Search completed in 1.16 seconds.
Index - MDN Web Docs Glossary: Definitions of Web-related terms
2 404 glossary, http errors, infrastructure, navigation a 404 is a standard response code meaning that the server cannot find the requested resource. ...
... 2 404 glossary, http errors, infrastructure, navigation a 404 is a standard response code meaning that the server cannot find the requested resource. ...
...design and implementation in complex software systems. it hides the technical complexity of systems behind simpler apis. 11 accessibility accessibility, glossary web accessibility (a11y) refers to best practices for keeping a website usable despite physical and technical restrictions. web accessibility is formally defined and discussed at the w3c through the web accessibility
initiative (wai). 12 accessibility tree (aom) aom, accessibility, dom, glossary, reference the accessibility tree, or accessibility object model (aom), contains accessibility-related information for most html elements. 13 adobe flash adobe, codingscripting, flash, glossary, infrastructure flash is an obsolescent technology developed by adobe for viewing expres...
...And 18 more matches
FC_Initialize
destroymutex should be null. lockmutex should be null. unlockmutex should be null. flags should be ckf_os_locking_ok. libraryparameters should point to a string that contains the library parameters. ...
... destroymutex should be null. lockmutex should be null. unlockmutex should be null. flags should be ckf_os_locking_ok. libraryparameters should point to a string that contains the library parameters. ...
... destroymutex should be null. lockmutex should be null. unlockmutex should be null. flags should be ckf_os_locking_ok. libraryparameters should point to a string that contains the library parameters. ...
...And 18 more matches
NSS_Initialize
name nss_
initialize -
initialize nss. syntax secstatus nss_
initialize(const char *configdir, const char *certprefix, const char *keyprefix, const char *secmodname, pruint32 flags); parameters nss_
initialize has five parameters: configdir [in] the directory where the certificate, key, and module databases live. to-do: document the "sql:" prefix. certprefix [in] prefix added to the beginning of the certificate database, for example, "https-server1-". keyprefix [in] prefix added to the beginning of the key database, for example, "https-server1-". secmodname [in] name of the security module database, usually "secmod.db". flags [in] bit flags that specify how nss should be
initialized. des...
...ive. to-do: document the "sql:" prefix. certprefix [in] prefix added to the beginning of the certificate database, for example, "https-server1-". keyprefix [in] prefix added to the beginning of the key database, for example, "https-server1-". secmodname [in] name of the security module database, usually "secmod.db". flags [in] bit flags that specify how nss should be
initialized. description nss_
initialize
initializes nss. it is more flexible than nss_
init, nss_
initreadwrite, and nss_nodb_
init. if any of those simpler nss
initialization functions suffices for your needs, call that instead. the flags parameter is a bitwise or of the following flags: nss_
init_readonly - open the databases read only. nss_
init_nocertdb - don't open the cert db and key db's, just
initialize the volatile certdb. n...
...ize
initializes nss. it is more flexible than nss_
init, nss_
initreadwrite, and nss_nodb_
init. if any of those simpler nss
initialization functions suffices for your needs, call that instead. the flags parameter is a bitwise or of the following flags: nss_
init_readonly - open the databases read only. nss_
init_nocertdb - don't open the cert db and key db's, just
initialize the volatile certdb. nss_
init_nomoddb - don't open the security module db, just
initialize the pkcs #11 module. nss_
init_forceopen - continue to force
initializations even if the databases cannot be opened. nss_
init_noroot
init - don't try to look for the root certs module automatically. nss_
init_optimizespace - optimize for space instead of speed. use smaller tables and caches. ...
...And 11 more matches
JS_InitClass
make a jsclass accessible to javascript code by creating its prototype, constructor, properties, and functions. syntax jsobject * js_
initclass(jscontext *cx, js::handleobject obj, js::handleobject parent_proto, const jsclass *clasp, jsnative constructor, unsigned nargs, const jspropertyspec *ps, const jsfunctionspec *fs, const jspropertyspec *static_ps, const jsfunctionspec *static_fs); 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. ...
...onspec *fs, const jspropertyspec *static_ps, const jsfunctionspec *static_fs); 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. ...
...s, const jsfunctionspec *static_fs); 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 pointer to the "globals" object to use for
initializing the class. this must not be null. ...
...And 11 more matches
NSS Sample Code Sample_2_Initialization of NSS
this program illustrates password handling. ...
... this program illustrates password handling. ...
...> [-p <plainpasswc>]" " [-f <passwdffile>]\n\n", progname); fprintf(stderr, "%-15s specify a db directory path\n\n", "-d <dbdirpath>"); fprintf(stderr, "%-15s specify a plaintext password\n\n", "-p <plainpasswc>"); fprintf(stderr, "%-15s specify a password file\n\n", "-f <plainpasswc>"); exit(-1); } /*
initialize the slot password */ char *
initslotpassword(pk11slotinfo *slot, prbool retry, void *arg) { file *input; file *output; char *p0 = null; char *p1 = null; secupwdata *pwdata = (secupwdata *) arg; if (pwdata->source == pw_fromfile) { return filepasswd(slot, retry, pwdata->data); } if (pwdata->source == pw_plain...
...And 9 more matches
Value definition syntax - CSS: Cascading Style Sheets
css value def
inition syntax, a formal grammar, is used for defining the set of valid values for a css property or function. in addition to this syntax, the set of valid values can be further restricted by semantic constraints (for example, for a number to be strictly positive). the def
inition syntax describes which values are allowed and the interactions between them. a component can be a keyword, some characters considered as a literal, or a value of a given css data type or of another css property. component value types keywords generic keywords a keyword with a predefined meaning appears literally, without quotation marks. for example: auto, smaller or ease-in. ...
...es which values are allowed and the interactions between them. a component can be a keyword, some characters considered as a literal, or a value of a given css data type or of another css property. component value types keywords generic keywords a keyword with a predefined meaning appears literally, without quotation marks. for example: auto, smaller or ease-in. the specific case of inherit,
initial and unset all css properties accept the keywords inherit,
initial and unset, that are defined throughout css. they are not shown in the value def
inition, and are implicitly defined. literals in css, a few characters can appear on their own, like the slash ('/') or the comma (','), and are used in a property def
inition to separate its parts. the comma is often used to separate values in enum...
...arts. the comma is often used to separate values in enumerations, or parameters in mathematical-like functions; the slash often separates parts of the value that are semantically different, but have a common syntax. typically, the slash is used in shorthand properties; to separate component that are of the same type, but belong to different properties. both symbols appear literally in a value def
inition. data types basic data types some kind of data are used throughout css, and are defined once for all values in the specification. called basic data types, they are represented with their name surrounded by the symbol '<' and '>': <angle>, <string>, … non-terminal data types less common data types, called non-terminal data types, are also surrounded by '<' and '>'. non-terminal data ty...
...And 9 more matches
Number.isFinite() - JavaScript
the number.isf
inite() method determines whether the passed value is a f
inite number. 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 number.isf
inite(value) parameters value the value to be tested for f
initeness. return value a boolean indicating whether or not the given value is a f
inite number. description in comparison to the global isf
inite() function, this method doesn't forcibly convert the parameter to a number. this means only values of the type number, that are also f
inite, return true. ...
...ber.isf
inite(value) parameters value the value to be tested for f
initeness. return value a boolean indicating whether or not the given value is a f
inite number. description in comparison to the global isf
inite() function, this method doesn't forcibly convert the parameter to a number. this means only values of the type number, that are also f
inite, return true. ...
... value the value to be tested for f
initeness. return value a boolean indicating whether or not the given value is a f
inite number. description in comparison to the global isf
inite() function, this method doesn't forcibly convert the parameter to a number. this means only values of the type number, that are also f
inite, return true. ...
...And 9 more matches
Initialize NSS database - sample 2
nss sample code 2:
initialize the nss database. the nss sample code below demonstrates how to
initialize the nss database. ...
...const char *progname) { fprintf(stderr, "\nusage: %s -d [-p ]" " [-f ]\n\n", progname); fprintf(stderr, "%-15s specify a db directory path\n\n", "-d "); fprintf(stderr, "%-15s specify a plaintext password\n\n", "-p "); fprintf(stderr, "%-15s specify a password file\n\n", "-f "); exit(-1); } /* *
initslotpassword */ char *
initslotpassword(pk11slotinfo *slot, prbool retry, void *arg) { file *input; file *output; char *p0 = null; char *p1 = null; secupwdata *pwdata = (secupwdata *) arg; if (pwdata->source == pw_fromfile) { return filepasswd(slot, retry, pwdata->data); } if (pwdata->source == pw_plaintext) { ...
...rg; if (pwdata->source == pw_fromfile) { return filepasswd(slot, retry, pwdata->data); } if (pwdata->source == pw_plaintext) { return pl_strdup(pwdata->data); } /* open terminal */ input = fopen("/dev/tty", "r"); if (input == null) { pr_fprintf(pr_stderr, "error opening input terminal for read\n"); return null; } /* we have no password, so
initialize database with one */ pr_fprintf(pr_stderr, "enter a password which will be used to encrypt your keys.\n" "the password should be at least 8 characters long,\n" "and should contain at least one non-alphabetic character.\n\n"); output = fopen("/dev/tty", "w"); if (output == null) { pr_fprintf(pr_stderr, "error opening output terminal for write\n"); ...
...And 8 more matches
initial-letter-align - CSS: Cascading Style Sheets
the
initial-letter-align css property specifies the alignment of
initial letters within a paragraph. /* keyword values */
initial-letter-align: auto;
initial-letter-align: alphabetic;
initial-letter-align: hanging;
initial-letter-align: ideographic; /* global values */
initial-letter-align: inherit;
initial-letter-align:
initial;
initial-letter-align: unset; syntax one of the keyword values listed below. values auto the user agent selects the value which corresponds to the language of the text. western languages would default to alphabetic, cjk languages to ideographic, and some indic languages to hanging. alphabetic as described above, the cap height of the
initial letter aligns with the cap height of the first line of text. ...
...tax one of the keyword values listed below. values auto the user agent selects the value which corresponds to the language of the text. western languages would default to alphabetic, cjk languages to ideographic, and some indic languages to hanging. alphabetic as described above, the cap height of the
initial letter aligns with the cap height of the first line of text. the baseline of the
initial letter aligns with the baseline of the nth text baseline. ...
...responds to the language of the text. western languages would default to alphabetic, cjk languages to ideographic, and some indic languages to hanging. alphabetic as described above, the cap height of the
initial letter aligns with the cap height of the first line of text. the baseline of the
initial letter aligns with the baseline of the nth text baseline. hanging the hanging baseline of the
initial letter aligns with the hanging baseline of the first line of text. ideographic the
initial letter is centered in the n-line area. ...
...And 8 more matches
isFinite() - JavaScript
the global isf
inite() function determines whether the passed value is a f
inite number. if needed, the parameter is first converted to a number. 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 isf
inite(testvalue) parameters testvalue the value to be tested for f
initeness. return value false if the argument is positive or negative inf
inity or nan or undefined; otherwise, true. description isf
inite is a top-level function and is not associated with any object. you can use this function to determine whether a number is a f
inite number. the isf
inite function examines the number in its argument. if the...
...lue to be tested for f
initeness. return value false if the argument is positive or negative inf
inity or nan or undefined; otherwise, true. description isf
inite is a top-level function and is not associated with any object. you can use this function to determine whether a number is a f
inite number. the isf
inite function examines the number in its argument. if the argument is nan, positive inf
inity, or negative inf
inity, this method returns false; otherwise, it returns true. ...
...or nan or undefined; otherwise, true. description isf
inite is a top-level function and is not associated with any object. you can use this function to determine whether a number is a f
inite number. the isf
inite function examines the number in its argument. if the argument is nan, positive inf
inity, or negative inf
inity, this method returns false; otherwise, it returns true. ...
...And 8 more matches
Object initializer - 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. ...
...or support for these notations. in non-supporting environments, these notations will lead to syntax errors. // shorthand property names (es2015) let a = 'foo', b = 42, c = {}; let o = {a, b, c} // shorthand method names (es2015) let o = { property(parameters) {} } // computed property names (es2015) let prop = 'foo' let o = { [prop]: 'hey', ['b' + 'ar']: 'there' } description an object
initializer is an expression that describes the
initialization of an object. objects consist of properties, which are used to describe an object. values of object properties can either contain primitive data types or other objects. object literal notation vs json the object literal notation is not the same as the javascript object notation (json). although they look similar, there are differences be...
...nitialization of an object. objects consist of properties, which are used to describe an object. values of object properties can either contain primitive data types or other objects. object literal notation vs json the object literal notation is not the same as the javascript object notation (json). although they look similar, there are differences between them: json permits only property def
inition using "property": value syntax. the property name must be double-quoted, and the def
inition cannot be a shorthand. in json the values can only be strings, numbers, arrays, true, false, null, or another (json) object. a function value (see "methods" above) can not be assigned to a value in json. objects like date will be a string after json.parse(). json.parse() will reject computed proper...
...And 8 more matches
Initialization and Destruction - Plugins
instance creation: the browser calls the plug-in api function npp_new when the instance is created. instance destruction: the plug-in instance is deleted when the user leaves the instance page or closes the instance window; the browser calls the function npp_destroy to tell the plug-in that the instance is being deleted. ...
...eaves the instance page or closes the instance window; the browser calls the function npp_destroy to tell the plug-in that the instance is being deleted. shutdown: when the last instance of a plug-in is deleted, the plug-in code is unloaded from memory and the browser calls the function np_shutdown. plug-ins consume no resources, other than disk space, if not referenced. ...
...the browser calls the function npp_destroy to tell the plug-in that the instance is being deleted. shutdown: when the last instance of a plug-in is deleted, the plug-in code is unloaded from memory and the browser calls the function np_shutdown. plug-ins consume no resources, other than disk space, if not referenced. this chapter ends with
initialize and shutdown example, which includes the np_
initialize and np_shutdown methods. ...
...And 7 more matches
NS_CStringContainerInit2
this parameter may be null. adatalength [in] an optional parameter that specifies the length of the array pointed to by adata. pass pr_uint32_max to indicate that adata's length may be determined by scanning the string for a terminating null. ...
...this parameter may be null. adatalength [in] an optional parameter that specifies the length of the array pointed to by adata. pass pr_uint32_max to indicate that adata's length may be determined by scanning the string for a terminating null. ...
...er
init2 function
initializes a nscstringcontainer instance for use as a nsacstring. #include "nsstringapi.h" nsresult ns_cstringcontainer
init2( nscstringcontainer& acontainer, const char* adata = nsnull, pruint32 adatalength = pr_uint32_max, pruint32 aflags = 0 ); parameters acontainer [in] the nscstringcontainer instance to
initialize. adata [in] an array of characters used to
initialize the string object. this parameter may be null. adatalength [in] an optional parameter that specifies the length of the array pointed to by adata. pass pr_uint32_max to indicate that adata's length may be determined by scanning the string for a terminating null. if adata is null, then this parameter is ignored. ...
...And 6 more matches
Event.initEvent() - Web APIs
bubbles is a boolean deciding whether the event should bubble up through the event chain or not. ...
... bubbles is a boolean deciding whether the event should bubble up through the event chain or not. ...
...ment.createevent() method. this method must be called to set the event before it is dispatched, using eventtarget.dispatchevent(). once dispatched, it doesn't do anything anymore. do not use this method anymore as it is deprecated. instead use specific event constructors, like event(). the page on creating and triggering events gives more information about the way to use these. syntax event.
initevent(type, bubbles, cancelable); type is a domstring defining the type of event. bubbles is a boolean deciding whether the event should bubble up through the event chain or not. once set, the read-only property event.bubbles will give its value. cancelable is a boolean defining whether the event can be canceled. once set, the read-only property event.cancelable will give its value. exam...
...And 6 more matches
XRInputSourcesChangeEventInit.added - Web APIs
the xrinputsourceschangeevent
init 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 xrinputsourceschangeevent
init 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. ...
...
init 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. ...
...And 6 more matches
XRInputSourcesChangeEventInit.removed - Web APIs
the xrinputsourceschangeevent
init property removed is an array of zero or more xrinputsource objects, each representing one input source which has been removed from the xrsession. ...
... the xrinputsourceschangeevent
init property removed is an array of zero or more xrinputsource objects, each representing one input source which has been removed from the xrsession. ...
... the xrinputsourceschangeevent
init property removed is an array of zero or more xrinputsource objects, each representing one input source which has been removed from the xrsession. ...
...And 6 more matches
initial - CSS: Cascading Style Sheets
the
initial css keyword applies the
initial (or default) value of a property to an element. it can be applied to any css property. this includes the css shorthand all, with which
initial can be used to restore all css properties to their
initial state. on inherited properties, the
initial value may be unexpected. you should consider using the inherit, unset, or revert keywords instead. ...
...al css keyword applies the
initial (or default) value of a property to an element. it can be applied to any css property. this includes the css shorthand all, with which
initial can be used to restore all css properties to their
initial state. on inherited properties, the
initial value may be unexpected. you should consider using the inherit, unset, or revert keywords instead. ...
...css property. this includes the css shorthand all, with which
initial can be used to restore all css properties to their
initial state. on inherited properties, the
initial value may be unexpected. you should consider using the inherit, unset, or revert keywords instead. examples using
initial to reset color for an element html <p> <span>this text is red.</span> <em>this text is in the
initial color (typically black).</em> <span>this is red again.</span> </p> css p { color: red; } em { color:
initial; } result specifications specification status comment css cascading and inheritance level 4the def
inition of '
initial' in that specification. candidate recommendation no changes from level 3. css cascading and inheritance level 3t...
...And 6 more matches
<dfn>: The Definition element - HTML: Hypertext Markup Language
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. content categories flow content, phrasing content, palpable content. permitted content phrasing content, but no <dfn> element must be a descendant. tag omission none, both the starting and ending tag are mandatory. ...
...eing defined. this is shown in the first example below. if the <dfn> element has a title attribute, it must contain the term being defined and no other text. links to <dfn> elements if you include an id attribute on the <dfn> element, you can then link to it using <a> elements. ...
...erm being defined and no other text. links to <dfn> elements if you include an id attribute on the <dfn> element, you can then link to it using <a> elements. such links should be uses of the term, with the intent being that the reader can quickly navigate to the term's def
inition if they're not already aware of it, by clicking on the term's link. this is shown in the example under links to def
initions below. examples let's take a look at some examples of various usage scenarios. ...
...And 6 more matches
initInstall - Archive of obsolete content
the name of the software is displayed to the user. ...
...the name of the software is displayed to the user. ...
...the name of the software is displayed to the user. ...
...And 5 more matches
UIEvent.initUIEvent() - Web APIs
canbubble is a boolean deciding whether the event should bubble up through the event chain or not. ...
...nt.createevent() method. this method must be called to set the event before it is dispatched, using eventtarget.dispatchevent(). once dispatched, it doesn't do anything anymore. do not use this method anymore as it is deprecated. instead use specific event constructors, like uievent(). the page on creating and triggering events gives more information about the way to use these. syntax event.
inituievent(type, canbubble, cancelable, view, detail) parameters type is a domstring defining the type of event. canbubble is a boolean deciding whether the event should bubble up through the event chain or not. once set, the read-only property event.bubbles will give its value. cancelable is a boolean defining whether the event can be canceled. once set, the read-only property event.cancel...
...owproxy associated with the event. detail is an unsigned long specifying some detail information about the event, depending on the type of event. for mouse events, it indicates how many times the mouse has been clicked on a given screen location. example var e = document.createevent("uievent"); // creates a click event that bubbles, can be cancelled, // and with its view and detail property
initialized to window and 1, // respectively e.
inituievent("click", true, true, window, 1); specifications specification status comment document object model (dom) level 3 events specificationthe def
inition of 'uievent.
inituievent()' in that specification. obsolete from document object model (dom) level 2 events specification, deprecated. document object model...
...And 5 more matches
Hoisting - MDN Web Docs Glossary: Definitions of Web-related terms
hoisting is a term you will not find used in any normative specification prose prior to ecmascript® 2015 language specification. hoisting was thought up as a general way of thinking about how execution contexts (specifically the creation and execution phases) work in javascript. however, the concept can be a little confusing at first. conceptually, for example, a strict def
inition of hoisting suggests that variable and function declarations are physically moved to the top of your code, but this is not in fact what happens. instead, the variable and function declarations are put into memory during the compile phase, but stay exactly where you typed them in your code. learn more technical example one of the advantages of javascript putting function declarations into memory before it...
...tname("chloe"); function catname(name) { console.log("my cat's name is " + name); } /* the result of the code above is: "my cat's name is chloe" */ even though we call the function in our code first, before the function is written, the code still works. this is because of how context execution works in javascript. hoisting works well with other data types and variables. ...
...s: "my cat's name is chloe" */ even though we call the function in our code first, before the function is written, the code still works. this is because of how context execution works in javascript. hoisting works well with other data types and variables. the variables can be
initialized and used before they are declared. only declarations are hoisted javascript only hoists declarations, not
initializations. if a variable is declared and
initialized after using it, the value will be undefined. for example: console.log(num); // returns undefined, as only declaration was hoisted, no
initialization has happened at this stage var num; // declaration num = 6; //
initialization the example below only has
initialization. no hoisting happens so trying to read the variable results in referenceer...
...And 4 more matches
NSC_InitToken
name nsc_
inittoken() -
initialize or re-
initialize a token. syntax ck_rv nsc_
inittoken( ck_slot_id slotid, ck_char_ptr ppin, ck_ulong ulpinlen, ck_char_ptr plabel ); parameters nsc_
inittoken() has the following parameters: slotid the id of the token's slot ppin the password of the security officer (so) ulpinlen the length in bytes of the so password plabel points to the label of the token, which must be padded with spaces to 32 bytes and not be null-terminated description nsc_
inittoken()
initializes a brand new token or re-
initializes a token that was
initialized before. specifically, nsc_
inittoken()
initializes or clears the key database, removes the password, and then marks all the user certs in the certificate database as non-user certs. (user certs are the cer...
... ckr_slot_id_invalid: slot id is invalid. ckr_token_write_protected slot id is 1. (the non-fips mode has two slots: 1 and 2. the key database is in slot 2. ...
... ckr_slot_id_invalid: slot id is invalid. ckr_token_write_protected slot id is 1. (the non-fips mode has two slots: 1 and 2. the key database is in slot 2. ...
...And 4 more matches
NS_InitXPCOM3
you may pass null if you are not interested in this return value. the service manager may alternatively be accessed by calling ns_getservicemanager. ...
...you may pass null if you are not interested in this return value. the service manager may alternatively be accessed by calling ns_getservicemanager. ...
...be used by xpcom to locate application specific directories and files (e.g., the user profile, the component registry, etc.). this parameter may be nsnull. astaticmodules [in] an array of nsstaticmoduleinfo objects. passing null causes the default (built-in) static modules to be registered, if present. astaticmodulecount [in] the number of elements in astaticmodules. ...
...And 4 more matches
KeyboardEvent.initKeyEvent() - 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 keyboardevent.
initkeyevent() method is used to
initialize the value of an event created using document.createevent("keyboardevent"). events
initialized in this way must have been created with the document.createevent("keyboardevent") method.
initkeyevent() must be called to set the event before it is dispatched. do not use this method anymore, use the keyboardevent() constructor instead. this method is based on early drafts of document object model (dom) level 2 events specification and is i...
... created with the document.createevent("keyboardevent") method.
initkeyevent() must be called to set the event before it is dispatched. do not use this method anymore, use the keyboardevent() constructor instead. this method is based on early drafts of document object model (dom) level 2 events specification and is implemented in gecko-based browsers; other browsers implemented keyboardevent.
initkeyboardevent based on early drafts of document object model (dom) level 3 events specification. favor the modern constructor structure as the only cross-browser way of building events. ...
...instead. this method is based on early drafts of document object model (dom) level 2 events specification and is implemented in gecko-based browsers; other browsers implemented keyboardevent.
initkeyboardevent based on early drafts of document object model (dom) level 3 events specification. favor the modern constructor structure as the only cross-browser way of building events. syntax event.
initkeyevent (type, bubbles, cancelable, viewarg, ctrlkeyarg, altkeyarg, shiftkeyarg, metakeyarg, keycodearg, charcodearg) parameters type is a domstring representing the type of event. bubbles is a boolean indicating whether the event should bubble up through the event chain or not (see bubbles). cancelable is a boolean i indicating whether the event ...
...And 4 more matches
FC_InitToken
name fc_
inittoken() -
initialize or re-
initialize a token. syntax ck_rv fc_
inittoken( ck_slot_id slotid, ck_char_ptr ppin, ck_ulong ulpinlen, ck_char_ptr plabel ); parameters fc_
inittoken() has the following parameters: slotid the id of the token's slot ppin the password of the security officer (so) ulpinlen the length in bytes of the so password plabel points to the label of the token, which must be padded with spaces to 32 bytes and not be null-terminated description fc_
inittoken()
initializes a brand new token or re-
initializes a token that was
initialized before. specifically, fc_
inittoken()
initializes or clears the key database, removes the password, and then marks all the user certs in the certificate database as non-user certs. (user certs are the certific...
... fc_
inittoken()
initializes a brand new token or re-
initializes a token that was
initialized before. specifically, fc_
inittoken()
initializes or clears the key database, removes the password, and then marks all the user certs in the certificate database as non-user certs. (user certs are the certificates that have their associated private keys in the key database.) a user must be able to call fc_
inittoken() without logging into the token (to assume the nss user role) because either the user's password hasn't been set yet or the user forgets the password and needs to blow away the password-encrypted private key database and start over. note: the so password should be the empty string, i.e., ulpinlen argument should be 0. fc_
inittoken() ignores the plabel argument. ...
...fc_
inittoken() without logging into the token (to assume the nss user role) because either the user's password hasn't been set yet or the user forgets the password and needs to blow away the password-encrypted private key database and start over. note: the so password should be the empty string, i.e., ulpinlen argument should be 0. fc_
inittoken() ignores the plabel argument. return value fc_
inittoken() returns the following return codes. ckr_ok: token
initialization succeeded. ckr_slot_id_invalid: slot id is invalid. ckr_token_write_protected we don't have a reference to the key database (we failed to open the key database or we have released our reference). ckr_device_error: failed to reset the key database. ...
...And 3 more matches
JS_InitStandardClasses
initializes general js function and object classes, and the built-in object classes used in most scripts. syntax bool js_
initstandardclasses(jscontext *cx, js::handle<jsobject*> obj); name type description cx jscontext * pointer to the executable script context for which to
initialize js function and object classes. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handle<jsobject*> the global object to
initialize. this object must be of a jsclass that has the jsclass_global_flags bits set. description js_
initstandardclasses
initializes the built-in javascript global properties. these include all the standard ecmascript global properties defined in ecma 262-3 §15.1: array,...
...nitialize. this object must be of a jsclass that has the jsclass_global_flags bits set. description js_
initstandardclasses
initializes the built-in javascript global properties. these include all the standard ecmascript global properties defined in ecma 262-3 §15.1: array, boolean, date, decodeuri, decodeuricomponent, encodeuri, encodeuricomponent, error, eval, evalerror, function, inf
inity, isnan, isf
inite, math, nan, number, object, parseint, parsefloat, rangeerror, referenceerror, regexp, string, syntaxerror, typeerror, undefined, and urierror as well as a few spidermonkey-specific globals, depending on compile-time options: escape, unescape, uneval, internalerror, script, xml, namespace, qname, file, generator, iterator, and stopiteration, as of spidermonkey 1.7. these g...
...ng, syntaxerror, typeerror, undefined, and urierror as well as a few spidermonkey-specific globals, depending on compile-time options: escape, unescape, uneval, internalerror, script, xml, namespace, qname, file, generator, iterator, and stopiteration, as of spidermonkey 1.7. these global objects, functions, constructors, and constants are created as properties of obj. ...
...And 3 more matches
DOMPointInit.z - Web APIs
the dompoint
init dictionary's z property is used to specify the z-coordinate of a point in 2d or 3d space when either creating or serializing to json a dompoint or dompointreadonly object. typically, a z value of 0 represents the plane of the screen. as the value increases, the point moves outward from the screen toward the user. as the value decreases, the point moves farther from the user, with negative values being behind the screen, receding into the distance. of course, if transforms have been applied, the axes may have changed orientation. syntax var dompoint
init = { z: zpos }; dompoint
init.z = zpos; var zpos = dompoint
init.z; value a double-precision floating-point value indicating the point's z-coordinate. ...
...th negative values being behind the screen, receding into the distance. of course, if transforms have been applied, the axes may have changed orientation. syntax var dompoint
init = { z: zpos }; dompoint
init.z = zpos; var zpos = dompoint
init.z; value a double-precision floating-point value indicating the point's z-coordinate. this value is unrestricted, meaning that it is allowed to be inf
inite or invalid (that is, its value may be nan or ±inf
inity). there are two methods which use dompoint
init: the static function dompointreadonly.frompoint() takes an object that complies with dompoint
init as its sole input parameter, to specify the coordinates and perspective value of the new point to be created. this method is, by inheritance, also available as dompoint.frompoint(). the dompoi...
...r ±inf
inity). there are two methods which use dompoint
init: the static function dompointreadonly.frompoint() takes an object that complies with dompoint
init as its sole input parameter, to specify the coordinates and perspective value of the new point to be created. this method is, by inheritance, also available as dompoint.frompoint(). the dompointreadonly.tojson() method returns a dompoint
init object that describes the same point as the original point. by inheritance, this method is also available as dompoint.tojson(). if this property is missing when the dompoint
init object is passed into frompoint(), the value is assumed to be 0 by default. ...
...And 3 more matches
NS_InitXPCOM2
you may pass null if you are not interested in this return value. the service manager may alternatively be accessed by calling ns_getservicemanager. the resulting interface pointer is addref'd upon return and must either be release'd explicitly or passed to ns_shutdownxpcom when the application is finished with xpcom. ...
... xpcom. abindirectory [in] the directory containing the component registry and runtime libraries. pass null to specify that the current working directory should be used. aappfilelocationprovider [in] the object to be used by xpcom to locate application specific directories and files (e.g., the user profile, the component registry, etc.). this parameter may be nsnull. ...
...ctory should be used. aappfilelocationprovider [in] the object to be used by xpcom to locate application specific directories and files (e.g., the user profile, the component registry, etc.). this parameter may be nsnull. return values the ns_
initxpcom2 function returns ns_ok if successful. otherwise, it returns an error code. some of the possible errors are documented below: ns_error_not_
initialized indicates that static globals were not yet
initialized, which may happen if this method is called before xpcom's static
initialization code executes. this error may also occur if xpcom is being
initialized after ns_shutdownxpcom has been called. remarks you must call ns_
initxpcom2 (or ns_
initxpcom3) before proceeding to use xpcom in a process. the one exception is that you may call ns_...
...And 2 more matches
DOMPointInit.y - Web APIs
the dompoint
init dictionary's y property is used to specify the y-coordinate of a point in 2d or 3d space when either creating or serializing to json a dompoint or dompointreadonly object. in general, the value of y increases to the right and decreases to the left, becoming negative to the left of the origin. this may change if transforms have been applied causing the axes' orientation to change. syntax var dompoint
init = { y: ypos }; dompoint
init.y = ypos; var ypos = dompoint
init.y; value a double-precision floating-point value indicating the point's y-coordinate. this value is unrestricted, meaning that it is allowed to be inf
inite or invalid (that is, its value may be nan or ±inf
inity). ...
...lied causing the axes' orientation to change. syntax var dompoint
init = { y: ypos }; dompoint
init.y = ypos; var ypos = dompoint
init.y; value a double-precision floating-point value indicating the point's y-coordinate. this value is unrestricted, meaning that it is allowed to be inf
inite or invalid (that is, its value may be nan or ±inf
inity). if this property is missing when the dompoint
init object is passed into frompoint(), the value is assumed to be 0 by default. there are two methods which use dompoint
init: the static function dompointreadonly.frompoint() takes an object that complies with dompoint
init as its sole input parameter, to specify the coordinates and perspective value of the new point to be created. this method is, by inheritance, also available as dompoint.frompoi...
... 0 by default. there are two methods which use dompoint
init: the static function dompointreadonly.frompoint() takes an object that complies with dompoint
init as its sole input parameter, to specify the coordinates and perspective value of the new point to be created. this method is, by inheritance, also available as dompoint.frompoint(). the dompointreadonly.tojson() method returns a dompoint
init object that describes the same point as the original point. by inheritance, this method is also available as dompoint.tojson(). specifications specification status comment geometry interfaces module level 1the def
inition of 'y' in that specification. ...
...And 2 more matches
DOMPointInit - Web APIs
the dompoint
init dictionary is used to provide the values of the coordinates and perspective when creating and jsonifying a dompoint or dompointreadonly object. it's used as an input parameter to the dompoint/dompointreadonly method frompoint(). it's used as the return value when calling tojson(). properties dompoint
init.x an unrestricted floating-point value indicating the x-coordinate of the point in space. this is generally the horizontal coordinate, with positive values being to the right and negative values to the left. the default value is 0. dompoint
init.y an unrestricted floating-point number providing the point's y-coordinate. this is the vertical coordinate, and barring any transforms applied to the coordinate system, positive values are downward and negative values upward t...
...ate, with positive values being to the right and negative values to the left. the default value is 0. dompoint
init.y an unrestricted floating-point number providing the point's y-coordinate. this is the vertical coordinate, and barring any transforms applied to the coordinate system, positive values are downward and negative values upward toward the top of the screen. the default is 0. dompoint
init.z an unrestricted floating-point value which gives the point's z-coordinate, which is (assuming no transformations that alter the situation) the depth coordinate; positive values are closer to the user and negative values retreat back into the screen. the default value is 0. dompoint
init.w the point's w perspective value, given as an unrestricted floating-point number. the default is 1. exam...
...omponent added to move the point closer to the user. ...
...And 2 more matches
XRInputSourceEventInit.inputSource - Web APIs
the new object's inputsource will be set to this value. ...
...the new object's inputsource will be set to this value. ...
...the new object's inputsource will be set to this value. ...
...And 2 more matches
XRInputSourcesChangeEventInit.session - Web APIs
the xrinputsourceschangeevent
init property session specifies the xrsession to which the input source list change event applies. syntax let inputsourcesevent
init = { session: xrsession, added: [newdevice1, ..., newdevicen], removed: [removeddevice1, ..., newdevicen], }; myinputsourceschangeevent = new xrinputsourceschangeevent
init("inputsourceschange", inputsourcesevent
init); myinputsourceschangeevent = new xrinputsourceschangeevent
init("inputsourceschange", { session: xrsession, added: addeddevicelist, removed: removeddevicelist }); value an xrsession indicating the webxr session to which the input source list change applies. specifica...
... ...
... ...
...And 2 more matches
XRWebGLLayerInit.antialias - Web APIs
the boolean antialias property, if present and set to true in the xrwebgllayer
init object provided as the xrwebgllayer() constructor's layer
init parameter, requests that the new webgl rendering layer support anti-aliasing. if this property is missing or is false, anti-aliasing is not desired. there is no way to request a specific anti-aliasing format or level; this decision is left up to the user agent. syntax let layer
init = { antialias: boolvalue }; let gllayer = new xrwebgllayer(xrsession, gl, layer
init); let gllayer = new xrwebgllayer(xrsession, gl, { antialias: boolvalue }); value a boolean value which can be set to true to request anti-aliasing support in the new webgl rendering layer. if false, anti-aliasing is not desired. usage notes the state of anti-aliasing for the co...
... ...
... ...
...And 2 more matches
XRWebGLLayerInit.framebufferScaleFactor - Web APIs
for example, a value of 1.0 indicates that the frame buffer should be the same resolution as the actual display, while a value of 0.5 indicates that the frame buffer should be half the resolution of the display. a value of 2.0, on the other hand, creates a frame buffer whose resolution is double that of the actual display buffer. there are valid use cases for all of these kinds of scaling. ...
...ution is double that of the actual display buffer. there are valid use cases for all of these kinds of scaling. see managing rendering quality in webxr performance guide for more information. you can determine the scaling factor that you would need to apply to match the default frame buffer resolution by using the xrwebgllayer.getnativeframebufferscalefactor() static function. syntax let layer
init = { framebufferscalefactor: scalefactor }; let gllayer = new xrwebgllayer(xrsession, gl, layer
init); let gllayer = new xrwebgllayer(xrsession, gl, { framebufferscalefactor: scalefactor }); value a floating-point value indicating a multiplier to apply to the default frame buffer resolution in order to determine the resolution of the frame buffer for the xrwebgllayer. example in this exampl...
... ...
...And 2 more matches
ReferenceError: can't access lexical declaration`X' before initialization - JavaScript
this happens within any block statement, when let or const declarations are accessed before they are defined. ...
...this happens within any block statement, when let or const declarations are accessed before they are defined. ...
...this happens within any block statement, when let or const declarations are accessed before they are defined. ...
...And 2 more matches
TypeError: Reduce of empty array with no initial value - JavaScript
the javascript exception "reduce of empty array with no
initial value" occurs when a reduce function is used. message typeerror: reduce of empty array with no
initial value error type typeerror what went wrong? in javascript, there are several reduce functions: array.prototype.reduce(), array.prototype.reduceright() and typedarray.prototype.reduce(), typedarray.prototype.reduceright()). these functions optionally take an
initialvalue (which will be used as the first argument to the first call of 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 appea...
... 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.getelementsbyclassname("names"); var name_list = array.prototype.reduce.c...
...lements 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.getelementsbyclassname("names"); var name_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. ...
...And 2 more matches
Number.NEGATIVE_INFINITY - JavaScript
the number.negative_inf
inity property represents the negative inf
inity 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. property attributes of number.negative_inf
inity writable no enumerable no configurable no description the value of number.negative_inf
inity is the same as the negative value of the global object's inf
inity property. this value behaves slightly differently than mathematical inf
inity: any positive value, including positive_inf
inity, multiplied by negative_inf
inity is negative_inf
inity. any neg...
... no configurable no description the value of number.negative_inf
inity is the same as the negative value of the global object's inf
inity property. this value behaves slightly differently than mathematical inf
inity: any positive value, including positive_inf
inity, multiplied by negative_inf
inity is negative_inf
inity. any negative value, including negative_inf
inity, multiplied by negative_inf
inity is positive_inf
inity. any positive value divided by negative_inf
inity is negative zero. any negative value divided by negative_inf
inity is positive zero. zero multiplied by negative_inf
inity is nan. nan multiplied by negative_inf
inity is nan. ...
...ty, multiplied by negative_inf
inity is negative_inf
inity. any negative value, including negative_inf
inity, multiplied by negative_inf
inity is positive_inf
inity. any positive value divided by negative_inf
inity is negative zero. any negative value divided by negative_inf
inity is positive zero. zero multiplied by negative_inf
inity is nan. nan multiplied by negative_inf
inity is nan. negative_inf
inity, divided by any negative value except negative_inf
inity, is positive_inf
inity. negative_inf
inity, divided by any positive value except positive_inf
inity, is negative_inf
inity. negative_inf
inity, divided by either negative_inf
inity or positive_inf
inity, is nan. you might use the number.negative_inf
inity property to indicate an error condition that returns a f
inite number in case of success. n...
...And 2 more matches
Number.POSITIVE_INFINITY - JavaScript
the number.positive_inf
inity property represents the positive inf
inity 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. property attributes of number.positive_inf
inity writable no enumerable no configurable no description the value of number.positive_inf
inity is the same as the value of the global object's inf
inity property. this value behaves slightly differently than mathematical inf
inity: any positive value, including positive_inf
inity, multiplied by positive_inf
inity is positive_inf
inity. any negative val...
...erable no configurable no description the value of number.positive_inf
inity is the same as the value of the global object's inf
inity property. this value behaves slightly differently than mathematical inf
inity: any positive value, including positive_inf
inity, multiplied by positive_inf
inity is positive_inf
inity. any negative value, including negative_inf
inity, multiplied by positive_inf
inity is negative_inf
inity. any positive number divided by positive_inf
inity is positive zero. any negative number divided by positive_inf
inity is negative zero. zero multiplied by positive_inf
inity is nan. nan multiplied by positive_inf
inity is nan. ...
..., multiplied by positive_inf
inity is positive_inf
inity. any negative value, including negative_inf
inity, multiplied by positive_inf
inity is negative_inf
inity. any positive number divided by positive_inf
inity is positive zero. any negative number divided by positive_inf
inity is negative zero. zero multiplied by positive_inf
inity is nan. nan multiplied by positive_inf
inity is nan. positive_inf
inity, divided by any negative value except negative_inf
inity, is negative_inf
inity. positive_inf
inity, divided by any positive value except positive_inf
inity, is positive_inf
inity. positive_inf
inity, divided by either negative_inf
inity or positive_inf
inity, is nan. you might use the number.positive_inf
inity property to indicate an error condition that returns a f
inite number in case of success. n...
...And 2 more matches
JS_GetPositiveInfinityValue
retrieve a floating-point inf
inity as a value of type js::value. syntax // added in spidermonkey 42 js::value js_getpositiveinf
inityvalue(jscontext *cx); js::value js_getnegativeinf
inityvalue(jscontext *cx); // obsolete since spidermonkey 42 jsval js_getpositiveinf
inityvalue(jscontext *cx); jsval js_getnegativeinf
inityvalue(jscontext *cx); name type description cx jscontext * a context. description js_getpositiveinf
inityvalue returns a js::value that represents an ieee floating-point positive inf
inity. js_getnegativeinf
inityvalue returns the corresponding negative inf
inity. inf
inities are typically used to represent numbers that are greater in magnitude than the greatest representable f
inite values. as a value in mathematical calculations, an in...
...scontext * a context. description js_getpositiveinf
inityvalue returns a js::value that represents an ieee floating-point positive inf
inity. js_getnegativeinf
inityvalue returns the corresponding negative inf
inity. inf
inities are typically used to represent numbers that are greater in magnitude than the greatest representable f
inite values. as a value in mathematical calculations, an inf
inite value behaves like inf
inity. for example, any nonzero value multiplied by inf
inity is inf
inity with the expected sign, and any f
inite value divided by inf
inity is zero (again with the expected sign). to get a floating-point nan, use js_getnanvalue. ...
...e than the greatest representable f
inite values. as a value in mathematical calculations, an inf
inite value behaves like inf
inity. for example, any nonzero value multiplied by inf
inity is inf
inity with the expected sign, and any f
inite value divided by inf
inity is zero (again with the expected sign). to get a floating-point nan, use js_getnanvalue. ...
.... as a value in mathematical calculations, an inf
inite value behaves like inf
inity. for example, any nonzero value multiplied by inf
inity is inf
inity with the expected sign, and any f
inite value divided by inf
inity is zero (again with the expected sign). to get a floating-point nan, use js_getnanvalue. ...
JS_Init
this article covers features introduced in spidermonkey 31
initializes the js engine so that further operations can be performed. syntax #include "js/
initialization.h" // previously "jsapi.h" bool js_
init(void); description
initialize spidermonkey, returning true only if
initialization succeeded. once this method has succeeded, it is safe to call js_newruntime and other jsapi methods. this method must be called before any other jsapi method is used on any thread. once it has been used, it is safe to call any jsapi method, and it remains safe to do so until js_shutdown is correctly called. it is currently not possible to
initialize spidermonkey multiple times (that is, calling js_
init, jsapi methods, then js_shutdown in that order, then doing so again). this restriction may ev...
...ny other jsapi method is used on any thread. once it has been used, it is safe to call any jsapi method, and it remains safe to do so until js_shutdown is correctly called. it is currently not possible to
initialize spidermonkey multiple times (that is, calling js_
init, jsapi methods, then js_shutdown in that order, then doing so again). this restriction may eventually be lifted. ...
.... once it has been used, it is safe to call any jsapi method, and it remains safe to do so until js_shutdown is correctly called. it is currently not possible to
initialize spidermonkey multiple times (that is, calling js_
init, jsapi methods, then js_shutdown in that order, then doing so again). this restriction may eventually be lifted. ...
...nitialize spidermonkey multiple times (that is, calling js_
init, jsapi methods, then js_shutdown in that order, then doing so again). this restriction may eventually be lifted. in the past js_
init once had the signature jsruntime * js_
init(uint32_t maxbytes) and was used to create new jsruntime instances. this meaning has been removed; use js_newruntime instead. ...
CustomEvent.initCustomEvent() - Web APIs
the customevent.
initcustomevent() method
initializes a customevent object. if the event has already been dispatched, this method does nothing. events
initialized in this way must have been created with the document.createevent() method. this method must be called to set the event before it is dispatched, using eventtarget.dispatchevent(). once dispatched, it doesn't do anything anymore. do not use this method anymore, as it is deprecated. note: rather than using the feature, instead use specific event constructors, like customevent(). the page on creating and triggering events gives more information about the way to use those. syntax event.
initcustomevent(type, canbubble, cancelable, detail); parameters type is a domstring containing the name of the event. canbubble is a boolea...
... triggering events gives more information about the way to use those. syntax event.
initcustomevent(type, canbubble, cancelable, detail); parameters type is a domstring containing the name of the event. canbubble is a boolean indicating whether the event bubbles up through the dom or not. cancelable is a boolean indicating whether the event is cancelable. detail the data passed when
initializing the event. specifications specification status comment domthe def
inition of 'customevent' in that specification. ...
...ntaining the name of the event. canbubble is a boolean indicating whether the event bubbles up through the dom or not. cancelable is a boolean indicating whether the event is cancelable. detail the data passed when
initializing the event. ...
...e name of the event. canbubble is a boolean indicating whether the event bubbles up through the dom or not. cancelable is a boolean indicating whether the event is cancelable. detail the data passed when
initializing the event. ...
DOMPointInit.w - Web APIs
the dompoint
init dictionary's w property is used to specify the w perspective value of a point in space when either creating or serializing to json a dompoint or dompointreadonly object. syntax var dompoint
init = { w: wperspective }; dompoint
init.w = wperspective; var wperspective = dompoint
init.w; value a double-precision floating-point value indicating the point's w perspective value. this value is unrestricted, meaning that it is allowed to be inf
inite or invalid (that is, its value may be nan or ±inf
inity). there are two methods which use dompoint
init: the static function dompointreadonly.frompoint() takes an object that complies with dompoint
init as its sole input parameter, to specify the coordinates and perspective value of the new point to be created. this method is, by i...
...r ±inf
inity). there are two methods which use dompoint
init: the static function dompointreadonly.frompoint() takes an object that complies with dompoint
init as its sole input parameter, to specify the coordinates and perspective value of the new point to be created. this method is, by inheritance, also available as dompoint.frompoint(). the dompointreadonly.tojson() method returns a dompoint
init object that describes the same point as the original point. by inheritance, this method is also available as dompoint.tojson(). this value is assumed to be 1 by default if not included in the dompoint
init object passed into frompoint(). specifications specification status comment geometry interfaces module level 1the def
inition of 'w' in that specification. candidat...
...es the same point as the original point. by inheritance, this method is also available as dompoint.tojson(). this value is assumed to be 1 by default if not included in the dompoint
init object passed into frompoint(). ...
... point as the original point. by inheritance, this method is also available as dompoint.tojson(). this value is assumed to be 1 by default if not included in the dompoint
init object passed into frompoint(). ...
DOMPointInit.x - Web APIs
the dompoint
init dictionary's x property is used to specify the x component of a point in 2d or 3d space when either creating or serializing a dompoint or dompointreadonly. in general, positive values x mean to the right, and negative values of x means to the left, assuming that transforms have not altered the orientation of the axes. syntax var dompoint
init = { x: xpos }; dompoint
init.x = xpos; var xpos = dompoint
init.x; value a double-precision floating-point value indicating the point's x coordinate. this value is unrestricted, meaning that it is allowed to be inf
inite or invalid (that is, its value may be nan or ±inf
inity). if this property is missing when the dompoint
init object is passed into frompoint(), the value is assumed to be 0 by default. ...
...dompoint
init.x = xpos; var xpos = dompoint
init.x; value a double-precision floating-point value indicating the point's x coordinate. this value is unrestricted, meaning that it is allowed to be inf
inite or invalid (that is, its value may be nan or ±inf
inity). if this property is missing when the dompoint
init object is passed into frompoint(), the value is assumed to be 0 by default. dompoint
init is used as an input when calling either dompointreadonly.frompoint() or dompoint.frompoint(), and is returned by the dompointreadonly.tojson() and dompoint.tojson() methods. specifications specification status comment geometry interfaces module level 1the def
inition of 'x' in that specification. ...
... is assumed to be 0 by default. dompoint
init is used as an input when calling either dompointreadonly.frompoint() or dompoint.frompoint(), and is returned by the dompointreadonly.tojson() and dompoint.tojson() methods. specifications specification status comment geometry interfaces module level 1the def
inition of 'x' in that specification. ...
... to be 0 by default. dompoint
init is used as an input when calling either dompointreadonly.frompoint() or dompoint.frompoint(), and is returned by the dompointreadonly.tojson() and dompoint.tojson() methods. specifications specification status comment geometry interfaces module level 1the def
inition of 'x' in that specification. ...
MouseEvent.initMouseEvent() - Web APIs
the mouseevent.
initmouseevent() method
initializes the value of a mouse event once it's been created (normally using the document.createevent() method). events
initialized in this way must have been created with the document.createevent() method. this method must be called to set the event before it is dispatched, using eventtarget.dispatchevent(). once dispatched, it doesn't do anything anymore. do not use this method anymore as it is deprecated. instead use specific event constructors, like mouseevent(). the page on creating and triggering events gives more information about the way to use these. ...
...createevent() method. this method must be called to set the event before it is dispatched, using eventtarget.dispatchevent(). once dispatched, it doesn't do anything anymore. do not use this method anymore as it is deprecated. instead use specific event constructors, like mouseevent(). the page on creating and triggering events gives more information about the way to use these. syntax event.
initmouseevent(type, canbubble, cancelable, view, detail, screenx, screeny, clientx, clienty, ctrlkey, altkey, shiftkey, metakey, button, relatedtarget); parameters type the string to set the event's type to. possible types for mouse events include: click, mousedown, mouseup, mouseover, mousemove, mouseout. canbubble whether or not ...
...ss null. example html <div style="background:red; width:180px; padding:10px;"> <div id="out"></div> <input type="text"> </div> javascript document.body.onclick = function(){ e = arguments[0]; var dt = e.target,stag = dt.tagname.tolowercase(); document.getelementbyid("out").innerhtml = stag; }; var simulateclick = function(){ var evt = document.createevent("mouseevents"); evt.
initmouseevent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null); document.body.dispatchevent(evt); } simulateclick(); result specifications specification status comment document object model (dom) level 3 events specificationthe def
inition of 'mouseevent.
initmouseevent()' in that specification. obsolete from document object model...
...ent(evt); } simulateclick(); result specifications specification status comment document object model (dom) level 3 events specificationthe def
inition of 'mouseevent.
initmouseevent()' in that specification. obsolete from document object model (dom) level 2 events specification, deprecated. document object model (dom) level 2 events specificationthe def
inition of 'mouseevent.
initmouseevent()' in that specification. obsolete
initial def
inition. ...
RTCTrackEventInit.transceiver - Web APIs
note: the rtcrtpreceiver referred to by this rtcrtpreceiver's receiver property will always be the same as the rtctrackevent's receiver property. ...
... note: the rtcrtpreceiver referred to by this rtcrtpreceiver's receiver property will always be the same as the rtctrackevent's receiver property. ...
... note: the rtcrtpreceiver referred to by this rtcrtpreceiver's receiver property will always be the same as the rtctrackevent's receiver property. ...
...properties which establish a single bidirectional srtp stream for use by the track associated with the rtctrackevent. note: the rtcrtpreceiver referred to by this rtcrtpreceiver's receiver property will always be the same as the rtctrackevent's receiver property. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtctrackevent
init.transceiver' in that specification. candidate recommendation
initial specification. ...
XRWebGLLayerInit - Web APIs
properties alpha optional the frame buffer's color buffer will be established with an alpha channel if the alpha boolean property is true. otherwise, the color buffer will not have an alpha channel. the default value is true. antialias optional a boolean value which is true if anti-aliasing is to be used when rendering in the context; otherwise false. the browser selects the anti-aliasing method to use; there is no support for requesting a specific mode yet. ...
... ...
... ...
... for distance information of any given point is its position relative to the viewer. const layeroptions = { ignoredepthvalues: true }; xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl, layeroptions); }); specifications specification status comment webxr device apithe def
inition of 'xrwebgllayer
init' in that specification. working draft
initial def
inition. ...
Method definitions - JavaScript
it is a shorthand for a function assigned to the method's name. 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. ...
... // ... } } you are now able to shorten this to: const obj = { foo() { // ... }, bar() { // ... } } generator methods generator methods can be defined using the shorthand syntax as well. when doing so: the asterisk (*) in the shorthand syntax must be before the generator property name. (that is, * g(){} will work, but g *(){} will not.) non-generator method def
initions cannot contain the yield keyword. this means that legacy generator functions won't work either, and will throw a syntaxerror. always use yield in conjunction with the asterisk (*). // using a named property const obj2 = { g: function* () { let index = 0 while (true) { yield index++ } } }; // the same object using shorthand syntax const obj2 = { * g() { let ind...
... await some_promise } } // the same object using shorthand syntax const obj3 = { async f() { await some_promise } } async generator methods generator methods can also be async. const obj4 = { f: async function* () { yield 1 yield 2 yield 3 } }; // the same object using shorthand syntax const obj4 = { async* f() { yield 1 yield 2 yield 3 } } method def
initions are not constructable methods cannot be constructors! they will throw a typeerror if you try to instantiate them. const obja = { method() {} } new obja.method // typeerror: obj.method is not a constructor const objb = { * g() {} } new objb.g // typeerror: obj.g is not a constructor (changed in es2016) examples simple test case const obj = { a: 'foo', b() { return this.a ...
...ed property names. const bar = { foo0: function() { return 0 }, foo1() { return 1 }, ['foo' + 2]() { return 2 } } console.log(bar.foo0()) // 0 console.log(bar.foo1()) // 1 console.log(bar.foo2()) // 2 // a global function function foo() { return 1 } let name = 'foo' console.log(window[name]()) // 1 specifications specification ecmascript (ecma-262)the def
inition of 'method def
initions' in that specification. ...
Infinity - JavaScript
the global property inf
inity is a numeric value representing inf
inity. property attributes of inf
inity writable no enumerable no configurable no 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. description inf
inity is a property of the global object. in other words, it is a variable in global scope. the
initial value of inf
inity is number.positive_inf
inity. the value inf
inity (positive inf
inity) is greater than any other number. ...
...s project, please clone https://github.com/mdn/interactive-examples and send us a pull request. description inf
inity is a property of the global object. in other words, it is a variable in global scope. the
initial value of inf
inity is number.positive_inf
inity. the value inf
inity (positive inf
inity) is greater than any other number. this value behaves slightly differently than mathematical inf
inity; see number.positive_inf
inity for details. as defined by the ecmascript 5 specification, inf
inity is read-only (implemented in javascript 1.8.5 / firefox 4). ...
...le in global scope. the
initial value of inf
inity is number.positive_inf
inity. the value inf
inity (positive inf
inity) is greater than any other number. this value behaves slightly differently than mathematical inf
inity; see number.positive_inf
inity for details. as defined by the ecmascript 5 specification, inf
inity is read-only (implemented in javascript 1.8.5 / firefox 4). ...
...he
initial value of inf
inity is number.positive_inf
inity. the value inf
inity (positive inf
inity) is greater than any other number. this value behaves slightly differently than mathematical inf
inity; see number.positive_inf
inity for details. as defined by the ecmascript 5 specification, inf
inity is read-only (implemented in javascript 1.8.5 / firefox 4). examples using inf
inity console.log(inf
inity ); /* inf
inity */ console.log(inf
inity + 1 ); /* inf
inity */ console.log(math.pow(10, 1000)); /* inf
inity */ console.log(math.log(0) ); /* -inf
inity */ console.log(1 / inf
inity ); /* 0 */ console.log(1 / 0 ); /* inf
inity */ specifications specification ecmascript (ecma-262)the def
inition of 'inf
inity' in that specification. ...
Initialize the framework - Game development
game's html the html document structure is quite simple, as the game will be rendered entirely on the <canvas> element generated by the framework. ...
... far at this point we have a charset defined, <title> and some basic css in the header to reset the default margin and padding. we also have a <script> element to apply the phaser source code to the page. the body contains a second <script> element, where we will write the javascript code to render the game and control it. the <canvas> element is generated automatically by the framework. we are
initializing it by creating a new phaser.game object and assigning it to the game variable. the parameters are: the width and height to set the <canvas> to. the rendering method. the three options are auto, canvas and webgl. we can set one of the latter two explicitly or use auto to let phaser decide which one to use. it usually uses webgl if available in the browser, falling back to canvas 2d if ...
...e loop on every frame; we will use the same names to keep it clean. preload takes care of preloading the assets create is executed once when everything is loaded and ready update is executed on every frame. compare your code here's the full source code of the first lesson, running live in a jsfiddle: next steps now we've set up the basic html and learned a bit about phaser
initialization, let's continue to the second lesson and learn about scaling. « previousnext » ...
State machine - MDN Web Docs Glossary: Definitions of Web-related terms
ng to execute a transition. a transition is a set of actions to execute when a condition is fulfilled or an event received. in a state diagram, circles represent each possible state and arrows represent transitions between states. looking at the final state, you can discern something about the series of inputs leading to that state. ...
...tate, you can discern something about the series of inputs leading to that state. there are two types of basic state machines: deterministic f
inite state machine this kind allows only one possible transition for any allowed input. this is like the "if" statement in that if x == true then dothis else dothat is not possible. the computer must perform one of the two options. non-deterministic f
inite state machine given some state, an input can lead to more than one different state. . figure 1: deterministic f
inite state machine in figure 1, the state begins in state 1; the state changes to state 2 given input 'x', or to state 3 given input 'y'. figure 2: non-deterministic f
inite state machine in figure 2, given input 'x', the state can persist or change to state 2. note that any...
...gure 1: deterministic f
inite state machine in figure 1, the state begins in state 1; the state changes to state 2 given input 'x', or to state 3 given input 'y'. figure 2: non-deterministic f
inite state machine in figure 2, given input 'x', the state can persist or change to state 2. note that any regular expression can be represented by a state machine. ...
PR_Init
initializes the runtime. syntax #include <pr
init.h> void pr_
init( prthreadtype type, prthreadpriority priority, pruintn maxptds); parameters pr_
init has the following parameters: type this parameter is ignored. priority this parameter is ignored. maxptds this parameter is ignored. description nspr is now implicitly
initialized, usually by the first nspr function called by a program. pr_
init is necessary only if a program has specific
initialization-sequencing requirements. ...
...riority, pruintn maxptds); parameters pr_
init has the following parameters: type this parameter is ignored. priority this parameter is ignored. maxptds this parameter is ignored. description nspr is now implicitly
initialized, usually by the first nspr function called by a program. pr_
init is necessary only if a program has specific
initialization-sequencing requirements. ...
...ptds); parameters pr_
init has the following parameters: type this parameter is ignored. priority this parameter is ignored. maxptds this parameter is ignored. description nspr is now implicitly
initialized, usually by the first nspr function called by a program. pr_
init is necessary only if a program has specific
initialization-sequencing requirements. ...
PR_Initialize
returning from prmain leads to termination of the process. argc the length of the argument vector, whether passed in from the host's program-launching facility or fabricated by the actual main program. this approach conforms to standard c programming practice. ...
...returning from prmain leads to termination of the process. argc the length of the argument vector, whether passed in from the host's program-launching facility or fabricated by the actual main program. this approach conforms to standard c programming practice. ...
...'s program-launching facility or fabricated by the actual main program. this approach conforms to standard c programming practice. argv the base address of an array of strings that compromise the program's argument vector. this approach conforms to standard c programming practice. maxptds this parameter is ignored. returns the value returned from the root function, prmain. description pr_
initialize
initializes the nspr runtime and places nspr between the caller and the runtime library. this allows main to be treated like any other function, signaling its completion by returning and allowing the runtime to coordinate the completion of the other threads of the runtime. pr_
initialize does not return to its caller until all user threads have terminated. the priority of the main (or prim...
Process Initialization
this chapter describes the nspr api for versioning, process
initialization, and shutdown of nspr. identity and versioning
initialization and cleanup module
initialization identity and versioning name and version constants pr_name pr_version pr_versioncheck
initialization and cleanup nspr detects whether the library has been
initialized and performs implicit
initialization if it hasn't. implicit
initialization should suffice unless a program has specific sequencing requirements or needs to characterize the primordial thread. explicit
initialization is rarely necessary. implicit
initialization assumes that the
initiator is the primordial thread and that the thread is a user thread of normal priority. ...
...y has been
initialized and performs implicit
initialization if it hasn't. implicit
initialization should suffice unless a program has specific sequencing requirements or needs to characterize the primordial thread. explicit
initialization is rarely necessary. implicit
initialization assumes that the
initiator is the primordial thread and that the thread is a user thread of normal priority. pr_
init pr_
initialize pr_
initialized pr_cleanup pr_disableclockinterrupts pr_blockclockinterrupts pr_unblockclockinterrupts pr_setconcurrency pr_processexit pr_abort module
initialization
initialization can be tricky in a threaded environment, especially
initialization that must happen exactly once. pr_callonce ensures that such
initialization code is called only once. this facility is recomm...
...pr_disableclockinterrupts pr_blockclockinterrupts pr_unblockclockinterrupts pr_setconcurrency pr_processexit pr_abort module
initialization
initialization can be tricky in a threaded environment, especially
initialization that must happen exactly once. pr_callonce ensures that such
initialization code is called only once. this facility is recommended in situations where complicated global
initialization is required. prcalloncetype prcalloncefn pr_callonce ...
FC_InitPIN
name fc_
initpin() -
initialize the user's pin. syntax ck_rv fc_
initpin( ck_session_handle hsession, ck_char_ptr ppin, ck_ulong ulpinlen ); parameters fc_
initpin() takes three parameters: hsession[input] session handle. ppin[input] pointer to the pin being set. ulpinlen [input] length of the pin. description fc_
initpin()
initializes the normal user's pin. fc_
initpin() must be called when the pkcs #11 security officer (so) is logged into the token and the session is read/write, that is, the session must be in the "r/w so functions" state (cks_rw_so_functions). the role of the pkcs #11 so is to
initialize a token and to
initialize the normal user's pin. in the nss cryptographic module, one uses the empty string password ("") to log in as the pkcs #11 so. the module onl...
... ckr_session_handle_invalid: the session handle is invalid. ckr_user_not_logged_in: the session is not in the "r/w so functions" state. ckr_pin_invalid: the pin has an invalid utf-8 character. ...
...role of the pkcs #11 so is to
initialize a token and to
initialize the normal user's pin. in the nss cryptographic module, one uses the empty string password ("") to log in as the pkcs #11 so. the module only allows the pkcs #11 so to log in if the normal user's pin has not yet been set or has been reset. return value fc_
initpin() returns the following return codes. ckr_ok: normal user's pin
initialization succeeded. ckr_session_handle_invalid: the session handle is invalid. ckr_user_not_logged_in: the session is not in the "r/w so functions" state. ckr_pin_invalid: the pin has an invalid utf-8 character. ckr_pin_len_range: the pin is too short, too long, or too weak (doesn't have enough character types). ckr_device_error: normal user's pin is already
initialized. see also nsc_in...
NS_CStringContainerInit
« xpcom api reference summary the ns_cstringcontainer
init function
initializes a nscstringcontainer instance for use as a nsacstring. #include "nsstringapi.h" nsresult ns_cstringcontainer
init( nscstringcontainer& astring ); parameters astring [in] a nscstringcontainer instance to be
initialized. return values the ns_cstringcontainer
init function returns ns_ok if successful. otherwise, it returns an error code. remarks this function is equivalent to ns_cstringcontainer
init2(container, nsnull, 0, 0). the nscstringcontainer structure has private members that should not be accessed directly. ...
...in] a nscstringcontainer instance to be
initialized. return values the ns_cstringcontainer
init function returns ns_ok if successful. otherwise, it returns an error code. remarks this function is equivalent to ns_cstringcontainer
init2(container, nsnull, 0, 0). the nscstringcontainer structure has private members that should not be accessed directly. after a nscstringcontainer object has been
initialized via ns_cstringcontainer
init, it may be used as an ordinary nsacstring object. with ns_cstringcontainer
init, the coder is required to call ns_cstringcontainerfinish when done with the nscstringcontainer object. therefore, it is generally better to use nsembedcstring, to instantiate a nsacstring object, since it automatically releases allocated memory when the object goes out of scope. exa...
... // call this function to release any memory owned by |str| when done. ns_cstringcontainerfinish(str); } history this function was finalized for mozilla 1.7. see bug 239123 for details. ...
NS_StringContainerInit
« xpcom api reference summary the ns_stringcontainer
init function
initializes a nsstringcontainer instance for use as a nsastring. this is a low-level api. #include "nsstringapi.h" nsresult ns_stringcontainer
init( nsstringcontainer& astring ); parameters astring [in] a nsstringcontainer instance to be
initialized. return values the ns_stringcontainer
init function returns ns_ok if successful. otherwise, it returns an error code. remarks the nsstringcontainer structure has unspecified size and layout. its members may not be accessed directly. after a nsstringcontainer object has been
initialized, it may be used as an ordinary nsastring object. ...
...nit function returns ns_ok if successful. otherwise, it returns an error code. remarks the nsstringcontainer structure has unspecified size and layout. its members may not be accessed directly. after a nsstringcontainer object has been
initialized, it may be used as an ordinary nsastring object. the internal buffer allocated by a nsstringcontainer is always null-terminated. with ns_stringcontainer
init, the coder is required to call ns_stringcontainerfinish when done with the nsstringcontainer object. ...
... // be sure to call this function to release any memory owned by |str| when done. ns_stringcontainerfinish(str); } history this function was frozen for mozilla 1.7. see bug 239123 for details. ...
initDataTypes - Web APIs
the mediakeysystemconfiguration.
initdatatypes read-only property returns a list of supported
initialization data type names. an
initialization data type is a string indicating the format of the
initialization data. syntax var datatypes[] = mediasystemconfiguration.
initdatatypes; specifications specification status comment encrypted media extensionsthe def
inition of '
initdatatypes' in that specification. ...
...property returns a list of supported
initialization data type names. an
initialization data type is a string indicating the format of the
initialization data. syntax var datatypes[] = mediasystemconfiguration.
initdatatypes; specifications specification status comment encrypted media extensionsthe def
inition of '
initdatatypes' in that specification. ...
...turns a list of supported
initialization data type names. an
initialization data type is a string indicating the format of the
initialization data. syntax var datatypes[] = mediasystemconfiguration.
initdatatypes; specifications specification status comment encrypted media extensionsthe def
inition of '
initdatatypes' in that specification. ...
MutationObserverInit.attributeFilter - Web APIs
if this property is specified, there's no need to also set attributes to true, as it's implied. if the attributes permission is true but no attributefilter is included in the options object, all attributes' values are watched for changes. syntax var options = { attributefilter: [ "list", "of", "attribute", "names" ] } value an array of domstring objects, each specifying the name of one attribute whose value is to be monitored for changes. there is no default value. ...
... living standard ...
... living standard ...
MutationObserverInit.characterDataOldValue - Web APIs
character data changes are detectable on any text node, including nodes based on the text, processinginstruction, and comment interfaces. ...
... character data changes are detectable on any text node, including nodes based on the text, processinginstruction, and comment interfaces. ...
...as the target parameter when you called observe() are monitored. to watch for changes to the text contents of all descendants of target, set the subtree option to true. if you set characterdataoldvalue to true, characterdata is automatically assumed to be true, even if you don't expressly set it as such. example specifications specification status comment domthe def
inition of 'mutationobserver
init.characterdataoldvalue' in that specification. living standard ...
MutationObserverInit.subtree - Web APIs
the default value, false, indicates only the target node itself is to be monitored for changes. subtree can be used in concert with the other options to extend monitoring of attributes, text content, and child lists to the entire subtree rooted at the target node. syntax var options = { subtree: true | false } value a boolean value. the default, false, indicates that only the target node specified when calling mutationobserver.observe() is to be monitored for changes. changing this value to true causes the entire subtree rooted at the specified target node to be monitored for the changes indicated by the other options. ...
...ue a boolean value. the default, false, indicates that only the target node specified when calling mutationobserver.observe() is to be monitored for changes. changing this value to true causes the entire subtree rooted at the specified target node to be monitored for the changes indicated by the other options. ...
...er
init passed into mutationobserver() can be: var options = { attributes: true, subtree: false }; since the default value of subtree is false, line 3 is optional. to monitor the entire subtree for attribute changes, simply set subtree to true: var options = { attributes: true, subtree: true }; example specifications specification status comment domthe def
inition of 'mutationobserver
init.subtree' in that specification. living standard ...
MutationObserverInit - Web APIs
the default value is false. ...
...it's primarily used as the type of the options parameter on the mutationobserver.observe() method. properties at a minimum, one of childlist, attributes, and/or characterdata must be true when you call observe(). otherwise, a typeerror exception will be thrown. subtree optional set to true to extend monitoring to the entire subtree of nodes rooted at target. all of the other mutationobserver
init properties are then extended to all of the nodes in the subtree instead of applying solely to the target node. the default value is false. childlist optional set to true to monitor the target node (and, if subtree is true, its descendants) for the addition of new child nodes or removal of existing child nodes. the default value is false. attributes optional set to true to watch for changes to...
...dvalue is specified, otherwise the default value is false. characterdataoldvalue optional set to true to record the previous value of a node's text whenever the text changes on nodes being monitored. for details and an example, see monitoring text content changes in mutationobserver. the default value is false. specifications specification status comment domthe def
inition of 'mutationobserver
init' in that specification. living standard ...
PerformanceResourceTiming.initiatorType - Web APIs
the
initiatortype read-only property is a string that represents the type of resource that
initiated the performance event. the value of this string is as follows: if the
initiator is a element, the property returns the element's localname. if the
initiator is a css resource, the property returns "css". if the
initiator is a xmlhttprequest object, the property returns "xmlhttprequest". if the
initiator is a performancenavigationtiming object, the property returns an empty string (""). note: this feature is available in web workers. syntax resource.
initiatortype; return value a string representing the type of resource that
initiated the performance event, as specified above. example function print_performanceentries() { // use getentriesbytype() to just get the "resource" eve...
...his feature is available in web workers. syntax resource.
initiatortype; return value a string representing the type of resource that
initiated the performance event, as specified above. example function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_
initiatortype(p[i]); } } function print_
initiatortype(perfentry) { // print this performance entry object's
initiatortype value var value = "
initiatortype" in perfentry; if (value) console.log("...
initiatortype = " + perfentry.
initiatortype); else console.log("... ...
...resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_
initiatortype(p[i]); } } function print_
initiatortype(perfentry) { // print this performance entry object's
initiatortype value var value = "
initiatortype" in perfentry; if (value) console.log("...
initiatortype = " + perfentry.
initiatortype); else console.log("...
initiatortype = not supported"); } specifications specification status comment resource timing level 1the def
inition of '
initiatortype' in that specification. candidate recommendation
initial def
inition. ...
RTCIceCandidateInit.candidate - Web APIs
value a domstring describing the properties of the candidate, taken directly from the sdp attribute "candidate". the candidate string specifies the network connectivity information for the candidate. if the candidate is an empty string (""), the end of the candidate list has been reached; this candidate is known as the "end-of-candidates" marker. the syntax of the candidate string is described in rfc 5245, section 15.1. ...
...andidatemessage(msg) { var icecandidate = new rtcicecandidate({ candidate: msg.candidate; }); pc.addicecandidate(icecandidate).catch({ /* handle error */ }); } it's helpful to note that for backward compatibility with older versions of the webrtc specification, the rtcicecandidate() constructor accepts the value of candidate as its only input, in place of the rtcicecandidate
init dictionary. that usage would change the above sample to look like this: function goticecandidatemessage(msg) { var icecandidate = new rtcicecandidate(msg.candidate); pc.addicecandidate(icecandidate).catch({ /* handle error */ }); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcicecand...
...ionary. that usage would change the above sample to look like this: function goticecandidatemessage(msg) { var icecandidate = new rtcicecandidate(msg.candidate); pc.addicecandidate(icecandidate).catch({ /* handle error */ }); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcicecandidate
init.candidate' in that specification. candidate recommendation
initial specification. ...
RTCTrackEventInit.receiver - Web APIs
the rtctrackevent
init dictionary's receiver property specifies the rtcrtpreceiver associated with the event. syntax var trackevent
init = { receiver: rtpreceiver, track: mediastreamtrack, streams: [videostream], transceiver: rtptransceiver }; var rtpreceiver = trackevent
init.receiver; value the rtcrtptransceiver which pairs the receiver with a sender and other properties which establish a single bidirectional srtp stream for use by the track associated with the rtctrackevent. note: the transceiver includes its own receiver property, which will always be the same rtcrtpreceiver as this one. ...
... ...
...ther properties which establish a single bidirectional srtp stream for use by the track associated with the rtctrackevent. note: the transceiver includes its own receiver property, which will always be the same rtcrtpreceiver as this one. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtctrackevent
init.receiver' in that specification. candidate recommendation
initial specification. ...
XRInputSourceEventInit.frame - Web APIs
the xrinputsourceevent
init dictionary's property frame specifies an xrframe providing information about the timestamp at which the new input source event took place, as well as access to the xrframe method getpose() which can be used to map the coordinates of any xrreferencespace to the space in which the event took place. of course, as a general rule, you won't need to create xrinputsourceevent
init objects yourself. these events are generated by and sent to you by the webxr infrastructure. ...
...ch the new input source event took place, as well as access to the xrframe method getpose() which can be used to map the coordinates of any xrreferencespace to the space in which the event took place. of course, as a general rule, you won't need to create xrinputsourceevent
init objects yourself. these events are generated by and sent to you by the webxr infrastructure. syntax xrinputsourceevent
init.frame = xrframe; let xrinputsourceevent
init = { frame: xrframe }; let xrinputsourceevent = new xrinputsourceevent(type, { frame: xrframe }); value an xrframe indicating the time at which the event took place, and providing a getpose() method which can be used to map reference spaces to the world reference space. usage notes the event frame does not correspond to a visual frame as is deliver...
...elative positions of the objects in the scene at the time the event occurred. examples this example creates a new select event and sends it to the xrsession. let event = new xrinputsourceevent("select", { frame: eventframe, inputsource: source }; if (event) { xrsession.dispatchevent(event); } specifications specification status comment webxr device apithe def
inition of 'xrinputsourceevent
init.frame' in that specification. working draft
initial def
inition. ...
XRReferenceSpaceEventInit.transform - Web APIs
examples this simple snippet calls the constructor to create a new reference space event of type reset. ...
... examples this simple snippet calls the constructor to create a new reference space event of type reset. ...
... from the pre-event coordinate system to the post-event coordinate system. examples this simple snippet calls the constructor to create a new reference space event of type reset. let refspaceevent = new xrreferencespaceevent("reset", { referencespace: myrefspace, transform: mytransform }); specifications specification status comment webxr device apithe def
inition of 'xrreferencespaceevent
init.transform' in that specification. working draft
initial def
inition. ...
XRWebGLLayerInit.ignoreDepthValues - Web APIs
the depth buffer is typically used to assist in ordering vertices and, by extension, polygons while compositing, to ensure that the scene is correctly composited, with objects the correct distance away and with clipping and other distance-related computations performed as accurately as possible. without the depth buffer, these computations must rely entirely on the coordinates of each pixel. ...
...e away and with clipping and other distance-related computations performed as accurately as possible. without the depth buffer, these computations must rely entirely on the coordinates of each pixel. this property differs from depth in that depth requests a webgl layer that does not have a depth buffer at all, while ignoredepthvalues merely asks that the depth layer be ignored. syntax let layer
init = { ignoredepthvalues: boolvalue }; let gllayer = new xrwebgllayer(xrsession, gl, layer
init); let gllayer = new xrwebgllayer(xrsession, gl, { ignoredepthvalues: boolvalue }); value a boolean value which can be set to true to disable the use of the depth buffer by the webgl rendering layer created by the xrwebgllayer() constructor. the default value, false, means the depth buffer will be use...
...are used by default). example in this example, a new xrwebgllayer is created for a webxr session, xrsession. it's configured to ignore depth values or an alpha channel. xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl, { alpha: false, ignoredepthvalues: true }); }); specifications specification status comment webxr device apithe def
inition of 'xrwebgllayer
init.ignoredepthvalues' in that specification. working draft
initial def
inition. ...
XRWebGLLayerInit.stencil - Web APIs
when using the xrwebgllayer() constructor to create a new webgl rendering layer for webxr, providing as the layer
init parameter an object whose stencil property is false requests that the new layer be created without a stencil buffer. the stencil buffer is an optional buffer which, just like the depth buffer, contains one entry for every pixel in the frame buffer. also just like the depth buffer, the value of an enter in the stencil buffer directly affects how (or if) the corresponding pixel is drawn during rendering. ...
...n the frame buffer. also just like the depth buffer, the value of an enter in the stencil buffer directly affects how (or if) the corresponding pixel is drawn during rendering. you can store values into each entry in the stencil bufer, then specify an operation that determines which stencil buffer values correspond to pixels which should be drawn to the screen during each frame. syntax let layer
init = { stencil: false }; let gllayer = new xrwebgllayer(xrsession, gl, layer
init); let gllayer = new xrwebgllayer(xrsession, gl, { stencil: false }); value a boolean which can be set to false to specify that the new webgl layer should not include a stencil buffer. the default value is true. example in this example, a new xrwebgllayer is created for a webxr session, xrsession, without a stenc...
...the new webgl layer should not include a stencil buffer. the default value is true. example in this example, a new xrwebgllayer is created for a webxr session, xrsession, without a stencil buffer. xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl, { stencil: false }); }); specifications specification status comment webxr device apithe def
inition of 'xrwebgllayer
init.stencil' in that specification. working draft
initial def
inition. ...
Accessibility - MDN Web Docs Glossary: Definitions of Web-related terms
web accessibility (a11y) refers to best practices for keeping a website usable despite physical and technical restrictions. web accessibility is formally defined and discussed at the w3c through the web accessibility
initiative (wai). ...
...al and technical restrictions. web accessibility is formally defined and discussed at the w3c through the web accessibility
initiative (wai). ...
Domain sharding - MDN Web Docs Glossary: Definitions of Web-related terms
ing splits content across multiple subdomains. when multiple domains are used to serve multiple assets, browsers are able to download more resources simultaneously, resulting in a faster page load time and improved user experience. the problem with domain sharding, in terms of performance, is the cost of extra dns lookups for each domain and the overhead of establishing each tcp connection. the
initial response from an http request is generally an html file listing other resources such as javascript, css, images and other media files that need to be downloaded. as browsers limit the number of active connections per domain, serving all the required resources from a single domain could be slow as assets need to be downloaded sequentially. with domain sharding, the required downloads are served...
...ded. as browsers limit the number of active connections per domain, serving all the required resources from a single domain could be slow as assets need to be downloaded sequentially. with domain sharding, the required downloads are served from more than one domain, enabling the browser to simultaneously download needed resources. multiple domains, however, is an anti-pattern, as dns lookups slow
initial load times. http2 supports unlimited concurrent requests making domain sharding an obsolete requirement when http/2 is enabled. see also transport layer security (tls) dns http/2 ...
Grid Cell - MDN Web Docs Glossary: Definitions of Web-related terms
if you do not place items using one of the grid placement methods, direct children of the grid container will be placed one into each individual grid cell by the auto-placement algorithm. additional row or column tracks will be created to create enough cells to hold all items. in the example we have created a three column track grid. the five items are placed into grid cells working along an
initial row of three grid cells, then creating a new row for the remaining two. * {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; } .wrapper { display: grid; grid-template-co...
...isplay: grid; grid-template-columns: repeat(3,1fr); grid-auto-rows: 100px; } <div class="wrapper"> <div>one</div> <div>two</div> <div>three</div> <div>four</div> <div>five</div> </div> learn more property reference grid-template-columns grid-template-rows grid-auto-rows grid-auto-columns further reading css grid layout guide: basic concepts of grid layout def
inition of grid cells in the css grid layout specification ...
TCP slow start - MDN Web Docs Glossary: Definitions of Web-related terms
tcp slow start helps buildup transmission speeds to the network's capabilities. it does this without
initially knowing what those capabilities are and without creating congestion. tcp slow start is an algorithm used to detect the available bandwidth for packet transmission, and balances the speed of a network connection. it prevents the appearance of network congestion whose capabilities are
initially unknown, and slowly increases the volume of information diffused until the network's maximum capacity is found. to implement tcp slow start, the congestion window (cwnd) sets an upper limit on the amount of data a source can transmit over the network before receiving an acknowledgment (ack). the slow start threshold (ssthresh) determines the (de)activation of slow start. when a new co...
...lowly increases the volume of information diffused until the network's maximum capacity is found. to implement tcp slow start, the congestion window (cwnd) sets an upper limit on the amount of data a source can transmit over the network before receiving an acknowledgment (ack). the slow start threshold (ssthresh) determines the (de)activation of slow start. when a new connection is made, cwnd is
initialized to one tcp data or acknowledgment packet, and waits for an acknowledgement, or ack. when that ack is received, the congestion window is incremented until the cwnd is less than ssthresh. slow start also terminates when congestion is experienced. congestion control congestion itself is a state that happens within a network layer when the message traffic is too busy it slows the network res...
WAI - MDN Web Docs Glossary: Definitions of Web-related terms
wai or web accessibility
initiative is an effort by the world wide web consortium (w3c) to improve accessibility for people with various challenges, who may need a nonstandard browser or devices. ...
... wai or web accessibility
initiative is an effort by the world wide web consortium (w3c) to improve accessibility for people with various challenges, who may need a nonstandard browser or devices. ...
Initial setup
for them in firefox's add-ons manager or following these links. ...
...lowing these links. ...
PR_INIT_STATIC_CLIST
statically
initializes a circular list. syntax #include <prclist.h> pr_
init_static_clist (prclist *listp); parameter listp a pointer to the anchor of the linked list. description pr_
init_static_clist statically
initializes the specified list to be an empty list. ...
... statically
initializes a circular list. syntax #include <prclist.h> pr_
init_static_clist (prclist *listp); parameter listp a pointer to the anchor of the linked list. description pr_
init_static_clist statically
initializes the specified list to be an empty list. ...
PR_InitializeNetAddr
this must be pr_ipaddrnull, pr_ipaddrany, or pr_ipaddrloopback. port the port number to be assigned in the network address structure. the value is specified in host byte order. addr a pointer to the prnetaddr structure to be manipulated. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. ...
...pecified in host byte order. addr a pointer to the prnetaddr structure to be manipulated. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. this may occur, for example, if the value of val is not within the ranges defined by prnetaddrvalue. you can retrieve the reason for the failure by calling pr_geterror. description pr_
initializenetaddr allows the assignment of special network address values and the port number, while also setting the state that indicates the version of the address being used. the special network address values are identified by the enum prnetaddrvalue: typedef enum prnetaddrvalue{ pr_ipaddrnull, pr_ipaddrany, pr_ipaddrloopback } prnetaddrvalue; the enum has the following enumerators: p...
FC_DecryptInit
name fc_decrypt
init -
initialize a decryption operation. syntax ck_rv fc_decrypt
init( ck_session_handle hsession, ck_mechanism_ptr pmechanism, ck_object_handle hkey ); parameters hsession [in] session handle. pmechanism [in] mechanism to be used for the subsequent decryption operation. hkey [in] handle of the key to be used. description fc_decrypt
init initializes a decryption operation. a user must log into the token (to assume the nss user role) before calling fc_decrypt
init. ...
...m, ck_object_handle hkey ); parameters hsession [in] session handle. pmechanism [in] mechanism to be used for the subsequent decryption operation. hkey [in] handle of the key to be used. ...
FC_DigestInit
name fc_digest
init -
initialize a message-digest operation. syntax ck_rv fc_digest
init( ck_session_handle hsession, ck_mechanism_ptr pmechanism ); parameters hsession [in] session handle. pmechanism [in] mechanism to be used for the subsequent digest operation. description fc_digest
init initializes a message-digest operation. a user may call fc_digest
init without logging into the token (to assume the nss user role). ...
...est
init( ck_session_handle hsession, ck_mechanism_ptr pmechanism ); parameters hsession [in] session handle. pmechanism [in] mechanism to be used for the subsequent digest operation. description fc_digest
init initializes a message-digest operation. a user may call fc_digest
init without logging into the token (to assume the nss user role). ...
FC_EncryptInit
name fc_encrypt
init -
initialize an encryption operation. syntax ck_rv fc_encrypt
init( ck_session_handle hsession, ck_mechanism_ptr pmechanism, ck_object_handle hkey ); parameters hsession[in] handle to the session. pmechanism[in] pointer to the mechanism to be used for subsequent encryption. hkey[in] handle of the encryption key. description fc_encrypt
init initializes an encryption operation with the mechanism and key to be used. a user must log into the token (to assume the nss user role) before calling fc_encrypt
init. return value ckr_ok slot information was successfully copied. ckr_slot_id_invalid the specified slot number is out of the defined range of values. ...
...ryption key. description fc_encrypt
init initializes an encryption operation with the mechanism and key to be used. a user must log into the token (to assume the nss user role) before calling fc_encrypt
init. return value ckr_ok slot information was successfully copied. ckr_slot_id_invalid the specified slot number is out of the defined range of values. ...
FC_FindObjectsInit
name fc_findobjects
init -
initialize the parameters for an object search. syntax ck_rv fc_findobjects
init( ck_session_handle hsession, ck_attribute_ptr ptemplate, ck_ulong uscount ); parameters hsession [in] session handle. ptemplate [in] pointer to template. uscount [in] number of attributes in the template. description fc_findobjects
init sets the attribute list for an object search. if fc_findobjects
init is successful fc_findobjects may be called one or more times to retrieve handles of matching objects. a user must log into the token (to assume the nss user role) before searching for secret or private key objects. ...
...he template. description fc_findobjects
init sets the attribute list for an object search. if fc_findobjects
init is successful fc_findobjects may be called one or more times to retrieve handles of matching objects. a user must log into the token (to assume the nss user role) before searching for secret or private key objects. ...
FC_SignInit
name fc_sign
init -
initialize a signing operation. syntax ck_rv fc_sign
init( ck_session_handle hsession, ck_mechanism_ptr pmechanism, ck_object_handle hkey ); parameters hsession [in] session handle. pmechanism [in] mechanism to be used for the subsequent signing operation. hkey [in] handle of the key to be used . description fc_sign
init initializes a signature operation. a user must log into the token (to assume the nss user role) before calling fc_sign
init. ...
...tr pmechanism, ck_object_handle hkey ); parameters hsession [in] session handle. pmechanism [in] mechanism to be used for the subsequent signing operation. hkey [in] handle of the key to be used . ...
FC_SignRecoverInit
name fc_signrecover
init -
initialize a sign recover operation. syntax ck_rv fc_signrecover
init( ck_session_handle hsession, ck_mechanism_ptr pmechanism, ck_object_handle hkey ); parameters hsession [in] session handle. pmechanism [in] mechanism to be used for the signing operation. hkey [in] handle of the key to be used. description fc_signrecover
init initializes a
initializes a signature operation where the (digest) data can be recovered from the signature. a user must log into the token (to assume the nss user role) before calling fc_signrecover
init. ...
...e. pmechanism [in] mechanism to be used for the signing operation. hkey [in] handle of the key to be used. description fc_signrecover
init initializes a
initializes a signature operation where the (digest) data can be recovered from the signature. ...
FC_VerifyInit
name fc_verify
init -
initialize a verification operation. syntax ck_rv fc_verify
init( ck_session_handle hsession, ck_mechanism_ptr pmechanism, ck_object_handle hkey ); parameters hsession [in] session handle. pmechanism [in] mechanism to be used for the verification operation. hkey [in] handle of the key to be used. description fc_verify
init initializes a verification operation where the signature is an appendix to the data. a user must log into the token (to assume the nss user role) before calling fc_verify
init. ...
...eters hsession [in] session handle. pmechanism [in] mechanism to be used for the verification operation. hkey [in] handle of the key to be used. description fc_verify
init initializes a verification operation where the signature is an appendix to the data. ...
FC_VerifyRecoverInit
name fc_verifyrecover
init -
initialize a verification operation where data is recoverable. syntax ck_rv fc_verifyrecover
init( ck_session_handle hsession, ck_mechanism_ptr pmechanism, ck_object_handle hkey ); parameters hsession [in] session handle. pmechanism [in] mechanism to be used for verification. hkey [in] handle of the key to be used. description fc_verifyrecover
init initializes a signature verification operation where the (digest) data can be recovered from the signature. a user must log into the token (to assume the nss user role) before calling fc_verifyrecover
init. ...
...andle. pmechanism [in] mechanism to be used for verification. hkey [in] handle of the key to be used. description fc_verifyrecover
init initializes a signature verification operation where the (digest) data can be recovered from the signature. ...
JS_InitCTypesClass
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. global jsobject * the global object. ...
...requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. global jsobject * the global object. ...
JS_TracerInit
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. this article covers features introduced in spidermonkey 1.8 note: in jsapi 12, the macro js_tracer_
init has been replaced by the function js_tracer
init initialize a jstracer for object graph tracing. syntax void js_tracer
init(jstracer *trc, jsruntime *rt, jstracecallback callback); name type description trc jstracer * the tracer to be
initialized. cx jscontext * the context in which to perform tracing. callback jstracecallback a callback, described below, which the tracing apis will call each time a pointer is found from one gc thing to another...
...is call the tracer callback for each traceable thing directly referenced by a particular object or runtime structure. it is the callback's responsibility to ensure the traversal of the full object graph, if desired, by eventually calling js_tracechildren on the passed thing. in this case the callback must be prepared to deal with cycles in the traversal graph. see also mxr id search for js_tracer
init bug 807168 ...
nsIDOMGlobalPropertyInitializer
dom/interfaces/base/nsidomglobalproperty
initializer.idlscriptable an
initializer for global properties that lets them know about the window they're being attached to. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) an xpcom component implementing this interface can be exposed to web content as a property on the window. see custom window properties are a snap in firefox blog post for details. an alternative way to expose an object to the web content is to add the property in response to the content-document-global-created notification. ...
...efox 4 / thunderbird 3.3 / seamonkey 2.1) an xpcom component implementing this interface can be exposed to web content as a property on the window. see custom window properties are a snap in firefox blog post for details. an alternative way to expose an object to the web content is to add the property in response to the content-document-global-created notification. method overview jsval
init(in nsidomwindow window); methods
init() jsval
init( in nsidomwindow window ); parameters window the window to which the global property is being attached. return value the
initialized global property. ensure that you never return any internal xpcom objects to untrusted code. it is also recommended to use __exposedprops__ to control which members are exposed. ...
CompositionEvent.initCompositionEvent() - Web APIs
canbubblearg a boolean specifying whether or not the event can bubble. cancelablearg a boolean shether or not the event can be canceled. viewarg the window object from which the event was generated. dataarg a domstring representing the value of the data attribute. localearg a domstring representing the value of the locale attribute. return value void. ...
...er or not the event can be canceled. viewarg the window object from which the event was generated. dataarg a domstring representing the value of the data attribute. localearg a domstring representing the value of the locale attribute. return value void. specifications specification status comment document object model (dom) level 3 events specificationthe def
inition of '
initcompositionevent()' in that specification. obsolete
initial def
inition. ...
MSManipulationEvent.initMSManipulationEvent() - 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
initmsmanipulationevent method is used to create a msmanipulationevent that can be called from javascript. this proprietary method is specific to internet explorer. beginning with the microsoft edge browser, the
initevent() constructor pattern for synthetic events is deprecated. syntax msmanipulationevent.
initmsmanipulationevent(typearg, canbubblearg, cancelablearg, viewarg, detailarg, laststate, currentstate); parameters typearg [in] type: domstring the type of the event being created. ...
...es the last state of the manipulation event. currentstate [in] type: integer indicates the current state of the manipulation event. return value this method does not return a value. ...
MutationObserverInit.attributeOldValue - Web APIs
syntax var options = { attributeoldvalue: true | false } value a boolean value indicating whether or not the prior value of a changed attribute should be included in the mutationobserver.oldvalue property when reporting attribute value changes. if true, oldvalue is set accordingly. if false, it is not. when using attributeoldvalue, setting the attributes option to true is optional. ...
...utation.attributename]) and its old value (mutation.oldvalue). when observe() is called, the specified options are attributes and attributeoldvalue, which means that changes to attribute values will be reported, and each mutation record will include the oldvalue property specifying the attribute's previous value. specifications specification status comment domthe def
inition of 'mutationobserver
init.attributeoldvalue' in that specification. living standard ...
MutationObserverInit.attributes - Web APIs
syntax var options = { attributes: true | false } value a boolean value indicating whether or not to report through the callback any changes to the values of attributes on the node or nodes being monitored. the default value is false. if true, the callback specified when observe() was used to start observing the node or subtree will be called any time one or more attributes have changed on observed nodes. ...
...utation.attributename]) and its old value (mutation.oldvalue). when observe() is called, the specified options are attributes and attributeoldvalue, which means that changes to attribute values will be reported, and each mutation record will include the oldvalue property specifying the attribute's previous value. specifications specification status comment domthe def
inition of 'mutationobserver
init.attributes' in that specification. living standard ...
MutationObserverInit.characterData - Web APIs
character data changes are detectable on any text node, including nodes based on the text, processinginstruction, and comment interfaces. note that this doesn't monitor content of an htmlelement, even if it only contains text inside, as it only monitors text nodes themselves. so either pass directly a text node to the observe() method or you need to also set subtree: true. syntax var options = { characterdata: true | false } value a boolean value indicating whether or not to call the observer's callback function when textual nodes' values change. ...
... the mutationrecord's oldvalue property. subtree lets you specify whether to watch the target node and all of its descendants (true), or just the target node (false). if you set characterdataoldvalue to true, characterdata is automatically assumed to be true, even if you don't expressly set it as such. example specifications specification status comment domthe def
inition of 'mutationobserver
init.characterdata' in that specification. living standard ...
MutationObserverInit.childList - Web APIs
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.. if subtree is false, only the node indicated by the observer's target node is monitored for changes. ...
...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 def
inition of 'mutationobserver
init.childlist' in that specification. living standard ...
RTCIceCandidateInit.usernameFragment - Web APIs
value a domstring containing the username fragment (usually referred to in shorthand as "ufrag" or "ice-ufrag") that, along with the ice password ("ice-pwd"), uniquely identifies a single ongoing ice interaction, including for any communication with the stun server. the string may be up to 256 characters long, and has no default value. randomization at least 24 bits of the text in the ufrag are required to be randomly selected by the ice layer at the beginning of the ice session. ...
...o always use a 24-character ufrag in which bit 4 of each character is randomly selected between 0 and 1. another example: it might take a user-defined string and append three 8-bit random bytes to the end. or perhaps every character is entirely random. example ... specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcicecandidate
init.usernamefragment' in that specification. candidate recommendation
initial specification. ...
RTCIceCandidateInit - Web APIs
it's also used as the return value from the rtcicecandidate.tojson() method, and can be passed directly into rtcpeerconnection.addicecandidate() to add a candidate to the peer connection. properties candidate optional the ice candidate-attribute. if the candidate is an indicator that there are no further candidates (rather than representing a new candidate), this is the empty string (""). the default is the empty string. ...
... the remote peer. this string is generated by webrtc at the beginning of the session, and at least 24 bits worth of the string contain random data. the string may be up to 256 characters long. this property has no default value and is not present unless set explicitly. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcicecandidate
init' in that specification. candidate recommendation
initial def
inition. ...
RTCRtpTransceiverInit - Web APIs
sendencodings optional a list of encodings to allow when sending rtp media from the rtcrtpsender. each entry is of type rtcrtpencodingparameters. streams optional a list of mediastream objects to add to the transceiver'srtcrtpreceiver; when the remote peer's rtcpeerconnection's track event occurs, these are the streams that will be specified by that event. ...
...der. each entry is of type rtcrtpencodingparameters. streams optional a list of mediastream objects to add to the transceiver'srtcrtpreceiver; when the remote peer's rtcpeerconnection's track event occurs, these are the streams that will be specified by that event. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcrtptransceiver
init' in that specification. candidate recommendation ...
RTCTrackEventInit - Web APIs
the webrtc api's rtctrackevent
init dictionary is used to provide information describing an rtctrackevent when instantiating a new track event using new rtctrackevent(). properties rtctrackevent
init inherits properties from the event
init dictionary, and also includes the following properties: receiver the rtcrtpreceiver which is being used to receive the track's media. streams optional an array of mediastream objects representing each of the streams that comprise the event's corresponding track. track the mediastreamtrack the event is associated with. transceiver the rtcrtptransceiver associated with the event. ...
...ck's media. streams optional an array of mediastream objects representing each of the streams that comprise the event's corresponding track. track the mediastreamtrack the event is associated with. transceiver the rtcrtptransceiver associated with the event. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtctrackevent
init' in that specification. candidate recommendation
initial specification. ...
XRInputSourceEventInit - Web APIs
the xrinputsourceevent
init dictionary is used when calling the xrinputsourceevent() constructor to provide configuration options for the newly-created xrinputsourceevent object to take on. properties the xrinputsourceevent
init dictionary inherits properties from the event
init dictionary. it also offers the following: frame an xrframe object representing the event frame during which the event took place. this event is not associated with the animation process, and has no viewer information contained within it. inputsource an xrinputsource object representing the input device from which the event is being sent. specifications specification status comment webxr device apithe def
inition of 'xrinputsourceevent
init' in that specification. working draft ...
...ook place. this event is not associated with the animation process, and has no viewer information contained within it. inputsource an xrinputsource object representing the input device from which the event is being sent. specifications specification status comment webxr device apithe def
inition of 'xrinputsourceevent
init' in that specification. working draft
initial def
inition. ...
XRReferenceSpaceEventInit - Web APIs
since the properties are read-only, this is the only opportunity available to set their values. you will not usually need to use this, since these events are created by the webxr infrastructure. properties referencespace the xrreferencespace from which the event originated. transform an xrrigidtransform which maps the old coordinate system (from before the changes indicated by this event) to the new coordiante system. usage notes all of this dictionary's properties must have valid values set on them before calling the xrreferencespaceevent() constructor. ...
...values set on them before calling the xrreferencespaceevent() constructor. examples this simple snippet calls the constructor to create a new reference space event of type reset. let refspaceevent = new xrreferencespaceevent("reset", { referencespace: myrefspace, transform: mytransform }); specifications specification status comment webxr device apithe def
inition of 'xrreferencespaceevent
init' in that specification. working draft
initial def
inition. ...
XRRenderStateInit - Web APIs
all distances are specified as floating-point values in meters; you can specify a value of 50 centimeters using a value of 0.5, for example. properties baselayer optional an xrwebgllayer object from which the webxr compositor will obtain imagery. this is null by default. depthfar optional a floating-point value specifying the distance in meters from the viewer to the far clip plane, which is a plane parallel to the display surface beyond which no further rendering will occur. ...
...hen computing the projection matrix for an inline xrsession. the projection matrix calculation also takes into account the output canvas's aspect ratio. this property must not be specified for immersive sessions, so the value is null by default for immersive sessions. the default value is otherwise π * 0.5 (half of the value of pi). usage notes any properties not specified in the xrrenderstate
init compliant object passed into updaterenderstate() are left at their current values. specifications specification status comment webxr device apithe def
inition of 'xrrenderstate
init' in that specification. working draft
initial def
inition. ...
XRWebGLLayerInit.alpha - Web APIs
the alpha property is a boolean value which, if present and set to true in the xrwebgllayer
init dictionary passed into the xrwebgllayer() constructor, specifies that the new layer's color buffer is to include an alpha channel. otherwise, the color buffer won't have an alpha channel. the default is true. syntax let layer
init = { alpha: boolvalue }; let gllayer = new xrwebgllayer(xrsession, gl, layer
init); let gllayer = new xrwebgllayer(xrsession, gl, { alpha: boolvalue }); value a boolean which can be set to true to request that the new webgl layer for rendering the webxr scene is to have an alpha channel. example in this example, a new xrwebgllayer is created for a webxr session, xrsession, without an alpha channel. xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrse...
... that the new webgl layer for rendering the webxr scene is to have an alpha channel. example in this example, a new xrwebgllayer is created for a webxr session, xrsession, without an alpha channel. xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl, { alpha: false }); }); specifications specification status comment webxr device apithe def
inition of 'xrwebgllayer
init.alpha' in that specification. working draft
initial def
inition. ...
XRWebGLLayerInit.depth - Web APIs
when using the xrwebgllayer() constructor to create a new webgl rendering layer for webxr, providing as the layer
init parameter an object whose depth property is false will request that the new layer be created without a depth buffer. syntax let layer
init = { depth: false }; let gllayer = new xrwebgllayer(xrsession, gl, layer
init); let gllayer = new xrwebgllayer(xrsession, gl, { depth: false }); value a boolean which can be set to false to specify that the new webgl layer should not have a depth buffer. this means that the only source for depth information is the vertex coordinates, and reduces the accuracy and quality of rendering, but may potentially affect the performance of rendering as well. the default value is true. usage notes this property differs from ignoredepthvalues ...
...s being ignored. if (gllayer.ignoredepthvalues) { /* not using the depth buffer */ } example in this example, a new xrwebgllayer is created for a webxr session, xrsession, without a depth buffer. xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl, { depth: false }); }); specifications specification status comment webxr device apithe def
inition of 'xrwebgllayer
init.depth' in that specification. working draft
initial def
inition. ...
Initial value - CSS: Cascading Style Sheets
the
initial value of a css property is its default value, as listed in its def
inition table in the specification. the usage of the
initial value depends on whether a property is inherited or not: for inherited properties, the
initial value is used on the root element only, as long as no specified value is supplied. for non-inherited properties, the
initial value is used on all elements, as long as no specified value is supplied. you can explicitly specify the
initial value by using the
initial keyword. note: the
initial value should not be confused with the value specified by the browser's style sheet. specifications specification status comment css cascade 4 formal def
inition. ...
...sed on all elements, as long as no specified value is supplied. you can explicitly specify the
initial value by using the
initial keyword. note: the
initial value should not be confused with the value specified by the browser's style sheet. specifications specification status comment css cascade 4 formal def
inition. css level 2 (revision 1)the def
inition of '
initial value' in that specification. recommendation implicit def
inition. ...
SyntaxError: a declaration in the head of a for-of loop can't have an initializer - JavaScript
the javascript exception "a declaration in the head of a for-of loop can't have an
initializer" occurs when the head of a for...of loop contains an
initializer expression such as |for (var i = 0 of iterable)|. this is not allowed in for-of loops. message syntaxerror: for-of loop head declarations cannot have an
initializer (edge) syntaxerror: a declaration in the head of a for-of loop can't have an
initializer (firefox) syntaxerror: for-of loop variable declaration may not have an
initializer. (chrome) error type syntaxerror what went wrong? the head of a for...of loop contains an
initializer expression. that is, a variable is declared and assigned a value |for (var i = 0 of iterable)|. this is not allowed in for-of loops. you might want a for loop that does allow an
initializer. exam...
...nitializer expression. that is, a variable is declared and assigned a value |for (var i = 0 of iterable)|. this is not allowed in for-of loops. you might want a for loop that does allow an
initializer. examples invalid for-of loop let iterable = [10, 20, 30]; for (let value = 50 of iterable) { console.log(value); } // syntaxerror: a declaration in the head of a for-of loop can't // have an
initializer valid for-of loop you need to remove the
initializer (value = 50) in the head of the for-of loop. maybe you intended to make 50 an offset value, in that case you could add it to the loop body, for example. let iterable = [10, 20, 30]; for (let value of iterable) { value += 50; console.log(value); } // 60 // 70 // 80 ...
init - Archive of obsolete content
min minor version number. rev revision number. bld build number. version a string representing version information in the format "4.1.2.1234". when maj, min, rev, and bld are provided as parameters, all four parameters are required, but all of them can be zero. ...
noinitialfocus - Archive of obsolete content
« xul reference homeno
initialfocustype: booleanif false, the default value, the element is considered when determining which element should be
initially focused in a dialog. if true, the element will not receive
initial focus. this lets you prevent things like descriptions and labels from inadvertently receiving
initial focus. ...
NP_Initialize - Archive of obsolete content
« gecko plugin api reference « plug-in side plug-in api summary provides global
initialization for a plug-in. syntax windows #include <npapi.h> nperror winapi np_
initialize(npnetscapefuncs *anpnfuncs) unix #include <npapi.h> nperror np_
initialize(npnetscapefuncs *anpnfuncs, nppluginfuncs *anppfuncs) returns if successful, the function returns nperr_no_error. if unsuccessful, the plug-in is not loaded and the function returns an error code. for possible values, see error codes. description the browser calls this function only once: when a plug-in is loaded, before the first instance is created. this is the first function that the browser calls. np_
initialize tells the plug-in that the browser has loaded it and provides global
initialization. allocate any memory or r...
Ajax - MDN Web Docs Glossary: Definitions of Web-related terms
ajax allows you to update parts of the dom of an html page instead without the need for a full page refresh. ajax also lets you work asynchronously, meaning your code continues to run while the targeted part of your web page is trying to reload (compared to synchronously, which blocks your code from running until that part of your page is done reloading). with interactive websites and modern web standards, ajax is gradually being replaced by functions within javascript frameworks and the official fetch api standard. ...
Alignment subject - MDN Web Docs Glossary: Definitions of Web-related terms
in css box alignment the alignment subject is the thing (or things) being aligned by the property. for justify-self and align-self, the alignment subject is the margin box of the box the property is set on, using the writing mode of that box. for justify-content and align-content, the writing mode of the box is also used. the def
inition of the alignment subject depends on the layout mode being used. block containers (including table cells) the entire content of the block as a single unit. multicol containers the column boxes, with any spacing inserted between column boxes added to the relevant column gaps. flex containers for justify-content, the flex items in each flex line. for align-content, the flex lines. note, this only has an effect on multi-line flex containers. gri...
Bézier curve - MDN Web Docs Glossary: Definitions of Web-related terms
the curve is defined by a set of control points with a minimum of two. web related graphics and animations use cubic béziers, which are curves with four control points p0, p1, p2, and p3. to draw the curve, two imaginary lines are drawn, one from p0 to p1 and the other from p1 to p2. the end points of the lines are then steadily moved to the next point. ...
CSS pixel - MDN Web Docs Glossary: Definitions of Web-related terms
the css pixel—denoted in css with the suffix px—is a unit of length which roughly corresponds to the width or height of a single dot that can be comfortably seen by the human eye without strain, but is otherwise as small as possible. by def
inition, this is the physical size of a single pixel at a pixel density of 96 dpi, located an arm's length away from the viewer's eyes. that def
inition, of course, leaves a lot of wiggle room, as the terms "be comfortably seen" and "an arm's length away" are imprecise, varying from person to person. when a user is sitting at a desk in front of a desktop, the display is generally substantially farther away from their eyes than when they're on a cell phone, for instance. as such, it generally suffices to say that when the unit px is used, the goa...
PR INIT CLIST
initializes a circular list. syntax #include <prclist.h> pr_
init_clist (prclist *listp); parameter listp a pointer to the anchor of the linked list. description
initializes the specified list to be an empty list. ...
PR_Initialized
checks whether the runtime has been
initialized. syntax #include <pr
init.h> prbool pr_
initialized(void); returns the function returns one of the following values: if pr_
init has already been called, pr_true. if pr_
init has not already been called, pr_false. ...
PR_REMOVE_AND_INIT_LINK
removes an element from a circular list and
initializes the linkage. syntax #include <prclist.h> pr_remove_and_
init_link (prclist *elemp); parameter elemp a pointer to the element. description pr_remove_and_
init_link removes the specified element from its circular list and
initializes the links of the element to point to itself. ...
AnimationEvent.initAnimationEvent() - Web APIs
summary the animationevent.
initanimationevent() method
initializes an animation event created using the deprecated document.createevent("animationevent") method. animationevent created this way are untrusted. note: during the standardization process, this method was removed from the specification. it has been deprecated and is in the progress of being removed from most implementations. do not use this method; instead, use the standard constructor, animationevent(), to create a synthetic animationevent. syntax animationevent.
initanimationevent(typearg, canbubblearg, cancelablearg, animationnamearg, elapsedtimearg); parameters typearg a domstring identifying the specific type of animation event that occurred. the following values are allowed: value meaning ...
CloseEvent.initCloseEvent() - Web APIs
the closeevent.
initcloseevent() method
initializes the value of a close event once it's been created (normally using the document.createevent() method). events
initialized in this way must have been created with the document.createevent() method. this method must be called to set the event before it is dispatched, using eventtarget.dispatchevent(). once dispatched, it doesn't do anything anymore. do not use this method anymore as it is deprecated. instead use specific event constructors, like closeevent(). the page on creating and triggering events gives more information about the way to use these. syntax event.
initmouseevent(type, canbubble, cancelable, wasclean, reasoncode, reason); parameters type the string to set the event's type to. possible types for mouse events include:...
ProgressEvent.initProgressEvent() - Web APIs
the progressevent.
initprogressevent() method
initializes an animation event created using the deprecated document.createevent("progressevent") method. progressevent created that way are untrusted. note: this method has been dropped during the standard process. it has been deprecated and removed from most implementation. do not use it anymore, use the standard constructor, progressevent(), to create a synthetic progressevent syntax progress.
initprogressevent(typearg, canbubblearg, cancelablearg, lengthcomputable, loaded, total); parameters typearg is a domstring identifying the specific type of animation event that occurred. the following values are allowed: value meaning loadstart the operation has started. progress ...
RTCIceCandidateInit.sdpMLineIndex - Web APIs
the optional property sdpmlineindex in the rtcicecandidate
init dictionary specifies the value of the rtcicecandidate object's sdpmlineindex property. value a number containing a 0-based index into the set of m-lines providing media descriptions, indicating which media source is associated with the candidate, or null if no such association is available. note: attempting to add a candidate (using addicecandidate()) that has a value of null for either sdpmid or sdpmlineindex will throw a typeerror exception. example ... specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcicecandidate
init.sdpmlineindex' in that specification. candidate recommendation
initial specification. ...
RTCIceCandidateInit.sdpMid - Web APIs
the optional property sdpmid in the rtcicecandidate
init dictionary specifies the value of the rtcicecandidate object's sdpmid property. value a domstring which uniquely identifies the source media component from which the candidate draws data, or null if no such association exists for the candidate. note: attempting to add a candidate (using addicecandidate()) that has a value of null for either sdpmid or sdpmlineindex will throw a typeerror exception. example ... specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcicecandidate
init.sdpmid' in that specification. candidate recommendation
initial specification. ...
RTCTrackEventInit.streams - Web APIs
the rtctrackevent
init dictionary's optional streams property provides an array containing a mediastream object for each of the streams associated with the event's track. syntax var trackevent
init = { receiver: rtpreceiver, track: mediastreamtrack, streams: [videostream], transceiver: rtptransceiver }; var streamlist = trackevent
init.streams; value an array of mediastream objects, one for each stream which make up the track. if streams is not specified, its default value is an empty array. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtctrackevent
init.streams' in that specification. candidate recommendation
initial specification. ...
RTCTrackEventInit.track - Web APIs
the rtctrackevent
init dictionary's track property specifies the mediastreamtrack associated with the track event. syntax var trackevent
init = { receiver: rtpreceiver, track: mediastreamtrack, streams: [videostream], transceiver: rtptransceiver }; var track = trackevent
init.track; value a mediastreamtrack representing the track with which the event is associated. this is the track that's being added to the rtcpeerconnection. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtctrackevent
init.track' in that specification. candidate recommendation
initial specification. ...
TransitionEvent.initTransitionEvent() - Web APIs
the transitionevent.
inittransitionevent() method
initializes a transition event created using the deprecated document.createevent("transitionevent") method. transitionevent created that way are untrusted. note: this method has been dropped during the standard process. it has been deprecated and is in the progress of been removed from most implementation. do not use it anymore, use the standard constructor, transitionevent(), to create a synthetic transitionevent syntax transitionevent.
inittransitionevent(typearg, canbubblearg, cancelablearg, transitionnamearg, elapsedtimearg); parameters typearg is a domstring identifying the specific type of transition event that occurred. the following value is allowed: value meaning transitionend the tra...
init() - Web APIs
scriptcontext the script context to use for the request; this must not be null. globalobject the object to use as the global for our request. often, this is the outer window, but it may also be a sandbox or backstage pass. this may be null, but if it is, the request cannot create a document. prior to firefox 23, this was always a window. ...
Index - Web APIs
ns api the pause() method of the web animations api's animation interface suspends playback of the animation. 73 animation.pending api, animation, animations, property, reference, web animations, web animations api the read-only animation.pending property of the web animations api indicates whether the animation is currently waiting for an asynchronous operation such as
initiating playback or pausing a running animation. 74 animation.play() api, animation, interface, method, reference, web animations, play, waapi, web animations api the play() method of the web animations api's animation interface starts or resumes playing of an animation. if the animation is finished, calling play() restarts the animation, playing it from the beginning. 7...
...vent.elapsedtime read-only property is a float giving the amount of time the animation has been running, in seconds, when this event fired, excluding any time the animation was paused. for an "animationstart" event, elapsedtime is 0.0 unless there was a negative value for animation-delay, in which case the event will be fired with elapsedtime containing (-1 * delay). 90 animationevent.
initanimationevent() api, animationevent, cssom, method, obsolete, web animations the animationevent.
initanimationevent() method
initializes an animation event created using the deprecated document.createevent("animationevent") method. 91 animationevent.pseudoelement api, animationevent, css, cssom, experimental, property, reference, web animations the animationevent.pse...
...ram.cancelscheduledvalues() api, audioparam, method, reference, web audio api, cancelscheduledvalues a reference to this audioparam object. in some older implementations this method returns void. 169 audioparam.defaultvalue api, audioparam, property, reference, web audio api, defaultvalue the defaultvalue read-only property of the audioparam interface represents the
initial value of the attributes as defined by the specific audionode creating the audioparam. 170 audioparam.exponentialramptovalueattime() api, audioparam, method, reference, web audio api, exponentialramptovalueattime a reference to this audioparam object. in some browsers older implementations of this interface return void. 171 audioparam.linearramptovalueattime() ...
...And 141 more matches
Bytecode Descriptions
ripts and other scripts that have a non-arrow function script on the scope chain. implements: getnewtarget. dynamicimport stack: moduleid ⇒ promise dynamic import of the module specified by the string value on the top of the stack. implements: import calls. importmeta stack: ⇒ import.meta push the import.meta object. this must be used only in module code. ...
...for jsop::newobject, the new object has a group based on the allocation site (or a new group if the template's group is a singleton). for jsop::newobjectwithgroup, the new object has the same group as the template object. ...
...re it might be executed more than once. there's a shell-only option, newglobal({clonesingletons: true}), that makes this instruction do a deep copy of the object. a few tests use it. format: jof_object objwithproto stack: proto ⇒ obj create and push a new ordinary object with the provided [[prototype]]. this is used to create the .prototype object for derived classes. ...
...And 47 more matches
JavaScript Daemons Management - Archive of obsolete content
ate a constructor for such a class of objects (daemon) in order to standardize and simplify the instantiation of 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 functio...
...ompatibility code (commented code), which enables the html5 standard parameters' passage functionality in that browser 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 |*| ...
...mons |*| https://developer.mozilla.org/user:fusionchess |*| |*| this framework is released under the gnu public license, version 3 or later. ...
...And 32 more matches
Details of the object model - JavaScript
be an instance of the employee class, representing a particular individual as an employee. an instance has exactly the same properties of its parent class (no more, no less). a prototype-based language, such as javascript, does not make this distinction: it simply has objects. ...
...you use the new operator in association with the constructor method to create class instances. ...
...te from which to get the
initial properties for a new object. any object can specify its own properties, either when you create it or at run time. in addition, any object can be associated as the prototype for another object, allowing the second object to share the first object's properties. defining a class in class-based languages, you define a class in a separate class def
inition. in that def
inition you can specify special methods, called constructors, to create instances of the class. a constructor method can specify
initial values for the instance's properties and perform other processing appropriate at creation time. you use the new operator in association with the constructor method to create class instances. ...
...And 32 more matches
Index
storage and management apis. nss doesn't require the programmer to manage individual files containing individual certificates or keys. instead, nss offers to use its own database(s). once you have imported certificates and keys into the nss database, you can easily look them up and use them again. because of nss's expectation to operate with an nss database, it's mandatory that you perform an
initialization call, where you tell nss which database you will be using. in the most simple scenario, the programmer will provide a directory on your filesystem as a parameter to the
init function, and nss is designed to do the rest. it will detect and open an existing database, or it can create a new one. alternatively, should you decide that you don't want to work with any persistent recording of c...
...usually, nss will flush all data to disk as soon as new data has been added to permanent storage. ...
...the list of external pkcs#11 modules that have been registered to be used by nss. the file could be named secmod.db, but in newer database generations a file named pkcs11.txt is used. only nss is allowed to access and manipulate these database files directly; a programmer using nss must go through the apis offered by nss to manipulate the data stored in these files. the programmer's task is to
initialize nss with the required parameters (such as a database), and nss will then transparently manage the database files. most of the time certificates and keys are supposed to be stored in the nss database. therefore, after
initial import or creation, the programmer usually doesn't deal with their raw bytes. instead, the programmer will use lookup functions, and nss will provide an access handl...
...And 30 more matches
sslfnc.html
this page is part of the ssl reference that we are migrating into the format described in the mdn style guide. if you are inclined to help with this migration, your help would be very much appreciated. upgraded documentation may be found in the current nss reference ssl functions chapter 4 ssl functions this chapter describes the core ssl functions. ssl
initialization functions ssl export policy functions ssl configuration functions ssl communication functions ssl functions used by callbacks ssl handshake functions nss shutdown function deprecated functions ssl
initialization functions this section describes the
initialization functions that are specific to ssl. for a complete list of nss
initialization functions, see
initialization. note tha...
...sl functions used by callbacks ssl handshake functions nss shutdown function deprecated functions ssl
initialization functions this section describes the
initialization functions that are specific to ssl. for a complete list of nss
initialization functions, see
initialization. note that at least one of the functions listed in ssl export policy functions must also be called during nss
initialization. nss_
init nss_
initreadwrite nss_nodb_
init ssl_optionsetdefault ssl_optiongetdefault ssl_cipherprefsetdefault ssl_cipherprefgetdefault ssl_clearsessioncache ssl_configserversessionidcache ssl_configmpserversidcache ssl_inheritmpserversidcache nss_
init sets up configuration files and performs other tasks required to run network security services. database files are ope...
...l_optionsetdefault ssl_optiongetdefault ssl_cipherprefsetdefault ssl_cipherprefgetdefault ssl_clearsessioncache ssl_configserversessionidcache ssl_configmpserversidcache ssl_inheritmpserversidcache nss_
init sets up configuration files and performs other tasks required to run network security services. database files are opened read-only. syntax #include "nss.h" secstatus nss_
init(char *configdir); parameter this function has the following parameter: configdir a pointer to a string containing the pathname of the directory where the certificate, key, and security module databases reside. returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to retriev...
...And 27 more matches
WebIDL bindings
allowed in situations in which it's ok to associate the resulting object with a random global object for security purposes; this is not usually ok for things that are exposed to web content. again, if you do not need wrapper caching you don't need to do this. the actual type returned from getparentobject must be defined in a header included from your implementation header, so that this type's def
inition is visible to the binding code. add the webidl for myinterface in dom/webidl and to the list in dom/webidl/moz.build. add an entry to dom/bindings/bindings.conf that sets some basic information about the implementation of the interface. if the c++ type is not mozilla::dom::myinterface, you need to set the 'nativetype' to the right type. if the type is not in the header file one gets by repla...
...hat are required or have default values have types as described under the corresponding webidl type in this document. the members that are not required and don't have default values have those types wrapped in optional<>. dictionary return values are represented by an out parameter whose type is a non-const reference to the struct described above, with all the members that have default values pre
initialized to those default values. note that optional dictionary arguments are always forced to have a default value of an empty dictionary by the idl parser and code generator, so dictionary arguments are never wrapped in optional<>. if necessary, dictionaries can be directly
initialized from a js::value in c++ code by invoking their
init() method. consumers doing this should declare their dictio...
...ized from a js::value in c++ code by invoking their
init() method. consumers doing this should declare their dictionary as rooteddictionary<dictionaryname>. when this is done, passing in a null jscontext* is allowed if the passed-in js::value is js::nullvalue(). likewise, a dictionary struct can be converted to a js::value in c++ by calling tojsvalue with the dictionary as the second argument. if
init() or tojsvalue() returns false, they will generally set a pending exception on the jscontext; reporting those is the responsibility of the caller. ...
...And 23 more matches
Mozilla DOM Hacking Guide
lper, is the name of the helper class for this dom class. helper classes are detailed in section 1.3. the fourth and last argument, _flags, is a bitvector of nsixpcscriptable flags. the macros for those flags are defined nsdomclassinfo.cpp. the flags give special behavior through xpconnect. see also section 1.9. the nsdomclassinfodata objects are created in the sclassinfodata array by explicitly
initializing it. here is the description of the structure: const char *mname: c-style string that is passed as second argument to the macro. it is the name of the javascript object that will be available in the browser through the dom. union { nsdomclassinfoconstructorfnc mconstructorfptr; nsdomclassinfoexternalconstructorfnc mexternalconstructorfptr; } u; this union is a pointer to a functi...
... available in the browser through the dom. union { nsdomclassinfoconstructorfnc mconstructorfptr; nsdomclassinfoexternalconstructorfnc mexternalconstructorfptr; } u; this union is a pointer to a function typedef'ed: typedef nsiclassinfo* (*nsdomclassinfoconstructorfnc)(nsdomclassinfoid aid); or typedef nsiclassinfo* (*nsdomclassinfoexternalconstructorfnc) (const char* aname); it is
initialized with the docreate member function of the helper class passed as third argument to the macro. nsiclassinfo *mcachedclassinfo: mcachedclassinfo holds an nsiclassinfo pointer to an instance of the relevant helper class. const nsiid *mprotochaininterface: pointer to the iid of the first interface available to javascript clients. this is used in global resolve functions, when xpconnect has to...
...connect has to find the member function to call. const nsiid **minterfaces: pointer to the first element of an array of pointers to all the interfaces available through js for this class. pruint32 mscriptableflags: 31; : the fourth argument passed to ns_define_classinfo_data_with_name. prbool mhasclassinterface: 1; : help me? mname and mconstructorfptr, mscriptableflags and mhasinterface are
initialized by ns_define_classinfo_data_with_name. mcachedclassinfo, mprotochaininterface and minterfaces, however, are
initialized in nsdomclassinfo::
init(), described in section 1.5. interface flattening one of the nicest -- and most important -- features of the xpconnect'ed dom is the interface flattening. "interface flattening is the ability to call methods on an object regardless of the interfa...
...And 22 more matches
Index
ted as the first parameters of the macros in js/xpconnect/src/xpc.msg (also at table of errors), with the value of each corresponding to that constant's value. 28 components.returncode xpcom:language bindings, xpconnect no summary! 29 components.stack xpcom:language bindings, xpconnect components.stack is a read only property of type nsistackframe (idl def
inition) that represents a snapshot of the current javascript callstack. this can be used for various diagnostic purposes. 30 components.utils xpcom:language bindings, xpconnect components.utils is a collection of various useful xpconnect features. its interface is defined at js/xpconnect/idl/xpccomponents.idl. 31 components.utils.sandbox needsmarkupwork, reference,...
...s the goal of this first chapter of the tutorial. in the subsequent chapters, we can begin to work on the example weblock component functionality itself. 105 finishing the component xpcom at this point you have created most of the infrastructure of the component. the component will be recognized by xpcom and registered with the category manager so that it starts up when xpcom
initializes. when the component starts up, it populates a list of urls read in from a file stored next to the gecko binary on the local system. 106 packaging weblock xpcom in this final part of the tutorial, we'll put all of the pieces of the web locking component - the library itself, the type library, the header file, and the user interface resources - into a package that can be...
...m library. in addition, it details the various helper classes and functions, as well as the components, provided by the xpcom glue library. the contents herein are oriented primarily toward extension developers and people embedding xpcom in other projects. 126 core xpcom functions functions, landing, mozilla, xpcom xpcom provides a number of global functions which are used to
initialize and shut down the xpcom library, as well as to allocate memory, get access to services, and to instantiate interfaces. 127 ns_alloc functions, functions:frozen, needsrelocation, reference, référence(2), xpcom, xpcom api reference infallibly allocates a block of memory using the xpcom memory manager. 128 ns_free functions, functions:frozen, xpcom, xpcom ...
...And 22 more matches
DevTools API - Firefox Developer Tools
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 tooldef
inition object. a def
inition 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 def
inition and to access tool instances. an instance of a tool is called a toolpanel. the toolpanel is built only when the tool ...
...ontaining toolbox. all these objects implement the eventemitter interface. api gdevtools the gdevtools api can be used to register new tools, themes and handle toolboxes for different tabs and windows. to use the gdevtools api from an add-on, it can be imported with following snippet const { gdevtools } = require("resource:///modules/devtools/gdevtools.jsm"); methods registertool(tooldef
inition) registers a new tool and adds a tab to each existing toolbox. parameters: tooldef
inition {tooldef
inition} - an object that contains information about the tool. see tooldef
inition for details. unregistertool(tool) unregisters the given tool and removes it from all toolboxes. parameters: tool {tooldef
inition|string} - the tool def
inition object or the id of the tool to unregister. ...
...ool and adds a tab to each existing toolbox. parameters: tooldef
inition {tooldef
inition} - an object that contains information about the tool. see tooldef
inition for details. unregistertool(tool) unregisters the given tool and removes it from all toolboxes. parameters: tool {tooldef
inition|string} - the tool def
inition object or the id of the tool to unregister. registertheme(themedef
inition) registers a new theme. parameters: themedef
inition {themedef
inition} - an object that contains information about the theme. unregistertheme(theme) unregisters the given theme. parameters: theme {themedef
inition|string} - the theme def
inition object or the theme identifier. showtoolbox(target [, toolid [, hosttype [, hostoptions]]]) opens a toolbox for given target either ...
...And 22 more matches
Python binding for NSS
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. ...
...the source code to python-nss was first imported into the mozilla cvs repository on june 9th 2009. ...
...l be a str object binary data will be a bytes object ints will be a python int object all pure python tests and examples have been ported to py3 syntax but should continue to run under py2. ...
...And 21 more matches
text-transform - CSS: Cascading Style Sheets
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 html attribute or the xml:lang xml at...
... or the xml:lang xml attribute. note: support for language-specific cases varies between browsers, so check the browser compatibility table. 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. ...
...ipping articles in english). the capitalize keyword was under-specified in css 1 and css 2.1. this resulted in differences between browsers in the way the first letter was calculated (firefox considered - and _ as letters, but other browsers did not. both webkit and gecko incorrectly considered letter-based symbols like ⓐ to be real letters. internet explorer 9 was the closest to the css 2 def
inition, but with some weird cases.) by precisely defining the correct behavior, css text level 3 cleans this mess up. the capitalize line in the browser compatibility table contains the version the different engines started to support this now precisely-defined behavior. uppercase is a keyword that converts all characters to uppercase. lowercase is a keyword that converts all characters to lowe...
...And 21 more matches
IPDL Tutorial
all messages for multi-process plugins and tabs in firefox are declared in the ipdl language. to experiment with adding a new ipdl protocol, see creating a new protocol. all ipdl messages are sent between parent and a child end points, called actors. an ipdl protocol declares how actors communicate: it declares the possible messages that may be sent between actors, as well as a state machine describing when messages are allowed to be sent. ...
...several c++ headers from each ipdl protocol. this generated code manages the details of the underlying communication layer (sockets and pipes), constructing and sending messages, ensuring that all actors adhere to their specifications, and handling many error conditions. the following ipdl code defines a very basic interaction of browser and plugin actors: async protocol pplugin { child: async
init(nscstring pluginpath); async shutdown(); parent: async ready(); }; this code declares the pplugin protocol. two messages can be sent from the parent to the child,
init() and shutdown(). one message can be sent from the child to the parent, ready(). ipdl protocols start with the letter p. the file in which the protocol is declared must have a matching name, pplugin.ipdl. generated c++ cod...
...piled, the headers ppluginparent.h, and ppluginchild.h will be generated in the ipc/ipdl/_ipdlheaders/ directory of the build tree. the ppluginparent and ppluginchild classes are abstract classes that must be subclassed. each outgoing message is a c++ method which can be called. ...
...And 18 more matches
Index
js_definefunction, js_compilefunction, and their unicode equivalents return values of type jsfunction *. 110 jsfunctionspec jsapi reference, spidermonkey jsfunctionspec defines the attributes for a single js function to associate with an object. an application typically has an array of jsfunctionspec to define all the functions for an object and calls js_definefunctions or js_
initclass to create the functions and assign them to an object. 111 jsgetobjectops jsapi reference, obsolete, spidermonkey jsobjectops is used by js_newobject's internals to discover the set of high-level object operations to use for new objects of the given class. all native objects have a jsclass, which is stored as a private (int-tagged) pointer in object slots. in contrast, al...
... the jsobjectops.defaultvalue callback corresponds to the [[defaultvalue]] method defined in ecma 262-3 §8.6.2.6. many expressions in the ecmascript language, such as a+b, involve implicit conversion of the operands using [[defaultvalue]]. 131 jsobjectops.defineproperty jsapi reference, obsolete, spidermonkey define obj[id], an own property of obj named id, having the given
initial value, with the specified getter, setter, and attributes. 132 jsobjectops.destroyobjectmap jsapi reference, obsolete, spidermonkey no summary! 133 jsobjectops.dropproperty jsapi reference, obsolete, spidermonkey the following contract governs jsobjectops callers and implementations: 134 jsobjectops.enumerate jsapi reference, obsolete, sp...
...eference, obsolete, spidermonkey get and set a required slot, one that should already have been allocated. these operations are infallible, so required slots must be pre-allocated, or implementations must suppress out-of-memory errors. the native ops (js_objectops, see js/src/jsobj.cpp) access slots reserved by including a call to the jsclass_has_reserved_slots(n) macro in the jsclass.flags
initializer. 138 jsobjectops.lookupproperty jsapi reference, obsolete, spidermonkey look for id in obj and its prototype chain, returning js_false on error or exception, js_true on success. on success, return null in *propp if id was not found. if id was found, return the first object searching from obj along its prototype chain in which id names a direct property in *objp, and re...
...And 18 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
ns attribute to accept. within the window are a label element and textbox element, wrapped in a hbox element so that they are arranged horizontally. ...
...at this point, it’s important that you disabled th...
...le, and replace “clock” and “current time” with entity references. listing 8: revisions to clock.xul <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/"?> <!doctype dialog system "chrome://helloworld/locale/clock.dtd"> <dialog id="clockdialog" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="&helloworld.clock;" buttons="accept" onload="
initclock();"> <script type="application/javascript" src="chrome://helloworld/content/clock.js" /> <hbox align="center"> <label value="&helloworld.currenttime;:" /> <textbox id="currenttime" /> </hbox> </dialog> create the dtd that defines the entity references now create the dtd file that gets referred to by clock.xul (listing 9). the clock.dtd file inside the fr-fr folder must be en...
...And 17 more matches
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
used in extensions as well. sometimes an extension will be packaged with a special xpcom component developed specifically for it. note: if you're developing components in c++ or other compiled languages, be sure to include binaries for every platform. reference materials to get an idea of what kinds of functions embedded xpcom can handle, take a look at the api reference and the interface def
initions from xpidl in the actual source code. note: interface def
inition language (idl) is a language for giving standard def
initions of objects, methods, and so forth. the xpidl (cross-platform idl) used by mozilla is a partial extension to the corba idl. you can perform a full-text search of the firefox source code in mozilla cross-reference using character strings, filenames, etc as search keys...
...nables you to get all windows in firefox, including dialogs, etc. manipulating files using xpcom xpcom provides a number of interfaces allowing you to perform file manipulations without concern for whether you are running on windows, mac os x, or linux. in order to work with local files, first you need to create a nsilocalfile object representing the local file, as shown in listing 6. when you
initialize this by passing the full path to the file with the nsilocalfile.
initwithpath() method, it becomes available to all functions. it doesn't matter whether a file at the specified path already exists. note: use the path format suited to your platform: the windows “\” path delimiter is interpreted as an escape code, so should always be written “\\”; characters like “./” on linux req...
...se the path format suited to your platform: the windows “\” path delimiter is interpreted as an escape code, so should always be written “\\”; characters like “./” on linux require no special handling. 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. passing true as a parameter for the nsilocalfile.remove() method will recursively delete folders and files. let's see what happens when we pass true to delete all the contents of a folder. listing 7: check that file exists, delete it, and cre...
...And 17 more matches
Using XPInstall to Install Plugins - Archive of obsolete content
ging the user to restart their browser. for plugin vendors who have already written a native code (e.g. exe) installer, xpinstall can wrap this native installer and run it so that the user never has to leave the browsing environment and click on the exe to run it. this article presents a guideline for improving the plugin installation experience for netscape gecko browsers using xpinstall. a def
inition of terms xpinstall is an installer technology, and the name itself stands for "cross platform install" (hence "xp" -- an abbreviation for "cross platform"). an xpinstall package is usually called an xpi package for short (and often pronounced "zippy"). this article is about how you can use xpinstall to install plugins to the browsers that support xpinstall. an xpi package is in fact a zip fil...
...sed on mozilla such as netscape 7), but because of the similarity between the two installer technologies, it is easy to convert your smartupdate files to xpinstall files. smartupdate involves a digitally signed jar file which contained the software components to be installed as well as a javascript install.js file (called the install script) as the installer logic. downloads and installs would be
initiated with a security dialog box naming the certificate authority and the signer. often, the smartupdate download was triggered via the pluginurl attribute of the embed tag: <embed type="application/x-randomtype" src="myfile.typ" width="50" height="50" pluginurl="http://mytypecompany.xyz/jarpacks/mytypeplugin.jar"></embed> in the example above, the pluginurl attribute points to the signed jar fi...
...o accomplish rapid installation and setup of plugin software for end-users. the benefit of using xpinstall is to provide a streamlined installation mechanism. this section discusses what an ideal xpinstall package will do, as well as points out some of the javascript api calls that you will make to accomplish these install tasks. ...
...And 17 more matches
Overview of Mozilla embedding APIs
memory management issues of storing the underlying data. see the string guide for more details. nsweakptr this is an nscomptr which encapsulates xpcom weak reference support. see the nsiweakreference 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::reall...
...bbrowser component. the webbrowser provides a simple mechanism for other applications to leverage gecko functionality. each instance of a webbrowser encapsulates a full featured html content area. the embedding application receives notifications from gecko through a set of callback interfaces it may choose to implement. below is a code snippet which an embedding application can use to create and
initialize a webbrowser: nsresult rv; nscomptr<nsibasewindow> basewindow; nscomptr<nsiwebbrowser> webbrowser; // create a nswebbrowser instance... webbrowser = do_createinstance(ns_webbrowser_contractid, &rv); if (ns_failed(rv)) return rv; // give the webbrowser a pointer to the embedding component which // implements the callback interfaces. replace ...
...wser_contractid, &rv); if (ns_failed(rv)) return rv; // give the webbrowser a pointer to the embedding component which // implements the callback interfaces. replace 'this' with // an appropriate object... rv = webbrowser->setcontainerwindow((nsiwebbrowserchrome*)this); if (ns_failed(rv)) return rv; basewindow = do_queryinterface(webbrowser); //
initialize the webbrowser with a native parent window // (ie. hwnd on win32). replace 'nativewindow' with a // reference to an appropriate native resource... rv = basewindow->
initwindow(nativewindow, // native window nsnull, // always nsnull. x, y, cx, cy); //
initial dimensions... if (ns_failed(rv)...
...And 17 more matches
jspage - Archive of obsolete content
var mootools={version:"1.2.4",build:"0d9113241a90b9cd5643b926795852a2026710d4"};var native=function(k){k=k||{};var a=k.name;var i=k.legacy;var b=k.protect; var c=k.implement;var h=k.generics;var f=k.
initialize;var g=k.afterimplement||function(){};var d=f||i;h=h!==false;d.constructor=native;d.$family={name:"native"}; if(i&&f){d.prototype=i.prototype;}d.prototype.constructor=d;if(a){var e=a.tolowercase();d.prototype.$family={name:e};native.typize(d,e);}var j=function(n,l,o,m){if(!b||m||!n.prototype[l]){n.prototype[l]=o; }if(h){native.genericize(n,l,b);}g.call(n,l,o);return n;};d.alias=function(n,l,p){if(typeof n=="string"){var o=this.prototype[n];if((n=o)){return j(this,l,n,p); }}for(var m in n){this.alias(m,n[m],l);}return this;};d.implement=function(m,l,o){if(typeof m=="string"){return...
...){var d=array.prototype.slice.call(arguments); return b.prototype[c].apply(d.shift(),d);};}};native.implement=function(d,c){for(var b=0,a=d.length;b<a;b++){d[b].implement(c);}};native.typize=function(a,b){if(!a.type){a.type=function(c){return($type(c)===b); };}};(function(){var a={array:array,date:date,function:function,number:number,regexp:regexp,string:string};for(var h in a){new native({name:h,
initialize:a[h],protect:true}); }var d={"boolean":boolean,"native":native,object:object};for(var c in d){native.typize(d[c],c);}var f={array:["concat","indexof","join","lastindexof","pop","push","reverse","shift","slice","sort","splice","tostring","unshift","valueof"],string:["charat","charcodeat","concat","indexof","lastindexof","match","replace","search","slice","split","substr","substring","tolower...
...f","join","lastindexof","pop","push","reverse","shift","slice","sort","splice","tostring","unshift","valueof"],string:["charat","charcodeat","concat","indexof","lastindexof","match","replace","search","slice","split","substr","substring","tolowercase","touppercase","valueof"]}; for(var e in f){for(var b=f[e].length;b--;){native.genericize(a[e],f[e][b],true);}}})();var hash=new native({name:"hash",
initialize:function(a){if($type(a)=="hash"){a=$unlink(a.getclean()); }for(var b in a){this[b]=a[b];}return this;}});hash.implement({foreach:function(b,c){for(var a in this){if(this.hasownproperty(a)){b.call(c,this[a],a,this); }}},getclean:function(){var b={};for(var a in this){if(this.hasownproperty(a)){b[a]=this[a];}}return b;},getlength:function(){var b=0;for(var a in this){if(this.hasownproperty(a)...
...And 16 more matches
nsITimer
it is not necessary to cancel the timer in that case. xpcom/threads/nsitimer.idlscriptable please add a summary to this article. ...
...it is not necessary to cancel the timer in that case. xpcom/threads/nsitimer.idlscriptable please add a summary to this article. ...
...it is not necessary to cancel the timer in that case. xpcom/threads/nsitimer.idlscriptable please add a summary to this article. ...
...And 15 more matches
Array.prototype.reduce() - JavaScript
ucer 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 accumulates callback's return values. it is the accumulated value previously returned in the last invocation of the callback—or
initialvalue, if it was supplied (see below). currentvalue ...
...ur arguments: accumulator the accumulator accumulates callback's return values. it is the accumulated value previously returned in the last invocation of the callback—or
initialvalue, if it was supplied (see below). currentvalue the current element being processed in the array. index optional the index of the current element being processed in the array. starts from index 0 if an
initialvalue is provided. otherwise, it starts from index 1. array optional the array reduce() was called upon.
initialvalue optional a value to use as the first argument to the first call of the callback. ...
...). currentvalue the current element being processed in the array. index optional the index of the current element being processed in the array. starts from index 0 if an
initialvalue is provided. otherwise, it starts from index 1. array optional the array reduce() was called upon.
initialvalue optional a value to use as the first argument to the first call of the callback. if no
initialvalue is supplied, the first element in the array will be used as the
initial accumulator value and skipped as currentvalue. calling reduce() on an empty array without an
initialvalue will throw a typeerror. return value the single value that results from the reduction. description the reduce() method executes the callback once for each assigned value present in the array, taking four argu...
...And 15 more matches
Using Objective-C from js-ctypes
to convert it to c code first. we can then convert it straight to js-ctypes code. speech synthesis example let's start with the following objective-c code, which invokes the speech synthesis api to say "hello, firefox!". it uses the default system voice and waits until the speaking is done. #import <appkit/appkit.h> int main(void) { nsspeechsynthesizer* synth = [[nsspeechsynthesizer alloc]
initwithvoice: nil]; [synth startspeakingstring: @"hello, firefox!"]; // wait until start speaking. while (![synth isspeaking]) {} // wait while speaking. while ([synth isspeaking]) {} [synth release]; return 0; } save this file as test.m, and run with the following command, inside the same directory as the saved file (needs xcode). $ clang -framework appkit test.m && ./a.out cla...
... xcode). $ clang -framework appkit test.m && ./a.out class, message, and selector our task at hand is to convert objective-c syntax to c syntax. let's look at the following codelet: [nsspeechsynthesizer alloc] it passes an alloc message to the nsspeechsynthesizer class, in objective-c syntax. it performs the following through this objective-c syntax: get the nsspeechsynthesizer class def
inition. register the alloc selector for the message. send a message to the class, with the selector. get a reference to a class class def
initions are retrieved with the objc_getclass function, declared in /usr/include/objc/runtime.h. the objc_getclass function receives the name of the class, looks up the def
inition, and returns it. class objc_getclass(const char *name); in /usr/include/objc/o...
...gsend(id self, sel op, ...); id is defined as the following, in /usr/include/objc/objc.h, it's also an opaque type. class can be cast into id, so we can pass class returned by objc_getclass. typedef struct objc_object *id; in this example, we send an alloc message without any arguments using the following code. this code returns an allocated nsspeechsynthesizer instance that has not yet been
initialized. id tmp = objc_msgsend((id)nsspeechsynthesizer, alloc); here, class is always cast into id, which is an opaque type. we could choose to use id instead, reducing casting and making our code more efficient in future. id nsspeechsynthesizer = (id)objc_getclass("nsspeechsynthesizer"); id tmp = objc_msgsend(nsspeechsynthesizer, alloc); selector for a method with arguments in this case, [...
...And 14 more matches
Working with objects - JavaScript
he object name (which could be a normal variable) and property name are case sensitive. you can define a property by assigning it a value. for example, let's create an object named mycar and give it properties named make, model, and year as follows: var mycar = new object(); mycar.make = 'ford'; mycar.model = 'mustang'; mycar.year = 1969; the above example could also be written using an object
initializer, which is a comma-delimited list of zero or more pairs of property names and associated values of an object, enclosed in curly braces ({}): var mycar = { make: 'ford', model: 'mustang', year: 1969 }; unassigned properties of an object are undefined (and not null). mycar.color; // undefined properties of javascript objects can also be accessed or set using a bracket notatio...
...perties 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 creating objects using a constructor function, you can create objects using an object
initializer. using object
initializers is sometimes referred to as creating objects with literal notation. "obj...
...zer. 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 creating objects using a constructor function, you can create objects using an object
initializer. using object
initializers is sometimes referred to as creating objects with literal notation. "object
initializer" is consistent with the terminology used by c++. the syntax for an object using an object
initializer is: var obj = { property_1: value_1, // property_# may be an identifier... 2: value_2, // or a number... // ..., 'property n': value_n }; // or a string where obj is the name of the new object, each property_i is an identifier (eithe...
...And 14 more matches
JSAPI User Guide
atures, applications may use js_setversion. error reporting is also per-context and is enabled using js_seterrorreporter. the global object: to create this object, you first need a jsclass with the jsclass_global_flags option. the example below defines a very basic jsclass (named global_class) with no methods or properties of its own. use js_newglobalobject to create a global object. use js_
initstandardclasses to populate it with the standard javascript globals. this may seem like a lot of pieces for a simple application. it amounts to about 80 lines of code, as shown below. but the jsapi is designed to scale to applications that need many global objects. it is a fine-grained api, supporting many different combinations of the parts, and giving applications precise control over how sp...
...nd a new compartment. rootedobject global(cx); global = js_newglobalobject(cx, &globalclass, nullptr, js::dontfireonnewglobalhook); if (!global) return 1; // enter the new global object's compartment. jsautocompartment ac(cx, global); // populate the global object with the standard globals, like object and // array. if (!js_
initstandardclasses(cx, global)) return 1; // your application code here. this may include jsapi calls to create your // own custom js objects and run scripts. return 0; } int main(int argc, const char *argv[]) { //
initialize the js engine. if (!js_
init()) return 1; // create a js runtime. jsruntime *rt = js_newruntime(8l * 1024l * 1024l); if (!rt) ...
...:value can be a number, a string, a boolean value, a reference to an object (like an object, array, date, or function), or one of the special values null or undefined. for integers and boolean values, a jsval contains the value itself. in other cases, the jsval is a pointer to an object, string, or number. warning: like c++ pointers, and unlike javascript vars, a js::value is not automatically
initialized to a safe value, and can become a dangling pointer! a dangling pointer is a pointer that used to point to a valid object, but no longer does because the object no longer exists. using a dangling pointer can crash a c++ program (or worse). in the case of js::value, the javascript garbage collector recycles objects, strings, and numbers that don't appear to be in use, and a js::value by its...
...And 13 more matches
Looping code - Learn web development
concept in programming. programming loops are all to do with doing the same thing over and over again — which is termed iteration in programming speak. let's consider the case of a farmer that is making sure he has enough food to feed his family for the week. he might use the following loop to achieve this: a loop usually has one or more of the following features: a counter, which is
initialized 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 genera...
...path(); ctx.fillstyle = 'rgba(255,0,0,0.5)'; ctx.arc(random(width), random(height), random(50), 0, 2 * math.pi); ctx.fill(); this would get very boring and difficult to maintain very quickly. loops really are the best. the standard for loop let's start exploring some specific 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 incremented to count the number of times the loop has run. it is also sometimes referred to as a counter variable. a conditi...
... cats.length; i++) { info += cats[i] + ', '; } para.textcontent = info; </script> </body> </html> note: you can find this example code on github too (also see it running live). this shows a loop is used to iterate over the items in an array and do something with each of them — a very common pattern in javascript. here: the counter variable (sometimes known as an
initializer or an iteration variable), i, starts at 0 (let i = 0). the loop has been told to run until i is no longer smaller than the length of the cats array. this is important — the condition is the condition under which the loop will still run. so in this case, while i < cats.length is still true, the loop will still run. inside the loop, we concatenate the current loop item (cats[i] , which i...
...And 12 more matches
NSS API Guidelines
lements the cryptographic operations, such as bsafe from rsa security. this is also known as the "bottom layer" api, or blapi. within pkcs #11, wraps crypto lib/freebl blapi.h, blapit.h jar provides support for reading and writing data in java archive (jar) format, including zlib compression. port lib/jar jar-ds.h, jar.h, jarfile.h nss provides high-level
initialiazation and shutdown of security services. specifically, this library provides nss_
init() for establishing default certificate, key, module databases, and
initializing a default random number generator. nss_shutdown() closes these databases, to prevent further access by an application. above high cert, high key lib/nss nss.h pk11wrap provides access to pkcs #11 modules, th...
...e. public functions should have the form layer_body(), where layer is an all caps prefix for what layer the function lives in, and body is concatenated english words, where the beginning letter of each word is capitalized (also known as camelcase). for example: layer_capitalizedenglishwords() or cert_destroycertificate(). data types and typdefs should have the form layerbody, with the same def
initions for layer as public functions, and body in camel case english words. for example: layercapitalizedenglishwords or seckeyprivatekey. structures should have the same name as their typedefs, with the string str added to the end. for example layercapitalizedenglishwordsstr or seckeyprivatekeystr. private functions should have the form layer_body(), where layer is the all lower case prefix for w...
...ros (minus the '()' of course). options 2 and 3 are the more preferred options. option 1, currently the most common used for enums, actually creates namespace pollution. callback functions, and functions used in function tables, should have a typedef used to define the complete signature of the given function. function typedefs should have the following format: layerbody(), with the same def
initions for layer as public functions, and body is camel case english words. for example: layercapitalizedenglishwords or seckeyprivatekey. opaque data structures there are many data structures in the security library whose def
inition is effectively private, to the portion of the security library that defines and operates on those data structures. external code does not have access to these defini...
...And 12 more matches
PKCS11 Implement
cs that affect module implementation. future versions of netscape server products will also support of pkcs #11 version 2.0. how nss calls pkcs #11 functions this section is organized according to the categories used in pkcs #11: cryptographic token interface standard, version 2.0. to understand this section, you should be familiar with the standard specification. general-purpose functions c_
initialize the nss calls c_
initialize on startup or when it loads a new module. the nss always passes null, as required by the pkcs #11 specification, in the single c_
initialize parameter preserved. c_finalize the nss calls c_finalize on shutdown and whenever it unloads a module. c_getfunctionlist the nss calls c_getfunctionlist on startup or when it loads a new module. the function list return...
...evice, nss may call c_gettokeninfo anytime it's looking for a new token to check whether the token is write protected, whether it can generate random numbers, and so on. the nss expects ck_token_info.label to contain the name of the token. if the ckf_write_protected flag is set, nss won't use the token to generate keys. ...
...rotected, whether it can generate random numbers, and so on. the nss expects ck_token_info.label to contain the name of the token. if the ckf_write_protected flag is set, nss won't use the token to generate keys. the nss interprets the combination of the ckf_login_required and ckf_user_pin_
initialized flags as shown in table 1.1. ...
...And 12 more matches
x - SVG: Scalable Vector Graphics
inate of the uper left corner of the referenced element. value <length> | <percentage> default value 0 animatable yes note: starting with svg2, x is a geometry property meaning this attribute can also be used as a css property for used elements. ...
... value <length> | <percentage> default value 0 animatable yes note: starting with svg2, x is a geometry property meaning this attribute can also be used as a css property for used elements. specifications specification status comment filter effects module level 1the def
inition of 'x' in that specification. ...
... animatable yes note: starting with svg2, x is a geometry property meaning this attribute can also be used as a css property for used elements. specifications specification status comment filter effects module level 1the def
inition of 'x' in that specification. working draft def
inition for <filter> filter effects module level 1the def
inition of 'x' in that specification. ...
...And 12 more matches
y - SVG: Scalable Vector Graphics
inate of the uper left corner of the referenced element. value <length> | <percentage> default value 0 animatable yes note: starting with svg2, y is a geometry property meaning this attribute can also be used as a css property for used elements. ...
... value <length> | <percentage> default value 0 animatable yes note: starting with svg2, y is a geometry property meaning this attribute can also be used as a css property for used elements. specifications specification status comment filter effects module level 1the def
inition of 'y' in that specification. ...
... animatable yes note: starting with svg2, y is a geometry property meaning this attribute can also be used as a css property for used elements. specifications specification status comment filter effects module level 1the def
inition of 'y' in that specification. working draft def
inition for <filter> filter effects module level 1the def
inition of 'y' in that specification. ...
...And 12 more matches
TypeScript support in Svelte - Learn web development
do.svelte next we will take care of newtodo.svelte. as usual, add the lang='ts' attribute. the warning will indicate that we have to specify a type for the nameel variable. set its type to htmlelement like this: let nameel: htmlelement // reference to the name input dom node last for this file, we need to specify the correct type for our autofocus variable; update its def
inition like this: export let autofocus: boolean = false todo.svelte now the only warnings that npm run validate emits are triggered by calling the todo.svelte component; let's fix them. open the todo.svelte file, and add the lang='ts' attribute. let's import the todotype, and set the type of the todo prop. replace the export let todo line with the following: import type { todot...
...pdate event } with this we are telling typescript that the updatedtodo variable will hold a subset of the todotype properties. now svelte-check tells us that we have to define the type of our action function parameters: ./07-next-steps/src/components/todo.svelte:45:24 warn: parameter 'node' implicitly has an 'any' type, but a better type may be inferred from usage. (ts) const focuson
init = (node) => node && typeof node.focus === 'function' && node.focus() ./07-next-steps/src/components/todo.svelte:47:28 warn: parameter 'node' implicitly has an 'any' type, but a better type may be inferred from usage. (ts) const focuseditbutton = (node) => editbuttonpressed && node.focus() we just have to define the node variable to be of type htmlelement. in the two lines indicated above, r...
...only check our application's .svelte files. if you want to also check the .ts files you can run npm run validate && npx tsc --noemit, which tells the typescript compiler to check for errors without generating the .js output files. you could even add a script to your package.json file that runs that command. we'll start with stores.js. rename the file to stores.ts. ...
...And 11 more matches
NSS Sample Code Sample_3_Basic Encryption and MACing
nss sample code 3: basic encryption and macing this example program demonstrates how to encrypt and mac a file. ...
... files and produces <opfilename> as a final output file.\n\n", ""); exit(-1); } /* this source code form is subject to the terms of the mozilla public * license, v. 2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. ...
...could not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } /* generate the symmetric key */ key = pk11_tokenkeygen(slot, mechanism, null, keysize, keyid, pr_true, pwdata); if (!key) { pr_fprintf(pr_stderr, "symmetric key generation failed \n"); } return key; } /* * mac
init */ secstatus mac
init(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digestop(ctx, msg, msglen); if (rv != secsuccess...
...And 11 more matches
NSS functions
the nss_reference documents the functions most commonly used by applications to support ssl. the nss home page links to additional ssl documentation. if documentation is available for a function listed below, the function name is linked to either its mdc wiki page or its entry in the old ssl reference. the mozilla cross reference (mxr) link for each function provides access to the function def
inition, prototype def
inition, and source code references. the nss version column indicates which versions of nss support the function. function name/documentation source code nss versions nss_getclientauthdata mxr 3.2 and later nss_setdomesticpolicy mxr 3.2 and later nss_setexportpolicy mxr 3.2 and later nss_setfrancepolicy mx...
... have been replaced with newer versions. the deprecated functions are not supported by the new ssl shared libraries. applications that want to use the ssl shared libraries must convert to calling the new replacement functions listed below. each function name is linked to its entry in the old ssl reference. the mozilla cross reference (mxr) link for each function provides access to the function def
inition, prototype def
inition, and source code references. function name/documentation source code replacement in nss 3.2 ssl_enable mxr ssl_optionset ssl_enablecipher mxr ssl_cipherprefsetdefault ssl_enabledefault mxr ssl_optionsetdefault ssl_redohandshake mxr ssl...
... mxr ssl_cipherpolicyset certificate functions the public functions listed here are used to interact with certificate databases. if documentation is available for a function listed below, the function name is linked to either its mdc wiki page or its entry in the old ssl reference. the mozilla cross reference (mxr) link for each function provides access to the function def
inition, prototype def
inition, and source code references. the nss version column indicates which versions of nss support the function. function name/documentation source code nss versions cert_addcerttolisttail mxr 3.2 and later cert_addextension mxr 3.5 and later cert_addocspacceptableresponses mxr 3.6 and later cert_addokdomainnam...
...And 11 more matches
Activity Manager examples
ivity manager is a simple component that understands how to display a combination of user activity and history. see the activity manager page for a general description of the component. see the activity manager interfaces page for an overview of the related interfaces. if the default implementation of nsiactivityprocess, nsiactivitywarning and nsiactivityevent are not sufficient for the activity
initiator, activity developers can provide their own components to extend the capabilities. default implementations can be found in nsactivity.js file. if activity developers would like to extend the default ui representation of the activity types, they can provide their own xbl elements for their own activity types. all custom activity xbl elements should inherit from "activity-base" binding. for xb...
...ityprocess; const nsiae = components.interfaces.nsiactivityevent; const nsiam = components.interfaces.nsiactivitymanager; let gactivitymanager = components.classes["@mozilla.org/activity-manager;1"].getservice(nsiam); let process = components.classes["@mozilla.org/activity-process;1"].createinstance(nsiap); // assuming folder is an instance of nsimsgfolder interface // localization is omitted,
initiator is not provided process.
init("processing folder: " + folder.prettiestname, 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 ...
...ent = 50; process.setprogress(percent, "junk processing 25 of 50 messages", 25, 50); // step 3: removing the process and adding an event using process' attributes process.state = components.interfaces.nsiactivityprocess.state_completed; gactivitymanager.removeactivity(process.id); let event = components.classes["@mozilla.org/activity-event;1"].createinstance(nsiae); // localization is omitted,
initiator is omitted event.
init(folder.prettiestname + " is processed", null, "no junk found", process.starttime, // start time date.now()); // completion time event.contexttype = process.contexttype; // optional event.contextobj = process.contextobj; // optional gactivitymanager.addactivity(event); showing a user-defined activity with cancel c...
...And 11 more matches
Border-image generator - CSS: Cascading Style Sheets
subscribers[this.topic].length; i++) subscribers[this.topic][i](this.value); }; var createslider = function createslider(topic, label) { var slider = document.createelement('div'); slider.classname = 'ui-input-slider'; slider.setattribute('data-topic', topic); if (label !== undefined) slider.setattribute('data-info', label); new inputslider(slider); return slider; }; var
init = function
init() { var elem = document.queryselectorall('.ui-input-slider'); var size = elem.length; for (var i = 0; i < size; i++) new inputslider(elem[i]); }; return {
init :
init, setmax : setmax, setmin : setmin, setunit : setunit, setstep : setstep, getnode : getnode, getstep : getstep, setvalue : setvalue, subscribe : subscribe, unsubscribe : unsubscribe, ...
...opic] = []; subscribers[topic].push(callback); }; var unsubscribe = function unsubscribe(topic, callback) { var index = subscribers[topic].indexof(callback); subscribers[topic].splice(index, 1); }; var notify = function notify() { if (subscribers[this.topic] === undefined) return; for (var i in subscribers[this.topic]) { subscribers[this.topic][i](this.value); } }; var
init = function
init() { var elem, size; elem = document.queryselectorall('.ui-dropdown'); size = elem.length; for (var i = 0; i < size; i++) new dropdown(elem[i]); }; return {
init :
init, setvalue : setvalue, subscribe : subscribe, unsubscribe : unsubscribe, createdropdown : createdropdown }; })(); /** * ui-buttonmanager */ var buttonmanager = (function checkboxmanag...
... subscribers[topic].push(callback); }; var unsubscribe = function unsubscribe(topic, callback) { subscribers[topic].indexof(callback); subscribers[topic].splice(index, 1); }; var notify = function notify() { if (subscribers[this.topic] === undefined) return; for (var i = 0; i < subscribers[this.topic].length; i++) subscribers[this.topic][i](this.checkbox.checked); }; var
init = function
init() { var elem = document.queryselectorall('.ui-checkbox'); var size = elem.length; for (var i = 0; i < size; i++) new checkbox(elem[i]); }; return {
init :
init, setvalue : setvalue, subscribe : subscribe, unsubscribe : unsubscribe }; })(); window.addeventlistener("load", function() { borderimage.
init(); }); var borderimage = (function borderimage() { var...
...And 11 more matches
Box-shadow generator - CSS: Cascading Style Sheets
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 (subscribers[this.topic] === undefined) return; for (var i in subscribers[this.topic]) { subscribers[this.topic][i](this.value); } } var
init = function
init() { var elem, size; elem = document.queryselectorall('.ui-slider-btn-set'); size = elem.length; for (var i = 0; i < size; i++) setbuttoncomponent(elem[i]); elem = document.queryselectorall('.ui-slider-input'); size = elem.length; for (var i = 0; i < size; i++) setinputcomponent(elem[i]); elem = document.queryselectorall('.ui-slider'); size = elem.length;...
...('.ui-slider-btn-set'); size = elem.length; for (var i = 0; i < size; i++) setbuttoncomponent(elem[i]); elem = document.queryselectorall('.ui-slider-input'); size = elem.length; for (var i = 0; i < size; i++) setinputcomponent(elem[i]); elem = document.queryselectorall('.ui-slider'); size = elem.length; for (var i = 0; i < size; i++) new slider(elem[i]); } return {
init :
init, setvalue : setvalue, subscribe : subscribe, unsubscribe : unsubscribe } })(); /** * ui-buttonmanager */ var buttonmanager = (function checkboxmanager() { var subscribers = []; var buttons = []; var checkbox = function checkbox(node) { var topic = node.getattribute('data-topic'); var state = node.getattribute('data-state'); var name = node.getattribute('data-label');...
...[]; subscribers[topic].push(callback); } var unsubscribe = function unsubscribe(topic, callback) { subscribers[topic].indexof(callback); subscribers[topic].splice(index, 1); } var notify = function notify() { if (subscribers[this.topic] === undefined) return; for (var i = 0; i < subscribers[this.topic].length; i++) subscribers[this.topic][i](this.checkbox.checked); } var
init = function
init() { var elem = document.queryselectorall('.ui-checkbox'); var size = elem.length; for (var i = 0; i < size; i++) new checkbox(elem[i]); } return {
init :
init, setvalue : setvalue, subscribe : subscribe, unsubscribe : unsubscribe } })(); window.addeventlistener("load", function(){ boxshadow.
init(); }); var boxshadow = (function boxshadow() { function ge...
...And 11 more matches
min-width - CSS: Cascading Style Sheets
/interactive-examples and send us a pull request. the element's width is set to the value of min-width whenever min-width is larger than max-width or width. syntax /* <length> value */ min-width: 3.5em; /* <percentage> value */ min-width: 10%; /* keyword values */ min-width: max-content; min-width: min-content; min-width: fit-content(20em); /* global values */ min-width: inherit; min-width:
initial; min-width: unset; values <length> defines the min-width as an absolute value. <percentage> defines the min-width as a percentage of the containing block's width. auto the browser will calculate and select a min-width for the specified element. none no limit on the size of the box. max-content the intrinsic preferred min-width. min-content the intrinsic minimum min-width. fit-...
...he browser will calculate and select a min-width for the specified element. none no limit on the size of the box. max-content the intrinsic preferred min-width. min-content the intrinsic minimum min-width. fit-content(<length-percentage>) uses the fit-content formula with the available space replaced by the specified argument, i.e. min(max-content, max(min-content, argument)). ...
...r will calculate and select a min-width for the specified element. none no limit on the size of the box. max-content the intrinsic preferred min-width. min-content the intrinsic minimum min-width. fit-content(<length-percentage>) uses the fit-content formula with the available space replaced by the specified argument, i.e. min(max-content, max(min-content, argument)). ...
...And 11 more matches
JXON - Archive of obsolete content
loper.mozilla.org/docs/jxon |*| https://developer.mozilla.org/user:fusionchess |*| |*| this framework is released under the gnu public license, version 3 or later. ...
...lla.org/user:fusionchess |*| |*| this framework is released under the gnu public license, version 3 or later. ...
...loper.mozilla.org/docs/jxon |*| https://developer.mozilla.org/user:fusionchess |*| |*| this framework is released under the gnu public license, version 3 or later. ...
...And 10 more matches
Working with Svelte stores - Learn web development
rectory. give it the following content: import { writable } from 'svelte/store' export const alert = writable('welcome to the to-do list app!') note: stores can be defined and used outside of svelte components, so you can organize them in any way you please. in the above code we import the writable() function from svelte/store and use it to create a new store called alert with an
initial value of "welcome to the to-do list app!". we then export the store. creating the actual component let's now create our alert component and see how we can read values from the store. create another new file named src/components/alert.svelte. give it the following content: <script> import { alert } from '../stores.js' import { ondestroy } from 'svelte' let alertcontent =...
...never the value of the store changes, the callback function will be called with the new value as its parameter. in the callback function we just assign the value we receive to the local variable, which will trigger the update of the component's dom. the subscribe() method also returns a clean-up function, which takes care of releasing the subscription. so we subscribe when the component is being
initialized, and use ondestroy to unsubscribe when the component is unmounted. finally we use the alertcontent variable in our markup, and if the user clicks on the alert we clean it. at the end we include a few css lines to style our alert component. this setup allows us to work with stores in a reactive way. when the value of the store changes, the callback is executed. there we assign a new val...
...('todos store - todos:', todos) console.log('todos store content - $todos:', $todos) when you run the app now, you'll see something like this in your web console: as you can see, our store is just an object containing subscribe(), set(), and update() methods, and $todos is our array of todos. ...
...And 10 more matches
NSS_3.12_release_notes.html
cy (see cert.h) cert_getclassicocspenabledsoftfailurepolicy (see cert.h) cert_getpkixverifynistrevocationpolicy (see cert.h) cert_getusepkixforvalidation (see cert.h) cert_getvaliddnspatternsfromcert (see cert.h) cert_newtempcertificate (see cert.h) cert_setocsptimeout (see certhigh/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_isremovable (see pk11pub.h) pk11_mergetokens (see pk11pub.h) pk11_writerawattribute (see pk11pub.h) seckey_ecparamstobasepoi...
...llia ckm: mechanisms ckm_sha224_rsa_pkcs ckm_sha224_rsa_pkcs_pss ckm_sha224 ckm_sha224_hmac ckm_sha224_hmac_general ckm_sha224_key_derivation ckm_camellia_key_gen ckm_camellia_ecb ckm_camellia_cbc ckm_camellia_mac ckm_camellia_mac_general ckm_camellia_cbc_pad ckm_camellia_ecb_encrypt_data ckm_camellia_cbc_encrypt_data ckg: mfgs ckg_mgf1_sha224 new error codes (see secerr.h): sec_error_not_
initialized sec_error_token_not_logged_in sec_error_ocsp_responder_cert_invalid sec_error_ocsp_bad_signature sec_error_out_of_search_limits sec_error_invalid_policy_mapping sec_error_policy_validation_failed sec_error_unknown_aia_location_type sec_error_bad_http_response sec_error_bad_ldap_response sec_error_failed_to_encode_data sec_error_bad_info_access_location sec_error_libpkix_internal new mech...
... nss 3.12. bug 354403: nsslist_createiterator returns pointer to a freed memory if the function fails to allocate a lock bug 399236: pkix wrapper must print debug output into stderr bug 399300: pkix error results not freed after use. bug 414985: crash in pkix_pl_ocsprequest_destroy bug 421870: strsclnt crashed in pkix tests. ...
...And 10 more matches
Encrypt Decrypt_MAC_Using Token
ould not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } /* generate the symmetric key. ...
...to token %s.\n", pk11_gettokenname(slot)); return null; } } /* generate the symmetric key. ...
...tfinal(ctx, mac, maclen, maxlen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestfinal()\n"); } return secsuccess; } /* * compute mac. ...
...And 10 more matches
nss tech note5
te: this document contains code snippets that focus on essential aspects of the task and often do not illustrate all the cleanup that needs to be done. also, this document does not attempt to be an exhaustive survey of all possible ways to do a certain task; it merely tries to show a certain way. encrypt/decrypt include headers #include "nss.h" #include "pk11pub.h" make sure nss is
initialized.the simplest
init function, in case you don't need a nss database is nss_nodb_
init(".") choose a cipher mechanism. note that some mechanisms (*_pad) imply the padding is handled for you by nss. if you choose something else, then data padding is the application's responsibility. you can find a list of cipher mechanisms in security/nss/lib/softoken/pkcs11.c - grep for ckf_en_de_. c...
...d blocksize of 16 bytes is used. the rijndael algorithm permits 3 blocksizes (16, 24, 32 bytes), but the aes standard requires the blocksize to be 16 bytes. the keysize can vary and these keysizes are permitted: 16, 24, 32 bytes. you can also look at a sample program illustrating encryption hash / digest include headers #include "nss.h" #include "pk11pub.h" make sure nss is
initialized.the simplest
init function, in case you don't need a nss database is nss_nodb_
init(".") <big>create digest context</big>. some of the digest algorithm identifiers are (without the sec_oid_ prefix) : md2, md5, sha1, sha256, sha384, sha512. pk11context* digestcontext = pk11_createdigestcontext(sec_oid_md5); <big>digest the data</big> <big>secstatus s = pk11_digestbegin(digest...
...you can find a list of digest mechanisms in security/nss/lib/softoken/pkcs11.c - grep for ckf_digest. ck_mechanism_type digestmech = ckm_md5 <big>(for example)</big> choose a slot on which to to do the operation pk11slotinfo* slot = pk11_getbestslot(digestmech,...
...And 10 more matches
XPCOM Stream Guide
primitive output streams type native class contract id interface how to bind to a data target generic nsstoragestream @mozilla.org/storagestream;1 nsis...
...nts nsioutputstream. ...
...there are two ways of getting the input stream: by calling the channel's .open() method for a synchronous read, or by calling the channel's .asyncopen() method with an nsistreamli...
...And 10 more matches
Using COM from js-ctypes
jsctypes converting com code to c code to convert com code to js-ctypes, we need to write c++ vtable pointers in c. after that, we can pass a pointer . speech synthesis example let's start with following c++ code, which invokes microsoft speech api and says "hello, firefox!" with system default voice, then wait until the speaking done. ...
... $ cl ole32.lib test.cpp vtable needs vtable description here. the order of the vtable is very critical. ...
... $ cl ole32.lib test.cpp vtable needs vtable description here. the order of the vtable is very critical. when used from c or js-ctypes, the order of the vtable methods should match the order of the c++ vtable. __stdcall and __cdecl needs __stdcall and __cdecl...
...And 10 more matches
SVGSVGElement - Web APIs
en positions at which the given ui event occurred. when the browser actually knows the physical size of a "screen unit", this float attribute will express that information; otherwise, user agents will provide a suitable default value (such as .28mm). svgsvgelement.screenpixeltomillimetery corresponding size of a screen pixel along the y-axis of the viewport. ...
... corresponding size of a screen pixel along the y-axis of the viewport. svgsvgelement.usecurrentview the
initial view (i.e., before magnification and panning) of the current innermost svg document fragment can be either the "standard" view, i.e., based on attributes on the <svg> element such as viewbox) or on a "custom" view (i.e., a hyperlink into a particular <view> or other element). if the
initial view is the "standard" view, then this attribute is false. if the
initial view is a "custom" view, then this attribute is true. svgsvgelement.currentview an svgviewspec defining the
initial view (i.e., before magnification and panning) of the current innermost svg document fragment. ...
...hyperlink into a particular <view> or other element). if the
initial view is the "standard" view, then this attribute is false. if the
initial view is a "custom" view, then this attribute is true. svgsvgelement.currentview an svgviewspec defining the
initial view (i.e., before magnification and panning) of the current innermost svg document fragment. ...
...And 10 more matches
range - CSS: Cascading Style Sheets
when defining custom counter styles, the range descriptor lets the author specify a range of counter values over which the style is applied. if a counter value is outside the specified range, then the fallback style will be used to construct the representation of that marker. syntax /* keyword value */ range: auto; /* range values */ range: 2 5; range: inf
inite 10; range: 6 inf
inite; range: inf
inite inf
inite; /* multiple range values */ range: 2 5, 8 10; range: inf
inite 6, 10 inf
inite; values auto the range depends on the counter system: for cyclic, numeric, and fixed systems, the range is negative inf
inity to positive inf
inity. for alphabetic and symbolic systems, the range is 1 to positive inf
inity. for additive systems, the range is 0 to positive inf
inity. for extends s...
...ative inf
inity to positive inf
inity. for alphabetic and symbolic systems, the range is 1 to positive inf
inity. for additive systems, the range is 0 to positive inf
inity. for extends systems, the range is whatever auto would produce for the extended system; if extending a complex predefined style (§7 complex predefined counter styles), the range is the style’s defined range. [ [ | inf
inite ]{2} ]# defines a comma-separated list of ranges. for each individual range, the first value is the lower bound and the second value is the upper bound. a range is inclusive, that means it always contains both, the lower and upper bound numbers. ...
...the range of the counter style is the union of all the ranges defined in the list. ...
...And 10 more matches
StringView - Archive of obsolete content
m for accessing raw binary data much more efficiently. the stringview constructor is one level above typed arrays. ...
...thub.com/madmurphy/stringview.js |*| |*| this framework is released under the gnu lesser general public license, version 3 or later. ...
... case arraybuffer: /* the input argument is an arraybuffer: the buffer will be shared. */ awhole = new ftaview(vinput); ninptlen = this.encoding === "utf-32" ? vinput.bytelength >>> 2 : this.encoding === "utf-16" ? vinput.bytelength >>> 1 : vinput.bytelength; araw = nstartidx === 0 && (!isf
inite(nlength) || nlength === ninptlen) ? awhole : new ftaview(vinput, nstartidx, !isf
inite(nlength) ? ninptlen - nstartidx : nlength); break typeswitch; case uint32array: case uint16array: case uint8array: /* the input argument is a typedarray: the buffer, and possibly the array itself, will be shared. */ ftaview = vinput.
...And 9 more matches
Index - Archive of obsolete content
de ("cvsblame"). 378 bookmark keywords user_documentation practically every web surfer has bookmarks, of course, and power surfers usually have hundreds stuffed into folders within folders. in addition to being handy pointers to useful resources, bookmarks in mozilla can be used to make the address bar itself a power tool. searches, lookups, package tracking, and even word def
initions can all be retrieved from user-customized bookmarks. 379 build this page was auto-generated because a user created a sub-page to this page. 380 building transformiix standalone needshelp, needsrewrite, xslt no summary! 381 chromeless update [this project may not be active — check github https://github.com/mozilla/chromeless] ...
...added by the sun dtrace team and can be used on solaris 10 and mac os x 10.5. 415 dehydra dehydra the development focus switched to dxr (where the "d" comes from "dehydra"), which is based on clang instead of gcc. try dxr instead, or else try the gcc python plugin: https://fedorahosted.org/gcc-python-plugin/. 416 dehydra frequently asked questions dehydra
initially dehydra was written as an easy way to look for patterns in control flow graphs (cfgs). images of those graphs reminded me of the multiheaded hydra monster. thus de-hydra can be thought of as a decapitating tool for slaying cfgs. currently dehydra does not provide the cfg functionality, this functionality is now provided by treehydra. 417 dehydra function reference the f...
...ser's profile directory. 721 installtrigger.startsoftwareupdate this is a very simple example of the installtrigger object's principal method, startsoftwareupdate, which takes a string representing the path to the xpi and installs that xpi on the local machine. 722 trigger scripts and install scripts trigger scripts are simple installations that can be
initiated from event handlers and other javascript code on a web page. 723 windows install this example shows the installation of a xpi in which user profile information is contained. 724 file object use the file object to manipulate local files and directories during the installation process. 725 methods no summary! 726 inst...
...And 9 more matches
Learn XPI Installer Scripting by Example - Archive of obsolete content
tories, to install files in system folders and other areas. overview of the install script xpi install scripts are written in javascript using xpinstall engine syntax defined in the xpinstall api reference. ...
... 1 to 18; the file addition process, here part of the main installation block, is on lines 24 to 41; the registration part of the main installation block is on lines 42-58; and the execution at the end of the main block is on lines 59 to 71. ...
... 42-58; and the execution at the end of the main block is on lines 59 to 71. if you choose not to register the installed software or do the verifications at the front end of the installation, then at a minimum, the install scripts must
initialize, add the files to be installed, and execute. ...
...And 9 more matches
2D maze game with device orientation - Game development
go through the big collection of examples. the phaser framework provides you with a set of tools that will speed up development and help handle generic tasks needed to complete the game, so you can focus on the game idea itself. starting with the project you can see cyber orb source code on github. the folder structure is quite straightforward: the starting point is the index.html file where we
initialize the framework and set up an <canvas> to render the game on. you can open the index file in your favourite browser to launch the game and try it. there are also three folders in the directory: img: all the images that we will use in the game. src: the javascript files with all the source code of the game defined inside. audio: the sound files used in the game. setting up the canvas...
....add('preloader', ball.preloader); game.state.add('mainmenu', ball.mainmenu); game.state.add('howto', ball.howto); game.state.add('game', ball.game); game.state.start('boot'); })(); </script> </body> </html> so far we have a simple html website with some basic content in the <head> section: charset, title, css styling and the inclusion of the javascript files. ...
...add('mainmenu', ball.mainmenu); game.state.add('howto', ball.howto); game.state.add('game', ball.game); game.state.start('boot'); })(); </script> </body> </html> so far we have a simple html website with some basic content in the <head> section: charset, title, css styling and the inclusion of the javascript files. the <body> contains
initialization of the phaser framework and the def
initions of the game states. var game = new phaser.game(320, 480, phaser.canvas, 'game'); the line above will
initialize the phaser instance — the arguments are the width of the canvas, height of the canvas, rendering method (we're using canvas, but there are also webgl and auto options available) and the optional id of the dom container we want to put the canvas in. if there's nothing specified i...
...And 9 more matches
JIT Optimization Strategies
call a function using f.apply(obj, arguments) if the function contains any use of the arguments object that falls out of the cases defined above, this optimization will be suppressed. in particular, arguments cannot be returned from the function, or passed as an argument into calls (except for the apply case above). getprop_argumentscallee attempts to optimize an arguments.callee proper...
... call a function using f.apply(obj, arguments) if the function contains any use of the arguments object that falls out of the cases defined above, this optimization will be suppressed. in particular, arguments cannot be returned from the function, or passed as an argument into calls (except for the apply example listed above). getprop_inferredconstant attempts to optimize an access to a ...
...o the object. when this optimization is successful, property access is eliminated entirely and replaced with an inline constant. the different success and failure conditions are documented below: getprop_staticname attempts to optimize a property access on window which refers to a property on the global object. getprop_typedobject optimizes accesses to properties on typedobjects. getprop_def
initeslot optimizes access to a well-known regular property on an object. for this optimization to succeed, the property needs to be well-defined on the object. for objects constructed by constructor functions, this means that the property needs to be defined in the constructor, before any complex logic occurs within the constructor. this is the best case for a regular "field" type property that is ...
...And 9 more matches
An Overview of XPCOM
of the component - establishing a contract with the software clients that use it. in this respect, interface-based programming is often referred to as programming by contract. interfaces and encapsulation between component boundaries, abstraction is crucial for software maintainability and reusability. consider, for example, a class that isn't well encapsulated. ...
...espect, interface-based programming is often referred to as programming by contract. interfaces and encapsulation between component boundaries, abstraction is crucial for software maintainability and reusability. consider, for example, a class that isn't well encapsulated. using a freely available public
initialization method, as the example below suggests, can cause problems. someclass class
initialization class someclass { public: // constructor someclass(); // virtual destructor virtual ~someclass(); //
init method void
init(); void dosomethinguseful(); }; for this system to work properly, the client programmer must pay close attention to whatever rules the component programmer has established. this is the contractual agreement of this unencapsulated ...
...osomethinguseful(); }; for this system to work properly, the client programmer must pay close attention to whatever rules the component programmer has established. this is the contractual agreement of this unencapsulated class: a set of rules that define when each method can be called and what it is expected to do. one rule might specify that dosomethinguseful may only be called after a call to
init(). the dosomethinguseful method may do some kind of checking to ensure that the condition - that
init has been called - has been satisfied. in addition to writing well-commented code that tells the client developer the rules about
init(), the developer can take a couple steps to make this contract even clearer. first, the construction of an object can be encapsulated, and a virtual class provide...
...And 9 more matches
Observer Notifications
ister for the profile-after-change notification in nsicategorymanager. topic description * everything. [nsobserverservice.cpp] topic description xpcom-startup note: an extension can no longer be registered to receive this notification in firefox 4 and later. see xpcom changes in gecko 2.0 for details. called when xpcom is
initialized. many things are not available for use at this point. to receive this notification you have to register with nsicategorymanager. the registered component is always retrieved as a singleton (that is getservice() will be used to instantiate it). app-startup note: an extension can no longer be registered to receive this notification in firefox 4 and later. see xpcom chang...
... you can register with nsicategorymanager to receive this notification. prior to firefox 3.5, this was available to observers observing the app-startup/xpcom-startup notification. final-ui-startup triggered just before the first window for the application is displayed. sessionstore-windows-restored sent by the session restore process to indicate that all
initial browser windows have opened. note that while the window are open and the chrome loaded the tabs in the windows may still be being restored after this notification. note: this notification is specific to firefox and seamonkey 2.0 applications application shutdown these are the topics that you can observe on shutdown, in order of appearance. topic description ...
...abort the close. browser-lastwindow-close-granted sent when all interested parties have responded to the browser-lastwindow-close-requested notification and none of them requested that the close be aborted. after this is sent and handled, the browser window will close. browser-delayed-startup-finished sent when the browser window and all its components have been loaded and
initialized. documents these topics indicate notifications you can monitor related to dom documents. topic subject data description chrome-document-global-created nsidomwindow null sent immediately after a chrome document window has been set up, but before any script code has been executed. this lets extensions inject api into chrome windows as needed (see ...
...And 9 more matches
Color picker tool - CSS: Cascading Style Sheets
ibers[topic].push(callback); }; var unsubscribe = function unsubscribe(callback) { subscribers.indexof(callback); subscribers.splice(index, 1); }; var notify = function notify(topic, value) { if (subscribers[topic] === undefined || subscribers[topic].length === 0) return; var color = new color(value); for (var i in subscribers[topic]) subscribers[topic][i](color); }; var
init = function
init() { var elem = document.queryselectorall('.ui-color-picker'); var size = elem.length; for (var i = 0; i < size; i++) new colorpicker(elem[i]); }; return {
init :
init, color : color, rgbcolor : rgbcolor, rgbacolor : rgbacolor, hsvcolor : hsvcolor, hsvacolor : hsvacolor, hslcolor : hslcolor, hslacolor : hslacolor, setcolor : setcolor, getcolor : getc...
...subscribers[this.topic].length; i++) subscribers[this.topic][i](this.value); }; var createslider = function createslider(topic, label) { var slider = document.createelement('div'); slider.classname = 'ui-input-slider'; slider.setattribute('data-topic', topic); if (label !== undefined) slider.setattribute('data-info', label); new inputslider(slider); return slider; }; var
init = function
init() { var elem = document.queryselectorall('.ui-input-slider'); var size = elem.length; for (var i = 0; i < size; i++) new inputslider(elem[i]); }; return {
init :
init, setmax : setmax, setmin : setmin, setunit : setunit, setstep : setstep, getnode : getnode, getstep : getstep, setvalue : setvalue, subscribe : subscribe, unsubscribe : unsubscribe, ...
...tmax, setmin : setmin, setunit : setunit, setstep : setstep, getnode : getnode, getstep : getstep, setvalue : setvalue, subscribe : subscribe, unsubscribe : unsubscribe, setprecision : setprecision, setsensivity : setsensivity, getprecision : getprecision, createslider : createslider, }; })(); 'use strict'; window.addeventlistener("load", function() { colorpickertool.
init(); }); var colorpickertool = (function colorpickertool() { /*========== get dom element by id ==========*/ function getelembyid(id) { return document.getelementbyid(id); } function allowdropevent(e) { e.preventdefault(); } /*========== make an element resizable relative to it's parent ==========*/ var uicomponent = (function uicomponent() { function makeresizable(elem, axis) {...
...And 9 more matches
all - CSS: Cascading Style Sheets
the all shorthand css property resets all of an element's properties except unicode-bidi, direction, and css custom properties. it can set properties to their
initial or inherited values, or to the values specified in another stylesheet origin. 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. ...
...ss custom properties. it can set properties to their
initial or inherited values, or to the values specified in another stylesheet origin. 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 /* global values */ all:
initial; all: inherit; all: unset; /* css cascading and inheritance level 4 */ all: revert; the all property is specified as one of the css global keyword values. note that none of these values affect the unicode-bidi and direction properties. values
initial specifies that all the element's properties should be changed to their
initial values. inherit specifies that all the element's propert...
... revert specifies behavior that depends on the stylesheet origin to which the declaration belongs: user-agent origin equivalent to unset. ...
...And 9 more matches
flex - 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. ...
...x: auto; flex:
initial; flex: none; /* one value, unitless number: flex-grow */ flex: 2; /* one value, width/height: flex-basis */ flex: 10em; flex: 30%; flex: min-content; /* two values: flex-grow | flex-basis */ flex: 1 30px; /* two values: flex-grow | flex-shrink */ flex: 2 2; /* three values: flex-grow | flex-shrink | flex-basis */ flex: 2 2 10%; /* global values */ flex: inherit; flex:
initial; flex: unset; the flex property may be specified using one, two, or three values. one-value syntax: the value must be one of: a <number>: in this case it is interpreted as flex: <number> 1 0; the <flex-shrink> value is assumed to be 1 and the <flex-basis> value is assumed to be 0. one of the keywords: none, auto, or
initial. two-value syntax: the first value must be a <num...
...er> and it is interpreted as <flex-grow>. the second value must be one of: a <number>: then it is interpreted as <flex-shrink>. a valid value for width: then it is interpreted as <flex-basis>. three-value syntax: the values must be in the following order: a <number> for <flex-grow>. a <number> for <flex-shrink>. a valid value for width for <flex-basis>. values
initial the item is sized according to its width and height properties. it shrinks to its minimum size to fit the container, but does not grow to absorb any extra free space in the flex container. this is equivalent to setting "flex: 0 1 auto". auto the item is sized according to its width and height properties, but grows to absorb any extra free space in the flex container, and shrinks to its mini...
...And 9 more matches
Math.hypot() - JavaScript
function makes this calculation easier and faster; you simply call math.hypot(v1, v2) , or math.hypot(v1, v2, v3, v4, ...). math.hypot also avoids overflow/underflow problems if the magnitude of your numbers is very large. the largest number you can represent in js is number.max_value, which is around 10308. if your numbers are larger than about 10154, taking the square of them will result in inf
inity. for example, math.sqrt(1e200*1e200 + 1e200*1e200) = inf
inity . if you use hypot() instead, you get better answer: math.hypot(1e200, 1e200) = 1.4142...e+200 . this is also true with very small numbers. math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0, but math.hypot(1e-200, 1e-200) =1.4142...e-200. because hypot() is a static method of math, you always use it as math.hypot(), rather than as a met...
...0) = 1.4142...e+200 . this is also true with very small numbers. math.sqrt(1e-200*1e-200 + 1e-200*1e-200) = 0, but math.hypot(1e-200, 1e-200) =1.4142...e-200. because hypot() is a static method of math, you always use it as math.hypot(), rather than as a method of a math object you created (math is not a constructor). if no arguments are given, the result is +0. if any of the arguments is ±inf
inity, the result is inf
inity. if any of the arguments is nan (unless another argument is ±inf
inity), the result is nan. if at least one of the arguments cannot be converted to a number, the result is nan. with one argument, math.hypot() is equivalent to math.abs(). polyfill a naive approach that does not handle overflow/underflow issues: if (!math.hypot) math.hypot = function() { var y = 0, i ...
...ny of the arguments is nan (unless another argument is ±inf
inity), the result is nan. if at least one of the arguments cannot be converted to a number, the result is nan. with one argument, math.hypot() is equivalent to math.abs(). ...
...And 9 more matches
SVG documentation index - SVG: Scalable Vector Graphics
g, svg attribute the clip-path presentation attribute defines or associates a clipping path with the element it is related to. 42 clip-rule svg, svg attribute the clip-rule attribute only applies to graphics elements that are contained within a <clippath> element. the clip-rule attribute basically works as the fill-rule attribute, except that it applies to <clippath> def
initions. 43 clippathunits svg, svg attribute the clippathunits attribute indicates which coordinate system to use for the contents of the <clippath> element. 44 color svg, svg attribute the color attribute is used to provide a potential indirect value, currentcolor, for the fill, stroke, stop-color, flood-color, and lighting-color attributes. 45 co...
... to render the text, relative to other fonts in the same font family. 86 format deprecated, svg, svg attribute the format attribute indicates the format of the given font. 87 fr svg, svg attribute the fr attribute defines the radius of the focal point for the radial gradient. 88 from svg, svg attribute the from attribute indicates the
initial value of the attribute that will be modified during the animation. 89 fx svg, svg attribute the fx attribute defines the x-axis coordinate of the focal point for a radial gradient. 90 fy svg, svg attribute the fy attribute defines the y-axis coordinate of the focal point for a radial gradient. 91 g1 deprecated, svg, svg attribute t...
...vertical attribute affects the amount that hte current text position advances as each glyph is rendered. 96 glyphref deprecated, svg, svg attribute the glyphref attribute represents the glyph identifier, the format of which is dependent on the format of the given font. 97 gradienttransform svg, svg attribute the gradienttransform attribute contains the def
inition of an optional additional transformation from the gradient coordinate system onto the target coordinate system (i.e., userspaceonuse or objectboundingbox). this allows for things such as skewing the gradient. this additional transformation matrix is post-multiplied to (i.e., inserted to the right of) any previously defined transformations, including the implicit transformation necessary to con...
...And 9 more matches
core/heritage - Archive of obsolete content
not in the scope of this documentation. doing all of this manually is both tedious and error prone task. that is why sdk provides utility functions to make it more declarative and less verbose. class module exports class utility function for making constructor functions with a proper prototype chain setup in declarative manner: var { class } = require('sdk/core/heritage'); var dog = class({
initialize: function
initialize(name) { this.name = name; }, type: 'dog', bark: function bark() { return 'ruff! ruff!' } }); note: we use term class to refer an exemplar constructs in a form of constructor functions with a proper prototype chain setup. constructors created using class function don't require new keyword (even though it can be used) for instantiation. also, idiomatic sd...
...fluffy'); // instatiation fluffy instanceof dog // => true fluffy instanceof class // => true as you could notice from example above classes created via class function by default inherits from a class itself. ...
...iation fluffy instanceof dog // => true fluffy instanceof class // => true as you could notice from example above classes created via class function by default inherits from a class itself. ...
...And 8 more matches
Debugging on Mac OS X
occur with hardened runtime so it is recommended to test fixes with sip enabled. disabling sip has system security implications that should be understood before taking this step. creating an xcode project if you try to create a new xcode project in an existing directory then xcode will delete its existing contents (xcode will warn you beforehand). to work around that, the steps below have you
initialize the project outside the mozilla source tree, close the project, copy the .xcodeproj project "file" into the source tree, and then reopen the project to finish setting it up. note also that since xcode 7.3.1 it doesn't seem to be possible to have the xcode project live outside the source tree. if you try to do that then xcode will simply copy the source files under the project directory rat...
...ou originally created the xcode project in is under that, right click it and delete it. now, right click on the root item, select 'add files to "<project-name>"', select all the files and directories in your source directory, untick "copy items if needed", then click add. (these will then be progressively added under the root item <project-name> in the left-hand pane. note that subdirectories may
initially appear to be empty, but they too will progressively be populated as xcode processes the sourse files. once done, you should be able to open any file quickly by hitting cmd-shift-o and typing in the name of a file.) in the product menu, select scheme > new scheme and name your scheme (for example, "debug"). after you click ok, xcode should open the settings window for the new scheme. (if not...
...e problems when you try to run the executable for debugging since you will get build errors). click "close" to close the scheme editor. at this point you can run the application from xcode, and when you pause or hit breakpoints it should show open the correct source file at the correct line. setting up lldb lldb is the debugger xcode provides/uses. ...
...And 8 more matches
Using the viewport meta tag to control layout on mobile browsers
ocumentation says the content is a "comma-delimited list," but existing browsers and web pages use any mix of commas, semicolons, and spaces as separators. learn more about viewports in different mobile browsers in a tale of two viewports at quirksmode.org. viewport basics a typical mobile-optimized site contains something like the following: <meta name="viewport" content="width=device-width,
initial-scale=1"> the width property controls the size of the viewport. it can be set to a specific number of pixels like width=600 or to the special value device-width, which is the width of the screen in css pixels at a scale of 100%. (there are corresponding height and device-height values, which may be useful for pages with elements that change size or position based on the viewport height.) the...
...al-scale=1"> the width property controls the size of the viewport. it can be set to a specific number of pixels like width=600 or to the special value device-width, which is the width of the screen in css pixels at a scale of 100%. (there are corresponding height and device-height values, which may be useful for pages with elements that change size or position based on the viewport height.) the
initial-scale property controls the zoom level when the page is first loaded. the maximum-scale, minimum-scale, and user-scalable properties control how users are allowed to zoom the page in or out. usage of user-scalable=no can cause accessibility issues to users with visual impairments such as low vision. a pixel is not a pixel in recent years, screen resolutions have risen to the size that ind...
...pixel in recent years, screen resolutions have risen to the size that individual pixels are hard to distinguish with the human eye. for example, recent smartphones generally have a 5-inch screens with resolutions upwards of 1920—1080 pixels (~400 dpi). because of this, many browsers can display their pages in a smaller physical size by translating multiple hardware pixels for each css "pixel".
initially this caused usability and readability problems on many touch-optimized web sites. peter-paul koch wrote about this problem in a pixel is not a pixel. on high dpi screens, pages with
initial-scale=1 will effectively be zoomed by browsers. their text will be smooth and crisp, but their bitmap images will probably not take advantage of the full screen resolution. to get sharper images on these...
...And 8 more matches
Encrypt Decrypt MAC Keys As Session Objects
could not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } /* generate the symmetric key */ key = pk11_tokenkeygen(slot, mechanism, null, keysize, keyid, pr_true, pwdata); if (!key) { pr_fprintf(pr_stderr, "symmetric key generation failed \n"); } return key; } /* * mac
init */ secstatus mac
init(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digestop(ctx, msg, msglen); if (rv != secsuccess...
...stfinal(ctx, mac, maclen, maxlen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestfinal()\n"); } return secsuccess; } /* * compute mac */ secstatus computemac(pk11context *ctxmac, unsigned char *ptext, unsigned int ptextlen, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = mac
init(ctxmac); if (rv != secsuccess) return rv; rv = macupdate(ctxmac, ptext, ptextlen); if (rv != secsuccess) return rv; rv = macfinal(ctxmac, mac, maclen, maxlen); return rv; } /* * writetoheaderfile */ secstatus writetoheaderfile(const char *buf, unsigned int len, headertype type, prfiledesc *outfile) { secstatus rv; char header[40]; ...
...ailer, 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; } pr_fprintf(outfile, "%s\n", header); printashex(outfile, buf, len); pr_fprintf(outfile, "%s\n\n", trailer); return secsuccess; } /* *
initialize for encryption or decryption - common code */ pk11context * crypt
init(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem ivitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(ckm_aes_cbc, &ivitem); if (secparam == null) { pr_fprintf(pr_s...
...And 8 more matches
Encrypt and decrypt MAC using token
could not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } /* generate the symmetric key */ key = pk11_tokenkeygen(slot, mechanism, null, keysize, keyid, pr_true, pwdata); if (!key) { pr_fprintf(pr_stderr, "symmetric key generation failed \n"); } return key; } /* * mac
init */ secstatus mac
init(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digestop(ctx, msg, msglen); if (rv != secsuccess...
...stfinal(ctx, mac, maclen, maxlen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestfinal()\n"); } return secsuccess; } /* * compute mac */ secstatus computemac(pk11context *ctxmac, unsigned char *ptext, unsigned int ptextlen, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = mac
init(ctxmac); if (rv != secsuccess) return rv; rv = macupdate(ctxmac, ptext, ptextlen); if (rv != secsuccess) return rv; rv = macfinal(ctxmac, mac, maclen, maxlen); return rv; } /* * writetoheaderfile */ secstatus writetoheaderfile(const char *buf, unsigned int len, headertype type, prfiledesc *outfile) { secstatus rv; char header[40]; ...
...ailer, 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; } pr_fprintf(outfile, "%s\n", header); printashex(outfile, buf, len); pr_fprintf(outfile, "%s\n\n", trailer); return secsuccess; } /* *
initialize for encryption or decryption - common code */ pk11context * crypt
init(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem ivitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(ckm_aes_cbc, &ivitem); if (secparam == null) { pr_fprintf(pr_s...
...And 8 more matches
EncDecMAC using token object - sample 3
gin(slot)) { rv = pk11_authenticate(slot, pr_true, pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not authenticate to token %s.\n", pk11_gettokenname(slot)); return null; } } /* generate the symmetric key */ key = pk11_tokenkeygen(slot, mechanism, null, keysize, keyid, pr_true, pwdata); if (!key) { pr_fprintf(pr_stderr, "symmetric key generation failed \n"); } return key; } /* * mac
init */ secstatus mac
init(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digestop(ctx, msg, msglen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed ...
...int *maclen, unsigned int maxlen) { secstatus rv = pk11_digestfinal(ctx, mac, maclen, maxlen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestfinal()\n"); } return secsuccess; } /* * compute mac */ secstatus computemac(pk11context *ctxmac, unsigned char *ptext, unsigned int ptextlen, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = mac
init(ctxmac); if (rv != secsuccess) return rv; rv = macupdate(ctxmac, ptext, ptextlen); if (rv != secsuccess) return rv; rv = macfinal(ctxmac, mac, maclen, maxlen); return rv; } /* * writetoheaderfile */ secstatus writetoheaderfile(const char *buf, unsigned int len, headertype type, prfiledesc *outfile) { secstatus rv; char header[40]; char trailer[40]; char *outstring = null; switch (type) { case sym...
...; strcpy(trailer, mackey_trailer); break; case iv: strcpy(header, iv_header); strcpy(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; } pr_fprintf(outfile, "%s\n", header); printashex(outfile, buf, len); pr_fprintf(outfile, "%s\n\n", trailer); return secsuccess; } /* *
initialize for encryption or decryption - common code */ pk11context * crypt
init(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem ivitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(ckm_aes_cbc, &ivitem); if (secparam == null) { pr_fprintf(pr_stderr, "crypt failed : secparam null\n"); retu...
...And 8 more matches
Mozilla internal string guide
hat the previous sentence says. to make the string longer, call setlength() before beginwriting() or use the bulkwrite() api described below. bulk write bulkwrite() allows capacity-aware cache-friendly low-level writes to the string's buffer. capacity-aware means that the caller is made aware of how the caller-requested buffer capacity was rounded up to mozjemalloc buckets. this is useful when
initially requesting best-case buffer size without yet knowing the true size need. if the data that actually needs to be written is larger than the best-case estimate but still fits within the rounded-up capacity, there is no need to reallocate despite requesting the best-case capacity. cache-friendly means that the zero terminator for c compatibility is written after the new content of the string ha...
...r, given that nsdependentcstring will also wrap a string value in an nscstring. the advantage of the user-defined literals is that the length of these strings is calculated at compile time, so the string does not need to be scanned at runtime to determine its length. nowadays, all supported platforms have 16-bit literals using u""_ns, so we longer need to rely on macros for portability. ...
...tage of the user-defined literals is that the length of these strings is calculated at compile time, so the string does not need to be scanned at runtime to determine its length. nowadays, all supported platforms have 16-bit literals using u""_ns, so we longer need to rely on macros for portability. ...
...And 8 more matches
nsICryptoHash
lculate the sha256 hash of a file to determine if it contains the data you think it does. the hash algorithms supported are md2, md5, sha-1, sha-256, sha-384, and sha-512. 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview acstring finish(in prbool aascii); void
init(in unsigned long aalgorithm); void
initwithstring(in acstring aalgorithm); void update([const, array, size_is(alen)] in octet adata, in unsigned long alen); void updatefromstream(in nsiinputstream astream, in unsigned long alen); constants hash algorithms these constants are used by the
init() method to indicate which hashing function to use. the values map dir...
...orithm 2 md5 2 message-digest algorithm 5 sha1 3 secure hash algorithm 1 sha256 4 secure hash algorithm 256 sha384 5 secure hash algorithm 384 sha512 6 secure hash algorithm 512 methods finish() completes the hash object and produces the actual hash data. note: this method may be called any time after " .. manch("
init") .. " is called. this call resets the object. acstring finish( in prbool aascii ); parameters aascii if true then the returned value is a base-64 encoded string. if false, then the returned value is binary data. return value this method returns a hash of the data that was read by this object. this can be either binary data or a base-64 encoded string. exceptions thrown ns_error_n...
..... " is called. this call resets the object. acstring finish( in prbool aascii ); parameters aascii if true then the returned value is a base-64 encoded string. if false, then the returned value is binary data. return value this method returns a hash of the data that was read by this object. this can be either binary data or a base-64 encoded string. ...
...And 8 more matches
nsIProcess
riptable this interface represents an executable process. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/process/util;1. ...
...cutable process. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/process/util;1. ...
... 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 removed entirely in gecko 1.9.2. processsignature unsigned long the process signature. 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. ...
...And 8 more matches
Add to iPhoto
type. core foundation the majority of the system routines we'll be using come from core foundation. among these are routines for managing cfstring, cfurl, and cfarray objects, among others. these are core system data formats that are used by other frameworks, and we'll be making use of them. ...
...anaging cfstring, cfurl, and cfarray objects, among others. these are core system data formats that are used by other frameworks, and we'll be making use of them. the core foundation api is implemented by the corefoundation object, which consists of two methods to
initialize and shut down the library, a reference to the library, and all the types and methods declared to support core foundation. ...
...ay objects, among others. these are core system data formats that are used by other frameworks, and we'll be making use of them. the core foundation api is implemented by the corefoundation object, which consists of two methods to
initialize and shut down the library, a reference to the library, and all the types and methods declared to support core foundation. ...
...And 8 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
ction (see the "this" problem for details). the following code is also available on github. for a more complex but still modular version of it (daemon) see javascript daemons management. this more complex version is nothing but a big and scalable collection of methods for the daemon constructor. however, 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 remains the recommended way for simple animations, because daemon without its collection of methods is essentially a clone of it. minidaemon.js /*\ |*| |*| :: minidaemon :: |*| |*| revision #2 - september 26, 2014 |*| |*| /docs/web/api/window.setinterval |*| https://developer.mozilla.org/use...
...is released under the gnu lesser general public license, version 3 or later. ...
...-1 : 1; if (odmn.task.call(odmn.owner, odmn.index, odmn.length, odmn.backw) === false || odmn.isatend()) { odmn.pau...
...And 8 more matches
Classes and Inheritance - Archive of obsolete content
data members are properties that allow each instance to have their own state, whereas member functions are properties that allow instances to have behavior. inheritance allows classes to inherit state and behavior from an existing classes, known as the base class. unlike languages like c++ and java, javascript does not have native support for classical inheritance. ...
... a constructor call instead, the constructor for shape would have been applied to a different object than the constructor for circle. we can now use the above constructor to create instances of the class circle: let circle = circle(2, 3, 5); circle instanceof circle; // => true circle.x; // => 2 circle.y; // => 3 circle.radius; // => 5 inheritance and prototypes there is a problem with the def
inition of circle in the previous section that we have glossed over thus far. consider the following: let circle = circle(2, 3, 5); circle.draw(); // => typeerror: circle.draw is not a function this is not quite right. the method draw is defined on instances of shape, so we def
initely want it to be defined on instances of circle. the problem is that draw is defined on the prototype of shape, but no...
... the lookup succeeds. the resulting behavior is what we were aiming for. inheritance and instanceof the single line of code we added in the previous section solved the problem with prototypes, but introduced a new problem with the instanceof operator. consider the following: let circle = circle(2, 3, 5); circle instanceof shape; // => false since instances of circle inherit from shape, we def
initely want the result of this expression to be true. to understand why it is not, we need to understand how instanceof works. every prototype has a constructor property, which is a reference to the constructor for objects with this prototype. in other words: circle.prototype.constructor == circle // => true the instanceof operator compares the constructor property of the prototype of the left han...
...And 7 more matches
File I/O - Archive of obsolete content
note: file objects are nsifile. for legacy reasons, there is also an nsilocalfile interface. creating an nsifile object components.utils.import("resource://gre/modules/fileutils.jsm"); var file = new fileutils.file("/home"); or the same without using fileutils.jsm: var file = components.classes["@mozilla.org/file/local;1"]. createinstance(components.interfaces.nsilocalfile); file.
initwithpath("/home"); note: the path should be in the "native" form (for example"c:\\windows"). if you need to use file:// uris as
initializers, see discussion of nsiioservice below. note: you can still get a file object even if the specified file does not exist, and no exception will be thrown. an exception is thrown only when methods that require the file to exist are called, e.g., isdirectory(...
...r chrome directory in their profile: %profile%/chrome. resource:app d the application directory in an xulrunner application. look in the source for other strings available: xpcom/io/nsappdirectoryservicedefs.h, xpcom/io/nsdirectoryservicedefs.h. other such keys as the "profd" key are available; check the known locations. enumerating drives on windows while you can use
initwithpath("/") on unix-like systems (linux, mac) to get the root of the file system, there's no such root on windows. however, you can enumerate available drives using the following code: components.utils.import("resource://gre/modules/fileutils.jsm"); var root = new fileutils.file("\\\\."); var drivesenum = root.directoryentries, drives = []; while (drivesenum.hasmoreelements()) { drives.push(...
...e file for reading or writing. reading a file // |file| is nsifile var data = ""; var fstream = components.classes["@mozilla.org/network/file-input-stream;1"]. createinstance(components.interfaces.nsifileinputstream); var cstream = components.classes["@mozilla.org/intl/converter-input-stream;1"]. ...
...And 7 more matches
Skinning XUL Files by Hand - Archive of obsolete content
javascript that dynamically switches between these styles. mozilla's current global skin defines this basic behavior for several classes of button. a button is styled by the global skin when its class attribute is set to a class which is defined in the global skin. for example, when a button is defined as follows: <button class="plain" label="push me" /> then the following very simple style def
inition applies to that button. button.plain { border: 0px !important; } the global skin, in which styles for these several button classes and dozens of other elements are defined, is described in the following section. if you want to use the classes already defined in mozilla's global skin to style your elements, you may do so. but you may also want to define new classes of buttons particular to y...
...the following section. if you want to use the classes already defined in mozilla's global skin to style your elements, you may do so. but you may also want to define new classes of buttons particular to your xul file, in which case the style information will be wholly defined within your custom css file. reading the global skin it's very important to familiarize yourself with the basic style def
initions in the global skin before you set out creating your own stylesheet. css can quickly become complicated. the ability to apply styles to elements of a type, to specifically identified elements, and to classes of elements creates the potential for redundancies or conflicts in the style information. to avoid this, the makers of the css specification have created some rules of precedence that look...
...uickly become complicated. the ability to apply styles to elements of a type, to specifically identified elements, and to classes of elements creates the potential for redundancies or conflicts in the style information. to avoid this, the makers of the css specification have created some rules of precedence that look at how many different rules have been defined for an element, where the style def
initions appear (i.e., externally in a css file or inline), where the elements themselves appear, and other esoteric variables. if you create a style in your custom stylesheet for a button with a particular id, for example, some of the more basic style information for buttons in the global skin may take precedence over your new style and cause it not to be applied. make sure you are aware of the way t...
...And 7 more matches
Eclipse CDT
system requirements 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. ...
...se's memory limits! make sure you do this! before you use eclipse with the mozilla source you must increase its memory limits. when eclipse's indexer tries to process the mozilla source, eclipse will need considerably more memory than the limits imposed by its default configuration. you can increase eclipse's memory limits using the eclipse.ini that lives alongside the eclipse binary. set an
initial heap space of 1 gb and max heap space of 5 gb, say, by modifying the values of the following two lines in eclipse.ini: -xms1g -xmx5g if you fail to increase these limits, then you will likely find that eclipse either hangs when it tries to index the mozilla source or else that the code intelligence is very broken after the indexing "completes". express setup for the eclipse indexer to work...
...not include results for sections of the code that are ifdef'ed out by the configuration used to create your object directory. for example, if you are using a mac and you search for callers of nsdisplaylistbuilder::isintransform, the results will not include the caller in nsobjectframe.cpp because that caller is wrapped in "#ifndef xp_macosx". just something to keep in mind. ;-) to jump to the def
inition of a symbol (or the declaration of a symbol if already at the def
inition), hover over the symbol, hold down the ctrl/cmd key, move the mouse slightly to linkify the symbol, then click on it. (having to move the mouse slightly is eclipse bug 26873). alternately, you can jump to the def
inition of the symbol under the cursor by pressing f3. to do a c++ symbol search select "search > c/c++" from ...
...And 7 more matches
source-editor.jsm
o 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. ...
...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. ...
...e that indicates whether or not to automatically expand tabs out to a series of spaces. sourceeditor.prefs.tab_size "devtools.editor.tabsize" an integer value that specifies the number of spaces per tab. editor mode constants these constants are used to set the syntax highlighting mode for the editor by calling its setmode() method, or in the configuration object when first
initializing the editor using its
init() method. constant value description sourceeditor.modes.css "css" cascading style sheet. sourceeditor.modes.html "html" html document. sourceeditor.modes.javascript "js" javascript source code. sourceeditor.modes.text "text" utf-8 text document. sourceeditor.modes.xml "xml" ...
...And 7 more matches
JSS Provider Notes
you have two choices. use the binary release of jss from mozilla.org. apply for your own jce code-signing certificate following the procedure at how to implement a provider for the javatm cryptography extension. then you can sign your own jss jar file. installing the provider in order to use any part of jss, including the jca provider, you must first call cryptomanager.
initialize(). by default, the jca provider will be installed in the list of providers maintained by the java.security.security class. if you do not wish the provider to be installed, create a cryptomanager.
initializationvalues object, set its installjssprovider field to false, and pass the
initializationvalues object to cryptomanager.
initialize(). specifying the cryptotoken all cryptographic o...
...lt token (by calling cryptomanager.getthreadtoken()) and instructs the new object to use that token for cryptographic operations. the per-thread default token setting is only consulted inside getinstance(). once a jca object has been created it will continue to use the same token, even if the application later changes the per-thread default token. whenever a new thread is created, its token is
initialized to the default, the internal key storage token. thus, the thread token is not inherited from the parent thread. the following example shows how you can specify which token is used for various jca operations: // lookup pkcs #11 tokens cryptomanager manager = cryptomanager.getinstance(); cryptotoken tokena = manager.gettokenbyname("tokena"); cryptotoken tokenb = manager.gettokenbyname...
....setthreadtoken(tokena); keypairgenerator rsakpg = keypairgenerator.getinstance("rsa", "mozilla-jss"); // create a dsa keypairgenerator using tokenb manager.setthreadtoken(tokenb); keypairgenerator dsakpg = keypairgenerator.getinstance("dsa", "mozilla-jss"); // generate an rsa keypair. this will happen on tokena because tokena // was the per-thread default token when rsakpg was created. ...
...And 7 more matches
How to embed the JavaScript engine
ntext. ...
...* the class of the global object. */ static jsclass global_class = { "global", jsclass_global_flags, js_propertystub, js_deletepropertystub, js_propertystub, js_strictpropertystub, js_enumeratestub, js_resolvestub, js_convertstub, nullptr, nullptr, nullptr, nullptr, js_globalobjecttracehook }; int main(int argc, const char *argv[]) { js_
init(); jsruntime *rt = js_newruntime(8l * 1024 * 1024, js_use_helper_threads); if (!rt) return 1; jscontext *cx = js_newcontext(rt, 8192); if (!cx) return 1; { // scope for our various stack objects (jsautorequest, rootedobject), so they all go // out of scope before we js_destroycontext. jsautorequest ar(cx); // in practice, you would want to exit ...
...st ar(cx); // in practice, you would want to exit this any // time you're spinning the event loop js::rootedobject global(cx, js_newglobalobject(cx, &global_class, nullptr, js::fireonnewglobalhook)); if (!global) return 1; js::rootedvalue rval(cx); { // scope for jsautocompartment jsautocompartment ac(cx, global); js_
initstandardclasses(cx, global); const char *script = "'hello'+'world, it is '+new date()"; const char *filename = "noname"; int lineno = 1; bool ok = js_evaluatescript(cx, global, script, strlen(script), filename, lineno, &rval); if (!ok) return 1; } jsstring *str = rval.tostring(); printf("%s\n", js_encodestring(cx, str)); } ...
...And 7 more matches
Reference Manual
e pointer, you should be able to use an nscomptr. an nscomptr is the exact same size and shape as a raw xpcom interface pointer. it can be used as a member variable without introducing bloat. most of 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>...
...tr<nsisupports> to mean "any xpcom interface." it would be annoying if nscomptr forced you to queryinterface to the xpcom-correct nsisupports within an object in places where you don't care to know the exact type. null-dereference safeguards an nscomptr will also assert at runtime if you try to dereference it when it is void, e.g., nscomptr<nsifoo> foo; // note: default
initialized to |0| foo->dosomething(); // ns_precondition: "you can't dereference a null nscomptr with operator->()" a similar precondition intervenes on behalf of operator*. reference-counting safeguards all of the operations that extract the underlying raw pointer out of an nscomptr use a c trick to implement another safety feature. the pointer returned cannot be addrefed, releas...
...ored into a base class now must become template-specific inlines. there is no factored base class. this implies that the entire application must be compiled with the same setting of nscap_feature_debug_ptr_types, else some parts will be expecting a base class and others will not. the app will not link. unit tests the unit tests for nscomptr can be found in the file /xpcom/tests/testcomptr.cpp
initialization and assignment built-in forms assignment into, or
initialization of an nscomptr is easy to understand. the nscomptr releases its old value, if any, and then assigns in the new value, addrefing it and/or calling queryinterface as you direct by "annotating" the assignment with directives like dont_addref. this section describes each of the possibilities, though the directives can be more ...
...And 7 more matches
dx - SVG: Scalable Vector Graphics
ndividual 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. ...
...re 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 def
inition of 'dx' in that specification. ...
...ues 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 def
inition of 'dx' in that specification. ...
...And 7 more matches
dy - SVG: Scalable Vector Graphics
vidual 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. ...
...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 def
inition of 'dy' in that specification. ...
... 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 def
inition of 'dy' in that specification. ...
...And 7 more matches
xlink:href - SVG: Scalable Vector Graphics
animatable yes tref for <tref>, xlink:href defines a reference to an element whose character data content shall be used as character data for this <tref> element. ...
...lement. value <iri> default value none animatable yes specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'href for <a>' in that specification. recommendation defines href for the <a> element. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'href for <altglyph>' in that specification. recommendation defines href for the <altglyph> element. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'href for <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set>' in that specification. recommendation defines href for animation elements. scalable vector graphics (svg) 1.
...h>' in that specification. recommendation defines href for the <altglyph> element. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'href for <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set>' in that specification. recommendation defines href for animation elements. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'href for <color-profile>' in that specification. recommendation defines href for the <color-profile> element. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'href for <cursor>' in that specification. ...
...And 7 more matches
Understanding WebAssembly text format - WebAssembly
oat f64: 64-bit float a single parameter is written (param i32) and the return type is written (result i32), hence a binary function that takes two 32-bit integers and returns a 64-bit float would be written like this: (func (param i32) (param i32) (result f64) ... ) after the signature, locals are listed with their type, for example (local i32). parameters are basically just locals that are
initialized with the value of the corresponding argument passed by the caller. getting and setting locals and parameters locals/parameters can be read and written by the body of the function with the local.get and local.set instructions. the local.get/local.set commands refer to the item to be got/set by its numeric index: parameters are referred to first, in order of their declaration, followed by...
...const 0) "hi") (func (export "writehi") i32.const 0 ;; pass offset 0 to log i32.const 2 ;; pass length 2 to log call $log)) note: above, note the double semi-colon syntax (;;) for allowing comments in webassembly files. now from javascript we can create a memory with 1 page and pass it in. this results in "hi" being printed to the console: var memory = new webassembly.memory({
initial:1}); var importobject = { console: { log: consolelogstring }, js: { mem: memory } }; webassembly.instantiatestreaming(fetch('logger2.wasm'), importobject) .then(obj => { obj.instance.exports.writehi(); }); note: you can find the full source on github as logger2.html (also see it live). webassembly tables to finish this tour of the webassembly text format, let’s look at the mos...
...e and corrupt raw function addresses, which is something that cannot be allowed on the web. the solution was to store function references in a table and pass around table indices instead, which are just i32 values. call_indirect’s operand can therefore simply be an i32 index value. ...
...And 7 more matches
JavaScript Object Management - Archive of obsolete content
t should come in handy when you have general utility functions or properties that you want to use across all objects within the namespace. for instance, there are frequently used xpcom services such as the observer service that can be included as members in the namespace: /** * 〈namespace〉 namespace. ...
...general utility functions or properties that you want to use across all objects within the namespace. for instance, there are frequently used xpcom services such as the observer service that can be included as members in the namespace: /** * 〈namespace〉 namespace. */ if (typeof 〈namespace〉 == "undefined") { var 〈namespace〉 = { /** *
initializes this object. ...
...s such as the observer service that can be included as members in the namespace: /** * 〈namespace〉 namespace. */ if (typeof 〈namespace〉 == "undefined") { var 〈namespace〉 = { /** *
initializes this object. */
init : function() { this.obsservice = cc["@mozilla.org/observer-service;1"].getservice(ci.nsiobserverservice); } }; 〈namespace〉.
init(); }; js objects can also be treated as string-indexed arrays: // equivalent. 〈namespace〉.hello = {}; 〈namespace〉["hello"] = {}; // equivalent. 〈namespace〉.hello.
init(); 〈namespace〉.hello["
init"](); this is very useful in cases where you have to set attributes or functions with dynamically generated names. it's one of the funky properties of javascript: all objects a...
...And 6 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
)} /> if you try your app out now, you'll see that the page is now blank, and in your devtools web console you'll see an error along the lines of: typeerror: nameel is undefined. to understand what's happening here, let's talk some more about that component lifecycle we mentioned earlier. component lifecycle, and the onmount() function when a component is instantiated, svelte runs the
initialization code (that is, the <script> section of the component). but at that moment, all the nodes that comprise the component are not attached to the dom, in fact, they don't even exist. so, how can you know when the component has already been created and mounted on the dom? the answer is that every component has a lifecycle that starts when it is created, and ends when it is destroyed. there a...
...ecycle. the one you'll use most frequently is onmount(), which lets us run a callback as soon as the component has been mounted on the dom. let's give it a try and see what happens to the nameel variable. ...
... the newtodo.svelte <script> section: import { onmount } from 'svelte' and these lines at the end of it: console.log('
initializing:', nameel) onmount( () => { console.log('mounted:', nameel) }) now remove the if (autofocus) nameel.focus() line to avoid throwing the error we were seeing before. the app will now work again, and you'll see the following in your console:
initializing: undefined mounted: <input id="todo-0" class="input input__lg" type="text" autocomplete="off"> as you can see, while the component is
initializing nameel is undefined, which makes sense because the node input doesn't even exist yet. after the component has been mounted, svelte assigned a reference to the <input> dom node to the nameel variable, thanks to the bind:this={nameel} directiv...
...And 6 more matches
HTML parser threading
be refactored into a separate class in due course.) nshtml5streamparser contains the code for dealing with data from the network. nshtml5parser owns nshtml5streamparser. script-created parsers (i.e. parsers created using document.open()) don't have an nshtml5streamparser instance. nshtml5parser has one tokenizer/tree builder pair for parsing data from document.write(). it also has another lazily
initialized tokenizer/tree builder for speculatively scanning the tail of document.write() data when the parser blocks without parsing the document.write() data to completion. nshtml5streamparser has one tokenizer/tree builder pair for parsing data from the network. additionally, each nshtml5parser has an associated nshtml5treeopexecutor that turns the output (tree operations; discussed later) of the ...
...tail of document.write() data when the parser blocks without parsing the document.write() data to completion. nshtml5streamparser has one tokenizer/tree builder pair for parsing data from the network. additionally, each nshtml5parser has an associated nshtml5treeopexecutor that turns the output (tree operations; discussed later) of the portable parser core into actions performed on the gecko dom. ...
...that method call doesn't yet cause anything to be parsed, though. actual network data is passed to an nsistreamlistener. ...
...And 6 more matches
Mozilla-JSS JCA Provider notes
er for jce algorithms. you have two choices. use the binary release of jss from mozilla.org. apply for your own jce code-signing certificate following the procedure at how to implement a provider for the javatm cryptography extension. then you can sign your own jss jar file. installing the provider in order to use any part of jss, including the jca provider, you must first call cryptomanager.
initialize(). by default, the jca provider will be installed in the list of providers maintained by the java.security.security class. if you do not wish the provider to be installed, create a cryptomanager.
initializationvalues object, set its installjssprovider field to false, and pass the
initializationvalues object to cryptomanager.
initialize(). specifying the cryptotoken all cryptographic operatio...
...fault token (by calling cryptomanager.getthreadtoken()) and instructs the new object to use that token for cryptographic operations. the per-thread default token setting is only consulted inside getinstance(). once a jca object has been created it will continue to use the same token, even if the application later changes the per-thread default token. whenever a new thread is created, its token is
initialized to the default, the internal key storage token. thus, the thread token is not inherited from the parent thread. the following example shows how you can specify which token is used for various jca operations: // lookup pkcs #11 tokens cryptomanager manager = cryptomanager.getinstance(); cryptotoken tokena = manager.gettokenbyname("tokena"); cryptotoken tokenb = manager.gettokenbyname("token...
....setthreadtoken(tokena); keypairgenerator rsakpg = keypairgenerator.getinstance("mozilla-jss", "rsa"); // create a dsa keypairgenerator using tokenb manager.setthreadtoken(tokenb); keypairgenerator dsakpg = keypairgenerator.getinstance("mozilla-jss", "dsa"); // generate an rsa keypair. this will happen on tokena because tokena // was the per-thread default token when rsakpg was created. ...
...And 6 more matches
PKCS #11 Module Specs
he value is terminated with and ending quote of the form ', ", ), ], }, or > matching the respective starting quote. ending quotes can be escaped. embedded '\' charaters are considered escape characters for the next character in the stream. note that case must be preserved in the values. these modules specs can be passed by the application directly to nss via the secmod_loadusermodule() call. ...
... in additions applications/libraries should be able to ignore additional name value pairs which are used to specify configuration for other applications. of course these application/libraries should be able to parse their own name/value pairs. each of these name/value pairs are optional. ...
...rameters are passed to the pkcs #11 module. if the application/library does not find its application/library specific data, it should use it's defaults for this pkcs #11 library. ...
...And 6 more matches
sslerr.html
soft token" in the internal virtual slot, that could do the job. may indicate a server configuration error, such as having a certificate that is inappropriate for the key exchange algorithm selected. ...
...on a server socket, indicates a failure of one of the following: (a) to unwrap the pre-master secret from the clientkey...
...on a server socket, indicates a failure of one of the following: (a) to unwrap the pre-master secret from the clientkeyexchange message, (b) to derive the master secret ...
...And 6 more matches
sslintro.html
ication chapter 1 overview of an ssl application ssl and related apis allow compliant applications to configure sockets for authenticated, tamper-proof, and encrypted communications. this chapter introduces some of the basic ssl functions. chapter 2, "getting started with ssl" illustrates their use in sample client and server applications. an ssl application typically includes five parts:
initialization configuration communication functions used by callbacks cleanup although the details differ somewhat for client and server applications, the concepts and many of the functions are the same for both. warning: some of the ssl header files provided as part of nss 2.0 include both public apis documented in the nss 2.0 documentation set and private apis intended for internal use...
...ed as part of nss 2.0 include both public apis documented in the nss 2.0 documentation set and private apis intended for internal use by the nss implementation of ssl. you should use only the ssl apis (and related certificate, key, and pkcs #11 apis) that are described in this document, the ssl reference. other apis that may be exposed in the header files are not supported for application use.
initialization
initialization includes setting up configuration files, setting global defaults, and setting up callback functions. functions used in the
initialization part of an application can include the following: pr_
init.
initializes nspr. must be called before any other nss functions. pk11_setpasswordfunc. sets the global callback function to obtain passwords for pkcs #11 modules. requ...
...required. ssl_optionsetdefault. changes default values for all subsequently opened sockets as long as the application is running (compare with ssl_seturl which only configures the socket that is currently open). ...
...And 6 more matches
Rhino scopes and contexts
imultaneously in the same scope. rhino guarantees that accesses to properties of javascript objects are atomic across threads, but doesn't make any more guarantees for scripts executing in the same scope at the same time. if two scripts use the same scope simultaneously, the scripts are responsible for coordinating any accesses to shared variables. a top-level scope is created by calling context.
initstandardobjects to create all the standard objects: scriptableobject scope = cx.
initstandardobjects(); the easiest way to embed rhino is just to create a new scope this way whenever you need one. however,
initstandardobjects is an expensive method to call and it allocates a fair amount of memory. we'll see below that there are ways to share a scope created this way among multiple scopes and thr...
...ing a property of an object in javascript, the object is first searched for a property with the given name. if none is found, the object's prototype is searched. this continues until either the object is found or the end of the prototype chain is reached. so to share information across multiple scopes, we first create the object we wish to share. typically this object will have been created with
initstandardobjects and may also have additional objects specific to the embedding. then all we need to do is create a new object and call its setprototypemethod to set the prototype to the shared object, and the parent of the new scope to null: scriptable newscope = cx.newobject(sharedscope); newscope.setprototype(sharedscope); newscope.setparentscope(null); the call to newobject simply creates a ...
.... then all we need to do is create a new object and call its setprototypemethod to set the prototype to the shared object, and the parent of the new scope to null: scriptable newscope = cx.newobject(sharedscope); newscope.setprototype(sharedscope); newscope.setparentscope(null); the call to newobject simply creates a new javascript object with no properties. it uses thesharedscope passed in to
initialize the prototype with the standard object.prototype value. we can now use newscope as a scope for calls to evaluate scripts. let's call this scope the instance scope. any top-level functions or variables defined in the script will end up as properties of the instance scope. uses of standard objects like function, string, or regexp will find the def
initions in the shared scope. multiple instan...
...And 6 more matches
GCIntegration - SpiderMonkey Redirect 1
ked. in addition, objects allocated during the incremental gc are marked unconditionally. at the end of the gc, any reachable object must have been newly allocated or else reachable at the beginning, since objects can never go from unreachable to reachable. the end result is that all reachable objects are marked. a simple way to visualize the invariant is that, when an incremental gc starts, an "
initial snapshot" of the heap is taken. the snapshot consists of all objects reachable from the roots via traced pointers--as if someone did a js_dumpheap() at the beginning of the incremental gc. these objects, as well as any that were allocated since the gc started, are guaranteed to be marked. the write barrier guarantees the snapshot-at-the-beginning (satb) invariant in a simple way. if, in the m...
...inning (satb) invariant in a simple way. if, in the middle of an incremental gc, a pointer to an object x is destroyed (meaning overwritten or no longer traced for some reason), then x will be marked. in the diagram above, c will be marked when the pointer from a to c is nulled out. this barrier is conservative—it assumes that any destroyed pointer was pointing to an object that was part of the
initial snapshot. consequently, more objects may be marked than necessary, but those objects will be collected in the next gc if they're unreachable. spidermonkey implements the write barrier internally. any time a property is updated in the vm or the jit, a write barrier is invoked. the troublesome spots are the pointers in gecko that spidermonkey doesn't know about. to understand the problem more, ...
...y're unreachable. spidermonkey implements the write barrier internally. any time a property is updated in the vm or the jit, a write barrier is invoked. the troublesome spots are the pointers in gecko that spidermonkey doesn't know about. ...
...And 6 more matches
TPS Tests
you will almost certainly see cleanup-profile1 or similar in the logs. that's what that phase is doing, it does any necessary cleanup for the phase, primarially unregistering the device associated with that profile. tps tests tend to be broken down into three sections, in the following order (we'll cover these out of order, for the sake of simplicity) phase declarations (mandatory). data def
initions/asset list (optional, but all current tests have them). phase implementation (mandatory) it's worth noting that some parts of tps assume that it can read the number off the end of the phase or profile to get to the next one, so try to stick to the convention established in the other tests. yes, this is cludgey, but it's effective enough and nobody has changed it. phase declarations th...
...with the profile from the phases object that corresponds to this test phase. performs the specified actions in sequence. determines if the phase passed or failed; if it passed, it continues to the next phase block and repeats the process. a phase is defined by calling the phase function with the name of the phase and a list of actions to perform: phase('phase1', [ [bookmarks.add, bookmarks_
initial], [passwords.add, passwords_
initial], [history.add, history_
initial], [sync, sync_wipe_server], ]); each action is an array, the first member of which is a function reference to call, the other members of which are parameters to pass to the function. each type of asset list has a number of built-in functions you can call, described in the section on asset lists; there are also some ad...
... if no options are passed, a default sync operation is performed. otherwise, a special sync can be performed if one of the following are passed: sync_wipe_server, sync_wipe_client, sync_reset_client. ...
...And 6 more matches
Secure Development Guidelines
memory leaks example: void *p; size_t new_size; p = realloc(p, new_size); if (p == null) { /* handle error */ } memory leaks: prevention tools like valgrind can he...
... memory leaks example: void *p; size_t new_size; p = realloc(p, new_size); if (p == null) { /* handle error */ } memory leaks: prevention tools like valgrind can help detect memory leaks writing secure code: object manag...
... memory leaks example: void *p; size_t new_size; p = realloc(p, new_size); if (p == null) { /* handle error */ } memory leaks: prevention tools like valgrind can help detect memory leaks writing secure code: object management reference counting issues real-life...
...And 6 more matches
Component Internals
a cross-platform user interface, and others. another, even more basic view of this relationship of components to the files and interfaces that define them is shown in onion peel view of xpcom component creation in the next chapter. the component is an abstraction sitting between the actual module in which it is implemented and the objects that its factory code creates for use by clients. ...
...iles and interfaces that define them is shown in onion peel view of xpcom component creation in the next chapter. the component is an abstraction sitting between the actual module in which it is implemented and the objects that its factory code creates for use by clients. xpcom
initialization to understand why and when your component library gets called, it is important to understand the xpcom
initalization process. when an application starts up, that application may
initialize xpcom. the sequence of events that kicks off this xpcom
initialization may be triggered by user action or by the application startup itself. a web browser that embeds gecko, for example, may
initialize xpcom at startup through the embedding apis. another application may delay this startup until xpcom is needed for th...
...parameters passed to this startup call allow you to configure some aspects of xpcom, including the customization of location of specific directories. ...
...And 6 more matches
Starting WebLock
observer is a generic interface for passing messages between two or more objects without defining a specific frozen interface, and it's one of the ways in which extensibility is built into xpcom. the implementation of the nsiobserver interface in the weblock component is similar to the implementation for the nsifactory interface. xxx what is example 2?following example 2, you change the class def
inition to support the nsiobserver interface and change ns_impl_isupports1 so that the queryinterface implementation knows that the component also supports nsiobserver. the weblock class def
inition with support for startup observation is below. class weblock: public nsiobserver { public: weblock(); virtual ~weblock(); ns_decl_isupports ns_decl_nsiobserver }; ns_impl_isupports1(web...
...of the functions can be anything you wish. both functions are passed the component manager and the path to the component, including the opaque registrylocation. these are also parameters in the nsimodule implementation in xxx what is example 1? link to it hereexample 1. in addition to these parameters, the callback functions are passed the nsmodulecomponentinfo struct, which is the same structure
initially passed into ns_impl_nsgetmodule. during registration, the registration callback is where you get the nsicategorymanager. once you have it, you can add the component to the category of components that get started automatically. as a service, the nsicategorymanager is accessible via the nsiservicemanager. also note that the nsicomponentmanager is passed into the callback. since the object tha...
...ger. the next step is to figure out which parameters to pass to the method. there is a category name and a name-value pair, but since the name-value pair meaning is category-specific, you need to figure out which category to use. there are two startup notifications, both of which create the observer if it isn't already created. the first is provided by xpcom. this notification will occur during
initialization of xpcom, where all xpcom services are guaranteed to be available during the calls. embedding applications may provide other notifications. common xpcom notifications category name value creates component xpcom-startup any contract id yes xpcom-shutdown any contract id no xpcom-autoregistration any contract id no ...
...And 6 more matches
Introduction to XPCOM for the DOM
ery robust. indeed, if someone decides to change the name or the signature of the methods you use, you will have to change all the calls to those methods throughout your code. as opposed to a concreate class, an interface is supposed to be more stable through time. indeed, many interfaces in the mozilla code are frozen (this is indicated by the comment @frozen at the beginning of the interface def
inition). that means that the interface will never change anymore. the good thing is that your code will (in the best condition) last forever. the bad thing is that we have to find a way to improve those interfaces, and freezing them obliges implementers to create new interfaces. in summary, manipulate an interface rather than its implementation whenever possible! a pointer to an interface nsifoo impl...
...und even if we don't need it. in both cases it's very bad, and we have to be extremely careful with the refcounting. fortunately, there are nscomptr's to make our life easier. nscomptr scott collins blessed us with the nscomptr, now let's use them. nscomptr's are an extension of the c auto_ptr, managing the reference counting operations for you, and providing several facilities for comparison,
initialization, etc... an nscomptr is used like an usual pointer to an interface in most cases. an usual pointer to an interface nsifoo is declared as follows: nsifoo *fooptr; an nscomptr to the same nsifoo interface is declared as follows: nscomptr<nsifoo> fooptr; the rest of the use of nscomptr's is described in the next section. for more information about nscomptr's, please read the user's gu...
...terface. you don't need to know anything else. so how do we use queryinterface() to get a pointer to nsifoo2 if we have a pointer to nsifoo? since we cannot re-use ifooptr, we create a new pointer to nsifoo2, ifooptr2. the following syntax is the preferred one (to use only with nscomptr's): nscomptr<nsifoo2> ifooptr2 (do_queryinterface(ifooptr)); that syntax is the preferred one to declare and
initialize an nscomptr at the same time. if you have to assign it another address later, you can easily do ifooptr2 = do_queryinterface(another_pointer); this syntax however is just a convenient shortcut to the real function. below is how one would use the queryinterface() function with raw pointers. nsifoo2 *ifooptr2; ifooptr->queryinterface(ns_get_iid(nsifoo2), (void **)&ifooptr2); ns_get_iid ...
...And 6 more matches
nsIBrowserSearchService
st changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/browser/search-service;1. to access this service, use: var browsersearchservice = components.classes["@mozilla.org/browser/search-service;1"] .getservice(components.interfaces.nsibrowsersearchservice); attempting to use any method or attribute of this interface before
init() has completed will force the service to fall back to a slower, synchronous,
initialization. this is not an issue if your code is executed in reaction to a user interaction, as
initialization is complete by then, but this is an issue if your code is executed during startup. if you need to write code that is executed during startup and makes use of nsibrowsersearchservice, you should make sure ...
...back to a slower, synchronous,
initialization. this is not an issue if your code is executed in reaction to a user interaction, as
initialization is complete by then, but this is an issue if your code is executed during startup. if you need to write code that is executed during startup and makes use of nsibrowsersearchservice, you should make sure that this code is executed from the callback to
init(). method overview void addengine(in astring engineurl, in long datatype, in astring iconurl, in boolean confirm, [optional] in nsisearchinstallcallback callback); void addenginewithdetails(in astring name, in astring iconurl, in astring alias, in astring description, in astring method, in astring url); void getdefaultengines([optional] out unsigned...
...string alias); nsisearchengine getenginebyname(in astring aenginename); void getengines([optional] out unsigned long enginecount, [retval, array, size_is(enginecount)] out nsisearchengine engines); void getvisibleengines([optional] out unsigned long enginecount, [retval, array, size_is(enginecount)] out nsisearchengine engines); void
init([optional] in nsibrowsersearch
initobserver observer); void moveengine(in nsisearchengine engine, in long newindex); void removeengine(in nsisearchengine engine); void restoredefaultengines(); attributes attribute type description currentengine nsisearchengine the currently active search...
...And 6 more matches
nsICryptoHMAC
netwerk/base/public/nsicryptohmac.idlscriptable this interface provides hmac signature algorithms. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview acstring finish(in prbool aascii); void
init(in unsigned long aalgorithm, in nsikeyobject akeyobject); void reset(); void update([const, array, size_is(alen)] in octet adata, in unsigned long alen); void updatefromstream(in nsiinputstream astream, in unsigned long alen); constants hashing algorithms. these values are to be used by the
init() method to indicate which hashing function to use. these values map onto the values defined in mozilla/security/nss/lib/softoken/pkcs11t.h and are switched to ckm_*_hma...
...est algorithm 2 md5 2 message-digest algorithm 5 sha1 3 secure hash algorithm 1 sha256 4 secure hash algorithm 256 sha384 5 secure hash algorithm 384 sha512 6 secure hash algorithm 512 methods finish() completes this hmac object and produces the actual hmac diegest data. ...
...ithm 5 sha1 3 secure hash algorithm 1 sha256 4 secure hash algorithm 256 sha384 5 secure hash algorithm 384 sha512 6 secure hash algorithm 512 methods finish() completes this hmac object and produces the actual hmac diegest data. note: this method may be called any time after
init() is called. this call resets the object to its pre-
init state. ...
...And 6 more matches
nsILocalFileMac
xpcom/io/nsilocalfilemac.idlscriptable please add a summary to this article. ...
...idlscriptable please add a summary to this article. ...
...erits from: nsilocalfile last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview cfurlref getcfurl(); native code only! fsref getfsref(); native code only! fsspec getfsspec(); native code only! void
inittoappwithcreatorcode(in ostype aappcreator); native code only! obsolete since gecko 2.0 void
initwithcfurl(in cfurlref acfurl); native code only! void
initwithfsref([const] in fsrefptr afsref); native code only! void
initwithfsspec([const] in fsspecptr afilespec); native code only! obsolete since gecko 1.9.2 boolean ispackage(); void launchwithdoc(in nsilocalfile adoctoload, in boolean alaunchinbackground); void opendocwithapp(in nsilocalfile aapptoopenwith, in boolean alaunchinbackground); void setfiletypeandcreatorfromextension(in string...
...And 6 more matches
nsIPlacesImportExportService
void backupbookmarksfile(); parameters n...
... void backupbookmarksfile(); parameters none. exporthtmltofile() saves the current bookmarks hierarchy to a bookmarks.html file. void exporthtmltofile( in nsilocalfile afile );...
... void backupbookmarksfile(); parameters none. exporthtmltofile() saves the current bookmarks hierarchy to a bookmarks.html file. ...
...And 6 more matches
nsIScriptError
use: var scripterror = components.classes["@mozilla.org/scripterror;1"] .createinstance(components.interfaces.nsiscripterror); note: the nsiscripterror2 interface was merged into this interface in gecko 12.0. prior to that release, if you wanted to associate an outer window with a script error, you had to use nsiscripterror2 instead. ...
...cripterror); note: the nsiscripterror2 interface was merged into this interface in gecko 12.0. prior to that release, if you wanted to associate an outer window with a script error, you had to use nsiscripterror2 instead. that subclass offered the nsiscripterror.
initwithwindowid() method for that purpose; that method is now available in this interface, however. ...
...pt error, you had to use nsiscripterror2 instead. that subclass offered the nsiscripterror.
initwithwindowid() method for that purpose; that method is now available in this interface, however. ...
...And 6 more matches
nsIXPConnect
ameflags); native code only! obsolete since gecko 2.0 jsval getxowforobject(in jscontextptr ajscontext, in jsobjectptr aparent, in jsobjectptr awrappedobj); native code only! ...
...ontext, in jsobjectptr aparent, in jsobjectptr awrappedobj); native code only! ...
...tgarbageonmainthreadonly prbool obsolete since gecko 1.9 currentjsstack nsistackframe read only. currentnativecallcontext nsaxpcnativecallcontextptr read only. deferreleasesuntilaftergarbagecollection prbool obsolete since gecko 1.9 pendingexception nsiexception constants constant value description
init_js_standard_classes 1 << 0 flag_system_global_object 1 << 1 omit_components_object 1 << 2 xpc_xow_clearscope 1 tells updatexows() to clear the scope of all of the xows it finds. obsolete since gecko 2.0 methods native code only!addjsholder root js objects held by aholder. void addjsholder( in voidptr aholder, in nsscriptobject...
...And 6 more matches
nsIXULTemplateQueryProcessor
variable ?start would be the reference variable, while the variable ?id would be the member variable, since it is the unique value that identifies a result. each result will have the four variables referred to defined for it and the values may be retrieved using the result's nsixultemplateresult.getbindingfor() and nsixultemplateresult.getbindingobjectfor() methods. ...
...ed using the result's nsixultemplateresult.getbindingfor() and nsixultemplateresult.getbindingobjectfor() methods. the template builder must call
initializeforbuilding() before the other 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. ...
... 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 nsixultemplateresult aright, in nsiatom avar, in unsigned long asorthints); nsisupports compilequery(in nsixultemplatebuilder abuilder, in nsidomnode aquery, in nsiatom arefvariable, in nsiatom ...
...And 6 more matches
nsIZipWriter
ile afile, in print32 aioflags); void processqueue(in nsirequestobserver aobserver, in nsisupports acontext); void removeentry(in autf8string azipentry, in boolean aqueue); attributes attribute type description comment acstring gets or sets the comment associated with the currently open zip file. exceptions thrown ns_error_not_
initialized if no zip file has been opened. file nsifile the zip file being written to. read only. inqueue boolean true if operations are being performed in the background queue, or false if background operations are not in progress. read only. constants constant value description compression_none 0 do not compress the f...
...odtime the modification time of the entry in microseconds. acompression one of the compression constants, indicating the compression method to use. achannel the channel from which to get the data. aqueue if true, the operation is queued for later execution. if false, the operation is performed immediately. will be performed when processqueue() is called. exceptions thrown ns_error_not_
initialized no zip file is open. ns_error_file_already_exists the specified path already exists in the zip file. ns_error_in_progress the zip writer is already performing another operation. addentrydirectory() adds a new directory entry to the zip file. if azipentry does not end with "/" then it will be added. note: although it is not necessary to add directory entries in order to add file en...
... example creates a folder in the zip called "sub folder" and then adds "c:\add this file.txt" to it, but it will be called "blah.txt". amodtime the modification time of the entry in microseconds. aqueue if true, the operation is queued for later execution. if false, the operation is performed immediately. will be performed when processqueue() is called. exceptions thrown ns_error_not_
initialized no zip file is open. ns_error_file_already_exists the specified path already exists in the zip file. ns_error_in_progress the zip writer is already performing another operation. addentryfile() adds a new file or directory to the zip file. if the specified file is a directory, this call is equivalent to: addentrydirectory(azipentry, afile.lastmodifiedtime, aqueue); void addentryf...
...And 6 more matches
Basic animations - Web APIs
ually 60 times per second and may be reduced to a lower rate when running in background tabs. for more information about the animation loop, especially for games, see the article anatomy of a video game in our game development zone. an animated solar system this example animates a small model of our solar system. ...
... function clock() { var now = new date(); var ctx = document.getelementbyid('canvas').getcontext('2d'); ctx.save(); ctx.clearrect(0, 0, 150, 150); ctx.translate(75, 75); ctx.scale(0.4, 0.4); ctx.rotate(-math.pi / 2)...
... <canvas> in which the image is scrolled. note that the width and height specified here must match the values of the canvasxzsize and canvasysize variables in the javascript code. ...
...And 6 more matches
Using channel messaging - Web APIs
when the iframe has loaded, we r...
... messagechannel() constructor. when the iframe has loaded, we register an onclick handler for our button and an onmessage handler for messagechannel.port1. finally we transfer messagechannel.port2 to the iframe using the window.postmessage method. let's explore how the iframe.contentwindow.postmessage line works in a bit more detail. it takes three arguments: the message being sent. for this
initial port transfering this message could be an empty string but in this example it is set to '
init'. the origin the message is to be sent to. * means "any origin". an object, the ownership of which is transferred to the receiving browsing context. in this case, we are transferring messagechannel.port2 to the iframe, so it can be used to communicate with the main page. when our button is clicked...
...e iframe, so it can be used to communicate with the main page. when our button is clicked, we prevent the form from submitting as normal and then send the value entered in our text input to the iframe via the messagechannel. ...
...And 6 more matches
Element - Web APIs
text has been selected. also available via the onselect property. show fired when a contextmenu event was fired on/bubbled to an element that has a contextmenu attribute. also available via the onshow property. wheel fired when the user rotates a wheel button on a pointing device (typically a mouse). also available via the onwheel property. clipboard events copy fired when the user
initiates a copy action through the browser's user interface. also available via the oncopy property. cut fired when the user
initiates a cut action through the browser's user interface. also available via the oncut property. paste fired when the user
initiates a paste action through the browser's user interface. also available via the onpaste property. composition events compositionend f...
...ilable 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. ...
... placed on the touch surface. also available via the ontouchstart property specifications specification status comment css pseudo-elements level 4the def
inition of 'element' in that specification. working draft added the pseudo() method. web animations working draft added the getanimations() method. undomanager and domtransactionthe def
inition of 'element' in that specification. editor's draft added the undoscope and undomanager properties. pointer events – level 2the def
inition of 'element' in that specification. recommendation added the following event handlers: ongotpointercapture and onlostpointercapture. added the following methods: setpointercapture() and releasepointercapture(). pointer eve...
...And 6 more matches
Pointer events - Web APIs
> function over_handler(event) { } function enter_handler(event) { } function down_handler(event) { } function move_handler(event) { } function up_handler(event) { } function cancel_handler(event) { } function out_handler(event) { } function leave_handler(event) { } function gotcapture_handler(event) { } function lostcapture_handler(event) { } function
init() { var el=document.getelementbyid("target"); // register pointer event handlers el.onpointerover = over_handler; el.onpointerenter = enter_handler; el.onpointerdown = down_handler; el.onpointermove = move_handler; el.onpointerup = up_handler; el.onpointercancel = cancel_handler; el.onpointerout = out_handler; el.onpointerleave = leave_h...
...</div> </body> </html> event properties this example illustrates accessing all of a touch event's properties. <html> <script> var id = -1; function process_id(event) { // process this event based on the event's identifier } function process_mouse(event) { // process the mouse pointer event } function process_pen(...
...</div> </body> </html> determining the primary pointer in some scenarios there may be multiple pointers (for example a device with both a touchscreen and a mouse) or a pointer supports m...
...And 6 more matches
WebGLRenderingContext.pixelStorei() - Web APIs
version or no color space conversion. glenum gl.browser_default_webgl gl.browser_default_webgl, gl.none webgl when using a webgl 2 context, the following values are available additionally: constant description type default value allowed values (for param) specified in gl.pack_row_length number of pixels in a row. ...
...e following values are available additionally: constant description type default value allowed values (for param) specified in gl.pack_row_length number of pixels in a row. glint 0 0 to inf
inity opengl es 3.0 gl.pack_skip_pixels number of pixel locations skipped before the first pixel is written into memory. ...
...l.pack_row_length number of pixels in a row. glint 0 0 to inf
inity opengl es 3.0 gl.pack_skip_pixels number of pixel locations skipped before the first pixel is written into memory. glint 0 0 to inf
inity opengl es 3.0 gl.pack_skip_rows number of rows of pixel locations skipped before the first pixel is written into memory glint 0 0 to inf
inity opengl es 3.0 gl.unpack_row_length number of pixels in a row. ...
...And 6 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
cubeorientation will store the current orientation of the cube, while cubematrix and mousematrix are storage for matrices used during the rendering of the scene. inverseorientation is a quaternion which will be used to represent the rotation to apply to the reference space for the object in the frame being rendered. radians_per_degreee is the value to multiply an angle in degree...
... error, since similar errors can have in multiple situations. the vertex and fragment shaders the vertex and fragment shaders are both exactly the same as those used in the example for our article lighting in webgl. refer to that if you're interested in the glsl source code for the basic shaders used here. ...
...x shader computes the position of each vertex given the
initial positions of each vertex and the transforms that need to be applied to convert them to simulate the viewer's current position and orientation. the fragment shader returns the color of each vertex, interpolating as needed from the values found in the texture and applying the lighting effects. starting up and shutting down webxr upon
initially loading the script, we install a handler for the load event, so that we can perform
initialization. window.addeventlistener("load", onload); function onload() { xrbutton = document.queryselector("#enter-xr"); xrbutton.addeventlistener("click", onxrbuttonclick); projectionmatrixout = document.queryselector("#projection-matrix div"); modelmatrixout = document.queryselector("#model-v...
...And 6 more matches
WheelEvent() - Web APIs
"deltay", optional and defaulting to 0.0, is a double representing the vertical scroll amount in the deltamode unit. "deltaz", optional and defaulting to 0.0, is a double representing the scroll amount for the z-axis in the deltamode unit. ...
... "deltay", optional and defaulting to 0.0, is a double representing the vertical scroll amount in the deltamode unit. "deltaz", optional and defaulting to 0.0, is a double representing the scroll amount for the z-axis in the deltamode unit. ...
...unt. permitted values are: constant value description dom_delta_pixel 0x00 the delta values are specified in pixels. dom_delta_line 0x01 the delta values are specified in lines. ...
...And 6 more matches
Basic concepts of flexbox - CSS: Cascading Style Sheets
h other layout methods such as css grid layout which follow the same patterns. the flex container an area of a document laid out using flexbox is called a flex container. to create a flex container, we set the value of the area's container's display property to flex or inline-flex. as soon as we do this the direct children of that container become flex items. as with all properties in css, some
initial values are defined, so when creating a flex container all of the contained flex items will behave in the following way. items display in a row (the flex-direction property's default is row). the items start from the start edge of the main axis. the items do not stretch on the main dimension, but can shrink. the items will stretch to fill the size of the cross axis. the flex-basis proper...
...a row, using the size of the content as their size in the main axis. if there are more items than can fit in the container, they will not wrap but will instead overflow. if some items are taller than others, all items will stretch along the cross axis to fill its full size. you can see in the live example below how this looks. try editing the items or adding additional items in order to test the
initial behavior of flexbox. changing flex-direction adding the flex-direction property to the flex container allows us to change the direction in which our flex items display. setting flex-direction: row-reverse will keep the items displaying along the row, however the start and end lines are switched. if we change flex-direction to column the main axis switches and our items now display in a co...
...r side. to cause wrapping behaviour add the property flex-wrap with a value of wrap. now, should your items be too large to all display in one line, they will wrap onto another line. the live sample below contains items that have been given a width, the total width of the items being too wide for the flex container. as flex-wrap is set to wrap, the items wrap. set it to nowrap, which is also the
initial value, and they will instead shrink to fit the container because they are using
initial flexbox values that allows items to shrink. using nowrap would cause an overflow if the items were not able to shrink, or could not shrink small enough to fit. find out more about wrapping flex items in the guide mastering wrapping of flex items. the flex-flow shorthand you can combine the two properti...
...And 6 more matches
animation-timing-function - CSS: Cascading Style Sheets
if no animation-timing-function is specified on a keyframe, the corresponding value of animation-timing-function from the element to which the animation is applied is used for that keyframe. a keyframe's timing function is applied on a property-by-property basis from the keyfra...
... as jump-end. step-start equal to steps(1, jump-start) step-end equal to steps(1, jump-end) note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property values. ...
...end. step-start equal to steps(1, jump-start) step-end equal to steps(1, jump-end) note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property values. ...
...And 6 more matches
animation - CSS: Cascading Style Sheets
when parsed, keywords that are valid for properties other than animation-name, and whose values were not found earlier in...
... <single-animation-play-state> an optional name for the animation, which may be none, a <custom-ident>, or a <string> zero, one, or two <time> values the order of values within each animation def
inition is important: the first value that can be parsed as a <time> is assigned to the animation-duration, and the second one is assigned to animation-delay. the order within each animation def
inition is also important for distinguishing animation-name values from other keywords. when parsed, keywords that are valid for properties other than animation-name, and whose values were not found earlier in the shorthand, must be accepted for those properties rather than for animation-name. furthermore, when serialized, default values of other properties must be output in at least the cases necessa...
...experience for users who have expressed a preference for no animated experiences. ...
...And 6 more matches
column-gap (grid-column-gap) - CSS: Cascading Style Sheets
the column-gap css property sets the size of the gap (gutter) between an element's columns. 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.
initially a part of multi-column layout, the def
inition of column-gap has been broadened to include multiple layout methods. now specified in box alignment, it may be used in multi-column, flexible box, and grid layouts. css grid layout
initially defined the grid-column-gap property. this prefixed property is being replaced by column-gap. however, in order to support browsers that implemented grid-column-gap and not column-gap for grid, you will need to use the prefixed proper...
...prefixed property is being replaced by column-gap. however, in order to support browsers that implemented grid-column-gap and not column-gap for grid, you will need to use the prefixed property. syntax /* keyword value */ column-gap: normal; /* <length> values */ column-gap: 3px; column-gap: 2.5em; /* <percentage> value */ column-gap: 3%; /* global values */ column-gap: inherit; column-gap:
initial; column-gap: unset; the column-gap property is specified as one of the values listed below. values normal the browser's default spacing is used between columns. for multi-column layout this is specified as 1em. for all other layout types it is 0. <length> the size of the gap between columns, defined as a <length>. the <length> property's value must be non-negative. <percentage> the ...
...r's default spacing is used between columns. for multi-column layout this is specified as 1em. for all other layout types it is 0. <length> the size of the gap between columns, defined as a <length>. the <length> property's value must be non-negative. <percentage> the size of the gap between columns, defined as a <percentage>. the <percentage> property's value must be non-negative. ...
...And 6 more matches
list-style-type - CSS: Cascading Style Sheets
note that: some types require a suitable font installed to display as expected. the cjk-ideographic is identical to trad-chinese-informal; it exists for legacy reasons. values <custom-ident> a identifier matching the...
...tring will be used as the item's marker. none no item marker is shown. disc a filled circle (default value) circle a hollow circle square a filled square decimal decimal numbers beginning with 1 cjk-decimal han decimal numbers e.g. 一, 二, 三, ..., 九八, 九九, 一〇〇 decimal-leading-zero decimal numbers padded by
initial zeros e.g. 01, 02, 03, … 98, 99 lower-roman lowercase roman numerals e.g. i, ii, iii, iv, v… upper-roman uppercase roman numerals e.g. i, ii, iii, iv, v… lower-greek lowercase classical greek alpha, beta, gamma… e.g. α, β, γ… lower-alpha lower-latin lowercase ascii letters e.g. a, b, c, … z lower-latin is unsupported in ...
... the list is announced properly. this ensures the design is unaffected by the bug fix and that list items are not improperly described. ...
...And 6 more matches
Functions - JavaScript
re to qualify as a function, it should take some input and return an output where there is some obvious relationship between the input and the output. to use a function, you must define it somewhere in the scope from which you wish to call it. see also the exhaustive reference chapter about javascript functions to get to know the details. defining functions function declarations a function def
inition (also called a function declaration, or function statement) consists of the function keyword, followed by: the name of the function. a list of parameters to the function, enclosed in parentheses and separated by commas. the javascript statements that define the function, enclosed in curly brackets, {...}. for example, the following code defines a simple function named square: function ...
...; // create a new array let i; // declare variable for (i = 0; i != a.length; i++) result[i] = f(a[i]); return result; } const f = function(x) { return x * x * x; } let numbers = [0, 1, 2, 5, 10]; let cube = map(f,numbers); console.log(cube); function returns: [0, 1, 8, 125, 1000]. in javascript, a function can be defined based on a condition. for example, the following function def
inition defines myfunc only if num equals 0: var myfunc; if (num === 0) { myfunc = function(theobject) { theobject.make = 'toyota'; } } in addition to defining functions as described here, you can also use the function constructor to create functions from a string at runtime, much like eval(). a method is a function that is a property of an object. read more about objects and methods in wor...
...ction is the function in which it is declared (or the entire program, if it is declared at the top level). note: this works only when defining the function using the above syntax (i.e. function funcname(){}). the code below will not work. this means that function hoisting only works with function declarations—not with function expressions. console.log(square) // square is hoisted with an
initial value undefined. console.log(square(5)) // uncaught typeerror: square is not a function const square = function(n) { return n * n; } the arguments of a function are not limited to strings and numbers. you can pass whole objects to a function. the show_props() function (defined in working with objects) is an example of a function that takes an object as an argument. a function can call it...
...And 6 more matches
Array.prototype.reduceRight() - JavaScript
left) to reduce it to a single 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. see also array.prototype.reduce() for left-to-right. syntax arr.reduceright(callback(accumulator, currentvalue[, index[, array]])[,
initialvalue]) parameters callback function to execute on each value in the array, taking four arguments: accumulator the value previously returned in the last invocation of the callback, or
initialvalue, if supplied. (see below.) currentvalue the current element being processed in the array. indexoptional the index of the current element being processed in the array. arrayoptiona...
...ecute on each value in the array, taking four arguments: accumulator the value previously returned in the last invocation of the callback, or
initialvalue, if supplied. (see below.) currentvalue the current element being processed in the array. indexoptional the index of the current element being processed in the array. arrayoptional the array reduceright() was called upon.
initialvalueoptional value to use as accumulator to the first call of the callback. if no
initial value is supplied, the last element in the array will be used and skipped. calling reduce or reduceright on an empty array without an
initial value creates a typeerror. return value the value that results from the reduction. description reduceright executes the callback function once for each elemen...
... the call to the reduceright callback would look something like this: array.reduceright(function(accumulator, currentvalue, index, array) { // ... ...
...And 6 more matches
begin - SVG: Scalable Vector Graphics
an element should be discarded. the attribute value is a semicolon separated list of values. the interpretation of a list of start times is detailed in the smil specification in "evaluation of begin and end time lists". each individual value can be one of the following : <offset-value>, <syncbase-value>, <event-value>, <repeat-value>, <accesskey-value>, <wallclock-sync-value> or the keyword indef
inite. six elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, <discard>, and <set> animate, animatecolor, animatemotion, animatetransform, set for <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set>, begin defines when the element should begin, i.e. become active. value <begin-value-list> default value 0s...
...unction accesskey() with the character to be input as parameter. an optional offset value as defined in <offset-value> can be appended. <wallclock-sync-value> this value defines the animation start time as a real-world clock time. a valid wallclock-sync-value consists of the function wallclock() with a time value as parameter. the time syntax is based upon the syntax defined in iso 8601. indef
inite the begin of the 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 indef
inite. as soon as the element's active duration starts, the element identified by the href attribute is discarded. the behavior is th...
... re-insert the discarded elements. so, authors are encouraged to set the playbackorder attribute to forwardonly when using the <discard> element. the <discard> element itself can be discarded prior to its activation, in which case it will never trigger the removal of its own target element. value <begin-value-list> default value 0s animatable no the def
inition of <begin-value-list> is the same as for the other animation elements. examples offset example <svg width="120" height="120" viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" version="1.1"> <!-- animated rectangles --> <rect x="10" y="35" height="15" width="0"> <animate attributetype="xml" attributename="width" to="100" begin="0s" dur="8s" ...
...And 6 more matches
gradientTransform - SVG: Scalable Vector Graphics
this allows for things such as skewing the gradient. this additional transformation matrix is post-multiplied to (i.e., inserted to the right of) any previously defined transformations, including the implicit transformation necessary to convert from object bounding box units to user space. ...
... usage notes default value identity transform value <transform-list> animatable yes <transform-list> a list of transformation functions specifying some additional transformation from the gradient coordinate system onto the target coordinate system. ...
...specifying some additional transformation from the gradient coordinate system onto the target coordinate system. specifications specification status comment css transforms level 1the def
inition of 'surfacescale for <fespecularlighting>' in that specification. working draft defines the <transformation-list> value. scalable vector graphics (svg) 2the def
inition of 'gradienttransformation for <lineargradient>' in that specification. ...
...And 6 more matches
height - SVG: Scalable Vector Graphics
or the referenced element. value auto | <length> | <percentage> default value auto (treated as 0) animatable yes note: starting with svg2, height is a geometry property meaning this attribute can also be used as a css property for used elements. ...
...ercentage> default value auto (treated as 0) animatable yes note: starting with svg2, height is a geometry property meaning this attribute can also be used as a css property for used elements. specifications specification status comment filter effects module level 1the def
inition of 'height' in that specification. working draft def
inition for <filter> filter effects module level 1the def
inition of 'height' in that specification. working draft def
inition for filter primitives css masking module level 1the def
inition of 'height' in that specification. candidate recommendation def
inition for <mask> scalable vector graphics (svg) 2the def
inition of 'height' in that specification. candidate ...
... filter effects module level 1the def
inition of 'height' in that specification. working draft def
inition for filter primitives css masking module level 1the def
inition of 'height' in that specification. candidate recommendation def
inition for <mask> scalable vector graphics (svg) 2the def
inition of 'height' in that specification. candidate recommendation def
inition as a geometry property scalable vector graphics (svg) 2the def
inition of 'height' in that specification. candidate recommendation def
inition for <pattern> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'height' in that specification. ...
...And 6 more matches
width - SVG: Scalable Vector Graphics
for the referenced element. value auto | <length> | <percentage> default value auto (treated as 0) animatable yes note: starting with svg2, width is a geometry property meaning this attribute can also be used as a css property for used elements. ...
...<percentage> default value auto (treated as 0) animatable yes note: starting with svg2, width is a geometry property meaning this attribute can also be used as a css property for used elements. specifications specification status comment filter effects module level 1the def
inition of 'width' in that specification. working draft def
inition for <filter> filter effects module level 1the def
inition of 'width' in that specification. working draft def
inition for filter primitives css masking module level 1the def
inition of 'width' in that specification. candidate recommendation def
inition for <mask> scalable vector graphics (svg) 2the def
inition of 'width' in that specification. candidate rec...
... filter effects module level 1the def
inition of 'width' in that specification. working draft def
inition for filter primitives css masking module level 1the def
inition of 'width' in that specification. candidate recommendation def
inition for <mask> scalable vector graphics (svg) 2the def
inition of 'width' in that specification. candidate recommendation def
inition as a geometry property scalable vector graphics (svg) 2the def
inition of 'width' in that specification. candidate recommendation def
inition for <pattern> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'width' in that specification. ...
...And 6 more matches
dev/panel - Archive of obsolete content
}, dispose: function() { // my teardown goes here }, onready: function() { // i can send messages to // the panel document here } }); alternatively, you can use the extend function: const { extend } = require("sdk/core/heritage"); function mypanel() {}; mypanel.prototype = extend(panel.prototype, { label: "my panel", tooltip: "...", .... }); in the constructor def
inition there are a number of mandatory and optional parameters for you to supply. name type description label string the string to display in the toolbox toolbar. mandatory icon string the icon to display in the toolbox toolbar, specified as a resource:// url pointing to an icon file, typically in your add-on's "data" directory. you ...
...essages. optional onload function an event handler that will be called after the document in the panel is fully loaded. it's equivalent to document.readystate === "complete". optional once you've defined the panel's constructor you have to export it so it can be called by the framework. creating a tool next, you need to create a new tool using the dev/toolbox module,
initializing it with the newly defined constructor. example here's a complete main.js: // main.js // require the sdk modules const { panel } = require("dev/panel"); const { tool } = require("dev/toolbox"); const { class } = require("sdk/core/heritage"); // define the panel constructor const mypanel = class({ extends: panel, label: "my panel", tooltip: "my new devtool's panel", icon: "./my...
..."./my-panel.html", // when the panel is created, // take a reference to the debuggee setup: function(options) { this.debuggee = options.debuggee; }, dispose: function() { this.debuggee = null; }, onready: function() { // in this function you can communicate // with the panel document } }); // export the constructor exports.mypanel = mypanel; // create a new tool,
initialized // with the new constructor const mytool = new tool({ panels: { mypanel: mypanel } }); panel document environment the panel document loaded from the url property can of course include css and javascript just like a normal web page: <html> <head> <meta charset="utf-8"> <link href="./my-panel.css"rel="stylesheet"></link> <script src="resource://sdk/dev/volcan.js"></script>...
...And 5 more matches
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
ilenames that have whitespace in them. usage an rpn calculator we’re going to implement a simple rpn3 calculator in javascript to see how this can be used. on the program side, we’ll create a class called rpncalc. first we’ll sketch out a simple interface for it (listing 1). save this as a file called calc.js. listing 1: calc.js (stage 1) function rpncalc() { } rpncalc.prototype = {
init: function() { }, push: function(val) { }, plus: function() { }, pop: function() { } } implement the addition operation create test case begin by creating the test case. first, select the menu item tools:mozlab:open mozunit runner to bring up the mozunit window. select the menu item file:new, and save test_calc.js in the same directory as the file that is the test target. next, c...
...king the test self-documenting. pretty clever. ...
...testcase'); var module = new modulemanager(); var rpncalc = module.require('package', 'calc'); tc.tests = { '2 1 +': function() { var calc = new rpncalc.rpncalc(); calc.
init(); calc.push(2); calc.push(1); calc.plus(); assert.equals(calc.pop(), 3); } } listing 3: additional content for calc.js function rpncalc() { this.stack = new array(); } rpncalc.prototype = {
init: function() { this.stack = new array(); }, push: function(val) { this.stack.push(number(val)); }, _letfunc: function(func) { a = this.pop(); b = this.pop(); this.push(func(a, b)); }, plus: function() { return this._letfunc(this._plus); }, _plus: function(a, b) { return a + b; }, pop: function() { return this.stack.pop(); } } check for errors...
...And 5 more matches
CSS3 - Archive of obsolete content
multi-column layout module working draft adds support for easy multi-column layouts using the css columns, column-count, column-fill, column-gap, column-rule, column-rule-color, column-rule-style, column-rule-width, column-span, column-width, break-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: def
inition for new font-relative length units: rem and ch . def
inition for viewport-relative length units: vw, vh, vmax, and vmin . precision about the real size of the absolute le...
....1, that were implicitely defined by their grammar token and some textual precisions. adds: def
inition for new font-relative length units: rem and ch . def
inition 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 . def
inition for <angle>, <time>, <frequency>, <resolution>. normative value to the def
inition of <color>, <image>, and <position>. def
inition for the calc(), attr(), and toggle() functional notations. at risk: due to insufficient browser support, standardization of the calc(), attr(), and toggle() functional notations may be postponed to the next iteration of this module. ...
...<time>, <frequency>, <resolution>. normative value to the def
inition of <color>, <image>, and <position>. def
inition for the calc(), attr(), and toggle() functional notations. at risk: due to insufficient browser support, standardization of the calc(), attr(), and toggle() functional notations may be postponed to the next iteration of this module. several types def
inition, like <ident> and <custom-ident>, have been deferred to css values and units module level 4. css flexible box layout module candidate recommendation add a flexbox layout to the css display property and several new css properties to control it: flex, flex-align, flex-direction, flex-flow, flex-item-align, flex-line-pack, flex-order, flex-pack, and flex-wrap. ...
...And 5 more matches
Reading textual data - Archive of obsolete content
s done in bug 295047. usage: var charset = /* need to find out what the character encoding is. ...
...h it (is.close()). not doing so can cause problems if you try to rename or delete the file at a later time on some platforms. note that you may get less characters than you asked for, especially (but not only) at the end of the file (stream). unsupported byte sequences you can specify what should happen with byte sequences that do not correspond to a valid character. the last (4th) argument to
init specifies which character they get replaced with; nsiconverterinputstream.default_replacement_character is u+fffd replacement character, which is often a good choice. if you do not want any replacement, you can specify 0x0000 as replacement character; that way, readstring will throw an exception when reaching unsupported bytes. reading lines the nsiunicharlineinputstream interface provides an ...
...ed nulls (like utf-16 and utf-32). it can be used like this: var charset = /* need to find out what the character encoding is. using utf-8 for this example: */ "utf-8"; var is = components.classes["@mozilla.org/intl/converter-input-stream;1"] .createinstance(components.interfaces.nsiconverterinputstream); // this assumes that fis is the nsiinputstream you want to read from is.
init(fis, charset, 1024, 0xfffd); is.queryinterface(components.interfaces.nsiunicharlineinputstream); if (is instanceof components.interfaces.nsiunicharlineinputstream) { var line = {}; var cont; do { cont = is.readline(line); // now you can do something with line.value } while (cont); } the above example reads an entire stream until eof. see nsiconverterinputstream for nsiconverte...
...And 5 more matches
Perceived performance - Learn web development
capturing the very beginning of the loading experience. but, just because there's content, doesn't mean it's useful content or that the user has content to consume. the first meaningful paint, or fmp, is the when content appears on the screen that is actually meaningful; which is a better metric for user-perceived loading experience, but still not ideal. largest contentful paint (lcp) metric, def
inited in the largest contentful paint api, reports the render time of the largest content element visible in the viewport. speed index is also used to approximate perceived performance: it measures the average time for pixels on the visible screen to be painted. it doesn't account for jitter, nor does it weight which content important to a user more highly, so it's not a perfect metric. these metri...
...ontentful paint api, reports the render time of the largest content element visible in the viewport. speed index is also used to approximate perceived performance: it measures the average time for pixels on the visible screen to be painted. it doesn't account for jitter, nor does it weight which content important to a user more highly, so it's not a perfect metric. these metrics have to do with
initial load and render. it is also important to ensure the site feels fast once the user begins interacting with it. for this, time to interactive, is a good metric; it is the moment when the last long task of the load process finishes and the ui is available for user interaction with delay. ui lack or responsiveness and jank both harm perceived performance. even though a task may take a long time, ...
...llow. some of these quick tips have full articles if you want to dive deeper. displaying content, or at least some part of the page with an indication that content is loading, as quickly as possible, is essential to improving perceived performance. for example, because page render is blocked by loading and parsing css and javascript, minimizing the amount of css and js that needs to be loaded on
initially will have a major impact on improving perceived performance. even though the bytes might be the same, not blocking the page from rendering makes the load feel faster. here are a few tips and tricks to help improve performance: minimize
initial load to improve perceived performance, minimize the original page load. in other words, first download everything you're going to actually show, bu...
...And 5 more matches
NSS Sample Code Sample1
// xxx data protection // - takes an input buffer, applies the encryption // and mac, and generates a buffer with the result. // - the application sends or uses the result (possibly // after base64 encoding it. // // server - an instance of a server that is part of a // cluster of servers that are sharing a common set // of encryption and macing keys. // class server { public: //
initializes the server instance. in particular, this // creates the key pair that is used for wrapping keys int
init(); // generates keys for encryption (aes) and macing. the // wrapped keys are stored in data files. int generatekeys(); // gets the server's public key (wrapping key) to // send to another server. this becomes the input to // the exportkeys method on the remote server.
...pedmackey(0), menckey(0), mmackey(0) { // copy the server name mservername = pl_strdup(servername); } server::~server() { if (mservername) pl_strfree(mservername); if (mwrappedenckey) secitem_freeitem(mwrappedenckey, pr_true); if (mwrappedmackey) secitem_freeitem(mwrappedmackey, pr_true); if (menckey) pk11_freesymkey(menckey); if (mmackey) pk11_freesymkey(mmackey); } int server::
init() { int rv = 0; seckeyprivatekey *prvkey = 0; seckeypublickey *pubkey = 0; pk11slotinfo *slot = 0; pk11rsagenparams rsaparams; secstatus s; // see if there is already a private key with this name. // if there is one, no further action is required. rv = getprivatekey(&prvkey); if (rv == 0 && prvkey) goto done; rv = 0; // these could be parameters to the
init function r...
...ng of a key) // this should not be used. use the rsa-based wrapping // methods instead. ...
...And 5 more matches
nsIAppShellService
d overview void closetoplevelwindow(in nsixulwindow awindow); obsolete since gecko 1.8 void createhiddenwindow(in nsiappshell aappshell); native code only! ...
...id closetoplevelwindow(in nsixulwindow awindow); obsolete since gecko 1.8 void createhiddenwindow(in nsiappshell aappshell); native code only! ...
...eservice acmdlineservice); obsolete since gecko 1.8 void enterlastwindowclosingsurvivalarea(); obsolete since gecko 1.8 void exitlastwindowclosingsurvivalarea(); obsolete since gecko 1.8 void gethiddenwindowandjscontext(out nsidomwindow ahiddendomwindow, out jscontext ajscontext); native code only! ...
...And 5 more matches
nsILocalFile
instance, use: var localfile = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile); method overview void appendrelativenativepath(in acstring relativefilepath); native code only! void appendrelativepath(in astring relativefilepath); acstring getrelativedescriptor(in nsilocalfile fromfile); void
initwithfile(in nsilocalfile afile); void
initwithnativepath(in acstring filepath); native code only! void
initwithpath(in astring filepath); void launch(); prlibrarystar load(); native code only! file openansifiledesc(in string mode); native code only! prfiledescstar opennsprfiledesc(in long flags, in long mode); native code only! void re...
...h. acstring getrelativedescriptor( in nsilocalfile fromfile ); parameters fromfile the file from which the descriptor is relative. there is no defined result if this parameter is null. return value an opaque string value with undefined character encoding. this string is not intended for display to users. ...
... in nsilocalfile fromfile ); parameters fromfile the file from which the descriptor is relative. there is no defined result if this parameter is null. return value an opaque string value with undefined character encoding. this string is not intended for display to users. the result returned from this method may be used with setrelativedescriptor() to
initialize a nsilocalfile instance. ...
...And 5 more matches
Using the clipboard
the clipboard model in mozilla requires you to perform the following steps to copy data: create an xpcom wrapper for the data which you want to put on the clipboard. this is needed because you can put anything on the clipboard from text to images. create a transferring object. this object can be the component @mozilla.org/widget/transferable;1 which implements the interface nsitransferable. ...
... tell the transferring object about the type of data being copied. tell the transferring object about the data to copy. create a clipboard object which refers to the system clipboard. ...
... if (source instanceof ci.nsidomwindow) // note: in gecko versions >16, you can import the privatebrowsingutils.jsm module // and use privatebrowsingutils.privacycontextfromwindow(sourcewindow) instead source = source.queryinterface(ci.nsiinterfacerequestor) ...
...And 5 more matches
EventTarget.addEventListener() - Web APIs
why? simply because by the time the event listener would execute, the scope in which it was defined would have already finished executing. getting data into and out of an event listener using objects unlike most functions in javascript, objects are retained in memory as long as a variable referencing them exists in memory. this, and the fact that objects can ha...
...umption, the lack of keeping a function reference is not the real issue; rather it is the lack of keeping a static function reference. in both problem-cases below, a function reference is kept, but since it is redefined on each iteration, it is not static. in the third case, the reference to the anonymous function is being reassigned with each iteration. ...
...ase, the entire function def
inition is unchanging, but it is still being repeatedly defined as if new (unless it was [[promoted]] by the compiler) and so is not static. therefore, though appearing to be simply [[multiple identical event listeners]], in both cases each iteration will instead create a new listener with its own unique reference to the handler function. however, since the function def
inition itself does not change, the same function may still be called for every duplicate listener (especially if the code gets optimized.) also in both cases, because the function reference was kept but repeatedly redefined with each add, the remove-statement from above can still remove a listener, but now only the last one added. // for illustration only: note "mistake" of [j] for [i] thus causing...
...And 5 more matches
HTMLTextAreaElement - Web APIs
recommendation the attributes tabindex and accesskey, as well as the methods blur() and focus() are now defined on htmlelement. the following attributes have been added: autofocus, placeholder, dirname, wrap, maxlength, required, textleng...
...area with fixed number of characters per line:<br /> <textarea cols="50" rows="10" onkeypress="return checkrows(this, event);" onpaste="return false;"></textarea> </p> </form> specifications specification status comment html living standardthe def
inition of 'htmltextareaelement' in that specification. living standard html5the def
inition of 'htmltextareaelement' in that specification. recommendation the attributes tabindex and accesskey, as well as the methods blur() and focus() are now defined on htmlelement. the following attributes have been added: autofocus, placeholder, dirname, wrap, maxlength, required, textlength, labels, selectionstart, selectionend, selectiondirection, validity, validationmessage, and willv...
... the following attributes have been added: autofocus, placeholder, dirname, wrap, maxlength, required, textlength, labels, selectionstart, selectionend, selectiondirection, validity, validationmessage, and willvalidate. the following methods have been added: checkvalidity(), setcustomvalidity(), and setselectionrange(). ...
...And 5 more matches
Web Accessibility: Understanding Colors and Luminance - Accessibility
. (see understanding success criterion 1.4.3: contrast) a viewer's distance from the screen, the ambient background, the health of his eyes, and more all affect how that color is received by the viewer. how the viewer perceives color after it gets to his eyes is yet another matter, and can be affected by overall health. luckily, css media queries level 5 will be a game-changer in accessibility
initiatives, because it will allow users to select settings that accomodate their needs best. color, contrast, and luminance are among the most central and critical concepts to creating accessible web content with color. luminance is of particular importance, however, because at the end of the day, understanding of what it is and how it is employed enables accessibility for those who are color-blind...
...ticles for opengl reference use of rgba rather than srgb. webgl is usually in the rgba format; see an example of how it is used in "clearing with colors". where accessibility is concerned, however, standards and guidelines are currently written predominantly using the srgb color space, especially as it applies to color contrast ratios. in speaking specifically to relative luminance, wcag's def
inition of relative luminance notes: "note 2: almost all systems used today to view web content assume srgb encoding. unless it is known that another color space will be used to process and display the content, authors should evaluate using srgb colorspace. if using other color spaces, see understanding success criterion 1.4.3." css color module level 4 will likely change the domination of the srgb ...
...st the better. that changes with animation. "safer" animation means images with less contrast, not more. for more on color contrast in animation, see three flashes or below threshold understanding sc 2.3.1 icons also need sufficient contrast for perception. see wcag 2.1 technique g207 luminance it is the difference in the luminance of a color that enables us to see contrast. here is the def
inition of relative luminance as defined by the w3c: "the relative brightness of any point in a colorspace, normalized to 0 for darkest black and 1 for lightest white" this statement is of course accurate, but may be confusing when used in reference to the rgb color space, which is an integer between 0 and 255. white has 100% relative luminance, black has 0% relative luminance (in most but not all ...
...And 5 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
ibers[topic].push(callback); }; var unsubscribe = function unsubscribe(callback) { subscribers.indexof(callback); subscribers.splice(index, 1); }; var notify = function notify(topic, value) { if (subscribers[topic] === undefined || subscribers[topic].length === 0) return; var color = new color(value); for (var i in subscribers[topic]) subscribers[topic][i](color); }; var
init = function
init() { var elem = document.queryselectorall('.ui-color-picker'); var size = elem.length; for (var i = 0; i < size; i++) new colorpicker(elem[i]); }; return {
init :
init, color : color, rgbcolor : rgbcolor, rgbacolor : rgbacolor, hsvcolor : hsvcolor, hsvacolor : hsvacolor, hslcolor : hslcolor, hslacolor : hslacolor, setcolor : setcolor, getcolor : getc...
...opic] = []; subscribers[topic].push(callback); }; var unsubscribe = function unsubscribe(topic, callback) { var index = subscribers[topic].indexof(callback); subscribers[topic].splice(index, 1); }; var notify = function notify() { if (subscribers[this.topic] === undefined) return; for (var i in subscribers[this.topic]) { subscribers[this.topic][i](this.value); } }; var
init = function
init() { var elem, size; elem = document.queryselectorall('.ui-dropdown'); size = elem.length; for (var i = 0; i < size; i++) new dropdown(elem[i]); }; return {
init :
init, setvalue : setvalue, subscribe : subscribe, unsubscribe : unsubscribe, createdropdown : createdropdown }; })(); /** * ui-slidersmanager */ var inputslidermanager = (function inputsli...
...subscribers[this.topic].length; i++) subscribers[this.topic][i](this.value); }; var createslider = function createslider(topic, label) { var slider = document.createelement('div'); slider.classname = 'ui-input-slider'; slider.setattribute('data-topic', topic); if (label !== undefined) slider.setattribute('data-info', label); new inputslider(slider); return slider; }; var
init = function
init() { var elem = document.queryselectorall('.ui-input-slider'); var size = elem.length; for (var i = 0; i < size; i++) new inputslider(elem[i]); }; return {
init :
init, setmax : setmax, setmin : setmin, setunit : setunit, setstep : setstep, getnode : getnode, getstep : getstep, setvalue : setvalue, subscribe : subscribe, unsubscribe : unsubscribe, ...
...And 5 more matches
float - CSS: Cascading Style Sheets
that the name of the dom member is the camel-case name of the dash-separated css name (due to the fact that "float" is a reserved word in javascript, as seen in the need to escape "class" as "classname" and escape <label>'s "for" as "htmlfor"). syntax /* keyword values */ float: left; float: right; float: none; float: inline-start; float: inline-end; /* global values */ float: inherit; float:
initial; float: unset; the float property is specified as a single keyword, chosen from the list of values below. values left the element must float on the left side of its containing block. right the element must float on the right side of its containing block. none the element must not float. inline-start the element must float on the start side of its containing block. that is the left...
... the right side of its containing block. none the element must not float. inline-start the element must float on the start side of its containing block. that is the left side with ltr scripts, and the right side with rtl scripts. inline-end the element must float on the end side of its containing block. that is the right side with ltr scripts, and the left side with rtl scripts. ...
...t side of its containing block. none the element must not float. inline-start the element must float on the start side of its containing block. that is the left side with ltr scripts, and the right side with rtl scripts. inline-end the element must float on the end side of its containing block. that is the right side with ltr scripts, and the left side with rtl scripts. formal def
inition
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 ...
...And 5 more matches
font-family - CSS: Cascading Style Sheets
each font family is specified as either a <family-name> or a <generic-name> value. the example below lists two font families, the first with a <family-name> and the second with a <generic-name>: font-family: gill sans extrabold, sans-serif; values <family-name> the name of a font family...
...it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax [ <family-name> | <generic-family> ]#where <family-name> = <string> | <custom-ident>+<generic-family> = serif | sans-serif | cursive | fantasy | monospace examples some common font families .serif { font-...
...it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax [ <family-name> | <generic-family> ]#where <family-name> = <string> | <custom-ident>+<generic-family> = serif | sans-serif | cursive | fantasy | monospace examples some common font families .serif { font-family: t...
...And 5 more matches
font-style - CSS: Cascading Style Sheets
faces are usually just sloped versions of the regular face. when the specified style is not available, both italic and oblique faces are simulated by artificially sloping the glyphs of the regular face (use font-synthesis to control this behavior). syntax font-style: normal; font-style: italic; font-style: oblique; font-style: oblique 10deg; /* global values */ font-style: inherit; font-style:
initial; font-style: unset; the font-style property is specified as a single keyword chosen from the list of values below, which can optionally include an angle if the keyword is oblique. values normal selects a font that is classified as normal within a font-family. italic selects a font that is classified as italic. if no italic version of the face is available, one classified as oblique is...
...el.textcontent = `font-style: ${slant};`; sampletext.style.fontstyle = slant; } slantinput.addeventlistener('input', update); update(); accessibility concerns large sections of text set with a font-style value of italic may be difficult for people with cognitive concerns such as dyslexia to read. mdn understanding wcag, guideline 1.4 explanations w3c understanding wcag 2.1 formal def
inition
initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | italic | oblique <angle>? examples font styles <p class="normal">this paragraph is normal.</p> <p class="italic">this paragraph is italic.</p> <p class="oblique">this paragraph is oblique.</p> .normal { fon...
...ue <angle>? ...
...And 5 more matches
grid-template-columns - CSS: Cascading Style Sheets
any columns will be implicitly generated and their size will be determined by the grid-auto-columns property. <length> a non-negative length, giving the width of the column. <percentage> is a non-negative <percentage> value relative to the inline size of the grid container. if the size of the grid co...
...k-list> ) represents a repeated fragment of the track list, allowing a large number of columns that exhibit a recurring pattern to be written in a more compact form. subgrid the subgrid value indicates that the grid will adopt the spanned portion of its parent grid in that axis. ...
...more compact form. subgrid the subgrid value indicates that the grid will adopt the spanned portion of its parent grid in that axis. rather than being specified explicitly, the sizes of the grid rows/columns will be taken from the parent grid’s def
inition. the subgrid value is from level 2 of the grid specification and currently only has implementation in firefox 71 and onwards. ...
...And 5 more matches
grid-template-rows - CSS: Cascading Style Sheets
values none is a keyword meaning that there is no explicit grid. any rows will be implicitly generated and their size will be determined by the grid-auto-rows property. <length> is a non-negative length. <percentage> is a non-negat...
...rack-list> ) represents a repeated fragment of the track list, allowing a large number of rows that exhibit a recurring pattern to be written in a more compact form. subgrid the subgrid value indicates that the grid will adopt the spanned portion of its parent grid in that axis. ...
...ore compact form. subgrid the subgrid value indicates that the grid will adopt the spanned portion of its parent grid in that axis. rather than being specified explicitly, the sizes of the grid rows/columns will be taken from the parent grid’s def
inition. the subgrid value is from level 2 of the grid specification and currently only has implementation in firefox 71 and onwards. ...
...And 5 more matches
text-align - CSS: Cascading Style Sheets
using a <string> value only, in which case the other value defaults to right. using both a keyword value and a <string> value. values start the same as left if direction is left-to-right and right ...
...en applied to a table cell, specifies the alignment character around which the cell's contents will align. accessibility concerns the inconsistent spacing between words created by justified text can be problematic for people with cognitive concerns such as dyslexia. ...
...d to a table cell, specifies the alignment character around which the cell's contents will align. accessibility concerns the inconsistent spacing between words created by justified text can be problematic for people with cognitive concerns such as dyslexia. ...
...And 5 more matches
word-break - CSS: Cascading Style Sheets
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 /* keyword values */ word-break: normal; word-break: break-all; word-break: keep-all; word-break: break-word; /* deprecated */ /* global values */ word-break: inherit; word-break:
initial; word-break: unset; the word-break property is specified as a single keyword chosen from the list of values below. values normal use the default line break rule. break-all to prevent overflow, word breaks should be inserted between any two characters (excluding chinese/japanese/korean text). keep-all word breaks should not be used for chinese/japanese/korean (cjk) text. non-cjk text...
...mal and overflow-wrap: anywhere, regardless of the actual value of the overflow-wrap property. note: in contrast to word-break: break-word and overflow-wrap: break-word (see overflow-wrap), word-break: break-all will create a break at the exact place where text would otherwise overflow its container (even if putting an entire word on its own line would negate the need for a break). ...
...verflow-wrap: anywhere, regardless of the actual value of the overflow-wrap property. note: in contrast to word-break: break-word and overflow-wrap: break-word (see overflow-wrap), word-break: break-all will create a break at the exact place where text would otherwise overflow its container (even if putting an entire word on its own line would negate the need for a break). ...
...And 5 more matches
Numbers and dates - JavaScript
numbers. numbers in javascript, numbers are implemented in double-precision 64-bit binary format ieee 754 (i.e., a number between ±2−1022 and ±2+1023, or about ±10−308 to ±10+308, with a numeric precision of 53 bits). integer values up to ±253 − 1 can be represented exactly. in addition to being able to represent floating-point numbers, the number type has three symbolic values: +inf
inity, -inf
inity, and nan (not-a-number). a more recent addition to javascript is bigint which lets you represent integers that may be very large. there are caveats to using bigint, however; for example, you can't mix and match bigint and number values in the same operation, and you can't use the math object with bigint values. see also javascript data types and structures for context with other pri...
...def), the following syntaxerror is thrown: "identifier starts immediately after numeric literal". ...
... // 81985529216486900 0xa // 10 exponentiation 1e3 // 1000 2e6 // 2000000 0.1e2 // 10 number object the built-in number object has properties for numerical constants, such as maximum value, not-a-number, and inf
inity. you cannot change the values of these properties and you use them as follows: var biggestnum = number.max_value; var smallestnum = number.min_value; var inf
initenum = number.positive_inf
inity; var neginf
initenum = number.negative_inf
inity; var notanum = number.nan; you always refer to a property of the predefined number object as shown above, and not as a property of a number object you create yourself. the following table summarizes the number object's properties. properties of number property description number.max_value ...
...And 5 more matches
Functions - JavaScript
not reflected globally or in the calling function. however, object references are values, too, and they are special: if the function changes the referred object's properties, that change is visible outside the function, as shown in the following example: /* declare the function 'myfunc' */ function myfunc(theobject) { theobject.brand = "toyota"; } /* * declare variable 'mycar'; * create and
initialize a new object; * assign reference to it to 'mycar' */ var mycar = { brand: "honda", model: "accord", year: 1998 }; /* logs 'honda' */ console.log(mycar.brand); /* pass object reference to the function */ myfunc(mycar); /* * logs 'toyota' as the value of the 'brand' property * of the object, as changed to by the function. */ console.log(mycar.brand); the this keyword does not ...
...ame. can be omitted, in which case the function becomes known as an anonymous function. param the name of an argument to be passed to the function. statements the statements comprising the body of the function. here is an example of an anonymous function expression (the name is not used): var myfunction = function() { statements } it is also possible to provide a name inside the def
inition in order to create a named function expression: var myfunction = function namedfunction(){ statements } one of the benefits of creating a named function expression is that in case we encountered an error, the stack trace will contain the name of the function, making it easier to find the origin of the error. as we can see, both examples do not start with the function keyword. statement...
...n (arg1, arg2, ... argn, functionbody) arg1, arg2, ... argn zero or more names to be used by the function as formal argument names. each must be a string that conforms to the rules for a valid javascript identifier or a list of such strings separated with a comma; for example "x", "thevalue", or "a,b". functionbody a string containing the javascript statements comprising the function def
inition. invoking the generatorfunction constructor as a function (without using the new operator) has the same effect as invoking it as a constructor. function parameters default parameters default function parameters allow formal parameters to be
initialized with default values if no value or undefined is passed. for more details, see default parameters. rest parameters the rest parameter syn...
...And 5 more matches
Populating the page: how browsers work - Web Performance
tep of navigating to a web page is finding where the assets for that page are located. if you navigate to https://example.com, the html page is located on the server with ip address of 93.184.216.34. if you’ve never visited this site, a dns lookup must happen. your browser requests a dns lookup, which is eventually fielded by a name server, which in turn responds with an ip address. after this
initial request, the ip will likely be cached for a time, which speeds up subsequent requests by retrieving the ip address from the cache instead of contacting a name server again. dns lookups usually only need to be done once per hostname for a page load. however, dns lookups must be done for each unique hostname the requested page references. if your fonts, images, scripts, ads, and metrics all hav...
...t is actually sent. while making the connection secure adds time to the page load, a secure connection is worth the latency expense, as the data transmitted between the browser and the web server cannot be decrypted by a third party. after the 8 round trips, the browser is finally able to make the request. response once we have an established connection to a web server, the browser sends an
initial http get request on behalf of the user, which for websites is most often an html file. once the server receives the request, it will reply with relevant response headers and the contents of the html. <!doctype html> <html> <head> <meta charset="utf-8"/> <title>my simple page</title> <link rel="stylesheet" src="styles.css"/> <script src="myscript.js"></script> </head> <body> <h1 cla...
..."utf-8"/> <title>my simple page</title> <link rel="stylesheet" src="styles.css"/> <script src="myscript.js"></script> </head> <body> <h1 class="heading">my page</h1> <p>a paragraph with a <a href="https://example.com/about">link</a></p> <div> <img src="myimage.jpg" alt="image description"/> </div> <script src="anotherscript.js"></script> </body> </html> this response for this
initial request contains the first byte of data received. time to first byte (ttfb) is the time between when the user made the request—say by clicking on a link—and the receipt of this first packet of html. the first chunk of content is usually 14kb of data. in our example above, the request is def
initely less than 14kb, but the linked resources aren't requested until the browser encounters the l...
...And 5 more matches
dur - SVG: Scalable Vector Graphics
imple duration of an animation. ...
...the value must be greater than 0 and can be expressed with hours (h), minutes (m), seconds (s) or milliseconds (ms). itʼs possible to combine those time representat...
...the value must be greater than 0 and can be expressed with hours (h), minutes (m), seconds (s) or milliseconds (ms). ...
...And 5 more matches
fill-rule - SVG: Scalable Vector Graphics
it is therefore considered outside the shape, and not filled. --> <polygon fill-rule="evenodd" stroke="red" points="150,0 121,90 198,35 102,35 179,90"/> </svg> usage notes value nonzero | evenodd default value nonzero animatable yes the fill-rule attribute provides two options for how the inside (that is, the area to be filled) of a shape...
...starting with a count of zero, add one each time a path segment crosses the ray from left to right and subtract one each time a path segment crosses the ray from right to left. after counting the crossings, if the result is zero then the point is outside the path. otherwise, it is inside. example htm...
...if this number is odd, the point is inside; if even, the point is outside. example html,body,svg { height:100% } <svg viewbox="-10 -10 320 120" xmlns="http://www.w3.org/2000/svg"> <!-- effect of evenodd fill rule on crossing path segments --> <polygon fill-rule="evenodd" stroke="red" ...
...And 5 more matches
rx - SVG: Scalable Vector Graphics
lue for rx as half of the width of the rectangle. value <length> | <percentage> | auto default value auto animatable yes note: starting with svg2, rx is a geometry property meaning this attribute can also be used as a css property for rects. ...
...ngth> | <percentage> | auto default value auto animatable yes note: starting with svg2, rx is a geometry property meaning this attribute can also be used as a css property for rects. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'rx' in that specification. ...
... starting with svg2, rx is a geometry property meaning this attribute can also be used as a css property for rects. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'rx' in that specification. candidate recommendation def
inition as a geometry property scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'rx' in that specification. ...
...And 5 more matches
ry - SVG: Scalable Vector Graphics
lue for ry as half of the width of the rectangle. value <length> | <percentage> | auto default value auto animatable yes note: starting with svg2, ry is a geometry property meaning this attribute can also be used as a css property for rects. ...
...ngth> | <percentage> | auto default value auto animatable yes note: starting with svg2, ry is a geometry property meaning this attribute can also be used as a css property for rects. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'ry' in that specification. ...
... starting with svg2, ry is a geometry property meaning this attribute can also be used as a css property for rects. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'ry' in that specification. candidate recommendation def
inition as a geometry property scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'ry' in that specification. ...
...And 5 more matches
Content type - SVG: Scalable Vector Graphics
.25 = 50 hours, 10 seconds and 250 milliseconds partial clock value: 02:33 = 2 minutes and 33 seconds 00:10.5 = 10.5 seconds = 10 seconds and 500 milliseconds timecount values: 3.2h = 3.2 hours = 3 hours and 12 minutes 45min = 45 minutes 30s = 30 seconds 5ms = 5 milliseconds 12.467 = 12 seconds and 467 milliseconds fractional values are just (base 10) floating point def
initions of seconds. thus: 00.5s = 500 milliseconds 00:00.005 = 5 milliseconds color <color> the basic type <color> is a css2 compatible specification for a color in the srgb color space. <color> applies to svg's use of the color attribute and is a component of the def
initions of attributes fill, stroke, stop-color, flood-color, and lighting-color, which also offer optional icc-based colo...
... svg supports all of the syntax alternatives for <color> defined in css2 syntax and basic data types, and (depend on the implementation) in the future css color module level 3. a <color> is either a keyword or a numerical rgb specification. in addition to these color keywords, users may specify keywords that correspond to the colors used by objects in the user's environment. the normative def
inition of these keywords is found in user preferences for colors (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 (...
...e "rgb(" or "rgb(". for compatibility, the all-lowercase form "rgb(" is preferred. the integer value 255 corresponds to 100%, and to f or ff in the hexadecimal notation: rgb(255,255,255) = rgb(100%,100%,100%) = #fff. white space characters are allowed around the numerical values. all rgb colors are specified in the srgb color space. using srgb provides an unambiguous and objectively measurable def
inition of the color, which can be related to international standards. color ::= "#" hexdigit hexdigit hexdigit (hexdigit hexdigit hexdigit)? | "rgb("integer, integer, integer")" | "rgb("integer "%", integer "%", integer "%)" | color-keyword hexdigit ::= [0-9a-fa-f] where color-keyword matches (case insensitively) one of the color keywords listed in css c...
...And 5 more matches
Creating Reusable Modules - Archive of obsolete content
er select a file we'll use nsifilepicker. the documentation for that interface includes an example which we can adapt like this: var {cc, ci} = require("chrome"); function promptforfile() { const nsifilepicker = ci.nsifilepicker; var fp = cc["@mozilla.org/filepicker;1"] .createinstance(nsifilepicker); var window = require("sdk/window/utils").getmostrecentbrowserwindow(); fp.
init(window, "select a file", nsifilepicker.modeopen); fp.appendfilters(nsifilepicker.filterall | nsifilepicker.filtertext); var rv = fp.show(); if (rv == nsifilepicker.returnok || rv == nsifilepicker.returnreplace) { var file = fp.file; // get the path as string. note that you usually won't // need to work with the string paths. var path = fp.file.path; // work with returne...
...ncludes an example of calculating an md5 hash of a file's contents, given its path. ...
...hexadecimal code for a byte function tohexstring(charcode) { return ("0" + charcode.tostring(16)).slice(-2); } function md5file(path) { var f = cc["@mozilla.org/file/local;1"] .createinstance(ci.nsilocalfile); f.
initwithpath(path); var istream = cc["@mozilla.org/network/file-input-stream;1"] .createinstance(ci.nsifileinputstream); // open for reading istream.
init(f, 0x01, 0444, 0); var ch = cc["@mozilla.org/security/hash;1"] .createinstance(ci.nsicryptohash); // we want to use the md5 algorithm ch.
init(ch.md5); // this tells updatefromstream to read the entire file const pr_uint32_max = 0xffffffff; ch.updatefromstream(istream, pr_uint32_max); // pass false here to get binary data back var hash = ch.finish(false); // convert t...
...And 4 more matches
Interaction between privileged and non-privileged pages - Archive of obsolete content
attribute1 and attribute2. to trigger the alert() in the listener and pass the data from the web page, write code such as this in the web page: var element = document.createelement("myextensiondataelement"); element.setattribute("attribute1", "foobar"); element.setattribute("attribute2", "hello world"); document.documentelement.appendchild(element); var evt = document.createevent("events"); evt.
initevent("myextensionevent", true, false); element.dispatchevent(evt); this code creates an arbitrary element -- <myextensiondataelement/> -- and inserts it into the web page's dom. values are set for two arbitrary attributes on the element. these can also be named anything you like, but we've chosen attribute1 and attribute2. finally, the code creates and dispatches a custom event named myextensio...
...xtension (privileged code) where your listener catches it and reads the attribute values from the dom element where the event originated. ...
... in the web page: document.addeventlistener("myanswerevent",function(e) { extensionanswer(e); },false); ...
...And 4 more matches
Appendix: What you should know about open-source software licenses - Archive of obsolete content
icenses exist, and when they’re appropriate. what is an oss license? what are the different kinds of oss licenses and what are their key characteristics? applying an oss license oss licensing today and in the future references what is an oss license? an open-source software license is a statement that anyone is free to use your source code in whatever way they want. the open source def
inition states what conditions the oss license must satisfy. perhaps surprisingly, these licenses enforce their terms through the exercise of copyright. understanding copyright all software licenses, not just open source, enforce their terms based on copyright. it’s easiest to understand if we think of it as being implemented in terms of the copyright framework. about copyright to put it very br...
... this covers three rights and six conditions. what is important to us now is the following three rights: open source rights: a user can create and distribute copies of the source code; a user can obtain a program’s source code; a user can modify the source code. any oss license will include these rights. the user is free to u...
...stricted software license >> usable within permitted scope restricted use within permitted scope fixme: wow, the table is weird! so what’s an oss license? so now you’re wondering, what conditions does an oss license place on software? this can be briefly answered by the open source def
inition, which was determined by the open source
initiative (osi). this covers three rights and six conditions. what is important to us now is the following three rights: open source rights: a user can create and distribute copies of the source code; a user can obtain a program’s source code; a user can modify the source code. any oss license will include these rights. the user is free to use (duplicate, distribute, and modify) the source...
...And 4 more matches
Table Reflow Internals - Archive of obsolete content
the container posts a dirty reflow command with itself as the target. content is inserted, appended, or deleted through the dom. ...
...the container posts a dirty reflow command with itself as the target. content is inserted, appended, or deleted through the dom. ...
...es in the reflow metrics after (possibly) reflowing some or all of its children which reflows it children, etc. the reflowee returns a reflow status which indicates if it is complete, and 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. incremental - 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 chan...
...And 4 more matches
Build the brick field - Game development
nt-kit/demos/lesson09.html. building the brick field is a little bit more complicated than adding a single object to the screen, although it's still easier with phaser than in pure javascript. let's explore how to create a group of bricks and print them on screen using a loop. defining new variables first, let's define the needed variables — add the following below your previous variable def
initions: var bricks; var newbrick; var brickinfo; the bricks variable will be used to create a group, newbrick will be a new object added to the group on every iteration of the loop, and brickinfo will store all the data we need. rendering the brick image next, let's load the image of the brick — add the following load.image() call just below the others: function preload() { // ... ga...
...the data we need. rendering the brick image next, let's load the image of the brick — add the following load.image() call just below the others: function preload() { // ... game.load.image('brick', 'img/brick.png'); } you also need to grab the brick image from github and save it in your /img directory. drawing the bricks we will place all the code for drawing the bricks inside an
initbricks function to keep it separated from the rest of the code. add a call to
initbricks at the end of the create() function: function create(){ // ...
initbricks(); } now onto the function itself. add the
initbricks() function at the end of our games code, just before the closing </script> tag, as shown below. to begin with we've included the brickinfo object, as this will come in han...
...it separated from the rest of the code. add a call to
initbricks at the end of the create() function: function create(){ // ...
initbricks(); } now onto the function itself. add the
initbricks() function at the end of our games code, just before the closing </script> tag, as shown below. ...
...And 4 more matches
Object prototypes - Learn web development
e in which we finished writing our person() constructor — load the example in your browser. you can use our oojs-class-further-exercises.html example (see also the source code), if you don't already have it from working through the last article. ...
...e also the source code), if you don't already have it from working through the last article. ...
...ill however also see some other members — tostring, valueof, etc — these are defined on person1's prototype object's prototype object, which is object.prototype. what happens if you call a method on person1, which is actually defined on object.prototype? for example: person1.valueof() valueof() returns the value of the object it is called on. in this case, what happens is: the browser
initially checks to see if the person1 object has a valueof() method available on it, as defined on its constructor, person(), and it doesn't. so the browser checks to see if the person1's prototype object has a valueof() method available on it. it doesn't, then the browser checks person1's prototype object's prototype object, and it has. so the method is called, and all is good! note: we want to ...
...And 4 more matches
Introducing a complete toolchain - Learn web development
f there's problems in my code format, go ahead and fix them, then save my file". this is fine for our development process, but we can also use prettier without the flag and it will only check the file. checking the file (and not saving it) is useful for purposes like checks that run before a release - i.e. "don't release any code that's not been properly formatted." it can be arduous to run the
initial command against each file, and it would be useful to have a single command to do this for us (and the same will go for our linting tools). there's many different ways to solve this problem; here's just a few: using npm scripts to run multiple commands from the command line in one go, such as npm run tidy-code. using special "git hooks" to test if the code is formatted before a commit. us...
...ver used no-unused-vars 96:19 error 'b' is defined but never used no-unused-vars ✖ 3 problems (3 errors, 0 warnings) note: we'll install eslint in the next section; don't worry about this for now. as with other tools, code editor integration support is typically good for eslint, and potentially more useful as it can give us real-time feedback when issues crop up: configuring the
initial project using these tools, a new project can be set up safe in the knowledge that many "basic" issues will be caught early on. using the command line, we can create the project, install the
initial tooling, and create rudimentary configuration files. again, once you've repeated this process a few times, you'll get a feel for what your default setup should be. of course, this is just one poss...
... start off by opening your terminal, and navigating to a place that you'll be able to find and get to easily. ...
...And 4 more matches
An overview of NSS Internals
storage and management apis. nss doesn't require the programmer to manage individual files containing individual certificates or keys. instead, nss offers to use its own database(s). once you have imported certificates and keys into the nss database, you can easily look them up and use them again. because of nss's expectation to operate with an nss database, it's mandatory that you perform an
initialization call, where you tell nss which database you will be using. in the most simple scenario, the programmer will provide a directory on your filesystem as a parameter to the
init function, and nss is designed to do the rest. it will detect and open an existing database, or it can create a new one. alternatively, should you decide that you don't want to work with any persistent recording of c...
...usually, nss will flush all data to disk as soon as new data has been added to permanent storage. ...
...the list of external pkcs#11 modules that have been registered to be used by nss. the file could be named secmod.db, but in newer database generations a file named pkcs11.txt is used. only nss is allowed to access and manipulate these database files directly; a programmer using nss must go through the apis offered by nss to manipulate the data stored in these files. the programmer's task is to
initialize nss with the required parameters (such as a database), and nss will then transparently manage the database files. most of the time certificates and keys are supposed to be stored in the nss database. therefore, after
initial import or creation, the programmer usually doesn't deal with their raw bytes. instead, the programmer will use lookup functions, and nss will provide an access handl...
...And 4 more matches
Enc Dec MAC Output Public Key as CSR
, ck_mechanism_type mechanism, int keysize, secitem *keyid, secupwdata *pwdata) { secstatus rv; pk11symkey *key; /* generate the symmetric key */ key = pk11_tokenkeygen(slot, mechanism, null, keysize, keyid, pr_false, pwdata); if (!key) { pr_fprintf(pr_stderr, "symmetric key generation failed \n"); } return key; } /* * mac
init */ secstatus mac
init(pk11context *ctx) { secstatus rv = pk11_digestbegin(ctx); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestbegin()\n"); } return rv; } /* * macupdate */ secstatus macupdate(pk11context *ctx, unsigned char *msg, unsigned int msglen) { secstatus rv = pk11_digestop(ctx, msg, msglen); if (rv != secsuccess...
...stfinal(ctx, mac, maclen, maxlen); if (rv != secsuccess) { pr_fprintf(pr_stderr, "compute mac failed : pk11_digestfinal()\n"); } return secsuccess; } /* * compute mac */ secstatus computemac(pk11context *ctxmac, unsigned char *ptext, unsigned int ptextlen, unsigned char *mac, unsigned int *maclen, unsigned int maxlen) { secstatus rv = mac
init(ctxmac); if (rv != secsuccess) return rv; rv = macupdate(ctxmac, ptext, ptextlen); if (rv != secsuccess) return rv; rv = macfinal(ctxmac, mac, maclen, maxlen); return rv; } /* * writetoheaderfile */ secstatus writetoheaderfile(const char *buf, unsigned int len, headertype type, prfiledesc *outfile) { secstatus rv; const char *header; co...
...er = lab_trailer; pr_fprintf(outfile, "%s\n", header); pr_fprintf(outfile, "%s\n", buf); pr_fprintf(outfile, "%s\n\n", trailer); return secsuccess; break; default: return secfailure; } pr_fprintf(outfile, "%s\n", header); printasascii(outfile, buf, len); pr_fprintf(outfile, "%s\n\n", trailer); return secsuccess; } /* *
initialize for encryption or decryption - common code */ pk11context * crypt
init(pk11symkey *key, unsigned char *iv, unsigned int ivlen, ck_mechanism_type type, ck_attribute_type operation) { secitem ivitem = { sibuffer, iv, ivlen }; pk11context *ctx = null; secitem *secparam = pk11_paramfromiv(type, &ivitem); if (secparam == null) { pr_fprintf(pr_stderr, ...
...And 4 more matches
JSAPI reference
roughly, but not really, corresponded to firefox releases. in the fall of 2012, the spidermonkey team decided to align releases with those of firefox. the reference applies this versioning scheme retroactively starting with firefox 5. firefox 4 is the last release that has a corresponding spidermonkey release with the old scheme, where the jsapi has the version 1.8.5. ...
...rsion_latest js_getimplementationversion js_getversion js_setversionforcompartment added in spidermonkey 31 js_stringtoversion js_versiontostring js_setversion obsolete since jsapi 25 js::currentglobalornull added in spidermonkey 31 js_getglobalforscopechain obsolete since jsapi 25 js_getglobalobject obsolete since jsapi 24 js_setglobalobject obsolete since jsapi 25 js_
initclass js_
initstandardclasses js_resolvestandardclass js_enumeratestandardclasses js_enumerateresolvedstandardclasses obsolete since jsapi 24 js_isrunning js_saveframechain js_restoreframechain js_isassigning obsolete since javascript 1.8.5 js_isconstructing obsolete since jsapi 26 js_isconstructing_possiblywithgiventhisobject obsolete since jsapi 17 js_getscopechain obsolete ...
...bage collector and other garbage collectors.) struct jstracer added in spidermonkey 1.8 js_tracechildren added in spidermonkey 1.8 js_traceruntime added in spidermonkey 1.8 jsval_is_traceable added in spidermonkey 1.8 obsolete since jsapi 31 jsval_to_traceable added in spidermonkey 1.8 obsolete since jsapi 31 jsval_trace_kind added in spidermonkey 1.8 obsolete since jsapi 31 js_tracer_
init added in spidermonkey 1.8 obsolete since jsapi 12 js_tracer
init added in spidermonkey 12 obsolete since jsapi 31 js_calltracer added in spidermonkey 1.8 obsolete since jsapi 22 js_set_tracing_details added in spidermonkey 1.8 obsolete since jsapi 26 js_set_tracing_index added in spidermonkey 1.8 obsolete since jsapi 26 js_set_tracing_name added in spidermonkey 1.8 obsolete since jsapi 26 js...
...And 4 more matches
Parser API
c is true, the parser includes source location information in the returned ast nodes. source string default: null a description of the input source; typically a filename, path, or url. this string is not meaningful to the parsing process, but is produced as part of the source location information in the returned ast nodes. line number default: 1 the
initial line number to use for source location information. builder builder default: null a builder object, which can be used to produce ast nodes in custom data formats. the expected callback methods are described under builder objects. target string default: script a type of the parsing target, can be either script or module. i...
...te: multiple catch clauses are spidermonkey-specific. interface whilestatement <: statement { type: "whilestatement"; test: expression; body: statement; } a while statement. interface dowhilestatement <: statement { type: "dowhilestatement"; body: statement; test: expression; } a do/while statement. interface forstatement <: statement { type: "forstatement";
init: variabledeclaration | expression | null; test: expression | null; update: expression | null; body: statement; } a for statement. interface forinstatement <: statement { type: "forinstatement"; left: variabledeclaration | expression; right: expression; body: statement; each: boolean; } a for/in statement, or, if each is true, a for each/in statement. note: t...
... expression: boolean; } a function declaration. note: the id field cannot be null. interface variabledeclaration <: declaration { type: "variabledeclaration"; declarations: [ variabledeclarator ]; kind: "var" | "let" | "const"; } a variable declaration, via one of var, let, or const. interface variabledeclarator <: node { type: "variabledeclarator"; id: pattern;
init: expression | null; } a variable declarator. note: the id field cannot be null. note: let and const are spidermonkey-specific. expressions interface expression <: node, pattern { } any expression node. since the left-hand side of an assignment may be any expression in general, an expression can also be a pattern. interface thisexpression <: expression { type: "thisexpression"; } a t...
...And 4 more matches
SpiderMonkey 31
it is supported on x86, x86_64, and arm architectures. on some other platforms (sparc, mips), the jit is provided but not supported. on all 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 31 the first change most embedders will notice is that spidermonkey must now be
initialized before it can be used, using the newly-repurposed js_
init method. after this method is called, normal jsapi operations are permitted. when all jsapi operation has completed, the corresponding js_shutdown method (currently non-mandatory, but highly recommended as it may become mandatory in the future) un
initializes spidermonkey, cleaning up memory and allocations performed by js_
init. a ...
... as the jspropertydescriptor structure and the matching jsprop_shortid flag. these and other changes are explained in detail below. new javascript language features javascript 31 includes significant updates to language features, yo. new c++ apis jsapi is now a c++-only api. please note that spidermonkey reserves the js:: namespace for itself (and the js:: namespace for internal use). js_
init is a new function which must be used to
initialize the js engine before any jsruntimes are created or other jsapi methods are called. this method pairs with the existing (currently non-mandatory) js_shutdown method, which un
initializes the js engine after all runtimes have been destroyed. js_seticumemoryfunctions is a new function which can be used to set the allocation and deallocation functio...
...rrently non-mandatory) js_shutdown method, which un
initializes the js engine after all runtimes have been destroyed. js_seticumemoryfunctions is a new function which can be used to set the allocation and deallocation functions used by the icu internationalization library. this is unlikely to be of interest to embedders unless you are doing detailed memory profiling. it must be called before js_
init is called. obsolete apis js_convertarguments "j" type deleted apis js_newgrowablestring (can be replaced with js_newucstring) js_isconstructing (can be replaced with callargs::isconstructing or callreceiver::isconstructing) js_valuetoboolean (replaced by js::toboolean) js_valuetonumber (can be replaced with js::tonumber) js_valuetoint64 (replaced by js::toint64) js_valuetouint64 (r...
...And 4 more matches
Core XPCOM functions
xpcom provides a number of global functions which are used to
initialize and shut down the xpcom library, as well as to allocate memory, get access to services, and to instantiate interfaces. ...
... ns_newlocalfilethe ns_newlocalfile function creates an instance of nsilocalfile that provides a platform independent representation of a file path.ns_newnativelocalfilethe ns_newna...
... ns_newlocalfilethe ns_newlocalfile function creates an instance of nsilocalfile that provides a platform independent representation of a file path.ns_newnativelocalfilethe ns_newnativelocalfile fun...
...And 4 more matches
nsIEditorSpellCheck
g suggestedword); astring getcurrentdictionary(); void getdictionarylist([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 nsitextservicesf...
...void addwordtodictionary( in wstring word ); parameters word the word to add to the current personal dictionary. canspellcheck() determines whether or not spell checking can be enabled. boolean canspellcheck(); parameters none. retur...
...urn 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. ...
...And 4 more matches
nsIPromptService
use this for labels that don't match one of the constants above. button default flags these flags are used to select which button is the default. constant value description button_pos_0_default 0 button_pos_1_default 16777216 button_pos_2_default 33554432 button_delay_enable button_delay_enable causes the buttons to be
initially disabled. they are enabled after a timeout expires. the implementation may interpret this loosely, as the intent is to ensure that the user does not click through a security dialog too quickly. strictly speaking, the implementation could choose to ignore this flag. a delay can be useful not only to give the user more time to think before acting, but also as a countermeasure against malicious...
...ext, in wstring acheckmsg, inout boolean acheckstate ); parameters aparent the parent window for the dialog. if set to null the parent window will be nsiwindowwatcher.activewindow. adialogtitle text to appear in the title of the dialog. atext text to appear in the body of the dialog. acheckmsg text to appear with the checkbox. acheckstate contains the
initial checked state of the checkbox when this method is called and the final checked state after this method returns. if you call this method from javascript you need to wrap this argument in an object with its 'value' property set to a boolean (or use an empty object). see also the alertcheck_example. confirm() shows a dialog with ok and cancel buttons. boolean confirm( in nsidomwindow aparent, ...
...ext, in wstring acheckmsg, inout boolean acheckstate ); parameters aparent the parent window for the dialog. if set to null the parent window will be nsiwindowwatcher.activewindow. adialogtitle text to appear in the title of the dialog. atext text to appear in the body of the dialog. acheckmsg text to appear with the checkbox. acheckstate contains the
initial checked state of the checkbox when this method is called and the final checked state after this method returns. if you call this method from javascript you need to wrap this argument in an object with its 'value' property set to a boolean (or use an empty object). return value true for ok, false for cancel confirmex() puts up a dialog with up to 3 buttons and an optional, labeled checkb...
...And 4 more matches
nsIStructuredCloneContainer
dom/interfaces/base/nsistructuredclonecontainer.idlscriptable this interface acts as a container for an object serialized using the structured clone algorithm. 1.0 66 introduced gecko 6.0 inherits from: nsisupports last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) you can copy an object into an nsistructuredclonecontainer using
initfromvariant() or
initfrombase64(). it is an error to
initialize an nsistructuredclonecontainer more than once. once you've
initialized the container, you can get a copy of the object it stores by calling deserializetovariant(). you can also get a base-64-encoded string containing a copy of the container's serialized data, using getdataasbase64(). method overview nsivariant deserializetovariant(); astring...
...read only. ...
...read only. serializednbytes unsigned long long get the size in bytes of this container's serialized data. read only. ...
...And 4 more matches
nsITextInputProcessor
scenarios in automated tests (what's tested with such events?) and js-ime and/or js-keyboard on firefox os or add-ons may dispatch events with wrong rules. for solving that issue, methods of this interface have been designed for performing a key operation or representing a change of composition state. for example, the implementation of this interface manages modifier state and composition state,
initializes dom events from minimum information, and doesn't dispatch some events if they are not necessary. this means that even when gecko changes the dom event behavior, it may not be necessary that the users of this interface need to be updated, i.e., the implementation of this class can be a cushion from the impact of gecko's change. you can create an instance of this interface with the followin...
...ents printable keyboard events forcibly. for example, if a key causes inputting "enter" as text, this flag is necessary. if this flag is not specified in such case, non-printable keyboard events will be dispatched. key_keep_key_location_standard 0x00000008 one of akeyflags. the location attribute value of dispatching keyboard events is computed automatically if the attribute isn't
initialized or
initialized with 0. for the latter case, you may not want textinputprocessor to compute location attribute value. in this case, you can suppress the computation with this flag. if this is specified with non-zero location attribute value, this causes throwing an exception since it doesn't make sense. key_keep_keycode_zero 0x00000010 one of akeyflags. the keycode attribute ...
...ribute value. in this case, you can suppress the computation with this flag. if this is specified with non-zero location attribute value, this causes throwing an exception since it doesn't make sense. key_keep_keycode_zero 0x00000010 one of akeyflags. the keycode attribute value of dispatching printable keyboard events is computed from key value automatically if the attribute isn't
initialized or
initialized with 0. for the latter case, you may not want textinputprocessor to compute keycode attribute value. in this case, you can suppress the computation with this flag. if this is specified with non-zero keycode attribute value, this causes throwing an excepction since it doesn't make sense. key_dont_dispatch_modifier_key_event 0x00000020 one of akeyflags. textinpu...
...And 4 more matches
Mozilla
d line options command line options are used to specify various startup options for mozilla applications.this page describes the commonly used options and how to use them. you can open the command line interface by pressing shift + f2. continuous integration when you push a commit to mozilla-central or a related repository, it
initiates a large chain of builds and tests across multiple types of infrastructure. this document will help you understand all the pieces that comprise mozilla's continuous integration systems. cookies in mozilla suggestions as to needed documentation can be directed to mike connor. cookies preferences in mozilla these p...
... web publishers can offer visitors a firefox sidebar to encourage their engagement. there are two ways to create a sidebar for firefox users: the social api and an extension. you can choose either depending on your needs and resources. creating a language pack to create a language pack, or a localization repack, you first need to go through the
initial setup process. creating a localized windows installer of seamonkey preamble: not all of the programs listed below are necessary. some of them are simply the ones i use because i like them, while others are scripts that i've created to speed up the work. you can in every case choose the program you prefer to do some operations, and you can also dec...
... the following tables list errors that can occur when calling various mozilla apis. each error is listed by its name and an error code in parentheses. an error will typically be displayed on the error console, but can be captured using a try-catch block in javascript. these constants can be accessed through components.results. for example, by using components.results.ns_error_not_
initialized firefox here you can learn about how to contribute to the firefox project and you will also find links to information about the construction of firefox add-ons, using the developer tools in firefox, and other topics. firefox operational information database: sqlite a large amount of operational in...
...And 4 more matches
Plug-in Basics - Plugins
dules in particular places on the system. for more information about where gecko looks for plugin modules on different systems, see how gecko finds plug-ins. when the user opens a page that contains embedded data of a media type that invokes a plug-in, the browser responds with the following sequence of actions: check for a plug-in with a matching mime type load the plug-in code into memory
initialize the plug-in create a new instance of the plug-in gecko can load multiple instances of the same plug-in on a single page, or in several open windows at the same time. if you are browsing a page that has several embedded realaudio clips, for example, the browser will create as many instances of the realplayer plug-in as are needed (though of course playing several realaudio files at the sa...
...y for its mime types. the following stages outline the life of a plug-in from loading to deletion: when gecko encounters data of a mime type registered for a plug-in (either embedded in an html page or in a separate file), it dynamically loads the plug-in code into memory, if it hasn't been loaded already, and it creates a new instance of the plug-in. gecko calls the plug-in api function np_
initialize when the plug-in code is first loaded. by convention, all of the plug-in specific functions have the prefix "npp", and all of the browser-specific functions have the prefix "npn". note: np_
initialize and np_shutdown are not technically a part of the function table that the plug-in hands to the browser. the browser calls them when the plug-in software is loaded and unloaded. these function...
... the browser calls the plug-in api function npp_new when the instance is created. multiple instances of the same plug-in can exist (a) if there are multiple embedded objects on a single page, or (b) if several browser windows are open and each displays the same data type. ...
...And 4 more matches
CSS.registerProperty() - Web APIs
sters custom properties, allowing for property type checking, default values, and properties that do or do not inherit their value. registering a custom property allows you to tell the browser how the custom property should behave; what are allowed types, whether the custom property inherits its value, and what the default value of the custom property is. syntax css.registerproperty(propertydef
inition); parameters a propertydef
inition dictionary object, which can contain the following members: name a domstring indicating the name of the property being defined. syntax optional a domstring representing the expected syntax of the defined property. defaults to "*". inherits a boolean value defining whether the defined property should be inherited (true), or not (false). defaults to fa...
... return value undefined. exceptions invalidmodificationerror the given name has already been registered. syntaxerror the given name isn't a valid custom property name (starts with two dashes, e.g. --foo). ...
... which can contain the following members: name a domstring indicating the name of the property being defined. syntax optional a domstring representing the expected syntax of the defined property. defaults to "*". inherits a boolean value defining whether the defined property should be inherited (true), or not (false). defaults to false.
initialvalue optional a domstring representing the
initial value of the defined property. return value undefined. exceptions invalidmodificationerror the given name has already been registered. syntaxerror the given name isn't a valid custom property name (starts with two dashes, e.g. --foo). typeerror the required name and/or inherits dictionary members were not provided. examples the following will register a custom property, --my-...
...And 4 more matches
DOMMatrixReadOnly - Web APIs
mmatrixreadonly—adds mutability, allowing you to alter the matrix after creating it. a 4×4 matrix is suitable to describe any rotation and translation in 3d. this interface should be available inside web workers, though some implementations doesn't allow it yet. properties this interface doesn't inherit any properties. is2d read only a boolean flag whose value is true if the matrix was
initialized as a 2d matrix. if false, the matrix is 3d. isidentity read only a boolean whose value is true if the matrix is the identity matrix. the identity matrix is one in which every value is 0 except those on the main diagonal from top-left to bottom-right corner (in other words, where the offsets in each direction are equal). m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m...
...d, for a total of six values and the form matrix(a, b, c, d, e, f). for a 3d matrix, the returned string contains all 16 elements and takes the form matrix3d(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44). see the css matrix3d() function for details on the 3d notation's syntax. throws an invalidstateerror exception if any of the elements in the matrix are non-f
inite (even if, in the case of a 2d matrix, the non-f
inite values are in elements not used by the 2d matrix representation). dommatrixreadonly.transformpoint() transforms the specified point using the matrix, returning a new dompoint object containing the transformed point. neither the matrix nor the original point are altered. dommatrixreadonly.translate() returns a new dommatrix containing a m...
...ror exception is thrown. fromfloat64array() creates a new mutable dommatrix object given an array of double-precision (64-bit) floating-point values. if the array has six values, the result is a 2d matrix; if the array has 16 values, the result is a 3d matrix. otherwise, a typeerror exception is thrown. ...
...And 4 more matches
Document.querySelectorAll() - Web APIs
es that the last element in the selector is within the search scope. ...
...electors on descendants of the base element: var select = document.queryselector('.select'); var inner = select.queryselectorall(':scope .outer .inner'); inner.length; // 0 specifications specification status comment domthe def
inition of 'parentnode.queryselectorall()' in that specification. living standard living standard selectors api level 2the def
inition of 'parentnode.queryselectorall()' in that specification. ...
...t.queryselectorall(':scope .outer .inner'); inner.length; // 0 specifications specification status comment domthe def
inition of 'parentnode.queryselectorall()' in that specification. living standard living standard selectors api level 2the def
inition of 'parentnode.queryselectorall()' in that specification. obsolete no change dom4the def
inition of 'parentnode.queryselectorall()' in that specification. ...
...And 4 more matches
Document - Web APIs
or <frameset> node of the current document. document.charactersetread only returns the character set being used by the document. document.compatmode read only indicates whether the document is rendered in quirks or strict mode. document.contenttype read only returns the content-type from the mime header of the current document. document.doctyperead only returns the document type def
inition (dtd) of the current document. document.documentelementread only returns the element that is a direct child of the document. for html documents, this is normally the htmlhtmlelement object representing the document's <html> element. document.documenturiread only returns the document location as a string. document.embedsread only returns a list of the embedded <embed> elements within t...
...ncel property. animationend fired when an animation has completed normally. also available via the onanimationend property. animationiteration fired when an animation iteration has completed. also available via the onanimationiteration property. animationstart fired when an animation starts. also available via the onanimationstart property. clipboard events copy fired when the user
initiates a copy action through the browser's user interface. also available via the oncopy property. cut fired when the user
initiates a cut action through the browser's user interface. also available via the oncut property. paste fired when the user
initiates a paste action through the browser's user interface. also available via the onpaste property. drag & drop events drag fired every...
...ilesize* returns size in bytes of the document. starting with internet explorer 11, that property is no longer supported. see msdn. internet explorer does not support all methods from the node interface in the document interface: document.contains as a work-around, document.body.contains() can be used. specifications specification status comment domthe def
inition of 'document' in that specification. living standard intend to supersede dom 3 html living standardthe def
inition of 'document' in that specification. living standard turn the htmldocument interface into a document extension. css object model (cssom) view modulethe def
inition of 'document' in that specification. working draft extend the document interface ...
...And 4 more matches
Element.animate() - Web APIs
onstart optional describes at what point in the iteration the animation should start. 0.5 would indicate starting halfway through the first iteration for example, and with this value set, an animation with 2 iterations would end halfway through a third iteration. defaults to 0.0. iterations optional the number of times the animation should repeat. defaults to 1, and can also take a value of inf
inity to make it repeat for as long as the element exists. you can also include a composite operation or iteration composite operation in your options list: composite optional determines how values are combined between this animation and other, separate animations that do not specify their own specific composite operation. defaults to replace. add dictates an additive effect, where each suc...
...ptional determines how values build from iteration to iteration in this animation. can be set to accumulate or replace (see above). defaults to replace. return value returns an animation. ...
...a single keyframe), and the browser will infer the other end of the animation if it is able to. ...
...And 4 more matches
Element.querySelectorAll() - Web APIs
rifies that the last element in the selector is within the search scope. ...
...ng selectors on descendants of the base element: var select = document.queryselector('.select'); var inner = select.queryselectorall(':scope .outer .inner'); inner.length; // 0 specifications specification status comment domthe def
inition of 'parentnode.queryselectorall()' in that specification. living standard living standard selectors api level 2the def
inition of 'parentnode.queryselectorall()' in that specification. ...
...elect.queryselectorall(':scope .outer .inner'); inner.length; // 0 specifications specification status comment domthe def
inition of 'parentnode.queryselectorall()' in that specification. living standard living standard selectors api level 2the def
inition of 'parentnode.queryselectorall()' in that specification. obsolete no change dom4the def
inition of 'parentnode.queryselectorall()' in that specification. ...
...And 4 more matches
HTMLOutputElement - Web APIs
2px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmloutputelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its parent, htmlelement. htmloutputelement.defaultvalue a domstring representing the default value of the element,
initially the empty string. htmloutputelement.formread only an htmlformelement indicating the form associated with the control, reflecting the form html attribute if it is defined. htmloutputelement.htmlforread only a domtokenlist reflecting the for html attribute, containing a list of ids of other elements in the same document that contribute to (or otherwise affect) the calculated value. html...
...en the user agent may report the error for the running script instead of notifying the user. htmloutputelement.setcustomvalidity() sets a custom validity message for the element. if this message is not the empty string, then the element is suffering from a custom validity error, and does not validate. modes this element behaves in one of two modes: default mode and value mode. default mode
initially, the element is in default mode, and so the contents of the element represent both the value of the element and its default value. if the element is in default mode when the descendants of the element are changed in any way, the defaultvalue property is set to the value of the textcontent property. resetting the form puts the element into default mode, and sets the textcontent property to ...
...f the defaultvalue property. value mode the element goes into value mode when the contents of the value property are set. the value property otherwise behaves like the textcontent property. when the element is in value mode, the default value is accessible only through the defaultvalue property. ...
...And 4 more matches
MouseEvent() - Web APIs
"screeny", optional and defaulting to 0, of type long, that is the vertical position of the mouse event on the user's screen; setting this value doesn't move the mouse pointer. ...
... "screeny", optional and defaulting to 0, of type long, that is the vertical position of the mouse event on the user's screen; setting this value doesn't move the mouse pointer. ...
... "screeny", optional and defaulting to 0, of type long, that is the vertical position of the mouse event on the user's screen; setting this value doesn't move the mouse pointer. ...
...And 4 more matches
ParentNode.querySelector() - Web APIs
n. return value the first element that matches at least one of the specified selectors or null if no such element is found. note: if the specified selectors include a css pseudo-element, the returned value is always null. exceptions syntaxerror the syntax of the specified selectors string is not valid. ...
...the specified selectors include a css pseudo-element, the returned value is always null. exceptions syntaxerror the syntax of the specified selectors string is not valid. specifications specification status comment domthe def
inition of 'parentnode.queryselector()' in that specification. living standard living standard selectors api level 2the def
inition of 'parentnode.queryselector()' in that specification. ...
...taxerror the syntax of the specified selectors string is not valid. specifications specification status comment domthe def
inition of 'parentnode.queryselector()' in that specification. living standard living standard selectors api level 2the def
inition of 'parentnode.queryselector()' in that specification. obsolete no change dom4the def
inition of 'parentnode.queryselector()' in that specification. ...
...And 4 more matches
ParentNode.querySelectorAll() - Web APIs
ies that the last element in the selector is within the search scope. ...
...selectors on descendants of the base element: var select = document.queryselector('.select'); var inner = select.queryselectorall(':scope .outer .inner'); inner.length; // 0 specifications specification status comment domthe def
inition of 'parentnode.queryselectorall()' in that specification. living standard living standard selectors api level 2the def
inition of 'parentnode.queryselectorall()' in that specification. ...
...ct.queryselectorall(':scope .outer .inner'); inner.length; // 0 specifications specification status comment domthe def
inition of 'parentnode.queryselectorall()' in that specification. living standard living standard selectors api level 2the def
inition of 'parentnode.queryselectorall()' in that specification. obsolete no change dom4the def
inition of 'parentnode.queryselectorall()' in that specification. ...
...And 4 more matches
Using Pointer Events - Web APIs
fference is that because pointer events are pointer device agnostic, the application accepts coordinate-based inputs from a mouse, a pen, or a fingertip using the same code. this application will only work on a browser that supports pointer events. a live version of this application is available on github. the source code is available on github and pull requests and bug reports are welcome. def
initions surface a touch-sensitive surface. this may be a trackpad, a touch screen, or even a virtual mapping of a user's desk surface (or mousepad) with the physical screen. touch point a point of contact with the surface. this may be a finger (or elbow, ear, nose, whatever, but typically a finger), stylus, mouse, or any other method for specifying a single point on the surface. example t...
... also be a stylus, mouse, or other method of pointing at a location. create a canvas the touch-action property is set to none to prevent the browser from applying its default touch behavior to the application. <canvas id="canvas" width="600" height="600" style="border:solid black 1px; touch-action:none"> your browser does not support canvas element. </canvas> <br> <button onclick="startup()">
initialize</button> <br> log: <pre id="log" style="border: 1px solid #ccc;"></pre> setting up the event handlers when the page loads, the startup() function shown below should be called by our <body> element's onload attribute (but in the example we use a button to trigger it, due to limitations of the mdn live example system). function startup() { var el = document.getelementsbytagname("canvas"...
...le we use a button to trigger it, due to limitations of the mdn live example system). function startup() { var el = document.getelementsbytagname("canvas")[0]; el.addeventlistener("pointerdown", handlestart, false); el.addeventlistener("pointerup", handleend, false); el.addeventlistener("pointercancel", handlecancel, false); el.addeventlistener("pointermove", handlemove, false); log("
initialized."); } this simply sets up all the event listeners for our <canvas> element so we can handle the touch events as they occur. tracking new touches we'll keep track of the touches in-progress. var ongoingtouches = new array(); when a pointerdown event occurs, indicating that a new touch on the surface has occurred, the handlestart() function below is called. function handlestart(evt) ...
...And 4 more matches
RTCPeerConnection.createDataChannel() - Web APIs
t chat, game update packets, and so forth. if the new data channel is the first one added to the connection, renegotiation is started by delivering a negotiationneeded event. syntax datachannel = rtcpeerconnection.createdatachannel(label[, options]); parameters label a human-readable name for the channel. this string may not be longer than 65,535 bytes. ...
...added to the connection, renegotiation is started by delivering a negotiationneeded event. syntax datachannel = rtcpeerconnection.createdatachannel(label[, options]); parameters label a human-readable name for the channel. this string may not be longer than 65,535 bytes. ...
...ion is started by delivering a negotiationneeded event. syntax datachannel = rtcpeerconnection.createdatachannel(label[, options]); parameters label a human-readable name for the channel. this string may not be longer than 65,535 bytes. ...
...And 4 more matches
RTCPeerConnection - Web APIs
ered. ...
...this has an effect only if the signalingstate is not "closed".getreceivers() the rtcpeerconnection.getreceivers() method returns an array of rtcrtpreceiver objects, each of which represents one rtp receiver. each rtp receiver manages the reception and decoding of data for a mediastreamtrack on an rtcpeerconnectiongetsenders()the rtcpeerconnection meth...
...peer isn't "bundle-aware" (compatible with the sdp bundle standard for bundling multiple media streams on a single transport link). all browser implementations are bundle-aware. ...
...And 4 more matches
Request() - Web APIs
the request() constructor creates a new request object. syntax var myrequest = new request(input[,
init]); parameters input defines the resource that you wish to fetch. this can either be: a usvstring containing the direct url of the resource you want to fetch. a request object, effectively creating a copy. note the following behavioural updates to retain security while making the constructor less likely to throw exceptions: if this object exists on another origin to the constructor call, the request.referrer is stripped out. if this object has a request.mode of navigate, the mode value is converted to same-origin.
init optional an options object containing any custom settings that you want to apply to the request. the possible options are: method: th...
...pe so it will be handled properly, then create an object url of it and display it in an <img> element. ...
...y, then create an object url of it and display it in an <img> element. ...
...And 4 more matches
SubtleCrypto.unwrapKey() - Web APIs
ow.prompt("enter your password"); let enc = new textencoder(); return window.crypto.subtle.importkey( "raw", enc.encode(password), {name: "pbkdf2"}, false, ["derivebits", "derivekey"] ); } /* derive an aes-kw key using pbkdf2. */ async function getunwrappingkey() { // 1. get the key material (user-supplied password) const keymaterial = await getkeymaterial(); // 2
initialize the salt parameter. // the salt must match the salt originally used to derive the key. // in this example it's supplied as a constant "saltbytes". const saltbuffer = bytestoarraybuffer(saltbytes); // 3 derive the key from key material and salt return window.crypto.subtle.derivekey( { "name": "pbkdf2", salt: saltbuffer, "iterations": 100000, "hash": "sha...
...", "length": 256}, true, [ "wrapkey", "unwrapkey" ] ); } /* unwrap an aes secret key from an arraybuffer containing the raw bytes. takes an array containing the bytes, and returns a promise that will resolve to a cryptokey representing the secret key. */ async function unwrapsecretkey(wrappedkey) { // 1. get the unwrapping key const unwrappingkey = await getunwrappingkey(); // 2.
initialize the wrapped key const wrappedkeybuffer = bytestoarraybuffer(wrappedkey); // 3. unwrap the key return window.crypto.subtle.unwrapkey( "raw", // import format wrappedkeybuffer, // arraybuffer representing key to unwrap unwrappingkey, // cryptokey representing key encryption key "aes-kw", // algorithm identifier for key encryption...
...w.prompt("enter your password"); let enc = new textencoder(); return window.crypto.subtle.importkey( "raw", enc.encode(password), {name: "pbkdf2"}, false, ["derivebits", "derivekey"] ); } /* derive an aes-gcm key using pbkdf2. */ async function getunwrappingkey() { // 1. get the key material (user-supplied password) const keymaterial = await getkeymaterial(); // 2
initialize the salt parameter. // the salt must match the salt originally used to derive the key. // in this example it's supplied as a constant "saltbytes". const saltbuffer = bytestoarraybuffer(saltbytes); // 3 derive the key from key material and salt return window.crypto.subtle.derivekey( { "name": "pbkdf2", salt: saltbuffer, "iterations": 100000, "hash": "sha...
...And 4 more matches
Window.screenLeft - Web APIs
ber of css pixels from the left edge of the browser viewport to the left edge of the screen. examples in our screenleft-screentop example, you'll see a canvas onto which has been drawn a circle. in this example we are using screenleft/screentop plus window.requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...ort to the left edge of the screen. examples in our screenleft-screentop example, you'll see a canvas onto which has been drawn a circle. in this example we are using screenleft/screentop plus window.requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...ionframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...And 4 more matches
Window.screenTop - Web APIs
umber of css pixels from the top edge of the browser viewport to the top edge of the screen. examples in our screenleft-screentop example, you'll see a canvas onto which has been drawn a circle. in this example we are using screenleft/screentop plus window.requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...port to the top edge of the screen. examples in our screenleft-screentop example, you'll see a canvas onto which has been drawn a circle. in this example we are using screenleft/screentop plus window.requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...ionframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...And 4 more matches
WindowOrWorkerGlobalScope.fetch() - Web APIs
404, etc.). instead, a then() handler must check the response.ok and/or response.status properties. the fetch() method is controlled by the connect-src directive of content security policy rather than the directive of the resources it's retrieving. note: the fetch() method's parameters are identical to those of the request() constructor. syntax const fetchresponsepromise = fetch(resource [,
init]) parameters resource this defines the resource that you wish to fetch. this can either be: a usvstring containing the direct url of the resource you want to fetch. some browsers accept the blob: and data: schemes. a request object.
init optional an object containing any custom settings that you want to apply to the request. the possible options are: method the request ...
...an <img> element. ...
...ueryselector('img'); let myrequest = new request('flowers.jpg'); fetch(myrequest) .then(function(response) { if (!response.ok) { throw new error(`http error! ...
...And 4 more matches
Cognitive accessibility - Accessibility
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 def
initions 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...
...ntial steps with progress indicators; making website authentication as easy as possible without compromising security; and making forms easy to complete, such as with clear error messages and simple error recovery. wcag guidelines wcag, web content accessibility guidelines, includes several guidelines to improve cognitive accessibility. these guidelines are published by the web accessibility
initiative (wai) of the world wide web consortium (w3c), the main international standards organization for the internet. this group is also responsible for the accessible rich internet application (aria) guidelines. wcag are guided by four principles: websites must be perceivable, operable, understandable, and robust. to this end, they define 17 specific guidelines, of which six are especially releva...
...tion could be spoken aloud via a narration tool. making your content capable of being understood by the software is a good way to help ensure it can be used by alternate presentational modes. time it is important to allow users the time they require to complete tasks. guideline 2.2 states "provide users enough time to read and use content." a time limit is any process that happens without user
initiation after a set time or on a periodic basis, such as being logged out after 30 minutes or having 15 minutes to make a purchase. 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...
...And 4 more matches
Using CSS animations - CSS: Cascading Style Sheets
cycle. animation-timing-function configures the timing of the animation; that is, how the animation transitions through keyframes, by establishing acceleration curves. animation-delay configures the delay between the time the element is loaded and the beginning of the animation sequence. animation-iteration-count configures the number of times the animation should repeat; you can specify inf
inite to repeat the animation indef
initely. animation-direction configures whether or not the animation should alternate direction on each run through the sequence or reset to the start point and repeat itself. animation-fill-mode configures what values are applied by the animation before and after it is executing. animation-play-state lets you pause and resume the animation sequence. defining...
...tion sequence, the header should have its left margin at 25% and the width should be 150%. note: reload page to see the animation, or click the codepen button to see the animation in the codepen environment. making it repeat to make the animation repeat itself, simply use the animation-iteration-count property to indicate how many times to repeat the animation. ...
...s left margin at 25% and the width should be 150%. note: reload page to see the animation, or click the codepen button to see the animation in the codepen environment. making it repeat to make the animation repeat itself, simply use the animation-iteration-count property to indicate how many times to repeat the animation. ...
...And 4 more matches
background-clip - CSS: Cascading Style Sheets
l elements." note: for documents whose root element is an html element: if the computed value of background-image on the root element is none and its background-color is transparent, user agents must instead propagate the computed values of the background properties from that element’s first html <body> child element. the used values of that <body> element’s background properties are their
initial values, and the propagated values are treated as if they were specified on the root element. it is recommended that authors of html documents specify the canvas background for the <body> element rather than the html element. syntax /* keyword values */ background-clip: border-box; background-clip: padding-box; background-clip: content-box; background-clip: text; /* global values */ backgro...
...s are treated as if they were specified on the root element. it is recommended that authors of html documents specify the canvas background for the <body> element rather than the html element. syntax /* keyword values */ background-clip: border-box; background-clip: padding-box; background-clip: content-box; background-clip: text; /* global values */ background-clip: inherit; background-clip:
initial; background-clip: unset; values border-box the background extends to the outside edge of the border (but underneath the border in z-ordering). padding-box the background extends to the outside edge of the padding. no background is drawn beneath the border. content-box the background is painted within (clipped to) the content box. text the background is painted within (clipped to)...
...ues border-box the background extends to the outside edge of the border (but underneath the border in z-ordering). padding-box the background extends to the outside edge of the padding. no background is drawn beneath the border. content-box the background is painted within (clipped to) the content box. text the background is painted within (clipped to) the foreground text. formal def
inition
initial valueborder-boxapplies toall elements. it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <box>#where <box> = border-box | padding-box | content-box examples html <p class="border-box">the background extends behind the border.</p> <p class="padding-box">the background extends to the inside edge of the borde...
...And 4 more matches
background-color - CSS: Cascading Style Sheets
values <color> the uniform color of the background. it is rendered behind any background-image that is specified, although the color will still be visible through any transparency in the image. accessibility concerns it is important to ensure that the contrast ratio between the background c...
...s. in order to meet current web content accessibility guidelines (wcag), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. large text is defined as 18.66px and bold or larger, or 24px or larger. webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 formal def
inition
initial valuetransparentapplies toall elements. it also applies to ::first-letter and ::first-line.inheritednocomputed valuecomputed coloranimation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <...
... ...
...And 4 more matches
bottom - CSS: Cascading Style Sheets
distances are respected. in all other situations, if height is constrained in any way or position is set to relative, the top property takes precedence and the bottom property is ignored. syntax /* <length> values */ bottom: 3px; bottom: 2.4em; /* <percentage>s of the height of the containing block */ bottom: 10%; /* keyword value */ bottom: auto; /* global values */ bottom: inherit; bottom:
initial; bottom: unset; values <length> a negative, null, or positive <length> that represents: for absolutely positioned elements, the distance to the bottom edge of the containing block. for relatively positioned elements, the distance that the element is moved above its normal position. <percentage> a <percentage> of the containing block's height. auto specifies that: for ab...
...the distance of the element from its normal position is based on the top property; or if top is also auto, the element is not moved vertically at all. inherit specifies that the value is the same as the computed value from its parent element (which might not be its containing block). this computed value is then handled as if it were a <length>, <percentage>, or the auto keyword. ...
...nce of the element from its normal position is based on the top property; or if top is also auto, the element is not moved vertically at all. inherit specifies that the value is the same as the computed value from its parent element (which might not be its containing block). this computed value is then handled as if it were a <length>, <percentage>, or the auto keyword. ...
...And 4 more matches
counter-increment - CSS: Cascading Style Sheets
you may specify as many counters to increment as you want, with each name or name-number pair separated by a space. the keyword value none. values <custom-ident> the name of the counter to increment. <integ...
...any counters to increment as you want, with each name or name-number pair separated by a space. the keyword value none. values <custom-ident> the name of the counter to increment. <integer> the value to add to the counter. defaults to 1 if not specified. none no counter must be incremented. this is used as the default value, or to cancel an increment in more specific rules. ...
...ers to increment as you want, with each name or name-number pair separated by a space. the keyword value none. values <custom-ident> the name of the counter to increment. <integer> the value to add to the counter. defaults to 1 if not specified. none no counter must be incremented. this is used as the default value, or to cancel an increment in more specific rules. ...
...And 4 more matches
counter-reset - CSS: Cascading Style Sheets
the counter-increment css property. syntax /* set "my-counter" to 0 */ counter-reset: my-counter; /* set "my-counter" to -1 */ counter-reset: my-counter -1; /* set "counter1" to 1, and "counter2" to 4 */ counter-reset: counter1 1 counter2 4; /* cancel any reset that could have been set in less specific rules */ counter-reset: none; /* global values */ counter-reset: inherit; counter-reset:
initial; counter-reset: unset; the counter-reset property is specified as either one of the following: a <custom-ident> naming the counter, followed optionally by an <integer>. you may specify as many counters to reset as you want, with each name or name-number pair separated by a space. the keyword value none. values <custom-ident> the name of the counter to reset. <integer> the value t...
...ou want, with each name or name-number pair separated by a space. the keyword value none. values <custom-ident> the name of the counter to reset. <integer> the value to reset the counter to on each occurrence of the element. defaults to 0 if not specified. none no counter reset is to be performed. this can be used to override a counter-reset defined in a less specific rule. ...
...with each name or name-number pair separated by a space. the keyword value none. values <custom-ident> the name of the counter to reset. <integer> the value to reset the counter to on each occurrence of the element. defaults to 0 if not specified. none no counter reset is to be performed. this can be used to override a counter-reset defined in a less specific rule. ...
...And 4 more matches
flex-basis - CSS: Cascading Style Sheets
it sets the size of the content box unless otherwise set with box-sizing. 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: in case both flex-basis (other than auto) and width (or height in case of flex-direction: column) are set for an element, flex-basis has priority. ...
...) are set for an element, flex-basis has priority. syntax /* specify <'width'> */ flex-basis: 10em; flex-basis: 3px; flex-basis: auto; /* intrinsic sizing keywords */ flex-basis: fill; flex-basis: max-content; flex-basis: min-content; flex-basis: fit-content; /* automatically size based on the flex item’s content */ flex-basis: content; /* global values */ flex-basis: inherit; flex-basis:
initial; flex-basis: unset; the flex-basis property is specified as either the keyword content or a <'width'>. values <'width'> an absolute <length>, a <percentage> of the parent flex container's main size property, or the keyword auto. negative values are invalid. defaults to auto. content indicates automatic sizing, based on the flex item’s content. note: this value was not present in ...
... flex-basis: unset; the flex-basis property is specified as either the keyword content or a <'width'>. values <'width'> an absolute <length>, a <percentage> of the parent flex container's main size property, or the keyword auto. negative values are invalid. defaults to auto. content indicates automatic sizing, based on the flex item’s content. note: this value was not present in the
initial release of flexible box layout, and thus some older implementations will not support it. the equivalent effect can be had by using auto together with a main size (width or height) of auto. history: originally, flex-basis:auto meant "look at my width or height property". then, flex-basis:auto was changed to mean automatic sizing, and "main-size" was introduced as the "look at my widt...
...And 4 more matches
grid - CSS: Cascading Style Sheets
declaration. 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: you can only specify the explicit or the implicit grid properties in a single grid declaration. the sub-properties you don’t specify are set to their
initial value, as normal for shorthands. also, the gutter properties are not reset by this shorthand. constituent properties this property is a shorthand for the following css properties: grid-auto-columns grid-auto-flow grid-auto-rows grid-template-areas grid-template-columns grid-template-rows syntax /* <'grid-template'> values */ grid: none; grid: "a" 100px "b" 1fr; grid: [linename1] ...
... <'grid-template-rows'> / [ auto-flow && dense? ] <'grid-auto-columns'>? sets up an auto-flow by setting the row tracks explicitly via the grid-template-rows property (and the grid-template-columns property to none) and specifying how to auto-repe...
...-columns'>? sets up an auto-flow by setting the row tracks explicitly via the grid-template-rows property (and the grid-template-columns property to none) and specifying how to auto-repeat the column tracks via grid-auto-columns (and setting grid-auto-rows to auto). grid-auto-flow is also set to column accordingly, with dense if it’s specified. all other grid sub-properties are reset to their
initial values. [ auto-flow && dense? ] <'grid-auto-rows'>? / <'grid-template-columns'> sets up an auto-flow by setting the column tracks explicitly via the grid-template-columns property (and the grid-template-rows property to none) and specifying how to auto-repeat the row tracks via grid-auto-rows (and setting grid-auto-columns to auto). grid-auto-flow is also set to row accordingly, with dense...
...And 4 more matches
left - CSS: Cascading Style Sheets
eractive 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 /* <length> values */ left: 3px; left: 2.4em; /* <percentage>s of the width of the containing block */ left: 10%; /* keyword value */ left: auto; /* global values */ left: inherit; left:
initial; left: unset; values <length> a negative, null, or positive <length> that represents: for absolutely positioned elements, the distance to the left edge of the containing block. for relatively positioned elements, the distance that the element is moved to the right of its normal position. <percentage> a <percentage> of the containing block's width. auto specifies that: f...
...has no effect. when both left and right are defined, and width constraints don't prevent it, the element will stretch to satisfy both. if the element cannot stretch to satisfy both, the position of the element is overspecified. when this is the case, the left value has precedence when the container is left-to-right; the right value has precedence when the container is right-to-left. ...
...fect. when both left and right are defined, and width constraints don't prevent it, the element will stretch to satisfy both. if the element cannot stretch to satisfy both, the position of the element is overspecified. when this is the case, the left value has precedence when the container is left-to-right; the right value has precedence when the container is right-to-left. ...
...And 4 more matches
list-style-position - CSS: Cascading Style Sheets
t declared as list-style-position: inside. chrome and safari both place this element on the same line as the marker box, whereas firefox, internet explorer, and opera place it on the next line. for more information on this, see bug 36854. ...
...tion: inside; list-style-position: outside; /* global values */ list-style-position: inherit; list-style-position:
initial; list-style-position: unset; the list-style-position property is specified as one of the keyword values listed below. values inside the ::marker is the first element among the list item's contents. outside the ::marker is outside the principal block box. ...
...ide; list-style-position: outside; /* global values */ list-style-position: inherit; list-style-position:
initial; list-style-position: unset; the list-style-position property is specified as one of the keyword values listed below. values inside the ::marker is the first element among the list item's contents. outside the ::marker is outside the principal block box. ...
...And 4 more matches
list-style - CSS: Cascading Style Sheets
if list-style-type and list-style-image are both set, then list-style-type is used as a fallback if the image is unavailable. values list-style-type see list-style-type. list-style-image see list-style-image. list-style-position see list-style-position. none no list style is used.
... the list is recognized properly. this ensures the design is unaffected by the bug fix and that list items are not improperly described. ...
... is recognized properly. this ensures the design is unaffected by the bug fix and that list items are not improperly described. ...
...And 4 more matches
margin-bottom - CSS: Cascading Style Sheets
this property has no effect on non-replaced inline elements, such as <span> or <code>. syntax /* <length> values */ margin-bottom: 10px; /* an absolute length */ margin-bottom: 1em; /* relative to the text size */ margin-bottom: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-bottom: auto; /* global values */ margin-bottom: inherit; margin-bottom:
initial; margin-bottom: unset; the margin-bottom property is specified as the keyword auto, or a <length>, or a <percentage>. its value can be positive, zero, or negative. values <length> the size of the margin as a fixed value. <percentage> the size of the margin as a percentage, relative to the width of the containing block. auto the browser selects a suitable value to use. see margin. ...
...n-bottom: unset; the margin-bottom property is specified as the keyword auto, or a <length>, or a <percentage>. its value can be positive, zero, or negative. values <length> the size of the margin as a fixed value. <percentage> the size of the margin as a percentage, relative to the width of the containing block. auto the browser selects a suitable value to use. see margin. formal def
inition
initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table. it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> | auto examples settin...
... working draft no si...
...And 4 more matches
offset-path - CSS: Cascading Style Sheets
l */ offset-path: url(#path); /* shapes */ offset-path: circle(50% at 25% 25%); offset-path: inset(50% 50% 50% 50%); offset-path: polygon(30% 0%, 70% 0%, 100% 50%, 30% 100%, 0% 70%, 0% 30%); offset-path: path('m 0,200 q 200,200 260,80 q 290,20 400,0 q 300,100 400,200'); /* geometry boxes */ offset-path: margin-box; offset-path: stroke-box; /* global values */ offset-path: inherit; offset-path:
initial; offset-path: unset; values ray() taking up to three values, defines a path that is a line segment starting from the position of the box and proceeds in the direction defined by the specified angle similar to the css gradient angle where 0deg is up, with positive angles increasing in the clockwise direction, with the size value being similar to the css radial gradient size values from cl...
...d with svg coordinate syntax. none specifies no motion path at all. description this property defines a path an animated element can follow. an offset path is either a specified path with one or multiple sub-paths or the geometry of a not-styled basic shape. the element’s exact position on the offset path is determined by the offset-distance property. ...
.... description this property defines a path an animated element can follow. an offset path is either a specified path with one or multiple sub-paths or the geometry of a not-styled basic shape. the element’s exact position on the offset path is determined by the offset-distance property. ...
...And 4 more matches
outline - CSS: Cascading Style Sheets
-examples and send us a pull request. constituent properties this property is a shorthand for the following css properties: outline-color outline-style outline-width syntax /* style */ outline: solid; /* color | style */ outline: #f66 dashed; /* style | width */ outline: inset thick; /* color | style | width */ outline: green solid 3px; /* global values */ outline: inherit; outline:
initial; outline: unset; the outline property may be specified using one, two, or three of the values listed below. the order of the values does not matter. note: the outline will be invisible for many elements if its style is not defined. this is because the style defaults to none. a notable exception is input elements, which are given default styling by browsers. values <'outline-color'> s...
... if absent. see outline-width. description borders and outlines are very similar. however, outlines differ from borders in the following ways: outlines never take up space, as they are drawn outside of an element's content. according to the spec, outlines don't have to be rectangular, although they usually are. as with all shorthand properties, any omitted sub-values will be set to their
initial value. accessibility concerns assigning outline a value of 0 or none will remove the browser's default focus style. if an element can be interacted with it must have a visible focus indicator. provide obvious focus styling if the default focus style is removed. how to design useful and usable focus indicators wcag 2.1: understanding success criterion 2.4.7: focus visible formal de...
...al value. accessibility concerns assigning outline a value of 0 or none will remove the browser's default focus style. if an element can be interacted with it must have a visible focus indicator. provide obvious focus styling if the default focus style is removed. how to design useful and usable focus indicators wcag 2.1: understanding success criterion 2.4.7: focus visible formal def
inition
initial valueas each of the properties of the shorthand:outline-color: invert, for browsers supporting it, currentcolor for the otheroutline-style: noneoutline-width: mediumapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:outline-color: for the keyword invert, the computed value is invert. for the color value, if the value is translucent, the computed ...
...And 4 more matches
position - CSS: Cascading Style Sheets
w 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 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 positione...
...ck. 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 there are browser inconsistencies with perspective and filter contributing to containing block formation.) its final position is det...
...rowser performance, and the device's processing speed, the browser may not be able to manage repaints at 60 fps, causing accessibility concerns for people with sensitivities and jank for everyone. one solution is to add will-change: transform to the positioned elements to render the element in its own layer, improving repaint speed and therefore improving performance and accessibility. formal def
inition
initial valuestaticapplies toall elementsinheritednocomputed valueas specifiedanimation typediscretecreates stacking contextyes formal syntax static | relative | absolute | sticky | fixed examples relative positioning relatively positioned elements are offset a given amount from their normal position within the document, but without the offset affecting other elements. in the example bel...
...And 4 more matches
scrollbar-width - CSS: Cascading Style Sheets
it must be one of the following values: auto the default scrollbar width for the platform. ...
...it must be one of the following values: auto the default scrollbar width for the platform. ...
...targets should be at least 44px in width and height (although the problem is compounded on high-resolution screens; thorough testing is advised). ...
...And 4 more matches
shape-outside - CSS: Cascading Style Sheets
the float area determines the shape around which inline content (float elements) wrap. values none the float area is unaffected. inline content wraps around the element's margin box, like usual. <shape-box> the flo...
...farthest-side keywords, interpolate between each value in the shape functions. if both shapes are of type inset(), interpolate between each value in the shape functions. if both shapes are of type polygon(), both polygons have the same number of vertices, and use the same <fill-rule>, interpolate between each value in the shape functions. in all other cases no interpolation occurs. ...
...side keywords, interpolate between each value in the shape functions. if both shapes are of type inset(), interpolate between each value in the shape functions. if both shapes are of type polygon(), both polygons have the same number of vertices, and use the same <fill-rule>, interpolate between each value in the shape functions. in all other cases no interpolation occurs. ...
...And 4 more matches
top - CSS: Cascading Style Sheets
he top and bottom distances are respected. in all other situations, if height is constrained in any way or position is set to relative, the top property takes precedence and the bottom property is ignored. syntax /* <length> values */ top: 3px; top: 2.4em; /* <percentage>s of the height of the containing block */ top: 10%; /* keyword value */ top: auto; /* global values */ top: inherit; top:
initial; top: unset; values <length> a negative, null, or positive <length> that represents: for absolutely positioned elements, the distance to the top edge of the containing block. for relatively positioned elements, the distance that the element is moved below its normal position. <percentage> a <percentage> of the containing block's height. auto specifies that: for absolute...
...stance of the element from its normal position is based on the bottom property; or if bottom is also auto, the element is not moved vertically at all. inherit specifies that the value is the same as the computed value from its parent element (which might not be its containing block). this computed value is then handled as if it were a <length>, <percentage>, or the auto keyword. ...
... the element from its normal position is based on the bottom property; or if bottom is also auto, the element is not moved vertically at all. inherit specifies that the value is the same as the computed value from its parent element (which might not be its containing block). this computed value is then handled as if it were a <length>, <percentage>, or the auto keyword. ...
...And 4 more matches
user-select - CSS: Cascading Style Sheets
the user-select css property controls whether the user can select text. this doesn't have any effect on content loaded as chrome, except in textboxes. ...
...webkit/chromium-based browsers do implement the property as inherited, which violates the behavior described in the spec, and this will bring some issues. until now, chromium chooses to fix the issues, make the final behavior meets the specifications. syntax none the text of the element and its sub-elements is not selectab...
...f a double-click or context-click occurred in sub-elements, the highest ancestor with this value will be selected. contain enables selection to start within the element; however, the selection will be contained by the bounds of that element. element (ie-specific alias) same as contain. supported only in internet explorer. note: css ui 4 renames user-select: element to contain. ...
...And 4 more matches
Closures - JavaScript
a closure is the combination of a function bundled together (enclosed) with references to its surrounding state (the lexical environment). in other words, a closure gives you access to an outer function’s scope from an inner function. in javascript, closures are created every time a function is created, at function creation time. lexical scoping consider the following example code: function
init() { var name = 'mozilla'; // name is a local variable created by
init function displayname() { // displayname() is the inner function, a closure alert(name); // use variable declared in the parent function } displayname(); }
init();
init() creates a local variable called name and a function called displayname(). the displayname() function is an inner function that is defined inside ...
...() { var name = 'mozilla'; // name is a local variable created by
init function displayname() { // displayname() is the inner function, a closure alert(name); // use variable declared in the parent function } displayname(); }
init();
init() creates a local variable called name and a function called displayname(). the displayname() function is an inner function that is defined inside
init() and is available only within the body of the
init() function. note that the displayname() function has no local variables of its own. however, since inner functions have access to the variables of outer functions, displayname() can access the variable name declared in the parent function,
init(). run the code using this jsfiddle link and notice that the alert() statement within the displayname...
...o determine where that variable is available. nested functions have access to variables declared in their outer scope. closure consider the following code example: function makefunc() { var name = 'mozilla'; function displayname() { alert(name); } return displayname; } var myfunc = makefunc(); myfunc(); running this code has exactly the same effect as the previous example of the
init() function above. what's different (and interesting) is that the displayname() inner function is returned from the outer function before being executed. at first glance, it might seem unintuitive that this code still works. in some programming languages, the local variables within a function exist for just the duration of that function's execution. once makefunc() finishes executing, you might e...
...And 4 more matches
Public class fields - JavaScript
instances. public static fields are declared using the static keyword. they are added to the class constructor at the time of class evaluation using object.defineproperty(). they are accessed again from the class constructor. class classwithstaticfield { static staticfield = 'static field' } console.log(classwithstaticfield.staticfield) // expected output: "static field" fields without
initializers are
initialized to undefined. class classwithstaticfield { static staticfield } console.assert(classwithstaticfield.hasownproperty('staticfield')) console.log(classwithstaticfield.staticfield) // expected output: "undefined" public static fields are not re
initialized on subclasses, but can be accessed via the prototype chain. class classwithstaticfield { static basestaticfield = '...
...e accessed via the prototype chain. class classwithstaticfield { static basestaticfield = 'base field' } class subclasswithstaticfield extends classwithstaticfield { static substaticfield = 'sub class field' } console.log(subclasswithstaticfield.substaticfield) // expected output: "sub class field" console.log(subclasswithstaticfield.basestaticfield) // expected output: "base field" when
initializing fields, this refers to the class constructor. you can also reference it by name, and use super to get the superclass constructor (if one exists). class classwithstaticfield { static basestaticfield = 'base static field' static anotherbasestaticfield = this.basestaticfield static basestaticmethod() { return 'base static method output' } } class subclasswithstaticfield extends clas...
...estaticmethod() } console.log(classwithstaticfield.anotherbasestaticfield) // expected output: "base static field" console.log(subclasswithstaticfield.substaticfield) // expected output: "base static method output" public instance fields public instance fields exist on every created instance of a class. by declaring a public field, you can ensure the field is always present, and the class def
inition is more self-documenting. public instance fields are added with object.defineproperty() either at construction time in the base class (before the constructor body runs), or just after super() returns in a subclass. class classwithinstancefield { instancefield = 'instance field' } const instance = new classwithinstancefield() console.log(instance.instancefield) // expected output: "instanc...
...And 4 more matches
TypedArray.prototype.reduce() - JavaScript
it to a single value. this method has the same algorithm as array.prototype.reduce(). typedarray is one of the typed array types here. 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 typedarray.reduce(callback[,
initialvalue]) parameters callback function to execute on each value in the typed array, taking four arguments: previousvalue the value previously returned in the last invocation of the callback, or
initialvalue, if supplied (see below). currentvalue the current element being processed in the typed array. index the index of the current element being processed in the typed array. a...
...ute on each value in the typed array, taking four arguments: previousvalue the value previously returned in the last invocation of the callback, or
initialvalue, if supplied (see below). currentvalue the current element being processed in the typed array. index the index of the current element being processed in the typed array. array the typed array reduce was called upon.
initialvalue optional. object to use as the first argument to the first call of the callback. return value the value that results from the reduction. ...
...yped array. array the typed array reduce was called upon.
initialvalue optional. object to use as the first argument to the first call of the callback. return value the value that results from the reduction. description the reduce method executes the callback function once for each element present in the typed array, excluding holes in the typed array, receiving four arguments: the
initial value (or value from the previous callback call), the value of the current element, the current index, and the typed array over which iteration is occurring. the first time the callback is called, previousvalue and currentvalue can be one of two values. ...
...And 4 more matches
var - JavaScript
it can be any legal expression. default value is undefined. description var declarations, wherever they occur, are processed before any code is executed. ...
...alue. 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 var varname1 [= value1] [, varname2 [= value2] ... [, varnamen [= valuen]]]; varnamen variable name. it can be any legal identifier. valuen optional
initial value of the variable. it can be any legal expression. default value is undefined. description var declarations, wherever they occur, are processed before any code is executed. this is called hoisting, and is discussed further below. the scope of a variable declared with var is its current execution context and closures thereof, which is either the enclosing function and functions declared...
...) { var x = 1; function bar() { var y = 2; console.log(x); // 1 (function `bar` closes over `x`) console.log(y); // 2 (`y` is in scope) } bar(); console.log(x); // 1 (`x` is in scope) console.log(y); // referenceerror in strict mode, `y` is scoped to `bar` } foo(); variables declared using var are created before any code is executed in a process known as hoisting. their
initial value is undefined. 'use strict'; console.log(x); // undefined (note: not referenceerror) console.log('still going...'); // still going... var x = 1; console.log(x); // 1 console.log('still going...'); // still going... in the global context, a variable declared using var is added as a non-configurable property of the global object. this means its property descr...
...And 4 more matches
Web video codec guide - Web media technologies
at a typical 30 frames per second, each second of hd video would occupy 248,832,000 bytes (~249 mb). a minute of hd video would need 14.93 gb of storage. ...
...r pixels of movement. this lets the overall movement of the camera be represented by fewer residual frames. the absolute minimum frame rate that a video can be before its contents are no longer perceived as motion by the human eye is about 12 frames per second. less than that, and the video becomes a series of still images. motion picture film is typically 24 frames per second, while standard def
inition television is about 30 frames per second (slightly less, but close enough) and high def
inition television is between 24 and 60 frames per second. anything from 24 fps upward will generally be seen as satisfactorily smooth; 30 or 60 fps is an ideal target, depending on your needs. in the end, the decisions about what sacrifices you're able to make are entirely up to you and/or your design team...
...widely used today for all sorts of media, including broadcast television, rtp videoconferencing, and as the video codec for blu-ray discs. avc is highly flexible, with a number of profiles with varying capabilities; for example, the constrained baseline profile is designed for use in videoconferencing and mobile scenarios, using less bandwidth than the main profile (which is used for standard def
inition digital tv in some regions) or the high profile (used for blu-ray disc video). most of the profiles use 8-bit color components and 4:2:0 chroma subsampling; the high 10 profile adds support for 10-bit color, and advanced forms of high 10 add 4:2:2 and 4:4:4 chroma subsampling. avc also has special features such as support for multiple views of the same scene (multiview video coding), which al...
...And 4 more matches
end - SVG: Scalable Vector Graphics
function accesskey() with the character to be input as parameter. an optional offset value as defined in <offset-value> can be appended. <wallclock-sync-value> this value defines the animation end time as a real-world clock time. a valid wallclock-sync-value consists of the function wallclock() with a time value as parameter. the time syntax is based upon the syntax defined in iso 8601. indef
inite the end of the animation will be determined by an svganimationelement.endelement() method call. examples offset example <svg width="120" height="120" viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" version="1.1"> <!-- animated rectangles --> <rect x="10" y="35" height="15" width="0"> <animate attributetype="xml" attributename="width" to="100" ...
...dth="120" height="120" viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- animated rectangle --> <rect x="10" y="35" height="15" width="0"> <animate attributetype="xml" attributename="width" from="0" to="100" begin="0s" end="endbutton.click" dur="8s" repeatcount="indef
inite" fill="freeze" /> </rect> <!-- trigger --> <rect id="endbutton" style="cursor:pointer;" x="19.5" y="62.5" rx="5" height="25" width="80" fill="#efefef" stroke="black" stroke-width="1" /> <text x="60" y="80" text-anchor="middle" style="pointer-events:none;">click me.</text> <!-- grid --> <text x="10" y="20" text-anchor="middle">0s</text> ...
...width="120" height="120" viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- animated rectangles --> <rect x="10" y="35" height="15" width="0"> <animate attributetype="xml" attributename="width" from="0" to="100" begin="0s" end="accesskey(e)" dur="8s" repeatcount="indef
inite" fill="freeze" /> </rect> <!-- trigger --> <text x="60" y="80" text-anchor="middle" style="pointer-events:none;">hit the "s" key</text> <!-- grid --> <text x="10" y="20" text-anchor="middle">0s</text> <line x1="10" y1="25" x2="10" y2="55" stroke="grey" stroke-width=".5" /> <text x="35" y="20" text-anchor="middle">2s</text> <line x1="35" y1="25" x2="35"...
...And 4 more matches
font-stretch - SVG: Scalable Vector Graphics
...
...i-expanded | expanded | extra-expanded | ultra-expanded | <percentage> default value normal animatable yes specifications specification status comment css fonts module level 4the def
inition of 'font-stretch' in that specification. working draft adds the <percentage> syntax for variable fonts. css fonts module level 3the def
inition of 'font-stretch' in that specification. ...
...default value normal animatable yes specifications specification status comment css fonts module level 4the def
inition of 'font-stretch' in that specification. working draft adds the <percentage> syntax for variable fonts. css fonts module level 3the def
inition of 'font-stretch' in that specification. ...
...And 4 more matches
href - SVG: Scalable Vector Graphics
mediate parent element of the current animation element. if both xlink:href and href are specified, the value of the latter attribute is used. refer to the descriptions of the individual animation elements for any restrictions on what types of elements can be targets of particular types of animations. except for any svg-specific rules explicitly mentioned in this specification, the normative def
inition for this attribute is the smil animation specification. in particular, see smil animation: specifying the animation target. value <url> default value none animatable no discard for <discard>, href defines a url referring the target element to discard. see the def
inition of href on animation elements for details on identifying a target element. not...
...ed. the <use> element can reference an entire svg document by specifying an href value without a fragment. such references are taken to be referring to the root element of the referenced document. ...
... the root element of the referenced document. value <url> default value none animatable yes specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'href for <a>' in that specification. candidate recommendation defines href for the <a> element. svg animations level 2the def
inition of 'href for <animate>, <animatemotion>, <animatetransform>, and <set>' in that specification. ...
...And 4 more matches
in2 - SVG: Scalable Vector Graphics
e. value sourcegraphic | sourcealpha | backgroundimage | backgroundalpha | fillpaint | strokepaint | <filter-primitive-reference> default value sourcegraphic for first filter primitive, otherwise result of previous filter primitive animatable yes specifications specification status comment filter effects module level 1the def
inition of 'in2 for <fedisplacementmap>' in that specification. working draft no change filter effects module level 1the def
inition of 'in2 for <fecomposite>' in that specification. working draft no change filter effects module level 1the def
inition of 'in2 for <feblend>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (sec...
...displacementmap>' in that specification. working draft no change filter effects module level 1the def
inition of 'in2 for <fecomposite>' in that specification. working draft no change filter effects module level 1the def
inition of 'in2 for <feblend>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'in2 for <fedisplacementmap>' in that specification. recommendation
initial def
inition for <fedisplacementmap> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'in2 for <fecomposite>' in that specification. ...
...end>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'in2 for <fedisplacementmap>' in that specification. recommendation
initial def
inition for <fedisplacementmap> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'in2 for <fecomposite>' in that specification. ...
...And 4 more matches
keyTimes - SVG: Scalable Vector Graphics
1 (inclusive), representing a proportional offset into the duration of the animation element. ...
... there must be exactly as many values in the keytimes list as in the values list. each succes...
... value is set; values are interpolated between the key times. for discrete animation, the first time value in the list must be 0. the time associated with each value defines when the value is set; the animation function uses that value until the next time defined in the list. if the calcmode attribute is set to paced, the keytimes attribute is ignored. ...
...And 4 more matches
path - SVG: Scalable Vector Graphics
default value path specified in href animatable yes <path-data> this value defines the text path along which the glyphs of the <text> element are aligned. for detailed information about the commands that can be used, see the explanation for the d attribute. ...
...ta> this value defines the text path along which the glyphs of the <text> element are aligned. for detailed information about the commands that can be used, see the explanation for the d attribute. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'path for <textpath>' in that specification. ...
...alue defines the text path along which the glyphs of the <text> element are aligned. for detailed information about the commands that can be used, see the explanation for the d attribute. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'path for <textpath>' in that specification. ...
...And 4 more matches
refX - SVG: Scalable Vector Graphics
erveaspectratio attributes. left the reference point of the marker is placed at the left edge of the shape. center the reference point of the marker is placed at the horizontal center of the shape. right the reference point of the marker is placed at the right edge of the shape. ...
...ed at the horizontal center of the shape. right the reference point of the marker is placed at the right edge of the shape. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'refx' in that specification. candidate recommendation added keywords left, center, and right. ...
... the marker is placed at the right edge of the shape. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'refx' in that specification. candidate recommendation added keywords left, center, and right. scalable vector graphics (svg) 2the def
inition of 'refx' in that specification. ...
...And 4 more matches
refY - SVG: Scalable Vector Graphics
eserveaspectratio attributes. top the reference point of the marker is placed at the top edge of the shape. center the reference point of the marker is placed at the vertical center of the shape. bottom the reference point of the marker is placed at the bottom edge of the shape. ...
...ed at the vertical center of the shape. bottom the reference point of the marker is placed at the bottom edge of the shape. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'refy' in that specification. candidate recommendation added keywords left, center, and right. ...
...the marker is placed at the bottom edge of the shape. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'refy' in that specification. candidate recommendation added keywords left, center, and right. scalable vector graphics (svg) 2the def
inition of 'refy' in that specification. ...
...And 4 more matches
text-anchor - SVG: Scalable Vector Graphics
r auto-wrapped text where the wrapping area is determined from the inline-size property relative to a given point. it is not applicable to other types of auto-wrapped text. for those cases you should use text-align. for multi-line text, the alignment takes place for each line. the text-anchor attribute is applied to each individual text chunk within a given <text> element. ...
... note: as a presentation attribute, text-anchor can be used as a css property. ...
...for an element with a vertical primary text direction (o...
...And 4 more matches
transform - SVG: Scalable Vector Graphics
html,body,svg { height:100% } <svg viewbox="-40 0 150 100" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <g fill="grey" transform="rotate(-10 50 100) translate(-36 45.5) skewx(40) scale(1 0.5)"> <path id="heart" d="m 10,30 a 20,20 0,0,1 50,30 a 20,20 0,0,1 90,30 q 90,60 50,90 q 10,60 10,30 z" /> </g> <use xlink:href="#heart" fill="none" stroke="red"/> </svg> note: as of svg2, transform is a presentation attribute, meaning it can be used as a css property. ...
...w transformation along the y axis by a degrees. ...
...-5 -5 10 10" xmlns="http://www.w3.org/2000/svg"> <rect x="-3" y="-3" width="6" height="6" /> <rect x="-3" y="-3" width="6" height="6" fill="red" transform="skewy(30)" /> </svg> specification specification status comment css transforms level 2the def
inition of 'transform' in that specification. editor's draft css transforms level 1the def
inition of 'transform' in that specification. ...
...And 4 more matches
y1 - SVG: Scalable Vector Graphics
it is applied to. ...
...fset="5%" stop-color="black" /> <stop offset="50%" stop-color="red" /> <stop offset="95%" stop-color="black" /> </lineargradient> <rect x="11" y="1" width="8" height="8" fill="url(#g1)" /> </svg> specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'y1' in that specification. ...
..."red" /> <stop offset="95%" stop-color="black" /> </lineargradient> <rect x="11" y="1" width="8" height="8" fill="url(#g1)" /> </svg> specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'y1' in that specification. candidate recommendation def
inition for <line> scalable vector graphics (svg) 2the def
inition of 'y1' in that specification. ...
...And 4 more matches
y2 - SVG: Scalable Vector Graphics
it is applied to. ...
...fset="5%" stop-color="black" /> <stop offset="50%" stop-color="red" /> <stop offset="95%" stop-color="black" /> </lineargradient> <rect x="11" y="1" width="8" height="8" fill="url(#g1)" /> </svg> specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'y2' in that specification. ...
..."red" /> <stop offset="95%" stop-color="black" /> </lineargradient> <rect x="11" y="1" width="8" height="8" fill="url(#g1)" /> </svg> specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'y2' in that specification. candidate recommendation def
inition for <line> scalable vector graphics (svg) 2the def
inition of 'y2' in that specification. ...
...And 4 more matches
SVG animation with SMIL - SVG: Scalable Vector Graphics
one adding an svg element like <animate> inside the svg element to animate. below are examples for the four different ways. animating attributes of an element the following example animates the cx attribute of a circle. to do so, we add an <animate> element inside the <circle> element. the important attributes for <animate> are: attributename the name of the attribute to animate. from the
initial value of the attribute. to the final value. dur the duration of the animation (for example, write '5s' for 5 seconds). if you want to animate more attributes inside the same element, just add more <animate> elements. <svg width="300" height="100"> <title>attribute animation with smil</title> <rect x="0" y="0" width="300" height="100" stroke="black" stroke-width="1" /> <circle cx="...
...re attributes inside the same element, just add more <animate> elements. <svg width="300" height="100"> <title>attribute animation with smil</title> <rect x="0" y="0" width="300" height="100" stroke="black" stroke-width="1" /> <circle cx="0" cy="50" r="15" fill="blue" stroke="black" stroke-width="1"> <animate attributename="cx" from="0" to="500" dur="5s" repeatcount="indef
inite" /> </circle> </svg> animating the transform attributes the <animatetransform> element let you animate transform attributes. this new element is necessary because we are not animating a simple attribute like x which is just a number. rotation attributes look like this: rotation(theta, x, y), where theta is the angle in degrees, and x and y are absolute positions. in the example below, we a...
...the path is defined the same way as in <path>. you can set the attribute to define whether the object rotates following the tangent of the path. example 1: linear motion in this example, a blue circle bounces between the left and right edge...
...And 4 more matches
Creating Event Targets - Archive of obsolete content
reate part of a module to access the browser's places api. it will emit events when the user adds and visits bookmarks, enabling users of the module to listen for these events using the sdk's standard event api. using the places api first, let's write some code using places api that logs the uris of bookmarks the user adds. create a new directory called "bookmarks", navigate to it, and run jpm
init, accepting all the defaults. then open "index.js" and add the following code: var {cc, ci} = require("chrome"); var { xpcomutils } = require("resource://gre/modules/xpcomutils.jsm"); var bookmarkservice = cc["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(ci.nsinavbookmarksservice); var bookmarkobserver = { onitemadded: function(aitemid, afolder, aindex) ...
...however: we're now importing from four modules: event/core gives us emit(): note that we don't need on, once, or off, since we wi...
...however: we're now importing from four modules: event/core gives us emit(): note that we don't need on, once, or off, since we will use eventtarget fo...
...And 3 more matches
Enhanced Extension Installation - Archive of obsolete content
ections of ui that display installed items are rooted on these containers. tracking item type item type is tracked for the most part by containment in one or other of the two containers. in situations where an item is not yet a member of one of the containers, type is inelegantly determined by checking for presence of a theme-only property on the item's install manifest rdf file. installation
initiation when an item is installed from the web, xpinstall is invoked and it calls into the extension system when it discovers that the xpi file contains an install.rdf manifest. the extension manager extracts that file and checks to see if the item is compatible with the running version of the application. if it is, a small set of metadata about it is written to the appropriate datasource (name, v...
...tem, for a subdirectory or file within an item's directory, etc. since our needs and the needs of other applications may vary in the future, since we've already effectively generalized the concept of an install location, we can make this set configurable by applications and extensions. to this end, we scan the category extension-install-locations as the extension system is started (after profile
initialization) and add these to our internal set. extension metadata the following files are now used to hold metadata: <profile>/extensions.ini -active items this file contains a list of active extension directories (i.e. directories to extensions that are enabled only), to be used by the xredirprovider during startup to locate components, preferences and chrome manifests. the format here is ...
... at this stage by looking at containment. see below in things this upgrade does not do. installation installation is much different. there three kinds of item installation: installation from a file installation by a folder or folder-link "appearing" in an install location, and a hybrid of the two - an xpi file "appearing" into a directory based install location. installation from a file
initiation when an item is installed from a file (such as, when an item is installed from the web, via xpinstall, upgraded by xpinstall or dropped into a directory-based install location), the install manifest supplied by the item is expanded into a temporary location and read. the guid and version supplied are validated, and then compatibility is checked for by the new _getinstalldata function. this...
...And 3 more matches
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
np 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 around strings. ...
... 100); as a general rule of thumb, just don't pass code around as strings and execute it by calling eval, settimeout and friends. alternative: use (anonymous) functions you can always create a small anonymous function to pass around instead. closures will ensure the code is still valid, even if your outer function already returned from execution. ...
...this is important to know in particular when you later want to call removeeventlistener: you'll have to pass the resulting function from the first .bind() call. calling .bind() again with removeeventlistener will not work. ...
...And 3 more matches
XPCOM Objects - Archive of obsolete content
ough xpcom components and interfaces. you can think of xpcom as a reference to all the capabilities available on the lower layers of firefox. using xpcom components is relatively simple, as you've seen in previous examples. this.obsservice = cc["@mozilla.org/observer-service;1"].getservice(ci.nsiobserverservice); the cc object (components.classes) is an index to static objects and class def
initions available through xpcom. the string between the brackets is just an identifier, in this case corresponding to the observer service. you'll usually know what string to use by reading examples and documentation. there is no comprehensive list of these (that we know of), and that's understandable since it would be a very long list, and it can be extended by add-ons. if you want to see the list i...
...aces) is an index of available interfaces. a modified version of the last code snippet produces an even longer list of available interfaces. just like in component identifiers, the nsi prefix is just a way of keeping things in order. the ns stands for netscape, mozilla's predecessor. the "i" stands for interface. our interfaces should begin with something like xsihello. an interface is just a def
inition of a set of attributes and methods that an object implementing it should have. xpcom components can implement multiple interfaces, and they often do. let's look at the preference service as an example of this. we'll look at its documentation in a very old xul site called xul planet. all of its documentation was planned to be migrated to mdc, but it looks like it was never finished and xul plan...
...mponents. this._prefservice = cc["@mozilla.org/preferences-service;1"].getservice(ci.nsiprefbranch); this._prefvalue = this._prefservice.getboolpref("somepreferencename"); this._prefservice.queryinterface(ci.nsiprefbranch2); this._prefservice.addobserver("somepreferencename", this, false); this._prefservice.queryinterface(ci.nsiprefbranch); this is a common piece of code you'll see when
initializing components or jsm that rely on preferences. we use the preferences service to get and set preference values, such as the preference value we're getting on the fourth line of code. these methods are in the nsiprefbranch interface. the getservice and createinstance methods allow you to get the component already set to an interface. in many cases you only need to use one interface, and you w...
...And 3 more matches
Tabbed browser - Archive of obsolete content
these snippets assume they are run in the context of a browser window. if you need to work with tabs from a non-browser window, you need to obtain a reference to one first, see working with windows in chrome code for details. ...
...view; if (win.frameelement) { // frame within a tab was loaded. win should be the top window of // the frameset. if you don't want do anything when frames/iframes // are loaded in this web page, uncomment the following line: // return; // find the root document: win = win.top; } } } // do not try to add a callback until the browser 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); ... // when no longer needed gbrowser.removeeventlistener("load", ex...
... // browser is the xul element of the browser that's been added } function exampletabmoved(event) { var browser = gbrowser.getbrowserfortab(event.target); // browser is the xul element of the browser that's been moved } function exampletabremoved(event) { var browser = gbrowser.getbrowserfortab(event.target); // browser is the xul element of the browser that's been removed } // during
initialization var container = gbrowser.tabcontainer; container.addeventlistener("tabopen", exampletabadded, false); container.addeventlistener("tabmove", exampletabmoved, false); container.addeventlistener("tabclose", exampletabremoved, false); // when no longer needed container.removeeventlistener("tabopen", exampletabadded, false); container.removeeventlistener("tabmove", exampletabmoved, false); ...
...And 3 more matches
The Joy of XUL - Archive of obsolete content
aration of presentation from application logic one of the major downfalls of most web applications is the tight coupling of user interface elements with client application logic. this poses a significant problem in team environments because the skills required to develop these two parts are often satisfied by different people. xul provides a clear separation among the client application def
inition and programmatic logic ("content" consisting of xul, xbl, and javascript), presentation ("skin" consisting of css and images), and language-specific text labels ("locale" consisting of dtds and string bundles in .properties files). the layout and appearance of xul applications can be altered independently of the application def
inition and logic. further, the application can be localized for di...
... for their application and customize the logo and branding for each of their customers by supplying different skins. an application that is written and deployed with an english language user interface can be translated to french for the same customer. while such changes are extensive and affect most (if not all) of the application, they are also isolated from one another, enabling the core xul def
inition and application logic to be shared among all of the custom versions. supporting technologies there are number of other technologies introduced by mozilla that complement xul for building cross platform web applications. xbl the extensible bindings language (xbl) is a markup language that defines special new elements, or "bindings" for xul widgets. with xbl, developers ...
... of a xul file without having to resupply the whole ui, and reusing particular pieces of the ui. overlays are a powerful mechanism for customizing and extending existing applications because they work in two related but highly different ways. in one respect, overlays are synonymous with "include" files in other languages because an application may specify that an overlay be included in its def
inition. but overlays can also be specified externally, enabling the designer to superimpose them upon an application without changing the original source. in practical terms, this enables developers to maintain one code stream for a given application, then apply custom branding or include special features for customers with a completely independent code base. this leads to an overall solution th...
...And 3 more matches
XPCOM Interfaces - Archive of obsolete content
aces. so, in most cases, you don't need to write native code for yourself. after learning this section, you can search suitable interfaces using xulplanet xpcom reference about xpcom mozilla is constructed from a collection of components, each of which performs a certain task. for example, there is a component for each menu, button and element. the components are constructed from a number of def
initions called interfaces. an interface in mozilla is a def
inition of a set of functionality that could be implemented by components. components are what implement the code in mozilla that does things. each component implements the functionality as described by interfaces. a single component might implement multiple interfaces. and multiple components might implement the same interface. let's take ...
...calfile interface. this also has the side effect of calling queryinterface(), so afile will be a valid nsilocalfile afterwards. calling the functions of an interface now that we have an object that refers to a component with the nsilocalfile interface, we can call the functions of nsilocalfile through it. the table below shows 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 ...
... another directory, optionally renaming the file. the directory should be a nsilocalfile holding the directory to copy the file to. moveto(directory,newname) moves a file to another directory, or renames a file. the directory should be a nsilocalfile holding the directory to move the file to. in order to delete a file we first need to assign a file to the nsilocalfile. ...
...And 3 more matches
Storing the information you need — Variables - Learn web development
xist, you'll get an error message — try typing in scoobydoo; note: don't confuse a variable that exists but has no defined value with a variable that doesn't exist at all — they are very different things. in the box analogy you saw above, not existing would mean there's no box (variable) for a value to go in. no value defined would mean that there is a box, but it has no value inside it.
initializing a variable once you've declared a variable, you can
initialize it with a value. you do this by typing the variable name, followed by an equals sign (=), followed by the value you want to give it. for example: myname = 'chris'; myage = 37; try going back to the console now and typing in these lines. you should see the value you've assigned to the variable returned in the console to conf...
...wed by the value you want to give it. for example: myname = 'chris'; myage = 37; try going back to the console now and typing in these lines. you should see the value you've assigned to the variable returned in the console to confirm it, in each case. again, you can return your variable values by simply typing their name into the console — try these again: myname; myage; you can declare and
initialize a variable at the same time, like this: let mydog = 'rover'; this is probably what you'll do most of the time, as it is quicker than doing the two actions on two separate lines. the difference between var and let at this point you may be thinking "why do we need two keywords for defining variables?? why have var and let?". the reasons are somewhat historical. back when javascript was f...
...orks somewhat differently to var, fixing its issues in the process. a couple of simple differences are explained below. we won't go into all the differences now, but you'll start to discover them as you learn more about javascript (if you really want to read about them now, feel free to check out our let reference page). for a start, if you write a multiline javascript program that declares and
initializes a variable, you can actually declare a variable with var after you
initialize it and it will still work. for example: myname = 'chris'; function logname() { console.log(myname); } logname(); var myname; note: this won't work when typing individual lines into a javascript console, just when running multiple lines of javascript in a web document. this works because of hoisting — ...
...And 3 more matches
Adding a new CSS property
omputed value of the property should go in. (again, see the gecko overview for more information.) it should generally be grouped with related properties. remember that each style struct contains only properties that inherit by default or only properties that do not. (which set the property is in is given in the specification, which says "inherited: yes" or "inherited: no" in the property's def
inition.) also note that some of the style structs intentionally contain only properties set/reset by a particular common shorthand property; this improves the effectiveness of some of the performance and memory optimizations done with the rule tree, and thus we should avoid adding a property not reset by that shorthand to such a struct. once you know which struct you're going to use (or that the pr...
...hands if you want the shorthand parser to be able to reuse the longhand parser. (note that when the longhand property css_property_parse_value_list, the shorthand property parser would be assumed to be reusing the longhand parser once per item, not for a whole list, as for properties like background-image or transform-timing-function.) if the property takes a list of keywords other than inherit/
initial/etc., auto, none, or normal (which can be expressed using the variant_* flags), you should use variant_keyword and add a keyword table to the nscssprops class. the name of this keyword table needs to go in the nscssproplist entry; otherwise that keyword table should be null. if you need a keyword table, you should include auto, normal, or none (if needed) in that table rather than combining ...
... into the preferences code for further understanding of how the parsing code works, you should read and understand the code in nscssparser.cpp. computed style when adding a new longhand property, you also need to implement the computed style side of things. (none of this applies to shorthand properties.) start by reading and understanding the "computed value:" line in the specification's def
inition of the property, and any associated prose. this line describes the conceptual representation (but not syntax) of the computed value of the property. the data structures in gecko that store the computed value must correspond to this concept, or inheritance won't work as described by the specification. so first, you need to add a member variable (or variables) to the chosen style struct in ns...
...And 3 more matches
Localization content best practices
uld always be descriptive of the string, and its role in the interface (button label, title, etc.). think of them as long variable names. when you have to change a key id, adding a progressive number to the existing key should always be used as a last resort. for example, suppose this string needs to be changed from "event" to "add new event": new-event-header = event add-new-event-header is def
initely a better choice for the new string than new-event-header1. if a string is tied to an accesskey or a tooltip, use string ids that highlight this relation: neweventbtn.label = add event neweventbtn.accesskey = a neweventbtn.tooltip = add a new event don't duplicate ids if you're adding new strings, check that you're not duplicating an existing id. depending on the parser logic, one of these...
...ate them. if you're reviewing a patch, check also strings for grammar errors, capitalization or inconsistencies. for example, use the single unicode …, and not three dots. if you have any doubts about the quality of strings, ask a copywriter to do a copy review of this text. ideally, all strings landing in code should originate from approved ux wireframes, any copy review should be part of the
initial stage of creating these wireframes. use unicode characters over their ascii counterparts when possible strings should use directional quotation marks when possible. u+2018 and u+2019 (\u2018 and \u2019 in javascript) are the left and right single quotation marks, respectively. the right single quotation mark should be used as an apostrophe. u+201c and u+201d (\u201c and \u201d in javasc...
...by the grammar), case and inflections (changes are made to a word to indicate differences in meaning or use) and so on. in modern english, such features are rare and are mainly restricted to plural -s and verb forms (e.g. go > went is a form of inflection). examples from other languages: gender in german: nouns can be either masculine, feminine or neuter. the most obvious impact is that the def
inite article which in english is always the can either be der, die or das. to complicate matters, if the grammatical context changes, the article will change: der text 'the text' changes to wollen sie den text speichern? 'do you want to save the text?' suffixes in basque: where english tends to use expressions such as 'to the' or 'from the', basque adds an ending to a word to express the same concep...
...And 3 more matches
FIPS mode of operation
general-purpose functions fc_getfunctionlist fc_
initialize fc_finalize fc_getinfo slot and token management functions fc_getslotlist fc_getslotinfo fc_gettokeninfo fc_waitforslotevent fc_getmechanismlist fc_getmechanisminfo fc_
inittoken fc_
initpin fc_setpin session management functions fc_opensession fc_closesession fc_closeallsessions fc_getsessioninfo fc_getoperationstate fc_setoperationstate fc_login fc_logout object management functions these functions manage certificates and keys. ...
... fc_
initpin fc_setpin session management functions fc_opensession fc_closesession fc_closeallsessions fc_getsessioninfo fc_getoperationstate fc_setoperationstate fc_login fc_logout object management functions these functions manage certificates and keys. fc_createobject fc_copyobject fc_destroyobject fc_getobjectsize fc_getattributevalue fc_setattributevalue fc_findobjects
init fc_findobjects fc_findobjectsfinal encryption functions these functions support triple des and aes in ecb and cbc modes. fc_encrypt
init fc_encrypt fc_encryptupdate fc_encryptfinal decryption functions these functions support triple des and aes in ecb and cbc modes. ...
...object fc_destroyobject fc_getobjectsize fc_getattributevalue fc_setattributevalue fc_findobjects
init fc_findobjects fc_findobjectsfinal encryption functions these functions support triple des and aes in ecb and cbc modes. fc_encrypt
init fc_encrypt fc_encryptupdate fc_encryptfinal decryption functions these functions support triple des and aes in ecb and cbc modes. fc_decrypt
init fc_decrypt fc_decryptupdate fc_decryptfinal message digesting functions these functions support sha-1, sha-256, sha-384, and sha-512. ...
...And 3 more matches
OLD SSL Reference
ypto writer: sean cotter manager: wan-teh chang chapter 1 overview of an ssl application ssl and related apis allow compliant applications to configure sockets for authenticated, tamper-proof, and encrypted communications. this chapter introduces some of the basic ssl functions. chapter 2, "getting started with ssl" illustrates their use in sample client and server applications.
initialization
initializing caches configuration communication functions used by callbacks cleanup chapter 2 getting started with ssl this chapter describes how to set up your environment, including certificate and key databases, to run the nss sample code. the sample code and makefiles are available via lxr in the sslsamples direc...
... certcertdbhandle certcertificate pk11slotinfo secitem seckeyprivatekey secstatus managing secitem memory secitem_freeitem secitem_zfreeitem chapter 4 ssl functions this chapter describes the core ssl functions. ...
... pk11slotinfo secitem seckeyprivatekey secstatus managing secitem memory secitem_freeitem secitem_zfreeitem chapter 4 ssl functions this chapter describes the core ssl functions. ...
...And 3 more matches
NSS_3.12.3_release_notes.html
ng specifies algorithms allowed to be used in certain applications, such as in signatures on certificates and crls. see documentation at this link. nss_strict_nofork string ("1", "disabled", or any other non-empty value) it is an error to try to use a pkcs#11 crypto module in a process before it has been
initialized in that process, even if the module was
initialized in the parent process. beginning in nss 3.12.3, softoken will detect this error. this environment variable controls softoken's response to that error. if set to to "1" or unset, softoken will trigger an assertion failure in debug builds, and will report an error in non-debug builds. if set to "disa...
...n some unix platforms in nss 3.12 bug 463342: move some headers to freebl/softoken bug 463452: sql db creation does not set files protections to 0600 bug 463678: need to add rpath to 64-bit libraries on hp-ux bug 464088: option to build nss without dbm (handy for wince) bug 464223: certutil didn't accept certificate request to sign. bug 464406: fix signtool regressions bug 465270: un
initialised value in devutil.c::create_object() bug 465273: dead assignment in devutil.c::nssslotarray_clone() bug 465926: during import of pkcs #12 files bug 466180: ssl_configmpserversidcache with default parameters fails on {net bug 466194: cert_decodetruststring should take a const char * input trusts string. bug 466736: incorrect use of nss_use_64 in lib/libpkix/pkix_pl_nss/system/pkix_...
...sts string. ...
...And 3 more matches
JS::PersistentRooted
this article covers features introduced in spidermonkey 31 a copyable, assignable global gc root type with arbitrary lifetime, an infallible constructor, and automatic unrooting on destruction. syntax js::persistentrooted<t> var; // added in spidermonkey 38 js::persistentrooted<t> var(cx); js::persistentrooted<t> var(cx,
initial); js::persistentrooted<t> var(rt); js::persistentrooted<t> var(rt,
initial); name type description cx jscontext * the context to get the runtime in which to add the root rt jsruntime * the runtime in which to add the root.
initial t an
initial value for the persistent rooted variable. methods here, ptr represents the private member of js::persistentrooted<t>, typed with t. meth...
... type description cx jscontext * the context to get the runtime in which to add the root rt jsruntime * the runtime in which to add the root.
initial t an
initial value for the persistent rooted variable. methods here, ptr represents the private member of js::persistentrooted<t>, typed with t. method description void
init(jscontext* cx)
initialize with optional
initial value (if not provided, it will be
initialized with the
initial value of the type). added in spidermonkey 38 void
init(jscontext* cx, t
initial) void
init(jsruntime* rt) void
init(jsruntime* rt, t
initial) void reset() reset the value to
initial value of the type. added in spidermonkey 38 t& get() ...
...ables. js::persistentrooted<t> is a copyable, assignable global gc root type with arbitrary lifetime, an infallible constructor, and automatic unrooting on destruction. these roots can be used in heap-allocated data structures, so they are not associated with any particular jscontext or stack. they are registered with the jsruntime itself, without locking, so they require a full jscontext to be
initialized, not one of its more restricted superclasses.
initialization may take place on construction, or in two phases if the no-argument constructor is called followed by
init(). note that you must not use an persistentrooted in an object owned by a js object: whenever one object whose lifetime is decided by the gc refers to another such object, that edge must be traced only if the owning js obj...
...And 3 more matches
nsIDOMParser
a domparser from a privileged script, you can pass parameters to the constructor, more on that below. to create a domparser when the constructor is not available (e.g., from a js xpcom component, a js module, or an xpcshell test), use: var parser = components.classes["@mozilla.org/xmlextras/domparser;1"] .createinstance(components.interfaces.nsidomparser); // optionally, call parser.
init(principal, documenturi, baseuri); principals, document and base uri note: this section covers changes introduced to domparser in gecko 1.9. (this section is only relevant to firefox extensions--not to web content.) to create a document, the parser needs to specify a principal (see security check basics), a base uri (see document.baseuriobject), and a documenturi. these values are automatically d...
...ox extensions--not to web content.) to create a document, the parser needs to specify a principal (see security check basics), a base uri (see document.baseuriobject), and a documenturi. these values are automatically determined as defined below, but if you work with domparser from privileged code, you can override the defaults by providing arguments to the domparser constructor or calling parser.
init(). usually you don't need to do that. if you come across a situation when these matter, feel free to ask questions in mozilla.dev.tech.dom and update this documentation to mention these cases. when a domparser is instantiated by calling new domparser(), it inherits the calling code's principal (except that for chrome callers the principal is set to the null principal) and the documenturi and bas...
...o new domparser(). if fewer than three parameters are passed, the remaining parameters will default to null. the first parameter is the principal to use; this overrides the default principal normally inherited. the second parameter is the documenturi to use. the third parameter is the baseuri to use. ...
...And 3 more matches
nsIDOMSimpleGestureEvent
seamonkey 2.0) the nsidomsimplegestureevent interface is the datatype for all mozilla-specific simple gesture events in the document object model. the following events are generated: mozswipegesture - generated when the user completes a swipe across across the input device. mozmagnifygesturestart - generated when the user begins the magnify ("pinch") gesture. the "delta" value represents the
initial movement. mozmagnifygestureupdate - generated periodically while the user is continuing the magnify ("pinch") gesture. the "delta" value represents the movement since the last mozmagnifygesturestart or mozmagnifygestureupdate event. mozmagnifygesture - generated when the user has completed the magnify ("pinch") gesture. if you only want to receive a single event when the magnify gesture is c...
...esture. if you only want to receive a single event when the magnify gesture is complete, you only need to hook this event and can safely ignore the mozmagnifygesturestart and the mozmagnifygestureupdate events. the "delta" value is the cumulative amount represented by the user's gesture. mozrotategesturestart - generated when the user begins the rotation gesture. the "delta" value represents the
initial rotation. mozrotategestureupdate - generated periodically while the user is continuing the rotation gesture. the "delta" value represents the rotation since the last mozrotategesturestart or mozrotategestureupdate event. mozrotategesture - generated when the user has completed the rotation gesture. if you only want to receive a single event when the rotation gesture is complete, you only nee...
...er up, first finger up) on the input device. client coordinates contain the center pivot point of the action. (xxx not implemented on mac) default behavior: some operating systems support default behaviors for gesture events when they are not handled by the application. consumers should use event.preventdefault() to prevent default behavior when consuming events. ...
...And 3 more matches
nsIFilePicker
17.0 / thunderbird 17.0 / seamonkey 2.14) implemented by: @mozilla.org/filepicker;1. ...
...leading dot, for example "jpg". defaultstring astring the filename, including extension, that should be suggested to the user as a default. this should be set before calling open() or show(). exceptions thrown ns_error_failure if you try to read this attribute. displaydirectory nsilocalfile the directory that the file picker dialog should
initially display. this should be set this before calling open() or show() to specify a starting point. file nsilocalfile the currently selected file or directory. read only. files nsisimpleenumerator an enumerator of the currently selected files. read only. note: only works with modeopenmultiple mode. fileurl nsiuri the uri of the currently select...
.... fileurl nsiuri the uri of the currently selected file or directory. read only. filterindex long the (0-based) index of the filter which is currently selected in the file picker dialog. set this to choose a particular filter to be selected by default. constants mode constants these constants are used to specify the type of file picker to create when calling
init(). constant value description modeopen 0 load a file. modesave 1 save a file. modegetfolder 2 select a folder/directory. modeopenmultiple 3 load multiple files. return value constants these values are returned by show() or passed as an argument to open()'s callback, indicating the result of the file picker activit...
...And 3 more matches
nsIScriptableInputStream
xpcom/io/nsiscriptableinputstream.idlscriptable this interface provides scriptable access to a nsiinputstream instance. inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview unsigned long available(); void close(); void
init(in nsiinputstream ainputstream); string read(in unsigned long acount); acstring readbytes(in unsigned long acount); methods available() return the number of bytes currently available in the stream. note: this method should not be used to determine the total size of a stream, even if the stream corresponds to a local file. moreover, since a stream may make available more than 2^32 bytes of data, this method is incapable of expressing the entire size o...
...method is incapable of expressing the entire size of the underlying data source. unsigned long available(); parameters none. return value the number of bytes. exceptions thrown ns_base_stream_closed if called after the stream has been closed. close() closes the stream. note: the close method may be called more than once, but subsequent calls are ignored. void close(); parameters none.
init() wrap the given nsiinputstream with this nsiscriptableinputstream. note: the
init method may be called more than once, allowing a nsiscriptableinputstream instance to be reused. void
init( in nsiinputstream ainputstream ); parameters ainputstream the nsiinputstream to be wrapped. read() read data from the stream. warning: if the data contains a null byte, then this method will ...
... the byte values into unicode code points, by assuming the byte values are encoded as iso-latin-1. this is the case for the javascript bindings. string read( in unsigned long acount ); parameters acount the maximum number of bytes to read from the stream. return value the data read as a string, which will be an empty string if the stream is at eof. exceptions thrown ns_error_not_
initialized if
init() was not called. ns_base_stream_closed if called after the stream has been closed. ns_base_stream_would_block indicates that reading from the input stream would block the calling thread for an indeterminate amount of time. this exception may only be thrown if nsiinputstream.isnonblocking() returns true. readbytes() read data from the stream, including null byt...
...And 3 more matches
The libmime module
hard h. pizzarro <rhp@netscape.com> this module, libmime, implements a general-purpose mime parser. one of the methods provided by this parser is the ability to emit an html representation of the data stream. the parser is object-oriented. there is a class for each mime type, and each class is responsible for parsing itself, and/or handing the input data off to one of its child objects. the def
inition of these classes is somewhat idiosyncratic and consists of an internally defined object system, instead of c++. there is one header file and one source file for each class (for example, the mimeinlinetext class is defined in "mimetext.h" and "mimetext.c".) each header file follows the following boiler-plate form: typedefs these come first to avoid circular dependencies. typedef struc...
...form: typedefs these come first to avoid circular dependencies. typedef struct foobarclass foobarclass; typedef struct foobar foobar; class declaration theis structure defines the callback routines and other per-class data of the class defined in this module. struct foobarclass { parentclass superclass; ...any callbacks or class-variables... }; class def
inition this variable holds an instance of the one-and-only class record; the various instances of this class point to this object. (one interrogates the type of an instance by comparing the value of its class pointer with the address of this variable.) extern foobarclass foobarclass; instance declaration theis structure defines the per-instance data of an object, and a pointer to the corresp...
... value of its class pointer with the address of this variable.) extern foobarclass foobarclass; instance declaration theis structure defines the per-instance data of an object, and a pointer to the corresponding class record. struct foobar { parent parent; ...any instance variables... ...
...And 3 more matches
CustomEvent - Web APIs
this interface inherits properties from its parent, event: event.bubbles read only a boolean indicating whether or not the event bubbles up through the dom. event.cancelbubble a historical alias to event.stoppropagation(). setting its value to true before returning from an event handler prevents propagation of the event. event.cancelable read only a boolean indicating whether the event is cancelable. ...
...ions of microsoft internet explorer) for event.target. some other browsers are starting to support it for web compatibility purposes. event.target read only a reference to the target to which the event was originally dispatched. event.timestamp read only the time at which the event was created (in milliseconds). by specification, this value is time since epoch—but in reality, browsers' def
initions vary. in addition, work is underway to change this to be a domhighrestimestamp instead. event.type read only the name of the event. case-insensitive. event.istrusted read only indicates whether or not the event was
initiated by the browser (after a user click, for instance) or by a script (using an event creation method, like event.
initevent). obsolete properties event.scoped read ...
... only indicates whether or not the event was
initiated by the browser (after a user click, for instance) or by a script (using an event creation method, like event.
initevent). obsolete properties event.scoped read only obsolete; use composed instead. (a boolean indicating whether the given event will bubble across through the shadow root into the standard dom.) methods customevent.
initcustomevent()
initializes a customevent object. if the event has already being dispatched, this method does nothing. this interface inherits methods from its parent, event: event.createevent() creates a new event, which must then be
initialized by calling its
initevent() method. event.composedpath() returns the event’s path (objects on which listeners will be invoked). this ...
...And 3 more matches
EffectTiming.iterations - Web APIs
element.animate(), keyframeeffectreadonly(), and keyframeeffect() all accept an object of timing properties including iterations. ...
... element.animate(), keyframeeffectreadonly(), and keyframeeffect() all accept an object of timing properties including iterations. ...
... element.animate(), keyframeeffectreadonly(), and keyframeeffect() all accept an object of timing properties including iterations. ...
...And 3 more matches
Event.currentTarget - Web APIs
variable, and then look for the currenttarget key in the console, its value will be null. instead, you can either directly console.log(event.currenttarget) to be able to view it in the console or use the debugger statement, which will pause the execution of your code thus showing you the value of event.currenttarget. ...
...you can either directly console.log(event.currenttarget) to be able to view it in the console or use the debugger statement, which will pause the execution of your code thus showing you the value of event.currenttarget. specifications specification status comment domthe def
inition of 'event.currenttarget' in that specification. living standard dom4the def
inition of 'event.currenttarget' in that specification. ...
...e execution of your code thus showing you the value of event.currenttarget. specifications specification status comment domthe def
inition of 'event.currenttarget' in that specification. living standard dom4the def
inition of 'event.currenttarget' in that specification. obsolete document object model (dom) level 3 events specificationthe def
inition of 'current event target' in that specification. ...
...And 3 more matches
Using Fetch - Web APIs
404 or 500. instead, it will resolve normally (with ok status set to false), and it will only reject on network failure or if anything prevented the request from completing. fetch() won't can receive cross-site cookies; you can’t can establish a cross site session using fetch. set-cookie headers from other sites are silently ignored. fetch won’t send cookies, unless you set the credentials
init option. (since aug 25, 2017. the spec changed the default credentials policy to same-origin. firefox changed since 61.0b13.) a basic fetch request is really simple to set up. have a look at the following code: fetch('http://example.com/movies.json') .then(response => response.json()) .then(data => console.log(data)); here we are fetching a json file across the network and printing it to ...
... both the request and response objects.) note: the body mixin also has similar methods to extract other types of body content; see the body section for more. fetch requests are controlled by the connect-src directive of content security policy rather than the directive of the resources it's retrieving. supplying request options the fetch() method can optionally accept a second parameter, an
init object that allows you to control a number of different settings: see fetch() for the full options available, and more details. // example post method implementation: async function postdata(url = '', data = {}) { // default options are marked with * const response = await fetch(url, { method: 'post', // *get, post, put, delete, etc. mode: 'cors', // no-cors, *cors, same-origin ...
... fetch('https://example.com', { credentials: 'include' }); if you only want to send credentials if the request url is on the same origin as the calling script, add credentials: 'same-origin'. // the calling script is on the origin 'https://example.com' fetch('https://example.com', { credentials: 'same-origin' }); to instead ensure browsers don’t ...
...And 3 more matches
HTMLAreaElement - Web APIs
e domain name. methods inherits methods from its parent, htmlelement, and implements those from htmlhyperlinkelementutils. htmlhyperlinkelementutils.tostring() returns a usvstring containing the whole url of the script executed in the worker. it is a synonym for htmlhyperlinkelementutils.href. ...
... recommendation technically, the properties tabindex and accesskey are now defined on htmlelement. the following property is now obsolete: nohref. the following properties have been added: rel, rellist, media, hreflang, type, host, hostname, pathname, port, protocol, search, and hash. ...
...lement' in that specification. recommendation technically, the properties tabindex and accesskey are now defined on htmlelement. the following property is now obsolete: nohref. ...
...And 3 more matches
HTMLFormElement: reset event - Web APIs
t">reset form</button> </form> <p id="log"></p> javascript function logreset(event) { log.textcontent = `form reset! ...
...xtcontent = `form reset! ...
...('form'); const log = document.getelementbyid('log'); form.addeventlistener('reset', logreset); result specifications specification status comment html living standardthe def
inition of 'reset' in that specification. working draft no change html 5.2the def
inition of 'reset' in that specification. ...
...And 3 more matches
HTMLFormElement: submit event - Web APIs
id="log"></p> javascript function logsubmit(event) { log.textcontent = `form submitted! ...
... stamp: ${event.timestamp}`; event.preventdefault(); } const form = document.getelementbyid('form'); const log = document.getelementbyid('log'); form.addeventlistener('submit', logsubmit); result specifications specification status comment html living standardthe def
inition of 'submit' in that specification. ...
...rm'); const log = document.getelementbyid('log'); form.addeventlistener('submit', logsubmit); result specifications specification status comment html living standardthe def
inition of 'submit' in that specification. working draft no change html 5.2the def
inition of 'submit' in that specification. ...
...And 3 more matches
HTMLHtmlElement - Web APIs
"94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlhtmlelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. ...
... htmlhtmlelement.version is a domstring representing the version of the html document type def
inition (dtd) that governs this document. this property should not be used any more as it is non-conforming. simply omit it. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmlhtmlelement' in that specification. living standard html 5.1the def
inition of 'htmlhtmlelement' in that specification. recommendation no change since the last snapshot html5the def
inition of 'htmlhtmlelement' in that specification. recommendation the version element has been removed, as it is non-conforming. document object model (dom) lev...
...at specification. living standard html 5.1the def
inition of 'htmlhtmlelement' in that specification. recommendation no change since the last snapshot html5the def
inition of 'htmlhtmlelement' in that specification. recommendation the version element has been removed, as it is non-conforming. document object model (dom) level 2 html specificationthe def
inition of 'htmlhtmlelement' in that specification. obsolete reflecting the element change in html 4.01 specification, the version property is now deprecated. ...
...And 3 more matches
HTMLOptionElement - Web APIs
th="2px" /><text x="406" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmloptionelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmloptionelement.defaultselected is a boolean that contains the
initial value of the selected html attribute, indicating whether the option is selected by default or not. htmloptionelement.disabled is a boolean representing the value of the disabled html attribute, which indicates that the option is unavailable to be selected. an option can also be disabled if it is a child of an <optgroup> element that is disabled. htmloptionelement.form read only is a htm...
...perty. methods inherits methods from its parent, htmlelement. option() is a constructor creating an htmloptionelement object. it has four values: the text to display, text, the value associated, value, the value of defaultselected, and the value of selected. the last three values are optional. specifications specification status comment html living standardthe def
inition of 'htmloptionelement' in that specification. living standard html5the def
inition of 'htmloptionelement' in that specification. recommendation a constructor, option(), has been added. the form property can be the null value. document object model (dom) level 2 html specificationthe def
inition of 'htmloptionelement' in that specification. obsolete the se...
...onelement' in that specification. recommendation a constructor, option(), has been added. the form property can be the null value. document object model (dom) level 2 html specificationthe def
inition of 'htmloptionelement' in that specification. obsolete the selected property changed its meaning: it now indicates if the option is currently selected and no longer if it was
initally selected. ...
...And 3 more matches
HTMLSelectElement.add() - Web APIs
recommendation is a snapshot of html living standard. the value of before can now be a long and is optional. it throws a domerror of the type hierarchyrequesterror if the passed item is an ancestor of the htmlselectelement and no ...
...ges it to: <select id="existinglist"> <option value="1">option: value 1</option> <option value="3">option: value 3</option> <option value="2">option: value 2</option> </select> */ specifications specification status comment html living standardthe def
inition of 'htmlselectelement.add()' in that specification. living standard html5the def
inition of 'htmlselectelement.add()' in that specification. recommendation is a snapshot of html living standard. the value of before can now be a long and is optional. it throws a domerror of the type hierarchyrequesterror if the passed item is an ancestor of the htmlselectelement and no longer throws if the before parameter is not found. document object model (dom) level 2 html spe...
...telement.add()' in that specification. recommendation is a snapshot of html living standard. the value of before can now be a long and is optional. it throws a domerror of the type hierarchyrequesterror if the passed item is an ancestor of the htmlselectelement and no longer throws if the before parameter is not found. ...
...And 3 more matches
MediaKeySystemConfiguration - Web APIs
mediakeysystemconfiguration.audiocapabilities read only returns a list of supported audio type and capability pairs. mediakeysystemconfiguration.videocapabilities read only returns a list of supported video type and capability pairs. ...
... mediakeysystemconfiguration.audiocapabilities read only returns a list of supported audio type and capability pairs. mediakeysystemconfiguration.videocapabilities read only returns a list of supported video type and capability pairs. ...
... mediakeysystemconfiguration.audiocapabilities read only returns a list of supported audio type and capability pairs. mediakeysystemconfiguration.videocapabilities read only returns a list of supported video type and capability pairs. ...
...And 3 more matches
MouseEvent - Web APIs
the mouseevent interface represents events that occur due to the user interacting with a pointing device (such as a mouse). common events using this interface include click, dblclick, mouseup, mousedown. mouseevent derives from uievent, which in turn derives from event. though the mouseevent.
initmouseevent() method is kept for backward compatibility, creating of a mouseevent object should be done using the mouseevent() constructor. several more specific events are based on mouseevent, including wheelevent and dragevent. <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" pres...
...own read only minimum force necessary for a normal click mouseevent.webkit_force_at_force_mouse_down read only minimum force necessary for a force click methods this interface also inherits methods of its parents, uievent and event. mouseevent.getmodifierstate() returns the current state of the specified modifier key. see the keyboardevent.getmodifierstate() for details. mouseevent.
initmouseevent()
initializes the value of a mouseevent created. if the event has already being dispatched, this method does nothing. example this example demonstrates simulating a click (that is programmatically generating a click event) on a checkbox using dom methods. html <p><label><input type="checkbox" id="checkbox"> checked</label> <p><button id="button">click me</button> javascript fu...
... candidate recommendation from document object model (dom) level 3 events specification, added movementx and movementy properties. ...
...And 3 more matches
Node.prefix - Web APIs
.prefix examples the following logs "x" to the console. <x:div onclick="console.log(this.prefix)"/> notes this will only work when a namespace-aware parser is used, i.e. when a document is served with an xml mime type. this will not work for html documents. ...
...en a document is served with an xml mime type. this will not work for html documents. specifications specification status comment document object model (dom) level 3 core specificationthe def
inition of 'node.prefix' in that specification. ...
...t is served with an xml mime type. this will not work for html documents. specifications specification status comment document object model (dom) level 3 core specificationthe def
inition of 'node.prefix' in that specification. ...
...And 3 more matches
PaymentRequest.show() - Web APIs
it may only be called while handling events that represent user interactions, such as click, keyup, or the like. only one payment request can be in the process of being handled at once, across all documents. ...
...ponse object when the user interaction is complete. the developer then uses the information in the paymentresponse object to format and send payment data to the server. you should send the payment information to the server asynchronously so that the final call to paymentresponse.complete() can indicate the success or failure of the payment. button.onclick = async function handlepurchase() { //
initialization of paymentrequest arguments are excerpted for the sake of // brevity. const payment = new paymentrequest(methods, details, options); try { const response = await payment.show(); // process response here, including sending payment instrument // (e.g., credit card) information to the server. // paymentresponse.methodname contains the selected payment method // pa...
...ment method // paymentresponse.details contains a payment method specific response await response.complete("success"); } catch (err) { console.error("uh oh, something bad happened", err.message); } } the following example shows how to update the payment sheet as it's being presented to the end-user. async function requestpayment() { // we start with au$0 as the total. const
initialdetails = { total: { label: "total", amount: { value: "0", currency: "aud" }, }, }; const request = new paymentrequest(methods,
initialdetails, options); // check if the the user supports the `methods` if (!await request.canmakepayment()) { return; // no, so use a web form instead. } // let's update the total as the sheet is shown const updateddetails = { ...
...And 3 more matches
RTCConfiguration - Web APIs
peer isn't "bundle-aware" (compatible with the sdp bundle standard for bundling multiple media streams on a single transport link). all browser implementations are bundle-aware. ...
...cy used, and any superfluous transports that were created
initially are closed at that point. note: in technical terms, a bundle lets all media flow between two peers flow across a single 5-tuple; that is, from a single ip and port on one peer to a single ip and port on the other peer, using the same transport protocol. constant description "balanced" the ice agent
initially creates one rtcdtlstransport for each type of content added: audio, video, and data channels. if the remote endpoint is not bundle-aware, then each of these dtls transports then handles all the communication for one type of data. "max-compat" the ice agent
initially creates one rtcdtlstransport per media track and a separate one for data channels. if the remote endpoint is not bu...
...if the remote endpoint is not bundle-aware, then only a single track will be negotiated and the rest ignored. ...
...And 3 more matches
Response() - Web APIs
the possible options are: status: the status code for the reponse, e.g., 200. statustext: the status message associated with the status code, e.g., ok. ...
...the possible options are: status: the status code for the reponse, e.g., 200. statustext: the status message associated with the status code, e.g., ok. ...
...status message associated with the status code, e.g., ok. headers: any headers you want to add to your response, contained within a headers object or object literal of bytestring key/value pairs (see http headers for a reference). ...
...And 3 more matches
UIEvent - Web APIs
several interfaces are direct or indirect descendants of this one: mouseevent, touchevent, focusevent, keyboardevent, wheelevent, inputevent, and compositionevent. ...
...information about the physical device responsible for generating a touch event. uievent.viewread only returns a windowproxy that contains the view that generated the event. uievent.which read only returns the numeric keycode of the key pressed, or the character code (charcode) for an alphanumeric key pressed. methods this interface also inherits methods of its parent, event. ...
... the physical device responsible for generating a touch event. uievent.viewread only returns a windowproxy that contains the view that generated the event. uievent.which read only returns the numeric keycode of the key pressed, or the character code (charcode) for an alphanumeric key pressed. methods this interface also inherits methods of its parent, event. ...
...And 3 more matches
Adding 2D content to a WebGL context - Web APIs
turned to the webgl layer by storing it in the special variable gl_fragcolor. that color is then drawn to the screen in the correct position for the shape's corresponding pixel. in this case, we're simply returning white every time, since we're just drawing a white square, with no lighting in use. ...
... 1.0); } `;
initializing the shaders now that we've defined the two shaders we need to pass them to webgl, compile them, and link them together. the code below creates the two shaders by calling loadshader(), passing the type and source for the shader. it then creates a program, attaches the shaders and links them together. if compiling or linking fails the code displays an alert. ...
...shaders we need to pass them to webgl, compile them, and link them together. the code below creates the two shaders by calling loadshader(), passing the type and source for the shader. it then creates a program, attaches the shaders and links them together. if compiling or linking fails the code displays an alert. ...
...And 3 more matches
window.location - Web APIs
this to effectively happen. ...
...r location = "http://www.mozilla.org"; example #2: force reloading the current page from the server location.reload(true); example #3 consider the following example, which will reload the page by using the replace() method to insert the value of location.pathname into the hash: function reloadpagewithhash() { var
initialpage = location.pathname; location.replace('http://example.com/#' +
initialpage); } example #4: display the properties of the current url in an alert dialog: function showloc() { var olocation = location, alog = ["property (typeof): value", "location (" + (typeof olocation) + "): " + olocation ]; for (var sprop in olocation){ alog.push(sprop + " (" + (typeof olocation[sprop]) + "): " + (olocation[sprop] || "n/a")); } alert(alog.join("\n")); } // in html:...
... ...
...And 3 more matches
Web APIs
ouble constrainulong contentindex contentindexevent convolvernode countqueuingstrategy crashreportbody credential credentialscontainer crypto cryptokey cryptokeypair customelementregistry customevent d domconfiguration domerror domexception domhighrestimestamp domimplementation domimplementationlist domlocator dommatrix dommatrixreadonly domobject domparser dompoint dompoint
init dompointreadonly domquad domrect domrectreadonly domstring domstringlist domstringmap domtimestamp domtokenlist domuserdata datatransfer datatransferitem datatransferitemlist dedicatedworkerglobalscope delaynode deprecationreportbody devicelightevent devicemotionevent devicemotioneventacceleration devicemotioneventrotationrate deviceorientationevent deviceproximityevent directorye...
...aints mediastreamevent mediastreamtrack mediastreamtrackaudiosourcenode mediastreamtrackaudiosourceoptions mediastreamtrackevent mediatrackconstraints mediatracksettings mediatracksupportedconstraints merchantvalidationevent messagechannel messageevent messageport metadata mimetype mimetypearray mouseevent mousescrollevent mousewheelevent mutationevent mutationobserver mutationobserver
init mutationrecord n ndefmessage ndefreader ndefreadingevent ndefrecord ndefwriter namelist namednodemap navigationpreloadmanager navigator navigatorconcurrenthardware navigatorid navigatorlanguage navigatoronline navigatorplugins navigatorstorage networkinformation node nodefilter nodeiterator nodelist nondocumenttypechildnode notation notification notificationaction notificationevent not...
...romiserejectionevent publickeycredential publickeycredentialcreationoptions publickeycredentialrequestoptions pushevent pushmanager pushmessagedata pushregistrationmanager pushsubscription r rtcansweroptions rtccertificate rtcconfiguration rtcdtmfsender rtcdtmftonechangeevent rtcdatachannel rtcdatachannelevent rtcdtlstransport rtcerror rtcerrorevent rtcicecandidate rtcicecandidate
init rtcicecandidatepair rtcicecandidatepairstats rtcicecandidatestats rtcicecandidatetype rtcicecomponent rtcicecredentialtype rtcicegathererstate rtciceparameters rtciceprotocol rtcicerole rtciceserver rtcicetcpcandidatetype rtcicetransport rtcicetransportstate rtcidentityassertion rtcidentityerrorevent rtcidentityevent rtcinboundrtpstreamstats rtcnetworktype rtcofferansweroptions rtcofferop...
...And 3 more matches
Using the aria-labelledby attribute - Accessibility
tive technology cannot catalog the object. aria-labelledby is very similar to aria-describedby: a label provides essential information about an object, while a description provides extended information that the user might need. in addition to form elements, you can use the aria-labelledby attribute to associate static text with widgets, groups of elements, panes, regions that have a heading, def
initions, and other types of objects. the examples section below provides more information on how to use the attribute this way. to improve compatibility with user agents that do not support aria, you can use aria-labelledby with the <label> element (using the for attribute). this attribute can be used with any typical html form element; it is not limited to elements that have an aria role assigned.
... <li role="radio">item #1</li> <li role="radio">item #2</li> <li role="radio">item #3</li> </ul> example 4: dialog label in the example below, the header element that labels the dialog is referred to by the aria-labelledby attribute: <div role="dialog" aria-labelledby="dialogheader"> <h2 id="dialogheader">choose a file</h2> ... ...
... <li role="radio">item #2</li> <li role="radio">item #3</li> </ul> example 4: dialog label in the example below, the header element that labels the dialog is referred to by the aria-labelledby attribute: <div role="dialog" aria-labelledby="dialogheader"> <h2 id="dialogheader">choose a file</h2> ... ...
...And 3 more matches
Web accessibility for seizures and physical reactions - Accessibility
ddition to seizures brought about by photosensitivity, listening to certain pieces of music can also trigger what are called musicogenic seizures, although these types of seizures seem to be much more rare. for a great introduction on the topic of musicogenic seizures, visit epilepsy ontario's web page on musicogenic seizures. seizures and epilepsy are not the same. in its article, "a revised def
inition of epilepsy" the epilepsy foundation notes that…"a seizure is an event and epilepsy is the disease involving recurrent unprovoked seizures." according to the epilepsy foundation's page "how serious are seizures?" , "sudden unexpected death in epilepsy (sudep) is likely the most common disease-related cause of death in with epilepsy. it is not frequent but it is a very real problem and people...
... is an event and epilepsy is the disease involving recurrent unprovoked seizures." according to the epilepsy foundation's page "how serious are seizures?" , "sudden unexpected death in epilepsy (sudep) is likely the most common disease-related cause of death in with epilepsy. it is not frequent but it is a very real problem and people need to be aware of its risk". the point is, seizures most def
initely can be and are fatal, and developers and designers are incredibly important to making the web a safer place for those with sensitivities to photosensitive or musicogenic triggers. seizures can be fatal, but even the ones that are "only" debilitating can be of such severity, that they render the user incapacitated. other disorders, such as disorientation, nausea, vomiting, and more can also be...
...n support for prefers-reduced-motion in modern browsers is growing. @media screen and (prefers-reduced-motion: reduce) { } @media screen and (prefers-reduced-motion) { } to see a great example of how to use the code prefers-reduced-motion, visit the mdn document, prefers-reduced-motion, or see the example below from the section on new in chrome 74. button { animation: vibrate 0.3s linear inf
inite both; } @media (prefers-reduced-motion: reduce) { button { animation: none; } } prefers-color-scheme this can be useful if the ambient light api is not available. support is emerging. @media (prefers-color-scheme: dark) { /* adust styles for dark mode */ } window.matchmedia() there is a powerful tool available to developers via window.matchmedia(). a great resource is md...
...And 3 more matches
-webkit-text-stroke - CSS: Cascading Style Sheets
the -webkit-text-stroke css property specifies the width and color of strokes for text characters. this is a shorthand property for the longhand properties -webkit-text-stroke-width and -webkit-text-stroke-color. ...
...ifies the width and color of strokes for text characters. this is a shorthand property for the longhand properties -webkit-text-stroke-width and -webkit-text-stroke-color. ...
...l values */ -webkit-text-stroke: inherit; -webkit-text-stroke:
initial; -webkit-text-stroke: unset; text-stroke: inherit; text-stroke:
initial; text-stroke: unset; constituent properties this property is a shorthand for the following css properties: -webkit-stroke-color -webkit-stroke-width syntax values <length> the width of the stroke. <color> the color of the stroke. ...
...And 3 more matches
font-style - CSS: Cascading Style Sheets
ith angle selects a font classified as oblique, and additionally specifies an angle for the slant of the text. oblique with angle range selects a font classified as oblique, and additionally specifies a range of allowable angle for the slant of the text. note that a range is only supported when the font-style is oblique; for font-style: normal or italic, no second value is allowed. ...
...ed as oblique, and additionally specifies an angle for the slant of the text. oblique with angle range selects a font classified as oblique, and additionally specifies a range of allowable angle for the slant of the text. note that a range is only supported when the font-style is oblique; for font-style: normal or italic, no second value is allowed. ...
...heir upright counterparts, having some unique features and generally have a rounded and calligraphic quality. these fonts are specially created by font designers and are not artificially sloped. ...
...And 3 more matches
@font-feature-values - CSS: Cascading Style Sheets
eatures activated differently in opentype. this can help simplify your css when using multiple fonts. the @font-feature-values at-rule may be used either at the top level of your css or inside any css conditional-group at-rule. syntax feature value blocks @swash specifies a feature name that will work with the swash() functional notation of font-variant-alternates. a swash feature value def
inition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't. @annotation specifies a feature name that will work with the annotation() functional notation of font-variant-alternates. an annotation feature value def
inition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't. @ornaments specifies a feature name that will work with the ornaments() functional notation of font...
...ident2: 2 4 isn't. @annotation specifies a feature name that will work with the annotation() functional notation of font-variant-alternates. an annotation feature value def
inition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't. @ornaments specifies a feature name that will work with the ornaments() functional notation of font-variant-alternates. an ornaments feature value def
inition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't. @stylistic specifies a feature name that will work with the stylistic() functional notation of font-variant-alternates. a stylistic feature value def
inition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't. @styleset specifies a feature name that will work with the styleset() functional notation of font-varia...
...lid, but ident2: 2 4 isn't. @stylistic specifies a feature name that will work with the stylistic() functional notation of font-variant-alternates. a stylistic feature value def
inition allows only one value: ident1: 2 is valid, but ident2: 2 4 isn't. @styleset specifies a feature name that will work with the styleset() functional notation of font-variant-alternates. a stylset feature value def
inition allows an unlimited number of values: ident1: 2 4 12 1 maps to the opentype values ss02, ss04, ss12, and ss01. note that values higher than 99 are valid, but don't map to any opentype values and are ignored. ...
...And 3 more matches
prefers-color-scheme - CSS: Cascading Style Sheets
a feature is used to detect if the user has requested the system use a light or dark color theme. syntax light indicates that user has notified the system that they prefer an interface that has a light theme, or has not expressed an active preference. dark indicates that user has notified the system that they prefer an interface that has a dark theme. ...
...that user has notified the system that they prefer an interface that has a light theme, or has not expressed an active preference. dark indicates that user has notified the system that they prefer an interface that has a dark theme. examples the elements below have an
initial color theme. they can be further themed according to the user's color scheme preference. ...
...stem that they prefer an interface that has a dark theme. examples the elements below have an
initial color theme. they can be further themed according to the user's color scheme preference. ...
...And 3 more matches
scripting - CSS: Cascading Style Sheets
the scripting css media feature can be used to test whether scripting (such as javascript) is available. syntax the scripting feature is specified as a keyword value chosen from the list below. none scripting is completely unavailable on the current document.
initial-only scripting is enabled during the
initial page load, but not afterwards. enabled scripting is supported and active on the current document. examples html <p class="script-none">you do not have scripting available. ...
...ing feature is specified as a keyword value chosen from the list below. none scripting is completely unavailable on the current document.
initial-only scripting is enabled during the
initial page load, but not afterwards. enabled scripting is supported and active on the current document. examples html <p class="script-none">you do not have scripting available. :-(</p> <p class="script-
initial-only">your scripting is only enabled during the
initial page load. ...
...ve on the current document. examples html <p class="script-none">you do not have scripting available. :-(</p> <p class="script-
initial-only">your scripting is only enabled during the
initial page load. ...
...And 3 more matches
max-height - CSS: Cascading Style Sheets
the max-height css descriptor specifies the maximum height of the viewport of a document defined via the @viewport at-rule. the height will
initially be set as close as possible to the
initial viewport height considering the maximum height constraint. syntax /* keyword value */ max-height: auto; /* <length> values */ max-height: 400px; max-height: 50em; max-height: 20cm; /* <percentage> value */ max-height: 75%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. ...
...maximum height constraint. syntax /* keyword value */ max-height: auto; /* <length> values */ max-height: 400px; max-height: 50em; max-height: 20cm; /* <percentage> value */ max-height: 75%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. ...
...s */ max-height: 400px; max-height: 50em; max-height: 20cm; /* <percentage> value */ max-height: 75%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the height of the
initial viewport at zoom factor 1.0 for vertical lengths. must be non-negative. ...
...And 3 more matches
max-width - CSS: Cascading Style Sheets
the max-width css descriptor specifies the maximum width of the viewport of a document defined via the @viewport at-rule. by default, the width is set as close as possible to the
initial viewport considering the maximum width constraint. syntax /* keyword value */ max-width: auto; /* <length> values */ max-width: 600px; max-width: 80em; max-width: 15cm; /* <percentage> value */ max-width: 75%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. ...
...g the maximum width constraint. syntax /* keyword value */ max-width: auto; /* <length> values */ max-width: 600px; max-width: 80em; max-width: 15cm; /* <percentage> value */ max-width: 75%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. ...
...ues */ max-width: 600px; max-width: 80em; max-width: 15cm; /* <percentage> value */ max-width: 75%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the width of the
initial viewport at zoom factor 1.0 for horizontal lengths. must be non-negative. ...
...And 3 more matches
min-height - CSS: Cascading Style Sheets
the min-height css descriptor specifies the minimum height of the viewport of a document defined via the @viewport at-rule. the height will
initially be set as close as possible to the
initial viewport height considering the minimum height constraint. syntax /* keyword value */ min-height: auto; /* <length> values */ min-height: 120px; min-height: 20em; min-height: 10cm; /* <percentage> value */ min-height: 25%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. ...
...minimum height constraint. syntax /* keyword value */ min-height: auto; /* <length> values */ min-height: 120px; min-height: 20em; min-height: 10cm; /* <percentage> value */ min-height: 25%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. ...
...s */ min-height: 120px; min-height: 20em; min-height: 10cm; /* <percentage> value */ min-height: 25%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the height of the
initial viewport at zoom factor 1.0 for vertical lengths. must be non-negative. ...
...And 3 more matches
min-width - CSS: Cascading Style Sheets
the min-width css descriptor specifies the minimum width of the viewport of a document defined via @viewport. by default, min-width is set as close as possible to the
initial viewport considering the minimum width constraint. syntax /* keyword value */ min-width: auto; /* <length> values */ min-width: 320px; min-width: 40em; min-width: 5cm; /* <percentage> value */ min-width: 25%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. ...
...imum width constraint. syntax /* keyword value */ min-width: auto; /* <length> values */ min-width: 320px; min-width: 40em; min-width: 5cm; /* <percentage> value */ min-width: 25%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. ...
...40em; min-width: 5cm; /* <percentage> value */ min-width: 25%; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the width or height of the
initial viewport at zoom factor 1.0, for horizontal and vertical lengths respectively. must be non-negative. ...
...And 3 more matches
Border-radius generator - CSS: Cascading Style Sheets
ic, 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() { for (var i in subscribers[this.topic]) { subscribers[this.topic][i](this.value); } } var
init = function
init() { var elem = document.queryselectorall('.ui-input-slider'); var size = elem.length; for (var i = 0; i < size; i++) new inputslider(elem[i]); } return {
init :
init, setmax : setmax, setmin : setmin, setunit : setunit, getnode : getnode, setvalue : setvalue, subscribe : subscribe, unsubscribe : unsubscribe } })(); /** * ui-buttonmanager */ var bu...
...bscribers[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() { for (var i = 0; i < subscribers[this.topic].length; i++) subscribers[this.topic][i](this.checkbox.checked); } var
init = function
init() { var elem = document.queryselectorall('.ui-checkbox'); var size = elem.length; for (var i = 0; i < size; i++) new checkbox(elem[i]); } return {
init :
init, setvalue : setvalue, subscribe : subscribe, unsubscribe : unsubscribe } })(); window.addeventlistener("load", function() { borderradius.
init(); }); var borderradius = (function borderradius() { f...
...cribe, unsubscribe : unsubscribe } })(); window.addeventlistener("load", function() { borderradius.
init(); }); var borderradius = (function borderradius() { function getelembyid(id) { return document.getelementbyid(id); } /** * shadow dragging */ var previewmousetracking = (function drag() { var active = false; var lastx = 0; var lasty = 0; var subscribers = []; var
init = function
init(id) { var elem = getelembyid(id); elem.addeventlistener('mousedown', dragstart, false); 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 = funct...
...And 3 more matches
CSS Images - CSS: Cascading Style Sheets
quests and speed up the availability of a page. ...
...esolution, conic-gradient(), and image() css images module level 3 candidate recommendation added image-orientation, image-rendering, object-fit and object-position compatibility standardthe def
inition of 'css gradients' in that specification. living standard standardizes the -webkit prefixed gradient value functions css values and units module level 3the def
inition of '<url>' in that specification. ...
...mage-orientation, image-rendering, object-fit and object-position compatibility standardthe def
inition of 'css gradients' in that specification. living standard standardizes the -webkit prefixed gradient value functions css values and units module level 3the def
inition of '<url>' in that specification. candidate recommendation css level 2 (revision 1)the def
inition of '<uri>' in that specification. ...
...And 3 more matches
Class selectors - CSS: Cascading Style Sheets
recommendation ...
...g">this paragraph has red text and a yellow background.</p> <p class="red fancy">this paragraph has red text and "fancy" styling.</p> <p>this is just a regular paragraph.</p> result specifications specification status comment selectors level 4the def
inition of 'class selectors' in that specification. ...
...fancy" styling.</p> <p>this is just a regular paragraph.</p> result specifications specification status comment selectors level 4the def
inition of 'class selectors' in that specification. working draft no changes selectors level 3the def
inition of 'class selectors' in that specification. ...
...And 3 more matches
Descendant combinator - CSS: Cascading Style Sheets
recomm...
... <li>subitem a</li> <li>subitem b</li> </ul> </li> <li> <div>item 2</div> <ul> <li>subitem a</li> <li>subitem b</li> </ul> </li> </ul> result specifications specification status comment selectors level 4the def
inition of 'descendant combinator' in that specification. ...
...em a</li> <li>subitem b</li> </ul> </li> </ul> result specifications specification status comment selectors level 4the def
inition of 'descendant combinator' in that specification. working draft selectors level 3the def
inition of 'descendant combinator' in that specification. ...
...And 3 more matches
Shorthand properties - CSS: Cascading Style Sheets
shorthand properties are css properties that let you set the values of multiple other css properties simultaneously. using a shorthand property, you can write more concise (and often more readable) style sheets, saving time and energy. the css specification defines shorthand properties to group the def
inition of common properties acting on the same theme. for instance, the css background property is a shorthand property that's able to define the values of background-color, background-image, background-repeat, and background-position. similarly, the most common font-related properties can be defined using the shorthand font, and the different margins around a box can be defined using the margin shorthand. tricky edge cases even if they are very convenient to use, there are a few edge cases ...
...round-image, background-repeat, and background-position. similarly, the most common font-related properties can be defined using the shorthand font, and the different margins around a box can be defined using the margin shorthand. tricky edge cases even if they are very convenient to use, there are a few edge cases to keep in mind when using them: a value which is not specified is set to its
initial value. that sounds anecdotal, but it really means that it overrides previously set values. therefore: background-color: red; background: url(images/bg.gif) no-repeat left top; will not set the color of the background to red but to background-color's default, transparent, as the second rule has precedence. only the individual properties values can inherit. as missing values are replaced by...
...ue. that sounds anecdotal, but it really means that it overrides previously set values. therefore: background-color: red; background: url(images/bg.gif) no-repeat left top; will not set the color of the background to red but to background-color's default, transparent, as the second rule has precedence. only the individual properties values can inherit. as missing values are replaced by their
initial value, it is impossible to allow inheritance of individual properties by omitting them. the keyword inherit can be applied to a property, but only as a whole, not as a keyword for one value or another. that means that the only way to make some specific value to be inherited is to use the longhand property with the keyword inherit. shorthand properties try not to force a specific order for the...
...And 3 more matches
align-self - CSS: Cascading Style Sheets
normal the effect of this keyword is dependent of the layout mode we are in: in absolutely-positioned layouts, the keyword behaves like start on replaced absolutely-positioned boxes, and as stretch on all other absolutely-positioned boxes. in static position of absolutely-positioned layouts, the keyword be...
...or equivalent functionality), so that the combined size of all auto-sized items exactly fills the alignment container along the cross axis. safe if the size of the item overflows the alignment container, the item is instead aligned as if the alignment mode were start. unsafe regardless of the relative sizes of the item and alignment container, the given alignment value is honored. formal def
inition
initial valueautoapplies toflex items, grid items, and absolutely-positioned boxesinheritednocomputed valueauto computes to itself on absolutely-positioned elements, and to the computed value of align-items on the parent (minus any legacy keywords) on all other boxes, or start if the box has no parent. its behavior depends on the layout model, as described for justify-self. otherwise the spec...
... ...
...And 3 more matches
background-position-x - CSS: Cascading Style Sheets
the position is relative to the position layer set by background-origin. 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. the value of this property is overridden by any declaration of the background or background-position shorthand properties applied to the element after it. ...
... values left aligns the left edge of the background image with the left edge of the background position layer. center aligns the center of the background image with the center of the background position layer. right aligns the right edge of the background image w...
...ge> the offset of the given background image's horizontal position relative to the container. a value of 0% means that the left edge of the background image is aligned with the left edge of the container, and a value of 100% means that the right edge of the background image is aligned with the right edge of the container, thus a value of 50% horizontally centers the background image. ...
...And 3 more matches
background-position-y - CSS: Cascading Style Sheets
the position is relative to the position layer set by background-origin. 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. the value of this property is overridden by any declaration of the background or background-position shorthand properties applied to the element after it. ...
... values top aligns the top edge of the background image with the top edge of the background position layer. center aligns the vertical center of the background image with the vertical center of the background position layer. bottom aligns the bottom edge of the b...
...entage> the offset of the given background image's vertical position relative to the container. a value of 0% means that the top edge of the background image is aligned with the top edge of the container, and a value of 100% means that the bottom edge of the background image is aligned with the bottom edge of the container, thus a value of 50% vertically centers the background image. ...
...And 3 more matches
border - CSS: Cascading Style Sheets
active-examples and send us a pull request. constituent properties this property is a shorthand for the following css properties: border-color border-style border-width syntax /* style */ border: solid; /* width | style */ border: 2px dotted; /* style | color */ border: outset #f33; /* width | style | color */ border: medium dashed green; /* global values */ border: inherit; border:
initial; border: unset; the border property may be specified using one, two, or three of the values listed below. the order of the values does not matter. note: the border will be invisible if its style is not defined. this is because the style defaults to none. values <line-width> sets the thickness of the border. defaults to medium if absent. see border-width. <line-style> sets the style...
...ults to none. values <line-width> sets the thickness of the border. defaults to medium if absent. see border-width. <line-style> sets the style of the border. defaults to none if absent. see border-style. <color> sets the color of the border. defaults to currentcolor if absent. see border-color. description as with all shorthand properties, any omitted sub-values will be set to their
initial value. importantly, border cannot be used to specify a custom value for border-image, but instead sets it to its
initial value, i.e., none. the border shorthand is especially useful when you want all four borders to be the same. to make them different from each other, however, you can use the longhand border-width, border-style, and border-color properties, which accept different values for e...
...the physical (e.g., border-top ) and logical (e.g., border-block-start) border properties. borders vs. outlines borders and outlines are very similar. however, outlines differ from borders in the following ways: outlines never take up space, as they are drawn outside of an element's content. according to the spec, outlines don't have to be rectangular, although they usually are. ...
...And 3 more matches
clip-path - CSS: Cascading Style Sheets
values <clip-source> a <url> referencing an svg <clippath> element. <basic-shape> a shape whose size and position is defined by the <geometry-box> value. if no geometry box is specified, the border-box will be used as the reference box. <geometry-box> if specified in combinatio...
...oned at the origin of the coordinate system established by the viewbox attribute and the dimension of the size of the reference box is set to the width and height values of the viewbox attribute. none no clipping path is created. note: a computed value other than none results in the creation of a new stacking context the same way that css opacity does for values other than 1. ...
...he origin of the coordinate system established by the viewbox attribute and the dimension of the size of the reference box is set to the width and height values of the viewbox attribute. none no clipping path is created. note: a computed value other than none results in the creation of a new stacking context the same way that css opacity does for values other than 1. ...
...And 3 more matches
clip - CSS: Cascading Style Sheets
the clip css property defines a visible portion of an element. the clip property applies only to absolutely positioned elements — that is, elements with position:absolute or position:fixed. /* keyword value */ clip: auto; /* <shape> values */ clip: rect(1px 10em 3rem 2ch); clip: rect(1px, 10em, 3rem, 2ch); /* global values */ clip: inherit; clip:
initial; clip: unset; syntax note: where possible, authors are encouraged to use the newer clip-path property instead. values <<shape>()> a rectangular <<shape>()> of the form rect(<top> <right> <bottom> <left>). the <top> and <bottom> values are offsets from the inside top border edge of the box, while <right> and <left> are offsets from the inside left border edge of the box — that is, the extent of the padding box. the <top>, <ri...
...t border edge of the box — that is, the extent of the padding box. the <top>, <right>, <bottom>, and <left> values may be either a <length> or auto. if any side's value is auto, the element is clipped to that side's inside border edge. auto the element does not clip (default). this is different from rect(auto, auto, auto, auto), which clips to the element’s inside border edges. ...
...edge of the box — that is, the extent of the padding box. the <top>, <right>, <bottom>, and <left> values may be either a <length> or auto. if any side's value is auto, the element is clipped to that side's inside border edge. auto the element does not clip (default). this is different from rect(auto, auto, auto, auto), which clips to the element’s inside border edges. ...
...And 3 more matches
columns - CSS: Cascading Style Sheets
n/interactive-examples and send us a pull request. constituent properties this property is a shorthand for the following css properties: column-count column-width syntax /* column width */ columns: 18em; /* column count */ columns: auto; columns: 2; /* both column width and count */ columns: 2 auto; columns: auto 12em; columns: auto auto; /* global values */ columns: inherit; columns:
initial; columns: unset; the columns property may be specified as one or two of the values listed below, in any order. values <'column-width'> the ideal column width, defined as a <length> or the keyword auto. the actual width may be wider or narrower to fit the available space. see column-width. <'column-count'> the ideal number of columns into which the element's content should be flowed, de...
...> or the keyword auto. the actual width may be wider or narrower to fit the available space. see column-width. <'column-count'> the ideal number of columns into which the element's content should be flowed, defined as an <integer> or the keyword auto. if neither this value nor the column's width are auto, it merely indicates the maximum allowable number of columns. see column-count. ...
...keyword auto. the actual width may be wider or narrower to fit the available space. see column-width. <'column-count'> the ideal number of columns into which the element's content should be flowed, defined as an <integer> or the keyword auto. if neither this value nor the column's width are auto, it merely indicates the maximum allowable number of columns. see column-count. ...
...And 3 more matches
counter-set - CSS: Cascading Style Sheets
ted using the counter-increment 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 the counter, followed optionally by an <integer>. you may specify as many counters to reset as you want, with each name or name-number pair separated by a space. the keyword value none. values <custom-ident> the name of the counter to set. <integer> the value to set ...
... 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 increment 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. ...
... 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 increment 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. ...
...And 3 more matches
cursor - CSS: Cascading Style Sheets
les project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword value */ cursor: pointer; cursor: auto; /* url, with a keyword fallback */ cursor: url(hand.cur), pointer; /* url and coordinates, with a keyword fallback */ cursor: url(cursor1.png) 4 12, auto; cursor: url(cursor2.png) 2 2, pointer; /* global values */ cursor: inherit; cursor:
initial; cursor: unset; the cursor property is specified as zero or more <url> values, separated by commas, followed by a single mandatory keyword value. each <url> should point to an image file. the browser will try to load the first image specified, falling back to the next if it can't, and falling back to the keyword value if no images could be loaded (or if none were specified). each <url> may ...
...ified) in or out. zoom-out usage notes although the specification does not define any size limitations for cursor, individual user agents may choose to do so. cursor changes using images which are outside the size range supported by the browser will generally just be ignored. check the browser compatibility table for any notes on cursor size limits. ...
... or out. zoom-out usage notes although the specification does not define any size limitations for cursor, individual user agents may choose to do so. cursor changes using images which are outside the size range supported by the browser will generally just be ignored. check the browser compatibility table for any notes on cursor size limits. ...
...And 3 more matches
<custom-ident> - CSS: Cascading Style Sheets
den values a <custom-ident> must not be placed between single or double 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-increment 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, decima...
...hanja-informal, lao, lower-armenian, malayalam, mongolian, myanmar, oriya, persian, simp-chinese-formal, simp-chinese-informal, tamil, telugu, thai, tibetan, trad-chinese-formal, trad-chinese-informal, upper-armenian, disclosure-open, and disclosure-close. grid-row-start grid-row-end grid-column-start grid-column-end forbids the span value. will-change forbids the global css values (unset,
initial, and inherit), as well as the values will-change, auto, scroll-position, and contents. examples valid identifiers nono79 a mix of alphanumeric characters and numbers ground-level a mix of alphanumeric characters and a dash -test a dash followed by alphanumeric characters _internal an underscore followed by alphanumeric characters \22 toto a unic...
...ash 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 specification status comment css values and units module level 4the def
inition of '<custom-ident>' in that specification. editor's draft css will change module level 1the def
inition of '<custom-ident> for will-change' in that specification. candidate recommendation defines which values are excluded for will-change. css counter styles level 3the def
inition of '<custom-ident> for list-style-type' in that specification. candidate recommenda...
...And 3 more matches
<easing-function> - CSS: Cascading Style Sheets
nge during animations. this lets you vary the animation's speed over the course of its duration. the easing functions in the cubic-bezier subset of easing functions are often called "smooth" easing functions, because they can be used to smooth down the start and end of the animation. they correlate a time ratio to an output ratio, both expressed as <number>s. for these values, 0.0 represents the
initial state, and 1.0 represents the final state. depending on the specific function used, the calculated output can sometimes grow to be greater than 1.0 or smaller than 0.0 during the course of an animation. this causes the animation to go farther than the final state, and then return. for some properties, such as left or right, this creates a kind of "bouncing" effect. however, certain propert...
...sed to smooth down the start and end of the animation and are therefore sometimes called easing functions. a cubic bézier curve is defined by four points p0, p1, p2, and p3. p0 and p3 are the start and the end of the curve and, in css these points are fixed as the coordinates are ratios (the abscissa the ratio of time, the ordinate the ratio of the output range). p0 is (0, 0) and represents the
initial time and the
initial state, p3 is (1, 1) and represents the final time and the final state. not all cubic bézier curves are suitable as easing functions as not all are mathematical functions; i.e., curves that for a given abscissa have zero or one value. with p0 and p3 fixed as defined by css, a cubic bézier curve is a function, and is therefore valid, if and only if the abscissas of p1 and...
...(4, end) steps(5, jump-none) steps(3, jump-both) steps-start the equivalent of steps(1, jump-start) steps-end the equivalent of steps(1, jump-end) step-start the animation jumps immediately to its final state, where it stays until the end. this keyword represents the easing function steps(1, jump-start) or steps(1, start). step-end the animation stays in its
initial state until the end, at which point it jumps directly to its final state. this keyword represents the easing function steps(1, jump-end) or steps(1, end). examples easing function comparison this example creates an animation that can be started and stopped again using the provided button, and a select menu that can be used to switch its easing function between the available keywords, plus a...
...And 3 more matches
font-weight - CSS: Cascading Style Sheets
values normal normal font weight. same as 400. bold bold font weight. same as 700. lighter one relative font weight lighter than the parent element. note that only four font weights are considered for relative weight calculation; see the meaning of relative weights section below. bo...
...tener('input', update); update(); accessibility concerns people experiencing low vision conditions may have difficulty reading text set with a font-weight value of 100 (thin/hairline) or 200 (extra light), especially if the font has a low contrast color ratio. ...
...put', update); update(); accessibility concerns people experiencing low vision conditions may have difficulty reading text set with a font-weight value of 100 (thin/hairline) or 200 (extra light), especially if the font has a low contrast color ratio. ...
...And 3 more matches
image-orientation - CSS: Cascading Style Sheets
ted in the specification. its functionality may be moved into properties on the <img> and/or <picture> elements, with the possible exception of from-image. the flip and <angle> values were made obsolete in firefox 63. /* keyword values */ image-orientation: none; image-orientation: from-image; /* use exif data from the image */ /* global values */ image-orientation: inherit; image-orientation:
initial; image-orientation: unset; /* obsolete values. obsolete since gecko 63 */ image-orientation: 90deg; /* rotate 90deg */ image-orientation: 90deg flip; /* rotate 90deg, and flip it horizontally */ image-orientation: flip; /* no rotation, only applies a horizontal flip */ syntax values none default
initial value. will not apply any additional image rotation; the image is oriented as encod...
...or scanned, use a transform property with the rotate keyword to specify rotation. this includes any user-directed changes to the orientation of the image, or changes required for printing in portrait versus landscape orientation. if used in conjunction with other css properties, such as a <transform-function>, any image-orientation rotation is applied before any other transformations. ...
...d, use a transform property with the rotate keyword to specify rotation. this includes any user-directed changes to the orientation of the image, or changes required for printing in portrait versus landscape orientation. if used in conjunction with other css properties, such as a <transform-function>, any image-orientation rotation is applied before any other transformations. ...
...And 3 more matches
<length> - CSS: Cascading Style Sheets
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-height properties of the root element, it refers to the properties'
initial value. viewport-percentage lengths viewport-percentage le...
...ength. when used on the font-size or line-height properties of the root element, it refers to the properties'
initial value. viewport-percentage lengths viewport-percentage lengths define the <length> value relative to the size of the viewport, i.e., the visible portion of the document. viewport lengths are invalid in @page declaration blocks. vh equal to 1% of the height of the viewport's
initial containing block. vw equal to 1% of the width of the viewport's
initial containing block. vi equal to 1% of the size of the
initial containing block, in the direction of the root element’s inline axis. vb equal to 1% of the size of the
initial containing block, in the direction of the root element’s block axis. vmin equal to the smaller of vw and vh. vmax equal to the larger ...
... one of the units to a physical unit, and then defining the others relative to it. the anchor is done differently for low-resolution devices, such as screens, versus high-resolution devices, such as printers. for low-dpi devices, the unit px represents the physical reference pixel; other units are defined relative to it. thus, 1in is defined as 96px, which equals 72pt. the consequence of this def
inition is that on such devices, dimensions described in inches (in), centimeters (cm), or millimeters (mm) don't necessary match the size of the physical unit with the same name. for high-dpi devices, inches (in), centimeters (cm), and millimeters (mm) are the same as their physical counterparts. therefore, the px unit is defined relative to them (1/96 of 1 inch). note: many users increase their u...
...And 3 more matches
line-height - CSS: Cascading Style Sheets
eractive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword value */ line-height: normal; /* unitless values: use this number multiplied by the element's font size */ line-height: 3.5; /* <length> values */ line-height: 3em; /* <percentage> values */ line-height: 34%; /* global values */ line-height: inherit; line-height:
initial; line-height: unset; the line-height property is specified as any one of the following: a <number> a <length> a <percentage> the keyword normal. values normal depends on the user agent. desktop browsers (including firefox) use a default value of roughly 1.2, depending on the element's font-family. <number> (unitless) the used value is this unitless <number> multiplied by the el...
...e current block. accessibility concerns use a minimum value of 1.5 for line-height for main paragraph content. this will help people experiencing low vision conditions, as well as people with cognitive concerns such as dyslexia. if the page is zoomed to increase the text size, using a unitless value ensures that the line height will scale proportionately. w3c understanding wcag 2.1 formal def
inition
initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyespercentagesrefer to the font size of the element itselfcomputed valuefor percentage and length values, the absolute length, otherwise as specifiedanimation typeeither number or length formal syntax normal | <number> | <length> | <percentage> examples basic example /* all rules below ...
... ...
...And 3 more matches
margin-block - CSS: Cascading Style Sheets
ctionality, and text orientation. /* <length> values */ margin-block: 10px 20px; /* an absolute length */ margin-block: 1em 2em; /* relative to the text size */ margin-block: 5% 2%; /* relative to the nearest block container's width */ margin-block: 10px; /* sets both start and end values */ /* keyword values */ margin-block: auto; /* global values */ margin-block: inherit; margin-block:
initial; margin-block: unset; these values corresponds to the margin-top and margin-bottom, or margin-right, and margin-left property depending on the values defined for writing-mode, direction, and text-orientation. constituent properties this property is a shorthand for the following css properties: margin-block-end margin-block-start syntax values the margin-block property takes the sam...
...nds to the margin-top and margin-bottom, or margin-right, and margin-left property depending on the values defined for writing-mode, direction, and text-orientation. constituent properties this property is a shorthand for the following css properties: margin-block-end margin-block-start syntax values the margin-block property takes the same values as the margin-left property. ...
...e margin-top and margin-bottom, or margin-right, and margin-left property depending on the values defined for writing-mode, direction, and text-orientation. constituent properties this property is a shorthand for the following css properties: margin-block-end margin-block-start syntax values the margin-block property takes the same values as the margin-left property. ...
...And 3 more matches
mask-type - CSS: Cascading Style Sheets
alpha masks will generally be faster to render. ...
...type property is specified as one of the keyword values listed below. values luminance is a keyword indicating that the associated mask image is a luminance mask, i.e., that its relative luminance values must be used when applying it. alpha is a keyword indicating that the associated mask image is an alpha mask, i.e., that its alpha channel values must be used when applying it. ...
...erty is specified as one of the keyword values listed below. values luminance is a keyword indicating that the associated mask image is a luminance mask, i.e., that its relative luminance values must be used when applying it. alpha is a keyword indicating that the associated mask image is an alpha mask, i.e., that its alpha channel values must be used when applying it. ...
...And 3 more matches
mask - CSS: Cascading Style Sheets
it is therefore recommended to use the mask shorthand rather than other shorthands or the individual properties to override any mask settings earlier in the cascade. this will ensure that mask-border has also been reset to allow the new styles to take effect. ...
...see mask-im...
...if only one <geometry-box> value is given, it sets both mask-origin and mask-clip. if two <geometry-box> values are present, then the first sets mask-origin and the second sets mask-clip. <geometry-box> | no-clip sets the area that is affected by the mask image. see mask-clip. <compositing-operator> sets the compositing operation used on the current mask layer. see mask-composite. ...
...And 3 more matches
max-height - CSS: Cascading Style Sheets
//github.com/mdn/interactive-examples and send us a pull request. max-height overrides height, but min-height overrides max-height. syntax /* <length> value */ max-height: 3.5em; /* <percentage> value */ max-height: 75%; /* keyword values */ max-height: none; max-height: max-content; max-height: min-content; max-height: fit-content(20em); /* global values */ max-height: inherit; max-height:
initial; max-height: unset; values <length> defines the max-height as an absolute value. <percentage> defines the max-height as a percentage of the containing block's height. auto the browser will calculate and select a max-height for the specified element. none no limit on the size of the box. max-content the intrinsic preferred max-height. min-content the intrinsic minimum max-height...
...e space replaced by the specified argument, i.e. min(max-content, max(min-content, argument)). accessibility concerns ensure that elements set with a max-height are not truncated and/or do not obscure other content when the page is zoomed to increase text size. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 formal def
inition
initial valuenoneapplies toall elements but non-replaced inline elements, table columns, and column groupsinheritednopercentagesthe percentage is calculated with respect to the height of the generated box's containing block. if the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the percentage valu...
... browser compatibility the comp...
...And 3 more matches
max-width - CSS: Cascading Style Sheets
clone https://github.com/mdn/interactive-examples and send us a pull request. max-width overrides width, but min-width overrides max-width. syntax /* <length> value */ max-width: 3.5em; /* <percentage> value */ max-width: 75%; /* keyword values */ max-width: none; max-width: max-content; max-width: min-content; max-width: fit-content(20em); /* global values */ max-width: inherit; max-width:
initial; max-width: unset; values <length> defines the max-width as an absolute value. <percentage> defines the max-width as a percentage of the containing block's width. auto the browser will calculate and select a max-width for the specified element. none no limit on the size of the box. max-content the intrinsic preferred max-width. min-content the intrinsic minimum max-width. fit-...
...ble space replaced by the specified argument, i.e. min(max-content, max(min-content, argument)). accessibility concerns ensure that elements set with a max-width are not truncated and/or do not obscure other content when the page is zoomed to increase text size. ...
... replaced by the specified argument, i.e. min(max-content, max(min-content, argument)). accessibility concerns ensure that elements set with a max-width are not truncated and/or do not obscure other content when the page is zoomed to increase text size. ...
...And 3 more matches
offset-position - CSS: Cascading Style Sheets
the offset-position css property defines the
initial position of the offset-path. syntax /* keyword values */ offset-position: auto; offset-position: top; offset-position: bottom; offset-position: left; offset-position: right; offset-position: center; /* <percentage> values */ offset-position: 25% 75%; /* <length> values */ offset-position: 0 0; offset-position: 1cm 2cm; offset-position: 10ch 8em; /* edge offsets values */ offset-position: bottom 10px right 20px; offset-position: right 3em bottom 10px; offset-position: bottom 10px right; offset-position: top right 10px; /* global values */ offset-position: inherit; offset-position:
initial; offset-position: unset; values auto the
initial position is the position of the box specified by the position property. <position> ...
...f two non-keyword values are used, the first value represents the horizontal position and the second represents the vertical position. if only one value is specified, the second value is assumed to be center. if three or four values are used, the length-percentage values are offsets for the preceding keyword value(s). for more explanation of these value types, see background-position. ...
...-keyword values are used, the first value represents the horizontal position and the second represents the vertical position. if only one value is specified, the second value is assumed to be center. if three or four values are used, the length-percentage values are offsets for the preceding keyword value(s). for more explanation of these value types, see background-position. ...
...And 3 more matches
outline-style - CSS: Cascading Style Sheets
ient to use the shorthand property outline when defining the appearance of an outline. syntax /* keyword values */ outline-style: auto; outline-style: none; outline-style: dotted; outline-style: dashed; outline-style: solid; outline-style: double; outline-style: groove; outline-style: ridge; outline-style: inset; outline-style: outset; /* global values */ outline-style: inherit; outline-style:
initial; outline-style: unset; the outline-style property is specified as any one of the values listed below. values auto permits the user agent to render a custom outline style. none no outline is used. the outline-width is 0. dotted the outline is a series of dots. dashed the outline is a series of short line segments. solid the outline is a single line. double ...
... and the space between them. groove the outline looks as though it were carved into the page. ridge the opposite of groove: the outline looks as though it were extruded from the page. inset the outline makes the box look as though it were embedded in the page. outset the opposite of inset: the outline makes the box look as though it were coming out of the page. formal def
inition
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | <'border-style'> examples setting outline style to auto the auto value indicates a custom outline style — typically a style [that] is either a user interface default for the platform, or perhaps a style that is richer than can be described in detail in css, e.g. a rou...
... ...
...And 3 more matches
outline-width - CSS: Cascading Style Sheets
low. values <length> the width of the outline specified as a <length>. thin depends on the user agent. typically equivalent to 1px in desktop browsers (including firefox). medium depends on the user agent. typically equivalent to 3px in desktop browsers (including firefox). thick depends on the user agent. typically equivalent to 5px in desktop browsers (including firefox). ...
...ues <length> the width of the outline specified as a <length>. thin depends on the user agent. typically equivalent to 1px in desktop browsers (including firefox). medium depends on the user agent. typically equivalent to 3px in desktop browsers (including firefox). thick depends on the user agent. typically equivalent to 5px in desktop browsers (including firefox). ...
... ...
...And 3 more matches
page-break-inside - CSS: Cascading Style Sheets
automatic page breaks (neither forced nor forbidden). avoid avoid page breaks inside the element. ...
...automatic page breaks (neither forced nor forbidden). avoid avoid page breaks inside the element. ...
...erty is now a legacy property, replaced by break-inside. for compatibility reasons, page-break-inside should be treated by browsers as an alias of break-inside. this ensures that sites using page-break-inside continue to work as designed. a subset of values should be aliased as follows: page-break-inside break-inside auto auto avoid avoid formal def
inition
initial valueautoapplies toblock-level elements in the normal flow of the root element. user agents may also apply it to other elements like table-row elements.inheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | avoid examples avoiding page breaks inside elements html <div class="page"> <p>this is the first paragraph.</p> <section class="list"> <span...
...And 3 more matches
perspective-origin - CSS: Cascading Style Sheets
ransform function which is placed on the element being transformed. syntax /* one-value syntax */ perspective-origin: x-position; /* two-value syntax */ perspective-origin: x-position y-position; /* when both x-position and y-position are keywords, the following is also valid */ perspective-origin: y-position x-position; /* global values */ perspective-origin: inherit; perspective-origin:
initial; perspective-origin: unset; values x-position indicates the position of the abscissa of the vanishing point. it can have one of the following values: <length-percentage> indicating the position as an absolute length value or relative to the width of the element. the value may be negative. left, a keyword being a shortcut for the 0 length value. center, a keyword being a shortcut ...
...int. it can have one of the following values: <length-percentage> indicating the position as an absolute length value or relative to the height of the element. the value may be negative. top, a keyword being a shortcut for the 0 length value. center, a keyword being a shortcut for the 50% percentage value. bottom, a keyword being a shortcut for the 100% percentage value. ...
...an have one of the following values: <length-percentage> indicating the position as an absolute length value or relative to the height of the element. the value may be negative. top, a keyword being a shortcut for the 0 length value. center, a keyword being a shortcut for the 50% percentage value. bottom, a keyword being a shortcut for the 100% percentage value. ...
...And 3 more matches
scroll-margin-block-end - 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. ...
... project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-block-end: 10px; scroll-margin-block-end: 1em; /* global values */ scroll-margin-block-end: inherit; scroll-margin-block-end:
initial; scroll-margin-block-end: unset; values <length> an outset from the block end edge of the scroll container. ...
... please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-block-end: 10px; scroll-margin-block-end: 1em; /* global values */ scroll-margin-block-end: inherit; scroll-margin-block-end:
initial; scroll-margin-block-end: unset; values <length> an outset from the block end edge of the scroll container. ...
...And 3 more matches
scroll-margin-block-start - CSS: Cascading Style Sheets
ource 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. ...
...ase clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-block-start: 10px; scroll-margin-block-start: 1em; /* global values */ scroll-margin-block-start: inherit; scroll-margin-block-start:
initial; scroll-margin-block-start: unset; values <length> an outset from the block start edge of the scroll container. ...
... https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-block-start: 10px; scroll-margin-block-start: 1em; /* global values */ scroll-margin-block-start: inherit; scroll-margin-block-start:
initial; scroll-margin-block-start: unset; values <length> an outset from the block start edge of the scroll container. ...
...And 3 more matches
scroll-margin-block - CSS: Cascading Style Sheets
project, please clone https://github.com/mdn/interactive-examples and send us a pull request. constituent properties this property is a shorthand for the following css properties: scroll-margin-block-end scroll-margin-block-start syntax /* <length> values */ scroll-margin-block: 10px; scroll-margin-block: 1em .5em ; /* global values */ scroll-margin-block: inherit; scroll-margin-block:
initial; scroll-margin-block: unset; values <length> an outset from the corresponding edge of the scroll container. description 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 cont...
...orresponding edge of the scroll container. description the scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport. ...
...ing edge of the scroll container. description the scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport. ...
...And 3 more matches
scroll-margin-bottom - CSS: Cascading Style Sheets
ied outsets. 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. ...
...teractive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-bottom: 10px; scroll-margin-bottom: 1em; /* global values */ scroll-margin-bottom: inherit; scroll-margin-bottom:
initial; scroll-margin-bottom: unset; values <length> an outset from the bottom edge of the scroll container. ...
... examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-bottom: 10px; scroll-margin-bottom: 1em; /* global values */ scroll-margin-bottom: inherit; scroll-margin-bottom:
initial; scroll-margin-bottom: unset; values <length> an outset from the bottom edge of the scroll container. ...
...And 3 more matches
scroll-margin-left - CSS: Cascading Style Sheets
specified outsets. 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 the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-left: 10px; scroll-margin-left: 1em; /* global values */ scroll-margin-left: inherit; scroll-margin-left:
initial; scroll-margin-left: unset; values <length> an outset from the left edge of the scroll container. ...
...nteractive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-left: 10px; scroll-margin-left: 1em; /* global values */ scroll-margin-left: inherit; scroll-margin-left:
initial; scroll-margin-left: unset; values <length> an outset from the left edge of the scroll container. ...
...And 3 more matches
scroll-margin-right - CSS: Cascading Style Sheets
cified outsets. 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. ...
...he interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-right: 10px; scroll-margin-right: 1em; /* global values */ scroll-margin-right: inherit; scroll-margin-right:
initial; scroll-margin-right: unset; values <length> an outset from the right edge of the scroll container. ...
...ctive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-right: 10px; scroll-margin-right: 1em; /* global values */ scroll-margin-right: inherit; scroll-margin-right:
initial; scroll-margin-right: unset; values <length> an outset from the right edge of the scroll container. ...
...And 3 more matches
scroll-margin-top - CSS: Cascading Style Sheets
g the specified outsets. 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. ...
...ntribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-top: 10px; scroll-margin-top: 1em; /* global values */ scroll-margin-top: inherit; scroll-margin-top:
initial; scroll-margin-top: unset; values <length> an outset from the top edge of the scroll container. ...
...to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-top: 10px; scroll-margin-top: 1em; /* global values */ scroll-margin-top: inherit; scroll-margin-top:
initial; scroll-margin-top: unset; values <length> an outset from the top edge of the scroll container. ...
...And 3 more matches
scroll-snap-align - CSS: Cascading Style Sheets
values specify the snapping alignment in the block axis and inline axis, respectively. if only one value is specified, the second value defaults to the same value. syntax /* keyword values */ scroll-snap-align: none; scroll-snap-align: start end; /* when two values set first is block, second inline */ scroll-snap-align: center; /* global values */ scroll-snap-align: inherit; scroll-snap-align:
initial; scroll-snap-align: unset; values none the box does not define a snap position in that axis. start the start alignment of this box's scroll snap area, within the scroll container's snapport is a snap position in this axis. end the end alignment of this box's scroll snap area, within the scroll container's snapport is a snap position in this axis. center the center alignment of this...
...end the end alignment of this box's scroll snap area, within the scroll container's snapport is a snap position in this axis. center the center alignment of this box's scroll snap area, within the scroll container's snapport is a snap position in this axis. safari currently has the two value syntax in the wrong order, the first value being inline the second block. ...
...end alignment of this box's scroll snap area, within the scroll container's snapport is a snap position in this axis. center the center alignment of this box's scroll snap area, within the scroll container's snapport is a snap position in this axis. safari currently has the two value syntax in the wrong order, the first value being inline the second block. see bug #191865. ...
...And 3 more matches
text-emphasis-style - CSS: Cascading Style Sheets
the text-emphasis-style css property sets the appearance of emphasis marks. it can also be set, and reset, using the text-emphasis shorthand. /*
initial value */ text-emphasis-style: none; /* no emphasis marks */ /* <string> values */ text-emphasis-style: 'x'; text-emphasis-style: '点'; text-emphasis-style: '\25b2'; text-emphasis-style: '*'; text-emphasis-style: 'foo'; /* should not be used. ...
...be used. it may be computed to or rendered as 'f' only */ /* keyword values */ text-emphasis-style: filled; text-emphasis-style: open; text-emphasis-style: dot; text-emphasis-style: circle; text-emphasis-style: double-circle; text-emphasis-style: triangle; text-emphasis-style: filled sesame; text-emphasis-style: open sesame; /* global values */ text-emphasis-style: inherit; text-emphasis-style:
initial; text-emphasis-style: unset; syntax values none no emphasis marks. filled the shape is filled with solid color. if neither filled nor open is present, this is the default. open the shape is hollow. dot display small circles as marks. the filled dot is '•' (u+2022), and the open dot is '◦' (u+25e6). circle display large circles as marks. the filled circle is '●' (u+25cf), a...
...s. the filled triangle is '▲' (u+25b2), and the open triangle is '△' (u+25b3). sesame display sesames as marks. the filled sesame is '﹅' (u+fe45), and the open sesame is '﹆' (u+fe46). <string> display the given string as marks. authors should not specify more than one character in <string>. the ua may truncate or ignore strings consisting of more than one grapheme cluster. ...
...And 3 more matches
text-orientation - CSS: Cascading Style Sheets
f 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 /* keyword values */ text-orientation: mixed; text-orientation: upright; text-orientation: sideways-right; text-orientation: sideways; text-orientation: use-glyph-orientation; /* global values */ text-orientation: inherit; text-orientation:
initial; text-orientation: unset; the text-orientation property is specified as a single keyword from the list below. values mixed rotates the characters of horizontal scripts 90° clockwise. lays out the characters of vertical scripts naturally. default value. upright lays out the characters of horizontal scripts naturally (upright), as well as the glyphs for vertical scripts. note that this...
...ced to be ltr. sideways causes characters to be laid out as they would be horizontally, but with the whole line rotated 90° clockwise. sideways-right an alias to sideways that is kept for compatibility purposes. use-glyph-orientation on svg elements, this keyword leads to use the value of the deprecated svg properties glyph-orientation-vertical and glyph-orientation-horizontal. ...
... ltr. sideways causes characters to be laid out as they would be horizontally, but with the whole line rotated 90° clockwise. sideways-right an alias to sideways that is kept for compatibility purposes. use-glyph-orientation on svg elements, this keyword leads to use the value of the deprecated svg properties glyph-orientation-vertical and glyph-orientation-horizontal. ...
...And 3 more matches
transform-origin - CSS: Cascading Style Sheets
s and send us a pull request. the transformation origin is the point around which a transformation is applied. for example, the transformation origin of the rotate() function is the center of rotation. this property is applied by first translating the element by the value of the property, then applying the element's transform, then translating by the negated property value. this means, this def
inition transform-origin: -100% 50%; transform: rotate(45deg); results in the same transformation as transform-origin: 0 0; transform: translate(-100%, 50%) rotate(45deg) translate(100%, -50%); by default, the origin of a transform is center. syntax /* one-value syntax */ transform-origin: 2px; transform-origin: bottom; /* x-offset | y-offset */ transform-origin: 3cm 2px; /* x-offset-keyword ...
... if two or more values are defined and either no value is a keyword, or the only used keyword is center, then the first value represents the horizontal offset a...
... if two or more values are defined and either no value is a keyword, or the only used keyword is center, then the first value represents the horizontal offset and the second represents the vertical offset. ...
...And 3 more matches
unicode-bidi - CSS: Cascading Style Sheets
s both left-to-right and right-to-left text, the user-agent uses a complex unicode algorithm to decide how to display the text. the unicode-bidi property overrides this algorithm and allows the developer to control the text embedding. the unicode-bidi and direction properties are the only properties that are not affected by the all shorthand. ...
...for inline elements, implicit reordering works across element boundaries. ...
...t. plaintext this keyword makes the elements directionality calculated without considering its parent bidirectional state or the value of the direction property. the directionality is calculated using the p2 and p3 rules of the unicode bidirectional algorithm. this value allows the display of data that is already formatted using a tool following the unicode bidirectional algorithm. ...
...And 3 more matches
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts flow content. ...
...ory. permitted parents any element that accepts flow content. ...
...ccepts flow content. implicit aria role group permitted aria roles radiogroup, presentation, none dom interface htmlfieldsetelement specifications specification status comment html living standardthe def
inition of '<fieldset>' in that specification. ...
...And 3 more matches
<input type="hidden"> - HTML: Hypertext Markup Language
running live). ...
...ething like this: title=my+excellent+blog+post&content=this+is+the+content+of+my+excellent+blog+post.+i+hope+you+enjoy+it!&postid=34657 even though the hidden input cannot be seen at all, its data is still submitted. ...
... this: title=my+excellent+blog+post&content=this+is+the+content+of+my+excellent+blog+post.+i+hope+you+enjoy+it!&postid=34657 even though the hidden input cannot be seen at all, its data is still submitted. ...
...And 3 more matches
<label> - HTML: Hypertext Markup Language
tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. ...
...ted parents any element that accepts phrasing content. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmllabelelement specifications specification status comment html living standardthe def
inition of '<label>' in that specification. ...
... role permitted aria roles no role permitted dom interface htmllabelelement specifications specification status comment html living standardthe def
inition of '<label>' in that specification. living standard html5the def
inition of '<label>' in that specification. ...
...And 3 more matches
<legend> - HTML: Hypertext Markup Language
st child is this <legend> element implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmllegendelement attributes this element only includes the global attributes. examples see <form> for examples on <legend>. ...
...rresponding role permitted aria roles no role permitted dom interface htmllegendelement attributes this element only includes the global attributes. examples see <form> for examples on <legend>. ...
...o role permitted dom interface htmllegendelement attributes this element only includes the global attributes. examples see <form> for examples on <legend>. ...
...And 3 more matches
<option>: The HTML Option element - HTML: Hypertext Markup Language
ouse clicks or focus-related ones. if this attribute is not set, the element can still be disabled if one of its ancestors is a disabled <optgroup> element. label this attribute is text for the label indicating the meaning of the option. if the label attribute isn't defined, its value is that of the element text content. selected if present, this boolean attribute indicates that the option is
initially selected. if the <option> element is the descendant of a <select> element whose multiple attribute is not set, only one single <option> of this <select> element may have the selected attribute. value the content of this attribute represents the value to be submitted with the form, should this option be selected. if this attribute is omitted, the value is taken from the text content of the ...
...t> element may have the selected attribute. value the content of this attribute represents the value to be submitted with the form, should this option be selected. if this attribute is omitted, the value is taken from the text content of the option element. ...
...nts the value to be submitted with the form, should this option be selected. if this attribute is omitted, the value is taken from the text content of the option element. examples see <select> for examples. ...
...And 3 more matches
HTML documentation index - HTML: Hypertext Markup Language
xt-level semantics, html:flow content, html:interactive content, html:palpable content, html:phrasing content, inline element, reference, web the html <a> element (or anchor element), with its href attribute, creates a hyperlink to web pages, files, email addresses, locations in the same page, or anything else a url can address. 56 <abbr>: the abbreviation element acronym, def
initions, element, html, html text-level semantics, html:flow content, html:palpable content, html:phrasing content, reference, web, abbr, abbreviation, semantics the html abbreviation element (<abbr>) represents an abbreviation or acronym; the optional title attribute can provide an expansion or description for the abbreviation. 57 <acronym> element, html, html:flow content, obso...
...ent is time- or date-related, the <time> element must be used. 86 <datalist>: the html data list element element, html, html forms, html5, reference, web the html <datalist> element contains a set of <option> elements that represent the permissible or recommended options available to choose from within other controls. 87 <dd>: the description details element def
inition, description details, element, html, html grouping content, reference, web, dd, description list, details the html <dd> element provides the description, def
inition, or value for the preceding term (<dt>) in a description list (<dl>). 88 <del>: the deleted text element deleted text, element, html, html edits, reference, web, del the html <del> element represents a ra...
... range of text that has been deleted from a document. 89 <details>: the details disclosure element disclosure box, disclosure widget, element, html, html interactive elements, reference, web, details the html details element (<details>) creates a disclosure widget in which information is visible only when the widget is toggled into an "open" state. 90 <dfn>: the def
inition element def
inition, def
initions, element, html, html text-level semantics, reference, semantic markup, web, dfn the html def
inition element (<dfn>) is used to indicate the term being defined within the context of a def
inition phrase or sentence. 91 <dialog>: the dialog element dialog, element, html, html interactive elements, reference, web, polyfill the html <di...
...And 3 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
/ 10 + '0x10'; // 16 a special value called nan (short for "not a number") is returned if the string is non-numeric: parseint('hello', 10); // nan nan is toxic: if you provide it as an operand to any mathematical operation, the result will also be nan: nan + 5; // nan you can test for nan using the built-in isnan() function: isnan(nan); // true javascript also has the special values inf
inity and -inf
inity: 1 / 0; // inf
inity -1 / 0; // -inf
inity you can test for inf
inity, -inf
inity and nan values using the built-in isf
inite() function: isf
inite(1 / 0); // false isf
inite(-inf
inity); // false isf
inite(nan); // false the parseint() and parsefloat() functions parse a string until they reach a character that isn't valid for the specified number format, then return the number pars...
...we'll talk about variables later, but in javascript it is possible to declare a variable without assigning a value to it. if you do this, the variable's type is undefined. undefined is actually a constant. javascript has a boolean type, with possible values true and false (both of which are keywords.) any value can be converted ...
...gether if you like: var name = 'kittens'; if (name == 'puppies') { name += ' woof'; } else if (name == 'kittens') { name += ' meow'; } else { name += '!'; } name == 'kittens meow'; javascript has while loops and do-while loops. the first is good for basic looping; the second for loops where you wish to ensure that the body of the loop is executed at least once: while (true) { // an inf
inite loop! } var input; do { input = get_input(); } while (inputisnotvalid(input)); javascript's for loop is the same as that in c and java: it lets you provide the control information for your loop on a single line. for (var i = 0; i < 5; i++) { // will execute 5 times } javascript also contains two other prominent for loops: for...of for (let value of array) { // do something with valu...
...And 3 more matches
Classes - JavaScript
width; } }; console.log(rectangle.name); // output: "rectangle" // named let rectangle = class rectangle2 { constructor(height, width) { this.height = height; this.width = width; } }; console.log(rectangle.name); // output: "rectangle2" note: class expressions are subject to the same hoisting restrictions as described in the class declarations section. class body and method def
initions the body of a class is the part that is in curly brackets {}. this is where you define class members, such as methods or constructor. strict mode the body of a class is executed in strict mode, i.e., code written here is subject to stricter syntax for increased performance, some otherwise silent errors will be thrown, and certain keywords are reserved for future versions of ecmascript. co...
...s is where you define class members, such as methods or constructor. strict mode the body of a class is executed in strict mode, i.e., code written here is subject to stricter syntax for increased performance, some otherwise silent errors will be thrown, and certain keywords are reserved for future versions of ecmascript. constructor the constructor method is a special method for creating and
initializing an object created with a class. there can only be one special method with the name "constructor" in a class. a syntaxerror will be thrown if the class contains more than one occurrence of a constructor method. a constructor can use the super keyword to call the constructor of the super class. prototype methods see also method def
initions. class rectangle { constructor(height, width)...
...in strict mode, autobinding will not happen; the value of this remains as passed. function animal() { } animal.prototype.speak = function() { return this; } animal.eat = function() { return this; } let obj = new animal(); let speak = obj.speak; speak(); // global object (in non–strict mode) let eat = animal.eat; eat(); // global obj...
...And 3 more matches
Math.trunc() - JavaScript
right of it, no matter whether the argument is a positive or negative number. the argument passed to this method will be converted to number type implicitly. because trunc() is a static method of math, you always use it as math.trunc(), rather than as a method of a math object you created (math is not a constructor). ...
...(), rather than as a method of a math object you created (math is not a constructor). ...
...an as a method of a math object you created (math is not a constructor). ...
...And 3 more matches
TypedArray.prototype.reduceRight() - JavaScript
the reduceright() method applies a function against an accumulator and each value of the typed array (from right-to-left) has to reduce it to a single value. this method has the same algorithm as array.prototype.reduceright(). typedarray is one of the typed array types here. syntax typedarray.reduceright(callback[,
initialvalue]) parameters callback function to execute on each value in the typed array, taking four arguments: previousvalue the value previously returned in the last invocation of the callback, or
initialvalue, if supplied (see below). currentvalue the current element being processed in the typed array. index the index of the current element being processed in the typed array. array the typed array reduce was called upon.
initialvalue optional. obje...
... the call to the reduceright callback would look something like this: typedarray.reduceright(function(previousvalue, currentvalue, index, typedarray) { // ... ...
...s callback call), the value of the current element, the current index, and the typed array over which iteration is occurring. the call to the reduceright callback would look something like this: typedarray.reduceright(function(previousvalue, currentvalue, index, typedarray) { // ... }); the first time the function is called, the previousvalue and currentvalue can be one of two values. ...
...And 3 more matches
d - SVG: Scalable Vector Graphics
the commands are detailed below. three elements have this attribute: <path>, <glyph>, and <missing-glyph> html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <path fill="none" stroke="red" d="m 10,30 a 20,20 0,0,1 50,30 a 20,20 0,0,1 90,30 q 90,60 50,90 q 10,60 10,30 z" /> </svg> path for <path>, d is a string containing a series of path commands that define the path to be drawn. ...
... command parame...
... command parameters notes q (x1,y1, x,y)+ draw a quadratic bézier curve from the current point to the end point specifie...
...And 3 more matches
filterUnits - SVG: Scalable Vector Graphics
en the <filter> element is referenced (i.e., the user coordinate system for the element referencing the <filter> element via a filter attribute). ...
...tem for the element referencing the <filter> element via a filter attribute). objectboundingbox in that case, x, y, width and height represent fractions or percentages of the bounding box on the referencing element. ...
... element referencing the <filter> element via a filter attribute). objectboundingbox in that case, x, y, width and height represent fractions or percentages of the bounding box on the referencing element. ...
...And 3 more matches
glyphRef - SVG: Scalable Vector Graphics
are using this attribute: <altglyph> and <glyphref> usage notes value <string> default value none animatable yes <string> this value represents the glyph identifier. its format depends on the format of the given font. ...
... <string> default value none animatable yes <string> this value represents the glyph identifier. its format depends on the format of the given font. ...
...> default value none animatable yes <string> this value represents the glyph identifier. its format depends on the format of the given font. ...
...And 3 more matches
gradientUnits - SVG: Scalable Vector Graphics
ith this value and gradienttransform being the identity matrix, the normal of the linear gradient is perpendicular to the gradient vector in object bounding box space (i.e., the abstract coordinate system where (0,0) is at the top/left of the object bounding box and (1,1) is at the bottom/right of the object bounding box). when the object's bounding box is not square, the gradient normal which is
initially perpendicular to the gradient vector within object bounding box space may render non-perpendicular relative to the gradient vector in user space. if the gradient vector is parallel to one of the axes of the bounding box, the gradient normal will remain perpendicular. this transformation is due to application of the non-uniform scaling transformation from bounding box space to user space. r...
...ttom/right of the object bounding box). when the object's bounding box is not square, the rings that are conceptually circular within object bounding box space will render as elliptical due to application of the non-uniform scaling transformation from bounding box space to user space. ...
...will render as elliptical due to application of the non-uniform scaling transformation from bounding box space to user space. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'gradientunits for <radialgradient>' in that specification. candidate recommendation no change scalable vector graphics (svg) 2the def
inition of 'gradientunits for <lineargradient>' in that specification. ...
...And 3 more matches
horiz-adv-x - SVG: Scalable Vector Graphics
iz-adv-x specifies the horizontal advance of the glyph in horizontal orientation. value <number> default value <font>ʼs horiz-adv-x value animatable no <number> this value indicates the horizontal advance of the glyph. ...
...<number> default value <font>ʼs horiz-adv-x value animatable no <number> this value indicates the horizontal advance of the glyph. ...
... default value <font>ʼs horiz-adv-x value animatable no <number> this value indicates the horizontal advance of the glyph. ...
...And 3 more matches
image-rendering - SVG: Scalable Vector Graphics
appropriate tradeoffs to balance speed and quality, but quality shall be given more importance than speed. optimizespeed indicates that the user agent shall emphasize rendering speed over quality. optimizequality indicates that the user agent shall emphasize quality over rendering speed. ...
...portance than speed. optimizespeed indicates that the user agent shall emphasize rendering speed over quality. optimizequality indicates that the user agent shall emphasize quality over rendering speed. specifications specification status comment css images module level 3the def
inition of 'image-rendering' in that specification. ...
...ent shall emphasize rendering speed over quality. optimizequality indicates that the user agent shall emphasize quality over rendering speed. specifications specification status comment css images module level 3the def
inition of 'image-rendering' in that specification. candidate recommendation def
inition in css scalable vector graphics (svg) 2the def
inition of 'image-rendering' in that specification. ...
...And 3 more matches
kernelUnitLength - SVG: Scalable Vector Graphics
which is a pixel-based coordinate system, and thus potentially not scalable. if a negative or zero value is specified the default value will be used instead. ...
... <number-optional-number> default value pixel in offscreen bitmap animatable yes specifications specification status comment filter effects module level 1the def
inition of 'kernelunitlength for <fespecularlighting>' in that specification. working draft marked the attribute as deprecated. filter effects module level 1the def
inition of 'kernelunitlength for <fediffuselighting>' in that specification. working draft marked the attribute as deprecated. ...
... filter effects module level 1the def
inition of 'kernelunitlength for <fespecularlighting>' in that specification. working draft marked the attribute as deprecated. filter effects module level 1the def
inition of 'kernelunitlength for <fediffuselighting>' in that specification. working draft marked the attribute as deprecated. filter effects module level 1the def
inition of 'kernelunitlength for <feconvolvematrix>' in that specification. working draft marked the attribute as deprecated. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'kernelunitlength for <fespecularlighting>' in that specification. ...
...And 3 more matches
keySplines - SVG: Scalable Vector Graphics
tion (bad values, too many or too few values), the animation will not occur. ...
... ...
...one time segment. the keytimes values that define the associated segment are the bézier "anchor points", and the keysplines values are the control points. thus, there must be one fewer sets of control points than there are keytimes. ...
...And 3 more matches
name - SVG: Scalable Vector Graphics
s <name> this value specifies the name of a local font. unlike the syntax allowed between the parentheses of the local(…) clause in an @font-face rule src descriptor, the font name specified in this attribute is not surrounded in single or double quotes. ...
... allowed between the parentheses of the local(…) clause in an @font-face rule src descriptor, the font name specified in this attribute is not surrounded in single or double quotes. ...
...tween the parentheses of the local(…) clause in an @font-face rule src descriptor, the font name specified in this attribute is not surrounded in single or double quotes. ...
...And 3 more matches
specularExponent - SVG: Scalable Vector Graphics
value <number> default value 1 animatable yes fespotlight for <fespotlight>, specularexponent defines the exponent value controlling the focus for the light source. value <number> default value 1 animatable yes specifications specification status comment filter effects module level 1the def
inition of 'specularexponent for <fespecularlighting>' in that specification. working draft no change filter effects module level 1the def
inition of 'specularexponent for <fespotlight>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'specularexponent for <fespecularlighting>' in that specification. re...
...exponent for <fespecularlighting>' in that specification. working draft no change filter effects module level 1the def
inition of 'specularexponent for <fespotlight>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'specularexponent for <fespecularlighting>' in that specification. ...
...r <fespecularlighting>' in that specification. working draft no change filter effects module level 1the def
inition of 'specularexponent for <fespotlight>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'specularexponent for <fespecularlighting>' in that specification. ...
...And 3 more matches
surfaceScale - SVG: Scalable Vector Graphics
ht of the surface. value <number> default value 1 animatable yes fediffuselighting for <fediffuselighting>, surfacescale defines the height of the surface. value <number> default value 1 animatable yes specifications specification status comment filter effects module level 1the def
inition of 'surfacescale for <fediffuselighting>' in that specification. working draft no change filter effects module level 1the def
inition of 'surfacescale for <fespecularlighting>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'surfacescale for <fediffuselighting>' in that specification. recommend...
...urfacescale for <fediffuselighting>' in that specification. working draft no change filter effects module level 1the def
inition of 'surfacescale for <fespecularlighting>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'surfacescale for <fediffuselighting>' in that specification. ...
... for <fediffuselighting>' in that specification. working draft no change filter effects module level 1the def
inition of 'surfacescale for <fespecularlighting>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'surfacescale for <fediffuselighting>' in that specification. ...
...And 3 more matches
ui/sidebar - Archive of obsolete content
give you a worker: attach and ready. listen to attach if the first message in your add-on goes from the sidebar scripts to the main add-on code, and listen to ready if the first message goes from the main add-on code to the sidebar script. using attach the attach event is triggered whenever the dom for a new sidebar instance is loaded and its scripts are attached. ...
...r a new sidebar instance is loaded and its scripts are attached. the sidebar script may not be
initialized yet, so you can't reliably send messages to the sidebar script right away: however, you can start listening to messages from the script. here's a simple but complete add-on that shows how to set up communication between main.js and a script in a sidebar, in the case where the sidebar script
initiates communication: the html file includes just a script, "sidebar.js": <!doctype html> <html> <body> content for my sidebar <script type="text/javascript" src="sidebar.js"></script> </body> </html> the "sidebar.js" file sends a ping message to main.js using port.emit() as soon as it loads, and adds a listener to the pong message. addon.port.emit("ping"); addon.port.on("pong", f...
...g the add-on, and showing the sidebar using the "view->sidebar->my sidebar" menu item. you should see console output like: console.log: add-on: add-on script got the message console.log: add-on: sidebar script got the reply using ready the ready event is emitted when the dom for the sidebar's content is ready. it is equivalent to the domcontentloaded event. ...
...And 2 more matches
Progress Listeners - Archive of obsolete content
if you use mylistener for more than one tab/window, // use aprogress.domwindow to obtai...
...is fires when the load finishes } }, onlocationchange: function(aprogress, arequest, auri) { // this fires when the location bar changes; that is load event is confirmed // or when the user switches tabs. if you use mylistener for more than one tab/window, // use aprogress.domwindow to obtain the tab/window which triggered the change. ...
...s 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 location bar, etc.) and also when user switches tabs. var myextension = { oldurl: null,
init: function() { gbrowser.addprogresslistener(this); }, un
init: 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.g...
...And 2 more matches
Observer Notifications - Archive of obsolete content
en 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. ...
... 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. ...
... * @param asubject the nsisupports object associated with the notification. * @param atopic the notification topic. ...
...And 2 more matches
Using the Editor from XUL - Archive of obsolete content
editorboxobject behind the scenes. the nseditorboxobject creates an nseditorshell, and holds the owning reference to it. through the magic of xbl, the xul bindings, and the nsieditorboxobject interface, you can get a javascript reference to the editorshell from the editor element with element.editorshell. we thus have an editorshell to play with. ...
...ditorboxobject interface, you can get a javascript reference to the editorshell from the editor element with element.editorshell. we thus have an editorshell to play with. now we set up the editorshell by calling its
init() method, telling it what type of editor we want (text or html), pointing it at the webshellwindow to use, and telling it the content node that it lives on: editorshell.
init(); editorshell.seteditortype(editortype); editorshell.webshellwindow = window; editorshell.contentwindow = window._content; the webshellwindow (a settable attribute on nsieditorshell) points to the top-level window element, 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 throb...
...ument, we go ahead and instantiate an editor on it (in nseditorshell::preparedocumentforediting()). as well as making the editor (which happens via nseditorshell::doeditormode()) we also hook up various listeners and observers for ui updating and user interaction, and store a file specifier for the document we opened. the editor is now set up, and ready to go. one thing to note about editor
initialization is that we pass into the editor's
init() method an nsicontent* that corresponds to the root of the content tree that the editor is allowed to work with. when
initializing the editor from the nseditorshell, we pass null here (which tells the editor that it can edit everything under the <body> of the document). this parameter is more important when the editor is in a text widget, where it...
...And 2 more matches
NPVariant - Archive of obsolete content
v is of type npvarianttype_object. npvariant_to_boolean() extracts the boolean value from v. npvariant_to_int32() extracts a signed 32-bit integer value from v. npvariant_to_double() extracts a double precision floating point value from v. npvariant_to_string() extracts the npstring value from v. npvariant_to_object() extracts the npobject value from v. ...
...lean value from v. npvariant_to_int32() extracts a signed 32-bit integer value from v. npvariant_to_double() extracts a double precision floating point value from v. npvariant_to_string() extracts the npstring value from v. npvariant_to_object() extracts the npobject value from v. void_to_npvariant()
initialize v to a variant of type npvarianttype_void. null_to_npvariant()
initialize v to a variant of type npvarianttype_null. ...
...e from v. npvariant_to_double() extracts a double precision floating point value from v. npvariant_to_string() extracts the npstring value from v. npvariant_to_object() extracts the npobject value from v. void_to_npvariant()
initialize v to a variant of type npvarianttype_void. null_to_npvariant()
initialize v to a variant of type npvarianttype_null. boolean_to_npvariant()
initialize v to a variant of type npvarianttype_bool with the value val. ...
...And 2 more matches
XEmbed Extension for Mozilla Plugins - Archive of obsolete content
ng you prefer. telling mozilla you support xembed as mentioned above, you will need to tell mozilla that you support the xembed protocol for hosting plugins. for backwards compatibility reasons if you don't tell mozilla that you support it it will try to hand you an xt widget as a parent. however, before you do so you should make sure that the browser also supports xembed when the plugin is first
initialized. if you've built your plugin so that it will support either xt or xembed you can include a fallback for older style hosting. if you haven't you can return an error and the plugin will be ignored. it's good practice to do this in case people try to install your plugin for older versions of the browser that don't support xembed functionality. this is an incomplete example of what a piece of ...
... for older style hosting. if you haven't you can return an error and the plugin will be ignored. it's good practice to do this in case people try to install your plugin for older versions of the browser that don't support xembed functionality. this is an incomplete example of what a piece of code might look like that tries to check for the proper mozilla version. ...
... haven't you can return an error and the plugin will be ignored. it's good practice to do this in case people try to install your plugin for older versions of the browser that don't support xembed functionality. this is an incomplete example of what a piece of code might look like that tries to check for the proper mozilla version. this would be included in your np_
initialize function. nperror np_
initialize(npnetscapefuncs* nstable, nppluginfuncs* pluginfuncs) { nperror err = nperr_no_error; prbool supportsxembed = pr_false; npntoolkittype toolkit = 0; [ code that copies all of the function tables and does ] [ other standard checks ] /* * make sure that the browser supports functionality we care * about. */ err = call...
...And 2 more matches
Building up a basic demo with A-Frame - Game development
it: <!doctype html> <html> <head> <meta charset="utf-8"> <title>mdn games: a-frame demo</title> <script src="aframe.min.js"></script> </head> <body> <!-- html goes here --> </body> </html> this contains some basic information like the document charset and <title>. the <script> element includes the a-frame framework in the page; we will write our example code inside the <body> element.
initializing the scene a scene is the place where everything happens. when creating new objects in the demo, we will be adding them all to the scene to make them visible on the screen. in a-frame, the scene is reperesented by a scene entity. note: an entity is any element — it can be an object like a box, cylinder or cone, but it can also be a camera, light or sound source. let's create the sce...
...ntities like <a-cube> — using <a-entity> we can create custom advanced shapes. let's try adding a torus — add this element below the previous code: <a-entity geometry=" primitive: torus; radius: 1; radiustubular: 0.1; segmentstubular: 12;" rotation="10 0 0" position="-3 1 0"> </a-entity> our entity has a torus primitive, which represents its shape. we are passing some
initial variables to that shape: the radius of the outer edge of the torus, the radius of the tube, and number of segments along the circumference of the tube face respectively. rotation and position are set in the same way as we saw earlier. defining a material the torus is now visible on the scene, but its color doesn't look very good — this is because we have to create a material to define the ...
... the illusion of animation. rotation there's a special <a-animation> entity that can help us animate elements. add the <a-animation> element seen below to the <a-box> element as a child, as shown: <a-box color="#0095dd" rotation="20 40 0" position="0 1 0"> <a-animation attribute="rotation" from="20 0 0" to="20 360 0" direction="alternate" dur="4000" repeat="indef
inite" easing="ease"> </a-animation> </a-box> as with any other entities, you can define key properties for the animation. we'll be animating the rotation attribute from 20 0 0 to 20 360 0, so it will do a full spin. the animation direction is set to alternate so the animation will be played forward, and then back. the duration is set to 4 seconds, and it will be repeated indef
initely. the ani...
...And 2 more matches
WAI-ARIA basics - Learn web development
and problems started to appear. for example, html5 introduced a number of semantic elements to define common page features (<nav>, <footer>, etc.) before these were available, developers would simply use <div>s with ids or classes, e.g. <div class="nav">, but these were problematic, as there was no easy way to easily find a specific page feature such as the main navigation programmatically. the
initial solution was to add one or more hidden links at the top of the page to link to the navigation (or whatever else), for example: <a href="#hidden" class="hidden">skip to navigation</a> but this is still not very precise, and can only be used when the screenreader is reading from the top of the page. as another example, apps started to feature complex controls like date pickers for choosing da...
... as a series of nested <div>s or table elements with classnames, which are then styled using css and controlled using javascript. the problem here is that visually they work, but screenreaders can't make any sense of what they are at all, and their users just get told that they can see a jumble of elements with no semantics to describe what they mean. enter wai-aria wai-aria (web accessibility
initiative - accessible rich internet applications) is a specification written by the w3c, defining a set of additional html attributes that can be applied to elements to provide additional semantics and improve accessibility wherever it is lacking. there are three main features defined in the spec: roles — these define what an element is or does. many of these are so-called landmark roles, which...
...he web page, except for the information exposed by the browser's accessibility apis (where screenreaders get their information from). wai-aria doesn't affect webpage structure, the dom, etc., although the attributes can be useful for selecting elements by css. note: you can find a useful list of all the aria roles and their uses, with links to futher information, in the wai-aria spec — see def
inition of roles. the spec also contains a list of all the properties and states, with links to further information — see def
initions of states and properties (all aria-* attributes). where is wai-aria supported? this is not an easy question to answer. it is difficult to find a conclusive resource that states what features of wai-aria are supported, and where, because: there are a lot of feat...
...And 2 more matches
Getting started with React - Learn web development
in mind that react and reactdom produce apps that only work on a fairly modern set of browsers — ie9+ by way of some polyfills. it is recommended that you use a modern browser like firefox, safari, or chrome when working through these tutorials. also, see the following for more information: "what is npm" on nodejs.org "introducing npx" on the npm blog the create-react-app documentation
initializing your app create-react-app takes one argument: the name you'd like to give your app. create-react-app uses this name to make a new directory, then creates the necessary files inside it. make sure you cd to the place you'd like your app to live on your hard drive, then run the following in your terminal: npx create-react-app moz-todo-react this creates a moz-todo-react directory, and doe...
...o live on your hard drive, then run the following in your terminal: npx create-react-app moz-todo-react this creates a moz-todo-react directory, and does several things inside it: installs some npm packages essential to the functionality of the app. writes scripts for starting and serving the application. creates a structure of files and directories that define the basic app architecture.
initializes the directory as a git repository, if you have git installed on your computer. note: if you have the yarn package manager installed, create-react-app will default to using it instead of npm. if you have both package managers installed and explicitly want to use npm, you can add the flag --use-npm when you run create-react-app: npx create-react-app moz-todo-react --use-npm create-reac...
...tea. when the process is complete, cd into the moz-todo-react directory and run the command npm start. the scripts installed by create-react-app will start being served at a local server at localhost:3000, and open the app in a new browser tab. your browser will display something like this: application structure create-react-app gives us everything we need to develop a react application. ...
...And 2 more matches
React interactivity: Events and state - Learn web development
o give our component some state. to use a react hook, we need to import it from the react module. in form.js, change your very first line so that it reads like this: import react, { usestate } from "react"; this allows us to import the usestate() function by itself, and utilize it anywhere in this file. usestate() creates a piece of state for a component, and its only parameter determines the
initial value of that state. it returns two things: the state, and a function that can be used to update the state later. this is a lot to take in at once, so let's try it out. we're going to make ourselves a name state, and a function for updating the name state. write the following above your handlesubmit() function, inside form(): const [name, setname] = usestate('use hooks!'); what's going on ...
...gs: the state, and a function that can be used to update the state later. this is a lot to take in at once, so let's try it out. we're going to make ourselves a name state, and a function for updating the name state. write the following above your handlesubmit() function, inside form(): const [name, setname] = usestate('use hooks!'); what's going on in this line of code? we are setting the
initial name value as "use hooks!". we are defining a function whose job is to modify name, called setname(). usestate() returns these two things, so we are using array destructuring to capture them both in separate variables. reading state you can see the name state in action right away. add a value attribute to the form’s input, and set its value to name. your browser will render "use hooks!"...
...g state you can see the name state in action right away. add a value attribute to the form’s input, and set its value to name. your browser will render "use hooks!" inside the input. <input type="text" id="new-todo-input" classname="input input__lg" name="text" autocomplete="off" value={name} /> change "use hooks!" to an empty string once you're done; this is what we want for our
initial state. const [name, setname] = usestate(''); reading user input before we can change the value of name, we need to capture a user's input as they type. for this, we can listen to the onchange event. let’s write a handlechange() function, and listen for it on the <input /> tag. // near the top of the `form` component function handlechange(e) { console.log("typing!"); } // down in the r...
...And 2 more matches
Deployment and next steps - Learn web development
a .gitignore 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@g...
...next we commit all the files to the local git repo, and then push those to the remote origin on gitlab. gitlab uses a built-in tool called gitlab ci/cd to build your site and publish it to the gitlab pages server. ...
...ngs > pages menu option. with this configuration, whenever you push changes to the gitlab repo, the application will be automatically rebuilt and deployed to gitlab pages. learning more about svelte in this section we'll give you some resources and projects to go and check out, to take your svelte learning further. svelte documentation to go further and learn more about svelte, you should def
initely visit the svelte homepage. there you'll find many articles explaining svelte's philosophy. if you haven't already done it, make sure you go through the svelte interactive tutorial. we already covered most of its content, so it won't take you much time to complete it — you should consider it as practise! you can also consult the svelte api docs and the available examples. to understand the ...
...And 2 more matches
Getting started with Svelte - Learn web development
it just renders the 'hello world!' message. main.js: the entry point to our application. it just instantiates the app component and binds it to the body of our html page. public: this directory contains all the files that will be published in production. favicon.png: this is the favicon for your app. currently, it's the svelte logo. index.html: this is the main page of your app.
initially it's just an empty html5 page that loads the css files and js bundles generated by svelte. global.css: this file contains unscoped styles. it's a regular css file that will be applied to the whole application. build: this folder contains the generated css and javascript source code. bundle.css: the css file that svelte generated from the styles defined for each component. ...
...hem? in svelte, css inside a component's <style> block will be scoped only to that component. this works by adding a class to selected elements, which is based on a hash of the component styles. you can see this in action by opening localhost:5000 in a new browser tab, right/ctrl-clicking on the hello world! label, and choosing inspect: when compiling the app, svelte changes our h1 styles def
inition to h1.svelte-1tky8bj, and then modifies every <h1> element in our component to <h1 class="svelte-1tky8bj">, so that it picks up the styles as required. note: you can override this behavior and apply styles to a selector globally using the :global(...) modifier (see the svelte <style> docs for more information). making a couple of changes now that we have a general idea of how it all fits ...
... the dom whenever the value of the name variable changes, without using any virtual dom or other complex reconciliation mechanism. note the use of : in on:click. that's svelte's syntax for listening to dom events. inspecting main.js: the entry point of our app let’s open src/main.js, which is where the app component is being imported and used. this file is the entry point for our app, and it
initially looks like this: import app from './app.svelte'; const app = new app({ target: document.body, props: { name: 'world' } }); export default app; main.js starts by importing the svelte component that we are going to use. then in line 3 it instantiates it, passing an option object with the following properties: target: the dom element inside which we want the component to be ren...
...And 2 more matches
Deploying our app - Learn web development
t to netlify each time we push to a github repo. it's exactly these kinds of connected services that we would encourage you to look for when deciding on your own build toolchain. we 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 extremely 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 de...
...e of this project you will need to host this project's code in your own git repository. our next step is to push the project to github. committing changes to github this section will get you over the line to storing your code in a git repository, but it is a far cry from a git tutorial. there’s many great tutorials and books available, and our git and github page is a good place to start. we
initialized our working directory as a git working directory earlier on. a quick way to verify this is to run the following command: git status you should get a status report of what files are being tracked, what files are staged, and so on — all terms that are part of the git grammar. if you get the error fatal: not a git repository returned, then the working directory is not a git working direct...
...tory as a git working directory earlier on. a quick way to verify this is to run the following command: git status you should get a status report of what files are being tracked, what files are staged, and so on — all terms that are part of the git grammar. if you get the error fatal: not a git repository returned, then the working directory is not a git working directory and you’ll need to
initialise git using git
init. now we have three tasks ahead of us: add any changes we’ve made to the stage (a special name for the place that git will commit files from). commit the changes to the repository. push the changes to github. to add changes, run the following command: git add . note the period at the end, it means “everything in this directory”. the git add . comma...
...And 2 more matches
Package management basics - Learn web development
to install parcel as a local tool, as best practices dictate. we'll install it as part of an experimental app. setting up the app as an npm package first of all, create a new directory to store our experimental app in, somewhere sensible that you’ll find again. ...
...just press return to accept the default parcel-experiment. version: the starting version number for the app: again, just press return to accept the default 1.0.0. description: a quick description of the app's purpose. ...
... parcel-experiment app; you won't be able to run it in a different directory. but the advantages outweigh the disadvantages. setting up our example app anyway, on with the setup. parcel expects an index.html and an index.js file to work with, but otherwise it is very unopinionated about how you structure your project. other tools can be very different, but at least parcel makes it easy for our
initial experiment. so now we need to add an index.html file to our working directory. create index.html in your test directory, and give it the following contents: <!doctype html> <html lang="en-us"> <head> <meta charset="utf-8"> <title>my test page</title> </head> <body> <script src="./index.js"></script> </body> </html> next, we need to add an index.js file in the same direct...
...And 2 more matches
Extras
255); stop-opacity:1;"/> <stop offset="100%" style="stop-color:rgb(255,0,0); stop-opacity:.8;"/> </radialgradient> </defs> <g transform="translate(15,15)"> <g> <animatetransform attributename="transform" attributetype="xml" type="rotate" from="360" to="0" dur="15s" repeatcount="indef
inite"/> <g transform="translate(-15, -15)"> <path fill="url(#radgrad1)" d="m 15 0 l 20 10 l 30 15 l 20 20 l 15 30 l 10 20 l 0 15 l 10 10"/> </g> </g> </g> </svg> </mtext> </mpadded> </msqrt> <mo>=</mo> <msubsup> <mo>∫</mo> <mn>0</mn> <mfrac> <mi>π</mi> <mn>2</mn> </mfrac> </msubsup> <msup> <mi>θ</mi> <mtext> <svg width="15px" height="15px"> <defs> <r...
...x="50%" cy="50%" r="50%" fx="50%" fy="50%"> <stop offset="0%" style="stop-color:rgb(255,255,255); stop-opacity:1;"/> <stop offset="100%" style="stop-color:rgb(0,0,255); stop-opacity:.9;"/> </radialgradient> </defs> <g> <animatemotion path="m0,0 l3,0 l2,5 l5,5 l0,4 l5,2 z" begin="0s" dur="0.5s" repeatcount="indef
inite"/> <circle fill="url(#radgrad2)" r="5px" cx="5px" cy="5px"/> </g> </svg> </mtext> </msup> <mrow> <mo>ⅆ</mo> <mi>θ</mi> </mrow> </math> <div style="width: 300px; margin-left: auto; margin-right: auto;"> <svg width="300px" height="250px"> <defs> <lineargradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%"> <stop offset="0%" style="stop-color:rgb(0,0,255);stop-opacity:1"/> <stop offset="100%" s...
...gb(0,255,255);stop-opacity:1"/> <stop offset="100%" style="stop-color:rgb(255,255,255);stop-opacity:.8"/> </radialgradient> </defs> <rect width="300" height="250" fill="url(#grad1)"/> <g transform="translate(150,125)"> <g> <animatetransform attributename="transform" attributetype="xml" type="rotate" from="0" to="360" dur="6s" repeatcount="indef
inite"/> <g transform="translate(-50,-35)"> <rect width="100" height="70" fill="url(#grad2)"/> <switch> <foreignobject width="100" height="70" requiredextensions="http://www.w3.org/1998/math/mathml"> <math display="block"> <mrow> <mo>(</mo> <mtable> <mtr> <mtd><mi>cos</mi><mi>θ</mi></mtd> <mtd><mo>−</mo><mi>sin</mi><mi>θ</mi></mtd> </mtr> <mtr> <mtd><mi>sin</mi><mi>θ</...
...And 2 more matches
AsyncTestUtils extended framework
this is likely to happen when i/o is involved or a potentially expensive process wants to break itself up into smaller chunks (like a search operation) so that the ui stays responsive. in the mozilla platform, the "top level" of a program is the event loop. it is a never-ending loop that dequeues pending events and runs them. this is how asynchronous ca...
...ace boilerplate just to call async_driver. if you have the following types of listeners you can use the following pre-defined helpers: nsiurllistener: asyncurllistener (predefined). if you need to wrap an existing url listener or need a callback or fancy promise, create an instance of asyncurllistener. copy listener: asynccopylistener. bringing messages into the picture synthetic set def
initions most of the code involved in creating synthetic messages takes an object that defines how to generate the set. the following is a list of frequently used attributes where the default value is listed after the attribute name. there are more attributes you can specify; consult the documentation for more information. (see the bottom of this page for links to the source files.) count: 10 the...
...uld 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 increment) 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 def
inition was {count: 3, age: {days: 7}, age_incr: {days: -1}}, then you would generate messages from 7, 6, and 5 days ago. subject: (automatically generated random subject) force all the messages to have the same subject you pass in. for example, {count: 1, subject: "my suitcase"} would result in a single message with the subject "my suitcase" with a random sender and random recipient. to: (automati...
...And 2 more matches
NSS 3.12.6 release notes
en upgraded. nss_ssl_require_safe_negotiation values: 1: requiresafenegotiation = true unset: requiresafenegotiation = false controls whether safe renegotiation indication is required for
initial handshake. if true, a connection will be dropped at
initial handshake if the peer server or client does not support safe renegotiation. the default setting for this option is false. these options can also be set with the following ssl options: ssloptions.enablerenegotiation ssloptions.requiresafenegotiation ...
... bug 527759: add multiple roots to nss (single patch) bug 528741: pkix_hash throws a null-argument exception on empty strings bug 530907: the peerid argument to ssl_setsockpeerid should be declared const bug 531188: decompression failure with https://livechat.merlin.pl/ ...
... bug 542538: nss: add function for recording ocsp stapled replies ...
...And 2 more matches
NSS 3.46 release notes
script does not set error exit code for tests that "failed with core" bug 1566601 - add wycheproof test vectors for aes-kw bug 1571316 - curve25519_32.c:280: undefined reference to `pr_assert' when building nss 3.45 on armhf-linux bug 1516593 - client to generate new random during renegotiation bug 1563258 - fips.sh fails due to non-existent "resp" directories bug 1561598 - remove -wmaybe-un
initialized warning in pqg.c bug 1560806 - increase softoken password max size to 500 characters bug 1568776 - output paths relative to repository in nss coverity bug 1453408 - modutil -changepw fails in fips mode if password is an empty string bug 1564727 - use a pss spki when possible for delegated credentials bug 1493916 - fix ppc64 inline assembler for clang bug 1561588 - remove -wmaybe-unin...
...hangs on windows x64 when building nss since changeset 9162c654d06915f0f15948fbf67d4103a229226f bug 1564875 - improve ...
...ve or fix -ddebug_$user from make builds bug 1565577 - visual studio's cl.exe -? ...
...And 2 more matches
sample2
/* this source code form is subject to the terms of the mozilla public * license, v. 2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. ...
...external file * * how this sample is different from sample 5 ? * * 1. as in sample 5, output is a pkcs#10 csr * 2. input and store a cert in cert db and also used to input, store and trust ca cert. * 3. like sample 5, but puts cert in header * 4. ...
...eak; case 'x': selfsign = pr_true; break; case 'm': serialnumberstr = strdup(optstate->value); serialnumber = atoi(serialnumberstr); break; case 't': truststr = strdup(optstate->value); break; case 'v': sigverify = pr_true; break; default: usage(progname); break; } } pl_destroyoptstate(optstate); if (cmd == unknown || !dbdir) usage(progname); /* open db for read/write and authenticate to it */ pr_
init(pr_user_thread, pr_priority_normal, 0);
initialized = pr_true; rv = nss_
initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_
initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata); if (rv != secsuccess) { pr_fprintf(pr_stderr, "could not auth...
...And 2 more matches
PKCS11 FAQ
) are handled by creating new sessions. if no new sessions are available, the one read-only session is used, and the state is saved and restored after each multipart operation. nss never uses parallel mode. nss opens new read/write sessions for key generation, some password management, and storage of new certificates. if your token is read/write and has only one session, nss will open that one
initial session read/write. what permanent pkcs #11 objects are used by nss or read from the token? example: rsa private key, ca certificate, user's own certificate, user's name. private keys (rsa and dsa) and the corresponding certificates are read from the token. other certificates on the token are also loaded (to allow building certificate chains), but it's not necessary to include the full chain...
...hread, which in turn opens up a new pkcs #11 session? this depends on the application. pkcs #11 sessions are cryptographic session states, independent of threads. in nss based servers, multiple threads may call the same session, but two threads will not call the same session at the same time. questions about keys and tokens is the pkcs #11 token treated in a read-only manner? that is, no token
init, no key gens, no data puts, no cert puts, etc.? if the token is marked read-only, then it will be treated as such. if the token is marked read/write and advertises that it can generate keys, nss uses the token (through pkcs #11) to generate the key and loads the user's certificate into the token. if the token is marked read/write and does not advertise that it can generate keys, nss generates th...
...he same application. nss explicitly depends on this semantic without the use of c_copyobject. if your module does not support this semantic, it will not work with nss. questions about pins will a password change ever be done on the token? yes, nss attempts to change the password in user mode only. ...
...And 2 more matches
NSS tools : modutil
name modutil - manage pkcs #11 module information within the security module database. synopsis modutil [options] [[arguments]] status this documentation is still work in progress. please contribute to the
initial review in mozilla nss bug 836477[1] description the security module database tool, modutil, is a command-line utility for managing pkcs #11 module information both within secmod.db files and within hardware tokens. modutil can add and delete pkcs #11 modules, change passwords on security databases, set defaults, list module contents, enable or disable slots, enable or disable fips 140-2 compliance, and assign default providers for cryptographic operations. this tool can also create certificate, key, and module security database files. the tasks associated with...
...util always requires one (and only one) option to specify the type of module operation. each option may take arguments, anywhere from none to multiple arguments. options -add modulename add the named pkcs #11 module to the database. use this option with the -libfile, -ciphers, and -mechanisms arguments. -changepw tokenname change the password on the named token. if the token has not been
initialized, this option
initializes the password. use this option with the -pwfile and -newpwfile arguments. a password is equivalent to a personal identification number (pin). -chkfips verify whether the module is in the given fips mode. true means to verify that the module is in fips mode, while false means to verify that the module is not in fips mode. -create create new certificate, key, ...
...d5:md2:ssl:tls:aes manufacturer: mozilla foundation type: software version number: 3.11 firmware version: 0.0 status: enabled token name: nss generic crypto services token manufacturer: mozilla foundation token model: nss 3 token serial number: 0000000000000000 token version: 4.0 token firmware version: 0.0 access: write protected login type: public (no login required) user pin: not
initialized slot: nss user private key and certificate services slot mechanism flags: none manufacturer: mozilla foundation type: software version number: 3.11 firmware version: 0.0 status: enabled token name: nss certificate db token manufacturer: mozilla foundation token model: nss 3 token serial number: 0000000000000000 token version: 8.3 token firmware version: 0.0 access: not write ...
...And 2 more matches
JS_DefineFunctions
add native methods to an object. syntax bool js_definefunctions(jscontext *cx, js::handle<jsobject*> obj, const jsfunctionspec *fs, propertydef
initionbehavior behavior = defineallproperties); in spidermonkey versions prior to spidermonkey 24, fs was not const. name type description cx jscontext * the context in which to define functions. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handle<jsobject*> the object on which functions are to be defined. ...
...hich to define functions. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handle<jsobject*> the object on which functions are to be defined. fs const jsfunctionspec * a null-terminated array of function specifications. each element of the array defines an individual function. behavior propertydef
initionbehavior see below. added in spidermonkey 38 enum propertydef
initionbehavior { defineallproperties, onlydefinelateproperties, dontdefinelateproperties }; name description defineallproperties define all properties regardless of their flags. onlydefinelateproperties define only properties which have a jsprop_define_late flag. do...
...roperties define only properties which have no jsprop_define_late flag. description js_definefunctions creates zero or more functions and makes them properties (methods) of a specified object, obj, as if by calling js_definefunction repeatedly. fs is a pointer to the first element of an array of jsfunctionspec records. this array is usually defined as a static global, with each record
initialized using js_fs or js_fn. each array element defines a single function: its name, the native c/c++ implementation, the number of javascript arguments the function expects, and any property attributes. the last element of the array must contain 0 values. (the macro js_fs_end can be used for the last element.) js_definefunctions creates one function for each non-zero element in the array. prope...
...And 2 more matches
Web Replay
ther recording. save recording and replay on a different machine (partially implemented) recordings can be replayed on a different machine from the one which recorded them. this requires using the same build of firefox and a reasonably similar version of the operating system; otherwise the tab will probably crash. this feature has had little testing or polishing and there is not yet a good def
inition of 'reasonably similar'. time travel features this section describes extensions to the developer tools that use time travel to help debug a recording/replaying tab. step back when paused, the reverse step button in the debugger developer tool will step to the previous line executed and allow inspecting program state there. it is the opposite of the normal forward step button. rewind to...
...d replaying children is that by switching between different children the middleman can effectively rewind a live recording, then play forward and allow the user to resume interacting with the tab after they have finished inspecting state in the past. the advantage of using two replaying processes is to provide a smoother experience when rewinding. recording/replaying process extensions during
initialization the child process spawns a thread that does not participate in the recording — any ipc or other system calls it performs are live, even when replaying. this thread sends and receives messages from the middleman. messages describe actions the child process is able to do independently from the recording; currently this includes sending graphics updates, taking and restoring process sn...
...an be rewound to an earlier state in response to a message from the middleman. after a recording process rewinds, it becomes a replaying process. rewinding happens by periodically taking memory snapshots during execution, and then later restoring them. care must be taken for efficiency when taking/restoring snapshots and for managing system resources when restoring. snapshots late in process
initialization the first snapshot is taken, which is simply a copy of the stacks/registers for each thread. each subsequent snapshot includes copies of thread stacks/registers as well as a diff containing the original contents of all pages of heap and static memory that were modified since the previous snapshot. certain memory regions are excluded from snapshots; these memory regions are allocated w...
...And 2 more matches
How to build an XPCOM component in JavaScript
n download an old version of xpcomviewer that works with firefox 1.5 from mozdev mirrors. if an interface exists that meets your needs, then you do not need to write an idl, or compile a typelib, and may skip to the next section. if you don't find a suitable pre-existing interface, then you must define your own. xpcom uses a dialect of idl to define interfaces, called xpidl. ...
...the compilation can be done using the gecko sdk. you can learn how to get mac, linux, and windows versions of the gecko sdk by reading the article gecko sdk. ...
...vents \ $(null) creating the component using xpcomutils in firefox 3 and later you can use import xpcomutils.jsm using components.utils.import to simplify the process of writing your component slightly. the imported library contains functions for generating the module, factory, and the nsgetmodule and queryinterface functions for you. note: it doesn't do the work of creating your interface def
inition file or the type library for you, so you still have to go through those steps above if they haven't been done. the library provides a simple example of its use in the source code (js/xpconnect/loader/xpcomutils.jsm), but here's another using this example. to begin, include a line at the top of your interface to import the xpcomutils library: components.utils.import("resource://gre/modules/xpc...
...And 2 more matches
Building the WebLock UI
the weblock component and use its interfaces to control the web locking of the browser. first of all, it's important to be able to represent the basic state of the lock as soon as it's loaded. like the secure page icon, the weblock icon that appears in the lower right corner of the browser should indicate whether the browser is currently locked or unlocked. ...
..., the weblock icon that appears in the lower right corner of the browser should indicate whether the browser is currently locked or unlocked. since the weblock component is always
initialized as unlocked, we can have the client code - the javascript code in the interface - represent this state and track it as the user manipulates the iweblock interface. ...
...tion wlock() { // check to see if locking is on or off weblock.lock(); wlocked = 1; } function wunlock() { // check to see if locking is on or off weblock.unlock(); wlocked = 0; } an important preliminary of these functions is that the weblock component be made available to the javascript in the form of the weblock object being used in the snippets above. as you can see, weblock is
initialized as a global javascript variable, available in the scope of these functions and others: var weblock = components.classes["@dougt/weblock"] .getservice() .queryinterface(components.interfaces.iweblock); in addition to this basic setup, you must also write javascript that uses the addsite method to add new sites to the white list. this is a b...
...And 2 more matches
Packaging WebLock
the installation archive (i.e., weblock.xpi) itself. ...
...ck trigger script), the installation script: downloads the weblock component and places it in the components directory copies the weblock subdirectory in the mozilla chrome application subdirectory registers both the component and the ui the xpinstall api provides such essential methods[essential-methods] as
initinstall, registerchrome, addfile, and others. ...
...cript: downloads the weblock component and places it in the components directory copies the weblock subdirectory in the mozilla chrome application subdirectory registers both the component and the ui the xpinstall api provides such essential methods[essential-methods] as
initinstall, registerchrome, addfile, and others. ...
...And 2 more matches
Detailed XPCOM hashtable guide
an entry struct type, deriving from pldhashentryhdr. this entry struct should contain whatever data you wish to store in the hashtable (any pointer or fixed-length data type). note: because of the double-hashing implementation, entries may move in memory when the hashtable is altered. if you need entry pointers to remain constant, you may want to consider using plhashtable instead. you must also
initialize a pldhashtableops structure. this serves similarly to a vtable in c++, with pointers to appropriate user-defined functions that
initialize, compare, and match entries. because pldhash does not know what datatype your key is, all functions that work with keys are declared using const void*, and your client code must cast these pointers to the appropriate type. pldhashtables can be allocated...
... plhashtable plhashtable is a part of nspr. the header file can be found at nsprpub/lib/ds/plhash.h. ...
... plhashtable plhashtable is a part of nspr. the header file can be found at nsprpub/lib/ds/plhash.h. in general, pldhash is a better solution than plhashtable, because plhashtable makes many heap allocations. ...
...And 2 more matches
nsIHttpServer
= parseint(port); server.identity.add('http', host, port); } server.wrappedjsobject._start(port, host); return true; }, registerfile: function(path, filepath) { var file = components.classes['@mozilla.org/file/local;1'] .createinstance(components.interfaces.nsilocalfile); file.
initwithpath(filepath); return server.registerfile(path, file); }, registerdirectory : function(path, directorypath) { var file = components.classes['@mozilla.org/file/local;1'] .createinstance(components.interfaces.nsilocalfile); file.
initwithpath(directorypath); return server.registerdirectory(path, file); ...
... } } reference : mozilla-release/netwerk/test/httpserver/nsihttpserver.idl [scriptable, uuid(cea8812e-faa6-4013-9396-f9936cbb74ec)] interface nsihttpserver : nsisupports { /** * starts up this server, listening upon the given port. ...
...lable from the metadata object passed to the * handler, under the key "directory". */ void setindexhandler(in nsihttprequesthandler handler); /** represents the locations at which this server is reachable. */ readonly attribute nsihttpserveridentity identity; /** * retrieves the string associated with the given key in this, for the given * path's saved state. all keys are
initially associated with the empty * string. */ astring getstate(in astring path, in astring key); /** * sets the string associated with the given key in this, for the given path's * saved state. */ void setstate(in astring path, in astring key, in astring value); /** * retrieves the string associated with the given key in this, in * entire-server saved state. all keys...
...And 2 more matches
nsIServerSocket
cket.idlscriptable please add a summary to this article. last changed in gecko 1.6 inherits from: nsisupports implemented by: @mozilla.org/network/server-socket;1. ...
... gecko 1.6 inherits from: nsisupports implemented by: @mozilla.org/network/server-socket;1. to create an instance, use: var serversocket = components.classes["@mozilla.org/network/server-socket;1"] .createinstance(components.interfaces.nsiserversocket); method overview void
init(in long aport, in boolean aloopbackonly, in long abacklog); void
initwithaddress([const] in prnetaddrptr aaddr, in long abacklog);native code only! void close(); void asynclisten(in nsiserversocketlistener alistener); prnetaddr getaddress();native code only! attributes attribute type description port long returns the port of this server socket. read only. methods asynclisten() this method put...
... network device. in the case of an ip socket, the ip address field would be zeroed out to indicate a server socket bound to all network devices. therefore, this method cannot be used to determine the ip address of the local system. see nsidnsservice.myhostname() if this is what you need. prnetaddr getaddress(); parameters none. return value the network address to which the socket is bound.
init()
initializes a server socket. void
init( in long aport, in boolean aloopbackonly, in long abacklog ); parameters aport the port of the server socket. pass -1 to indicate no preference, and a port will be selected automatically. aloopbackonly if true, the server socket will only respond to connections on the local loopback interface. otherwise, it will accept connections from any ...
...And 2 more matches
nsIUpdateItem
item managed by the extension system, providing metadata describing the item. 1.0 66 introduced gecko 1.8 obsolete gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface is obsolete; instead of using the extension manager, you should use the addon manager. ...
...te manifests for this add-on. read only. updaterdf astring the url of the update rdf file for this item. read only. version astring the version of the item, in fvf format. read only. xpihash astring the string hash for the xpi file. can be null and if supplied must be in the format of "type:hash" (see the types in nsicryptohash and nsixpinstallmanager.
initmanagerwithhashes(). read only. xpiurl astring the url of the xpi where this item can be downloaded. read only. constants item type constants constants representing types of update checks. constants that callers can use to indicate the reason for an add-on update check. internal code uses other constants in nsextensionmanager.js.in. constant gecko version de...
... version the ...
...And 2 more matches
nsIZipReader
getinputstream(in autf8string zipentry); nsiinputstream getinputstream(in string zipentry); obsolete since gecko 10 nsiinputstream getinputstreamwithspec(in autf8string ajarspec, in autf8string zipentry); nsiinputstream getinputstreamwithspec(in autf8string ajarspec, in string zipentry); obsolete since gecko 10 boolean hasentry(in autf8string zipentry); void
init(in nsifile zipfile); obsolete since gecko 1.9 void open(in nsifile zipfile); void openinner(in nsizipreader zipreader, in autf8string zipentry); void openinner(in nsizipreader zipreader, in string zipentry); obsolete since gecko 10 void test(in autf8string aentryname); void test(in string aentryname); obsolete since gecko 10 attributes attrib...
...read only. manifestentriescount pruint32 the number of entries in the manifest. read only. methods close() closes a zip reader. subsequent attempts to extract() files or read from its input stream will result in an error. subsequent attempts to access a nsizipentry obtained from this zip reader will cause unspecified behavior. void close(); parameters none. ...
...ame of the entry to open() the stream from. return value the nsiinputstream containing the contents of the specified zip entry. hasentry() checks whether the zipfile contains an entry specified by zipentry. boolean hasentry( in autf8string zipentry ); parameters zipentry the zip entry. return value boolean value, true if the zip entry exists, false is it does not exist. ...
...And 2 more matches
AudioWorkletNodeOptions - Web APIs
hen constructing a new audioworkletnode object for custom audio processing. it is only used when calling the audioworkletnode() constructor. during internal instantiation of the underlying audioworkletprocessor, the the structured clone algorithm is applied to the options object and the result is passed into audioworkletprocessor's constructor. properties numberofinputs optional the value to
initialize the numberofinputs property to. defaults to 1. numberofoutputs optional the value to
initialize the numberofoutputs property to. defaults to 1. outputchannelcount optional an array defining the number of channels for each output. for example, outputchannelcount: [n, m] specifies the number of channels in the first output to be n and the second output to be m. the array length must match...
...ts optional the value to
initialize the numberofoutputs property to. defaults to 1. outputchannelcount optional an array defining the number of channels for each output. for example, outputchannelcount: [n, m] specifies the number of channels in the first output to be n and the second output to be m. the array length must match numberofoutputs. parameterdata optional an object containing the
initial values of custom audioparam objects on this node (in its parameters property), with key being the name of a custom parameter and value being its
initial value. processoroptions optional any additional data that can be used for custom
initialization of the underlying audioworkletprocessor. usage notes when creating an audioworkletnode, these options can have various effects. if the number ...
...tions can have various effects. if the number of inputs and number of outputs are both set to 0, a notsupportederror will be thrown and the node construction process aborted. if the length of the outputchannelcount array doesn't match numberofoutputs, an indexsizeerror will be thrown. if outputchannelcount isn't specified, and numberofinputs and numberofoutputs are both 1, the audioworkletnode's
initial channel count is set to 1. this has the effect of changing the output channel count to dynamically change to the computed number of channels, based on the input's channel count and the current setting of the audionode property channelcountmode. otherwise, if outputchannelcount is provided and if the values of numberofinputs and numberofoutputs are both 1, the audio worklet node's channel coun...
...And 2 more matches
AudioWorkletProcessor() - Web APIs
ally by the creation of an associated audioworkletnodes. var processor = new audioworkletprocessor(options); parameters options an object that is passed as options parameter to audioworkletnode constructor and passed through the structured clone algorithm. the object is based on audioworkletnodeoptions dictionary. available properties are as follows: numberofinputs optional the value to
initialize the numberofinputs property to. defaults to 1. numberofoutputs optional the value to
initialize the numberofoutputs property to. defaults to 1. outputchannelcount optional an array defining the number of channels for each output. for example, outputchannelcount: [n, m] specifies the number of channels in the first output to be n and the second output to be m. the array length must match...
...ts optional the value to
initialize the numberofoutputs property to. defaults to 1. outputchannelcount optional an array defining the number of channels for each output. for example, outputchannelcount: [n, m] specifies the number of channels in the first output to be n and the second output to be m. the array length must match numberofoutputs. parameterdata optional an object containing the
initial values of custom audioparam objects on this node (in its parameters property), with key being the name of a custom parameter and value being its
initial value. processoroptions optional any additional data that can be used for custom
initialization of the underlying audioworkletprocessor. note that there are default values for the first two properties, so even if there are no options object ...
... ...
...And 2 more matches
CSS - Web APIs
) can be used to escape a string mostly for use as part of a css selector. css factory functions can be used to return a new cssunitvalue with a value of the parameter number of the units of the name of the factory function method used. ...
...value of the parameter number of the units of the name of the factory function method used. css.em(3) // cssunitvalue {value: 3, unit: "em"} specifications specification status comment css painting api level 1the def
inition of 'paintworklet' in that specification. working draft adds the paintworklet static property. ...
... specifications specification status comment css painting api level 1the def
inition of 'paintworklet' in that specification. working draft adds the paintworklet static property. css object model (cssom)the def
inition of 'css' in that specification. working draft adds the escape() static method. ...
...And 2 more matches
DOMMatrix() - Web APIs
example this example creates a dommatrix to use as an argument for calling point.matrixtransform(). ...
... example this example creates a dommatrix to use as an argument for calling point.matrixtransform(). ...
... ...
...And 2 more matches
DOMPoint.w - Web APIs
the dompoint interface's w property holds the point's perspective value, w, for a point in space. syntax var perspective = dompoint.w; value a double-precision floating-point value indicating the w perspective value for the point. ...
... the dompoint interface's w property holds the point's perspective value, w, for a point in space. syntax var perspective = dompoint.w; value a double-precision floating-point value indicating the w perspective value for the point. ...
...ce. syntax var perspective = dompoint.w; value a double-precision floating-point value indicating the w perspective value for the point. this value is unrestricted, meaning that it is allowed to be inf
inite or invalid (that is, its value may be nan or ±inf
inity). the default is 1.0. ...
...And 2 more matches
DOMPoint.x - Web APIs
coordinate, x, for a point in space. in general, positive values x mean to the right, and negative values of x means to the left, barring any transforms that may have altered the orientation of the axes. ...
...ve values x mean to the right, and negative values of x means to the left, barring any transforms that may have altered the orientation of the axes. ...
... the orientation of the axes. syntax var xpos = dompoint.x; value a double-precision floating-point value indicating the x coordinate's value for the point. ...
...And 2 more matches
DOMPoint.y - Web APIs
ompoint interface's y property holds the vertical coordinate, y, for a point in space. unless transforms have been applied to alter the orientation, the value of y increases downward and decreases upward. ...
...nate, y, for a point in space. unless transforms have been applied to alter the orientation, the value of y increases downward and decreases upward. ...
...ownward and decreases upward. syntax var ypos = dompoint.y; value a double-precision floating-point value indicating the y coordinate's value for the point. ...
...And 2 more matches
DOMPoint.z - Web APIs
have changed the orientation, a z of 0 is the plane of the screen, with positive values extending outward toward the user from the screen, and negative values receding into the distance behind the screen. ...
...he screen, with positive values extending outward toward the user from the screen, and negative values receding into the distance behind the screen. ...
...e distance behind the screen. syntax var zpos = dompoint.z; value a double-precision floating-point value indicating the z coordinate's value for the point. ...
...And 2 more matches
DOMPointReadOnly.w - Web APIs
holds the point's perspective value, w, for a read-only point in space. if your script needs to be able to change the value of this property, you should instead use the dompoint object. ...
...point in space. if your script needs to be able to change the value of this property, you should instead use the dompoint object. syntax const perspective = somedompointreadonly.w value a double-precision floating-point value indicating the w perspective value for the point. ...
...t perspective = somedompointreadonly.w value a double-precision floating-point value indicating the w perspective value for the point. this value is unrestricted, meaning that it is allowed to be inf
inite or invalid (that is, its value may be nan or ±inf
inity). the default is 1.0. ...
...And 2 more matches
DOMPointReadOnly.x - Web APIs
is read-only version of the dompoint object. in general, positive values x mean to the right, and negative values of x means to the left, assuming no transforms have resulted in a reversal. ...
..., positive values x mean to the right, and negative values of x means to the left, assuming no transforms have resulted in a reversal. ...
...a reversal. syntax const xpos = somedompointreadonly.x; value a double-precision floating-point value indicating the x coordinate's value for the point. ...
...And 2 more matches
DOMPointReadOnly.y - Web APIs
operty, you should instead use the dompoint object. in general, positive values of y mean downward, and negative values of y mean upward, assuming no transforms have resulted in a reversal. ...
...general, positive values of y mean downward, and negative values of y mean upward, assuming no transforms have resulted in a reversal. ...
...a reversal. syntax const ypos = somedompointreadonly.y; value a double-precision floating-point value indicating the y coordinate's value for the point. ...
...And 2 more matches
DOMPointReadOnly.z - Web APIs
eral, positive values of z mean toward the user (out from the screen), and negative values of z mean away from the user (into the screen), assuming no transforms have resulted in a reversal. ...
...m the screen), and negative values of z mean away from the user (into the screen), assuming no transforms have resulted in a reversal. ...
...a reversal. syntax const zpos = somedompointreadonly.z; value a double-precision floating-point value indicating the z coordinate's value for the point. ...
...And 2 more matches
DocumentFragment - Web APIs
javascript var list = document.queryselector('#list') var fruits = ['apple', 'orange', 'banana', 'melon'] var fragment = new documentfragment() fruits.foreach(function (fruit) { var li = document.createelement('li') li.innerhtml = fruit fragment.appendchild(li) }) list.appendchild(fragment) result specifications specification status comment domthe def
inition of 'documentfragment' in that specification. living standard added the constructor and the implementation of parentnode. selectors api level 1the def
inition of 'documentfragment' in that specification. obsolete added the queryselector() and queryselectorall() methods. document object model (dom) level 3 core specificationthe def
inition of 'documentfragment' in tha...
...ion of 'documentfragment' in that specification. obsolete added the queryselector() and queryselectorall() methods. document object model (dom) level 3 core specificationthe def
inition of 'documentfragment' in that specification. obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe def
inition of 'documentfragment' in that specification. ...
...n of 'documentfragment' in that specification. obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe def
inition of 'documentfragment' in that specification. ...
...And 2 more matches
DocumentType - Web APIs
l 4.01//en", empty string for html5. documenttype.systemid read only a domstring, eg "http://www.w3.org/tr/html4/strict.dtd", empty string for html5. methods inherits methods from its parent, node, and implements the childnode interface. childnode.remove() removes the object from its parent children list. specifications specification status comment domthe def
inition of 'documenttype' in that specification. living standard added implemention of the childnode interface. removed the internalsubset, entities, and notation properties. document object model (dom) level 3 core specificationthe def
inition of 'documenttype' in that specification. obsolete no change from document object model (dom) level 2 core specification. docume...
...standard added implemention of the childnode interface. removed the internalsubset, entities, and notation properties. document object model (dom) level 3 core specificationthe def
inition of 'documenttype' in that specification. obsolete no change from document object model (dom) level 2 core specification. document object model (dom) level 2 core specificationthe def
inition of 'documenttype' in that specification. ...
...e def
inition of 'documenttype' in that specification. obsolete no change from document object model (dom) level 2 core specification. document object model (dom) level 2 core specificationthe def
inition of 'documenttype' in that specification. obsolete added the publicid, systemid, and internalsubset properties. document object model (dom) level 1 specificationthe def
inition of 'documenttype' in that specification. ...
...And 2 more matches
DragEvent() - Web APIs
ctor is used to create a synthetic dragevent object. although this interface has a constructor, it is not possible to create a useful datatransfer object from script, since datatransfer objects have a processing and security model that is coordinated by the browser during drag-and-drops. this interface inherits properties from mouseevent and event. syntax event = new dragevent(type, dragevent
init); arguments type is a domstring representing the name of the event (see dragevent event types). dragevent
initoptional is a dragevent
init dictionary, having the following fields: "datatransfer", optional and defaults to "null". the type is datatransfer. the dragevent
init dictionary inherits from the mouseevent
init dictionary. specifications specification status ...
...ting the name of the event (see dragevent event types). dragevent
initoptional is a dragevent
init dictionary, having the following fields: "datatransfer", optional and defaults to "null". the type is datatransfer. the dragevent
init dictionary inherits from the mouseevent
init dictionary. specifications specification status comment html living standardthe def
inition of 'dragevent' in that specification. ...
...ent
init dictionary, having the following fields: "datatransfer", optional and defaults to "null". the type is datatransfer. the dragevent
init dictionary inherits from the mouseevent
init dictionary. specifications specification status comment html living standardthe def
inition of 'dragevent' in that specification. living standard html 5.1the def
inition of 'dragevent' in that specification. ...
...And 2 more matches
DragEvent - Web APIs
applications are free to interpret a drag and drop interaction in an application-specific way. this interface inherits properties from mouseevent and event. properties dragevent.datatransfer read only the data that is transferred during a drag and drop interaction. ...
...ver event. globaleventhandlers.ondragstart a global event handler for the dragstart event. globaleventhandlers.ondrop a global event handler for the drop event. ...
...globaleventhandlers.ondrop a global event handler for the drop event. ...
...And 2 more matches
Element.className - Web APIs
ute and element.setattribute if you are dealing with svg elements. however, take into account that element.getattribute returns null instead of "" if the element has an empty class attribute. elm.setattribute('class', elm.getattribute('class')) the class is an html attribute, while the classname is a dom property. ...
... element.getattribute returns null instead of "" if the element has an empty class attribute. elm.setattribute('class', elm.getattribute('class')) the class is an html attribute, while the classname is a dom property. ...
...ass')) the class is an html attribute, while the classname is a dom property. specifications specification status comment domthe def
inition of 'element.classname' in that specification. living standard dom4the def
inition of 'element.classname' in that specification. ...
...And 2 more matches
Element.getAttributeNS() - Web APIs
obsolete specifies that a not_supported_err exception is thrown if the ua does not support the "xml" feature. also specifies that null must be passed to have no namespace. d...
...etattributens getattributenode getattributenodens hasattribute (dom 2) hasattributens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe def
inition of 'element.getattributens()' in that specification. living standard document object model (dom) level 3 core specificationthe def
inition of 'element.getattributens()' in that specification. ...
...living standard document object model (dom) level 3 core specificationthe def
inition of 'element.getattributens()' in that specification. obsolete specifies that a not_supported_err exception is thrown if the ua does not support the "xml" feature. also specifies that null must be passed to have no namespace. ...
...And 2 more matches
Element.getElementsByTagName() - Web APIs
er-case should be used. example // check the status of each data cell in a table const table = document.getelementbyid('forecast-table'); const cells = table.getelementsbytagname('td'); for (let cell of cells) { let status = cell.getattribute('data-status'); if (status === 'open') { // grab the data } } specifications specification status comment domthe def
inition of 'element.getelementsbytagname()' in that specification. living standard changed the return value from nodelist to htmlcollection document object model (dom) level 3 core specificationthe def
inition of 'element.getelementsbytagname()' in that specification. obsolete no change from document object model (dom) level 2 core specification document object model (dom)...
...me()' in that specification. living standard changed the return value from nodelist to htmlcollection document object model (dom) level 3 core specificationthe def
inition of 'element.getelementsbytagname()' in that specification. obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe def
inition of 'element.getelementsbytagname()' in that specification. ...
...agname()' in that specification. obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe def
inition of 'element.getelementsbytagname()' in that specification. ...
...And 2 more matches
Event.eventPhase - Web APIs
"bubbling" : "error"; divinfo.innerhtml += e.currenttarget.id + "; eventphase: " + level + "<br/>"; } function clear() { for (let i = 0; i < divs.length; i++) { if (divs[i].id != "divinfo") { divs[i].style.backgroundcolor = (i & 1) ? ...
...<br/>"; } function clear() { for (let i = 0; i < divs.length; i++) { if (divs[i].id != "divinfo") { divs[i].style.backgroundcolor = (i & 1) ? ...
...r = (i & 1) ? ...
...And 2 more matches
Event.stopPropagation() - Web APIs
inks are still processed. if you want to stop those behaviors, see the preventdefault() method. syntax event.stoppropagation(); parameters none. return value undefined. examples see example 5: event propagation in the examples chapter for a more detailed example of this method and event propagation in the dom. ...
... event.stoppropagation(); parameters none. return value undefined. examples see example 5: event propagation in the examples chapter for a more detailed example of this method and event propagation in the dom. ...
...re detailed example of this method and event propagation in the dom. specifications specification status comment domthe def
inition of 'event.stoppropagation()' in that specification. living standard dom4the def
inition of 'event.stoppropagation()' in that specification. ...
...And 2 more matches
FederatedCredential - Web APIs
browser compatibility the compatibility table in this page is generated from structured data. ...
... browser compatibility the compatibility table in this page is generated from structured data. ...
... browser compatibility the compatibility table in this page is generated from structured data. ...
...And 2 more matches
Fetch API - Web APIs
the fetch api provides an interface for fetching resources (including across the network). it will seem familiar to anyone who has used xmlhttprequest, but the new api provides a more powerful and flexible feature set. concepts and usage fetch provides a generic def
inition of request and response objects (and other things involved with network requests). this will allow them to be used wherever they are needed in the future, whether it’s for service workers, cache api, and other similar things that handle or modify requests and responses, or any kind of use case that might require you to generate your responses programmatically (that is, the use of computer program or personal programming instructions). it also defines related concepts such as cors and the http origin header semantics, s...
...hether it’s for service workers, cache api, and other similar things that handle or modify requests and responses, or any kind of use case that might require you to generate your responses programmatically (that is, the use of computer program or personal programming instructions). it also defines related concepts such as cors and the http origin header semantics, supplanting their separate def
initions elsewhere. for making a request and fetching a resource, use the windoworworkerglobalscope.fetch() method. it is implemented in multiple interfaces, specifically window and workerglobalscope. this makes it available in pretty much any context you might want to fetch resources in. the fetch() method takes one mandatory argument, the path to the resource you want to fetch. it returns a promis...
...s implemented in multiple interfaces, specifically window and workerglobalscope. this makes it available in pretty much any context you might want to fetch resources in. the fetch() method takes one mandatory argument, the path to the resource you want to fetch. it returns a promise that resolves to the response to that request, whether it is successful or not. you can also optionally pass in an
init options object as the second argument (see request). once a response is retrieved, there are a number of methods available to define what the body content is and how it should be handled (see body). you can create a request and response directly using the request() and response() constructors, but it's uncommon to do this directly. instead, these are more likely to be created as results of othe...
...And 2 more matches
GlobalEventHandlers.onpointercancel - Web APIs
ents. syntax targetelement.onpointercancel = cancelhandler; var cancelhandler = targetelement.onpointercancel; value cancelhandler the pointercancel event handler for element targetelement. example this example shows two ways to use onpointercancel to handle an element's pointercancel events. ...
... cancelhandler the pointercancel event handler for element targetelement. example this example shows two ways to use onpointercancel to handle an element's pointercancel events. <html> <script> function cancelhandler(ev) { // process the pointercancel event } function
init() { var el = document.getelementbyid('target1'); el.onpointercancel = cancelhandler; } </script> <body onload="
init();"> <div id="target1"> touch me ... </div> <div id="target2" onpointercancel="cancelhandler(event)"> touch me ... ...
...cancel event } function
init() { var el = document.getelementbyid('target1'); el.onpointercancel = cancelhandler; } </script> <body onload="
init();"> <div id="target1"> touch me ... </div> <div id="target2" onpointercancel="cancelhandler(event)"> touch me ... </div> </body> </html> specifications specification status comment pointer events – level 2the def
inition of 'onpointercancel' in that specification. recommendation non-stable version pointer eventsthe def
inition of 'onpointercancel' in that specification. ...
...And 2 more matches
GlobalEventHandlers.onpointerdown - Web APIs
this event can be sent to window, document, and element objects. this is functionally equivalent to the mousedown event when generated due to user activity with a mouse or mouse-compatible device. if the pointerdown event isn't canceled through a call to preventdefault(), most user agents will fire a mousedown event, so that sites not using pointer events will work. you can also use addeventlistener() to add a listener for pointerdown events. ...
... cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; } result the resulting output is shown below. ...
...} result the resulting output is shown below. try tapping, clicking, or touching the box and see what happens. for full effect, try it with a variety of pointer types. ...
...And 2 more matches
GlobalEventHandlers.onpointerenter - Web APIs
ter events. syntax targetelement.onpointerenter = enterhandler; var enterhandler = targetelement.onpointerenter; value enterhandler the pointerenter event handler for element targetelement. example this example shows two ways to use onpointerenter to set an element's pointerenter event handler. ...
...alue enterhandler the pointerenter event handler for element targetelement. example this example shows two ways to use onpointerenter to set an element's pointerenter event handler. <html> <script> function enterhandler(ev) { // process the pointerenter event } function
init() { let el = document.getelementbyid('target1'); el.onpointerenter = enterhandler; } </script> <body onload="
init();"> <div id="target1"> touch me ... </div> <div id="target2" onpointerenter="enterhandler(event)"> touch me ... ...
...interenter event } function
init() { let el = document.getelementbyid('target1'); el.onpointerenter = enterhandler; } </script> <body onload="
init();"> <div id="target1"> touch me ... </div> <div id="target2" onpointerenter="enterhandler(event)"> touch me ... </div> </body> </html> specifications specification status comment pointer events – level 2the def
inition of 'onpointerenter' in that specification. recommendation non-stable version pointer eventsthe def
inition of 'onpointerenter' in that specification. ...
...And 2 more matches
GlobalEventHandlers.onpointerleave - Web APIs
target.onpointerleave = leavehandler; var leavehandler = eventtarget.onpointerleave; value leavehandler the eventlistener which will be invoked to handle pointerleave events sent to the target. example this example shows two ways to use onpointerleave to set an element's pointerleave event handler. <html> <script> function leavehandler(ev) { // process the pointerleave event } function
init() { var el=document.getelementbyid("target1"); el.onpointerleave = leavehandler; } </script> <body onload="
init();"> <div id="target1"> touch me ... </div> <div id="target2" onpointerleave="leavehandler(event)"> touch me ... </div> </body> </html> see using pointer events for additional details. specifications specification status comment pointer events – level...
... el=document.getelementbyid("target1"); el.onpointerleave = leavehandler; } </script> <body onload="
init();"> <div id="target1"> touch me ... </div> <div id="target2" onpointerleave="leavehandler(event)"> touch me ... </div> </body> </html> see using pointer events for additional details. specifications specification status comment pointer events – level 2the def
inition of 'onpointerleave' in that specification. ...
...arget1"> touch me ... </div> <div id="target2" onpointerleave="leavehandler(event)"> touch me ... </div> </body> </html> see using pointer events for additional details. ...
...And 2 more matches
GlobalEventHandlers.onpointermove - Web APIs
s pointermove events. syntax targetelement.onpointermove = movehandler; var movehandler = targetelement.onpointermove; value movehandler the pointermove event handler for element targetelement. example this example shows two ways to use onpointermove to set an element's pointermove event handler. ...
...rmove; value movehandler the pointermove event handler for element targetelement. example this example shows two ways to use onpointermove to set an element's pointermove event handler. <html> <script> function movehandler(ev) { // process the pointermove event } function
init() { let el=document.getelementbyid('target1'); el.onpointermove = movehandler; } </script> <body onload="
init();"> <div id="target1"> touch me ... </div> <div id="target2" onpointermove="movehandler(event)"> touch me ... ...
... the pointermove event } function
init() { let el=document.getelementbyid('target1'); el.onpointermove = movehandler; } </script> <body onload="
init();"> <div id="target1"> touch me ... </div> <div id="target2" onpointermove="movehandler(event)"> touch me ... </div> </body> </html> specifications specification status comment pointer events – level 2the def
inition of 'onpointermove' in that specification. recommendation non-stable version pointer eventsthe def
inition of 'onpointermove' in that specification. ...
...And 2 more matches
GlobalEventHandlers.onpointerout - Web APIs
at processes pointerout events. syntax targetelement.onpointerout = outhandler; var outhandler = targetelement.onpointerout; value outhandler the pointerout event handler for element targetelement. example this example shows two ways to use onpointerout to set an element's pointerout event handler. ...
....onpointerout; value outhandler the pointerout event handler for element targetelement. example this example shows two ways to use onpointerout to set an element's pointerout event handler. <html> <script> function outhandler(ev) { // process the pointerout event } function
init() { let el=document.getelementbyid('target1'); el.onpointerout = outhandler; } </script> <body onload="
init();"> <div id="target1"> touch me ... </div> <div id="target2" onpointerout="outhandler(event)"> touch me ... ...
...ocess the pointerout event } function
init() { let el=document.getelementbyid('target1'); el.onpointerout = outhandler; } </script> <body onload="
init();"> <div id="target1"> touch me ... </div> <div id="target2" onpointerout="outhandler(event)"> touch me ... </div> </body> </html> specifications specification status comment pointer events – level 2the def
inition of 'onpointerout' in that specification. recommendation non-stable version pointer eventsthe def
inition of 'onpointerout' in that specification. ...
...And 2 more matches
GlobalEventHandlers.onpointerover - Web APIs
s pointerover events. syntax targetelement.onpointerover = overhandler; var overhandler = targetelement.onpointerover; value overhandler the pointerover event handler for element targetelement. example this example shows two ways to use onpointerover to set an element's pointerover event handler. ...
...ver; value overhandler the pointerover event handler for element targetelement. example this example shows two ways to use onpointerover to set an element's pointerover event handler. <html> <script> function overhandler(ev) { // process the pointerover event } function
init() { let el = document.getelementbyid('target1'); el.onpointerover = overhandler; } </script> <body onload="
init();"> <div id="target1"> touch me ... </div> <div id="target2" onpointerover="overhandler(event)"> touch me ... ...
...he pointerover event } function
init() { let el = document.getelementbyid('target1'); el.onpointerover = overhandler; } </script> <body onload="
init();"> <div id="target1"> touch me ... </div> <div id="target2" onpointerover="overhandler(event)"> touch me ... </div> </body> </html> specifications specification status comment pointer events – level 2the def
inition of 'onpointerover' in that specification. recommendation non-stable version pointer eventsthe def
inition of 'onpointerover' in that specification. ...
...And 2 more matches
GlobalEventHandlers.onpointerup - Web APIs
thandler that processes pointerup events. syntax targetelement.onpointerup = uphandler; var uphandler = targetelement.onpointerup; value uphandler the pointerup event handler for element targetelement. example this example shows two ways to use onpointerup to set an element's pointerup event handler. ...
...element.onpointerup; value uphandler the pointerup event handler for element targetelement. example this example shows two ways to use onpointerup to set an element's pointerup event handler. <html> <script> function uphandler(ev) { // process the pointerup event } function
init() { let el = document.getelementbyid('target1'); el.onpointerup = uphandler; } </script> <body onload="
init();"> <div id="target1"> touch me ... </div> <div id="target2" onpointerup="uphandler(event)"> touch me ... ...
... process the pointerup event } function
init() { let el = document.getelementbyid('target1'); el.onpointerup = uphandler; } </script> <body onload="
init();"> <div id="target1"> touch me ... </div> <div id="target2" onpointerup="uphandler(event)"> touch me ... </div> </body> </html> specifications specification status comment pointer events – level 2the def
inition of 'onpointerup' in that specification. recommendation non-stable version pointer eventsthe def
inition of 'onpointerup' in that specification. ...
...And 2 more matches
HTMLFieldSetElement - Web APIs
true because <fieldset> objects are never candidates for constraint validation. htmlfieldsetelement.setcustomvalidity() sets a custom validity message for the field set. if this message is not the empty string, then the field set is suffering from a custom validity error, and does not validate. specifications specification status comment html living standardthe def
inition of 'htmlfieldsetelement' in that specification. living standard html 5.1the def
inition of 'htmlfieldsetelement' in that specification. recommendation html5the def
inition of 'htmlfieldsetelement' in that specification. recommendation the following properties have been added: disabled, elements, name, type, valdiationmessage, validity, and willvalidate. ...
...cation. recommendation html5the def
inition of 'htmlfieldsetelement' in that specification. recommendation the following properties have been added: disabled, elements, name, type, valdiationmessage, validity, and willvalidate. the following methods have been added: checkvalidity(), setcustomvalidity(). document object model (dom) level 2 html specificationthe def
inition of 'htmlfieldsetelement' in that specification. ...
...erties have been added: disabled, elements, name, type, valdiationmessage, validity, and willvalidate. the following methods have been added: checkvalidity(), setcustomvalidity(). ...
...And 2 more matches
HTMLHeadElement - Web APIs
#0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlheadelement.profile is a domstring representing the uris of one or more metadata profiles (white space separated). methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmlheadelement' in that specification. living standard html 5.1the def
inition of 'htmlheadelement' in that specification. recommendation no change from html5. html5the def
inition of 'htmlheadelement' in that specification. recommendation the following property has been removed: profile. document object model (dom) level 2 html specificationth...
...f 'htmlheadelement' in that specification. living standard html 5.1the def
inition of 'htmlheadelement' in that specification. recommendation no change from html5. html5the def
inition of 'htmlheadelement' in that specification. recommendation the following property has been removed: profile. document object model (dom) level 2 html specificationthe def
inition of 'htmlheadelement' in that specification. ...
... recommendation no change from html5. html5the def
inition of 'htmlheadelement' in that specification. recommendation the following property has been removed: profile. document object model (dom) level 2 html specificationthe def
inition of 'htmlheadelement' in that specification. ...
...And 2 more matches
HTMLInputElement.setSelectionRange() - Web APIs
l" in the word "mozilla"). ...
...ct text</button> javascript function selecttext() { const input = document.getelementbyid('text-box'); input.focus(); input.setselectionrange(2, 5); } result specifications specification status comment html living standardthe def
inition of 'htmlinputelement.setselectionrange()' in that specification. ...
... input.setselectionrange(2, 5); } result specifications specification status comment html living standardthe def
inition of 'htmlinputelement.setselectionrange()' in that specification. living standard no change html 5.1the def
inition of 'htmlinputelement.setselectionrange()' in that specification. ...
...And 2 more matches
HTMLInputElement.stepDown() - Web APIs
put to go out of range, in this case stopping when it reaches 0 and rounding down and floats that are passed as a parameter. try setting the step decrementer to 1.2. what happens when you invoke the method? try setting the value to 44, which is not valid. ...
...hat are passed as a parameter. try setting the step decrementer to 1.2. what happens when you invoke the method? try setting the value to 44, which is not valid. ...
... you invoke the method? ...
...And 2 more matches
HTMLInputElement.stepUp() - Web APIs
input to out of range, in this case stopping when it reaches 400, and rounding down any floats that are passed as a parameter. try setting the step increment to 1.2. what happens when you invoke the method? try setting the value to 4, which is not valid. ...
...ats that are passed as a parameter. try setting the step increment to 1.2. what happens when you invoke the method? try setting the value to 4, which is not valid. ...
... when you invoke the method? ...
...And 2 more matches
HTMLMediaElement - Web APIs
t.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 seeked, this value is the media's
initial playback time. 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. htmlm...
...mlmediaelement.disableremoteplayback a boolean that sets or returns the remote playback state, indicating whether the media element is allowed to have a remote playback ui. htmlmediaelement.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 indef
inite length (such as streamed live media, a webrtc call's media, or similar), the value is +inf
inity. htmlmediaelement.ended read only returns a boolean that indicates whether the media element has finished playing. htmlmediaelement.error read only returns a mediaerror object for the most recent error, or null if there has not been an error. htmlmediaelement.loop a boolean that reflects the l...
....0 (silent) to 1.0 (loudest). event handlers htmlmediaelement.onencrypted sets the eventhandler called when the media is encrypted. htmlmediaelement.onwaitingforkey sets the eventhandler called when playback is blocked while waiting for an encryption key. obsolete attributes these attributes are obsolete and should not be used, even if a browser still supports them. htmlmediaelement.
initialtime read only returns a double that indicates the
initial playback position in seconds. 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 ...
...And 2 more matches
HTMLMeterElement - Web APIs
value a double representing the currrent value, reflecting the value attribute. htmlmeterelement.labelsread only a nodelist of <label> elements that are associated with the element. methods this interface does not implement any specific methods but inherits methods from its parent, htmlelement. ...
...belsread only a nodelist of <label> elements that are associated with the element. methods this interface does not implement any specific methods but inherits methods from its parent, htmlelement. ...
...rface does not implement any specific methods but inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmlmeterelement' in that specification. ...
...And 2 more matches
HTMLSelectElement - Web APIs
lue) // second a better way to track changes to the user's selection is to watch for the change event to occur on the <select>. this will tell you when the value changes, and you can then update anything you need to. see the example provided in the documentation for the change event for details. specifications specification status comment html living standardthe def
inition of 'htmlselectelement' in that specification. living standard since the latest snapshot, html5, it adds the autocomplete property and the reportvalidity() method. html5the def
inition of 'htmlselectelement' in that specification. recommendation is a snapshot of html living standard. it adds the autofocus, form, required, labels, selectedoptions, willvalidate, validity a...
...snapshot of html living standard. it adds the autofocus, form, required, labels, selectedoptions, willvalidate, validity and validationmessage properties. the tabindex property and the blur() and focus() methods have been moved to htmlelement. ...
...ave been moved to htmlelement. the methods item(), nameditem(), checkvalidity() and setcustomvalidity(). document object model (dom) level 2 html specificationthe def
inition of 'htmlselectelement' in that specification. obsolete options now returns an htmloptionscollection. ...
...And 2 more matches
HTMLStyleElement - Web APIs
ted with the given element, or null if there is none htmlstyleelement.scoped is a boolean value indicating if the element applies to the whole document (false) or only to the parent's sub-tree (true). methods no specific method; inherits properties from its parent, htmlelement, and linkstyle. ...
... indicating if the element applies to the whole document (false) or only to the parent's sub-tree (true). methods no specific method; inherits properties from its parent, htmlelement, and linkstyle. specifications specification status comment html living standardthe def
inition of 'htmlstyleelement' in that specification. living standard html 5.1the def
inition of 'htmlstyleelement' in that specification. recommendation html5the def
inition of 'htmlstyleelement' in that specification. recommendation the following property has been added: scoped. document object model (dom) level 2 html specificationthe def
inition of 'htmlstyleelement' in that specification. obsolete added a second inheritence, the linkstyle interf...
... html5the def
inition of 'htmlstyleelement' in that specification. recommendation the following property has been added: scoped. document object model (dom) level 2 html specificationthe def
inition of 'htmlstyleelement' in that specification. obsolete added a second inheritence, the linkstyle interface. document object model (dom) level 1 specificationthe def
inition of 'htmlstyleelement' in that specification. ...
...And 2 more matches
Ajax navigation example - Web APIs
if (history.pushstate) { bupdateurl = true; getpage(surl); } else { /* ajax navigation is not supported */ location.assign(surl); } } function processlink () { if (this.classname === sajaxclass) { requestpage(this.href); return false; } return true; } function
init () { opageinfo.title = document.title; history.replacestate(opageinfo, opageinfo.title, opageinfo.url); for (var olink, nidx = 0, nlen = document.links.length; nidx < nlen; document.links[nidx++].onclick = processlink); } const /* customizable constants */ stargetid = "ajax-content", sviewkey = "view_as", sajaxclass = "ajax-nav", /* not c...
... ...
... ...
...And 2 more matches
IDBOpenDBRequest - Web APIs
ng example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these event handlers act on the database being opened. dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db // variable. this is used a lot below db = dbopenrequest.result; // run the displaydata() function to populate the task // listwith all the to-do list data already in the idb displaydata(); }; // this event handles the event whereby a new version of // the database needs to be created either one has not // been cr...
... recommendation ...
... recommendation ...
...And 2 more matches
Basic concepts - Web APIs
net connectivity to work (for example, mail clients, to-do lists, and notepads). about this document this introduction discusses essential concepts and terminology in indexeddb. it gives you the big picture and explains key concepts. you'll find the following useful: for an overview of the design and structure of indexeddb, see big concepts. to learn more about indexeddb terms, see the def
initions section. for a detailed tutorial on how to use the api, see using indexeddb. for the reference documentation on the indexeddb api, refer back to the main indexeddb api article and its subpages, which document the types of objects used by indexeddb. for more information on how the browser handles storing your data in the background, read browser storage limits and eviction criteria. overv...
... this transaction model is really useful when you consider what might happen if a user opened two instances of your web app in two different tabs simultaneously. without transactional operations, the two instances could interfere with each other's modifications. if you are not familiar with transactions in a database, read the wikipedia article on transactions. also see transaction under the def
initions section. the indexeddb api is mostly asynchronous. the api doesn't give you data by returning values; instead, you have to pass a callback function. you don't "store" a value into the database, or "retrieve" a value out of the database through synchronous means. instead, you "request" that a database operation happens. you get notified by a dom event when the operation finishes, and the...
...e same origin, it cannot retrieve data from http://www.example.com:8080/dir/ (different port) or https://www.example.com/dir/ (different protocol), because they have different origins. note: third party window content (e.g. <iframe> content) can access the indexeddb store for the origin it is embedded into, unless the browser is set to never accept third party cookies (see bug 1147821.) def
initions this section defines and explains terms used in the indexeddb api. database database a repository of information, typically comprising one or more object stores. each database must have the following: name. this identifies the database within a specific origin and stays constant throughout its lifetime. the name can be any string value (including an empty string). current vers...
...And 2 more matches
MediaTrackSettings - Web APIs
ot include certain values, such as facingmode or groupid. properties of all media tracks deviceid a domstring indicating the current value of the deviceid property. the device id is a origin-unique string identifying the source of the track; this is usually a guid. this value is specific to the source of the track's data and is not usable for setting constraints; it can, however, be used for
initially selecting media when calling mediadevices.getusermedia(). groupid a domstring indicating the current value of the groupid property. the group id is a browsing session-unique string identifying the source group of the track. two devices (as identified by the deviceid) are considered part of the same group if they are from the same physical device. for instance, the audio input and output de...
...rom the same physical device. for instance, the audio input and output devices for the speaker and microphone built into a phone would share the same group id, since they're part of the same physical device. the microphone on a headset would have a different id, though. this value is specific to the source of the track's data and is not usable for setting constraints; it can, however, be used for
initially selecting media when calling mediadevices.getusermedia(). properties of audio tracks autogaincontrol a boolean which indicates the current value of the autogaincontrol property, which is true if automatic gain control is enabled and is false otherwise. channelcount a long integer value indicating the current value of the channelcount property, specifying the number of audio channels ...
... aspectratio a double-precision floating point value indicating the current value of the aspectratio property, specified precisely to 10 decimal places. this is the width of the image in pixels divided by its height in pixels. common values include 1.3333333333 (for the classic television 4:3 "standard" aspect ratio, also used on tablets such as apple's ipad), 1.7777777778 (for the 16:9 high-def
inition widescreen aspect ratio), and 1.6 (for the 16:10 aspect ratio common among widescreen computers and tablets). facingmode a domstring indicating the current value of the facingmode property, specifying the direction the camera is facing. the value will be one of: "user" a camera facing the user (commonly known as a "selfie cam"), used for self-portraiture and video calling. "environme...
...And 2 more matches
Capabilities, constraints, and settings - Web APIs
ly. 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 indicate that any values are fine for nearly all properties, but that a standard high def
inition (hd) video size is desired, with the standard 16:9 aspect ratio. there's no guarantee that the resulting track will match any of these, but the user agent should do its best to match as many as possible. the prioritization of the properties is simple: if two properties' requested values are mutually exclusive, then the one listed first in the constraint set will be used. as an example, if the...
... retrieving current constraints and settings it's important to remember the difference between constraints and settings. constraints are a way to specify what values you need, want, and are willing to accept for the various constrainable properties (as described in the documentation for mediatrackconstraints), while settings are the actual values of each constrainable property at the curren...
...area { padding: 8px; } h3 { margin-bottom: 3px; } #supportedconstraints { column-count: 2; -moz-column-count: 2; } #log { padding-top: 10px; } javascript content now let's take a look at the javascript code that makes everything work. defaults and variables first we have the default constraint sets, as strings. these strings are presented in editable <textarea>s, but this is the
initial configuration of the stream. let videodefaultconstraintstring = '{\n "width": 320,\n "height": 240,\n "framerate": 30\n}'; let audiodefaultconstraintstring = '{\n "samplesize": 16,\n "channelcount": 2,\n "echocancellation": false\n}'; these defaults ask for a pretty common camera configuration, but don't insist on any property being of special importance. the browser should do its bes...
...And 2 more matches
MouseEvent.buttons - Web APIs
ent, while the mouseevent.button property only guarantees the correct value for mouse events caused by pressing or releasing one or multiple buttons. syntax var buttonspressed = instanceofmouseevent.buttons return value a number representing one or more buttons. for more than one button pressed simultaneously, the values are combined (e.g., 3 is primary + secondary). 0 : no button or un-
initialized 1 : primary button (usually the left button) 2 : secondary button (usually the right button) 4 : auxiliary button (usually the mouse wheel button or middle button) 8 : 4th button (typically the "browser back" button) 16 : 5th button (typically the "browser forward" button) example this example logs the buttons property when you trigger a mousedown event. html <p>click anywher...
... working draft current working draft ...
... working draft current working draft ...
...And 2 more matches
MutationObserver.observe() - Web APIs
or all of its descendant nodes. to stop the mutationobserver (so that none of its callbacks will be triggered any longer), call mutationobserver.disconnect(). syntax mutationobserver.observe(target, options) parameters target a dom node (which may be an element) within the dom tree to watch for changes, or to be the root of a subtree of nodes to be watched. ...
...root of a subtree of nodes to be watched. options a mutationobserver
init object providing options that describe which dom mutations should be reported to mutationobserver’s callback. return value undefined. exceptions typeerror thrown in any of the following circumstances: the options are configured such that nothing will actually be monitored. (for example, if mutationobserver
init.childlist, mutationobserver
init.attributes, and mutationobserver
init.characterdata are all false.) the value of options.attributes is false (indicating that attribute changes are not to be monitored), but attributeoldvalue is true and/or attributefilter is present. ...
... usage notes reusing mutationobservers you can call observe() multiple times on the same mutationobserver to watch for changes to different parts of the dom tree and/or different types of changes. ...
...And 2 more matches
NamedNodeMap - Web APIs
nameditemns() 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. ...
...n namespace and related local name. namednodemap.removenameditemns() removes the attr identified by the given namespace and related local name. specifications specification status comment domthe def
inition of 'namednodemap' in that specification. living standard deals with attr instead of node document object model (dom) level 3 core specificationthe def
inition of 'namednodemap' in that specification. ...
...ent domthe def
inition of 'namednodemap' in that specification. living standard deals with attr instead of node document object model (dom) level 3 core specificationthe def
inition 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 def
inition of 'namednodemap' in that specification. obsolete added getnameditemns(), setnameditemns() and removenameditemns() document object model (dom) level 1 specificationthe def
inition of 'namednodemap' in that specification. ...
...And 2 more matches
Node.cloneNode() - Web APIs
ode has an id attribute, and the clone will be placed in the same document, then you should modify the clone's id to be unique. name attributes may need to be modified also, depending on whether duplicate names are expected. to clone a node to insert into a different document, use document.importnode() instead. ...
...ay need to be modified also, depending on whether duplicate names are expected. to clone a node to insert into a different document, use document.importnode() instead. specifications specification status comment domthe def
inition of 'node.clonenode()' in that specification. ...
...document.importnode() instead. specifications specification status comment domthe def
inition of 'node.clonenode()' in that specification. living standard document object model (dom) level 3 core specificationthe def
inition of 'node.clonenode()' in that specification. ...
...And 2 more matches
Node.nextSibling - Web APIs
the above example, #text nodes are inserted in the dom where whitespace occurs between tags (i.e. after the closing tag of an element and before the opening tag of the next). the possible inclusion of text nodes must be allowed for when traversing the dom using nextsibling. see the resources in the notes section. ...
...g tag of the next). the possible inclusion of text nodes must be allowed for when traversing the dom using nextsibling. see the resources in the notes section. specifications specification status comment domthe def
inition of 'node.nextsibling' in that specification. ...
...he notes section. specifications specification status comment domthe def
inition of 'node.nextsibling' in that specification. living standard no change document object model (dom) level 2 core specificationthe def
inition of 'node.nextsibling' in that specification. ...
...And 2 more matches
Notation - Web APIs
or formally declare the document's processing instruction targets. inherits methods and properties from node. its nodename is the notation name. has no parent. properties notation.publicid read only is a domstring. notation.systemid read only is a domstring. ...
...ame. has no parent. properties notation.publicid read only is a domstring. notation.systemid read only is a domstring. specifications specification status comment document object model (dom) level 3 core specificationthe def
inition of 'notation' in that specification. ...
...fications specification status comment document object model (dom) level 3 core specificationthe def
inition of 'notation' in that specification. obsolete no change document object model (dom) level 2 core specificationthe def
inition of 'notation' in that specification. ...
...And 2 more matches
performance.now() - Web APIs
headers ensure a top-level document does not share a browsing context group with cross-origin documents. ...
...-origin documents. coop process-isolates your document and potential attackers can't access to your global object if they were opening it in a popup, preventing a set of cross-origin attacks dubbed xs-leaks. ...
...ttackers can't access to your global object if they were opening it in a popup, preventing a set of cross-origin attacks dubbed xs-leaks. ...
...And 2 more matches
RTCIceCandidate.priority - Web APIs
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. ...
... note: if priority is null, passing the candidate to addicecandidate() will fail, throwing an operationerror exception. this applies only if the candidate implements the priority property. ...
... ...
...And 2 more matches
RTCPeerConnection.setRemoteDescription() - Web APIs
onfiguration, the description submitted by calling setremotedescription() 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. ...
...ntax apromise = rtcpeerconnection.setremotedescription(sessiondescription); parameters sessiondescription an rtcsessiondescription
init or rtcsessiondescription which specifies the remote peer's current offer or answer. this value is an offer or answer received from the remote peer through your implementation of the sessiondescription parameter is technically of type rtcsessiondescription
init, but because rtcsessiondescription serializes to be indistinguishable from rtcsessiondescription
init, you can also pass in an rtcsessiondescription. this lets you simplify code such as the following: mypeerconnection.setremotedescription(new rtcsessiondescription(description)) .then(function () { return createmystream(); }) to simply be: mypeerconnection.setremotedescription(description) .t...
...he others specifeid here are reported as operationerror. this includes identity validation errors. rtcerror an rtcerror with the errordetail set to sdp-syntax-error is reported if the sdp specified by rtcsessiondescription.sdp. the error object's sdplinenumber property indicates the line number within the sdp on which the syntax error was detected. typeerror the specified rtcsessiondescription
init or rtcsessiondescription object is missing the type property, or no description parameter was provided at all. usage notes when you call setremotedescription(), the ice agent checks to make sure the rtcpeerconnection is in either the stable or have-remote-offer signalingstate. these states indicate that either an existing connection is being renegotiated or that an offer previously specified b...
...And 2 more matches
RTCSessionDescription() - Web APIs
the rtcsessiondescription() constructor creates a new rtcsessiondescription with its properties
initialized as described in the specified object. this constructor has been deprecated because rtcpeerconnection.setlocaldescription() and other methods which take sdp as input now directly accept an object conforming to the rtcsessiondescription
init dictionary, so you don't have to instantiate an rtcsessiondescription yourself. syntax sessiondescription = new rtcsessiondescription(rtcsessiondescription
init); values rtcsessiondescription
init optional an object providing the default values for the session description; the object conforms to the rtcsessiondescription
init dictionary. that dictionary has the following properties: type required. a string which is a member of the rtcs...
... required. a string which is a member of the rtcsdptype enum; it must have one of the following values: this enum defines strings that describe the current state of the session description, as used in the type property. the session description's type will be specified using one of these values. value description answer the sdp contained in the sdp property is the def
initive choice in the exchange. in other words, this session description describes the agreed-upon configuration, and is being sent to finalize negotiation. offer the session description object describes the
initial proposal in an offer/answer exchange. the session negotiation process begins with an offer being sent from the caller to the callee. pranswer the session descriptio...
...essage describing the session. this value is an empty string ("") by default and may not be null. example this example uses the constructor to convert an sdp offer into an rtcsessiondescription object. this is no longer necessary, however; rtcpeerconnection.setlocaldescription() and other methods which take sdp as input now directly accept an object conforming to the rtcsessiondescription
init dictionary, so you don't have to instantiate an rtcsessiondescription yourself. navigator.getusermedia({video: true}, function(stream) { pc.onaddstream({stream: stream}); // adding a local stream won't trigger the onaddstream callback pc.addstream(stream); pc.createoffer(function(offer) { pc.setlocaldescription(new rtcsessiondescription(offer), function() { // send the offer ...
...And 2 more matches
RTCSessionDescription - Web APIs
scription.sdp read only a domstring containing the sdp describing the session. constants rtcsdptype this enum defines strings that describe the current state of the session description, as used in the type property. the session description's type will be specified using one of these values. value description answer the sdp contained in the sdp property is the def
initive choice in the exchange. in other words, this session description describes the agreed-upon configuration, and is being sent to finalize negotiation. offer the session description object describes the
initial proposal in an offer/answer exchange. the session negotiation process begins with an offer being sent from the caller to the callee. pranswer the session descriptio...
...s offer that is not the final answer. it is usually employed by legacy hardware. rollback this special type with an empty session description is used to roll back to the previous stable state. methods the rtcsessiondescription doesn't inherit any methods. rtcsessiondescription() this constructor returns a new rtcsessiondescription. the parameter is a rtcsessiondescription
init 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. example signalingchannel.onmessage = function (evt) { if (!pc) start(false); var message = json.parse(evt.data); if (message.sdp) pc.setremotedesc...
... ...
...And 2 more matches
ResizeObserver - Web APIs
the resizeobserver interface reports changes to the dimensions of an element's content or border box, or the bounding box of an svgelement. note: the content box is the box in which content can be placed, meaning the border box minus the padding and border width. the border box encompasses the content, padding, and border. see the box model for further explanation. resizeobserver avoids inf
inite callback loops and cyclic dependencies that are often created when resizing via a callback function. it does this by only processing elements deeper in the dom in subsequent frames. implementations should, if they follow the specification, invoke resize events before paint and after layout. constructor resizeobserver() creates and returns a new resizeobserver object. properties none. meth...
...ing elements deeper in the dom in subsequent frames. implementations should, if they follow the specification, invoke resize events before paint and after layout. constructor resizeobserver() creates and returns a new resizeobserver object. properties none. methods resizeobserver.disconnect() unobserves all observed element targets of a particular observer. resizeobserver.observe()
initiates the observing of a specified element. resizeobserver.unobserve() ends the observing of a specified element. examples in the resize-observer-text.html (see source) example, we use the resize observer to change the font-size of a header and paragraph as a slider’s value is changed causing the containing <div> to change width. this shows that you can respond to changes in an element’s ...
... ...
...And 2 more matches
SVGAnimationElement - Web APIs
omexception with code invalid_state_err is thrown. svganimationelement.getcurrenttime() returns a float representing the current time in seconds relative to time zero for the given time container. svganimationelement.getsimpleduration() returns a float representing the number of seconds for the simple duration for this animation. if the simple duration is undefined (e.g., the end time is indef
inite), then a domexception with code not_supported_err is raised. svganimationelement.beginelement() creates a begin instance time for the current time. the new instance time is added to the begin instance times list. the behavior of this method is equivalent to beginelementat(0). svganimationelement.beginelementat() creates a begin instance time for the current time plus the specified offs...
...property. endevent fired when at the active end of the animation is reached. also available via the onend property. repeatevent fired when the element's local timeline repeats. ...
...e element's local timeline repeats. it will be fired each time the element repeats, after the first iteration. also available via the onrepeat property. ...
...And 2 more matches
SVGExternalResourcesRequired - Web APIs
text { fill: #0095dd; pointer-events: all;} warning: this interface was removed in the svg 2 specification. properties svgexternalresourcesrequired.externalresourcesrequired corresponds to the externalresourcesrequired attribute of the given element. ...
...as removed in the svg 2 specification. properties svgexternalresourcesrequired.externalresourcesrequired corresponds to the externalresourcesrequired attribute of the given element. note: the svg dom defines the attribute externalresourcesrequired as being of type svganimatedboolean, whereas the svg language def
inition says that the attribute is not animated. ...
...guage def
inition says that the attribute is not animated. because the svg language def
inition states that externalresourcesrequired cannot be animated, the animval will always be the same as the baseval. methods this interface doesn't implement any specific methods. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgexternalresourcesrequired' in that specification. ...
...And 2 more matches
SVGTransformList - Web APIs
vgtransform objects. an svgtransformlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...the list. methods name & arguments return description clear() void clears all existing current items from the list, with the result being an empty 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.
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 th...
...s list before it is inserted into this list. the inserted item is the item itself and not a copy. 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. createsvgtransformfrommatrix(in svgmatrix) svgtransform creates an svgtransform object which is
initialized to transform of type svg_transform_matrix and whose values are the given matrix. the values from the parameter matrix are copied, the matrix parameter is not adopted as svgtransform::matrix. consolidate() svgtransform consolidates the list of separate svgtransform objects by multiplying the equivalent transformation matrices together to result in a list consisting of a ...
...And 2 more matches
SubtleCrypto.deriveKey() - Web APIs
it returns a promise which will be fulfilled with a cryptokey object representing the new key. it's worth noting that the three key derivation algorithms you can use have quite different characteristics and are appropriate in quite different situations. see supported algorithms for some more detail on this. ...
...es ); parameters algorithm is an object defining the derivation algorithm to use. to use ecdh, pass an ecdhkeyderiveparams object. to use hkdf, pass an hkdfparams object. to use pbkdf2, pass a pbkdf2params object. basekey is a cryptokey representing the input to the derivation algorithm. if algorithm is ecdh, then this will be the ecdh private key. otherwise it will be the
initial key material for the derivation function: for example, for pbkdf2 it might be a password, imported as a cryptokey using subtlecrypto.importkey(). derivedkeyalgorithm is an object defining the algorithm the derived key will be used for. for hmac: pass an hmackeygenparams object. for aes-ctr, aes-cbc, aes-gcm, or aes-kw: pass an aeskeygenparams object. extractable is a boolean in...
... ...
...And 2 more matches
TrackEvent - Web APIs
media track list types: events involving video tracks are always sent to the videotracklist found in htmlmediaelement.videotracks events involving audio tracks are always sent to the audiotracklist specified in htmlmediaelement.audiotracks events affecting text tracks are sent to the texttracklist object indicated by htmlmediaelement.texttracks. constructor trackevent() creates and
initializes a new trackevent object with the event type specified, as well as optional additional properties. properties trackevent is based on event, so properties of event are also available on trackevent objects. track read only 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). m...
... ...
... ...
...And 2 more matches
WebGLRenderingContext.getProgramInfoLog() - Web APIs
he specified webglprogram object. it contains errors that occurred during failed linking or validation of webglprogram objects. syntax gl.getprograminfolog(program); parameters program the webglprogram to query. return value a domstring that contains diagnostic messages, warning messages, and other information about the last linking or validation operation. ...
... standard man page of the opengl api. ...
... standard man page of the opengl api. ...
...And 2 more matches
Animating textures in WebGL - Web APIs
play to start loading and playing the video. the video must be loaded from a secure source in order to be used to provide texture data to webgl. that means that you'll not only need to deploy code like using a secure web server, but you'll need a secure server to test with as well. see how do you set up a local testing server? for help. ...
...b server, but you'll need a secure server to test with as well. see how do you set up a local testing server? for help. using the video frames as a texture the next change is to
inittexture(), which becomes much simpler, since it no longer needs to load an image file. instead, all it does is create an empty texture object, put a single pixel in it, and set its filtering for later use: function
inittexture(gl) { const texture = gl.createtexture(); gl.bindtexture(gl.texture_2d, texture); // because video has to be download over the internet // they might take a moment until it's ready so // put a single pixel in the texture so we can // use it immediately. const level = 0; const internalformat = gl.rgba; const width = 1; const height = 1; const border = 0; const srcfo...
...cformat, srctype, video); } you've seen this code before. it's nearly identical to the image onload function in the previous example — except when we call teximage2d(), instead of passing an image object, we pass in the <video> element. webgl knows how to pull the current frame out and use it as a texture. ...
...And 2 more matches
Window.screenX - Web APIs
eft edge of the browser viewport to the left edge of the screen. examples in our screenleft-screentop (source code) example, you'll see a canvas onto which has been drawn a circle. in this example we are using window.screenleft/window.screentop plus window.requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
... screen. examples in our screenleft-screentop (source code) example, you'll see a canvas onto which has been drawn a circle. in this example we are using window.screenleft/window.screentop plus window.requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...ionframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...And 2 more matches
Window.screenY - Web APIs
ixels from the top edge of the browser viewport to the top edge of the screen. examples in our screenleft-screentop example, you'll see a canvas onto which has been drawn a circle. in this example we are using window.screenleft/window.screentop plus window.requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...op edge of the screen. examples in our screenleft-screentop example, you'll see a canvas onto which has been drawn a circle. in this example we are using window.screenleft/window.screentop plus window.requestanimationframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...ionframe() to constantly redraw the circle in the same physical position on the screen, even if the window position is moved. ...
...And 2 more matches
WorkerGlobalScope.self - Web APIs
alscope. syntax var selfref = self; value a global scope object (differs depending on the type of worker you are dealing with, as indicated above). ...
...syntax var selfref = self; value a global scope object (differs depending on the type of worker you are dealing with, as indicated above). ...
...rs depending on the type of worker you are dealing with, as indicated above). ...
...And 2 more matches
XRReferenceSpace: reset event - Web APIs
d-floor reference space, the coordinate system can be reset if the user exits the boundaries of the reference space and enters a new one (such as by crossing from one level to another in a game, where each level is its own map with its own coordinate system). the tracking system has temporarily lost the user, then regained them, but not until after they had moved enough to leave the immediate vic
inity of the last-known position. primarily an issue for unbounded reference spaces. the user is in an unbounded reference space and has moved far enough from the starting position (the reference space's origin) that floating-point or other forms of error or drift are problematic. the coordinate system is thus reset with its new origin at or near the user's current position. the webxr infrastructure...
... way, the user's position only changes once rather than twice. the effect of discontinuity size the reset event won't be fired when the discontinuity is small enough that the device is able to regain tracking within the same tracking area. nor will be be fired at an unbounded reference space as it makes small adjustments to its native origin over time to maintain the space's stability in the vic
inity of the user; only large discontinuities will trigger a reset. examples to add a handler for the reset event, you can use either of two approaches. first, you can use the addeventlistener() method: viewerrefspace.addeventlistener("reset", (event) => { /* perform reset related tasks */ }); the second option is to set the xrreferencespace object's onreset event handler property: viewerrefsp...
... ...
...And 2 more matches
XRSession - Web APIs
quests that a new xrreferencespace of the specified type be created. returns a promise which resolves with the xrreferencespace or xrboundedreferencespace which was requested, or throws a notsupportederror if the requested space type isn't supported by the device. updaterenderstate() updates the properties of the session's render state to match the values specified in the specified xrrenderstate
init dictionary. any properties not included in the given dictionary are left unchanged from their current values. events the following events are delivered to xrsession objects. event description end sent to the xrsession object after the webxr session has ended and all hardware-related functions have completed. the event is represented by an object of type xrsessionev...
...action is over. also available through the onsqueeze event handler property. squeezeend an xrinputsourceevent sent to the xrsession when the primary squeeze action ends, whether or not the action was successful. also available using the onsqueezeend event handler property. squeezestart an event of type xrinputsourceevent which is sent to the xrsession when the user
initially squeezes a squeezable controller. this may be, for example, a trigger which is used to represent grabbing objects, or might represent actual squeezing when wearing a haptic glove. also available through the onsqueezestart event handler property. visibilitychange an xrsessionevent which is sent to the session when its visibility state as indicated by the visibilitystate change...
... ...
...And 2 more matches
XRSystem: requestSession() - Web APIs
the xrsystem interface's requestsession() method returns a promise which resolves to an xrsession object through which you can manage the requested type of webxr session. while only one immersive vr session can be active at a time, multiple inline sessions can be in progress at once. syntax var sessionpromise = xr.requestsession(sessionmode, session
init) parameters sessionmode a domstring whose value is one of those included in the xrsessionmode enum. the supported modes are: immersive-ar the session's output will be given exclusive access to the immersive device, but the rendered content will be blended with the real-world environment. the session's environmentblendmode indicates the method to be used to blend the content together. important: the immersive-ar mode is...
...requires it. inline the output is presented inline within the context of an element in a standard html document, rather than occupying the full visual space. inline sessions can be presented in either mono or stereo mode, and may or may not have viewer tracking available. inline sessions don't require special hardware and should be avalable on any user agent offering webxr api support. session
init optional a xrsession
init object providing options to configure the new xrsession. see specifying session options for details on how to configure a webxr session. return value a promise that resolves with an xrsession object if the device and user agent support the requested mode and features. exceptions this method doesn't throw true exceptions; instead, it rejects the returned promise, pas...
...options are unsupported. securityerror permission to enter the specified xr mode is denied. this can happen for a number of reasons, which are covered in more detail in permissions and security in webxr device api. examples creating an immersive vr session the following example calls requestsession() requesting an "immersive-vr" session. if the promise resolves, it sets up a session and
initiates the animation loop. navigator.xr.requestsession("immersive-vr") .then((xrsession) => { xrsession.addeventlistener('end', onxrsessionended); // do necessary session setup here. // begin the session’s animation loop. xrsession.requestanimationframe(onxranimationframe); }).catch(function(error) { // "immersive-vr" sessions are not supported console.warn("'immersive-vr' isn't supp...
...And 2 more matches
-webkit-line-clamp - CSS: Cascading Style Sheets
d has some issues. it got standardized for legacy support. the css overflow module level 3 specification also defines a line-clamp property, which is meant to replace this property and avoid its issues. ...
...bkit-line-clamp: none; /* <integer> values */ -webkit-line-clamp: 3; -webkit-line-clamp: 10; /* global values */ -webkit-line-clamp: inherit; -webkit-line-clamp:
initial; -webkit-line-clamp: unset; none this value specifies that the content wonʼt be clamped. <integer> this value specifies the number of lines after which the content will be clamped. it must be greater than 0. formal def
inition
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax none | <integer> examples truncating a paragraph html <p> in this example the <code>-webkit-line-clamp</code> property is set to <code>3</code>, which means the text is clamped after three lines. an ellipsis will be shown at the point where the text is clamp...
...ty is set to <code>3</code>, which means the text is clamped after three lines. ...
...And 2 more matches
-webkit-mask-position-x - CSS: Cascading Style Sheets
the -webkit-mask-position-x css property sets the
initial horizontal position of a mask image. ...
...percentages are calculated agai...
...percentages are calculated against the horizontal dimension of the box pad...
...And 2 more matches
-webkit-mask-position-y - CSS: Cascading Style Sheets
the -webkit-mask-position-y css property sets the
initial vertical position of a mask image. ...
...percentages are calculated agains...
...percentages are calculated against the vertical dimension of the box padding...
...And 2 more matches
-webkit-text-fill-color - CSS: Cascading Style Sheets
the -webkit-text-fill-color css property specifies the fill color of characters of text. if this property is not set, the value of the color property is used. ...
...s not set, the value of the color property is used. /* <color> values */ -webkit-text-fill-color: red; -webkit-text-fill-color: #000000; -webkit-text-fill-color: rgb(100, 200, 0); /* global values */ -webkit-text-fill-color: inherit; -webkit-text-fill-color:
initial; -webkit-text-fill-color: unset; syntax values <color> the foreground fill color of the element's text content. ...
..., the value of the color property is used. /* <color> values */ -webkit-text-fill-color: red; -webkit-text-fill-color: #000000; -webkit-text-fill-color: rgb(100, 200, 0); /* global values */ -webkit-text-fill-color: inherit; -webkit-text-fill-color:
initial; -webkit-text-fill-color: unset; syntax values <color> the foreground fill color of the element's text content. ...
...And 2 more matches
:visited - CSS: Cascading Style Sheets
recommendation lifts the r...
... them to be styled with the :visited state */ background-color: white; border: 1px solid white; } a:visited { background-color: yellow; border-color: hotpink; color: hotpink; } result specifications specification status comment html living standardthe def
inition of ':visited' in that specification. living standard selectors level 4the def
inition of ':visited' in that specification. working draft no change. selectors level 3the def
inition of ':visited' in that specification. recommendation no change. css level 2 (revision 1)the def
inition of ':visited' in that specification. recommendation lifts the restriction to only apply :visited to the <a> element. lets browsers restrict its behavior for privacy...
... 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. ...
...And 2 more matches
additive-symbols - CSS: Cascading Style Sheets
symbol and a non-negative integer weight. the additive system is used to construct sign-value numbering systems such as roman numerals. syntax additive-symbols: 3 "0"; additive-symbols: 3 "0", 2 "\2e\20"; additive-symbols: 3 "0", 2 url(symbol.png); when the system descriptor is cyclic, numeric, alphabetic, symbolic, or fixed, use the symbols descriptor instead of additive-symbols. ...
...ght. the additive system is used to construct sign-value numbering systems such as roman numerals. syntax additive-symbols: 3 "0"; additive-symbols: 3 "0", 2 "\2e\20"; additive-symbols: 3 "0", 2 url(symbol.png); when the system descriptor is cyclic, numeric, alphabetic, symbolic, or fixed, use the symbols descriptor instead of additive-symbols. ...
... ...
...And 2 more matches
negative - CSS: Cascading Style Sheets
tion; and a second symbol if specified, will be appended to the representation. the negative descriptor has effect only if the system value is symbolic, alphabetic, numeric, additive, or extends, if the extended counter style itself uses a negative sign. if the negative descriptor is specified for other systems that don't support negative counter values, then the descriptor is ignored. ...
..., will be appended to the representation. the negative descriptor has effect only if the system value is symbolic, alphabetic, numeric, additive, or extends, if the extended counter style itself uses a negative sign. if the negative descriptor is specified for other systems that don't support negative counter values, then the descriptor is ignored. ...
... ...
...And 2 more matches
prefix - CSS: Cascading Style Sheets
e @counter-style rule specifies content that will be prepended to the marker representation. if not specified, the default value will be "" (an empty string). syntax /* <symbol> values */ prefix: "»"; prefix: "page "; prefix: url(bullet.png); values <symbol> specifies a <symbol> that is prepended to the marker representation. it may be a <string>, <image>, or <custom-ident>. ...
...t that will be prepended to the marker representation. if not specified, the default value will be "" (an empty string). syntax /* <symbol> values */ prefix: "»"; prefix: "page "; prefix: url(bullet.png); values <symbol> specifies a <symbol> that is prepended to the marker representation. it may be a <string>, <image>, or <custom-ident>. ...
... ...
...And 2 more matches
speak-as - CSS: Cascading Style Sheets
t in the form specified in that counter style, kind of like specifying the fallback descriptor. if the specified style does not exist, speak-as defaults to auto. accessibility concerns assistive technology support is very limited for the speak-as property. do not rely on it to convey information critical to understanding the page's purpose. ...
...r style, kind of like specifying the fallback descriptor. if the specified style does not exist, speak-as defaults to auto. accessibility concerns assistive technology support is very limited for the speak-as property. do not rely on it to convey information critical to understanding the page's purpose. ...
... ...
...And 2 more matches
symbols - CSS: Cascading Style Sheets
\24b7" "\24b8" d e; symbols: "0" "1" "2" "4" "5" "6" "7" "8" "9"; symbols: url('first.svg') url('second.svg') url('third.svg'); symbols: indic-numbers; the symbols descriptor must be specified when the value of the system descriptor is cyclic, numeric, alphabetic, symbolic, or fixed. when the additive system is used, use the additive-symbols descriptor instead to specify the symbols. ...
...2" "4" "5" "6" "7" "8" "9"; symbols: url('first.svg') url('second.svg') url('third.svg'); symbols: indic-numbers; the symbols descriptor must be specified when the value of the system descriptor is cyclic, numeric, alphabetic, symbolic, or fixed. when the additive system is used, use the additive-symbols descriptor instead to specify the symbols. ...
... ...
...And 2 more matches
@import - CSS: Cascading Style Sheets
recommendation extended the syntax to support any media que...
...mport "common.css" screen; @import url('landscape.css') screen and (orientation:landscape); specifications specification status comment css cascading and inheritance level 4the def
inition of 'the @import rule' in that specification. candidate recommendation extended the syntax to support the @supports syntax. css cascading and inheritance level 3the def
inition of '@import' in that specification. candidate recommendation media queriesthe def
inition of '@import' in that specification. recommendation extended the syntax to support any media query and not only simple media types. css level 2 (revision 1)the def
inition of '@import' in that specification. recommendation added support for <string> to denote the url of a...
...that specification. recommendation extended the syntax to support any media query and not only simple media types. css level 2 (revision 1)the def
inition of '@import' in that specification. ...
...And 2 more matches
bleed - CSS: Cascading Style Sheets
using the marks property. syntax /* keyword values */ bleed: auto; /* <length> values */ bleed: 8pt; bleed: 1cm; values auto computes to 6pt if the value of marks is crop. otherwise it computes to zero. <length> specifies by how far outward, in each direction, the bleed area extends past the page box. ...
...yntax /* keyword values */ bleed: auto; /* <length> values */ bleed: 8pt; bleed: 1cm; values auto computes to 6pt if the value of marks is crop. otherwise it computes to zero. <length> specifies by how far outward, in each direction, the bleed area extends past the page box. values may be negative, but there may be implementation-specific limits. ...
...d area extends past the page box. values may be negative, but there may be implementation-specific limits. ...
...And 2 more matches
orientation - CSS: Cascading Style Sheets
ally, typically based on the device's orientation as determined by an accelerometer (if the device has such a hardware sensor), although there is often a user-controlled, os-level "lock orientation" setting that will trump the accelerometer reading. portrait the document should be locked into portrait orientation. landscape the document should be locked into landscape orientation. ...
...ce's orientation as determined by an accelerometer (if the device has such a hardware sensor), although there is often a user-controlled, os-level "lock orientation" setting that will trump the accelerometer reading. portrait the document should be locked into portrait orientation. landscape the document should be locked into landscape orientation. ...
...d be locked into landscape orientation. ...
...And 2 more matches
@viewport - CSS: Cascading Style Sheets
sswg-drafts/issues/4766 for discussion around @viewport's removal from the standards track. the @viewport css at-rule lets you configure the viewport through which the document is viewed. it's primarily used for mobile devices, but is also used by desktop browsers that support features like "snap to edge" (such as microsoft edge). ...
...e" (such as microsoft edge). lengths specified as percentages are calculated relative to the
initial viewport, which is the viewport before any user agent or authored styles have had an opportunity to adjust the viewport. this is typically based on the size of the window on desktop browsers that aren't in full screen mode. on mobile devices (or desktop devices that are in full screen mode), the
initial viewport is usually the portion of a device's screen that is available for application use. this may be either the full screen or the full screen area minus areas controlled by the operating system (such as a taskbar) or the application-available screen area (either the full screen or the screen minus any areas owned by the operating system or other applications). @viewport { width: 100vw; ...
... is first displayed. width a shorthand descriptor for setting both min-width and max-width. min-height used in the determination of the height of the viewport when the document is first displayed. max-height used in the determination of the height of the viewport when the document is first displayed. height a shorthand descriptor for setting both min-height and max-height. zoom sets the
initial zoom factor. min-zoom sets the minimum zoom factor. max-zoom sets the maximum zoom factor. user-zoom controls whether or not the user should be able to change the zoom factor. orientation controls the document's orientation. viewport-fit controls the display of the document on non-rectangular displays. formal syntax @viewport { <group-rule-body> } examples setting viewport siz...
...And 2 more matches
Attribute selectors - CSS: Cascading Style Sheets
reats the type attribute. ...
...yle-type: upper-alpha; background: lime; } html <ol type="a"> <li>example list</li> </ol> result specifications specification status comment selectors level 4the def
inition of 'attribute selectors' in that specification. working draft adds modifier for ascii case-sensitive and case-insensitive attribute value selection. ...
...ons specification status comment selectors level 4the def
inition of 'attribute selectors' in that specification. working draft adds modifier for ascii case-sensitive and case-insensitive attribute value selection. selectors level 3the def
inition of 'attribute selectors' in that specification. ...
...And 2 more matches
Basic Concepts of grid layout - CSS: Cascading Style Sheets
r: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } the fr unit tracks can be defined using any length unit. grid also introduces an additional length unit to help us create flexible grid tracks. the new fr unit represents a fraction of the available space in the grid container. the next grid def
inition would create three equal width tracks that grow and shrink according to the available space. <div class="wrapper"> <div>one</div> <div>two</div> <div>three</div> <div>four</div> <div>five</div> </div> .wrapper { display: grid; grid-template-columns: 1fr 1fr 1fr; } * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color:...
...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...
...o 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 def
inition: .wrapper { display: grid; grid-template-columns: 1fr 1fr 1fr; } can also be written as: .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); } repeat notation can be used for a part of the track listing. in this next example i have created a grid with an
initial 20-pixel track, then a repeating section of 6 1fr tracks then a final 20-pixel track. .wrapper { displa...
...And 2 more matches
animation-fill-mode - CSS: Cascading Style Sheets
rules for both forwards and backwards, thus extending the animation properties in both directions. note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property values. formal def
inition
initial valuenoneapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <single-animation-fill-mode>#where <single-animation-fill-mode> = none | forwards | backwards | both examples you can see the effect of animation-fill-mode in the following example. it demonstrates how, for an animation that runs for an inf...
...ion
initial valuenoneapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <single-animation-fill-mode>#where <single-animation-fill-mode> = none | forwards | backwards | both examples you can see the effect of animation-fill-mode in the following example. it demonstrates how, for an animation that runs for an inf
inite time, you can cause it to remain in its final state rather than reverting to the original state (which is the default). html <p>move your mouse over the gray box!</p> <div class="demo"> <div class="growsandstays">this grows and stays big.</div> <div class="grows">this just grows.</div> </div> css .demo { border-top: 100px solid #ccc; height: 300px; } @keyframes grow { 0% { font-siz...
... ...
...And 2 more matches
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
efox 64. -moz-window-frame-bottom firefox removed in firefox 64. -moz-window-frame-left firefox removed in firefox 64. -moz-window-frame-right firefox removed in firefox 64. -moz-window-titlebar firefox removed in firefox 64. -moz-window-titlebar-maximized firefox removed in firefox 64. ...
... -moz-window-frame-bottom firefox removed in firefox 64. -moz-window-frame-left firefox removed in firefox 64. -moz-window-frame-right firefox removed in firefox 64. -moz-window-titlebar firefox removed in firefox 64. -moz-window-titlebar-maximized firefox removed in firefox 64. ...
... ...
...And 2 more matches
backface-visibility - CSS: Cascading Style Sheets
e is a mirror image of its front face. though invisible in 2d, the back face can become visible when a transformation causes the element to be rotated in 3d space. ...
...ity: hidden; /* global values */ backface-visibility: inherit; backface-visibility:
initial; backface-visibility: unset; the backface-visibility property is specified as one of the keywords listed below. values visible the back face is visible when turned towards the user. hidden the back face is hidden, effectively making the element invisible when turned away from the user. formal def
inition
initial valuevisibleapplies totransformable elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax visible | hidden examples cube with transparent and opaque faces this example shows a cube with transparent faces, and one with opaque faces. html <table> <tr> <th><code>backface-visibility: visible;</code></th> <th><code>backface-visibility: hidden;</...
... ...
...And 2 more matches
background-origin - CSS: Cascading Style Sheets
tribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note that background-origin is ignored when background-attachment is fixed. ...
...und-origin: inherit; background-origin:
initial; background-origin: unset; the background-origin property is specified as one of the keyword values listed below. values border-box the background is positioned relative to the border box. padding-box the background is positioned relative to the padding box. content-box the background is positioned relative to the content box. formal def
inition
initial valuepadding-boxapplies toall elements. it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <box>#where <box> = border-box | padding-box | content-box examples setting background origins .example { border: 10px double; padding: 10px; background: url('image.jpg'); background-position: center left; b...
... ...
...And 2 more matches
background-position - CSS: Cascading Style Sheets
the position is relative to the position layer set by background-origin. 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. ...
... values <position> a <position>. a position defines an x/y coordinate, to place an item relative to the edges of an element's box. it can be defined using one to four values. if two non-keyword values are used, the first value represents the horizontal positio...
...eft of the container, in this example that puts the right edge of the 300px-wide image in the center of the container) it's worth mentioning that if your background-size is equal to the container size for a given axis, then a percentage position for that axis will have no effect because the "container-image difference" will be zero. you will need to offset using absolute values. formal def
inition
initial value0% 0%applies toall elements. it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the size of the background positioning area minus size of background image; size refers to the width for horizontal offsets and to the height for vertical offsetscomputed valuea list, each item consisting of two keywords representing the origin and two offsets from that ...
...And 2 more matches
<basic-shape> - CSS: Cascading Style Sheets
ate system for the shape has its origin at the top-left corner of the reference box, with the x-axis running to the right and the y-axis running downwards. all the lengths expressed in percentages are resolved from the used dimensions of the reference box. shape functions the following shapes are supported. all <basic-shape> values use functional notation and are defined here using the value def
inition syntax. inset() inset( <shape-arg>{1,4} [round <border-radius>]? ) defines an inset rectangle. when all of the first four arguments are supplied they represent the top, right, bottom and left offsets from the reference box inward that define the positions of the edges of the inset rectangle. these arguments follow the syntax of the margin shorthand, that let you set all four insets w...
... to animate a clip path between two polygons. note that both polygons have the same number of vertices, which is necessary for this type of animation to work. ...
... ...
...And 2 more matches
block-size - CSS: Cascading Style Sheets
teractive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...lock-size: min-content; block-size: fit-content(20em); block-size: auto; /* global values */ block-size: inherit; block-size:
initial; block-size: unset; if the writing mode is vertically oriented, the value of block-size relates to the width of the element; otherwise, it relates to the height of the element. a related property is inline-size, which defines the other dimension of the element. ...
... of the element. a related property is inline-size, which defines the other dimension of the element.
initial valueautoapplies tosame as width and heightinheritednopercentagesblock-size of containing blockcomputed valuesame as width and heightanimation typea length, percentage or calc(); syntax values the block-size property takes the same values as the width and height properties. ...
...And 2 more matches
border-bottom-color - CSS: Cascading Style Sheets
, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <color> values */ border-bottom-color: red; border-bottom-color: #ffbb00; border-bottom-color: rgb(255, 0, 0); border-bottom-color: hsla(100%, 50%, 25%, 0.75); border-bottom-color: currentcolor; border-bottom-color: transparent; /* global values */ border-bottom-color: inherit; border-bottom-color:
initial; border-bottom-color: unset; the border-bottom-color property is specified as a single value. values <color> the color of the bottom border. formal def
inition
initial valuecurrentcolorapplies toall elements. it also applies to ::first-letter.inheritednocomputed valuecomputed coloranimation typea color formal syntax <'border-top-color'> examples a simple div with a border html <...
...lass="mybox"> <p>this is a box with a border around it. ...
... red; } result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-bottom-color' in that specification. candidate recommendation no significant changes, though the transparent keyword, now included in <color> which has been extended, has been formally removed. ...
...And 2 more matches
border-end-end-radius - CSS: Cascading Style Sheets
orientation. this is useful when building styles to work regardless of the text orientation and writing mode. /* <length> values */ /* with one value the corner will be a circle */ border-end-end-radius: 10px; border-end-end-radius: 1em; /* with two values the corner will be an ellipse */ border-end-end-radius: 1em 2em; /* global values */ border-end-end-radius: inherit; border-end-end-radius:
initial; border-end-end-radius: unset; for instance, in a horizontal-tb writing mode this property corresponds to the border-bottom-right-radius property. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horiz...
...ty. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal def
inition
initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typ...
... ...
...And 2 more matches
border-end-start-radius - CSS: Cascading Style Sheets
n. this is useful when building styles to work regardless of the text orientation and writing mode. /* <length> values */ /* with one value the corner will be a circle */ border-end-start-radius: 10px; border-end-start-radius: 1em; /* with two values the corner will be an ellipse */ border-end-start-radius: 1em 2em; /* global values */ border-end-start-radius: inherit; border-end-start-radius:
initial; border-end-start-radius: unset; for instance, in a horizontal-tb writing mode this property corresponds to the border-top-right-radius property. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizo...
...ty. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal def
inition
initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typ...
... ...
...And 2 more matches
border-left-color - CSS: Cascading Style Sheets
examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <color> values */ border-left-color: red; border-left-color: #ffbb00; border-left-color: rgb(255, 0, 0); border-left-color: hsla(100%, 50%, 25%, 0.75); border-left-color: currentcolor; border-left-color: transparent; /* global values */ border-left-color: inherit; border-left-color:
initial; border-left-color: unset; the border-left-color property is specified as a single value. values <color> the color of the left border. formal def
inition
initial valuecurrentcolorapplies toall elements. it also applies to ::first-letter.inheritednocomputed valuecomputed coloranimation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-col...
... class="mybox"> <p>this is a box with a border around it. ...
...r: red; } result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-left-color' in that specification. candidate recommendation no significant changes, though the transparent keyword, now included in <color> which has been extended, has been formally removed. ...
...And 2 more matches
border-right-color - CSS: Cascading Style Sheets
project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <color> values */ border-right-color: red; border-right-color: #ffbb00; border-right-color: rgb(255, 0, 0); border-right-color: hsla(100%, 50%, 25%, 0.75); border-right-color: currentcolor; border-right-color: transparent; /* global values */ border-right-color: inherit; border-right-color:
initial; border-right-color: unset; the border-right-color property is specified as a single value. values <color> the color of the right border. formal def
inition
initial valuecurrentcolorapplies toall elements. it also applies to ::first-letter.inheritednocomputed valuecomputed coloranimation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-...
...class="mybox"> <p>this is a box with a border around it. ...
...: red; } result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-right-color' in that specification. candidate recommendation no significant changes, though the transparent keyword, now included in <color> which has been extended, has been formally removed. ...
...And 2 more matches
border-spacing - CSS: Cascading Style Sheets
he table. note: the border-spacing property is equivalent to the deprecated cellspacing <table> attribute, except that it has an optional second value that can be used to set different horizontal and vertical spacing. syntax /* <length> */ border-spacing: 2px; /* horizontal <length> | vertical <length> */ border-spacing: 1cm 2em; /* global values */ border-spacing: inherit; border-spacing:
initial; border-spacing: unset; the border-spacing property may be specified as either one or two values. when one <length> value is specified, it defines both the horizontal and vertical spacings between cells. when two <length> values are specified, the first value defines the horizontal spacing between cells (i.e., the space between cells in adjacent columns), and the second value defines the...
...th the horizontal and vertical spacings between cells. when two <length> values are specified, the first value defines the horizontal spacing between cells (i.e., the space between cells in adjacent columns), and the second value defines the vertical spacing between cells (i.e., the space between cells in adjacent rows). values <length> the size of the spacing as a fixed value. formal def
inition
initial value0applies totable and inline-table elementsinheritedyescomputed valuetwo absolute lengthsanimation typediscrete formal syntax <length> <length>? examples spacing and padding table cells this example applies a spacing of .5em vertically and 1em horizontally between a table's cells. note how, along its outside edges, the table's padding values are added to its border-spacing va...
... ...
...And 2 more matches
border-start-end-radius - CSS: Cascading Style Sheets
n. this is useful when building styles to work regardless of the text orientation and writing mode. /* <length> values */ /* with one value the corner will be a circle */ border-start-end-radius: 10px; border-start-end-radius: 1em; /* with two values the corner will be an ellipse */ border-start-end-radius: 1em 2em; /* global values */ border-start-end-radius: inherit; border-start-end-radius:
initial; border-start-end-radius: unset; for instance, in a horizontal-tb writing mode this property corresponds to the border-bottom-left-radius property. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the hori...
...ty. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal def
inition
initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typ...
... ...
...And 2 more matches
border-start-start-radius - CSS: Cascading Style Sheets
useful when building styles to work regardless of the text orientation and writing mode. /* <length> values */ /* with one value the corner will be a circle */ border-start-start-radius: 10px; border-start-start-radius: 1em; /* with two values the corner will be an ellipse */ border-start-start-radius: 1em 2em; /* global values */ border-start-start-radius: inherit; border-start-start-radius:
initial; border-start-start-radius: unset; for instance, in a horizontal-tb writing mode this property corresponds to the border-top-left-radius property. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horiz...
...ty. syntax values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal def
inition
initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typ...
... ...
...And 2 more matches
border-top-color - CSS: Cascading Style Sheets
ractive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <color> values */ border-top-color: red; border-top-color: #ffbb00; border-top-color: rgb(255, 0, 0); border-top-color: hsla(100%, 50%, 25%, 0.75); border-top-color: currentcolor; border-top-color: transparent; /* global values */ border-top-color: inherit; border-top-color:
initial; border-top-color: unset; the border-top-color property is specified as a single value. values <color> the color of the top border. formal def
inition
initial valuecurrentcolorapplies toall elements. it also applies to ::first-letter.inheritednocomputed valuecomputed coloranimation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> ...
...l <div class="mybox"> <p>this is a box with a border around it. ...
...or: red; } result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-top-color' in that specification. ...
...And 2 more matches
box-shadow - CSS: Cascading Style Sheets
if only two values are given, they are interpreted as <offset-x><offset-y> values. if a third value is given, it is interpreted as a <blur-radius>. if a fourth value is given, it is interpreted as a <spread-radius>. optionally, the inset keyword. optionally, a <color> value. t...
...et, then the interpolated shadow must match the input shadows in that regard. if any pair of input shadows has one inset and the other not inset, the entire shadow list is uninterpolable. if the lists of shadows have different lengths, then the shorter list is padded at the end with shadows whose color is transparent, all lengths are 0, and whose inset (or not) matches the longer list. formal def
inition
initial valuenoneapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueany length made absolute; any specified color computed; otherwise as specifiedanimation typea shadow list formal syntax none | <shadow>#where <shadow> = inset? && <length>{2,4} && <color>?where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <d...
...rlap adjacent elements or go beyond the border of the containing box. ...
...And 2 more matches
box-sizing - CSS: Cascading Style Sheets
ontent. on the other hand, when using position: relative or position: absolute, use of box-sizing: content-box allows the positioning values to be relative to the content, and independent of changes to border and padding sizes, which is sometimes desirable. syntax the box-sizing property is specified as a single keyword chosen from the list of values below. values content-box this is the
initial and default value as specified by the css standard. the width and height properties include the content, but does not include the padding, border, or margin. for example, .box {width: 350px; border: 10px solid black;} renders a box that is 370px wide. here, the dimensions of the element are calculated as: width = width of the content, and height = height of the content. (borders and padding a...
...order: 10px solid black;} renders a box that is 350px wide, with the area for content being 330px wide. the content box can't be negative and is floored to 0, making it impossible to use border-box to make the element disappear. here the dimensions of the element are calculated as: width = border + padding + width of the content, and height = border + padding + height of the content. formal def
inition
initial valuecontent-boxapplies toall elements that accept width or heightinheritednocomputed valueas specifiedanimation typediscrete formal syntax content-box | border-box examples box sizes with content-box and border-box this example shows how different box-sizing values alter the rendered size of two otherwise identical elements. html <div class="content-box">content box</div> <br>...
... ...
...And 2 more matches
break-after - CSS: Cascading Style Sheets
to determine if a break must be done, the following rules are applied: if any of the three concerned values is a forced break...
...ould be aliased as follows: page-break-after break-after auto auto left left right right avoid avoid always page the always value of page-break-* was implemented by browsers as a page break, and not as a column break. therefore the aliasing is to page, rather than the always value in the level 4 spec. ...
...liased as follows: page-break-after break-after auto auto left left right right avoid avoid always page the always value of page-break-* was implemented by browsers as a page break, and not as a column break. therefore the aliasing is to page, rather than the always value in the level 4 spec. ...
...And 2 more matches
break-before - CSS: Cascading Style Sheets
to determine if a break must be done, the following rules are applied: if any of the three concerned values is a forced brea...
...ld be aliased as follows: page-break-before break-before auto auto left left right right avoid avoid always page the always value of page-break-* was implemented by browsers as a page break, and not as a column break. therefore the aliasing is to page, rather than the always value in the level 4 spec. ...
...ased as follows: page-break-before break-before auto auto left left right right avoid avoid always page the always value of page-break-* was implemented by browsers as a page break, and not as a column break. therefore the aliasing is to page, rather than the always value in the level 4 spec. ...
...And 2 more matches
break-inside - CSS: Cascading Style Sheets
the break-inside css property sets how page, column, or region breaks should behave inside a generated box. if there is no generated box, the property is ignored. /* keyword values */ break-inside: auto; break-inside: avoid; break-inside: avoid-page; break-inside: avoid-column; break-inside: avoid-region; /* global values */ break-inside: inherit; break-inside:
initial; break-inside: unset; each possible break point (in other words, each element boundary) is affected by three properties: the break-after value of the previous element, the break-before value of the next element, and the break-inside value of the containing element. to determine if a break must be done, the following rules are applied: if any of the three concerned values is a forced break value (always, left, right, pag...
... principal box. page break aliases for compatibility reasons, the legacy page-break-inside property should be treated by browsers as an alias of break-inside. this ensures that sites using page-break-inside continue to work as designed. ...
...l box. page break aliases for compatibility reasons, the legacy page-break-inside property should be treated by browsers as an alias of break-inside. this ensures that sites using page-break-inside continue to work as designed. ...
...And 2 more matches
caption-side - CSS: Cascading Style Sheets
contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* directional values */ caption-side: top; caption-side: bottom; /* warning: non-standard values */ caption-side: left; caption-side: right; caption-side: top-outside; caption-side: bottom-outside; /* global values */ caption-side: inherit; caption-side:
initial; caption-side: unset; the caption-side property is specified as one of the keyword values listed below. values top the caption box should be positioned above the table. bottom the caption box should be positioned below the table. left the caption box should be positioned on the left side of the table. this value was proposed for css 2, but removed from the final css 2.1 specifi...
... in a future specification. bottom-outside the caption box should be positioned below the table, while the width and horizontal alignment behavior are not bound to the table's horizontal layout. the css 2.1 specification notes that the css 2 specification described a different behavior for the bottom value, which will be reintroduced by this value in a future specification. ...
...ure specification. bottom-outside the caption box should be positioned below the table, while the width and horizontal alignment behavior are not bound to the table's horizontal layout. the css 2.1 specification notes that the css 2 specification described a different behavior for the bottom value, which will be reintroduced by this value in a future specification. ...
...And 2 more matches
caret-color - CSS: Cascading Style Sheets
agent may choose a different color to ensure good visibility and contrast with the surrounding content, taking into account the value of currentcolor, the background, shadows, and other factors. note: while user agents may use currentcolor (which is usually animatable) for the auto value, auto is not interpolated in transitions and animations. <color> the color of the caret. ...
...y choose a different color to ensure good visibility and contrast with the surrounding content, taking into account the value of currentcolor, the background, shadows, and other factors. note: while user agents may use currentcolor (which is usually animatable) for the auto value, auto is not interpolated in transitions and animations. <color> the color of the caret. ...
... ...
...And 2 more matches
color - CSS: Cascading Style Sheets
note that the value must be a uniform color. it can't be a <gradient>, which is actually a type of <image>. values <color> sets the color of the textual and decorative parts of the element. accessibility concerns it is important to ensure that the contrast ratio between the color of the text and the background...
...es. in order to meet current web content accessibility guidelines (wcag), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. large text is defined as 18.66px and bold or larger, or 24px or larger. webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 formal def
inition
initial valuevaries from one browser to anotherapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueif the value is translucent, the computed value will be the rgba() corresponding one. if it isn't, it will be the rgb() corresponding one. the transparent keyword maps to rgba(0,0,0,0).animation typea color formal syntax <color>where <color> = <...
... 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(), device-cmyk(), a...
...And 2 more matches
display - CSS: Cascading Style Sheets
r example, using two values you might specify an inline flex container as follows: .container { display: inline flex; } this can currently be specified using a single value. .container { display: inline-flex; } for more information on these changes to the specification, see the article adapting to the new two-value syntax of display. global /* global values */ display: inherit; display:
initial; display: unset; description the individual pages for the different types of value that display can have set on it feature multiple examples of those values in action — see the syntax section. in addition, see the following material, which covers the various values of display in depth. adapting to the new two-value syntax of display css flow layout (display: block, display: inline) ...
...esentation in the accessibility tree. this will cause the table to no longer be announced properly by screen reading technology. short note on what css display properties do to table semantics — the paciello group hidden content for better a11y | go make things mdn understanding wcag, guideline 1.3 explanations understanding success criterion 1.3.1 | w3c understanding wcag 2.0 formal def
inition
initial valueinlineapplies toall elementsinheritednocomputed valueas the specified value, except for positioned and floating elements and the root element. in both cases the computed value may be a keyword other than the one specified.animation typediscrete formal syntax [ <display-outside> | <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy>wher...
...; function updatedisplay() { articles.foreach((article) => { article.style.display = select.value; }); } select.addeventlistener('change', updatedisplay); updatedisplay(); result note: you can find more examples in the pages for each separate display data type, linked above. ...
...And 2 more matches
empty-cells - CSS: Cascading Style Sheets
ve 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. this property has an effect only when the border-collapse property is separate. ...
...der-collapse property is separate. syntax /* keyword values */ empty-cells: show; empty-cells: hide; /* global values */ empty-cells: inherit; empty-cells:
initial; empty-cells: unset; the empty-cells property is specified as one of the keyword values listed below. values show borders and backgrounds are drawn like in normal cells. hide no borders or backgrounds are drawn. ...
...pse property is separate. syntax /* keyword values */ empty-cells: show; empty-cells: hide; /* global values */ empty-cells: inherit; empty-cells:
initial; empty-cells: unset; the empty-cells property is specified as one of the keyword values listed below. values show borders and backgrounds are drawn like in normal cells. hide no borders or backgrounds are drawn. ...
...And 2 more matches
filter - CSS: Cascading Style Sheets
alues */ filter: blur(5px); filter: brightness(0.4); filter: contrast(200%); filter: drop-shadow(16px 16px 20px blue); filter: grayscale(50%); filter: hue-rotate(90deg); filter: invert(75%); filter: opacity(25%); filter: saturate(30%); filter: sepia(60%); /* multiple filters */ filter: contrast(175%) brightness(3%); /* use no filter */ filter: none; /* global values */ filter: inherit; filter:
initial; filter: unset; with a function, use the following: filter: <filter-function> [<filter-function>]* | none for a reference to an svg <filter> element, use the following: filter: url(file.svg#filter-element-id) interpolation if both the beginning and end filters have a function list of the same length without <url>, each of their filter functions is interpolated according to its specifi...
... height: 100%; } table.standard-table th { border: 1px solid rgb(187, 187, 187); padding: 0px 5px; background: none repeat scroll 0% 0% rgb(238, 238, 238); text-align: left; font-weight: bold; } table.standard-table td { padding: 5px; border: 1px solid rgb(204, 204, 204); text-align: left; vertical-align: top; width:25%; height:auto; } #img3 { height:100%; } formal def
inition
initial valuenoneapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typea filter function list formal syntax none | <filter-function-list>where <filter-function-list> = [ <filter-function> | <url> ]+where <filter-function> = <blur()> | <brightness()> | <contrast()> | <drop-shadow...
... ...
...And 2 more matches
font-kerning - CSS: Cascading Style Sheets
pecified as one of the keyword values listed below. values auto the browser determines whether font kerning should be used or not. for example, some browsers will disable kerning on small fonts, since applying it could harm the readability of text. normal font kerning information stored in the font must be applied. none font kerning information stored in the font is disabled. formal def
inition
initial valueautoapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | normal | none examples enabling and disabling kerning html <div id="kern"></div> <div id="nokern"></div> <textarea id="input">av t. ij</textarea> css div { font-size: 2rem; font-family: serif; } #nokern { f...
... ...
... ...
...And 2 more matches
font-language-override - CSS: Cascading Style Sheets
the font-language-override css property controls the use of language-specific glyphs in a typeface. /* keyword value */ font-language-override: normal; /* <string> values */ font-language-override: "eng"; /* use english glyphs */ font-language-override: "trk"; /* use turkish glyphs */ /* global values */ font-language-override:
initial; font-language-override: inherit; font-language-override: unset; by default, html's lang attribute tells browsers to display glyphs designed specifically for that language. for example, a lot of fonts have a special character for the digraph fi that merge the dot on the "i" with the "f." however, if the language is set to turkish the typeface will likely know not to use the merged glyph; turkish has two versions of the "i," one with a dot (i) and one wit...
...es normal tells the browser to use font glyphs that are appropriate for the language specified by the lang attribute. this is the default value. <string> tells the browser to use font glyphs that are appropriate for the language specified by the string. the string must match a language tag found in the opentype language system. for example, "eng" is english, and "kor" is korean. formal def
inition
initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | <string> examples using danish glyphs html <p class="para1">default language setting.</p> <p class="para2">this is a string with the <code>font-language-override</code> set to danish.</p> css p.para1 { font...
... ...
...And 2 more matches
font-variation-settings - CSS: Cascading Style Sheets
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 /* use the default settings */ font-variation-settings: normal; /* set values for variable font axis names */ font-variation-settings: "xhgt" 0.7; /* global values */ font-variation-settings: inherit; font-variation-settings:
initial; font-variation-settings: unset; values this property's value can take one of two forms: normal text is laid out using default settings. <string> <number> when rendering text, the list of variable font axis names is passed to the text layout engine to enable or disable font features. each setting is always one or more pairs consisting of a <string> of 4 ascii characters followed by a ...
...t axis tags are case-sensitive. in order to use variable fonts on your operating system, you need to make sure that it is up to date. for example linux oses need the latest linux freetype version, and macos prior to 10.13 does not support variable fonts. if your operating system is not up to date, you will not be able to use variable fonts in web pages or the firefox developer tools. formal def
inition
initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typea transform formal syntax normal | [ <string> <number> ]# examples you can find a number of other variable fonts examples at our variable fonts guide, v-fonts.com, and axis-praxis.org. weight (wght) the following live example's css can be edit...
...les at our variable fonts guide, v-fonts.com, and axis-praxis.org. ...
...And 2 more matches
gap (grid-gap) - CSS: Cascading Style Sheets
the gap css property sets the gaps (gutters) between rows and columns. it is a shorthand for row-gap and column-gap. 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. css grid layout
initially defined the grid-gap property. this prefixed property is being replaced by gap. however, in order to support browsers that implemented grid-gap and not gap for grid, you will need to use the prefixed property as in the interactive example above. syntax /* one <length> value */ gap: 20px; gap: 1em; gap: 3vmin; gap: 0.5cm; /* one <percentage> value */ gap: 16%; gap: 100%; /* two <length> values */ gap: 20px 10px; gap: 1em 0.
...if <'column-gap'> is omitted, it’s set to the same value as <'row-gap'>. <'row-gap'> and <'column-gap'> are each specified as a <length> or a <percentage>. values <length> is the width of the gutter separating the grid lines. <percentage> is the width of the gutter ...
... optionally by a value for <'column-gap'>. if <'column-gap'> is omitted, it’s set to the same value as <'row-gap'>. <'row-gap'> and <'column-gap'> are each specified as a <length> or a <percentage>. values <length> is the width of the gutter separating the grid lines. <percentage> is the width of the gutter separating the grid lines, relative to the dimension of the element. ...
...And 2 more matches
grid-auto-columns - CSS: Cascading Style Sheets
<flex> is a non-negative dimension with the unit fr specifying the track’s flex factor. each <flex>-sized track takes...
... <flex> is 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. ...
...at argument if it is greater than the auto minimum. auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be streched by the align-content and justify-content properties. ...
...And 2 more matches
grid-auto-rows - CSS: Cascading Style Sheets
<flex> is a non-negative dimension with the unit fr specifying the track’s flex factor. each <flex>-sized track takes a ...
... <flex> is a non-negative dimension with the unit fr specifying the track’s flex factor. ...
...iner is sized under a minimal content constraint). auto is a keyword that is identical to maximal content if it's a maximum. as a minimum it represents the largest minimum size (as specified by min-width/min-height) of the grid items occupying the grid track. note: auto track sizes (and only auto track sizes) can be stretched by the align-content and justify-content properties. ...
...And 2 more matches
grid-template - CSS: Cascading Style Sheets
there are no named grid areas. rows and columns will be implicitly generated; their size will be determined by the grid-auto-rows and grid-auto-columns properties. <'grid-template-rows'> / <'grid-template-columns'> sets grid-template-rows and grid-template...
...r each size, and grid-template-columns to the track listing specified after the slash (or none, if not specified). note: the repeat() function isn’t allowed in these track listings, as the tracks are intended to visually line up one-to-one with the rows/columns in the “ascii art”. ...
...ote: the repeat() function isn’t allowed in these track listings, as the tracks are intended to visually line up one-to-one with the rows/columns in the “ascii art”. note: the grid shorthand accepts the same syntax, but also resets the implicit grid properties to their
initial values. use grid (as opposed to grid-template) to prevent these values from cascading in seperately. ...
...And 2 more matches
hanging-punctuation - CSS: Cascading Style Sheets
one-value syntax uses any one of the keyword values in the list below. two-value syntax uses one of the following: first together with any one of last, allow-end, or force-end last together with any one of first, allow-end, or force-end three-value syntax...
...ues none no character hangs. first an opening bracket or quote at the start of the first formatted line of an element hangs. last a closing bracket or quote at the end of the last formatted line of an element hangs. force-end a stop or 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. formal def
inition
initial valuenoneapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | [ first | [ force-end | allow-end ] | last ] examples setting opening and closing quotes to hang html <p>“lorem ipsum dolor sit amet, consectetur adipiscing elit. curabitur dignissim nunc mauris, et sollicitudin est scelerisque sed. praesent laoreet tortor massa, si...
... hang html <p>“lorem ipsum dolor sit amet, consectetur adipiscing elit. ...
...And 2 more matches
height - 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. the min-height and max-height properties override height. syntax /* keyword value */ height: auto; /* <length> values */ height: 120px; height: 10em; /* <percentage> value */ height: 75%; /* global values */ height: inherit; height:
initial; height: unset; values <length> defines the height as an absolute value. <percentage> defines the height as a percentage of the containing block's height. auto the browser will calculate and select a height for the specified element. max-content the intrinsic preferred height. min-content the intrinsic minimum height. fit-content(<length-percentage>) uses the fit-content formul...
... the available space replaced by the specified argument, i.e. min(max-content, max(min-content, )). accessibility concerns ensure that elements set with a height are not truncated and/or do not obscure other content when the page is zoomed to increase text size. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 formal def
inition
initial valueautoapplies toall elements but non-replaced inline elements, table columns, and column groupsinheritednopercentagesthe percentage is calculated with respect to the height of the generated box's containing block. if the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the value computes ...
... elements, table columns, and column groupsinheritednopercentagesthe percentage is calculated with respect to the height of the generated box's containing block. if the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the value computes to auto. ...
...And 2 more matches
image-rendering - CSS: Cascading Style Sheets
image is 100×100px, but its actual dimensions are 200×200px (or 50×50px), then the image will be upscaled (or downscaled) using the algorithm specified by image-rendering. this property has no effect on non-scaled images. syntax /* keyword values */ image-rendering: auto; image-rendering: crisp-edges; image-rendering: pixelated; /* global values */ image-rendering: inherit; image-rendering:
initial; image-rendering: unset; values auto the scaling algorithm is ua dependent. since version 1.9 (firefox 3.0), gecko uses bilinear resampling (high quality). smooth the image should be scaled with an algorithm that maximizes the appearance of the image. in particular, scaling algorithms that "smooth" colors are acceptable, such as bilinear interpolation. this is intended for images such...
...ted when scaling the image up, the nearest-neighbor algorithm must be used, so that the image appears to be composed of large pixels. when scaling down, this is the same as auto. note: the values optimizequality and optimizespeed present in an early draft (and coming from its svg counterpart image-rendering) are defined as synonyms for the smooth and pixelated values respectively. formal def
inition
initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | crisp-edges | pixelated examples setting image scaling algorithms in practical use, the pixelated and crisp-edges rules can be combined to provide some fallback for each other. (just prepend the actual rules with the fallback.) the canvas api can provide a fallback solu...
... ...
...And 2 more matches
ime-mode - CSS: Cascading Style Sheets
the ime-mode css property controls the state of the input method editor (ime) for text fields. this property is obsolete. /* keyword values */ ime-mode: auto; ime-mode: normal; ime-mode: active; ime-mode: inactive; ime-mode: disabled; /* global values */ ime-mode: inherit; ime-mode:
initial; ime-mode: unset; the ime-mode property is only partially and inconsistently implemented in browsers. it was introduced by microsoft with internet explorer 5 as a proprietary extension: -ms-ime-mode attribute | imemode property. note: in general, it's not appropriate for a public web site to change the ime mode. this property should only be used for private web applications or to undo the property if it was previously set by legacy code. syntax the ime-mode property is specified using one of the...
... code. syntax the ime-mode property is specified using one of the keyword values listed below. values auto no change is made to the current input method editor state. this is the default. normal the ime state should be normal; this value can be used in a user style sheet to override the page's setting. this value is not supported by internet explorer. active the input method editor is
initially active; text entry is performed through it unless the user specifically dismisses it. not supported on linux. inactive the input method editor is
initially inactive, but the user may activate it if they wish. not supported on linux. disabled the input method editor is disabled and may not be activated by the user. description unlike internet explorer, firefox's implementation of ime-m...
...rect the inappropriate behavior of sites that don't follow this recommendation by placing the following css into their user stylesheet: input[type=password] { ime-mode: auto !important; } the mac version of gecko 1.9 (firefox 3) can't recover the previous state of the ime when a field for which it is disabled loses focus, so mac users may get grumpy when you use the disabled value. formal def
inition
initial valueautoapplies totext fieldsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | normal | active | inactive | disabled examples disabling input method support this example disables input method support for a form field. in the past, this was commonly used on fields that entered data into databases which didn't support extended character sets. <input...
...And 2 more matches
justify-items - CSS: Cascading Style Sheets
baseline alignment: the baseline keyword, plus optionally one of first or last. positional alignment: one of: center, start, end, flex-start, flex-end, self-start, self-end, left, or right. plus optionally safe or unsafe. legacy alignment: the l...
...aligned as if the alignment mode were start. unsafe regardless of the relative sizes of the item and alignment container, the given alignment value is honored. legacy makes the value inherited by the box descendants. note that if a descendant has a justify-self: auto value, the legacy keyword is not considered by the descend, only the left, right, or center value associated to it. ...
...s if the alignment mode were start. unsafe regardless of the relative sizes of the item and alignment container, the given alignment value is honored. legacy makes the value inherited by the box descendants. note that if a descendant has a justify-self: auto value, the legacy keyword is not considered by the descend, only the left, right, or center value associated to it. ...
...And 2 more matches
justify-self - CSS: Cascading Style Sheets
baseline alignment: the baseline keyword, plus optionally one of first or last. positional alignment: one of: center, start, end, flex-start, flex-end, self-start, self-end, left, or right. plus optionally safe or unsafe. values ...
...constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container. safe if the size of the item overflows the alignment container, the item is instead aligned as if the alignment mode were start. unsafe regardless of the relative sizes of the item and alignment container, the given alignment value is honored. ...
...ts imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container. safe if the size of the item overflows the alignment container, the item is instead aligned as if the alignment mode were start. unsafe regardless of the relative sizes of the item and alignment container, the given alignment value is honored. ...
...And 2 more matches
letter-spacing - CSS: Cascading Style Sheets
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. syntax /* keyword value */ letter-spacing: normal; /* <length> values */ letter-spacing: 0.3em; letter-spacing: 3px; letter-spacing: .3px; /* global values */ letter-spacing: inherit; letter-spacing:
initial; letter-spacing: unset; values normal the normal letter spacing for the current font. unlike a value of 0, this keyword allows the user agent to alter the space between characters in order to justify text. <length> specifies extra inter-character space in addition to the default space between characters. values may be negative, but there may be implementation-specific limits. user agen...
...here the word(s) may be unrecognizable. legible letter-spacing must be determined on a case-by-case basis, as different font families have different character widths. there is no one value that can ensure all font families automatically maintain their legibility. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.8 | w3c understanding wcag 2.0 formal def
inition
initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valuean optimum value consisting of either an absolute length or the keyword normalanimation typea length formal syntax normal | <length> examples setting letter spacing html <p class="normal">letter spacing</p> <p class="em-wide">letter spacing</p> <p class="em-wider">lett...
...tter spacing</p> <p class="em-tight">letter spacing</p> <p class="px-wide">letter spacing</p> css .normal { letter-spacing: normal; } .em-wide { letter-spacing: 0.4em; } .em-wider { letter-spacing: 1em; } .em-tight { letter-spacing: -0.05em; } .px-wide { letter-spacing: 6px; } result specifications specification status comment css text module level 3the def
inition of 'letter-spacing' in that specification. working draft no change. css level 2 (revision 1)the def
inition of 'letter-spacing' in that specification. recommendation no change. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'letter-spacing' in that specification. recommendation
initial svg def
inition. css level 1the def
inition o...
...And 2 more matches
margin-left - CSS: Cascading Style Sheets
margin-left is ignored, and will have the same calculated value as if the auto value was specified. syntax /* <length> values */ margin-left: 10px; /* an absolute length */ margin-left: 1em; /* relative to the text size */ margin-left: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-left: auto; /* global values */ margin-left: inherit; margin-left:
initial; margin-left: unset; the margin-left property is specified as the keyword auto, or a <length>, or a <percentage>. its value can be positive, zero, or negative. values <length> the size of the margin as a fixed value. <percentage> the size of the margin as a percentage, relative to the width of the containing block. auto the left margin receives a share of the unused horizontal space...
... and margin-right are set to auto. in this case, it is set to the value centering the border area inside the available width, if fixed. absolutely positioned layout mode flex, inline-flex any any 0, except if there is any positive horizontal free space. in this case, it is evenly distributed to all horizontal auto margins. flexbox layout mode formal def
inition
initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table. it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> | auto examples settin...
... recommendation like in css1, b...
...And 2 more matches
mask-position - CSS: Cascading Style Sheets
values <position> one to four values representing a 2d position regarding the edges of the element's box. relative or absolute offsets can be given. ...
...for each defined mask image. ...
...m 1rem, center; /* global values */ mask-position: inherit; mask-position:
initial; mask-position: unset; syntax one or more <position> values, separated by commas. values <position> one to four values representing a 2d position regarding the edges of the element's box. relative or absolute offsets can be given. note that the position can be set outside of the element's box. ...
...And 2 more matches
mask-size - CSS: Cascading Style Sheets
syntax one or more <bg-size> values, separated by commas. a <bg-size> can be specified in one of three ways: using the keyword contain usi...
... syntax one or more <bg-size> values, separated by commas. ...
...d dimension and compute the other dimension from the specified dimension and the intrinsic proportion. if the image has no intrinsic proportion, use the specified dimension for that dimension. for the other dimension, use the image's corresponding intrinsic dimension if there is one. if there is no such intrinsic dimension, use the corresponding dimension of the mask positioning area. ...
...And 2 more matches
offset-anchor - CSS: Cascading Style Sheets
<position> a <position> defines an x/y coordinate, to place an item relative to the edges of an element's box. it can be defined using one to four values. for more specifics, see the <position> and ...
... its value from offset-position. <position> a <position> defines an x/y coordinate, to place an item relative to the edges of an element's box. it can be defined using one to four values. for more specifics, see the <position> and background-position reference pages. note that the 3-value position syntax does not work for any usage of <position>, except for in background(-position). ...
...e from offset-position. <position> a <position> defines an x/y coordinate, to place an item relative to the edges of an element's box. it can be defined using one to four values. for more specifics, see the <position> and background-position reference pages. note that the 3-value position syntax does not work for any usage of <position>, except for in background(-position). ...
...And 2 more matches
outline-offset - CSS: Cascading Style Sheets
d the edge or border of an element. 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 /* <length> values */ outline-offset: 3px; outline-offset: 0.2em; /* global values */ outline-offset: inherit; outline-offset:
initial; outline-offset: unset; values <length> the width of the space between the element and its outline. a negative value places the outline inside the element. a value of 0 places the outline so that there is no space between it and the element. description an outline is a line that is drawn around an element, outside the border edge. the space between an element and its outline is transp...
...element and its outline. a negative value places the outline inside the element. a value of 0 places the outline so that there is no space between it and the element. description an outline is a line that is drawn around an element, outside the border edge. the space between an element and its outline is transparent. in other words, it is the same as the parent element's background. ...
...nd its outline. a negative value places the outline inside the element. a value of 0 places the outline so that there is no space between it and the element. description an outline is a line that is drawn around an element, outside the border edge. the space between an element and its outline is transparent. in other words, it is the same as the parent element's background. ...
...And 2 more matches
padding-left - CSS: Cascading Style Sheets
a pull request. an element's padding area is the space between its content and its border. note: the padding property can be used to set paddings on all four sides of an element with a single declaration. ...
...:
initial; padding-left: unset; the padding-left property is specified as a single value chosen from the list below. unlike margins, negative values are not allowed for padding. values <length> the size of the padding as a fixed value. must be nonnegative. <percentage> the size of the padding as a percentage, relative to the width of the containing block. must be nonnegative. formal def
inition
initial value0applies toall elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column. it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> ex...
... ...
...And 2 more matches
padding-top - CSS: Cascading Style Sheets
us a pull request. an element's padding area is the space between its content and its border. note: the padding property can be used to set paddings on all four sides of an element with a single declaration. ...
...op:
initial; padding-top: unset; the padding-top property is specified as a single value chosen from the list below. unlike margins, negative values are not allowed for padding. values <length> the size of the padding as a fixed value. must be nonnegative. <percentage> the size of the padding as a percentage, relative to the width of the containing block. must be nonnegative. formal def
inition
initial value0applies toall elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column. it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> ex...
... ...
...And 2 more matches
padding - CSS: Cascading Style Sheets
each value is a <length> or a <percentage>. negative values are invalid. when one value is specified, it applies the same padding to all four sides. when two values are specified, the first padding applies to the top and bottom, the second to the left and right. when three values are specified,...
...ecified, the first padding applies to the top, the second to the right and left, the third to the bottom. when four values are specified, the paddings apply to the top, right, bottom, and left in that order (clockwise). values <length> the size of the padding as a fixed value. <percentage> the size of the padding as a percentage, relative to the width of the containing block. formal def
inition
initial valueas each of the properties of the shorthand:padding-bottom: 0padding-left: 0padding-right: 0padding-top: 0applies toall elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column. it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valueas each of t...
... ...
...And 2 more matches
paint-order - CSS: Cascading Style Sheets
hen drawing svg shapes involving the use of the marker-* properties (e.g. marker-start) and <marker> element. they do not apply to html text, so in that case, you can only determine the order of stroke and fill. values normal paint the different items in normal paint order. stroke, fill, markers specify some or all of these values in the order you want them to be painted in. ...
...ng svg shapes involving the use of the marker-* properties (e.g. marker-start) and <marker> element. they do not apply to html text, so in that case, you can only determine the order of stroke and fill. values normal paint the different items in normal paint order. stroke, fill, markers specify some or all of these values in the order you want them to be painted in. ...
... ...
...And 2 more matches
place-self - CSS: Cascading Style Sheets
normal the effect of this keyword is dependent of the layout mode we are in: in absolutely-positioned layouts, the keyword behaves like start on replaced absolutely-positioned boxes, and as stretch on all other absolutely-positioned boxes. in static position of absolutely-positioned layouts, the keyword be...
...ombined size of the items along the cross axis is less than the size of the alignment container and the item is auto-sized, its size is increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size of all auto-sized items exactly fills the alignment container along the cross axis. ...
...ize of the items along the cross axis is less than the size of the alignment container and the item is auto-sized, its size is increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size of all auto-sized items exactly fills the alignment container along the cross axis. ...
...And 2 more matches
repeating-linear-gradient() - CSS: Cascading Style Sheets
the function's result is an object of the <gradient> data type, which is a special kind of <image>. 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. ...
...point of the color transition is the midpoint between two color stops. note: rendering of color stops in css gradients follows the same rules as color stops in svg gradients. ...
... ...
...And 2 more matches
right - CSS: Cascading Style Sheets
ve 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 /* <length> values */ right: 3px; right: 2.4em; /* <percentage>s of the width of the containing block */ right: 10%; /* keyword value */ right: auto; /* global values */ right: inherit; right:
initial; right: unset; values <length> a negative, null, or positive <length> that represents: for absolutely positioned elements, the distance to the right edge of the containing block. for relatively positioned elements, the distance that the element is moved to the left of its normal position. <percentage> a <percentage> of the containing block's width. auto specifies that: ...
...if not prevented from doing so by other properties, the element will stretch to satisfy both. if the element cannot stretch to satisfy both -- for example, if a width is declared -- the position of the element is over-constrained. when this is the case, the left value has precedence when the container is left-to-right; the right value has precedence when the container is right-to-left. ...
...evented from doing so by other properties, the element will stretch to satisfy both. if the element cannot stretch to satisfy both -- for example, if a width is declared -- the position of the element is over-constrained. when this is the case, the left value has precedence when the container is left-to-right; the right value has precedence when the container is right-to-left. ...
...And 2 more matches
rotate - CSS: Cascading Style Sheets
equivalent to a rotatex()/rotatey()/rotatez() (3d rotation) function. vector plus angle value three <number>s representing an origin-centered vector that defines a line around which you want to rotate the element, plus an <angle> specifying the angle to rotate the element through. equivalent to a rotate3d() (3d rotation) function. none specifies that no rotation should be applied. ...
...t to a rotatex()/rotatey()/rotatez() (3d rotation) function. vector plus angle value three <number>s representing an origin-centered vector that defines a line around which you want to rotate the element, plus an <angle> specifying the angle to rotate the element through. equivalent to a rotate3d() (3d rotation) function. none specifies that no rotation should be applied. ...
... ...
...And 2 more matches
row-gap (grid-row-gap) - CSS: Cascading Style Sheets
the row-gap css property sets the size of the gap (gutter) between an element's grid rows. 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. css grid layout
initially defined the grid-row-gap property. this prefixed property is being replaced by row-gap. ...
...fixed property is being replaced by row-gap. however, in order to support browsers that implemented grid-row-gap and not row-gap for grid, you will need to use the prefixed property as in the interactive example above. ...
... in the interactive example above. syntax /* <length> values */ row-gap: 20px; row-gap: 1em; row-gap: 3vmin; row-gap: 0.5cm; /* <percentage> value */ row-gap: 10%; /* global values */ row-gap: inherit; row-gap:
initial; row-gap: unset; values <length-percentage> is the width of the gutter separating the rows. <percentage> values are relative to the dimension of the element. ...
...And 2 more matches
ruby-position - CSS: Cascading Style Sheets
the ruby-position css property defines the position of a ruby element relatives to its base element. it can be position over the element (over), under it (under), or between the characters, on their right side (inter-character). /* keyword values */ ruby-position: over; ruby-position: under; ruby-position: inter-character; /* global values */ ruby-position: inherit; ruby-position:
initial; ruby-position: unset; syntax values over is a keyword indicating that the ruby has to be placed over the main text for horizontal scripts and right to it for vertical scripts. under is a keyword indicating that the ruby has to be placed under the main text for horizontal scripts and left to it for vertical scripts. inter-character is a keyword indicating that the ruby has to be place...
...r is a keyword indicating that the ruby has to be placed over the main text for horizontal scripts and right to it for vertical scripts. under is a keyword indicating that the ruby has to be placed under the main text for horizontal scripts and left to it for vertical scripts. inter-character is a keyword indicating that the ruby has to be placed between the different characters. ...
...eyword indicating that the ruby has to be placed over the main text for horizontal scripts and right to it for vertical scripts. under is a keyword indicating that the ruby has to be placed under the main text for horizontal scripts and left to it for vertical scripts. inter-character is a keyword indicating that the ruby has to be placed between the different characters. ...
...And 2 more matches
scale - CSS: Cascading Style Sheets
<number>s that specify the x and y axis scaling values (respectively) of a 2d scale. equivalent to a scale() (2d scaling) function with two values specified. three length/percentage values three <number>s that specify the x, y, and z axis scaling values (respectively) of a 3d scale. equivalent to a scale3d() (3d scaling) function. none specifies that no scaling should be applied. ...
...s that specify the x and y axis scaling values (respectively) of a 2d scale. equivalent to a scale() (2d scaling) function with two values specified. three length/percentage values three <number>s that specify the x, y, and z axis scaling values (respectively) of a 3d scale. equivalent to a scale3d() (3d scaling) function. none specifies that no scaling should be applied. ...
... ...
...And 2 more matches
scroll-margin-inline - CSS: Cascading Style Sheets
inline shorthand property sets the scroll margins of an element in the inline dimension. constituent properties this property is a shorthand for the following css properties: scroll-margin-inline-end scroll-margin-inline-start syntax /* <length> values */ scroll-margin-inline: 10px; scroll-margin-inline: 1em .5em ; /* global values */ scroll-margin-inline: inherit; scroll-margin-inline:
initial; scroll-margin-inline: unset; values <length> an outset from the corresponding edge of the scroll container. description 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 con...
...orresponding edge of the scroll container. description 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 def
inition
initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length>{1,2} examples simple demonstration this example implements something very similar to the interactive example above, except that here we'll explain to you how it's implemented. the aim here is to create four horizontally-scrolling blocks, the second and thi...
...the start and end of the inline axis (x in our case), but only the end edge is really relevant. ...
...And 2 more matches
scroll-margin - CSS: Cascading Style Sheets
ase clone https://github.com/mdn/interactive-examples and send us a pull request. constituent properties this property is a shorthand for the following css properties: scroll-margin-bottom scroll-margin-left scroll-margin-right scroll-margin-top syntax /* <length> values */ scroll-margin: 10px; scroll-margin: 1em .5em 1em 1em; /* global values */ scroll-margin: 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...
...marily 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 def
inition
initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length>{1,4} examples simple demonstration this example implements something very similar to the interactive example above, except that here we'll explain to you how it's implemented. the aim here is to create four horizontally-scrolling blocks, the second and thi...
...e we are setting scroll-margin on all sides at once, but only the start edge is really relevant. ...
...And 2 more matches
scroll-padding-block-end - CSS: Cascading Style Sheets
e to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...-end: inherit; scroll-padding-block-end:
initial; scroll-padding-block-end: unset; values <length-percentage> an inwards offset from the block end edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...erit; scroll-padding-block-end:
initial; scroll-padding-block-end: unset; values <length-percentage> an inwards offset from the block end edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...And 2 more matches
scroll-padding-block-start - CSS: Cascading Style Sheets
ute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...inherit; scroll-padding-block-start:
initial; scroll-padding-block-start: unset; values <length-percentage> an inwards offset from the block start edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...scroll-padding-block-start:
initial; scroll-padding-block-start: unset; values <length-percentage> an inwards offset from the block start edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...And 2 more matches
scroll-padding-block - CSS: Cascading Style Sheets
scrollport. ...
...ng-block: inherit; scroll-padding-block:
initial; scroll-padding-block: unset; values <length-percentage> an inwards offset from the corresponding edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
... inherit; scroll-padding-block:
initial; scroll-padding-block: unset; values <length-percentage> an inwards offset from the corresponding edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...And 2 more matches
scroll-padding-bottom - CSS: Cascading Style Sheets
tory. 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. ...
...adding-bottom: inherit; scroll-padding-bottom:
initial; scroll-padding-bottom: unset; values <length-percentage> an inwards offset from the bottom edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...ttom: inherit; scroll-padding-bottom:
initial; scroll-padding-bottom: unset; values <length-percentage> an inwards offset from the bottom edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...And 2 more matches
scroll-padding-inline-end - CSS: Cascading Style Sheets
ontribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...nd: inherit; scroll-padding-inline-end:
initial; scroll-padding-inline-end: unset; values <length-percentage> an inwards offset from the inline end edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...it; scroll-padding-inline-end:
initial; scroll-padding-inline-end: unset; values <length-percentage> an inwards offset from the inline end edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...And 2 more matches
scroll-padding-inline-start - CSS: Cascading Style Sheets
the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...erit; scroll-padding-inline-start:
initial; scroll-padding-inline-start: unset; values <length-percentage> an inwards offset from the inline start edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...oll-padding-inline-start:
initial; scroll-padding-inline-start: unset; values <length-percentage> an inwards offset from the inline start edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...And 2 more matches
scroll-padding-inline - CSS: Cascading Style Sheets
ort. ...
...inline: inherit; scroll-padding-inline:
initial; scroll-padding-inline: unset; values <length-percentage> an inwards offset from the corresponding edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...nherit; scroll-padding-inline:
initial; scroll-padding-inline: unset; values <length-percentage> an inwards offset from the corresponding edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...And 2 more matches
scroll-padding-left - CSS: Cascading Style Sheets
ithub 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. ...
... scroll-padding-left: inherit; scroll-padding-left:
initial; scroll-padding-left: unset; values <length-percentage> an inwards offset from the left edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...adding-left: inherit; scroll-padding-left:
initial; scroll-padding-left: unset; values <length-percentage> an inwards offset from the left edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...And 2 more matches
scroll-padding-right - CSS: Cascading Style Sheets
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. ...
...roll-padding-right: inherit; scroll-padding-right:
initial; scroll-padding-right: unset; values <length-percentage> an inwards offset from the top edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...ing-right: inherit; scroll-padding-right:
initial; scroll-padding-right: unset; values <length-percentage> an inwards offset from the top edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...And 2 more matches
scroll-padding-top - CSS: Cascading Style Sheets
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. ...
... */ scroll-padding-top: inherit; scroll-padding-top:
initial; scroll-padding-top: unset; values <length-percentage> an inwards offset from the top edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...l-padding-top: inherit; scroll-padding-top:
initial; scroll-padding-top: unset; values <length-percentage> an inwards offset from the top edge of the scrollport, as a valid length or a percentage. auto the offset is determind by the user agent. this will generally be 0px, but a user agent is able to detect and do something else if a non-zero value is more appropriate. ...
...And 2 more matches
scroll-padding - CSS: Cascading Style Sheets
ollport. ...
...scroll-padding: inherit; scroll-padding:
initial; scroll-padding: unset; values <length-percentage> an inwards offset from the corresponding edge of the scrollport, as a valid <length> or a <percentage>. auto the offset is determind by the user agent. this will generally be 0px, but the user agent is free to detect and do something else if a non-zero value is more appropriate. ...
...dding: inherit; scroll-padding:
initial; scroll-padding: unset; values <length-percentage> an inwards offset from the corresponding edge of the scrollport, as a valid <length> or a <percentage>. auto the offset is determind by the user agent. this will generally be 0px, but the user agent is free to detect and do something else if a non-zero value is more appropriate. ...
...And 2 more matches
scroll-snap-stop - CSS: Cascading Style Sheets
the scroll-snap-stop css property defines whether the scroll container is allowed to "pass over" possible snap positions. /* keyword values */ scroll-snap-stop: normal; scroll-snap-stop: always; /* global values */ scroll-snap-type: inherit; scroll-snap-type:
initial; scroll-snap-type: unset; syntax values normal when the visual viewport of this element's scroll container is scrolled, it may "pass over" possible snap positions. ...
...ays; /* global values */ scroll-snap-type: inherit; scroll-snap-type:
initial; scroll-snap-type: unset; syntax values normal when the visual viewport of this element's scroll container is scrolled, it may "pass over" possible snap positions. always the scroll container must not "pass over" a possible snap position; and must snap to the first of this elements' snap positions. formal def
inition
initial valuenormalapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax normal | always examples snapping in different axes this example is duplicated from scroll-snap-type with minor variances. css /* setup */ :root, body { height: 100%; display: flex; align-items: center; justify-content: space-between; flex-flow: column nowrap; ...
...eight: 100%; display: flex; align-items: center; justify-content: space-between; flex-flow: column nowrap; font-family: monospace; } .container { display: flex; overflow: auto; outline: 1px dashed lightgray; flex: none; } .container.x { width: 100%; height: 128px; flex-flow: row nowrap; } .container.y { width: 256px; height: 256px; flex-flow: column nowrap; } /* def
inite scroll snap */ .mandatory-scroll-snapping > div { scroll-snap-stop: always; } .proximity-scroll-snapping > div { scroll-snap-stop: normal; } /* scroll-snap */ .x.mandatory-scroll-snapping { scroll-snap-type: x mandatory; } .y.mandatory-scroll-snapping { scroll-snap-type: y mandatory; } .x.proximity-scroll-snapping { scroll-snap-type: x proximity; } .y.proximity-scroll-snapping { s...
...And 2 more matches
table-layout - CSS: Cascading Style Sheets
o lay out <table> cells, rows, and columns. 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 /* keyword values */ table-layout: auto; table-layout: fixed; /* global values */ table-layout: inherit; table-layout:
initial; table-layout: unset; values auto by default, most browsers use an automatic table layout algorithm. the widths of the table and its cells are adjusted to fit the content. fixed table and column widths are set by the widths of table and col elements or by the width of the first row of cells. cells in subsequent rows do not affect column widths. under the "fixed" layout method, the ent...
...e can be rendered once the first table row has been downloaded and analyzed. this can speed up rendering time over the "automatic" layout method, but subsequent cell content might not fit in the column widths provided. cells use the overflow property to determine whether to clip any overflowing content, but only if the table has a known width; otherwise, they won't overflow the cells. formal def
inition
initial valueautoapplies totable and inline-table elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | fixed examples fixed-width tables with text-overflow this example uses a fixed table layout, combined with the width property, to restrict the table's width. the text-overflow property is used to apply an ellipsis to words that are too long to fit. if...
... ...
...And 2 more matches
text-align-last - CSS: Cascading Style Sheets
ke to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword values */ text-align-last: auto; text-align-last: start; text-align-last: end; text-align-last: left; text-align-last: right; text-align-last: center; text-align-last: justify; /* global values */ text-align-last: inherit; text-align-last:
initial; text-align-last: unset; values auto the affected line is aligned per the value of text-align, unless text-align is justify, in which case the effect is the same as setting text-align-last to start. start the same as left if direction is left-to-right and right if direction is right-to-left. end the same as right if direction is left-to-right and left if direction is right-to-left. ...
...ht and left if direction is right-to-left. left the inline contents are aligned to the left edge of the line box. right the inline contents are aligned to the right edge of the line box. center the inline contents are centered within the line box. justify the text is justified. text should line up their left and right edges to the left and right content edges of the paragraph. formal def
inition
initial valueautoapplies toblock containersinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | start | end | left | right | center | justify examples justifying the last line <p>integer elementum massa at nulla placerat varius. suspendisse in libero risus, in interdum massa. vestibulum ac leo vitae metus faucibus gravida ac in neque. nullam est eros, suscip...
... at nulla placerat varius. suspendisse in libero risus, in interdum massa. ...
...And 2 more matches
text-decoration-color - CSS: Cascading Style Sheets
t-decoration-line property), and specifying the line color (with text-decoration-color) on a per-element basis. syntax /* <color> values */ text-decoration-color: currentcolor; text-decoration-color: red; text-decoration-color: #00ff00; text-decoration-color: rgba(255, 128, 128, 0.5); text-decoration-color: transparent; /* global values */ text-decoration-color: inherit; text-decoration-color:
initial; text-decoration-color: unset; values <color> the color of the line decoration. accessibility concerns it is important to ensure that the contrast ratio between the color of the text, the background the text is placed over, and the text decoration line is high enough that people experiencing low vision conditions will be able to read the content of the page. color contrast ratio is de...
...etermined by comparing the luminosity of the text and background color values. color alone should not be used to convey meaning. for example, change of text and text-decoration-color alone is not enough to indicate a link has focus. webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 formal def
inition
initial valuecurrentcolorapplies toall elements. it also applies to ::first-letter and ::first-line.inheritednocomputed valuecomputed coloranimation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / ...
...the text-decoration property is now a shorthand to define multiple related properties. ...
...And 2 more matches
text-decoration-line - CSS: Cascading Style Sheets
values none produces no text decoration. underline each line of text has a decorative line beneath it. overline each line of text has a decorative line above it. line-through each line of text has a decorative line going through its middl...
...ion. underline each line of text has a decorative line beneath it. overline each line of text has a decorative line above it. line-through each line of text has a decorative line going through its middle. blink the text blinks (alternates between visible and invisible). conforming user agents may simply not blink the text. this value is deprecated in favor of css animations. formal def
inition
initial valuenoneapplies toall elements. it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax none | [ underline | overline | line-through | blink ] | spelling-error | grammar-error examples <p class="wavy">here's some text with wavy red underline!</p> <p class="both">this text has lines both above and below it.</p> ...
...the text-decoration property is now a shorthand to define multiple related properties. ...
...And 2 more matches
text-decoration-thickness - CSS: Cascading Style Sheets
that is used on text in an element, such as a line-through, underline, or overline. syntax /* single keyword */ text-decoration-thickness: auto; text-decoration-thickness: from-font; /* length */ text-decoration-thickness: 0.1em; text-decoration-thickness: 3px; /* percentage */ text-decoration-thickness: 10%; /* global values */ text-decoration-thickness: inherit; text-decoration-thickness:
initial; text-decoration-thickness: unset; values auto the browser chooses an appropriate width for the text decoration line. from-font if the font file includes information about a preferred thickness, use that value. if the font file doesn't include this information, behave as if auto was set, with the browser choosing an appropriate thickness. <length> specifies the thickness of the text ...
...ss of the text decoration line as a <percentage> of 1em in the current font. a percentage inherits as a relative value, and so therefore scales with changes in the font. the browser must use a minimum of 1 device pixel. for a given application of this property, the thickness is constant across the whole box it is applied to, even if there are child elements with a different font size. formal def
inition
initial valueautoapplies toall elements. it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the font size of the element itselfcomputed valueas specifiedanimation typeby computed value type formal syntax auto | from-font | <length> | <percentage> examples varying thickness html <p class="thin">here's some text with a 1px red underline.</p> <p class="thick"...
... note: the property used to be called text-decoration-width, but was updated in 2019 to text-decoration-thickness. ...
...And 2 more matches
text-emphasis-color - CSS: Cascading Style Sheets
the text-emphasis-color css property sets the color of emphasis marks. this value can also be set using the text-emphasis shorthand. /*
initial value */ text-emphasis-color: currentcolor; /* <color> */ text-emphasis-color: #555; text-emphasis-color: blue; text-emphasis-color: rgba(90, 200, 160, 0.8); text-emphasis-color: transparent; /* global values */ text-emphasis-color: inherit; text-emphasis-color:
initial; text-emphasis-color: unset; syntax values <color> defines the color of the emphasis marks. if no color is present, it defaults to currentcolor. ...
...color; /* <color> */ text-emphasis-color: #555; text-emphasis-color: blue; text-emphasis-color: rgba(90, 200, 160, 0.8); text-emphasis-color: transparent; /* global values */ text-emphasis-color: inherit; text-emphasis-color:
initial; text-emphasis-color: unset; syntax values <color> defines the color of the emphasis marks. if no color is present, it defaults to currentcolor. ...
...* <color> */ text-emphasis-color: #555; text-emphasis-color: blue; text-emphasis-color: rgba(90, 200, 160, 0.8); text-emphasis-color: transparent; /* global values */ text-emphasis-color: inherit; text-emphasis-color:
initial; text-emphasis-color: unset; syntax values <color> defines the color of the emphasis marks. if no color is present, it defaults to currentcolor. ...
...And 2 more matches
text-emphasis-position - CSS: Cascading Style Sheets
the text-emphasis-position css property sets where emphasis marks are drawn. like ruby text, if there isn't enough room for emphasis marks, the line height is increased. /*
initial value */ text-emphasis-position: over right; /* keywords value */ text-emphasis-position: over left; text-emphasis-position: under right; text-emphasis-position: under left; text-emphasis-position: left over; text-emphasis-position: right under; text-emphasis-position: left under; /* global values */ text-emphasis-position: inherit; text-emphasis-position:
initial; text-emphasis-position: unset; syntax values over draw marks over the text in horizontal writing mode. under draw marks under the text in horizontal writing mode. right draws marks to the right of the text in vertical writing mode. left...
... preferred emphasis mark and ruby position language preferred position illustration horizontal vertical japanese over right korean mongolian chinese under right note: the text-emphasis-position cannot be set, and therefore are not reset either, using the text-emphasis shorthand property. formal def
inition
initial valueover rightapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ over | under ] && [ right | left ] examples preferring ruby over emphasis marks some editors prefer to hide emphasis marks when they conflict with ruby. in html, this can be done with the following style rule: ruby { text-emphasis: none; } preferring emphasis mar...
...rks over ruby some other editors prefer to hide ruby when they conflict with emphasis marks. ...
...And 2 more matches
text-emphasis - CSS: Cascading Style Sheets
set the value of text-emphasis-position. this is because if the style and the color of emphasis marks may vary in a text, it is extremely unlikely that their position will. in the very rare cases when this is needed, the property text-emphasis-position. constituent properties this property is a shorthand for the following css properties: text-emphasis-color text-emphasis-style syntax /*
initial value */ text-emphasis: none; /* no emphasis marks */ /* <string> value */ text-emphasis: 'x'; text-emphasis: '点'; text-emphasis: '\25b2'; text-emphasis: '*' #555; text-emphasis: 'foo'; /* should not use. it may be computed to or rendered as 'f' only */ /* keywords value */ text-emphasis: filled; text-emphasis: open; text-emphasis: filled sesame; text-emphasis: open sesame; /* keywords va...
...xt-emphasis: '\25b2'; text-emphasis: '*' #555; text-emphasis: 'foo'; /* should not use. it may be computed to or rendered as 'f' only */ /* keywords value */ text-emphasis: filled; text-emphasis: open; text-emphasis: filled sesame; text-emphasis: open sesame; /* keywords value combined with a color */ text-emphasis: filled sesame #555; /* global values */ text-emphasis: inherit; text-emphasis:
initial; text-emphasis: unset; values none no emphasis marks. filled the shape is filled with solid color. if neither filled nor open is present, this is the default. open the shape is hollow. dot display small circles as marks. the filled dot is '•' (u+2022), and the open dot is '◦' (u+25e6). circle display large circles as marks. the filled circle is '●' (u+25cf), and the open ci...
...s '﹆' (u+fe46). this is the default shape in vertical writing modes when no other shape is given. <string> display the given string as marks. authors should not specify more than one character in <string>. the ua may truncate or ignore strings consisting of more than one grapheme cluster. <color> defines the color of the mark. if no color is present, it defaults to currentcolor. ...
...And 2 more matches
text-indent - CSS: Cascading Style Sheets
ght-to-left layout) edge of the containing block-level element's content box. syntax /* <length> values */ text-indent: 3mm; text-indent: 40px; /* <percentage> value relative to the containing block width */ text-indent: 15%; /* keyword values */ text-indent: 5em each-line; text-indent: 5em hanging; text-indent: 5em hanging each-line; /* global values */ text-indent: inherit; text-indent:
initial; text-indent: unset; values <length> indentation is specified as an absolute <length>. negative values are allowed. see <length> values for possible units. <percentage> indentation is a <percentage> of the containing block's width. each-line indentation affects the first line of the block container as well as each line after a forced line break, but does not affect lines after a so...
...d. see <length> values for possible units. <percentage> indentation is a <percentage> of the containing block's width. each-line indentation affects the first line of the block container as well as each line after a forced line break, but does not affect lines after a soft wrap break. hanging inverts which lines are indented. all lines except the first line will be indented. ...
...ength> values for possible units. <percentage> indentation is a <percentage> of the containing block's width. each-line indentation affects the first line of the block container as well as each line after a forced line break, but does not affect lines after a soft wrap break. hanging inverts which lines are indented. all lines except the first line will be indented. ...
...And 2 more matches
touch-action - CSS: Cascading Style Sheets
pulated by a touchscreen user (for example, by zooming features built into the browser). /* keyword values */ touch-action: auto; touch-action: none; touch-action: pan-x; touch-action: pan-left; touch-action: pan-right; touch-action: pan-y; touch-action: pan-up; touch-action: pan-down; touch-action: pinch-zoom; touch-action: manipulation; /* global values */ touch-action: inherit; touch-action:
initial; touch-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 f...
...combined with any of the pan- values. accessibility concerns a declaration of touch-action: none; may inhibit operating a browser's zooming capabilities. this will prevent people experiencing low vision conditions from being able to read and understand page content. ...
...with any of the pan- values. accessibility concerns a declaration of touch-action: none; may inhibit operating a browser's zooming capabilities. this will prevent people experiencing low vision conditions from being able to read and understand page content. ...
...And 2 more matches
transform-box - CSS: Cascading Style Sheets
the transform-box css property defines the layout box to which the transform and transform-origin properties relate. /* keyword values */ transform-box: content-box; transform-box: border-box; transform-box: fill-box; transform-box: stroke-box; transform-box: view-box; /* global values */ transform-box: inherit; transform-box:
initial; transform-box: unset; syntax the transform-box property is specified as one of the keyword values listed below. values content-box the content box is used as the reference box. the reference box of a <table> is the border box of its table wrapper box, not its table box. border-box the border box is used as the reference box. the reference box of a <table> is the border box of its table wrapper box, not its table box. fill-box the object boundi...
... box is used as the reference box. view-box the nearest svg viewport is used as the reference box. if a viewbox attribute is specified for the svg viewport creating element, the reference box is positioned at the origin of the coordinate system established by the viewbox attribute, and the dimension of the reference box is set to the width and height values of the viewbox attribute. ...
...sed as the reference box. view-box the nearest svg viewport is used as the reference box. if a viewbox attribute is specified for the svg viewport creating element, the reference box is positioned at the origin of the coordinate system established by the viewbox attribute, and the dimension of the reference box is set to the width and height values of the viewbox attribute. ...
...And 2 more matches
transform-style - CSS: Cascading Style Sheets
e https://github.com/mdn/interactive-examples and send us a pull request. if flattened, the element's children will not exist on their own in the 3d-space. as this property is not inherited, it must be set for all non-leaf descendants of the element. ...
...ment. syntax /* keyword values */ transform-style: flat; transform-style: preserve-3d; /* global values */ transform-style: inherit; transform-style:
initial; transform-style: unset; values flat indicates that the children of the element are lying in the plane of the element itself. preserve-3d indicates that the children of the element should be positioned in the 3d-space. formal def
inition
initial valueflatapplies totransformable elementsinheritednocomputed valueas specifiedanimation typediscretecreates stacking contextyes formal syntax flat | preserve-3d examples transform style demonstration in this example we have a 3d cube created using transforms. the parent container of the cube faces has transform-style: preserve-3d set on it by default, so it is transformed in the ...
... ...
...And 2 more matches
transform - CSS: Cascading Style Sheets
if perspective() is one of multiple function values, it must be listed first. values <transform-function> one or more of the css transform functions to be applied. the transform functions are multiplied in order from left to right, meaning that comp...
...rn off animations, preferrably site-wide. also, consider making use of the prefers-reduced-motion media feature — use it to write a media query that will turn off animations if the user has reduced animation specified in their system preferences. ...
...imations, preferrably site-wide. also, consider making use of the prefers-reduced-motion media feature — use it to write a media query that will turn off animations if the user has reduced animation specified in their system preferences. ...
...And 2 more matches
transition-timing-function - CSS: Cascading Style Sheets
the non-step keyword values (ease, linear, ease-in-out, etc.) each represent cubic bézier curve with fixed four point values, with the cubic-bezier() function value allowing for a non-pr...
...ention deficit hyperactivity disorder (adhd) and certain kinds of motion can be a trigger for vestibular disorders, epilepsy, and migraine and scotopic sensitivity. consider providing a mechanism for pausing or disabling animation, as well as using the reduced motion media query to create a complimentary experience for users who have expressed a preference for no animated experiences. ...
...ficit hyperactivity disorder (adhd) and certain kinds of motion can be a trigger for vestibular disorders, epilepsy, and migraine and scotopic sensitivity. consider providing a mechanism for pausing or disabling animation, as well as using the reduced motion media query to create a complimentary experience for users who have expressed a preference for no animated experiences. ...
...And 2 more matches
transition - CSS: Cascading Style Sheets
each single-property transition describes the transition that should be applied to a single property (or the special values all and none). it includes: zero or one value representing the property to which the transition should apply. this may be any one of: the ...
..., one, or two <time> values. the first value that can be parsed as a time is assigned to the transition-duration, and the second value that can be parsed as a time is assigned to transition-delay. see how things are handled when lists of property values aren't the same length. in short, extra transition descriptions beyond the number of properties actually being animated are ignored. ...
... two <time> values. the first value that can be parsed as a time is assigned to the transition-duration, and the second value that can be parsed as a time is assigned to transition-delay. see how things are handled when lists of property values aren't the same length. in short, extra transition descriptions beyond the number of properties actually being animated are ignored. ...
...And 2 more matches
Used value - CSS: Cascading Style Sheets
width: ${wid}.`; } function updateallusedwidths() { updateusedwidth("no-width"); updateusedwidth("width-50"); updateusedwidth("width-inherit"); } updateallusedwidths(); window.addeventlistener('resize', updateallusedwidths); result difference from computed value css 2.0 defined only computed value as the last step in a property's calculation. then, css 2.1 introduced the distinct def
inition of used value. an element could then explicitly inherit a width/height of a parent, whose computed value is a percentage. for css properties that don't depend on layout (e.g., display, font-size, or line-height), the computed values and used values are the same. the following are the css 2.1 properties that do depend on layout, so they have a different computed value and used value: (taken fro...
... ...
... ...
...And 2 more matches
visibility - CSS: Cascading Style Sheets
ute 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 indexe...
... support for visibility: collapse is missing or partially incorrect in some modern browsers. it may not be correctly treated like visibility: hidden on elements other than table rows and columns. visibility: collapse may change the layout of a table if the table has nested tables within the cells that are collapsed, unless visibility: visible is specified explicitly on nested tables. formal def
inition
initial valuevisibleapplies toall elementsinheritedyescomputed valueas specifiedanimation typea visibility formal syntax visible | hidden | collapse examples basic example html <p class="visible">the first paragraph is visible.</p> <p class="not-visible">the second paragraph is not visible.</p> <p class="visible">the third paragraph is visible. notice the second paragraph is still occup...
... ...
...And 2 more matches
width - CSS: Cascading Style Sheets
examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the min-width and max-width properties override width. syntax /* <length> values */ width: 300px; width: 25em; /* <percentage> value */ width: 75%; /* keyword values */ width: max-content; width: min-content; width: fit-content(20em); width: auto; /* global values */ width: inherit; width:
initial; width: unset; the width property is specified as either: one of the following keyword values: min-content, max-content, fit-content, auto. a <length> or a <percentage>. values <length> defines the width as an absolute value. <percentage> defines the width as a percentage of the containing block's width. auto the browser will calculate and select a width for the specified eleme...
...ble space replaced by the specified argument, i.e. min(max-content, max(min-content, <length-percentage>)). accessibility concerns ensure that elements set with a width aren't truncated and don't obscure other content when the page is zoomed to increase text size. ...
... replaced by the specified argument, i.e. min(max-content, max(min-content, <length-percentage>)). accessibility concerns ensure that elements set with a width aren't truncated and don't obscure other content when the page is zoomed to increase text size. ...
...And 2 more matches
Event reference
s completed. animationiteration animationevent css animations a css animation is repeated. animationstart animationevent css animations a css animation has started. appinstalled event web app manifest a web application is successfully installed as a progressive web app. audioprocess audioprocessingevent web audio apithe def
inition of 'audioprocess' in that specification. the input buffer of a scriptprocessornode is ready to be processed. audioend event web speech api the user agent has finished capturing audio for speech recognition. audiostart event web speech api the user agent has started to capture audio for speech recognition. beforeprint event html5 the ...
...ry status the chargingtime attribute has been updated. click mouseevent dom l3 a pointing device button has been pressed and released on an element. close event websocket a websocket connection has been closed. complete indexeddb a transaction successfully completed. complete offlineaudiocompletionevent web audio apithe def
inition of 'offlineaudiocompletionevent' in that specification. the rendering of an offlineaudiocontext is terminated. compositionend compositionevent dom l3 the composition of a passage of text has been completed or canceled. compositionstart compositionevent dom l3 the composition of a passage of text is prepared (similar to keydown for a keyboard input, but wo...
...e element has been checked and doesn't satisfy its constraints. keydown keyboardevent dom l3 a key is pressed down. keypress keyboardevent dom l3 a key is pressed down, and that key normally produces a character value (use input event instead). keyup keyboardevent dom l3 a key is released. languagechange event html 5.1the def
inition of 'navigatorlanguage.languages' in that specification. the user's preferred languages have changed. levelchange event battery status the level attribute has been updated. load uievent dom l3 a resource and its dependent resources have finished loading. load progressevent progress and xmlhttprequest progression has been successful. ...
...And 2 more matches
Cross-browser audio basics - Developer guides
fault controls look different among various browsers. so creating your own controls ensures a consistent look for the controls across all browsers. html5 audio in detail now we've looked at a basic example, let's now explore the different aspects of html5 audio in more detail. audio html attributes we can specify a number of attributes with the audio tag to further determine the way audio is
initialized. autoplay specifying autoplay will cause the audio to start playing as soon as possible and without any user interaction — in short, the audio will autoplay. <audio autoplay> ... </audio> note: this value is often ignored on mobile platforms, and its use is not recommended unless really necessary. auto-playing audio (and video) is usually really annoying. plus browsers have polici...
...aying again. <audio loop> ... </audio> muted if you want the audio to start muted (no volume), add the muted attribute. <audio muted> ... </audio> note: this value is often ignored on mobile platforms. preload the preload attribute allows you to specify a preference for how the browser preloads the audio, in other words, which part of the file it downloads when the <audio> element is
initialized, and before the play button is pressed. preload can take 3 different values: none: don't download anything before the play button is pressed. metadata: download the audio metadata; this is usually the best option, as it allows you to access and display information such as audio length, and allow the browser to work out which audio file it should use. auto: download the whole audio fi...
...a look at the media loading process in order: loadstart the loadstart event tells us simply that load process has started and the browser is connecting to the media. myaudio.addeventlistener("loadstart", function() { //grabbing the file }); durationchange if you just want to know as soon as the duration of your media is established, this is the event for you. this can be useful because the
initial value for duration is nan (not a number), which you probably don't want to display to your users. myaudio.addeventlistener("durationchange", function() { //you can display the duration now }); loadedmetadata metadata can consist of more than just duration — if you want to wait for all the metadata to download before doing something, you can detect the loadedmetadata event. myaudio.adde...
...And 2 more matches
<col> - HTML: Hypertext Markup Language
ercentage values, this attribute might take the special form 0*, which means that the width of each column in the group should be the minimum width necessary to hold the column's contents. relative widths such as 0.5* also can be used. ...
...width of each column in the group should be the minimum width necessary to hold the column's contents. relative widths such as 0.5* also can be used. examples please see the <table> page for examples on <col>. ...
...relative widths such as 0.5* also can be used. examples please see the <table> page for examples on <col>. specifications specification status comment html living standardthe def
inition of '<col>' in that specification. ...
...And 2 more matches
<dl>: The Description List element - HTML: Hypertext Markup Language
rently. some screen readers, such as voiceover on ios, will not announce that <dl> content is a list. because of this, make sure each list item's content is written in such a way that it communicates its relationship to the other list items in the list grouping. ...
...ntent is a list. because of this, make sure each list item's content is written in such a way that it communicates its relationship to the other list items in the list grouping. ...
...communicates its relationship to the other list items in the list grouping. codepen - html buddies: dt & dd specifications specification status comment html living standardthe def
inition of '<dl>' in that specification. ...
...And 2 more matches
<input type="number"> - HTML: Hypertext Markup Language
d like to buy:</label> <input id="ticketnum" type="number" name="ticketnum" value="0"> a number input is considered valid when empty and when a single number is entered, but is otherwise invalid. if the required attribute is used, the input is no longer considered valid when empty. note: any number is an acceptable value, as long as it is a valid floating point number (that is, not nan or inf
inity). placeholders sometimes it's helpful to offer an in-context hint as to what form the input data should take. this can be especially important if the page design doesn't offer descriptive labels for each <input>. this is where placeholders come in. a placeholder is a value most commonly used to provide a hint as to the format the input should take value. it is displayed inside the edit box wh...
... <input type="submit" value="submit form"> </div> </form> you'll see that we are using many of the attributes we've already looked at in the article earlier on. since we want to accept a meter value in centimeters, we've set the step value to 0.01, so that values like 1.78 are not seen as invalid. we've also provided a placeholder for that input. we've hidden the feet and inches inputs
initially using style="display: none;", so that meters is the default entry type. now, onto the css. this looks very similar to the validation styling we saw before; nothing remarkable here. div { margin-bottom: 10px; position: relative; } input[type="number"] { width: 100px; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; paddi...
...s) we are hiding, and empty the value attribute(s). ...
...And 2 more matches
<input type="password"> - HTML: Hypertext Markup Language
so you can see it. obviously this defeats the purpose of a password field, but it's helpful for experimenting with the pattern. ...
...s helpful for experimenting with the pattern. ...
...or experimenting with the pattern. ...
...And 2 more matches
<p>: The Paragraph element - HTML: Hypertext Markup Language
s presence, but not any content contained within it — because there is none. this can confuse and frustrate the person using the screen reader. ...
...e screen reader. if extra space is desired, use css properties like margin to create the effect: p { margin-bottom: 2em; // increase white space after a paragraph } specifications specification status comment html living standardthe def
inition of '<p>' in that specification. ...
...increase white space after a paragraph } specifications specification status comment html living standardthe def
inition of '<p>' in that specification. living standard no change since the latest w3c snapshot html5 html5the def
inition of '<p>' in that specification. ...
...And 2 more matches
<q>: The Inline Quotation element - HTML: Hypertext Markup Language
ation quoted. this attribute is intended to point to information explaining the context or the reference for the quote. ...
...ext or the reference for the quote. ...
...//www.mozilla.org/about/history/details/">firefox 1.0 was released in 2004 and became a big success.</q></p> specifications specification status comment html living standardthe def
inition of '<q>' in that specification. ...
...And 2 more matches
draggable - HTML: Hypertext Markup Language
">. if this attribute is not set, its default value is auto, which means drag behavior is the default browser behavior: only text selections, images, and links can be dragged. for other elements, the event ondragstart must be set for drag and drop to work, as shown in this comprehensive example. ...
...elections, images, and links can be dragged. for other elements, the event ondragstart must be set for drag and drop to work, as shown in this comprehensive example. specifications specification status comment html living standardthe def
inition of 'draggable' in that specification. ...
...r drag and drop to work, as shown in this comprehensive example. specifications specification status comment html living standardthe def
inition of 'draggable' in that specification. living standard no change from latest snapshot, html 5.1 html 5.2the def
inition of 'draggable' in that specification. ...
...And 2 more matches
CSP: child-src - HTTP
tempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and def
initely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url scheme and port number. you must include the single quotes. some browse...
... ...
... ...
...And 2 more matches
CSP: font-src - HTTP
tempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and def
initely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url scheme and port number. you must include the single quotes. some browse...
... ...
... ...
...And 2 more matches
CSP: media-src - HTTP
tempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and def
initely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url scheme and port number. you must include the single quotes. some browse...
... ...
... ...
...And 2 more matches
CSP: object-src - HTTP
tempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and def
initely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url scheme and port number. you must include the single quotes. some browse...
... ...
... ...
...And 2 more matches
HTTP Index - HTTP
rudp — the reliable update of udp — is a suitable alternative. 2 a typical http session http in client-server protocols, like http, sessions consist of three phases: 3 an overview of http html, http, overview, webmechanics, l10n:priority http isthe foundation of any data exchange on the web and it is a client-server protocol, which means requests are
initiated by the recipient, usually the web browser. a complete document is reconstructed from the different sub-documents fetched, for instance text, layout description, images, videos, scripts, and more 4 basics of http guide, http, overview http is a pretty extensible protocol. it relies on a few basic concepts like the notion of resources and uris, a simple structure of messag...
... security, media-src, source the http content-security-policy (csp) media-src directive specifies valid sources for loading media using the <audio> and <video> elements. 89 csp: navigate-to csp, content-security-policy, directive, http, navigation, reference, security the http content-security-policy (csp) navigate-to directive restricts the urls to which a document can
initiate navigations by any means including <form> (if form-action is not specified), <a>, window.location, window.open, etc. this is an enforcement on what navigations this document
initiates not on what this document is allowed to navigate to. 90 csp: object-src csp, content-security-policy, directive, http, object, reference, security, object-src, source the http content-securi...
...e http feature-policy header unoptimized-images directive controls whether the current document is allowed to download and display unoptimized images. 146 feature-policy: unsized-media directive, feature-policy, http, reference the http feature-policy header unsized-media directive controls whether the current document is allowed to change the size of media elements after the
initial layout is complete. 147 feature-policy: usb directive, feature-policy, http, reference, vibration api, web usb the http feature-policy header usb directive controls whether the current document is allowed to use the webusb api. 148 feature-policy: vibrate directive, feature-policy, http, reference, vibration api the http feature-policy header vibrate d...
...And 2 more matches
Grammar and types - JavaScript
at the start of some javascript files, which looks something like this: #!/usr/bin/env node. this is called hashbang comment syntax, and is a special comment used to specify the path to a particular javascript engine that should execute the script. see hashbang comments for more details. declarations javascript has three kinds of variable declarations. var declares a variable, optionally
initializing it to a value. let declares a block-scoped, local variable, optionally
initializing it to a value. const declares a block-scoped, read-only named constant. variables you use variables as symbolic names for values in your application. the names of variables, called identifiers, conform to certain rules. a javascript identifier must start with a letter, underscore (_), or dollar sig...
...ot defined variable hoisting another unusual thing about variables in javascript is that you can refer to a variable declared later, without getting an exception. this concept is known as hoisting. variables in javascript are, in a sense, "hoisted" (or "lifted") to the top of the function or statement. however, variables that are hoisted return a value of undefined. so even if you declare and
initialize after you use or refer to this variable, it still returns undefined. /** * example 1 */ console.log(x === undefined); // true var x = 3; /** * example 2 */ // will return a value of undefined var myvar = 'my value'; (function() { console.log(myvar); // undefined var myvar = 'local value'; })(); the above examples will be interpreted the same as: /** * example 1 */ var x; con...
...== undefined); // true x = 3; /** * example 2 */ var myvar = 'my value'; (function() { var myvar; console.log(myvar); // undefined myvar = 'local value'; })(); because of hoisting, all var statements in a function should be placed as near to the top of the function as possible. this best practice increases the clarity of the code. in ecmascript 2015, let and const are hoisted but not
initialized. referencing the variable in the block before the variable declaration results in a referenceerror, because the variable is in a "temporal dead zone" from the start of the block until the declaration is processed. console.log(x); // referenceerror let x = 3; function hoisting in the case of functions, only function declarations are hoisted—but not the function expressions. /* functio...
...And 2 more matches
Indexed collections - JavaScript
er properties for use with regular expressions. creating an array the following statements create equivalent arrays: let arr = new array(element0, element1, ..., elementn) let arr = array(element0, element1, ..., elementn) let arr = [element0, element1, ..., elementn] element0, element1, ..., elementn is a list of values for the array's elements. when these values are specified, the array is
initialized with them as the array's elements. the array's length property is set to the number of arguments. the bracket syntax is called an "array literal" or "array
initializer." it's shorter than other forms of array creation, and so is generally preferred. see array literals for details. to create an array with non-zero length, but without any items, either of the following can be used: // thi...
...return arraylength, but the array doesn't contain any elements. a for...in loop will not find any property on the array. in addition to a newly defined variable as shown above, arrays can also be assigned as a property of a new or an existing object: let obj = {} // ... obj.prop = [element0, element1, ..., elementn] // or let obj = {prop: [element0, element1, ...., elementn]} if you wish to
initialize an array with a single element, and the element happens to be a number, you must use the bracket syntax. when a single number value is passed to the array() constructor or function, it is interpreted as an arraylength, not as a single element. let arr = [42] // creates an array with only one element: // the number 42. let arr = array(42) // creates an array wit...
...gs false some(callback[, thisobject]) returns true if callback returns true for at least one item in the array. ...
...And 2 more matches
Inheritance and the prototype chain - JavaScript
se (the class keyword is introduced in es2015, but is syntactical sugar, javascript remains prototype-based). when it comes to inheritance, javascript only has one construct: objects. each object has a private property which holds a link to another object called its prototype. that prototype object has a prototype of its own, and so on until an object is reached with null as its prototype. by def
inition, null has no prototype, and acts as the final link in this prototype chain. nearly all objects in javascript are instances of object which sits on the top of a prototype chain. while this confusion is often considered to be one of javascript's weaknesses, the prototypal inheritance model itself is, in fact, more powerful than the classic model. it is, for example, fairly trivial to build a c...
... 2} // add properties in f function's prototype f.prototype.b = 3; f.prototype.c = 4; // do not set the prototype f.prototype = {b:3,c:4}; this will break the prototype chain // o.[[prototype]] has properties b and c. // o.[[prototype]].[[prototype]] is object.prototype. // finally, o.[[prototype]].[[prototype]].[[prototype]] is null. // this is the end of the prototype chain, as null, // by def
inition, has no [[prototype]]. // thus, the full prototype chain looks like: // {a: 1, b: 2} ---> {b: 3, c: 4} ---> object.prototype ---> null console.log(o.a); // 1 // is there an 'a' own property on o? yes, and its value is 1. console.log(o.b); // 2 // is there a 'b' own property on o? yes, and its value is 2. // the prototype also has a 'b' property, but it's not visited. // this is called proper...
...eatures of newer javascript engines, like array.foreach. summary of methods for extending the prototype chain here are all 4 ways and their pros/cons. all of the examples listed below create exactly the same resulting inst object (thus logging the same results to the console), except in different ways for the purpose of illustration. name example(s) pro(s) con(s) new-
initialization function foo(){} foo.prototype = { foo_prop: "foo val" }; function bar(){} var proto = new foo; proto.bar_prop = "bar val"; bar.prototype = proto; var inst = new bar; console.log(inst.foo_prop); console.log(inst.bar_prop); supported in every browser imaginable (support goes all the way back to ie 5.5!). also, it is very fast, very standard, and very jist-optimizable. ...
...And 2 more matches
JavaScript error reference - JavaScript
point toward understanding and resolving the error. ...
...are deprecatedsyntaxerror: "use strict" not allowed in function with non-simple parameterssyntaxerror: "x" is a reserved identifiersyntaxerror: json.parse: bad parsingsyntaxer...
...escape seq. are deprecatedsyntaxerror: "use strict" not allowed in function with non-simple parameterssyntaxerror: "x" is a reserved identifiersyntaxerror: json.parse: bad parsingsyntaxerror: malformed formal parametersyntaxerror: unexpected tokensyntaxerror: using //@ to indicate sourceurl pragmas is deprecated. ...
...And 2 more matches
Rest parameters - 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 function f(a, b, ...theargs) { // ... } description a function's last parameter can be prefixed with ... which will cause all remaining (user supplied) arguments to be placed within a "standard" javascript array. only the last parameter can be a "rest parameter". ...
...s that the user includes. function myfun(a, b, ...manymoreargs) { console.log("a", a) console.log("b", b) console.log("manymoreargs", manymoreargs) } myfun("one", "two", "three", "four", "five", "six") // a, one // b, two // manymoreargs, [three, four, five, six] below... even though there is just one value, the last argument still gets put into an array. ...
...anymoreargs, [three, four, five, six] below... even though there is just one value, the last argument still gets put into an array. // using the same function def
inition from example above myfun("one", "two", "three") // a, one // b, two // manymoreargs, [three] below, the third argument isn't provided, but manymoreargs is still an array (albeit an empty one). ...
...And 2 more matches
JSON.stringify() - JavaScript
n array). json.stringify() can return undefined when passing in "pure" values like json.stringify(function(){}) or json.stringify(undefined). all symbol-keyed properties will be completely ignored, even when using the replacer function. the instances of date implement the tojson() function by returning a string (the same as date.toisostring()). thus, they are treated as strings. the numbers inf
inity and nan, as well as the value null, are all considered null. all the other object instances (including map, set, weakmap, and weakset) will have only their enumerable properties serialized. examples using json.stringify json.stringify({}); // '{}' json.stringify(true); // 'true' json.stringify('foo'); // '"foo"' json.stringify([1, 'false',...
...ll the other object instances (including map, set, weakmap, and weakset) will have only their enumerable properties serialized. ...
... enumerable: true } }) ); // '{"y":"y"}' // bigint values throw json.stringify({x: 2n}); // typeerror: bigint value can't be serialized in json the replacer parameter the replacer parameter can be either a function or an array. as a function, it takes two parameters: the key and the value being stringified. the object in which the key was found is provided as the replacer's this parameter.
initially, the replacer function is called with an empty string as key representing the object being stringified. it is then called for each property on the object or array being stringified. it should return the value that should be added to the json string, 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...
...And 2 more matches
Math.fround() - JavaScript
at for equality may fail even though the numbers are seemingly identical. to solve this, math.fround() can be used to cast the 64-bit float to a 32-bit float. internally, javascript continues to treat the number as a 64-bit float, it just performs a "round to even" on the 23rd bit of the mantissa, and sets all following mantissa bits to 0. if the number is outside the range of a 32-bit float, inf
inity or -inf
inity is returned. because fround() is a static method of math, you always use it as math.fround(), rather than as a method of a math object you created (math is not a constructor). polyfill this can be emulated with the following function, if float32array are supported: math.fround = math.fround || (function (array) { return function(x) { return array[0] = x, array[0]; }; })(...
...r exp = math.floor(math.log(arg) / math.ln2); var powexp = math.pow(2, math.max(-126, math.min(exp, 127))); // handle subnormals: leading digit is zero if exponent bits are all zero. var leading = exp < -127 ? 0 : 1; // compute 23 bits of mantissa, inverted to round toward zero. ...
... ...
...And 2 more matches
parseInt() - JavaScript
because some numbers use the e character in their string representation (e.g. 6.022e23 for 6.022 × 1023), using parseint to truncate numbers will produce unexpected results when used on very large or very small numbers. parseint should not be used as a substitute for math.floor(). parseint understands exactly two signs: + for positive, and - for negative (since ecmascript 1). it is done as an
initial step in the parsing after whitespace is removed. if no signs are found, the algorithm moves to the following step; otherwise, it removes the sign and runs the number-parsing on the rest of the string. if radix is undefined, 0, or unspecified, javascript assumes the following: if the input string begins with "0x" or "0x" (a zero, followed by lowercase or uppercase x), radix is assumed to be...
...s differs from ecmascript 3, which merely discouraged (but allowed) octal interpretation. many implementations have not adopted this behavior as of 2013. and, because older browsers must be supported, always specify a radix. a stricter parse function it is sometimes useful to have a stricter way to parse integers. ...
...imes useful to have a stricter way to parse integers. ...
...And 2 more matches
for - JavaScript
ee optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement (usually a block statement) to be executed in the loop. 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 for ([
initialization]; [condition]; [final-expression]) statement
initialization an expression (including assignment expressions) or variable declaration evaluated once before the loop begins. typically used to
initialize a counter variable. this expression may optionally declare new variables with var or let keywords. variables declared with var are not local to the loop, i.e. they are in the same s...
...sed to update or increment 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 (;). ...
...owing 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 increments 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
initialization block, the condition block is also optional. if you are omitting this expression, you must make sure to break the loop in the body in order to not create an inf
inite loop. for (let i = 0;; i++) { console.log(i); if (i > 3) break...
...And 2 more matches
let - JavaScript
the let statement declares a block-scoped local variable, optionally
initializing it to a 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. syntax let var1 [= value1] [, var2 [= value2]] [, ..., varn [= valuen]; parameters var1, var2, …, varn the names of the variable or variables to declare. each must be a legal javascript identifier. value1, value2, …, valuen optional for each variable declared, you may optionally specify its
initial value to any legal javascript expression. description let allows you to declare variables that are limited to the scope of a block statement, or expression on whic...
... just like const the let does not create properties of the window object when declared globally (in the top-most scope). an explanation of why the name "let" was chosen can be found here. ...
...ant to point out that a block nested inside a case clause will create a new block scoped lexical environment, which will not produce the redeclaration errors shown above. let x = 1; switch(x) { case 0: { let foo; break; } case 1: { let foo; break; } } temporal dead zone unlike variables declared with var, which will start with the value undefined, let variables are not
initialized until their def
inition is evaluated. accessing the variable before the
initialization results in a referenceerror. the variable is in a "temporal dead zone" from the start of the block until the
initialization is processed. function do_something() { console.log(bar); // undefined console.log(foo); // referenceerror var bar = 1; let foo = 2; } the temporal dead zone and typeof un...
...And 2 more matches
Strict mode - JavaScript
x 'use strict'; function nested() { return 'and so am i!'; } return "hi! i'm a strict mode function! " + nested(); } function notstrict() { return "i'm not strict."; } strict mode for modules ecmascript 2015 introduced javascript modules and therefore a 3rd way to enter strict mode. the entire contents of javascript modules are automatically in strict mode, with no statement needed to
initiate it. function strict() { // because this is a module, i'm strict by default } export default strict; changes in strict mode strict mode changes both syntax and runtime behavior. changes generally fall into these categories: changes converting mistakes into errors (as syntax errors or at runtime), changes simplifying how the particular variable for a given use of a name is computed, cha...
... no failure feedback. in strict mode assigning to nan throws an exception. ...
...properties on primitive values. without strict mode, setting properties is simply ignored (no-op), with strict mode, however, a typeerror is thrown. (function() { 'use strict'; false.true = ''; // typeerror (14).sailing = 'home'; // typeerror 'with'.you = 'far away'; // typeerror })(); simplifying variable uses strict mode simplifies how variable names map to particular variable def
initions 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 def
inition 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...
...And 2 more matches
Progressive loading - Progressive web apps (PWAs)
ml, css, javascript), and only loading those immediately that are really needed for the very first experience. bundling versus splitting many visitors won't go through every single page of a website, yet the usual approach is to bundle every feature we have into one big file. a bundle.js file can be many megabytes, and a single style.css bundle can contain everything from basic css structure def
initions to all the possible styles of every version of the site: mobile, tablet, desktop, print only, etc. it is faster to load all that information as one file rather than many small ones, but if the user doesn't need everything at the very beginning, we could load only what's crucial and then manage other resources when needed. render-blocking resources bundling is a problem, because the browser...
... information as one file rather than many small ones, but if the user doesn't need everything at the very beginning, we could load only what's crucial and then manage other resources when needed. render-blocking resources bundling is a problem, because the browser has to load the html, css, and javascript before it can paint their rendered results onto the screen. during the few seconds between
initial website access and completion of loading, the user sees a blank page, which is a bad experience. to fix that we can, for example, add defer to javascript files: <script src="app.js" defer></script> they will be downloaded and executed after the document itself has been parsed, so it won't block rendering the html structure. we can also split css files and add media types to them: <link re...
...er and move everything from style.css to the <style> tag in the <head> of index.html — this would improve performance even more, but for the readability of the example we will skip that approach too. images besides javascript and css, websites will likely contain a number of images. when you include <img> elements in your html, then every referenced image will be fetched and downloaded during
initial website access. it's not unusual to have megabytes of image data to download before announcing the site is ready, but this again creates a bad perception of performance. we don't need all of the images in the best possible quality at the very beginning of viewing the site. this can be optimized. first of all, you should use tools or services similar to tinypng, which will reduce the file size...
...And 2 more matches
fill-opacity - SVG: Scalable Vector Graphics
? opera android ? safari ios ? samsung internet android ? ...
... ? samsung internet android ? ...
... compatibility unknown compatibility unknown specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'fill-opacity' in that specification. ...
...And 2 more matches
flood-opacity - SVG: Scalable Vector Graphics
a number of 0 or a percentage of 0% represents a fully transparent color, 1 or 100% represents a fully opaque color. specifications specification status comment filter effects module level 1the d...
...l value 1 animatable yes <alpha-value> a number or percentage indicating the opacity value to use across the current filter primitive subregion. ...
... a percentage of 0% represents a fully transparent color, 1 or 100% represents a fully opaque color. specifications specification status comment filter effects module level 1the def
inition of 'flood-opacity' in that specification. ...
...And 2 more matches
font-variant - SVG: Scalable Vector Graphics
c-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero || <east-asian-variant-values> || <east-asian-width-values> || ruby ] default value normal animatable yes for a description of the values, please refer to the css font-variant property. ...
...-width-values> || ruby ] default value normal animatable yes for a description of the values, please refer to the css font-variant property. specifications specification status comment css fonts module level 4the def
inition of 'font-variant' in that specification. ...
...fication status comment css fonts module level 4the def
inition of 'font-variant' in that specification. working draft no change css fonts module level 3the def
inition of 'font-variant' in that specification. candidate recommendation added many more keywords for different types of variations. ...
...And 2 more matches
from - SVG: Scalable Vector Graphics
when used with the to attribute, the animation will change the modified attribute from the from value to the to value. when used with the by attribute, the animation will change the attribute relatively from the from value by the value specified in by. ...
...usage notes value see below default value none animatable no the exact value type for this attribute depends on the value of the attribute that will be animated. ...
...ibute depends on the value of the attribute that will be animated. when a list of values is defined via the values attribute, the from attribute is ignored. ...
...And 2 more matches
keyPoints - SVG: Scalable Vector Graphics
default value none animatable no <number> [; <number>] ;? this value defines a semicolon-separated list of floating point values between 0 and 1 and indica...
...s in the keytimes list. if there's a semicolon at the end of the value, optionally followed by white space, both the semicolon and the trailing white space are ignored. if there are any errors in the value specification (i.e. ...
...g white space are ignored. if there are any errors in the value specification (i.e. bad values, too many or too few values), then thatʼs an error. ...
...And 2 more matches
letter-spacing - SVG: Scalable Vector Graphics
g</text> </svg> usage notes value normal | <length> default value normal animatable yes for a description of the values, please refer to the css letter-spacing property. ...
...al animatable yes for a description of the values, please refer to the css letter-spacing property. prior to firefox 72 firefox ignored letter-spacing and renders text without. ...
...css letter-spacing property. prior to firefox 72 firefox ignored letter-spacing and renders text without. specifications specification status comment css text module level 3the def
inition of 'letter-spacing' in that specification. ...
...And 2 more matches
media - SVG: Scalable Vector Graphics
value <media-query-list> default value all animatable yes <media-query-list> this value holds a media query that needs to match in order for the style sheet to be applied. if not specified, the style sheet is applied unconditionally. ...
... <media-query-list> this value holds a media query that needs to match in order for the style sheet to be applied. if not specified, the style sheet is applied unconditionally. ...
... the style sheet is applied unconditionally. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'media' in that specification. ...
...And 2 more matches
operator - SVG: Scalable Vector Graphics
or dilate (fatten) the source graphic. value erode | dilate default value erode animatable yes erode this value thins the source graphic defined in the in attribute. dilate this value fattens the source graphic defined in the in attribute. ...
... erode this value thins the source graphic defined in the in attribute. dilate this value fattens the source graphic defined in the in attribute. specifications specification status comment filter effects module level 1the def
inition of 'operator for <femorphology>' in that specification. working draft no change filter effects module level 1the def
inition of 'operator for <fecomposite>' in that specification. ...
...level 1the def
inition of 'operator for <femorphology>' in that specification. working draft no change filter effects module level 1the def
inition of 'operator for <fecomposite>' in that specification. working draft refers to css compositing and blending specification for the values and added the lighter value. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'operator for <femorphology>' in that specification. recommendation
initial def
inition for <femorphology> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'operator for <fecomposite>' in that specification. ...
...And 2 more matches
preserveAspectRatio - SVG: Scalable Vector Graphics
lt value xmidymid meet animatable yes view for <view>, preserveaspectratio indicates if a uniform scaling must be performed to fit the element viewport. ...
...ng must be performed to fit the element viewport. value <align> <meetorslice>? default value xmidymid meet animatable yes specification specification status comment filter effects module level 1the def
inition of 'preserveaspectratio' in that specification. ...
...es specification specification status comment filter effects module level 1the def
inition of 'preserveaspectratio' in that specification. working draft scalable vector graphics (svg) 2the def
inition of 'preserveaspectratio' in that specification. ...
...And 2 more matches
r - SVG: Scalable Vector Graphics
to the perimeter of this end circle. a value of lower or equal to zero will cause the area to be painted as a single color using the color and opacity of the last gradient <stop>. ...
...will cause the area to be painted as a single color using the color and opacity of the last gradient <stop>. value <length> | <percentage> default value 50% animatable yes specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'r' in that specification. ...
... of the last gradient <stop>. value <length> | <percentage> default value 50% animatable yes specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'r' in that specification. candidate recommendation def
inition as a geometry property scalable vector graphics (svg) 2the def
inition of 'r' in that specification. candidate recommendation def
inition for svg2 paint servers <radialgradient> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'r' in that specification. recommendation
initial def
inition for <radialgradient> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'r' in that specification. recommenda...
...And 2 more matches
repeatDur - SVG: Scalable Vector Graphics
until the document ends). specifications s...
...2000/svg"> <rect x="0" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatdur="5s"/> </rect> <rect x="120" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatdur="indef
inite"/> </rect> </svg> usage notes value <clock-value> | indef
inite default values none animatable no <clock-value> this value specifies the duration in presentation time to repeat the animation. indef
inite this value indicates that the animation will be repeated indef
initely (i.e. until the document ends). specifications specification status comment svg animations level 2the def
initio...
...me to repeat the animation. indef
inite this value indicates that the animation will be repeated indef
initely (i.e. until the document ends). specifications specification status comment svg animations level 2the def
inition of 'repeatdur' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'repeatdur' in that specification. ...
...And 2 more matches
startOffset - SVG: Scalable Vector Graphics
only one element is using this attribute: <textpath> html,body,svg { height:100% } <svg viewbox="0 0 220 100" xmlns="http://www.w3.org/2000/svg"> <path id="path1" fill="none" stroke="red" d="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50" /> <path id="path2" fill="none" stroke="red" d="m130,90 q210,90 210,45 q210,10 170,10 q130,10 130,40 q130,70 165,70 q190,70 195,50" /> <text> <textpath href="#path1" startoffset="0"> quick brown fox jumps over the lazy dog. ...
...int of the path and 100% indicates the end point of the path. <number> this value indicates a distance along the path measured in the current user coordinate system for the <textpath> element. ...
...inate system for the <textpath> element. note: negative values and values larger than the path length (e.g. 150%) are allowed. ...
...And 2 more matches
stop-opacity - SVG: Scalable Vector Graphics
on the following element: <stop> usage notes value <opacity-value> default value 1 animatable yes <opacity-value> this value is either a <number> between 0 and 1 or a <percentage> value specifying the opacity of the color gradient stop. ...
...t value 1 animatable yes <opacity-value> this value is either a <number> between 0 and 1 or a <percentage> value specifying the opacity of the color gradient stop. ...
...rcentage> value specifying the opacity of the color gradient stop. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'stop-opacity' in that specification. ...
...And 2 more matches
stroke-dasharray - SVG: Scalable Vector Graphics
? opera android ? safari ios ? samsung internet android ? ...
... ? samsung internet android ? ...
... compatibility unknown compatibility unknown specification specification status comment scalable vector graphics (svg) 2the def
inition of 'stroke-dasharray' in that specification. ...
...And 2 more matches
stroke-dashoffset - SVG: Scalable Vector Graphics
? opera android ? safari ios ? samsung internet android ? ...
... ? samsung internet android ? ...
... compatibility unknown compatibility unknown specification specification status comment scalable vector graphics (svg) 2the def
inition of 'stroke-dashoffset' in that specification. ...
...And 2 more matches
stroke-linecap - SVG: Scalable Vector Graphics
? opera android ? safari ios ? samsung internet android ? ...
... ? samsung internet android ? ...
... compatibility unknown compatibility unknown specification specification status comment scalable vector graphics (svg) 2the def
inition of 'stroke-linecap' in that specification. ...
...And 2 more matches
stroke-miterlimit - SVG: Scalable Vector Graphics
? opera android ? safari ios ? samsung internet android ? ...
... ? samsung internet android ? ...
... compatibility unknown compatibility unknown specification specification status comment scalable vector graphics (svg) 2the def
inition of 'stroke-miterlimit' in that specification. ...
...And 2 more matches
stroke-opacity - SVG: Scalable Vector Graphics
? opera android ? safari ios ? samsung internet android ? ...
... ? samsung internet android ? ...
... compatibility unknown compatibility unknown specification specification status comment scalable vector graphics (svg) 2the def
inition of 'stroke-opacity' in that specification. ...
...And 2 more matches
stroke-width - SVG: Scalable Vector Graphics
? opera android ? safari ios ? samsung internet android ? ...
... ? samsung internet android ? ...
... compatibility unknown compatibility unknown specification specification status comment scalable vector graphics (svg) 2the def
inition of 'stroke-width' in that specification. ...
...And 2 more matches
target - SVG: Scalable Vector Graphics
elf | _parent | _top | _blank | <xml-name> default value _self animatable yes _replace the current svg image is replaced by the linked content in the same rectangular area in the same frame as the current svg image. note: this value was never well implemented, and the distinction between _replace and _self has been made redundant by changes in the html def
inition of browsing contexts. use _self to replace the current svg document. _self the current svg image is replaced by the linked content in the same browsing context as the current svg image. _parent the immediate parent browsing context of the svg image is replaced by the linked content, if it exists and can be securely accessed from this document. _top the content of the full active wind...
...ting content. if it does not exist, it is created (the same as '_blank', except that it now has a name). ...
...with an underscore (u+005f low line character), to meet the requirements of a valid browsing context name from html. ...
...And 2 more matches
text-decoration - SVG: Scalable Vector Graphics
usage notes value <'text-decoration-line'> || <'text-decoration-style'> || <'text-decoration-color'> default value see individual properties animatable yes for a description of the values, please refer to the css text-decoration property. ...
...efer to the css text-decoration property. specifications specification status comment css text decoration module level 3the def
inition of 'text-decoration' in that specification. candidate recommendation defines the property as a shorthand for text-decoration-line, text-decoration-style, and text-decoration-color. scalable vector graphics (svg) 2the def
inition of 'text-decoration' in that specification. candidate recommendation mainly refers to the def
inition in css text decoration 3 turning the property into a shorthand for text-decoration-line and text-decoration-style. ...
...ine, text-decoration-style, and text-decoration-color. scalable vector graphics (svg) 2the def
inition of 'text-decoration' in that specification. candidate recommendation mainly refers to the def
inition in css text decoration 3 turning the property into a shorthand for text-decoration-line and text-decoration-style. ...
...And 2 more matches
to - SVG: Scalable Vector Graphics
set for the <set> element, to specifies the value for the attribute during the duration of the element. value <value> default value none animatable no the exact value type for this attribute depend on the value of the attribute that will be animated. ...
...lue <value> default value none animatable no the exact value type for this attribute depend on the value of the attribute that will be animated. specifications specification status comment svg animations level 2the def
inition of 'to for <set>' in that specification. editor's draft no change svg animations level 2the def
inition of 'to for <animate>, <animatecolor>, <animatemotion>, and <animatetransform>' in that specification. ...
...cification status comment svg animations level 2the def
inition of 'to for <set>' in that specification. editor's draft no change svg animations level 2the def
inition of 'to for <animate>, <animatecolor>, <animatemotion>, and <animatetransform>' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'to for <set>' in that specification. recommendation
initial def
inition for <set> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'to for <animate>, <animatecolor>, <animatemotion>, and <animatetransform>' in that specification. ...
...And 2 more matches
values - SVG: Scalable Vector Graphics
es (a00 a01 a02 a03 a04 a10 a11 ... a34), separated by whitespace and/or a comma. for type="saturate", values is a single real number value (0 to 1). for type="huerotate", values is a single one real number value (degrees). for type="luminancetoalpha", values is not applicable. ...
...mber value (0 to 1). for type="huerotate", values is a single one real number value (degrees). for type="luminancetoalpha", values is not applicable. specifications specification status comment filter effects module level 1the def
inition of 'values for <fecolormatrix>' in that specification. working draft no change svg animations level 2the def
inition of 'values for <animate>, <animatecolor>, <animatemotion>, and <animatetransform>' in that specification. ...
...comment filter effects module level 1the def
inition of 'values for <fecolormatrix>' in that specification. working draft no change svg animations level 2the def
inition of 'values for <animate>, <animatecolor>, <animatemotion>, and <animatetransform>' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'values for <fecolormatrix>' in that specification. recommendation
initial def
inition for <fecolormatrix> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'values for <animate>, <animatecolor>, <animatemotion>, and <animatetransform>' in that specification. ...
...And 2 more matches
word-spacing - SVG: Scalable Vector Graphics
/text> </svg> usage notes value normal | <length> animatable yes default values normal for a description of the values, please refer to the css letter-spacing property. ...
... default values normal for a description of the values, please refer to the css letter-spacing property. prior to firefox 72 firefox ignored word-spacing and renders text without. ...
... css letter-spacing property. prior to firefox 72 firefox ignored word-spacing and renders text without. specifications specification status comment css text module level 3the def
inition of 'word-spacing' in that specification. ...
...And 2 more matches
writing-mode - SVG: Scalable Vector Graphics
the writing-mode attribute applies only to <text> elements; the attribute is ignored for <tspan>, <tref>, <altglyph> and <textpath> sub-elements. (note that the inline-progression-direction can change within a <text> element due to the unicode bidirectional algorithm and properties direction and unicode-bidi.) note: as a presentation attribute, writing-mode can be used as a css property. see the css writing-mode property for more information. ...
... mode are horizontal. vertical-rl this value defines a right-to-left block flow direction. both the writing mode and the typographic mode are vertical. vertical-lr this value defines a left-to-right block flow direction. both the writing mode and the typographic mode are vertical. specifications specification status comment css writing modes module level 3the def
inition of 'writing-mode' in that specification. proposed recommendation def
inition in css writing modes 3 scalable vector graphics (svg) 2the def
inition of 'writing-mode' in that specification. candidate recommendation mainly refers to the def
inition in css writing modes 3 and defines a mapping between the deprecated svg 1.1 values and the new values. scalable vector gra...
...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. ...
...And 2 more matches
z - SVG: Scalable Vector Graphics
the z attribute defines the location along the z-axis for a light source in the coordinate system established by the primitiveunits attribute on the <filter> element, assuming that, in the
initial coordinate system, the positive z-axis comes out towards the person viewing the content and assuming that one unit along the z-axis equals one unit in x and y. two elements are using this attribute: <fepointlight> and <fespotlight> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="diffuselighting1" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fepointlight x="60" y="60" z="10" /> </fediffuselighting> </filter> <filter id="diffuselighting2" x="0" y="0" width="100%" height="100%"> ...
... yes fespotlight for <fespotlight>, z defines the location along the z-axis for the light source in the coordinate system established by the primitiveunits attribute on the <filter> element. ...
...established by the primitiveunits attribute on the <filter> element. value <number> default value 1 animatable yes specifications specification status comment filter effects module level 1the def
inition of 'z for <fepointlight>' in that specification. working draft no change filter effects module level 1the def
inition of 'z for <fespotlight>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'z for <fepointlight>' in that specification. recommendation
initial def
inition for <fepointlight> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'z for <fespotlight>' in that specification. recommend...
...And 2 more matches
Communicating With Other Scripts - Archive of obsolete content
ript> </body> </html> the content script "content-script.js" adds an event listener to the button, that sends a custom event containing a message: var messenger = document.getelementbyid("message"); messenger.addeventlistener("click", sendcustomevent, false); function sendcustomevent() { var greeting = {"greeting" : "hello world"}; var event = document.createevent('customevent'); event.
initcustomevent("addon-message", true, true, greeting); document.documentelement.dispatchevent(event); } finally, the page script "page-script.js" listens for the message and logs the greeting to the web console: window.addeventlistener("addon-message", function(event) { console.log(event.detail.greeting); }, false); after firefox 30: clone the message object this technique depends on being ...
...also, there's no need to clone the message when using custom dom events in this direction. in this example, "main.js" creates a page-...
...when using custom dom events in this direction. ...
...gemod({ include: "http://my-domain.org/talk.html", contentscriptfile: data.url("listen.js") }); the web page "talk.html" creates and dispatches a custom dom event, using
initcustomevent()'s detail parameter to supply the payload: <!doctype html> <html> <head></head> <body> <script> function sendmessage() { var event = document.createevent('customevent'); event.
initcustomevent("addon-message", true, true, { hello: 'world' }); document.documentelement.dispatchevent(event); } </script> <button onclick="sendmessage()">send message</button> </body> </html> finally, the content script "listen.js" listens for the new event and retrieves the payload from its detail attribute: window.addeventlistener("addon-message", function(event) { con...
lang/functional - Archive of obsolete content
+b)); } parameters fn : function a function to be delayed. ms : number number of milliseconds to delay the execution of fn. arguments : mixed additional arguments to pass to fn upon execution once(fn) creates a version of the input function that can only be called one time. repeated calls to the modified function will have no effect, returning the value from the original call. ...
...s to fn upon execution once(fn) creates a version of the input function that can only be called one time. repeated calls to the modified function will have no effect, returning the value from the original call. useful for
initialization functions, instead of having to set a boolean flag and checking it later. ...
... input function that can only be called one time. repeated calls to the modified function will have no effect, returning the value from the original call. useful for
initialization functions, instead of having to set a boolean flag and checking it later. ...
...the value from the original call. useful for
initialization functions, instead of having to set a boolean flag and checking it later. let { once } = require("sdk/lang/functional"); let setup = once(function (env) { //
initializing important things console.log("successfully
initialized " + env); return 1; // assume success and return 1 }); setup('dev'); // returns 1 // prints "successfully
initialized dev" // future attempts to call this function just return the cached // value that was returned previously setup('production'); // returns 1 // no print message is displayed since the function isn't executed parameters fn : function the function that will be executed only once inside the once wrapper. returns function : the wrapped fn that can only be executed once. chain(fn) creat...
places/bookmarks - Archive of obsolete content
: "http://mozilla.org" }); // attempt to save the bookmark instance to the bookmarks database // and store the emitter let emitter = save(bookmark); // listen for events emitter.on("data", function (saved, inputitem) { // on a "data" event, an item has been updated, passing in the // latest snapshot from the server as `saved` (with properties // such as `updated` and `id`), as well as the
initial input // item as `inputitem` console.log(saved.title === inputitem.title); // true console.log(saved !== inputitem); // true console.log(inputitem === bookmark); // true }).on("end", function (saveditems, inputitems) { // similar to "data" events, except "end" is an aggregate of // all progress events, with ordered arrays as `saveditems` // and `inputitems` }); creating several ...
...d items. in this case, // `mygroup` has to be saved before `mybookmark`, since // `mybookmark` is a child of `mygroup`. `mygroup` will // also have a `data` event called for it. }).on("end", function (items, inputitems) { // the `end` event returns all items that are explicitly // saved. so `mygroup` will not be in this array, // but `mybookmark` will be. ...
...{ query: "firefox" }).on("data", function (item) { // each bookmark item that matches the query will // be called in this function }); arguments bookmark|group|separator : for the save function, this is the saved, latest snapshot of the bookmark item. for search, this is a snapshot of a bookmark returned from the search query. bookmark|group|separator|object : only in save data events. the
initial instance of the item that was used for the save request. error the error event is emitted whenever a bookmark item's save could not be completed. arguments string : a string indicating the error that occurred. bookmark|group|separator|object : only in save error events. the
initial instance of the item that was used for the save request. end the end event is called when all bookmark ite...
... the item that was used for the save request. end the end event is called when all bookmark items and dependencies have been saved, or an aggregate of all items returned from a search query. arguments array : the array is an ordered list of the input bookmark items, replaced with their updated, latest snapshot instances (the first argument in the data handler), or in the case of an error, the
initial instance of the item that was used for the save request (the second argument in the data or error handler). see also using xpcom without chrome - bookmark observer ...
Getting Started (jpm) - Archive of obsolete content
the add-on sdk includes a command-line tool that you use to
initialize, run, test, and package add-ons. the current tool is called jpm, and is based on node.js. it replaces the old cfx tool. you can use jpm from firefox 38 onwards. this article describes how to develop using jpm. this tutorial walks through creating a simple add-on using the sdk. prerequisites to create add-ons for firefox using the sdk, you'll need: firefox version 38 or later. if you need to work with earlier versions of firefox, you'll need to use the old cfx tool. see instructions for getting started with cfx. the command-line jpm tool. see the instructions for installing jpm. once you've done that, you'll be looking at a command prompt. ...
... firefox using the sdk, you'll need: firefox version 38 or later. if you need to work with earlier versions of firefox, you'll need to use the old cfx tool. see instructions for getting started with cfx. the command-line jpm tool. see the instructions for installing jpm. once you've done that, you'll be looking at a command prompt. install firefox developer version for testing your add-on. ...
...versions of firefox, you'll need to use the old cfx tool. see instructions for getting started with cfx. the command-line jpm tool. see the instructions for installing jpm. once you've done that, you'll be looking at a command prompt. install firefox developer version for testing your add-on.
initializing an empty add-on in the command prompt, create a new directory. navigate to it, type jpm
init, and hit enter: mkdir my-addon cd my-addon jpm
init you'll then be asked to supply some information about your add-on: this will be used to create your add-on's package.json file. for now, just press enter to accept the default for each property. for more information on jpm
init, see the jpm command reference. once you've supplied a value or accepted the default for these properties, you'll b...
...all.signatures.required to false to run it unsigned. this setting applies to any add-on, so take extra care to not accidently install a malicious one from elsewhere. to distribute your add-on, submit the xpi file to addons.mozilla.org or run jpm sign if you wish to distribute the add-on on your own server. summary in this tutorial we've built and packaged an add-on using three commands: jpm
init to
initialize an empty add-on template jpm run to run a new instance of firefox with the add-on installed, so we can try it out jpm xpi to package the add-on into an xpi file for distribution these are the three main commands you'll use when developing sdk add-ons. there's comprehensive reference documentation covering all the commands you can use and all the options they take. the add-on co...
Getting started (cfx) - Archive of obsolete content
using the cfx command-line tool. cfx has been deprecated and you should use jpm instead. use cfx only if you need to work with firefox 38 or earlier. see: getting started with jpm cfx to jpm prerequisites to create add-ons for firefox using the sdk, you'll first need to follow the instructions to install and activate the sdk. once you've done that, you'll be looking at a command prompt. ...
...jpm prerequisites to create add-ons for firefox using the sdk, you'll first need to follow the instructions to install and activate the sdk. once you've done that, you'll be looking at a command prompt.
initializing an empty add-on in the command prompt, create a new directory. the directory doesn't have to be under the sdk root: you can create it anywhere you like. navigate to it, type cfx
init, and hit enter: mkdir my-addon cd my-addon cfx
init you'll see some output like this: * lib directory created * data directory created * test directory created * doc directory created * readme.md written * package.json written * test/test-main.js written * lib/main.js written * doc/main.md written your sample add-on is now ready for testing: try "cfx test" and then "cfx run". have fun!" imp...
...own firefox installation. you can do this by pressing the ctrl+o key combination (cmd+o on mac) from within firefox, or selecting the "open" item from firefox's "file" menu. this will bring up a file selection dialog; navigate to the "my-addon.xpi" file, open it and follow the prompts to install the add-on. summary in this tutorial we've built and packaged an add-on using three commands: cfx
init to
initialize an empty add-on template cfx run to run a new instance of firefox with the add-on installed, so we can try it out cfx xpi to package the add-on into an xpi file for distribution these are the three main commands you'll use when developing sdk add-ons. there's comprehensive reference documentation covering all the commands you can use and all the options they take. the add-on co...
... level used when an add-on is run using cfx run. this means that if you want to see output from console.log() messages, you'll have to tweak a setting. see the documentation on logging levels for the details on this. ...
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
the option: -chrome file_url.xul another way, as shown in listing 1, is to use the window.opendialog() method, which can be used only within a xul window. this is used by extensions to open a separate window. window.opendialog('another.xul', '_blank','chrome,all,dialog=no'); listing 1: opening a window without the firefox gui xul as an xml application listing 2 shows an example of a gui def
inition file marked up in xul (a "xul document"). the root element in xul is generally the "window" element. the namespace uri is : http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul if the character encoding is utf-8, both the encoding specifier and the xml declaration can be omitted. but for the samples in this chapter, please include them. because a xul document is also an xml docum...
...es fill. id is used to define a unique name for an element, and class is used to classify elements; both of these provide convenient ways to refer to elements in css and javascript. there are also special kinds of element that only come into play after being referenced by another element. orient whether a box's contents will be vertically or horizontally arrayed depends on the elements in their
initial state. you can explicitly set or change this layout using the orient attribute, with options for horizontal and vertical. align and pack the align and pack attributes both specify the layout of elements within a box. they can both take the values start (top or left), center, end (bottom or right), or stretch (extend this element to match the element with the greatest height or width). the a...
...gure 6. <menubar> <menu label="menu 1"> <menupopup> <menuitem label="item 1"/> <menuitem label="item 2"/> <menuseparator/> <menuitem label="item 3"/> <menu label="submenu"> <menupopup> <menuitem label="item 4"/> <menuitem label="item 5"/> </menupopup> </menu> </menupopup> </menu> </menubar> listing 9: a menu def
inition figure 6: output from listing 9 each item in a menu is marked up with the menuitem tag. use the menuseparator element to insert a separator bar that groups items together. both menu and menuitem elements take the label attribute to set their labels. insert menu elements into a menubar element to create multiple menus. you can easily create hierarchical menus by inserting menupopup and men...
... with the id "label1". conversely, if we wanted to insert it directly after, we could have used the attribute insertafter. we can also use the position attribute as a way to locate an element numerically at any position; for example, using position="4" would insert it as the fourth element. external entities being a form of xml, xul can also use entity references based on dtds (document type def
initions) as shown in listing 26. note that external dtd files are limited to what is given in the chrome url, which will be discussed in chapter 5. please be aware that ordinary dtd files on the web or in a local directory will not be opened. note: you may use a relative path to access a chrome url from an xul document. <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet href="chrome://global/s...
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
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 becomes ridiculous. until this redesign, wired news wasn't even using css to style the content inside tables. the sheer amount [sic] of redundant <font> tags inside every cell was probably enough to double file size. my
initial attempts at the markup and css for the wired news design eliminated the majority of our tables, but left one master table to control the primary columns of each page. that approach meant that the content of every column would have to be loaded and calculated before it would be rendered in the browser window. that wasn't good enough. around that time, i started discovering great sites like glis...
...e primary columns of each page. that approach meant that the content of every column would have to be loaded and calculated before it would be rendered in the browser window. that wasn't good enough. around that time, i started discovering great sites like glish.com and bluerobot.com. both presented and documented viable means of producing multi-column layouts without a single table. despite some
initial setbacks with those approaches due to our own unique scenarios, it wasn't long before i discovered a variation of one of their methods that worked for the wired news design. by eliminating tables that were strictly used for layout, we significantly cut back on the amount of markup and useless tags in our html, and gained a structure that is much easier to maintain. now that the content is not...
...e embedded in all past stories of the database. fortunately, our chief engineer was able to write some code that scraped through the database looking for errors like this which would invalidate our markup. we don't make any claims about past archived content, but we've taken many efforts to make sure even stories from a few years ago are as valid as possible. while conversion to xhtml and css def
initely shaved off development time that would have normally been spent manipulating the code, it didn't come entirely easy or without cost. our engineer, aaron jones, actually ended up rebuilding the majority of our vignette templates from scratch. i ran into a steep learning curve, not with the web standards themselves, but with the quirky rendering behaviors and inconsistencies in various browsers.
...documents with many bugs, or you'll have to consciously choose to hide certain bits of style information from browsers that can't support css adequately enough. what are the browser percentages of your current user base, and what about your target user base (which may be different)? will the majority of your users be viewing your pages with a newer, standards-compliant browser? going through the
initial conversion may take longer for some sites, depending on the organization and complexity of the data. pages which draw their content from a database will probably require less labor to convert than sorting through hundreds of flat html files that have mixed structures. whatever the situation, if the conversion is something deemed worthwhile, it's an excellent opportunity to restructure your dat...
Notes on HTML Reflow - Archive of obsolete content
most notably, html tables may require more than one pass. the xul box layout model, on the other hand, is constraint based , meaning that geometric preferences and constraints of neighboring elements are taken into consideration before the elements' final geometry can be computed. the box is the geometric primitive for the xul layout model. all html reflow, including the
initial reflow , begins at the root frame , which corresponds to the <html> element of the html document. reflow proceeds recursively through some or all of the frame hierarchy, computing geometric information for each frame object that requires it. reflow may have the side-effect of creating new continuation frames, for example, for a text frame when the text must be wrapped. some reflows ...
...esentation 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 width property) would note this in the reflow state object before flowing its children. when reflow begins, the root reflow state is
initialized with information about the top-level container for the document's presentation; e.g., the width and height of the application window. this is passed as an argument to the reflow method of the root frame in the frame hierarchy. each container frame constructs a new reflow state object (based on its container's reflow state object) in which the container will reflow its chi...
...example, the available space in the new reflow state is computed by subtracting the container frame's border and padding from the parent reflow state's available space. reflow reason all 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. incremental, when something in the frame tree changes; for example, when more content is read from the network, or some script manipulates the dom. an incremental reflow is targeted at a single frame in the ...
...rnal state (e.g., a text frame's text) has changed; instead, a top-down change in the layout constraints has occurred. stylechange, when the entire frame hierarchy must be traversed to recover from stylistic change; for example, a change in the default font size. dirty, when a container frame has consolidated several individual incremental reflows that have been targeted at its child frames.
initial, incremental, resize, and style change reflows may each be performed as an immediate "global" reflow from the presentation shell: an
initial reflow is performed when the presentation shell is
initialized to flow the shell's
initial frame hierarchy. incremental reflows are dispatched en masse when the presentation shell's incremental reflow queue is asynchronously serviced. ...
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
it implements the iappfilelocprovider interface, and tells xpcom where to find certain files...
...it implements the iappfilelocprovider interface, and tells xpcom where to find certain files and directories. ...
...embedding failed } locationprovider is a class provided by the java application. it implements the iappfilelocprovider interface, and tells xpcom where to find certain files and directories. if your code cannot find the gre and keeps throwing filenotfoundexceptions during the getgrepathwithproperties(...) call, check whether you already registered the gre on your system: gre registration the
initembedding method kicks off the embedding process, allowing the java application to work with xpcom and mozilla. once the java application is done using mozilla, it needs to terminate the embedding process: try { mozilla.termembedding(); } catch (xpcomexception e) { // this exception is thrown if termembedding failed } working with xpcom objects now that mozilla is embedded, the java a...
..._iid); windowwatcher.setwindowcreator(creator); in this example, we have a java class called windowcreator, which implements the nsiwindowcreator interface, and we want to register it with mozilla. to do so, we first get the service manager, through which we can get a reference to mozilla's window watcher. ...
Microsummary topics - Archive of obsolete content
tor(), firefox sets their uri attribute to urn:source:sourceurl, where sourceurl is the url from which the generator was downloaded. in the future, firefox may access source urls to download updated versions of generators, so unless you are installing generators which are available from urls, you should not use this form for your programmatically-installed generators. differentiating between user-
initiated and microsummary-related requests when firefox updates a microsummary generated by a microsummary generator add-on, it automatically downloads the html content of the page being summarized. it does not generally download related content like embedded images and javascript scripts referenced by the page. however, because of a technical limitation (bug 340746), it does download css stylesheets...
...ing summarized. it does not generally download related content like embedded images and javascript scripts referenced by the page. however, because of a technical limitation (bug 340746), it does download css stylesheets referenced by the page. firefox includes the x-moz request header with these requests. it sets the value of the header to the string microsummary. thus, to differentiate requests
initiated manually by users for the purpose of viewing a web page from those
initiated automatically by firefox for the purpose of summarizing that page, check for the presence and value of the x-moz request header. if the x-moz header is present, and its value is microsummary, then the request is a microsummary-related request. otherwise, it is a user-
initiated request. controlling the frequency of ...
...oz request header. if the x-moz header is present, and its value is microsummary, then the request is a microsummary-related request. otherwise, it is a user-
initiated request. controlling the frequency of microsummary requests when firefox downloads content in order to update a microsummary, it honors cache-related http response headers. thus, if you would like to control how frequently firefox
initiates microsummary-related requests to your web server, you can do so by including an http expires or cache-control header in your response to a microsummary-related request. for example, you might include the following header in your response to prevent firefox from making another microsummary-related request for one hour: cache-control: max-age=3600 note: because of a technical limitation (bug ...
... http expires or cache-control header in your response to a microsummary-related request. for example, you might include the following header in your response to prevent firefox from making another microsummary-related request for one hour: cache-control: max-age=3600 note: because of a technical limitation (bug 346820), firefox uses the same cache for both microsummary-related requests and user-
initiated requests, so the cache headers you return apply to both. thus if your cache headers tell firefox not to refresh a page on your site more than once per hour, and the user reloads the page within that time period, the user will see the cached version of your page, which may not be what you want. to mitigate this effect, only return microsummary-specific cache headers in response to microsummar...
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
ng style sheets (css), including most of css1, css2.1 and parts of css3, compared to internet explorer as well as all other browsers. for most issues mentioned below, mozilla will add an error or warning entry into the javascript console. check the javascript console if you encounter css-related issues. mimetypes (when css files are not applied) the most common css-related issue is that css def
initions inside referenced css files are not applied. this is usually due to the server sending the wrong mimetype for the css file. the css specification states that css files should be served 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 whic...
...ed whenever an error occurs during the request. functionref onload if set, the references function will be called when the request completes successfully and the response has been received. use when an asynchronous request is used. void open (string http_method, string url) void open (string http_method, string url, boolean async, string username, string password)
initializes the request for the specified url, using either get or post as the http method. to send the request, call the send() method after
initialization. if async is false, the request is synchronous, else it defaults to asynchronous. optionally, you can specify a username and password for the given url needed. int readystate state of the request. possible values: ...
... 1 loading - send() has not been called yet. 2 loaded - send() has been called, headers and status are available. 3 interactive - downloading, responsetext holds the partial data. ...
...ed, headers and status are available. 3 interactive - downloading, responsetext holds the partial data. 4 completed - finished with all operations. string responsetext string containing the response. domdocument responsexml dom document containing the response. void send(variant body)
initiates the request. if body is defined, it is sent as the body of the post request. body can be an xml document or a string serialized xml document. void setrequestheader (string headername, string headervalue) sets an http request header for use in the http request. has to be called after open() is called. string status the status code of the http response. xslt diff...
Writing textual data - Archive of obsolete content
os.close(); you can also write character arrays using the write function, although using writestring is simpler from javascript code. the example above passes 0 as the third argument, which disables buffering (note: the implementation of the converter stream might not sup...
...ffering (note: the implementation of the converter stream might not support buffering). passing 0 ensures that data will be immediately written to the underlying stream; however, for better perfomance you should pass a value like 4096 instead. unsupported characters you can specify what should happen with characters that are not supported by the selected character encoding. the last argument to
init specifies that: 0x0000 means that writing unsupported characters throws an exception (with an error code of ns_error_loss_of_significant_data), and no data will be written. to instead write a replacement character in such cases, specify the character instead of 0x00: os.
init(fos, charset, 0, "?".charcodeat(0)); you can, of course, replace the "?" in that example with any other character. you ...
... 1.0.x, mozilla 1.7.x and older versions do not support nsiconverteroutputstream. alternative ways usable from javascript do not support character encodings that use embedded nulls (such as utf-16 and utf-32). they work by manually converting the string you want to write to a byte sequence using nsiscriptableunicodeconverter, and writing that to the stream. ...
...tput. var fin = converter.finish(); if (fin.length > 0) os.write(fin, fin.length); os.close(); converting a string into a stream sometimes, it is useful to convert a string into a stream, for example for uploading it using nsiuploadchannel. the example here requires gecko 1.8 (firefox 1.5, seamonkey 1.0). nsiscriptableunicodeconverter has a simple method to do that: // first, get and
initialize the converter var converter = components.classes["@mozilla.org/intl/scriptableunicodeconverter"] .createinstance(components.interfaces.nsiscriptableunicodeconverter); converter.charset = /* the charset you want to use. using utf-8 in this example */ "utf-8"; // now, convert a string to an nsiinputstream var stream = converter.converttoinputstream("a string with no...
Elements - Archive of obsolete content
nt specified by the children element. its value can be a tag name or multiple tag names separated by the pipe character ("|"). a child can only be placed within the insertion point if it is matched by the value in the includes attribute. only immediate children are matched against the selector. for example, an xml fragment <customelement><foobar><hoge/></foobar></customelement> with an binding def
inition <binding id="customelement"><content><xul:box><children includes="hoge"/></xul:box></content></binding> for the customelement element, <xul:box/> becomes empty because the selector includes="hoge" doesn't match for the immediate child foobar element. implementation <!entity % implementation-content "(method|property)*"> <!element implementation %implementation-content;> <!attlist implementa...
... field <!element field empty> <!attlist field id id #implied name cdata #required readonly (true|false) #implied > a field is similar to a property, except that it should not have a getter or setter. it is useful as a simple holder for a value. the field element must have content which is code that determines the
initial value of the field. the field tag must be inside the implementation tag. id - the id attribute is a document-unique identifier. name - the name of the field. this is the name used to refer to the field on the bound element. readonly - if true, this field is read-only. if this attribute is omitted, the field will be readable and writable. note: the readonly attribute did not work correct...
...o refer to the property on the bound element. readonly - the readonly attribute is used to designate a property as read-only. if set to true, the value of the property cannot be altered. if this attribute is omitted, the property will be readable and writable. onget - the onget attribute's value is a script that executes when the value of the property is requested. if this attribute is set, any
initial value contained underneath the element will be ignored. the return value of the script represents the value of the property that will be returned to the requestor. a property getter can also be specified as a child of the property element using the getter tag. onset - the onset attribute's value is a script that executes when the value of the property is being altered. if this attribute is se...
...ue contained underneath the element will be ignored. the return value of the script represents the value of the property that will be returned to the requestor. a property getter can also be specified as a child of the property element using the getter tag. onset - the onset attribute's value is a script that executes when the value of the property is being altered. if this attribute is set, any
initial value contained underneath the element will be ignored. within the script, the parameter val represents the new value being assigned. a property setter can also be specified as a child of the property element using a setter tag. getter <!element getter pcdata> <!attlist getter id id #implied > the getter element contains script that gets executed when a s...
Creating XPI Installer Modules - Archive of obsolete content
f slightly more complex--structure and content specification as the barley.jar. making the barley install script what remains is to package up your jar file in such a way that it can be installed using mozilla's xpinstall technology. the xpi file format is used to designate archives that use mozilla's xpinstall to install themselves. ...
...cation as the barley.jar. making the barley install script what remains is to package up your jar file in such a way that it can be installed using mozilla's xpinstall technology. the xpi file format is used to designate archives that use mozilla's xpinstall to install themselves. ...
... script what remains is to package up your jar file in such a way that it can be installed using mozilla's xpinstall technology. the xpi file format is used to designate archives that use mozilla's xpinstall to install themselves. ...
...n installation script like the one above that tells mozilla xpinstall where to put the new resources and how to register them. to create a xpi, use your zip archiver[zip] again to archive the jar file and the installation script install.js. the archive, named barley.xpi, should contain the following two files: barley.jar install.js this zip file, when opened from mozilla using file -> open, will
initialize its own installation and display a message like the following: when you click ok, mozilla installs the new package. exit mozilla and restart it with mozilla -chrome chrome://barley/content and the new package displays. the resources are installed in the mozilla/bin/chrome/ directory, and the xpi itself can be redistributed for installation on other machines. notes note: zip there exist...
Install Scripts - Archive of obsolete content
window object with the qualifier before it, which means that window.open() can simply be written open(). in an install script, there is no associated window, however the global object will be an install object which contains a number of functions to customize the install process. some of the install object's functions will be described below. the install script should take the following steps:
initialize the installation by specifying what package and version is being installed. use the install functions to indicate what files and directories need to be installed. you can also set files to be moved and deleted. start the process of installing the necessary files. it is important to note that during step two, you only indicate which files should be installed and any other operations you...
...red as directory-like path of the following form: /author/package name replace the word author with your name and replace the package name with the name of the package that you are installing. for example: /xulplanet/find files /netscape/personal security manager the first example is what we'll use for the find files dialog. the second is the key used for the personal security manager. ...
.../author/package name replace the word author with your name and replace the package name with the name of the package that you are installing. for example: /xulplanet/find files /netscape/personal security manager the first example is what we'll use for the find files dialog. the second is the key used for the personal security manager. install
initialization the install object has a function,
initinstall() which can be used to
initialize for the installation. it should be called at the beginning of your installation script. the syntax of this function is as follows:
initinstall( ''packagename'' , ''regpackage'' , ''version'' ); an example
initinstall("find files","/xulplanet/find files","0.5.0.0"); the first argument is the name of the package in user-readable form. the second argumen...
...llation completion the adddirectory() and addfile() functions don't copy any files. they only state which files should be installed. similarly, registerchrome() only states that chrome should be registered. to complete the process and begin copying files, call the performinstall() function. it takes no arguments. ...
Tree View Details - Archive of obsolete content
what the next sibling's row index would be in such a case. example of hierarchical custom view let's put this together into a simple example that takes an array and constructs a tree from it. this tree will only support a single parent level with an inner child level, but it could be extended to support additional levels without too much effort. we'll examine it piece by piece. <window onload="
init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <tree id="elementlist" flex="1"> <treecols> <treecol id="element" label="element" primary="true" flex="1"/> </treecols> <treechildren/> </tree> </window> we use a simple tree here with no data in the treechildren. the '
init' function is called when the window is loaded to
initialize the tree. it simpl...
...treecols> <treecol id="element" label="element" primary="true" flex="1"/> </treecols> <treechildren/> </tree> </window> we use a simple tree here with no data in the treechildren. the '
init' function is called when the window is loaded to
initialize the tree. it simply sets the custom view by retrieving the tree and setting its 'view' property. we will define 'treeview' next. function
init() { document.getelementbyid("elementlist").view = treeview; } the custom tree view will need to implement a number of methods, of which the important ones will be examined individually. first we'll define two structures to hold the data for the tree, the first will hold a map between parents and the children they contain, and the second will hold an array of the visible items. remember that a...
... easiest way to do this is to invalidate the row. complete example there are several other view functions we can implement but they don't need to do anything in this example, so we can create functions that do nothing for those. ...
... « previousnext » ...
XUL Questions and Answers - Archive of obsolete content
for more information please look at the following link: nsextensionmanager.js is nsivariant fully supported using python? python has full support for variants. pass a python string/int/etc to the method requiring an nsivariant. a python object is convered when implmenting an interface taking an nsiv...
...for more information please look at the following link: nsextensionmanager.js is nsivariant fully supported using python? python has full support for variants. pass a python string/int/etc to the method requiring an nsivariant. a python object is convered when implmenting an interface taking an nsivariant. how do i close ...
...terface = function(aiid) { if (aiid.equals(listobj.wpl) || aiid.equals(components.interfaces.nsisupportsweakreference) || aiid.equals(components.interfaces.nsisupports)) return this; throw components.results.ns_nointerface; } listobj.onstatechange = function(aprogress, arequest, aflag, astatus) { if (aflag & listobj.wpl.state_start) { // this fires when the load event is
initiated } else { if (aflag & listobj.wpl.state_stop) { if ( aflag & listobj.wpl.state_is_window ) { // this fires when all load finish } if ( aflag & listobj.wpl.state_is_network ) { // fires when all load are really over, // do something "final" here // (my two cents) } else { // this fires when a load finishes } } } ...
...in addition i need to ev...
XML - Archive of obsolete content
it attempts to balance precise control of layout with flexibility and ease of use, and in this respect it does a great job. using a combination of xul's ready-made widgets (e.g., menubar, scrollbar, progressmeter, and so on) and xul's incorporation of such standards as html4, dom1/2, and cascading stylesheets, you can design any interface that you can imagine, using any number of different features, tools, and methodologies. ...
...ch simpler, in fact, than a lot of xml primers and references would have you believe. in fact, let's create a new xml-based language right now called "memoml". it will consist of a lexicon of four terms: memo, to, from, body -- all of which fit together into a syntax represented in most xml circles as: <!element memo (from, to, body)> for developers accustomed to reading and using xml, this def
inition indicates that the root element "memo" is constituted by a "from" element, then a "to" element, then a "body" element. that's it. in our new language, there are only four words, but they are adequate to describe thestructure of a real, very simple memo. note that our language doesn't suffice to describe the content of the memo, which is written in english. but that's not what markup languages ...
... suffice to describe the content of the memo, which is written in english. but that's not what markup languages are for, in general. ...
...not what markup languages are for, in general. an actual memo using the memoml to represent itself might look like this: <memo> <from>ian oeschger</from> <to>steve rudman</to> <body>i think the first draft of the guide is done!</body> </memo> note how the memo element -- the root element in our brief def
inition, ordeclaration, above -- surrounds the other three elements. in the memoml def
inition, the memo element is defined as containing the from, to, and body elements in that order. so the example here is valid memo according to our dtd; it's a memo that's been writtten in memoml. bam! you're a markup language programmer! you can author an inf
inite number of memos using our new markup language, and all will be structured in a consistent, foreseeable way. this consistency makes it pos...
prefwindow - Archive of obsolete content
tring specifying a window type. if a window with that type is already open, this method will just switch that window to the front and focus it instead of opening another window. if a window of the type is not open, a new one is opened displaying the supplied url. showpane( prefpane ) return type: no return value switch to a particular pane. notes usage patterns opening/
initializing a prefwindow note that you can define an
initwithparams() function in your sub window - to handle parameters passed using openwindow() in case the window was already open. for example the permissions manager ui in firefox uses the same window for three dialogs: images, software installation and popups. it uses
initwithparams() to change the dialog type without closing and re-opening it. ...
...- to handle parameters passed using openwindow() in case the window was already open. for example the permissions manager ui in firefox uses the same window for three dialogs: images, software installation and popups. it uses
initwithparams() to change the dialog type without closing and re-opening it. the suggested usage pattern is as follows: // subwindow.js function onload(ev) { // do some
initialization... ...
...s passed using openwindow() in case the window was already open. for example the permissions manager ui in firefox uses the same window for three dialogs: images, software installation and popups. it uses
initwithparams() to change the dialog type without closing and re-opening it. the suggested usage pattern is as follows: // subwindow.js function onload(ev) { // do some
initialization... ...
...irefox uses the same window for three dialogs: images, software installation and popups. it uses
initwithparams() to change the dialog type without closing and re-opening it. the suggested usage pattern is as follows: // subwindow.js function onload(ev) { // do some
initialization...
initwithparams(window.arguments[0]); // we expect a single parameter to be passed to the window } function
initwithparams(aparams) { // this will also get called when an already open window is activated using openwindow() } closing a prefwindow sometimes you need to do things when the prefwindow is closed, such as things that can't (or shouldn't) be handled as preferences, such as saving passwords or updating sqlite data. to do this, you can set the prefwindow's onunload attribute to a function that wi...
nsIContentPolicy - Archive of obsolete content
t loaded via @font-face rule. type_media 15 indicates a video or audio load. type_websocket 16 indicates a websocket load. type_csp_report 17 indicates a content security policy report. type_xslt 18 indicates a style sheet transformation. type_beacon 19 indicates a beacon post. type_fetch 20 indicates a load
initiated by the globalfetch.fetch() method, which is available as a global in both window and worker contexts. type_imageset 21 indicates a request to load an <img> (with the srcset attribute or <picture>. type_web_manifest 22 indicates a request to load a web manifest. type_internal_script 23 an internal constant used to represent scripts loaded usin...
...equestorigin, in nsisupports acontext, in acstring amimetypeguess, in nsisupports aextra, in nsiprincipal arequestprincipal ); parameters acontenttype the type of content being tested. this will be one one of the content types listed above. acontentlocation the uri of the content being checked; must not be null. arequestorigin {optional_inline}} the location of the resource that
initiated this load request; can be null if inapplicable. acontext {optional_inline}} the nsidomnode or nsidomwindow that
initiated the request, or something that can queryinterface() to one of those; can be null if inapplicable. note: acontext is the new tab/window when a user uses the context menu to open a link in a new tab/window or cmd/ctrl + clicks the link (i.e., acontext is not the tab ...
...yinterface() to one of those; can be null if inapplicable. note: acontext is the new tab/window when a user uses the context menu to open a link in a new tab/window or cmd/ctrl + clicks the link (i.e., acontext is not the tab which the link was on in these cases). amimetypeguess optional. a guess for the requested content's mime type, based on information available to the request
initiator (e.g., an object's type attribute); does not reliably reflect the actual mime type of the requested content. aextra an optional argument, pass-through for non-gecko callers to pass extra data to callees. arequestprincipal optional. defines the principal that caused the load. this is optional only for non-gecko code: all gecko code should set this argument. for navigation events, this ...
...rts acontext, in acstring amimetype, in nsisupports aextra, in nsiprincipal arequestprincipal ); parameters acontenttype the type of content being tested. this will be one of the type_* constants. acontentlocation optional. the location of the resource being requested: may be, e.g., a post-redirection uri for the resource. arequestorigin optional. the location of the resource that
initiated this load request; can be null if inapplicable. acontext optional. the nsidomnode or nsidomwindow that
initiated the request, or something that can query interface to one of those; can be null if inapplicable. amimetype the mime type of the requested resource (for example, image/png), as reported by the networking library, if available (may be empty if inappropriate for the type, e.g., t...
Writing a plugin for Mac OS X - Archive of obsolete content
mime and filename extension information using the info.plist file, which is packaged in the plugin bundle. the plugin also communicates its bundle type in that file, under the key cfbundlepackagetype; the type is 'brpl'. if the type isn't an npapi plugin type, the bundle won't load as an npapi plugin. you can always just use 'brpl'. xp_macosx it's important to define the gcc preprocessor def
inition xp_macosx to 1; this is used by the npapi headers to build properly on mac os x. if you don't define it, they won't be interpreted correctly. this is easy to miss in the sample project's build settings. symbol visibility symbol visibility is a common problem for people trying to get npapi plugins working. some symbols must be visible as standard c symbols so the browser can find them, whi...
...ect's build settings. symbol visibility symbol visibility is a common problem for people trying to get npapi plugins working. some symbols must be visible as standard c symbols so the browser can find them, which means they need to be prefixed by an underscore, and must not have the c++ obfuscation that is generated by the c++ compiler. the three symbols that must always be visible are: np_
initialize() np_getentrypoints() np_shutdown() the sample plugin is written entirely in c, using a standard xcode build configuration, so by default all of its symbols are c-style and visible. if you want to implement your plugin in c++ or objective-c++, you need to tell the compiler to export them in c format by using extern "c" in the header, like this: #pragma gcc visibility push(default) ex...
...nts() np_shutdown() the sample plugin is written entirely in c, using a standard xcode build configuration, so by default all of its symbols are c-style and visible. ...
...{ nperror np_
initialize(npnetscapefuncs *browserfuncs); nperror np_getentrypoints(nppluginfuncs *pluginfuncs); void np_shutdown(void); } #pragma gcc visibility pop you can check to be sure your symbols are visible and in standard c format by using the nm utility provided among the mac os x developer tools: [user@foo mymac] nm basicplugin ... ...
Describing microformats in JavaScript - Archive of obsolete content
for firefox 3, this should be set to 0.8. mfobject the javascript object that implements the microformat. classname a string specifying the name of the microformat's class as referenced in html (class="classname"). ...
...for firefox 3, this should be set to 0.8. mfobject the javascript object that implements the microformat. classname a string specifying the name of the microformat's class as referenced in html (class="classname"). ...
...lephone number html html including tags float a floating-point number microformat a microformat microformat_property a specific property within the microformat specified by microformat. custom custom data a simple example the hcard microformat for defining contact information makes use of the adr microformat to define an address. ...
...tiple types can be specified. this allows an address to be marked as being, for example, a work address for receiving parcels. the street-address property is plural as well. this allows multiple lines of address information to be contained in the street-address array. the microformat is registered with the microformat api by calling microformats.add(), like this: microformats.add("adr", adr_def
inition); note: to be clear: since the adr microformat is included by default in firefox 3 and later, you don't need to add it yourself if you wish to make use of it. see also using microformats, parsing microformats in javascript ...
Building up a basic demo with Babylon.js - Game development
render the content on) to fill the entire available viewport space. the first <script> element includes the babylon.js library in the page; we will write our example code in the second one. there is one helper variable already included, which will store a reference to the <canvas> element. before reading on, copy this code to a new text file and save it in your working directory as index.html.
initialising the babylon.js engine we have to create a babylon.js engine instance first (passing it the <canvas> element to render on) before we start developing our game. add the following code to the bottom of your second <script> element: var engine = new babylon.engine(canvas); the babylon global object contains all the babylon.js functions available in the engine. creating a scene a scene i...
...ering loop to make the scene actually visible we have to render it. add these lines at the end of the <script> element, just before the closing </script>. var renderloop = function () { scene.render(); }; engine.runrenderloop(renderloop); we're using the engine's runrenderloop() method to execute the renderloop() function repeatedly on every frame — the loop will continue to render indef
initely until told to stop. creating a camera now the setup code is in place we need to think about implementing the standard scene components: camera, light and objects. let's start with the camera — add this line to your code below the scene creation and the line where we defined the clearcolor. var camera = new babylon.freecamera("camera", new babylon.vector3(0, 0, -10), scene); there are ma...
...hink about implementing the standard scene components: camera, light and objects. let's start with the camera — add this line to your code below the scene creation and the line where we defined the clearcolor. var camera = new babylon.freecamera("camera", new babylon.vector3(0, 0, -10), scene); there are many cameras available in babylon.js; freecamera is the most basic and universal one. to
initialize it you need to pass it three parameters: any name you want to use for it, the coordinates where you want it to be positioned in the 3d space, and the scene you want to add it to. note: you probably noticed the babylon.vector3() method in use here — this defines a 3d position on the scene. babylon.js is bundled with a complete math library for handling vectors, colors, matrices etc. le...
...3() method in use here — this defines a 3d position on the scene. babylon.js is bundled with a complete math library for handling vectors, colors, matrices etc. let there be light there are various light sources available in babylon.js. the most basic one is the pointlight, which works like a flashlight — shining a spotlight in a given direction. add the following line below your camera def
inition: var light = new babylon.pointlight("light", new babylon.vector3(10, 10, 0), scene); the parameters are very similar to the previously defined camera: the name of the light, a position in 3d space and the scene to which the light is added. geometry now the scene is properly rendering we can start adding 3d shapes to it. to speed up development babylon.js provides a bunch of predefined pr...
Building up a basic demo with PlayCanvas editor - Game development
t option and enter a name for it (we are using "mdn games demo".) enter a description if you want — it is optional. click create to have it created. next you'll see your project's page — there's not much yet. by clicking the editor button we'll launch the online playcanvas editor where we'll create our scene with the shapes. do this now. creating the scene here's how the scene looks
initially in the editor. even though it's a blank new project we don't have to start entirely from scratch — the camera and directional light are prepared already, so you don't have to worry about them. now onto the creative part. to add an entity to the scene you have to click on the big plus button located in the top left area of the editor, next to the hierarchy text. when hovering over that b...
... it, you'll be moved to a code editor. as you can see, the file contains some boilerplate code already: pc.script.create('boxanimation', function (app) { // creates a new boxanimation instance var boxanimation = function (entity) { this.entity = entity; }; boxanimation.prototype = { // called once after all resources are loaded and before the first update
initialize: function () { }, // called every frame, dt is time in seconds since last update update: function (dt) { } }; return boxanimation; }); the most interesting part is the update() function, which is where we can put any code that we want repeated on every frame. add the following line inside this function, to rotate the cube on every frame: this.enti...
...ipt to the box object. the cylinder now we'll do the same steps for cylinder. first: create a new script asset. name it cylinderanimation.js. double click the script icon to launch the code editor. this time instead of rotating the object we will try to scale it. for that we'll need a timer to store the total amount of time passed since the start of the animation. add this code to the
initialize() function: this.timer = 0; and those two lines to the update() function: this.timer += dt; this.entity.setlocalscale(1, math.abs(math.sin(this.timer)), 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...
...he 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. ...
Audio for Web games - Game development
wsers. there is further information about it here from the google developers site. it is worth noting that autoplay with sound is allowed if: the user has interacted with the domain. on mobile the user has added the site to their home screen. ...
...d the site to their home screen. many browsers will simply ignore any requests made by your game to automatically play audio; instead playback for audio needs to be started by a user-
initiated event, such as a click or tap. this means you will have to structure your audio playback to take account of that. this is usually mitigated against by loading the audio in advance and priming it on a user-
initiated event. for more passive audio auto play, for example background music that starts as soon as a game loads, one trick is to detect any user
initiated event and start playback then. for other more active sounds that are to be used during the game we could consider priming them as soon as something like a start button is pressed. to prime audio like this we want to play a part of it; for this...
...s and platforms to see how it works. volume programmatic volume control may be disabled in mobile browsers. the reason often given is that the user should be in control of the volume at the os level and this shouldn't be overridden. buffering and preloading likely as an attempt to mitigate runaway mobile network data use, we also often find that buffering is disabled before playback has been
initiated. buffering is the process of the browser downloading the media in advance, which we often need to do to ensure smooth playback. the htmlmediaelement interface comes with lots of properties to help determine whether a track is in a state to be playable. note: in many ways the concept of buffering is an outdated one. as long as byte-range requests are accepted (which is the default behavior...
...n() { myaudio.currenttime = this.getattribute("data-start"); stoptime = this.getattribute("data-stop"); myaudio.play(); }, false); } myaudio.addeventlistener('timeupdate', function() { if (this.currenttime > stoptime) { this.pause(); } }, false); note: you can try out our audio sprite player live on jsfiddle. note: on mobile we may need to trigger this code from a user-
initiated event such as a start button being pressed, as described above. note: watch out for bit rates. encoding your audio at lower bit rates means smaller file sizes but lower seeking accuracy. background music music in games can have a powerful emotional effect. you can mix and match various music samples and assuming you can control the volume of your audio element you could cross-fade diff...
Extra lives - Game development
; 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. ...
...ible = false; the livestext and lifelosttext objects look very similar to the scoretext one — they define a position on the screen, the actual text to display, and the font styling. the former is anchored on its top right edge to align properly with the screen, and the latter is centered, both using anchor.set(). the lifelosttext will be shown only when the life is lost, so its visibility is
initially set to false. making our text styling dry as you probably noticed we're using the same styling for all three texts: scoretext, livestext and lifelosttext. if we ever want to change the font size or color we will have to do it in multiple places. to make it easier for us to maintain in the future we can create a separate variable that will hold our styling, let's call it textstyle and place...
...king our text styling dry as you probably noticed we're using the same styling for all three texts: scoretext, livestext and lifelosttext. if we ever want to change the font size or color we will have to do it in multiple places. ...
...fbounds.add(function(){ alert('game over!'); location.reload(); }, this); we will assign a new function called ballleavescreen; delete the previous event handler (shown above) and replace it with the following line: ball.events.onoutofbounds.add(ballleavescreen, this); we want to decrease the number of lives every time the ball leaves the canvas. ...
Cascade and inheritance - Learn web development
nt! which properties are inherited by default and which aren't is largely down to common sense. controlling inheritance css provides four special universal property values for controlling inheritance. every css property accepts these values. inherit sets the property value applied to a selected element to be the same as that of its parent element. effectively, this "turns on inheritance".
initial sets the property value applied to a selected element to the
initial value of that property. unset resets the property to its natural value, which means that if the property is naturally inherited it acts like inherit, otherwise it acts like
initial. note: there is also a newer value, revert, which has limited browser support. note: see origin of css declarations in introducing the cs...
...hat 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 these inheritance values to (almost) all properties at once. its value can be any one of the inheritance values (inherit,
initial, unset, or revert). it's a convenient way to undo changes made to styles so that you can get back to a known starting point before beginning new changes. in the below example we have two blockquotes. the first has styling applied to the blockquote element itself, the second has a class applied to the blockquote which sets the value of all to unset. try setting the value of all to some of ...
... properties which are the same. this behavior helps avoid repetition in your css. a common practice is to define generic styles for the basic elements, and then create classes for those which are different. for example, in the stylesheet below we have defined generic styles for level 2 headings, and then created some classes which change only some of the properties and values. the values defined
initially are applied to all headings, then the more specific values are applied to the headings with the classes. let's now have a look at how the browser will calculate specificity. we already know that an element selector has low specificity and can be overwritten by a class. essentially a value in points is awarded to different types of selectors, and adding these up gives you the weight of th...
...s 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 cascade, specificity, and inheritance, then don't worry! this is def
initely the most complicated thing we've covered so far in the course, and is something that even professional web developers sometimes find tricky. we'd advise that you return to this article a few times as you continue through the course, and keep thinking about it. refer back here if you start to come across strange issues with styles not applying as expected. it could be a specificity issue. ...
Positioning - Learn web development
so for example, if you specify top: 30px;, a force pushes the top of the box, causing it to move downwards by 30px. note: you can see the example at this point live at 2_relative-positioning.html (...
... rather than positioning the element based on its relative position within the normal document layout flow, they specify the distance the element should be from each of the containing element's sides. so in this case, we are saying that the absolutely positioned element should sit 30px from the top of the "containing element", and 30px from the left. (in this case, the "containing element" is the
initial containing block. see the section below for more information) note: you can use top, bottom, left, and right to resize elements if you need to. try setting top: 0; bottom: 0; left: 0; right: 0; and margin: 0; on your positioned elements and see what happens! put it back again afterwards... note: yes, margins still affect positioned elements. margin collapsing doesn't, however. note: yo...
...t" of an absolutely positioned element? this is very much dependent on the position property of the ancestors of the positioned element (see identifying the containing block). if no ancestor elements have their position property explicitly defined, then by default all ancestor elements will have a static position. the result of this is, the absolutely positioned element will be contained in the
initial containing block. the
initial containing block has the dimensions of the viewport, and is also the block that contains the <html> element. simply put, the absolutely positioned element will be displayed outside of the <html> element, and be positioned relative to the
initial viewport. the positioned element is nested inside the <body> in the html source, but in the final layout, it is 30px a...
... use. using 2 and 3 would give the same effect as 300 and 40000. note: you can see the example at this point live at 5_z-index.html (see source code). fixed positioning let's now look at fixed positioning. this works in exactly the same way as absolute positioning, with one key difference: whereas absolute positioning fixes an element in place relative to its nearest positioned ancestor (the
initial containing block if there isn't one), fixed positioning usually fixes an element in place relative to the visible portion of the viewport, except if one of its ascendants is a fixed containing block 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 h...
Advanced text formatting - Learn web development
arn how to use lesser-known html elements to mark up advanced semantic features. description lists in html text fundamentals, we walked through how to mark up basic lists in html, but we didn't mention the third type of list you'll occasionally come across — description lists. ...
... description lists in html text fundamentals, we walked through how to mark up basic lists in html, but we didn't mention the third type of list you'll occasionally come across — description lists. the purpose of these lists is to mark up a set of items and their associated descriptions, such as terms and def
initions, or questions and answers. let's look at an example of a set of terms and def
initions: soliloquy in drama, where a character speaks to themselves, representing their inner thoughts or feelings and in the process relaying them to the audience (but not to other characters.) monologue in drama, where a character speaks their thoughts out loud to share them with the audience and any other characters present. aside in drama, where a character shares a comment only with the audienc...
...nt. aside in drama, where a character shares a comment only with the audience for humorous or dramatic effect. this is usually a feeling, thought or piece of additional background information description lists use a different wrapper than the other list types — <dl>; in addition each term is wrapped in a <dt> (description term) element, and each description is wrapped in a <dd> (description def
inition) element. let's finish marking up our example: <dl> <dt>soliloquy</dt> <dd>in drama, where a character speaks to themselves, representing their inner thoughts or feelings and in the process relaying them to the audience (but not to other characters.)</dd> <dt>monologue</dt> <dd>in drama, where a character speaks their thoughts out loud to share them with the audience and any other ch...
...s a comment only with the audience for humorous or dramatic effect. this is usually a feeling, thought, or piece of additional background information.</dd> <dd>in writing, a section of content that is related to the current topic, but doesn't fit directly into the main flow of content so is presented nearby (often in a box off to the side.)</dd> </dl> active learning: marking up a set of def
initions it's time to try your hand at description lists; add elements to the raw text in the input field so that it appears as a description list in the output field. you could try using your own terms and descriptions if you like. 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 code <h2>li...
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
-color: red; margin: 0; display: flex; justify-content: center; align-items: center; } div { display: inline-block; font-size: 10rem; } insert a <script> element just above the closing </body> tag. insert the following javascript inside your <script> element. here, you're storing a reference to the <div> inside a constant, setting a rotatecount variable to 0, setting an un
initialized variable that will later be used to contain a reference to the requestanimationframe() call, and setting a starttime variable to null, which will later be used to store the start time of the requestanimationframe(). const spinner = document.queryselector('div'); let rotatecount = 0; let starttime = null; let raf; below the previous code, insert a draw() function that will be used...
...raw() function, insert the following line. this is the key to the whole operation — you are setting the variable defined earlier to an active requestanimation() call, which takes the draw() function as its parameter. this starts the animation off, constantly running the draw() function at a rate as near 60 fps as possible. raf = requestanimationframe(draw); below the draw() function def
inition, add a call to the the draw() function to start the animation. draw(); note: you can find the finished example live on github. (you can see the source code, also.) clearing a requestanimationframe() call clearing a requestanimationframe() call can be done by calling the corresponding cancelanimationframe() method. (note that the function name starts with "cancel", not "clear" as wit...
...t'); in order, these are: a reference to the spinner, so you can animate it. a reference to the <div> element that contains the spinner, used for showing and hiding it. a rotate count. this determines how much you want to show the spinner rotated on each frame of the animation. a null start time. this will be populated with a start time when the spinner starts spinning. an un
initialized variable to later store the requestanimationframe() call that animates the spinner. a reference to the start button. a reference to the results paragraph. next, below the previous lines of code, add the following function. it simply takes two numbers and returns a random number between the two. you'll need this to generate a random timeout interval later on. function rand...
...ner. this is very similar to the version from the simple spinner example, earlier: function draw(timestamp) { if(!starttime) { starttime = timestamp; } rotatecount = (timestamp - starttime) / 3; if(rotatecount > 359) { rotatecount %= 360; } spinner.style.transform = 'rotate(' + rotatecount + 'deg)'; raf = requestanimationframe(draw); } now it is time to set up the
initial state of the app when the page first loads. add the following two lines, which simply hide the results paragraph and spinner container using display: none;. result.style.display = 'none'; spinnercontainer.style.display = 'none'; next, define a reset() function, which sets the app back to the original state required to start the game again after it has been played. add the following at...
Client-side storage - Learn web development
notes into the database. the css provides some simple styling to make it clearer what is going on. the javascript file contains five declared constants containing references to the <ul> element the notes will be displayed in, the title and body <input> elements, the <form> itself, and the <button>. rename your javascript file to index.js. you are now ready to start adding code to it. database
initial set up now let's look at what we have to do in the first place, to actually set up a database. below the constant declarations, add the following lines: // create an instance of a db object for us to store the open database in let db; here we are declaring a variable called db — this will later be used to store an object representing our database. we will use this in a few place...
... in the lifecycle. once the request has succeeded, we clear the form inputs ready for entering the next note. once the transaction has completed, we run the displaydata() function again to update the display of notes on the page. displaying the data we've referenced displaydata() twice in our code already, so we'd probably better define it. ...
...lar to the previous example, and the code is well-commented. for this simple example, we've stored the names of the videos to fetch in an array of objects: const videos = [ { 'name' : 'crystal' }, { 'name' : 'elf' }, { 'name' : 'frog' }, { 'name' : 'monster' }, { 'name' : 'pig' }, { 'name' : 'rabbit' } ]; to start with, once the database is successfully opened we run an
init() function. this loops through the different video names, trying to load a record identified by each name from the videos database. if each video is found in the database (easily checked by seeing whether request.result evaluates to true — if the record is not present, it will be undefined), its video files (stored as blobs) and the video name are passed straight to the displayvideo() functi...
...e (easily checked by seeing whether request.result evaluates to true — if the record is not present, it will be undefined), its video files (stored as blobs) and the video name are passed straight to the displayvideo() function to place them in the ui. if not, the video name is passed to the fetchvideofromnetwork() function to ... you guessed it — fetch the video from the network. ...
Adding features to our bouncing balls demo - Learn web development
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 def
initions 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, try reloading the code — it should work just the same as it did before, with our redesigned objects. defining evilcircle() now it's time to me...
...operties 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 copying the ball.prototype.draw def
inition. you should then make the following changes: we want the evil circle to not be filled in, but rather just have an outer line (stroke). you can achieve this by updating fillstyle and fill() to strokestyle and stroke(). we also want to make the stroke a bit thicker, so you can see the evil circle a bit more easily. this can be achieved by setting a value for linewidth somewhere after the beg...
...ircle a bit more easily. this can be achieved by setting a value for linewidth somewhere after the beginpath() call (3 will do). checkbounds() this method will do the same thing as the first part of ball()'s update() function — look to see whether the evil circle is going to go off the edge of the screen, and stop it from doing so. again, you can mostly just copy the ball.prototype.update def
inition, but there are a few changes you should make: get rid of the last two lines — we don't want to automatically update the evil circle's position on every frame, because we will be moving it in some other way, as you'll see below. inside the if() statements, if the tests return true we don't want to update velx/vely; we want to instead change the value of x/y so the evil circle is bounced b...
...e the value of x/y so the evil circle is bounced back onto the screen slightly. adding or subtracting (as appropriate) the evil circle's size property would make sense. setcontrols() this method will add an onkeydown event listener to the window object so that when certain keyboard keys are pressed, we can move the evil circle around. ...
Inheritance in JavaScript - Learn web development
rests; }; the methods are all defined on the constructor's prototype. for example: person.prototype.greeting = function() { alert('hi! i\'m ' + this.name.first + '.'); }; note: in the source code, you'll also see bio() and farewell() methods defined. later you'll see how these can be inherited by other constructors. say we wanted to create a teacher class, like the one we described in our
initial object-oriented def
inition, which inherits all the members from person, but also includes: a new property, subject — this will contain the subject the teacher teaches. an updated greeting() method, which sounds a bit more formal than the standard greeting() method — more suitable for a teacher addressing some students at school. defining a teacher() constructor function the first th...
...rn class syntax. this is called creating a subclass or subclassing. to create a subclass we use the extends keyword to tell javascript the class we want to base our class on, class teacher extends person { constructor(subject, grade) { this.subject = subject; this.grade = grade; } } but there's a little catch. unlike old-school constructor functions where the new operator does the
initialization of this to a newly-allocated object, this isn't automatically
initialized for a class defined by the extends keyword, i.e the sub-classes. therefore running the above code will give an error: uncaught referenceerror: must call super constructor in derived class before accessing 'this' or returning from derived constructor for sub-classes, the this intialization to a newly allocated o...
...in derived class before accessing 'this' or returning from derived constructor for sub-classes, the this intialization to a newly allocated object is always dependant on the parent class constructor, i.e the constructor function of the class from which you're extending. here we are extending the person class — the teacher sub-class is an extension of the person class. so for teacher, the this
initialization is done by the person constructor. to call the parent constructor we have to use the super() operator, like so: class teacher extends person { constructor(subject, grade) { super(); // now 'this' is
initialized by calling the parent constructor. this.subject = subject; this.grade = grade; } } there is no point having a sub-class if it doesn't inherit properties from t...
...or, we can see it has the following block of code in its constructor method: constructor(first, last, age, gender, interests) { this.name = { first, last }; this.age = age; this.gender = gender; this.interests = interests; } since the super() operator is actually the parent class constructor, passing it the necessary arguments of the parent class constructor will also
initialize the parent class properties in our sub-class, thereby inheriting it: class teacher extends person { constructor(first, last, age, gender, interests, subject, grade) { super(first, last, age, gender, interests); // subject and grade are specific to teacher this.subject = subject; this.grade = grade; } } now when we instantiate teacher object instances, we can call met...
Object-oriented JavaScript for beginners - Learn web development
rather than having to duplicate it. where functionality differs between classes, you can define specialized features directly on them as needed. this is really useful — teachers and students share many common features such as name, gender, and age, so it is convenient to only have to define those features once. you can also define the same feature separately in different classes, as each def
inition of that feature will be in a different namespace. for example, a student's greeting might be of the form "yo, i'm [firstname]" (e.g yo, i'm sam), whereas a teacher might use something more formal, such as "hello, my name is [prefix] [lastname], and i teach [subject]." (e.g hello, my name is mr griffiths, and i teach chemistry). note: the fancy word for the ability of multiple object types to...
...le object types to implement the same functionality is polymorphism. just in case you were wondering. you can now create object instances from your child classes. for example: in the rest of the article, we'll start to look at how oop theory can be put into practice in javascript. constructors and object instances javascript uses special functions called constructor functions to define and
initialize objects and their features. they are useful because you'll often come across situations in which you don't know how many objects you will be creating; constructors provide the means to create as many objects as you need in an effective way, attaching data and functions to them as required. let's explore creating classes via constructors and creating object instances from them in javascript...
...gain: let person1 = new person('bob'); let person2 = new person('sarah'); in each case, the new keyword is used to tell the browser we want to create a new object instance, followed by the function name with its required parameters contained in parentheses, and the result is stored in a variable — very similar to how a standard function is called. ...
... getting and setting the members of the resulting object instances. in addition, there are a couple of problems with our bio() method — the output always includes the pronoun "he", even if your person is female, or some other preferred gender classification. and the bio only includes two interests, even if more are listed in the interests array. can you work out how to fix this in the class def
inition (constructor)? you can put any code you like inside a constructor (you'll probably need a few conditionals and a loop). think about how the sentences should be structured differently depending on gender, and depending on whether the number of listed interests is 1, 2, or more than 2. note: if you get stuck, we have provided an answer inside our github repo (see it live) — try writing it yo...
Understanding client-side JavaScript frameworks - Learn web development
s in the process. 2. beginning our react todo list let's say that we’ve been tasked with creating a proof-of-concept in react – an app that allows users to add, edit, and delete tasks they want to work on, and also mark tasks as complete without deleting them. this article will walk you through putting the basic app component structure and styling in place, ready for individual component def
inition and interactivity, which we'll add later. 3. componentizing our react app at this point, our app is a monolith. before we can make it do things, we need to break it apart into manageable, descriptive components. react doesn’t have any hard rules for what is and isn’t a component – that’s up to you! in this article, we will show you a sensible way to break our app up into components. ...
...n the ember-todomvc-tutorial repository. for a running live version, see https://nullvoxpopuli.github.io/ember-todomvc-tutorial/ (this also includes a few additional features not covered in the tutorial). 1. getting started with ember in our first ember article we will look at how ember works and what it's useful for, install the ember toolchain locally, create a sample app, and then do some
initial setup to get it ready for development. 2. ember app structure and componentization in this article we'll get right on with planning out the structure of our todomvc ember app, adding in the html for it, and then breaking that html structure into components. 3. ember interactivity: events, classes and state at this point we'll start adding some interactivity to our app, providing the abilit...
...lly we will go over our app and see what modifications we have to make to fully take advantage of typescript features. 8. deployment and next steps in this final article we will look at how to deploy your application and get it online, and also share some of the resources that you should go on to, to continue your svelte learning journey. which frameworks did we choose? we are publishing our
initial set of articles with guides focusing on four frameworks. three of them are very popular and well-established — react/reactdom, ember, and vue — whereas svelte is a comparative newcomer that shows a lot of promise and has gained a lot of recent popularity. there is a variety of reasons for this: they are popular choices that will be around for a while — like with any software tool, it...
...ocus on out of the huge number of choices available is a very real problem. keeping the list short is therefore helpful. we want to say this upfront — we've not chosen the frameworks we are focusing on because we think they are the best, or because we endorse them in any way. we just think they score highly on the above criteria. note that we were hoping to have more frameworks included upon
initial publication, but we decided to release the content and then add more framework guides later, rather than delay it longer. if your favourite framework is not represented in this content and you'd like to help change that, feel free to discuss it with us! get in touch with us via matrix, or discourse, or drop us a mail on the mdn-admins list. ...
Mozilla accessibility architecture
e mozilla should use the api's programmatic interfaces to expose this information to an accessibility client (the assistive technology). each platform's accessibility api has made different assumptions, although there are a number of common characteristics. for example, they all expose an accessible name, or text representation, of each object, and they all use an enumerated integer value from a f
inite list, to expose the role of an object. examples of accessible role constants are role_button, role_checkbox and role_list, although they can have slightly different names and values in each api. in general, the accessibility apis use similar concepts, but use different method, constant and interfaces names. given that there is a fair amount of commonality between accessibility api toolkits, it m...
.... however, because this would have caused a lot of difficulty when implementing the accessibility cache, the code was moved in to the "wrap" classes in a source directory specific to each toolkit. classes with "wrap" in the name, such as nstextaccessiblewrap and nsdocaccessiblewrap, inherit from cross-platform classes of similar name without "wrap" in them. they may override some methods, such as
init() and shutdown(), and add other methods to support interfaces needed only by the given toolkit. for example, nsaccessiblewrap implements the methods in iaccessible, but because it is also an nsaccessible, it only needs to call the nsiaccessible methods in "this" to get at the information it needs. class inheritence diagram view the class inheritence diagram. 3. accessible tree construction and tr...
...accessnodewrap. isimpledomnode is used by the assistive technology to get access to information about individual dom nodes which may or may not be "accessible". because an nsaccessnode can point to any dom node, even dom nodes that are not "accessible", it may or may not also be an nsaccessible. in other words, the lowest common denominator for objects we must cache is nsaccessnode. nsaccessnode::
init() when nsaccessibilityservice::getaccessible() gets a newly created accessible, it calls nsiaccessnode::
init() on the new object, which will add this to the cache for the doc accessible. each nsaccessnode contains the dom node and weak pres shell for the object. the weak pres shell is used to create a hash key to get the doc accessible from gglobaldocaccessiblecache. the dom node pointer is used ...
...it() on the new object, which will add this to the cache for the doc accessible. each nsaccessnode contains the dom node and weak pres shell for the object. the weak pres shell is used to create a hash key to get the doc accessible from gglobaldocaccessiblecache. the dom node pointer is used to create the new hash key and add the nsiaccessnode* into the document accessible's maccessnodecache. the
init() method is also virtual, and many accessibles override it to do their own special
initialization. if they do, they must also call their parent class'
init() method when finished. nsaccessnode::shutdown() shutdown() is used when the dom node for the given nsaccessnode/nsaccessible no longer exists. it can be called in a number of ways: in the destructor for nswindow: when the document is destr...
How Mozilla's build system works
cribe the current state of the system and what the existing build configuration looks like. for example, a data structure defines which compiler to use, how to invoke it, which application features are enabled, and so on. you are encouraged to open config.status to have a look! after we have emitted a config.status file, we proceed to phase 2. phase 2: build backend preparation and the build def
inition once configure has determined what the current build configuration is, we need to apply this to the source tree so we can actually build. what essentially happens is the automatically produced config.status python script is executed as soon as configure has generated it. config.status is charged with the task of telling a tool how to build the tree. to do this, config.status must first scan ...
...has determined what the current build configuration is, we need to apply this to the source tree so we can actually build. what essentially happens is the automatically produced config.status python script is executed as soon as configure has generated it. config.status is charged with the task of telling a tool how to build the tree. to do this, config.status must first scan the build system def
inition. the build system def
inition consists of various moz.build files in the tree. there is roughly one moz.build file per directory or per set of related directories. each moz.build file defines how its part of the build configuration works. for example, it says i want these c++ files compiled or look for additional information in these directories. config.status starts with the main moz.build fi...
...ed directories. each moz.build file defines how its part of the build configuration works. for example, it says i want these c++ files compiled or look for additional information in these directories. config.status starts with the main moz.build file and then recurses into all referenced files and directories. as the moz.build files are read, data structures describing the overall build system def
inition are emitted. these data structures are then read by a build backend generator, which then converts them into files, function calls, and so on. in the case of a make backend, the generator writes out makefiles. when config.status runs, you'll see the following output: reticulating splines... finished reading 1096 moz.build files into 1276 descriptors in 2.40s backend executed in 2.39s 2188 to...
... a particular build target is dirs. dirs is a list of subdirectories of the current directory to recursively build in. subdirectories are traversed after their 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 def
inition 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 bui...
Eclipse CDT Manual Setup
e need to carry out a thorough static analysis of the project's source files, to build up a picture of the code (what eclipse is trying to do when it "indexes" the source.) static analysis involves parsing the source files, so naturally it can only produce good results if it has a sensible set of preprocessor defines, include paths and pre-include files for each source file. since eclipse doesn't
initially have any of this information, the code assistance that it's able to provide out of the box is pretty broken. for projects the size and complexity of mozilla, it's impractical to manually configure eclipse when there is a valid set of defines and includes paths for each of the different parts of the source code. happily, eclipse makes manual configuration unnecessary. like some other ides,...
...but these are worth sacrificing for much improved code assistance. see the building from eclipse section below if you're interested in what you lose. if you're interested in future improvements to eclipse that would allow parallel builds to be run from inside eclipse while still allowing it to obtain the compiler options, see the faq isn't there a better method of build option discovery? below.)
initial workspace preferences when you open eclipse, it will ask you to "select a workspace" (a directory where eclipse will store files that it generates during indexing, and so on.) it's recommended that you have a separate workspace containing only a single project for each mozilla source tree [rational], and that you choose a directory outside the mozilla source. something like $home/eclipse-work...
... in the source tree). click on the little green button beside this message to open the "progress" tab, and keep an eye on the "refreshing workspace" item as you continue with the steps below. (if an "indexing" item starts after the "refreshing the workspace" item has finished, click the little red box beside that item to cancel it, since we want to configure the project before the indexer runs.)
initial project properties so that the indexer will run faster and give better results, and so that eclipse doesn't give results for irrelevant files, you should add some resource filters to have eclipse ignore certain non-source files and directories. note, you must not make eclipse ignore your (main) object directory. that object directory is needed to resolve include paths to the various headers t...
... 30 seconds on a warm tree (files cached in ram) if your object directory is up to date, although eclipse will take several minutes to process the "build output" that it produces. download just-print-mozilla-build.py and change its permissions to make it executable ('chmod a+x just-print-mozilla-build.py'). if you don't put just-print-mozilla-build.py somewhere in your path, then go back to the
initial project properties section where you set just-print-mozilla-build.py and specify its absolute path instead of just its name. now invoke the script by clicking the build button (the button with the hammer symbol) or by selecting "project > build project" from the main menu. that done, select the "console" tab at the bottom of the main eclipse window and you should see the build console output ...
SVG Guidelines
real examples seen in mozilla's code. basics two spaces indenting no useless whitespaces or line breaks (see below for more details) adding a license header use double quotes whitespace and line breaks whitespace in addition to trailing whitespace at the end of lines, there are a few more cases more specific to svgs: trailing whitespaces in attribute values (usually seen in path def
initions) excessive whitespace in path or polygon points def
inition examples this path: <path d=" m5,5 l1,1z "> can be cut down to this: <path d="m5,5 l1,1z"> similarly, this polygon: <polygon points=" 0,0 4,4 4,0 "/> can be cut down to this: <polygon points="0,0 4,4 4,0"/> line breaks you should only use line breaks for logical separation or if they help make the file readable. ...
... so they are easier to spot. unused tags and attributes editor metadata vector editors (inkscape, adobe illustrator, sketch) usually add a bunch of metadata in svg files while saving them. metadata can mean many things, including: the typical "created with editor" comments non-standard editor specific tags and attributes (sketch:foo, illustrator:foo, sopodi:foo, …) the xml namespace def
inition that comes with the latter (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 descripti...
... the root <svg> element can also host many useless attributes. ...
...shape transform="translate(60, 308)"/></g> can be cut down to: <shape transform="translate(-2,-2)"/> because: -62+60 = -310+308 = -2 performance tips these rules are optional, but they help speeding up the svg. avoid using a <use> tag when that <use> tag is being referenced only once in the whole file. instead of using css/svg transforms, apply directly the transform on the path/shape def
inition. tools tools can help to clean svg files. note, however that some of the rules stated above can be hard to detect with automated tools since they require too much context-awareness. to this date, there doesn't seem to be a tool that handles all of the above. however, there are some utilities that cover parts of this document: mostly complete command line tool: https://github.com/svg/svg...
Storage access policy: Block cookies from trackers
ant storage access scoped to the first party for a particular third-party origin as described in this section. currently, firefox includes some web compatibility heuristics that grant storage access to third-party resources classified as trackers when a user interacts with those third parties. we do this when we expect that not granting access would cause the web page to break. we also support an
initial implementation of the storage access api, through which embedded <iframe>s can request storage access by calling document.requeststorageaccess(). although both of these approaches provide the same level of storage access, we recommend third parties switch to using the storage access api in order to guarantee their access to storage. automatic storage access upon interaction in order to impro...
...ey 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. ...
...if a user interacts with the pop-up window following a redirect, the origin of the content loaded in the pop-up window is given storage access on the opener document. ...
.... once they do, many social content providers will prompt them to log in. after these interactions, the provider will receive third-party storage access if they prompt the user in a way that is captured by the storage access activation heuristics described above. these providers should consider switching to explicitly request storage access through the storage access api as soon as possible. an
initial implementation of this api is currently available in nightly. i use third-party pixels and other tools to measure the effectiveness of my ad campaigns. will i still be able to measure the conversion rate of my ads? this depends on how the third party has implemented the measurement tool, but generally ad conversion measurement will be more difficult. consider the following examples: you r...
Extending a Protocol
t we could do): let's start by implementing the webidl above. implementing the navigator.echo() in your favorite editor, open dom/webidl/navigator.webidl at the end of the file, add: partial interface navigator { [throws] promise<domstring> echo(domstring astring); }; now we need to implement the echo() method in c++, so open up ./dom/base/navigator.h and let's add the method def
inition, so under public:: already_addrefed<promise> echo(const nsastring& astring, errorresult& arv); we use nsastring& as the domstring comes in from js as utf-16. this will matter later, as we will need to convert it to utf-8 (using nscstring) to send it to the parent process. now let's implement the method in ./dom/base/navigator.cpp - we add a little bit of error boilerplate stuff, as i...
...o 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: at the top, add #include "mozilla/dom/echoparent.h" and then, as part of the windowglobalparent class def
inition, add the following two public methods: already_addrefed<echoparent> allocpechoparent(); bool deallocpechoparent(pechoparent* aactor); natrually, we will have to do the alloc/dealloc dance for the children too. so, let's do that now. defining windowglobalchild's alloc/deallocpechochild() same as above, now open up dom/ipc/windowglobalchild.h and we are going to add two things: at ...
...eallocpechoparent(pechoparent* aactor); natrually, we will have to do the alloc/dealloc dance for the children too. so, let's do that now. defining windowglobalchild's alloc/deallocpechochild() same as above, now open up dom/ipc/windowglobalchild.h and we are going to add two things: at the top, add #include "mozilla/dom/echochild.h" and then, as part of the windowglobalchild class def
inition, add the following two public methods: already_addrefed<echochild> allocpechochild(); bool deallocpechochild(pechochild* aactor); super tedious, we know... nearly there though! let's give this a compile and see how we are doing! we should see ./mach build make significant progress now, but obviously, wihtout a backing cpp implementation, it's not going to do much. let's implement the...
...getechochild() private method will do the intial setup for us. echochild* navigator::getechochild(errorresult& arv) { if (!mechochild) { if (!mwindow) { arv.throw(ns_error_unexpected); return nullptr; } auto windowglobalchild = mwindow->getwindowglobalchild(); // let's get us a child! mechochild = windowglobalchild->allocpechochild(); // let's make sure it's
initialized and ready to send messages. windowglobalchild->sendpechoconstructor(mechochild); } return mechochild; } and finally... we can now finally finish off ::echo(): already_addrefed<promise> navigator::echo(const nsastring& astring, errorresult& arv) { if (!mwindow || !mwindow->getdocshell()) { arv.throw(ns_error_unexpected); return ...
Localization Use Cases
localization of gaia (the ui layer of firefox os) by using l20n. in all presented examples, we try to show the existing code, explain the problem from the localizers' or developers' perspective, and suggest a solution. declensions in gaia's browser app, there's an about-browser string defined as follows in apps/browser/locales/browser: about-browser=about {{browserbrandshortname}} problem def
inition in many inflected languages (e.g. german, finnish, hungarian, all slavic languages), the about preposition governs the grammatical case of the complement. it might be the accusative (german), ablative (latin) or locative (slavic languages). let's take slovenian as an example. in slovenian, the ideal string would inflect the noun, like so: o firefoxu however, since we want the name of the b...
.... slovenian uses the locative case with its about preposition: <aboutbrowser "o {{ browserbrandshortname.locative }}"> for the official branding, we get: o firefoxu and for the unofficial branding, we end up with: o brskalniku genders in the system app's apps/system/locales/system, there's a string called crash-banner-os2. crash-banner-os2={{brandshortname}} just crashed. problem def
inition in some languages, past participles (crashed) must be accorded with the gender of the subject (in case of reflexive verbs) or the gender of the object. in polish, the grammatical form of crashed depends on the gender of brandshortname. in order to construct a grammatically-correct and naturally-sounding message, we must know the gender of the subject. solution in l20n, the localizer can de...
...consequently, using the existing localization frameworks, the developer needs to predict which strings might need plu...
...es can be asymmetrical and have more entities that the source language. you'll notice that devicestoragehelper.showformatedsize passes a localized name of the unit to availablesize: function showformatedsize(element, l10nid, size) { // … var _ = navigator.mozl10n.get; element.textcontent = _(l10nid, { size: sizeinfo.size, unit: _('byteunit-' + sizeinfo.unit) }); } problem def
inition even though there's no need to localize the units in english at all, we still need to do it, because in other languages we might need to use localized names. byteunit-b = b byteunit-kb = kb byteunit-mb = mb byteunit-gb = gb byteunit-tb = tb for example in french, the unit abbreviations are as follows: byteunit-b = o byteunit-kb = ko byteunit-mb = mo byteunit-gb = go byteunit-tb = to sol...
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. ...
...st, 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. ...
...nd 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. ...
...usive 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. ...
NSS 3.35 release notes
ncryption keys, or ssl_sig_rsa_pss_pss_sha* for pss keys. note that this release does not include support for the latter. notable changes in nss 3.35 previously, nss used the dbm file format by default. starting with version 3.35, nss uses the sql file format by default. below, are explanations that could be helpful for environments that need to adopt to the new default. if nss is
initialized, in read-write mode with a database directory provided, it uses database files to store certificates, key, trust, and other information. nss supports two different database file formats: dbm: the legacy file format, based on berkeley db, using filenames cert8.db, key3.db and secmod.db. parallel database access, by multiple applications, is forbidden as it will likely result in da...
... applications, is forbidden as it will likely result in data corruption. sql: the newer file format, based on sqlite, using filenames cert9.db, key4.and and pkcs11.txt. parallel database access, by multiple applications, is supported. applications using nss may explicitly request to use a specific database format, by adding a type prefix to the database directory, provided at nss
initialization time. without a prefix, the default database type will be used (dbm in versions prior to 3.35, and sql in version 3.35 and later.) when using the sql type (either explicitly, or because of the new default), with a database directory which already contains a dbm type database, nss will automatically perform a one time migration of the information contained in the dbm files to the newe...
...d (dbm in versions prior to 3.35, and sql in version 3.35 and later.) when using the sql type (either explicitly, or because of the new default), with a database directory which already contains a dbm type database, nss will automatically perform a one time migration of the information contained in the dbm files to the newer sql files. if a master password was set on the dbm database, then the
initial migration may be partial, and migration of keys from dbm to sql will be delayed, until this master password is provided to nss. (conversely, nss will never synchronize data from sql to dbm format.) additional information can be found on this fedora linux project page: https://fedoraproject.org/wiki/changes/nssdefaultfileformatsql added formally verified implementations of non-vectoriz...
... tls 1.3 connections, as they are made using the experimental ssl_helloretryrequestcallback function. this function allows for callbacks to be installed, which are called when a server receives a new tls clienthello. the application is then able to examine application-chosen content from the session tickets, or helloretryrequest cookie, and decide whether to proceed with the connection. for an
initial clienthello, an application can control whether nss sends a helloretryrequest, and include application-chosen content in the cookie. new experimental apis below is a list of experimental functions, which might not be available in future releases of nss. in sslexp.h experimental: ssl_keyupdate - prompt nss to update traffic keys (tls 1.3 only). experimental: ssl_getextensio...
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
nerates encryption/mac keys and outputs public key as pkcs11 certificate signing request /* this source code form is subject to the terms of the mozilla public * license, v. 2.0. if a copy of the mpl was not distributed with this * file, you can obtain one at http://mozilla.org/mpl/2.0/. ...
...as in sample 5, output is a pkcs#10 csr * 2. input and store a cert in cert db and also used to input, store and trust ca cert. * 3. like sample 5, but puts cert in header * 4. ...
... case 't': truststr = strdup(optstate->value); break; case 'v': sigverify = pr_true; break; default: usage(progname); break; } } pl_destroyoptstate(optstate); if (cmd == unknown || !dbdir) usage(progname); /* open db for read/write and authenticate to it */ pr_
init(pr_user_thread, pr_priority_normal, 0);
initialized = pr_true; rv = nss_
initreadwrite(dbdir); if (rv != secsuccess) { pr_fprintf(pr_stderr, "nss_
initreadwrite failed\n"); goto cleanup; } pk11_setpasswordfunc(getmodulepassword); slot = pk11_getinternalkeyslot(); if (pk11_needlogin(slot)) { rv = pk11_authenticate(slot, pr_true, &pwdata);...
...rfilename, infilename); /* verify with the matching public key */ rv = findkeyandverify(slot, certhandle, &pwdata, headerfilename, infilename); if (rv != secsuccess) { pr_fprintf(pr_stderr, "find public key and verify signature : failed\n"); goto cleanup; } } cleanup: if (slot) { pk11_freeslot(slot); } if (
initialized) { secstatus rvshutdown = nss_shutdown(); if (rvshutdown != secsuccess) { pr_fprintf(pr_stderr, "failed : nss_shutdown() - %s", port_errortostring(rvshutdown)); rv = secfailure; } pr_cleanup(); } return rv; } </pre> ...
NSS Sample Code sample3
<< "length: " << len << endl; for(i = 0;i < len;i++) printf("%02x ", digest[i]); cout << endl; } /* * main */ int main(int argc, const char *argv[]) { int status = 0; pk11slotinfo *slot = 0; pk11symkey *key = 0; pk11context *context = 0; unsigned char data[80]; unsigned char digest[20]; /*is there a way to tell how large the output is?*/ unsigned int len; secstatus s; /*
initialize nss * if your application code has already
initialized nss, you can skip it * here. * this code uses the simplest of the
init functions, which does not * require a nss database to exist */ nss_nodb_
init("."); /* get a slot to use for the crypto operations */ slot = pk11_getinternalkeyslot(); if (!slot) { cout << "getinternalkeyslot failed" << endl; status =...
...the simplest of the
init functions, which does not * require a nss database to exist */ nss_nodb_
init("."); /* get a slot to use for the crypto operations */ slot = pk11_getinternalkeyslot(); if (!slot) { cout << "getinternalkeyslot failed" << endl; status = 1; goto done; } /* * part 1 - simple hashing */ cout << "part 1 -- simple hashing" << endl; /*
initialize data */ memset(data, 0xbc, sizeof data); /* create a context for hashing (digesting) */ context = pk11_createdigestcontext(sec_oid_md5); if (!context) { cout << "createdigestcontext failed" << endl; goto done; } s = pk11_digestbegin(context); if (s != secsuccess) { cout << "digestbegin failed" << endl; goto done; } s = pk11_digestop(context, data, sizeof data); if (s != s...
..." << endl; goto done; } s = pk11_digestfinal(context, digest, &len, sizeof digest); if (s != secsuccess) { cout << "digestfinal failed" << endl; goto done; } /* print digest */ printdigest(digest, len); pk11_destroycontext(context, pr_true); context = 0; /* * part 2 - hashing with included secret key */ cout << "part 2 -- hashing with included secret key" << endl; /*
initialize data */ memset(data, 0xbc, sizeof data); /* create a key */ key = pk11_keygen(slot, ckm_generic_secret_key_gen, 0, 128, 0); if (!key) { cout << "create key failed" << endl; goto done; } cout << (void *)key << endl; /* create parameters for crypto context */ /* note: params must be provided, but may be empty */ secitem noparams; noparams.type = sibuffer; noparams.data ...
...< "digestupdate failed" << endl; goto done; } s = pk11_digestfinal(context, digest, &len, sizeof digest); if (s != secsuccess) { cout << "digestfinal failed" << endl; goto done; } /* print digest */ printdigest(digest, len); pk11_destroycontext(context, pr_true); context = 0; /* * part 3 - mac (with secret key) */ cout << "part 3 -- mac (with secret key)" << endl; /*
initialize data */ memset(data, 0xbc, sizeof data); context = pk11_createcontextbysymkey(ckm_md5_hmac, cka_sign, key, &noparams); if (!context) { cout << "createcontextbysymkey failed" << endl; goto done; } s = pk11_digestbegin(context); if (s != secsuccess) { cout << "digestbegin failed" << endl; goto done; } s = pk11_digestop(context, data, sizeof data); if (s != secsuccess) { cout ...
nss tech note2
s. for optimized builds, nss must be built with the variable debug_pkcs11 set. modes of operation the logger has several modes of operation: 1. only display the sequence of pkcs #11 calls. to enable this mode, set: nspr_log_modules=nss_mod_log:1 nspr_log_file=<logfile> the output format is: osthreadid[nsprthreadid]: c_xxx osthreadid[nsprthreadid]: rv = 0xyyyyyyyy for example, 1024[805ef10]: c_
initialize 1024[805ef10]: rv = 0x0 1024[805ef10]: c_getinfo 1024[805ef10]: rv = 0x0 1024[805ef10]: c_getslotlist 1024[805ef10]: rv = 0x0 2. display the sequence of pkcs #11 calls, and the parameters given to them. to enable this mode, set: nspr_log_modules=nss_mod_log:3 nspr_log_file=<logfile> the output format is: osthreadid[nsprthreadid]: c_xxx osthreadid[nsprthreadid]: arg1 = 0xaaaaaaaa .
...0]: rv = 0x0 2. display the sequence of pkcs #11 calls, and the parameters given to them. to enable this mode, set: nspr_log_modules=nss_mod_log:3 nspr_log_file=<logfile> the output format is: osthreadid[nsprthreadid]: c_xxx osthreadid[nsprthreadid]: arg1 = 0xaaaaaaaa ... ...
...e sequence of pkcs #11 calls, and the parameters given to them. to enable this mode, set: nspr_log_modules=nss_mod_log:3 nspr_log_file=<logfile> the output format is: osthreadid[nsprthreadid]: c_xxx osthreadid[nsprthreadid]: arg1 = 0xaaaaaaaa ... ...
...unction takes a pointer argument for which it will set a value (c_getslotlist above), this mode will display the value upon return. 3. display verbose information, including template values, array values, etc. to enable this mode, set: nspr_log_modules=nss_mod_log:4 nspr_log_file=<logfile> the output format is the same as above, but with more information. ...
NSS PKCS11 Functions
at some point in the past. returns the function returns one of these values: if successful, secsuccess). if unsuccessful, secfailure. secmod_openuserdb open a new database using the softoken. syntax #include "pk11pub.h" pk11slotinfo *secmod_openuserdb(const char *modulespec) parameters this function has the following parameters: modulespec is the same data that you would pass to softoken at
initialization time under the 'tokens' options. returns the function returns one of these values: if successful, a pointer to a slot. if unsuccessful, null. description open a new database using the softoken. the caller is responsible for making sure the module spec is correct and usable. the caller should ask for one new database per call if the caller wants to get meaningful information about the ...
...of these values: if successful, a pointer to a slot. if unsuccessful, null. description open a new database using the softoken. the caller is responsible for making sure the module spec is correct and usable. the caller should ask for one new database per call if the caller wants to get meaningful information about the new database. modulespec is the same data that you would pass to softoken at
initialization time under the 'tokens' options. for example, if you would normally specify tokens=<0x4=[configdir='./mybackup' tokendescription='backup']> to softoken if you at
init time, then you could specify "configdir='./mybackup' tokendescription='backup'" as your module spec here to open the database ./mybackup on the fly. the slot id will be calculated for you by secmod_openuserdb(). typical pa...
...t change after thedatabase is closed. it should have some number to make this unique. minpwlen then minimum password length for this token. flags a comma separated list of flag values, parsed case-insensitive. valid flags are: readonly - databases should be opened read only. nocertdb - don't try to open a certificate database. nokeydb - don't try to open a key database. forceopen - don't fail to
initialize the token if thedatabases could not be opened. passwordrequired - zero length passwords are not acceptable(valid only if there is a keydb). optimizespace - allocate smaller hash tables and lock tables.when this flag is not specified, softoken will allocatelarge tables to prevent lock contention. for more info on module strings see pkcs11_module_specs. this function will return a reference ...
...rse of an ssl operation, it may be necessary for the user to log in to a pkcs #11 token (either a smart card or soft token) to access protected information, such as a private key. such information is protected with a password that can be retrieved by calling an application-supplied callback function. the callback function is identified in a call to pk11_setpasswordfunc that takes place during nss
initialization. the callback function set up by pk11_setpasswordfunc has the following prototype: typedef char *(*pk11passwordfunc)( pk11slotinfo *slot, prbool retry, void *arg); this callback function has the following parameters: slot a pointer to a slot info structure. retry set to pr_true if this is a retry. this implies that the callback has previously returned the wrong password. arg a po...
NSS environment variables
ents. default is "auto". see the source for more information. 3.12 nss_ssl_cbc_random_iv string ("0", "1") controls the workaround for the beast attack on ssl 3.0 and tls 1.0. "0" disables it, "1" enables it. it is also known as 1/n-1 record splitting. default is "1". nss_ssl_enable_renegotiation string ([0|n|n], [1|u|u], [2|r|r], [3|t|t]) (def
inition for nss 3.12.6 and above) sets how tls renegotiation is handled [1|u|u]: ssl_renegotiate_unrestricted server and client are allowed to renegotiate without any restrictions. this setting was the default prior 3.12.5 and makes products vulnerable. [0|n|n]: ssl_renegotiate_never never allow renegotiation - that was the default for 3.12.5 release. ...
...ervers have been upgraded. [2|r|r]: ssl_renegotiate_requires_xtn (default) only allows renegotiation if the peer's hello bears the tls renegotiation_info extension. this is the safe renegotiation. 3.12.5 modified in 3.12.6 nss_ssl_require_safe_negotiation boolean (1 to enable) it controls whether safe renegotiation indication is required for
initial handshake. in other words a connection will be dropped at
initial handshake if a server or client do not support safe renegotiation. the default setting for this option is false. 3.12.5 nss_ssl_server_cache_mutex_timeout integer (seconds) timeout time to detect dead or hung process in multi-process ssl server. default is 30 seconds. 3.4 nss_strict_nofork st...
...ing for this option is false. 3.12.5 nss_ssl_server_cache_mutex_timeout integer (seconds) timeout time to detect dead or hung process in multi-process ssl server. default is 30 seconds. 3.4 nss_strict_nofork string ("1", "disabled", or any other non-empty value) it is an error to try to use a pkcs#11 crypto module in a process before it has been
initialized in that process, even if the module was
initialized in the parent process. beginning in nss 3.12.3, softoken will detect this error. this environment variable controls softoken's response to that error. if set to to "1" or unset, softoken will trigger an assertion failure in debug builds, and will report an error in non-debug builds. if set to "disabled", softoken will igno...
...re forks, and behave as it did in older versions. if set to any other non-empty value, softoken will report an error in both debug and non-debug builds. 3.12.3 nss_strict_shutdown string (any non-empty value) will trigger an assertion failure in debug builds when a program tries to shutdown nss before freeing all the resources it acquired from nss while nss was
initialized. 3.5 nss_trace_ocsp boolean (any value to enable) enables ocsp tracing. the trace information is written to the file pointed by nspr_log_file (default stderr). see nss tracing 3.12 nss_use_decoded_cka_ec_point boolean (any value to enable) tells nss to send ec key points across the pkcs#11 interface in the non-standard unencoded format that w...
NSS tools : certutil
ration. each option may take arguments, anywhere from none to multiple arguments. the command option -h will list all the command options available and their relevant arguments. command options -a add an existing certificate to a certificate database. the certificate database should already exist; if one is not present, this command option will
initialize one by default. -b run a series of commands from the specified batch file. this requires the -i argument. -c create a new binary certificate file from a binary certificate request file. use the -i argument to specify the certificate request file. if this argument is not used, certutil prompts for a filename. ...
... public key you have generated. in such a case, only the private key is deleted from the key pair. you can display the public key with the command certutil -k -h tokenname. -g generate a new public and private key pair within a key database. the key database should already exist; if one is not present, this option will
initialize one by default. some smart cards (for example, the litronic card) can store only one key pair. if you create a new key pair for such a card, the previous pair is overwritten. -h display a list of the options and arguments used by the certificate database tool. -k list the key id of keys in the key datab...
...ificates a certificate contains an expiration date in itself, and expired certificates are easily rejected. however, certificates can also be revoked before they hit their expiration date. checking whether a certificate has been revoked requires validating the certificate. validation can also be used to ensure that the certificate is only used for the purposes it was
initially issued for. validation is carried out by the -v command option. certutil -v -n certificate-name [-b time] [-e] [-u cert-usage] -d [sql:] directory for example, to validate an email certificate: $ certutil -v -n "john smith's email cert" -e -u s,r -d sql:/home/my/sha rednssdb modifying certificate trust settings the trust settings (which relate to the operations that...
... certutil -m -n "my ca certificate" -d sql:/home/my/sharednssdb -t "ctu ,ctu,ctu" printing the certificate chain certificates can be issued in chains because every certificate authority itself has a certificate; when a ca issues a certificate, it essentially stamps that certificate with its own fingerprint. the -o prints the full chain of a certificate, going from the
initial ca (the root ca) through ever intermediary ca to the actual certificate. for example, for an email certificate with two cas in the chain: $ certutil -d sql:/home/my/sharednssdb -o -n "jsmith@example.com" "builtin object token:thawte personal freemail ca" [e=personal-freemail@ thawte.com,cn=thawte personal freemail ca,ou=certification services divi sion,o=thawte consulting,l=cape to...
Utility functions
the nss version column indicates which versions of nss support the function. ...
...the nss version column indicates which versions of nss support the function. ...
...the nss version column indicates which versions of nss support the function. ...
...r hash_gettype mxr 3.12 and later hash_hashbuf mxr 3.10 and later hash_resultlen mxr 3.4 and later hash_resultlenbyoidtag mxr 3.10 and later hash_resultlencontext mxr 3.10 and later hash_update mxr 3.4 and later nss_
init mxr 3.2 and later nss_
initialize mxr 3.2 and later nss_
initreadwrite mxr 3.2 and later nss_
initwithmerge mxr 3.12 and later nss_is
initialized mxr 3.9.2 and later nss_nodb_
init mxr 3.2 and later nss_putenv mxr 3.2 and la...
NSS Tools modutil
dule in environments where javascript support is available (as in netscape communicator), see the document using the jar installation manager to install a pkcs #11 cryptographic module. -delete modulename delete the named module. note that you cannot delete the netscape communicator internal pkcs #11 module. -changepw tokenname change the password on the named token. if the token has not been
initialized, this option
initializes the password. use this option with the -pwfile and -newpwfile arguments. in this context, the term "password" is equivalent to a personal identification number (pin). -default modulename specify the security mechanisms for which the named module will be a default provider. the security mechanisms are specified with the -mechanisms mechanism-list argument. -unde...
...ting default provider status for various security mechanisms: -add modulename -libfile library-file [-ciphers cipher-enable-list] [-mechanisms mechanism-list] adding a pkcs #11 module from an existing jar file: -jar jar-file -installdir root-installation-directory [-tempdir temporary-directory] deleting a specific pkcs #11 module from a security module database: -delete modulename
initializing or changing a token's password: -changepw tokenname [-pwfile old-password-file] [-newpwfile new-password-file] setting the default provider status of various security mechanisms in an existing pkcs #11 module: -default modulename -mechanisms mechanism-list clearing the default provider status of various security mechanisms in an existing pkcs #11 module: -undefault modulename...
...es version 4.0manufacturer: netscape communications corp type: softwareversion number: 4.1firmware version: 0.0status: enabledtoken name: communicator generic crypto svcstoken manufacturer: netscape communications corp token model: libsec 4.0 token serial number: 0000000000000000token version: 4.0token firmware version: 0.0access: write protectedlogin type: public (no login required)user pin: not
initializedslot: communicator user private key and certificate servicesmanufacturer: netscape communications corp type: softwareversion number: 3.0firmware version: 0.0status: enabledtoken name: communicator certificate db token manufacturer: netscape communications corp token model: libsec 4.0 token serial number: 0000000000000000token version: 7.0token firmware version: 0.0access: not write protecte...
...y and certificate servicesmanufacturer: netscape communications corp type: softwareversion number: 3.0firmware version: 0.0status: enabledtoken name: communicator certificate db token manufacturer: netscape communications corp token model: libsec 4.0 token serial number: 0000000000000000token version: 7.0token firmware version: 0.0access: not write protectedlogin type: login requireduser pin: not
initialized setting a default provider this example makes the specified module a default provider for the rsa, dsa, and rc2 security mechanisms: modutil -default "cryptographic module" -dbdir c:\databases -mechanisms rsa:dsa:rc2 the security module database tool displays a warning: warning: performing this operation while communicator is running couldcause corruption of your security database...
certutil
n may take arguments, anywhere from none to multiple arguments. run the command option and -h to see the arguments available for each command option. options options specify an action and are uppercase. -a add an existing certificate to a certificate database. the certificate database should already exist; if one is not present, this option will
initialize one by default. -b run a series of commands from the specified batch file. this requires the -i argument. -c create a new binary certificate file from a binary certificate request file. use the -i argument to specify the certificate request file. if this argument is not used, certutil prompts for a filename. -d ...
... you remove a public key you have generated. in such a case, only the private key is deleted from the key pair. you can display the public key with the command certutil -k -h tokenname. -g generate a new public and private key pair within a key database. the key database should already exist; if one is not present, this option will
initialize one by default. some smart cards (for example, the litronic card) can store only one key pair. if you create a new key pair for such a card, the previous pair is overwritten. -h display a list of the options and arguments used by the certificate database tool. -k list the key id of keys in the key database. a key id...
...dating certificates a certificate contains an expiration date in itself, and expired certificates are easily rejected. however, certificates can also be revoked before they hit their expiration date. checking whether a certificate has been revoked requires validating the certificate. validation can also be used to ensure that the certificate is only used for the purposes it was
initially issued for. validation is carried out by the -v command option. certutil -v -n certificate-name [-b time] [-e] [-u cert-usage] -d [sql:]directory for example, to validate an email certificate: $ certutil -v -n "john smith's email cert" -e -u s,r -d sql:/home/my/sharednssdb modifying certificate trust settings the trust settings (which relate to the operations that a certif...
... example: $ certutil -m -n "my ca certificate" -d sql:/home/my/sharednssdb -t "ctu,ctu,ctu" printing the certificate chain certificates can be issued in chains because every certificate authority itself has a certificate; when a ca issues a certificate, it essentially stamps that certificate with its own fingerprint. the -o prints the full chain of a certificate, going from the
initial ca (the root ca) through ever intermediary ca to the actual certificate. for example, for an email certificate with two cas in the chain: $ certutil -d sql:/home/my/sharednssdb -o -n "jsmith@example.com" "builtin object token:thawte personal freemail ca" [e=personal-freemail@thawte.com,cn=thawte personal freemail ca,ou=certification services division,o=thawte consulting,l=cape town,st...
NSS tools : modutil
fy the type of module operation. each option may take arguments, anywhere from none to multiple arguments. options -add modulename add the named pkcs #11 module to the database. use this option with the -libfile, -ciphers, and -mechanisms arguments. -changepw tokenname change the password on the named token. if the token has not been
initialized, this option
initializes the password. use this option with the -pwfile and -newpwfile arguments. a password is equivalent to a personal identification number (pin). -chkfips verify whether the module is in the given fips mode. true means to verify that the module is in fips mode, while false means to verify that the module is not...
...cturer: mozilla foundation type: software version number: 3.11 firmware version: 0.0 status: enabled token name: nss generic crypto services token manufacturer: mozilla foundation token model: nss 3 token serial number: 0000000000000000 token version: 4.0 token firmware version: 0.0 access: write protected login type: public (no login required) user pin: not
initialized slot: nss user private key and certificate services slot mechanism flags: none manufacturer: mozilla foundation type: software version number: 3.11 firmware version: 0.0 status: enabled token name: nss certificate db token manufacturer: mozilla foundation token model: nss 3 token serial number: 0000000000000000 token version: 8.3 token firmware versi...
...(this information can be edited by loading new specs using the -rawadd command.) modutil -rawlist -dbdir sql:/home/my/sharednssdb name="nss internal pkcs #11 module" parameters="configdir=. certprefix= keyprefix= secmod=secmod.db flags=readonly " nss="trustorder=75 cipherorder=1...
...the -fips option. for example: modutil -fips true -dbdir sql:/home/my/sharednssdb/ fips mode enabled. to verify that status of fips mode, run the -chkfips command with either a true or false flag (it doesn't matter which). the tool returns the current fips setting. modutil -chkfips false -dbdir sql:/home/my/sharednssdb/ fips mode enabled. changing the password on a token
initializing or changing a token's password: modutil -changepw tokenname [-pwfile old-password-file] [-newpwfile new-password-file] modutil -dbdir sql:/home/my/sharednssdb -changepw "nss certificate db" enter old password: incorrect password, try again... enter old password: enter new password: re-enter new password: token "communicator certificate db" password changed successfully. jar in...
Hacking Tips
ce-mode auto end printing asm.js/wasm generated assembly code (from gdb) set a breakpoint on js::wasm::instance::callexport (defined in wasminstance.cpp as of november 18th 2016). this will trigger for *any* asm.js/wasm call, so you should find a way to set this breakpoint for the only generated codes you want to look at. run the program. do next in gdb until you reach the def
inition of the funcptr: // call the per-exported-function trampoline created by generateentry. │ auto funcptr = js_data_to_func_ptr(exportfuncptr, codebase() + func.entryoffset()); │ if (!call_generated_2(funcptr, exportargs.begin(), &tlsdata_)) ...
... (gdb_iongraph, gdb_dot, gdb_pngviewer) before starting gdb, or with gdb parameters (set iongraph-bin <path>, set dot-bin <path>, set pngviewer-bin <path>) within gdb. enabling gdb instrumentation may require launching a js shell executable that shares a directory with a file name "js-gdb.py". if js/src/js does not provide the "iongraph" command, try js/src/shell/js. gdb may complain that ~/.gdb
init requires modification to authorize user scripts, and if so will print out directions. break on valgrind errors sometimes, a bug can be reproduced under valgrind but hardly under gdb. one way to investigate is to let valgrind start gdb for you, the other way documented here is to let valgrind act as a gdb server which can be manipulated from the gdb remote. $ valgrind --smc-check=all-non-file ...
...atch on the previous expression gdb will watch the expression and run out of watchpoint) rr with emacs within emacs, do m-x gud-gdb and replace the command line with rr replay. when gdb comes up, enter set annot 1 to get it to emit file location information so that emacs will pop up the corresponding source. note that if you reverse-continue over a sigsegv and you're using the standard .gdb
init that sets a catchpoint for that signal, you'll get an additional stop at the catchpoint. just reverse-continue again to continue to your breakpoints or whatever. [hack] replacing one instruction to replace one specific instruction, you can use in visit function of each instruction the jsscript filename in lineno fields as well as the id() of the lir / mir instructions. the jsscript can be obta...
...or, and the thing kind (object, function, whatever). after this come a list of addresses that the gc thing points to, each one starting with ">". it's also possible to dump the javascript heap from c++ code (or from gdb) using the js::dumpheap function. it is part of jsfriendapi.h and it is available in release builds. inspecting mir objects within a debugger for mirgraph, mbasicblock, and mdef
inition and its subclasses (minstruction, mconstant, etc.), call the dump member function. (gdb) call graph->dump() (gdb) call block->dump() (gdb) call def->dump() benchmarking without a phone if you do not have a mobile device or prefer to test on your desktop first, you will need to downgrade your computer such as it is able to run programs as fast as-if they were running on a phone. o...
JSAutoByteString
onkey 17 take ownership of a string and free it later. syntax jsautobytestring str; jsautobytestring(jscontext *cx, jsstring *str); name type description cx jscontext * the context in which to add the root. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. str jsstring * a pointer to jsstring to get
initial content by calling js_encodestring(cx, str). methods method description void
initbytes(char *bytes) take ownership of the given byte array. char *encodelatin1(jscontext *cx, jsstring *str) call js_encodestring and take ownership of the returned string, and return the string. char *encodelatin1(js::exclusivecontext *cx, jsstring *str) call...
...ate string and copy the content of jslinearstring::latin1chars, and take the ownership of the string. this may fail if str is not linear. char *encodeutf8(jscontext *cx, js::handlestring str) call js_encodestringtoutf8 and take ownership of the returned string, and return the string. void clear() free the owned string. you should call this before calling encode* methods or
initbytes method if a string is already owned, otherwise the string will never be freed. char *ptr() const return a pointer to the owned string. this could be null if no string is owned. bool operator!() const return true if no string is owned. size_t length() const return the length of the owned string. return 0 if no string is owned. description jsautobyte...
... *ptr() const return a pointer to the owned string. this could be null if no string is owned. bool operator!() const return true if no string is owned. size_t length() const return the length of the owned string. return 0 if no string is owned. description jsautobytestring takes the ownership of string and frees it in destructor. if jsautobytestring instance is
initialized with jsautobytestring bytes(cx, str); style, it calls js_encodestring(cx, str) to get the string to take ownership. if jsautobytestring instance is
initialized with jsautobytestring bytes; style, it does not own any string. you can call some methods to take ownership of other string. note that the js_encodestring call in constructor and some encode* methods may fail and get null. so ensu...
...deutf8(cx, str)) /* calls js_encodestringtoutf8 internally */ return false; /* ...do something with bytes... */ /* when leaving this scope, the string returned by js_encodestringtoutf8 is freed. */ } take ownership of other buffer { char *buff = cx->pod_malloc<char>(length + 1); if (!buff) return false; memcpy(buff, other_buff, length + 1) jsautobytestring bytes; bytes.
initbytes(buff); /* ...do something with bytes... */ /* when leaving this scope, buff is freed. */ } see also mxr id search for jsautobytestring js_encodestring js_encodestringtoutf8 bug 610198 ...
JSClass
a jsclass describes a class of javascript objects. a c/c++ program can use a jsclass with the js_
initclass and js_newobject apis to create objects that have custom methods and properties implemented in c/c++. syntax struct jsclass { const char *name; uint32_t flags; /* optional since spidermonkey 37 */ jspropertyop addproperty; jsdeletepropertyop delproperty; jspropertyop getproperty; jsstrictpropertyop setproperty; jsenumerateop enumerate; jsresolveop resolve; jsconvertop convert; /* obsolete since spidermonkey 44 */ /* optional since spidermonkey 25 */ jsfinalizeop finalize; /* optional */ jsclassinternal reserved0; /* obsolete since spidermonkey 13 */...
... 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 da...
...le 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 example uses the c++ new and delete keywords, but the application can allocate the memory for private data however it likes. the javascript engine never touches the private data; it is for the application's use only.) void printer_finalize(jscontext *cx, jsobject *obj) { myprinter *p = (myprinter *) js_getpriva...
...j = js_newobjectforconstructor(cx, &printer_class, vp); */ if (!obj) return false; myprinter *p = new myprinter; if (p == null) { js_reportoutofmemory(cx); return false; } js_setprivate(cx, obj, p); args.rval().setobject(*obj); /* spidermonkey 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...
JS_NewRuntime
initializes the javascript runtime. syntax jsruntime * js_newruntime(uint32_t maxbytes, uint32_t maxnurserybytes = js::defaultnurserybytes, jsruntime *parentruntime = nullptr); jsruntime * js_newruntime(uint32_t maxbytes, jsusehelperthreads usehelperthreads, jsruntime *parentruntime = nullptr); // deprecated since jsapi 32 name type description maxbytes uint32 maximum number of allocated bytes after which garbage collection is run. maxnurserybytes uint32 nursery size in bytes. maxnurserybytes is rounded down to a multiple of chunk size. added in spidermonkey 38 parentruntime jsruntime * the topmost parent or nullptr . ...
...e description maxbytes uint32 maximum number of allocated bytes after which garbage collection is run. maxnurserybytes uint32 nursery size in bytes. maxnurserybytes is rounded down to a multiple of chunk size. added in spidermonkey 38 parentruntime jsruntime * the topmost parent or nullptr . added in spidermonkey 31 description js_newruntime
initializes the javascript runtime environment. call js_newruntime before making any other api calls except js_
init. js_newruntime allocates memory for the jsruntime and
initializes certain internal runtime structures. maxbytes specifies the number of allocated bytes after which garbage collection is run. if parentruntime is specified, the resulting runtime shares significant amounts of read-only stat...
...it is recommended to make use of this for every runtime in a process after the first one. the returned jsruntime can be used from the calling thread only. ...
... use helper threads internally, though.) on success, js_newruntime returns a pointer to the newly created runtime, which the caller must later destroy using js_destroyruntime. otherwise it returns null. ...
SpiderMonkey 1.8.8
the mozilla javascript team is pleased to announce the release of spidermonkey 1.8.8. you can download full source code here: insert-actual-link-when-the-release-happens (md5 checksum: insert-actual-hash-here). spidermonkey 1.8.8 is the javascript engine that shipped in firefox 10.0. it continues to improve performance over previous spidermonkey releases, with ongoing jit compilation work and with the introduction of type inference to enable faster jitted code. ...
... (the msstdint project includes an implementation of this header for microsoft visual studio which demonstrates what the c99 interface looks like.) otherwise, if the compiler doesn't provide a usable <stdint.h> header, a custom impl...
...jspackedbool n/a n/a jsrefcount n/a n/a the fixed-size integer types are defined in one of the following ways: if the environment variable moz_custom_stdint_h is set, that file will be included to provide def
initions for these types. the file must conform to the standard c99 <stdint.h> header interface in all respects, providing all that header's types and macro def
initions. (the msstdint project includes an implementation of this header for microsoft visual studio which demonstrates what the c99 interface looks like.) otherwise, if the compiler doesn't provide a usable <stdint.h> header, a custom implementation shipped with the spidermonkey source is used. currently only versions of visual studio prior to 2010 (also known as version 10) are known to be defic...
...d. currently only versions of visual studio prior to 2010 (also known as version 10) are known to be deficient in this manner, so the custom implementation (which is compatible with the one shipped in visual 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 def
initions of those types, and those particular def
initions are incompatible with the standard def
initions 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 al...
SpiderMonkey 17
the mozilla javascript team is pleased to announce the release of spidermonkey 17. you can download full source code here: http://ftp.mozilla.org/pub/mozilla.org/js/mozjs17.0.0.tar.gz (md5 checksum: 20b6f8f1140ef6e47daa3b16965c9202). spidermonkey 17 is the javascript engine that shipped in firefox 17. ...
... (the msstdint project includes an implementation of this header for microsoft visual studio which demonstrates what the c99 interface looks like.) otherwise, if the compiler doesn't provide a usable <stdint.h> header, a custom impl...
...jspackedbool n/a n/a jsrefcount n/a n/a the fixed-size integer types are defined in one of the following ways: if the environment variable moz_custom_stdint_h is set, that file will be included to provide def
initions for these types. the file must conform to the standard c99 <stdint.h> header interface in all respects, providing all that header's types and macro def
initions. (the msstdint project includes an implementation of this header for microsoft visual studio which demonstrates what the c99 interface looks like.) otherwise, if the compiler doesn't provide a usable <stdint.h> header, a custom implementation shipped with the spidermonkey source is used. currently only versions of visual studio prior to 2010 (also known as version 10) are known to be defic...
...d. currently only versions of visual studio prior to 2010 (also known as version 10) are known to be deficient in this manner, so the custom implementation (which is compatible with the one shipped in visual 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 def
initions of those types, and those particular def
initions are incompatible with the standard def
initions 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 al...
SpiderMonkey 24
the mozilla javascript team is pleased to announce the release of spidermonkey 24. you can download full source code here: https://ftp.mozilla.org/pub/mozilla.org/js/mozjs-24.2.0.tar.bz2 (sha1: ce779081cc11bd0c871c6f303fc4a0091cf4fe66) spidermonkey 24 is the javascript engine that shipped in firefox 24. it continues to improve performance over previous spidermonkey releases, with a significantly improved garbage collector, a new jit compilation mode, and other features. it also contains new language and api features described in detail below. ...
... changes are explained in detail below. new javascript language features javascript 24 includes significant updates to language features, yo. typedef changes the fixed-size integer types introduced in spidermonkey 17 are defined in one of the following ways (xxx update for msvc<10 deprecation): if the environment variable moz_custom_stdint_h is set, that file will be included to provide def
initions for these types. the file must conform to the standard c99 <stdint.h> header interface in all respects, providing all that header's types and macro def
initions. (the msstdint project includes an implementation of this header for microsoft visual studio which demonstrates what the c99 interface looks like.) otherwise, if the compiler doesn't provide a usable <stdint.h> header, a custom impl...
.... currently only versions of visual studio prior to 2010 (also known as version 10) are known to be deficient in this manner, so the custom implementation (which is compatible with the one shipped in visual 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 def
initions of those types, and those particular def
initions are incompatible with the standard def
initions 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 al...
... break out and discuss all api changes here... jsoption_strict has been renamed to jsoption_extra_warnings. js_setversion has been removed, js version is now set on the compartment instead of context. js_getprototype, takes context as first argument js_encodestringtobuffer takes add context as first argument, js_newruntime adds a js_[use|no]_helper_threads flag delete property in jsclass def
initions now use js_deletepropertystub garbage collection functions now take runtime argument most garbage collection functions now take a runtime argument instead of a context. the one exception to this is js_maybegc which still takes a context as argument. javascript shell changes detail added/removed methods here... known issues detail any known issues here... future direction ...inser...
Using RAII classes in Mozilla
users of the class, but they do slightly complicate the implementation of the class. these macros are provided in guardobjects.h. in the common case, using these macros involves these three additions to a class: class moz_raii nsautoscriptblocker { public: explicit nsautoscriptblocker(jscontext *cx moz_guard_object_notifier_param) { // note: no ',' before macro moz_guard_object_notifier_
init; nscontentutils::addscriptblocker(cx); } ~nsautoscriptblocker() { nscontentutils::removescriptblocker(); } private: moz_decl_use_guard_object_notifier }; moz_guard_object_notifier_param is added to the end of the constructor's parameter list. moz_guard_object_notifier_
init is added as a statement in the constructor. moz_decl_use_guard_object_notifier is added where private memb...
...e constructor (otherwise) takes no arguments, then you have to use the moz_guard_object_notifier_only_param macro instead. (this is needed because the macro adds a parameter only when debug is defined, and in this case, it can't add the leading comma.) class moz_raii nsautoscriptblocker { public: explicit nsautoscriptblocker(moz_guard_object_notifier_only_param) { moz_guard_object_notifier_
init; nscontentutils::addscriptblocker(); } ~nsautoscriptblocker() { nscontentutils::removescriptblocker(); } private: moz_decl_use_guard_object_notifier }; second, if the constructor is not inline, it needs the parameter added in its implementation as well. in this case, the implementation must use the moz_guard_object_notifier_param_in_impl macro to add to the implementation: nsau...
...ate: moz_decl_use_guard_object_notifier }; second, if the constructor is not inline, it needs the parameter added in its implementation as well. ...
..._object_notifier_param_in_impl macro to add to the implementation: nsautoscriptblocker::nsautoscriptblocker(jscontext *cx moz_guard_object_notifier_param_in_impl) { moz_guard_object_notifier_
init; nscontentutils::addscriptblocker(cx); } or, if it is the only parameter: nsautoscriptblocker::nsautoscriptblocker(moz_guard_object_notifier_only_param_in_impl) { moz_guard_object_notifier_
init; nscontentutils::addscriptblocker(); } finally, if an raii class that uses these macros has derived classes, the derived classes must also use some of the macros in order to get the benefit of the assertions. in particular, a class derived from a class using these macros does not use moz_guard_object_notifier_
init or moz_decl_use_guard_object_notifier, but instead uses either moz_guard_objec...
Animated PNG graphics
ucture an apng stream is a normal png stream as defined in the png specification, with three additional chunk types describing the animation and providing additional frame data. to be recognized as an apng, an 'actl' chunk must appear in the stream before any 'idat' chunks. the 'actl' structure is described below. conceptually, at the beginning of each play the output buffer must be completely
initialized to a fully transparent black rectangle, with width and height dimensions from the 'ihdr' chunk. the default image may be included as the first frame of the animation by the presence of a single 'fctl' chunk before 'idat'. otherwise, the default image is not part of the animation. subsequent frames are encoded in 'fdat' chunks, which have the same structure as 'idat' chunks, except preced...
... is an ancillary chunk as defined in the png specification. it must appear before the first 'idat' chunk within a valid png stream. the 'actl' chunk contains: byte offset field name field type description 0 num_frames unsigned int the number of frames in the apng. 4 num_plays unsigned int the number of times to loop this apng. 0 indicates inf
inite looping. num_frames indicates the total number of frames in the animation. this must equal the number of 'fctl' chunks. 0 is not a valid value. 1 is a valid value for a single-frame apng. if this value does not equal the actual number of frames it should be treated as an error. num_plays indicates the number of times that this animation should play; if it is 0, the animation should play ...
...ping. num_frames indicates the total number of frames in the animation. this must equal the number of 'fctl' chunks. 0 is not a valid value. 1 is a valid value for a single-frame apng. if this value does not equal the actual number of frames it should be treated as an error. num_plays indicates the number of times that this animation should play; if it is 0, the animation should play indef
initely. if nonzero, the animation should come to rest on the final frame at the end of the last play. 'fctl': the frame control chunk the 'fctl' chunk is an ancillary chunk as defined in the png specification. it must appear before the 'idat' or 'fdat' chunks of the frame to which it applies, specifically: for the default image, if a 'fctl' chunk is present it must appear before the first 'idat'...
...two blend modes are functionally equivalent due to the clearing of the output buffer at the beginning of each play. the 'fctl' chunk corresponding to the default image, if it exists, has these restrictions: the x_offset and y_offset fields must be 0. the width and height fields must equal the corresponding fields from the 'ihdr' chunk. as noted earlier, the output buffer must be completely
initialized to fully transparent black at the beginning of each play. this is to ensure that each play of the animation will be identical. decoders are free to avoid an explicit clear step as long as the result is guaranteed to be identical. for example, if the default image is included in the animation, and uses a blend_op of apng_blend_op_source, clearing is not necessary because the entire output b...
History Service Design
this document provides a high-level overview of the overall history service design of the places system. places is designed to be a complete replacement for the firefox bookmarks and history systems using storage. this system provides additional performance, flexibility, and querying capabilities over the old one, for both end users and extensions developers. view the service interface def
inition: nsinavhistoryservice.idl. objectives the primary objectives of the new history service implementation in places are: improve access to browsing history allow association of useful metadata with urls flexible query system for both end-users and add-ons developers clean architecture for ease of code reuse and maintainability the most known and visible feature of history are views. the...
...ext indexes, and the possibility to generalize the frecency algorithm to allow for its use in user's queries. might be also nice to provide a hook for third-party products so they can provide text searching capabilities to the places system. places core history service (nsinavhistoryservice.idl) is the core of places, every other places service depends on it to correctly work, so it gets always
initialized at application startup. actual tasks executed by this service include: database creation, maintenance and
initialization: all services rely on a common shared database called places.sqlite. history service checks for database existance and coherence, and
initializes the connection through the storage service. history management: provides basic and advanced apis to store and mo...
...nce the database connection has been set-up the schema version of the database is checked. schema version is upgraded every time a change is made to the database schema, 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...
...mark's inserts. performance to ensure performance a bunch of statements, commonly used when adding or reading visit informations, are created at startup. these statements can be reused avoiding the overhead due to createstatement calls, before closing the connection these statements need to be finalized though, since not doing that would cause leaking. the internal syncing service takes care of
initializing places, syncing data to disk and finalize statements, so usually that's not a problem. the same pre-compiled statements approach is used in other dependant services and in autocomplete. another step to improve performance is mainly dedicated to not locking ui. since places is actually not thread-safe and doing most of the work in the main-thread, adding visits (the most common action usu...
Places utilities for JavaScript
alog is to be shown. [optional] atitle the default title for the new bookmark. [optional] adescription the default description for the new bookmark [optional] adefaultinsertionpoint the default insertion point for the new item. if set, the folder picker would be hidden unless ashowpicker is set to true, in which case the dialog only uses the folder identifier from the insertion point as the
initially selected item in the folder picker. [optional] ashowpicker see above [optional] aloadinsidebar if true, the dialog will default to load the new item in the sidebar (as a web panel). [optional] akeyword the default keyword for the new bookmark. the keyword field will be shown in the dialog if this is used. [optional] apostdata post data for post-style keywords. return type returns ...
...o load the new item in the sidebar (as a web panel). [optional] akeyword the default keyword for the new bookmark. the keyword field will be shown in the dialog if this is used. [optional] apostdata post data for post-style keywords. return type returns true if any transaction has been performed. note: the location, description and "load in sidebar" fields are visible only if there is no
initial uri (auri is null). note: when adefaultinsertionpoint is not set, the dialog defaults to the bookmarks root folder. showminimaladdbookmarkui() showminimaladdbookmarkui(auri, atitle, adescription, adefaultinsertionpoint, ashowpicker, aloadinsidebar, ...
... [optional] afeeduri the feed uri for which the dialog is to be shown (nsiuri). [optional] asiteuri the site uri for the new live-bookmark (nsiuri). [optional] adefaultinsertionpoint the default insertion point for the new item. if set, the folder picker would be hidden unless ashowpicker is set to true, in which case the dialog only uses the folder identifier from the insertion point as the
initially selected item in the folder picker. [optional] ashowpicker see above return type return true if any transaction has been performed. note: the feeduri and description fields are visible only if there is no
initial feed uri (afeeduri is null). note: when adefaultinsertionpoint is not set, the dialog defaults to the bookmarks root folder. showminimaladdlivemarkui() this opens the d...
...itle, adefaultinsertionpoint, ashowpicker) parameters [optional] atitle the default title for the new bookmark. [optional] adefaultinsertionpoint the default insertion point for the new item. if set, the folder picker would be hidden unless ashowpicker is set to true, in which case the dialog only uses the folder identifier from the insertion point as the
initially selected item in the folder picker. [optional] ashowpicker see above return type return true if any transaction has been performed. annotations these are functions that simplify annotating pages. information like keywords, descriptions, and post data is already stored as annotations by firefox, but you can create additional ones. using the functions can save you some implementation wo...
Using the Places history service
ents.classes["@mozilla.org/browser/nav-history-service;1"] .getservice(components.interfaces.nsinavhistoryservice); it also responds to the old contract id for url bar autocomplete "@mozilla.org/autocomplete/search;1?name=history" and the contract id for the old history system (since it is backwards-compatible) "@mozilla.org/browser/global-history;2". if database
initialization completes correctly a "places-
init-complete" topic is notified, at this point is possible to look for database status: var databasestatus = historyservice.databasestatus; switch (databasestatus) { case historyservice.database_status_ok: // database did already exist and has been correctly
initialized. break; case historyservice.database_status_create: // database did no...
...-complete" topic is notified, at this point is possible to look for database status: var databasestatus = historyservice.databasestatus; switch (databasestatus) { case historyservice.database_status_ok: // database did already exist and has been correctly
initialized. break; case historyservice.database_status_create: // database did not exist, a new one has just been created and
initialized. break; case historyservice.database_status_corrupt: // database was corrupt, has been moved to a .corrupt file and a new one has been created and
initialized. break; case historyservice.database_status_upgraded: // database had an old schema version and has been upgraded to a new one. break; } in case the database is locked by a third party process and cannot be ...
... adding pages to history nsiglobalhistory2.adduri: this is the basic function for adding pages to history that is called by the docshell as you browse. the redirect flag is deprecated. see adddocumentredirect below. nsiglobalhistory3.adddocumentredirect: this is called by the docshell when a redirect occurs. ...
...he given uri will be stored by the history system. many types of uris, such as "chrome:" uris, are not stored when adduri is called. this function allows you to determine whether it will be or not. advanced querying see querying places for more detailed examples on how to used the advanced querying functionality of navhistory. nsinavhistoryservice.getnewquery: returns a new query object
initialized to the default values. you can pass this to executequeries(). nsinavhistoryservice.getnewqueryoptions: returns a new query options object
initialized to the default values. you can pass this to executequeries(). nsinavhistoryservice.executequery: runs a query with a single query object and options. all the parameters set on the query object will be anded together. nsinavhistoryservice.e...
Creating the Component Code
* required includes and constants * weblock: public iweblock * weblockfactory: public nsifactory * weblockmodule: public nsimodule in xpcom, all of these classes also derive from the nsisupports base interface. digging in: required includes and constants let's take a look at the first several lines of code in the component and discuss what they mean in xpcom. the includes and def
initions at the top of an xpcom source file can give you an idea about some of the data types and techniques we'll be discussing more in the upcoming chapters. for example, mozilla_strict_api is a variable that shields you from certain private, non-xpcom headers. for example, including nsicomponentmanager.idl without mozilla_strict_api defined will include the following headers, which are not support...
...d factory interfaces, and they contain a couple of important macros as well (see the following chapter for information about using these macros). the two other includes, nsicomponentmanager.h and nsicomponentregistrar.h, provide functions such as registerfactorylocation that are required to implement the module and factory classes in your code. identifiers in xpcom the series of nsiid variables
initialized here are actually classes created for handing the 128-bit identifiers that xpcom uses to support contractual relationships between the client and component interfaces. the variable kifactoryiid, for example, provides methods like equals() that can be used to facilitate comparisons in the code, as in the following example from the mozilla source: using class methods to handle identifiers ...
...ter a contract id - it simply passes null. this prevents clients from ever accessing the component with a contract id.) to be accessible to others, you need to publish the cid and/or contract id of the component along with the interfaces it supports. given the example above, someone could create the sample object via the component manager as follows: nsicomponentmanager* compmanager; // assume
initialized nsisupports* sample; compmanager->createinstance(ksamplecid, nsnull, kisupportsiid, (void**)&sample); in the above snippet, we assume that the component manager has been
initialized. in many cases this value is passed in or easily accessible. if not, it can always be obtained by a call to ns_getcomponent...
...ad) { *oktounload = pr_false; // we do not know how to unload. ...
Components.Constructor
summary creates a javascript function which can be used to create or construct new instances of xpcom components. syntax var func = [ new ] components.constructor(contractid [, interfacename [,
initializer ] ]); parameters contractid a string containing the contract id of the component interfacename if given, nsisupports.queryinterface() will be called on each newly-created instance with the interface named by this string
initializer if given, a string containing the name of a function which will be called on the newly-created instance, using the arguments provided to the created function when called description components.constructor() is a handy shortcut for creating instances of xpcom components. it eliminates the clutter of typing components.classes, components.inte...
... "nsibinaryinputstream"); var bis = new binaryinputstream(); print(bis.tostring()); // "[xpconnect wrapped nsibinaryinputstream]" // someinputstream is an existing nsiinputstream bis.setinputstream(someinputstream); // succeeds if three arguments are given, then in addition to being nsisupports.queryinterface()'d, the instance will also have had an
initialization method called on it. the arguments used with the
initialization method are the arguments passed to the components.constructor()-created function when called: var binaryinputstream = components.constructor("@mozilla.org/binaryinputstream;1", "nsibinaryinputstream", "setinputstream"); try { //...
...ance creation using components.constructor(); the latter is much easier to read than the former (particularly if you're creating instances of a component in many different places): var bis = components.classes["@mozilla.org/binaryinputstream;1"] .createinstance(components.interfaces.nsibinaryinputstream); bis.setinputstream(someinputstream); // assumes binaryinputstream was
initialized previously var bis = new binaryinputstream(someinputstream); components.constructor() is purely syntactic sugar (albeit speedy and pretty syntactic sugar) for actions that can be accomplished using other common methods. it is equivalent to the following javascript function: function components_constructor(contractid, interfacename,
initializer) { var ccargs = arguments; function ct...
...tion components_constructor(contractid, interfacename,
initializer) { var ccargs = arguments; function ctor() { var instance = components.classes[contractid] .createinstance(components.interfaces.nsisupports); if (ccargs.length > 1) { instance.queryinterface(components.interfaces[interfacename]); if (ccargs.length > 2) instance[
initializer].apply(instance, arguments); } return instance; } return ctor; } ...
NS_ShutdownXPCOM
return values the ns_shutdownxpcom function returns ns_ok if successful. otherwise, it returns an error code. ...
... return values the ns_shutdownxpcom function returns ns_ok if successful. otherwise, it returns an error code. ...
...r code. ...
...ks you must call this method once you are finished using xpcom. calling this method triggers the "xpcom-shutdown" notification to be dispatched to observers. once this function has been called, the nsicomponentmanager and nsiservicemanager will refuse to return object instances. history this function was finalized for mozilla 0.9.6. see bug bug 99147 for details. see also ns_
initxpcom2, ns_
initxpcom3 ...
nsIAuthInformation
at was entered by the user. attributes attribute type description authenticationscheme autf8string the authentication scheme used for this request, if applicable. if the protocol for this authentication does not support schemes, this will be the empty string. otherwise, this will be a string such as "basic" or "digest". this string will always be in lowercase. read only. domain astring the
initial value should be used to prefill the dialog or be shown in some other way to the user. on return, this parameter should contain the domain entered by the user. this attribute is only used if flags include #need_domain. flags unsigned long flags describing this dialog. a bitwise or of the constants. it is possible that neither #auth_host nor #auth_proxy are set. auth prompts should ignore fla...
...n entered by the user. this attribute is only used if flags include #need_domain. flags unsigned long flags describing this dialog. a bitwise or of the constants. it is possible that neither #auth_host nor #auth_proxy are set. auth prompts should ignore flags they do not understand; especially, they should not throw an exception because of an unsupported flag. read only. password astring the
initial value should be used to prefill the dialog or be shown in some other way to the user. the password should not be shown in clear. on return, this parameter should contain the password entered by the user. realm astring the server-supplied realm of the authentication as defined in rfc 2617. can be the empty string if the protocol does not support realms. otherwise, this is a human-readable str...
...in some other way to the user. the password should not be shown in clear. on return, this parameter should contain the password entered by the user. realm astring the server-supplied realm of the authentication as defined in rfc 2617. can be the empty string if the protocol does not support realms. otherwise, this is a human-readable string like "secret files". read only. username astring the
initial value should be used to prefill the dialog or be shown in some other way to the user. on return, this parameter should contain the username entered by the user. this field can only be changed if the #only_password flag is not set. constants constant value description auth_host 1 this dialog belongs to a network host. auth_proxy 2 this dialog belongs to a proxy. need_domain 4 this d...
...gs to a proxy. need_domain 4 this dialog needs domain information. the user interface should show a domain field, prefilled with the domain attributes value. only_password 8 this dialog only asks for password information. authentication prompts should not show a username field. attempts to change the username field will have no effect. nsiauthprompt2 implementations should, however, show its
initial value to the user in some form. for example, a paragraph in the dialog might say "please enter your password for user jsmith at server intranet". this flag is mutually exclusive with #need_domain. previous_failed 16 we have already tried to log in for this channel (with auth values from a previous promptauth call), but it failed, so we now ask the user to provide a new, correct login. ...
nsIContentViewer
onents.interfaces.nsicontentviewer); method overview void clearhistoryentry(); void close(in nsishentry historyentry); void destroy(); [noscript,notxpcom,nostdcall] nsiviewptr findcontainerview(); void getbounds(in nsintrectref abounds); native code only! [noscript,notxpcom] nsidocumentptr getdocument(); void hide(); void
init(in nsiwidgetptr aparentwidget, [const] in nsintrectref abounds); native code only! void loadcomplete(in unsigned long astatus); void loadstart(in nsisupports adoc); void move(in long ax, in long ay); void open(in nsisupports astate, in nsishentry ashentry); void pagehide(in boolean isunload); boolean permitunload([optional] in boolean acalle...
...nt should not even be displayed. native code only!getbounds void getbounds( in nsintrectref abounds ); parameters abounds missing description getdocument() returns the dom document object (as an nsidocument without addrefing. [noscript,notxpcom] nsidocumentptr getdocument(); parameters none. return value the dom document object. hide() void hide(); parameters none. ...
...ould not even be displayed. native code only!getbounds void getbounds( in nsintrectref abounds ); parameters abounds missing description getdocument() returns the dom document object (as an nsidocument without addrefing. [noscript,notxpcom] nsidocumentptr getdocument(); parameters none. return value the dom document object. hide() void hide(); parameters none. ...
...de only!getbounds void getbounds( in nsintrectref abounds ); parameters abounds missing description getdocument() returns the dom document object (as an nsidocument without addrefing. [noscript,notxpcom] nsidocumentptr getdocument(); parameters none. return value the dom document object. hide() void hide(); parameters none. native code only!
init initializes the content viewer. ...
nsICrashReporter
appnotes(in voidptr aexception); native code only! void writeminidumpforexception(in voidptr aexceptioninfo); native code only! attributes attribute type description enabled boolean enable or disable the crashreporter at runtime. minidumppath nsilocalfile get or set the path on the local system to which minidumps will be written when a crash happens. ...
...e code only! void writeminidumpforexception(in voidptr aexceptioninfo); native code only! attributes attribute type description enabled boolean enable or disable the crashreporter at runtime. minidumppath nsilocalfile get or set the path on the local system to which minidumps will be written when a crash happens. exceptions thrown ns_error_not_
initialized if crash reporting is not
initialized. serverurl nsiurl get or set the url to which crash reports will be submitted. only https and http urls are allowed, as the submission is handled by os-native networking libraries. exceptions thrown ns_error_failure on get if no url is set. ns_error_invalid_arg on set if a non-http(s) url is assigned. ns_error_not_
initialized if crash reporting is not
initialized. submitreports b...
...thods annotatecrashreport() add some extra data to be submitted with a crash report. void annotatecrashreport( in acstring key, in acstring data ); parameters key name of the data to be added. data data to be added. exceptions thrown ns_error_invalid_arg if key or data contain invalid characters. invalid characters for key are '=' and '\n'. invalid character for data is '\0'. ns_error_not_
initialized if crash reporting not
initialized. appendappnotestocrashreport() append some data to the "notes" field, to be submitted with a crash report. unlike annotatecrashreport(), this method will append to existing data. void appendappnotestocrashreport( in acstring data ); parameters data data to be added. exceptions thrown ns_error_invalid_arg if data contains invalid characters. the onl...
.... appendappnotestocrashreport() append some data to the "notes" field, to be submitted with a crash report. unlike annotatecrashreport(), this method will append to existing data. void appendappnotestocrashreport( in acstring data ); parameters data data to be added. exceptions thrown ns_error_invalid_arg if data contains invalid characters. the only invalid character is '\0'. ns_error_not_
initialized if crash reporting not
initialized. native code only!appendobjcexceptioninfotoappnotes append note containing an obj-c exception's info. void appendobjcexceptioninfotoappnotes( in voidptr aexception ); parameters aexception nsexception object to append note for. native code only!writeminidumpforexception write a minidump immediately, with the user-supplied exception information. thi...
nsIDOMEvent
vailable in that interface. see bug 761613. ...
...a 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 multiple times the final invocation takes precedence. if called from a subclass of event interface only the val...
...this type may be any event type currently defined in this specification or a new event type. the string must be an xml name. ...
...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 multiple times the final invocation takes precedence. if called from a subclass of event interface only the values specified in the
initevent method are modified, all other attributes are left unchanged. void
initevent( in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg ); parameters eventtypearg specifies the event type. this type may be any event type currently defined in this specification or a new event type. the string must be an xml name. any new event type must not begin with any upper, lower, or mixed case version of the string "dom". this prefix is reserved fo...
nsIDOMMouseScrollEvent
sidommousescrollevent.idlscriptable this interface represents a mouse scroll wheel event. 1.0 66 introduced gecko 1.9.1 inherits from: nsidommouseevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) gecko 1.9.2 note prior to gecko 1.9.2, this inherited from nsisupports instead of from nsidommouseevent. ...
... type description axis long indicates which mouse wheel axis changed; this will be either horizontal_axis or vertical_axis. read only. constants constant value description horizontal_axis 1 the horizontal (x) axis. vertical_axis 2 the vertical (y) axis. ...
...ion axis long indicates which mouse wheel axis changed; this will be either horizontal_axis or vertical_axis. read only. constants constant value description horizontal_axis 1 the horizontal (x) axis. vertical_axis 2 the vertical (y) axis. ...
...dicates which mouse wheel axis changed; this will be either horizontal_axis or vertical_axis. read only. constants constant value description horizontal_axis 1 the horizontal (x) axis. vertical_axis 2 the vertical (y) axis. methods
initmousescrollevent()
initializes the progress event object. ...
nsIDOMMozTouchEvent
ing mouse events in that touch events can be generated independently for each finger touching the screen. this lets you process multi-finger touch gestures and actions. dom/interfaces/events/nsidommoztouchevent.idlscriptable please add a summary to this article. ...
... in unsigned long streamidarg); attributes attribute type description streamid unsigned long a unique identifier for each finger, so that each finger's movement can be tracked separately. this is a random number that is guaranteed to remain the same for each finger during all moztouchmove events between the corresponding moztouchdown and moztouchup events. ...
...in unsigned long streamidarg); attributes attribute type description streamid unsigned long a unique identifier for each finger, so that each finger's movement can be tracked separately. this is a random number that is guaranteed to remain the same for each finger during all moztouchmove events between the corresponding moztouchdown and moztouchup events. ...
... attributes attribute type description streamid unsigned long a unique identifier for each finger, so that each finger's movement can be tracked separately. this is a random number that is guaranteed to remain the same for each finger during all moztouchmove events between the corresponding moztouchdown and moztouchup events. methods
initmoztouchevent()
initializes the touch event. ...
nsIDirectoryService
xpcom/io/nsidirectoryservice.idlscriptable this interface provides methods to
initialize and configure a directory service instance. the xpcom directory service implements this interface to provide support for a variety of well-known file and directory locations. inherits from: nsisupports last changed in gecko 1.7 method overview void
init(); void registerprovider(in nsidirectoryserviceprovider prov); void unregisterprovider(in nsidirectoryserviceprovider prov);
init()
initializes the nsidirectoryservice instance. this method must be called before an nsidirectoryservice instance can be used. ...
...registerprovider() register a provider with the service. the directory service will keep a strong reference to the nsidirectoryserviceprovider instances registered via registerprovider. ...
...registerprovider() register a provider with the service. the directory service will keep a strong reference to the nsidirectoryserviceprovider instances registered via registerprovider. ...
...registerprovider() register a provider with the service. the directory service will keep a strong reference to the nsidirectoryserviceprovider instances registered via registerprovider. the providers will be released when the service is destroyed at xpcom shutdown. ...
nsIDocShell
presentation shell for the currently loaded document. this may be null. read only. native code only! previoustransindex long keeps track of the previous shtransaction index and the current shtransaction index at the time that the doc shell begins to load. used for contentviewer eviction. read only. printpreview nsiwebbrowserprint if the current content viewer is not
initialized for print preview, it is replaced with one which is and to which an about:blank document is loaded. read only. restoringdocument boolean track whether we're currently restoring a document presentation. read only. securityui nsisecurebrowserui the securebrowserui object for this docshell. this is set by browser or nswebbrowser for their root docshell. ...
...4 returned by the loadtype attribute for history navigation. load_cmd_pushstate 0x8 returned by the loadtype attribute when the page has used history.pushstate() character set source constants these constants are not exposed to script. they are used internally as values for the parentcharsetsource attribute. constant value description kcharsetun
initialized 0 the character set has not yet been
initialized. kcharsetfromweakdoctypedefault 1 kcharsetfromuserdefault 2 the user's default character set is being used. kcharsetfromdoctypedefault 3 the character set has been inferred from the doctype. all values from here upward are confident enough to be used for xmlhttprequest. kcharsetfr...
...f no hint. apostdatastream post data stream (if posting) aheadersstream stream containing "extra" request headers. aloadflags flags to modify load behaviour. flags are defined in nsiwebnavigation. ashentry active session history entry (if loading from sh) firstparty true if this is the master top-level document. adocshell if the load was succesfully
initiated, this receives the nsidocshell that actually performed the load. arequest the new channel created for the load. isbeingdestroyed() boolean isbeingdestroyed(); parameters none. return value returns true if the docshell is being destroyed, false otherwise. native code only!loadstream loads a given stream. this will give priority to loading the requested stream in the object implement...
...d in nsiwebnavigation. note that using flags outside load_flags_mask is only allowed if passing in a non-null loadinfo. and even some of those might not be allowed. use at your own risk. firstparty true if this is the master top-level document. preparefornewcontentmodel() reset state to a new content model within the current document and the document viewer. called by the document before
initiating an out of band document.write(). void preparefornewcontentmodel(); parameters none. resumerefreshuris() restart the xpcom timers for each meta-refresh uri in this docshell, and this docshell's children, recursively. if the timers are already running, this has no effect. void resumerefreshuris(); parameters none. native code only!setchildoffset set the offset of this child in its containe...
nsIDragService
constants constant value description dragdrop_action_none 0 no action. dragdrop_action_copy 1 the drag and drop operation should copy the object. dragdrop_action_move 2 the drag and drop operation should move the object. dragdrop_action_link 4 the drag and drop operation should link the object. dragdrop_action_un
initialized 64 the action is not
initialized. methods native code only!dragmoved programmatically changes the drag position of the drag session. this is used on mac and windows to update the position of a popup being used as a drag image during the drag operation. it's not used on gtk, which handles the drag popup itself. [noscript] void dragmoved( in long ax, in long ay ); pa...
...d, the aimagex and aimagey arguments specify the offset within the image where the cursor would be positioned. that is, when the image is drawn, it is offset up and left the amount so that the cursor appears at that location within the image. if aimage is null, aimagex and aimagey are not used and the image is instead determined from the source node adomnode, and the offset calculated so that the
initial location for the image appears in the same screen position as where the element is located. the node must be within a document. currently, supported images are all dom nodes. if this is an html <image> or <canvas> element, the drag image is taken from the image data. if the element is in a document, it will be rendered at its displayed size, otherwise, it will be rendered at its real size. fo...
...s adomnode the source node on which the drag gesture was started. atransferables an array of transferables to be dragged. aregion a region containing rectangles for cursor feedback, in window coordinates. aactiontype specified which of copy/move/link are allowed. aimage image object. aimagex x position of image. aimagey y position of image. adragevent the drag gesture event that
initiated the drag. adatatransfer a data transfer object that is available on the current drag session. invokedragsessionwithselection() start a modal drag session using the selection as the drag image. the adragevent must be supplied as the current screen coordinates of the event are needed to calculate the image location. void invokedragsessionwithselection( in nsiselection aselection, in...
...siselection aselection, in nsisupportsarray atransferablearray, in unsigned long aactiontype, in nsidomdragevent adragevent, in nsidomdatatransfer adatatransfer ); parameters aselection the selection that is to be dragged. atransferablearray an array of transferables to be dragged. aactiontype specified which of copy/move/link are allowed adragevent the drag gesture event that
initiated the drag. adatatransfer a data transfer object that is available on the current drag session. startdragsession() tells the drag service to start a drag session. this is called when an external drag occurs void startdragsession(); parameters none. suppress() increase dragging suppress level by one. this disables dragging if it is not already disabled. void suppress(); parameter...
nsIFile
nly! void copytonative(in nsifile newparentdir, in acstring newname); native code only! ...
...parentdir, in acstring newname); native code only! ...
... void create(in unsigned long type, in unsigned long permissions); void createunique(in unsigned long type, in unsigned long permissions); boolean equals(in nsifile infile); boolean exists(); acstring getrelativedescriptor(in nsifile fromfile); void
initwithfile(in nsifile afile); void
initwithnativepath(in acstring filepath); void
initwithpath(in astring filepath); boolean isdirectory(); boolean isexecutable(); boolean isfile(); boolean ishidden(); boolean isreadable(); boolean isspecial(); boolean issymlink(); boolean iswritable(); void launch(); prlibrarystar load(); void moveto(in nsifile newparentdir, in astring newname); ...
... it returns false. isreadable() this method tests whether or not this nsifile corresponds to a file or directory that may be read by the user. boolean isreadable(); parameters none. return value true if the file or directory may be read by the user. otherwise it returns false. isspecial() this method tests whether or not this nsifile corresponds to a special system file. note: the def
inition of a special system file is platform dependent. for example, under unix platforms this might correspond to a device file, socket, or fifo. boolean isspecial(); parameters none. return value true if this nsifile corresponds to a special system file. otherwise it returns false. issymlink() this method tests whether or not this nsifile corresponds to a symbolic link, shortcut, or alias.
nsIJumpListBuilder
widget/public/nsijumplistbuilder.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) jump lists are built and then applied. modifying an applied jump list is not permitted. callers should begin the creation of a new jump list using
initlistbuild(), add sub lists using addlisttobuild(), then commit the jump list using commitlistbuild(). lists are built in real-time during the sequence of build calls, make sure to check for errors on each 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.
...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 of an array of nsiwinjumplistitems representing items such as shortcuts, links, and separators. see nsijumplistitem for information on adding additiona...
... list is made up of an array of nsiwinjumplistitems 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 n...
...rameters none. return value true if the operation completed successfully. deleteactivelist() 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. re...
nsILoginManagerStorage
sabledhosts([optional] out unsigned long count, [retval, array, size_is(count)] out wstring hostnames); void getallencryptedlogins([optional] out unsigned long count, [retval, array, size_is(count)] out nsilogininfo logins); void getalllogins([optional] out unsigned long count, [retval, array, size_is(count)] out nsilogininfo logins); boolean getloginsavingenabled(in astring ahost); void
init(); void
initwithfile(in nsifile ainputfile, in nsifile aoutputfile); void modifylogin(in nsilogininfo oldlogin, in nsisupports newlogindata); void removealllogins(); void removelogin(in nsilogininfo alogin); void searchlogins(out unsigned long count, in nsipropertybag matchdata, [retval, array, size_is(count)] out nsilogininfo logins); void setloginsavingenabled(in astring ahost, in ...
...hether or not login saving has been disabled for a specific host. boolean getloginsavingenabled( in astring ahost ); parameters ahost the hostname whose login saving status should be returned. this string will be in the origin url format, without a pathname. for example, "http://mozilla.com". return value return true if login saving is enabled for the specified host; otherwise, return false. ...
...een disabled for a specific host. boolean getloginsavingenabled( in astring ahost ); parameters ahost the hostname whose login saving status should be returned. this string will be in the origin url format, without a pathname. for example, "http://mozilla.com". return value return true if login saving is enabled for the specified host; otherwise, return false.
init() implement this method to
initialize the component. ...
...ost the hostname whose login saving status should be returned. this string will be in the origin url format, without a pathname. for example, "http://mozilla.com". return value return true if login saving is enabled for the specified host; otherwise, return false.
init() implement this method to
initialize the component. this is not called automatically; you must call it yourself if needed. void
init(); parameters none.
initwithfile() implement this method to
initialize the component, overriding the default filename locations with those specified. this method is primarily used for unit tests and during profile migration. void
initwithfile( in nsifile ainputfile, in nsifile aoutputfile ); parameters ainputfile the file from which to read stored logins. aoutputfile the file to which to w...
nsIPrinterEnumerator
s.idlscriptable please add a summary to this article. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void displaypropertiesdlg(in wstring aprinter, in nsiprintsettings aprintsettings); void enumerateprinters(out pruint32 acount,[retval, array, size_is(acount)] out wstring aresult); obsolete since gecko 1.9 void
initprintsettingsfromprinter(in wstring aprintername, in nsiprintsettings aprintsettings); attributes attribute type description defaultprintername wstring the name of the system default printer. this name should also be present in printernamelist. this is not necessarily gecko's default printer; see nsiprintsettingsservice.defaultprinter...
... aprintsettings enumerateprinters() obsolete since gecko 1.9 (firefox 3) returns an array of the names of all installed printers. void enumerateprinters( out pruint32 acount, [retval, array, size_is(acount)] out wstring aresult ); parameters acount returns number of printers returned. aresult returns array of names. ...
... enumerateprinters() obsolete since gecko 1.9 (firefox 3) returns an array of the names of all installed printers. void enumerateprinters( out pruint32 acount, [retval, array, size_is(acount)] out wstring aresult ); parameters acount returns number of printers returned. aresult returns array of names. ...
...pruint32 acount, [retval, array, size_is(acount)] out wstring aresult ); parameters acount returns number of printers returned. aresult returns array of names.
initprintsettingsfromprinter()
initializes certain settings from the native printer into the printsettings these settings include, but are not limited to: page orientation, page size, number of copies. ...
nsIScriptError2
js/src/xpconnect/idl/nsiscripterror.idlscriptable represents javascript errors and warnings for use by the console service; augments nsiscripterror by adding a way to
initialize the error with the window id of the outer window with which the error is associated. 1.0 66 introduced gecko 2.0 obsolete gecko 12.0 inherits from: nsiscripterror last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) in gecko 12.0 this interface was merged into the nsiscripterror interface. ...
...tialize the error with the window id of the outer window with which the error is associated. 1.0 66 introduced gecko 2.0 obsolete gecko 12.0 inherits from: nsiscripterror last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) in gecko 12.0 this interface was merged into the nsiscripterror interface. method overview void
initwithwindowid(in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category, in unsigned long long innerwindowid); attributes attribute type description innerwindowid unsigned long long the inner window id with which the error is associated. this is zero if the error was...
...ithwindowid(in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category, in unsigned long long innerwindowid); attributes attribute type description innerwindowid unsigned long long the inner window id with which the error is associated. this is zero if the error was
initialized by calling nsiscripterror.
init() instead of
initwithwindowid(). read only. outerwindowid unsigned long long the window id with which the error is associated. this is zero if the error was
initialized by calling nsiscripterror.
init() instead of
initwithwindowid(). read only. timestamp long long elapsed time, in milliseconds, from a platform-specific zero time ...
...wid(). read only. outerwindowid unsigned long long the window id with which the error is associated. this is zero if the error was
initialized by calling nsiscripterror.
init() instead of
initwithwindowid(). read only. timestamp long long elapsed time, in milliseconds, from a platform-specific zero time to the time the message was created. read only. methods
initwithwindowid() void
init( in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category, in unsigned long long innerwindowid ); parameters message the text of the message to add to the log. sourcename the url of the file in which the error occurred. this will be a hyperlink in the j...
nsIStandardURL
netwerk/base/public/nsistandardurl.idlscriptable this interface defines the interface to an url with the standard file path format common to protocols like http, ftp, and file. it supports
initialization from a relative path and provides some customization on how urls are normalized. inherits from: nsimutable last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/network/standard-url;1. ...
... a relative path and provides some customization on how urls are normalized. inherits from: nsimutable last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/network/standard-url;1. to create an instance, use: var standardurl = components.classes["@mozilla.org/network/standard-url;1"] .createinstance(components.interfaces.nsistandardurl); method overview void
init(in unsigned long aurltype, in long adefaultport, in autf8string aspec, in string aorigincharset, in nsiuri abaseuri); attributes attribute type description mutable boolean control whether or not this url can be modified. protocol handlers can set this flag before handing out an url to ensure that it is not inadvertently modified. obsolete since gecko 1.9 constants these constants descr...
...adefaultport if the port parsed from the url string matches this port, then the port will be removed from the canonical form of the url. aspec url string. ao...
.../bar urltype_authority 2 blah:foo/bar => blah://foo/bar blah:/foo/bar => blah://foo/bar blah://foo/bar => blah://foo/bar blah:///foo/bar => blah://foo/bar urltype_no_authority 3 blah:foo/bar => blah:///foo/bar blah:/foo/bar => blah:///foo/bar blah://foo/bar => blah://foo/bar blah:///foo/bar => blah:///foo/bar methods
init() normalizes a given url to an standard url. void
init( in unsigned long aurltype, in long adefaultport, in autf8string aspec, in string aorigincharset, in nsiuri abaseuri ); parameters aurltype one of the constants listed above. adefaultport if the port parsed from the url string matches this port, then the port will be removed from the canonical form of the url. aspec url string. aorigincharset the charset from which this uri string ori...
nsIXULTemplateBuilder
element containing a datasources attribute. a template builder, given an input source of data, a template, and a reference point, generates a list of results from the input, and copies part of the template for each result. templates may generate content recursively, using the same template, but with the previous iteration's results as the reference point. as an example, for an xml data source the
initial reference point would be a specific node in the dom tree and a template might generate a list of all child nodes. for the next iteration, those children would be used to generate output for their child nodes and so forth. a template builder is attached to a single dom node; this node is called the root node and is expected to contain a xul template element as a direct child. different template...
... datasource nsisupports the opaque da...
...ery processor's translateref method with the root node's ref attribute as an argument. queryprocessor nsixultemplatequeryprocessor [noscript] readonly: the query processor used to generate results. methods rebuild() force the template builder to rebuild its content. all existing content will be removed first. the query processor's done() method will be invoked during cleanup, followed by its
initializeforbuilding() method when the content is to be regenerated. void rebuild(); parameters none. refresh() reloads any rdf datasources that support nsirdfremotedatasource. note: this is a temporary hack so that remote-xul authors can reload remote datasources. when rdf becomes remote-scriptable, this will no longer be necessary. void refresh(); parameters none. addresult() informs the template b...
...ault conditions specified inside the <rule> tag are applied before the rule filter is applied, meaning that the filter may be used to further filter out results but not reaccept results that have already been rejected. void addrulefilter( in nsidomnode arule, in nsixultemplaterulefilter afilter ); parameters arule the rule to apply the filter to. afilter the filter to add. native code only!
init called to
initialize a xul content builder on a particular root element. this element presumably has a datasources attribute, which the builder will parse to set up the template builder's data sources. [noscript] void
init( in nsicontent aelement ); parameters aelement the root element from which to derive the data. native code only!createcontents invoked lazily by a xul element that needs i...
Using nsIDirectoryService
d locations the nsiproperties keywords that you will use to get locations are defined in two places. os and xpcom level nsdirectoryservicedefs.h these locations are provided by xpcom, are constant with the system, and and should not need customization. although you will not customize these locations, you may need to tell xpcom where its /bin directory is. this is done by passing a directory to ns_
initxpcom or, for embedding, as the first parameter to ns_
initembedding. the location of the components folder and the components registry, among other things, are relative to the /bin directory. if mozilla's components directory is not in the same directory as your process, you will need to set the /bin directory as described above. in this case you will also need to tell the system of the location o...
...ese paths to the /bin directory. application level nsappdirectoryservicedefs.h the first group listed is for locations that are relative to the application: for instance, the name and location of the chrome folder, or the default location of user profiles. the nsidirectoryserviceprovider which normally provides these locations is at mozilla/xpcom/io/. this provider is installed by seamonkey after
initializing xpcom. it is also installed by default by ns_
initembedding. the second group listed is for locations which are relative to the current user profile. in seamonkey, the profile service is an nsidirectoryserviceprovider and it provides these locations. there are some cases in embedding in which distinct user profiles are not needed; however, prefs and history and such are needed. in this cas...
...you can also install your own nsidirectoryserviceprovider to control them en masse. to do this for application-level locations, create a provider based on appfilelocprovider. this object has to implement the nsisupports and nsidirectoryserviceprovider interfaces. it does not need to be a component - it can be a static lib, a source file in your project - whatever. just construct it, pass it to ns_
initembedding, and it will be installed. if you are not using ns_
initembedding, you will have to construct it and register it yourself using nsidirectoryservice.registerprovider(). if you are registering it yourself it is very important to register it immediately after calling ns_
initxpcom. there are things in the startup process that need these locations at a very early point - even before registerin...
...g nsidirectoryservice.registerprovider(). if you are registering it yourself it is very important to register it immediately after calling ns_
initxpcom. there are things in the startup process that need these locations at a very early point - even before registering components. if you want to use mpfilelocprovider, or something like it, to provide one fixed profile, just construct it and call its
initialize method - it will register itself. again, if you do this, do not
initialize the profile service - it's either one or the other. related pages code_snippets:file_i/o original document information authors: conrad carlen, doug turner last updated date: september 26, 2000 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; conte...
URLs - Plugins
s immediately and only later handles the request and calls npp_urlnotify. without this notification, the plug-in cannot tell whether a request with a null target failed or a request with a non-null target was completed. nperror npn_geturlnotify(npp instance, const char* url, const char* target, void* notifydata); the instance, url, and target parameters have the same def
initions as those of npn_geturl. the notifydata parameter contains private plug-in data that can be used to associate the request with the subsequent npp_urlnotify call (which returns this value) and/or to pass a pointer to some request-related payload. if a request is not completed successfully (for example, because the url is invalid or an http server is down), the browser should call npp_urlnotify...
...ify functions call the npp_urlnotify method to notify the plug-in of the result of a request. both functions pass the notifydata value to npp_urlnotify, which tells the plug-in that the url request was completed and the reason for completion. void npp_urlnotify(npp instance, const char* url, npreason reason, void* notifydata); the instance and url parameters have the same def
initions as those of npn_geturl. the notifydata parameter contains the private plug-in data passed to the corresponding call to npn_geturlnotify and npn_posturlnotify. warning: in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), npn_geturlnotify() does not notify the plug-in if notifydata is null. see bug 638367 for details. getting the url and displaying the page to retrieve a url and disp...
... the path string. the file-type url prefix "file://" is optional. npn_posturl is typically asynchronous: it returns immediately and only later handles the request and calls npp_notify (which, in turn, calls npp_urlnotify). nperror npn_posturl(npp instance, const char *url, const char *target, uint32 len, const char *buf, npbool file); the instance, url, and target parameters have the same def
initions as those of npn_geturl. the buf parameter identifies a local temporary file or data buffer that contains the data to post. windows and mac if a file is posted with any protocol other than ftp, the file must be text with unix-style line breaks ('\n' separators only). npn_posturl works identically with buffers and files. to post data from a memory buffer, set the flag file to false, the buf...
...p_urlnotify upon successful or unsuccessful completion of the request. npn_posturlnotify is typically asynchronous: it returns immediately and only later handles the request and calls npp_urlnotify. nperror npn_posturlnotify( npp instance, const char *url, const char *target, uint32 len, const char *buf, npbool file, void* notifydata ); the parameters of this function have the same def
initions as those of npn_posturl. the notifydata parameter contains plug-in-private data passed by npp_urlnotify and may be used for tracking multiple posts. posting data to an http server the following code posts two name-value pairs to a cgi script through http. the response from the server is displayed in a new window. char* ppostdata = "content-type:\tapplication/x-www-form-urlencoded\nconte...
Debugger - Firefox Developer Tools
the debugger object when called as a constructor, the debugger object creates a new debugger instance. new debugger([global, …]) create a debugger object, and apply its adddebuggee method to each of the givenglobal objects to add them as the
initial debuggees. ...
...nherits the following accessor properties from its prototype: enabled a boolean value indicating whether this debugger instance’s handlers, breakpoints, and the like are currently enabled. it is an accessor property with a getter and setter: assigning to it enables or disables this debugger instance; reading it produces true if the instance is enabled, or false otherwise. this property is
initially true in a freshly created debugger instance. this property gives debugger code a single point of control for disentangling itself from the debuggee, regardless of what sort of events or handlers or “points” we add to the interface. allowunobservedasmjs a boolean value indicating whether asm.js code running inside this debugger instance’s debuggee globals is invisible to debugge...
...oints” we add to the interface. allowunobservedasmjs a boolean value indicating whether asm.js code running inside this debugger instance’s debuggee globals is invisible to debugger api handlers and breakpoints. setting this to false inhibits the ahead-of-time asm.js compiler and forces asm.js code to run as normal javascript. this is an accessor property with a getter and setter. it is
initially false in a freshly created debugger instance. setting this flag to true is intended for uses of subsystems of the debugger api (e.g, debugger.source) for purposes other than step debugging 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. collectc...
...ccurs in debuggee code, the engine pauses the debuggee and calls the corresponding debugging handler on each debugger instance that is observing the debuggee. the handler functions receive the debugger instance as their this value. most handler functions can return a resumption value indicating how the debuggee’s execution should proceed. on a new debugger instance, each of these properties is
initially undefined. any value assigned to a debugging handler must be either a function or undefined; otherwise a typeerror is thrown. handler functions run in the same thread in which the event occurred. they run in the compartment to which they belong, not in a debuggee compartment. onnewscript(script,global) new code, represented by the debugger.script instancescript, has been loaded in the...
The JavaScript input interpreter - Firefox Developer Tools
der the input prompt, followed by the result. if your input does not appear to be complete when you press enter, then the console treats this as shift+enter , enabling you to finish your input. for example, if you type: function foo() { and then enter, the console does not immediately execute the input, but behaves as if you had pressed shift+enter , so you can finish entering the function def
inition. multi-line mode for multi-line entry, click the "split pane" icon at the right hand side of the single-line entry field, or press ctrl+b (windows/linux) or cmd+b (macos). the multi-line editing pane opens on the left side the of web console. you can enter multiple lines of javascript by default in this mode, pressing enter after each one. to execute the snippet that is currently in the ...
..."gear") menu in the web console toolbar. the menuitem instant evaluation has a checkmark next to it when the feature is enabled, which is missing when it is disabled. select the menuitem to change the state. execution context code that you have executed becomes part of the execution context, regardless of what editing mode you were in when you executed it. for example, if you type a function def
inition in the multi-line editor, and click run, you can switch to single-line 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 acce...
...s 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, much like you can in bash on linux and mac or powershell on windows. on windows and linux press f9. on mac press ctrl+r (note: not cmd+r!) to
initiate the reverse search. enter the text you want to search for in the input box at the bottom of the console. start typing part of the expression you are looking for and the first match is displaye...
...you can also use the ⋀ and ⋁ icons in the expression search bar. when you find the expression you want, press enter (return) to execute the statement. ...
AnalyserNode.AnalyserNode() - Web APIs
the analysernode constructor of the web audio api creates a new analysernode object instance. syntax var analysernode = new analysernode(context, ?options); parameters inherits parameters from the audionodeoptions dictionary. context a reference to an audiocontext or offlineaudiocontext. options optional fftsize: the desired
initial size of the fft for frequency-domain analysis. the default is 2048. maxdecibels: the desired
initial maximum power in db for fft analysis. the default is -30. mindecibels: the desired
initial minimum power in db for fft analysis. the default is -100. smoothingtimeconstant: the desired
initial smoothing constant for the fft analysis. the default is 0.8. return value a new analysernode object instance. specifications ...
... browser compatibility the compatibility table on this page is generated from structured data. ...
... 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. ...
Animation.playState - Web APIs
ion is unresolved and there are no pending tasks. running the animation is running. paused the animation was suspended and the animation.currenttime property is not updating. finished the animation has reached one of its boundaries and the animation.currenttime property is not updating. previously, web animations defined a pending value to indicate that some asynchronous operation such as
initiating playback was yet to complete. this is now indicated by the separate animation.pending property. example in the growing/shrinking alice game example, players can get an ending with alice crying into a pool of tears. in the game, for performance reasons, the tears should only be animating when they're visible. so they must be paused as soon as they are animated like so: // setting up the t...
...reasons, the tears should only be animating when they're visible. so they must be paused as soon as they are animated like so: // setting up the tear animations tears.foreach(function(el) { el.animate( tearsfalling, { delay: getrandommsrange(-1000, 1000), // randomized for each tear duration: getrandommsrange(2000, 6000), // randomized for each tear iterations: inf
inity, easing: 'cubic-bezier(0.6, 0.04, 0.98, 0.335)' }); el.pause(); }); // play the tears falling when the ending needs to be shown. tears.foreach(function(el) { el.play(); }); // reset the crying tears animations and pause them. tears.foreach(function(el) { el.pause(); el.currenttime = 0; }); specifications specification status comment web animat...
... ...
... }); // play the tears falling when the ending needs to be shown. tears.foreach(function(el) { el.play(); }); // reset the crying tears animations and pause them. tears.foreach(function(el) { el.pause(); el.currenttime = 0; }); specifications specification status comment web animationsthe def
inition of 'playstate' in that specification. working draft
initial def
inition. ...
AudioParam - Web APIs
of an audionode (such as gainnode.gain). an audioparam can be set to a specific value or a change in value, and can be scheduled to happen at a specific time and following a specific pattern. there are two kinds of audioparam, a-rate and k-rate parameters: an a-rate audioparam takes the current audio parameter value for each sample frame of the audio signal. a k-rate audioparam uses the same
initial audio parameter value for the whole block processed, that is 128 sample frames. in other words, the same value applies to every frame in the audio as it's processed by the node. each audionode defines which of its parameters are a-rate or k-rate in the spec. each audioparam has a list of events,
initially empty, that define when and how values change. when this list is not empty, changes us...
... that define when and how values change. when this list is not empty, changes using the audioparam.value attributes are ignored. this list of events allows us to schedule changes that have to happen at very precise times, using arbitrary timelime-based automation curves. the time used is the one defined in audiocontext.currenttime. properties audioparam.defaultvalue read only represents the
initial volume of the attribute as defined by the specific audionode creating the audioparam. audioparam.maxvalue read only represents the maximum possible value for the parameter's nominal (effective) range. audioparam.minvalue read only represents the minimum possible value for the parameter's nominal (effective) range. audioparam.value represents the parameter's current value as of the cu...
...f the attribute as defined by the specific audionode creating the audioparam. audioparam.maxvalue read only represents the maximum possible value for the parameter's nominal (effective) range. audioparam.minvalue read only represents the minimum possible value for the parameter's nominal (effective) range. audioparam.value represents the parameter's current value as of the current time;
initially set to the value of defaultvalue. methods audioparam.setvalueattime() schedules an instant change to the value of the audioparam at a precise time, as measured against audiocontext.currenttime. the new value is given by the value parameter. audioparam.linearramptovalueattime() schedules a gradual linear change in the value of the audioparam. the change starts at the time specified fo...
... working draft ...
AudioParamDescriptor - Web APIs
. automationrate optional either "a-rate", or "k-rate" string which represents an automation rate of this audioparam. defaults to "a-rate". minvalue optional a float which represents minimum value of the audioparam. defaults to -3.4028235e38. maxvalue optional a float which represents maximum value of the audioparam. defaults to 3.4028235e38. defaultvalue optional a float which represents
initial value of the audioparam. defaults to 0. examples to demonstrate creation and usage of custom audioparams, we'll expand the example from audioworkletnode page. there we've created a simple node which outputs white noise. here, additionally, we'll create a custom gain parameter, so we can directly change volume of the output (although you could use gainnode to achieve this as well). first, w...
... ...
... ...
... ...
AudioWorkletNode() - Web APIs
e registered using the audioworkletglobalscope.registerprocessor() method. options optional an object based on the audioworkletnodeoptions dictionary, which contains zero or more optional properties to configure the new node. the result of the structured clone algorithm applied to the object is also internally passed into the associated audioworkletprocessor() constructor — this allows custom
initialization of an underlying user-defined audioworkletprocessor. available properties are as follows: numberofinputs optional the value to
initialize the numberofinputs property to. defaults to 1. numberofoutputs optional the value to
initialize the numberofoutputs property to. defaults to 1. outputchannelcount optional an array defining the number of channels for each output. for example, o...
... return value the newly constructed audioworkletnode instance. ...
...ls for each output. for example, outputchannelcount: [n, m] specifies the number of channels in the first output to be n and the second output to be m. the array length must match numberofoutputs. parameterdata optional an object containing the
initial values of custom audioparam objects on this node (in its parameters property), with key being the name of a custom parameter and value being its
initial value. processoroptions optional any additional data that can be used for custom
initialization of the underlying audioworkletprocessor. return value the newly constructed audioworkletnode instance. exceptions notsupportederror the specified options.outputchannelcount is 0 or larger than the current implementation supports. indexsizeerror the length of options.outputchannelcount a...
...e specified options.outputchannelcount is 0 or larger than the current implementation supports. indexsizeerror the length of options.outputchannelcount array does not match options.numberofoutputs. example for a complete example demonstrating user-defined audio processing, see the audioworkletnode page. specifications specification status comment web audio apithe def
inition of 'audioworkletnode()' in that specification. working draft
initial def
inition. ...
CDATASection - Web APIs
dle" alignment-baseline="middle">cdatasection</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no specific properties and implements those of its parent text. methods this interface has no specific methods and implements those of its parent text. specifications specification status comment domthe def
inition of 'cdatasection' in that specification. living standard re-added in issue #295 due to web breakage dom4the def
inition of 'cdatasection' in that specification. obsolete removed in favour of the more generic text interface document object model (dom) level 3 core specificationthe def
inition of 'cdatasection' in that specification. obsolete no change from docu...
...m4the def
inition of 'cdatasection' in that specification. obsolete removed in favour of the more generic text interface document object model (dom) level 3 core specificationthe def
inition of 'cdatasection' in that specification. obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe def
inition of 'cdatasection' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'cdatasection' in that specification. ...
... no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe def
inition of 'cdatasection' in that specification. obsolete no change from document object model (dom) level 1 specification. ...
...from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe def
inition of 'cdatasection' in that specification. obsolete no change from document object model (dom) level 1 specification. ...
CSSPageRule - Web APIs
pagerule.selectortext represents the text of the page selector associated with the at-rule. csspagerule.style read only returns the declaration block associated with the at-rule. methods as a cssrule, csspagerule also implements the methods of that interface. it has no specific methods. ...
...pagerule also implements the methods of that interface. it has no specific methods. specifications specification status comment css object model (cssom)the def
inition of 'csspagerule' in that specification. ...
...no specific methods. specifications specification status comment css object model (cssom)the def
inition of 'csspagerule' in that specification. ...
... methods. specifications specification status comment css object model (cssom)the def
inition of 'csspagerule' in that specification. ...
CSSRule - Web APIs
. the relationships between these constants and the interfaces are: type value rule-specific interface comments and examples cssrule.style_rule 1 cssstylerule the most common kind of rule: selector { prop1: val1; prop2: val2; } cssrule.import_rule 3 cssimportrule an @import rule. ...
... cssrule.region_style_rule 16 cssregionstylerule cssrule.unknown_rule 0 cssunknownrule cssrule.charset_rule 2 csscharsetrule (removed in most browsers.) an up-to-date informal list of constants can be found on the csswg wiki. specifications specification status comment css object model (cssom)the def
inition of 'cssrule' in that specification. working draft obsoleted values charset_rule and unknown_rule. added value namespace_rule. css animationsthe def
inition of 'cssrule' in that specification. working draft added values keyframes_rule and keyframe_rule. css fonts module level 4the def
inition of 'cssrule' in that specification. working draft added value font_fe...
...bsoleted values charset_rule and unknown_rule. added value namespace_rule. css animationsthe def
inition of 'cssrule' in that specification. working draft added values keyframes_rule and keyframe_rule. css fonts module level 4the def
inition of 'cssrule' in that specification. working draft added value font_feature_values_rule. css counter styles level 3the def
inition of 'cssrule' in that specification. candidate recommendation added value counter_style_rule. css conditional rules module level 3the def
inition of 'cssrule' in that specification. candidate recommendation added value supports_rule. ...
...def
inition of 'cssrule' in that specification. candidate recommendation added value counter_style_rule. css conditional rules module level 3the def
inition of 'cssrule' in that specification. candidate recommendation added value supports_rule. (document_rule has been pushed to css conditional rules level 4) document object model (dom) level 2 style specificationthe def
inition of 'cssrule' in that specification. obsolete
initial def
inition. ...
CSSStyleDeclaration - Web APIs
ssprimitivevalue or null for shorthand properties. ...
...leobj.removeproperty(namestring); } console.log(styleobj.csstext); specifications specification status comment css object model (cssom)the def
inition of 'cssstyledeclaration' in that specification. ...
...ecifications specification status comment css object model (cssom)the def
inition of 'cssstyledeclaration' in that specification. working draft merged the dom level 2 style css2properties interface into cssstyledeclaration. ...
...s specification status comment css object model (cssom)the def
inition of 'cssstyledeclaration' in that specification. working draft merged the dom level 2 style css2properties interface into cssstyledeclaration. ...
CacheStorage - Web APIs
onding cache objects. use cachestorage.open() to obtain a cache instance. use cachestorage.match() to check if a given request is a key in any of the cache objects that the cachestorage object tracks. you can access cachestorage through the global caches property. note: cachestorage always rejects with a securityerror on untrusted origins (i.e. those that aren't using https, although this def
inition will likely become more complex in the future.) when testing, you can get around this by checking the "enable service workers over http (when toolbox is open)" option in the firefox devtools options/gear menu. note: cachestorage.match() is a convenience method. equivalent functionality to match a cache entry can be implemented by returning an array of cache names from cachestorage.keys(), ope...
... ...
... ...
... ...
CanvasRenderingContext2D.filter - Web APIs
0% means completely transparent. a value of 100% leaves the drawing unchanged. saturate() a css <percentage>. saturates the drawing. a value of 0% means completely un-saturated. a value of 100% leaves the drawing unchanged. sepia() a css <percentage>. converts the drawing to sepia. a value of 100% means completely sepia. a value of 0% leaves the drawing unchanged. none no filter is applied.
initial value. examples to view these examples, make sure to use a browser that supports this feature; see the compatibility table below. applying a blur this example blurs a piece of text using the filter property. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.filter = 'blur(4px)'; ctx.font = '48px s...
... ...
... ...
... ...
Basic usage of canvas - Web APIs
s id="tutorial" width="150" height="150"></canvas> at first sight a <canvas> looks like the <img> element, with the only clear difference being that it doesn't have the src and alt attributes. indeed, the <canvas> element has only two attributes, width and height. these are both optional and can also be set using dom properties. when no width and height attributes are specified, the canvas will
initially be 300 pixels wide and 150 pixels high. the element can be sized arbitrarily by css, but during rendering the image is scaled to fit its layout size: if the css sizing doesn't respect the ratio of the
initial canvas, it will appear distorted. note: if your renderings seem distorted, try specifying your width and height attributes explicitly in the <canvas> attributes, and not using css. ...
...tance). it is always a good idea to supply an id because this makes it much easier to identify it in a script. the <canvas> element can be styled just like any normal image (margin, border, background…). these rules, however, don't affect the actual drawing on the canvas. we'll see how this is done in a dedicated chapter of this tutorial. when no styling rules are applied to the canvas it will
initially be fully transparent. fallback content the <canvas> element differs from an <img> tag in that, like for <video>, <audio>, or <picture> elements, it is easy to define some fallback content, to be displayed in older browsers not supporting it, like versions of internet explorer earlier than version 9 or textual browsers. you should always provide fallback content to be displayed by those br...
... that support canvas at all. the rendering context the <canvas> element creates a fixed-size drawing surface that exposes one or more rendering contexts, which are used to create and manipulate the content shown. in this tutorial, we focus on the 2d rendering context. other contexts may provide different types of rendering; for example, webgl uses a 3d context based on opengl es. the canvas is
initially blank. to display something, a script first needs to access the rendering context and draw on it. the <canvas> element has a method called getcontext(), used to obtain the rendering context and its drawing functions. getcontext() takes one parameter, the type of context. for 2d graphics, such as those covered by this tutorial, you specify "2d" to get a canvasrenderingcontext2d. var canvas =...
... the script includes a function called draw(), which is executed once the page finishes loading; this is done by listening for the load event on the document. this function, or one like it, could also be called using window.settimeout(), window.setinterval(), or any other event handler, as long as the page has been loaded first. here is how a template would look in action. as shown here, it is
initially blank. a simple example to begin, let's take a look at a simple example that draws two intersecting rectangles, one of which has alpha transparency. we'll explore how this works in more detail in later examples. <!doctype html> <html> <head> <meta charset="utf-8"/> <script type="application/javascript"> function draw() { var canvas = document.getelementbyid('canvas'); ...
Comment - Web APIs
ific property, but inherits those of its parent, characterdata, and indirectly those of node. constructor comment() returns a comment object with the parameter as its textual content. methods this interface has no specific method, but inherits those of its parent, characterdata, and indirectly those of node. specifications specification status comment domthe def
inition of 'comment' in that specification. living standard added the constructor. document object model (dom) level 3 core specificationthe def
inition of 'comment' in that specification. obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe def
inition of 'comment' in that specification. ...
...ationthe def
inition of 'comment' in that specification. obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe def
inition of 'comment' in that specification. obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe def
inition of 'comment' in that specification. ...
...obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe def
inition of 'comment' in that specification. ...
... no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe def
inition of 'comment' in that specification. ...
ContentIndexEvent() - Web APIs
the options are: id: the id of the indexed content you want the contentindexevent to remove. ...
...the options are: id: the id of the indexed content you want the contentindexevent to remove. ...
...the options are: id: the id of the indexed content you want the contentindexevent to remove. ...
...lue 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 def
inition of 'contentindexevent' in that specification. unknown
initial def
inition. ...
CustomElementRegistry.get() - Web APIs
the get() method of the customelementregistry interface returns the constructor for a previously-defined custom element. syntax constructor = customelements.get(name); parameters name the name of the custom element whose constructor you want to return a reference to. return value the constructor for the named custom element, or undefined if there is no custom element def
inition with that name. examples customelements.define('my-paragraph', class extends htmlelement { constructor() { super(); let template = document.getelementbyid('my-paragraph'); let templatecontent = template.content; const shadowroot = this.attachshadow({mode: 'open'}) .appendchild(templatecontent.clonenode(true)); } }) // return a reference to the my-paragraph construc...
... ...
... ...
... ...
CustomEvent() - Web APIs
the customevent() constructor creates a new customevent. note: this feature is available in web workers. syntax event = new customevent(typearg, customevent
init); parameters typearg a domstring representing the name of the event. customevent
init optional a customevent
init dictionary, having the following fields: "detail", optional and defaulting to null, of type any, that is an event-dependent value associated with the event. the customevent
init dictionary also accepts fields from the event
init dictionary. return value a new customevent object of the specified type, with any other properties configured according to the customevent
init dictionary (if one was provided). example // add an appropriate event listener obj.addeventlistener("cat", function(e) { process(e...
... ...
... ...
... ...
DOMPointReadOnly() - Web APIs
e is 0. y optional the value of the vertical coordinate, y, as a floating point number. the default value is 0. z optional the value of the depth coordinate, z, as a floating point number. the default value is 0. w optional the value of the perspective, w, as a floating point number. the default is 1. note: each of these values is what's called an unrestricted number. in addition to any f
inite floating-point value, you may use special values such as ±inf
inity and nan. return value a new dompointreadonly object representing the specified location in space. examples the following code demonstrates creating both 2d and 3d points. var point2d = new dompointreadonly(50, 25); var point3d = new dompointreadonly(50, 0, 10); var perspectivepoint3d = new dompointreadonly(50, 50, 25, 0.5)...
...only object representing the specified location in space. ...
...ode demonstrates creating both 2d and 3d points. ...
...rates creating both 2d and 3d points. ...
DOMPointReadOnly.fromPoint() - Web APIs
the static dompointreadonly method frompoint() creates and returns a new dompointreadonly object given a source point. the source point is specified as a dompoint
init-compatible object, which includes both dompoint and dompointreadonly. you can also create a new dompointreadonly object using the new dompointreadonly() constructor. syntax const point = dompointreadonly.frompoint(sourcepoint) properties sourcepoint a dompoint
init-compliant object, which includes both dompoint and dompointreadonly, from which to take the values of the new point's properties. return value a new dompointreadonly object (which is identical to the source point). examples creating a 2d point this sample creates a 2d point, specifying an inline object that includes the values to use for x and y. the z an...
...ting point this example creates a point, origpoint, of type dompoint, using new dompoint(). ...
...w dompoint(). that point is then used as the input for frompoint() to create a new point, newpoint. ...
...). that point is then used as the input for frompoint() to create a new point, newpoint. ...
DataTransfer.files - Web APIs
return value a list of the files in a drag operation, one list item for each file in the operation. if the drag operation had no files, the list is empty. ...
...he operation. if the drag operation had no files, the list is empty. ...
...mpty. ...
...ple there are two live examples of this interface: firefox only: http://jsfiddle.net/9c2ef/ all browsers: https://jsbin.com/hiqasek/ specifications specification status comment html living standardthe def
inition of 'files' in that specification. living standard html 5.1the def
inition of 'files' in that specification. recommendation
initial def
inition ...
Document.anchors - Web APIs
a list of all of the anchors in the document. syntax nodelist = document.anchors; value an htmlcollection. ...
... var toc = document.getelementbyid("toc"); var i, li, newanchor; for (i = 0; i < document.anchors.length; i++) { li = document.createelement("li"); newanchor = document.createelement('a'); newanchor.href = "#" + document.anchors[i].name; newanchor.innerhtml = document.anchors[i].text; li.appendchild(newanchor); toc.appendchild(li); } } </script> </head> <body onload="
init()"> <h1>title</h1> <h2><a name="contents">contents</a></h2> <ul id="toc"></ul> <h2><a name="plants">plants</a></h2> <ol> <li>apples</li> <li>oranges</li> <li>pears</li> </ol> <h2><a name="veggies">veggies</a></h2> <ol> <li>carrots</li> <li>celery</li> <li>beats</li> </ol> </body> </html> view on jsfiddle notes for reasons of backwards compatibility, the returned set of anchors...
... ...
...mpatibility, the returned set of anchors only contains those anchors created with the name attribute, not those created with the id attribute. specifications specification status comment html living standardthe def
inition of 'document.anchors' in that specification. living standard obsoleted. document object model (dom) level 2 html specificationthe def
inition of 'document.anchors' in that specification. obsolete
initial def
inition. ...
Document.createElementNS() - Web APIs
s an element with the specified namespace uri and qualified name. to create an element without specifying a namespace uri, use the createelement() method. syntax var element = document.createelementns(namespaceuri, qualifiedname[, options]); parameters namespaceuri a string that specifies the namespace uri to associate with the element. the namespaceuri property of the created element is
initialized with the value of namespaceuri. see valid namespace uris. qualifiedname a string that specifies the type of element to be created. the nodename property of the created element is
initialized with the value of qualifiedname. optionsoptional an optional elementcreationoptions object containing a single property named is, whose value is the tag name for a custom element previously defined...
...l namespace and appends it to the vbox element. ...
...emonstrate the use of elements from two different namespaces within a single document: <?xml version="1.0"?> <page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml" title="||working with elements||" onload="
init()"> <script type="application/javascript"><![cdata[ let container; let newdiv; let txtnode; function
init(){ container = document.getelementbyid("containerbox"); newdiv = document.createelementns("http://www.w3.org/1999/xhtml", "div"); txtnode = document.createtextnode("this is text that was constructed dynamically with createelementns and createtextnode then inserted into the document using appendchild."); newdiv.appendchild(txtnode); container.appendchild(newdiv); } ]]></script> ...
... living standard ...
Document.createProcessingInstruction() - Web APIs
r().parsefromstring('<foo />', 'application/xml'); var pi = doc.createprocessinginstruction('xml-stylesheet', 'href="mycss.css" type="text/css"'); doc.insertbefore(pi, doc.firstchild); console.log(new xmlserializer().serializetostring(doc)); // displays: <?xml-stylesheet href="mycss.css" type="text/css"?><foo/> specifications specification status comment domthe def
inition of 'createprocessinginstruction()' in that specification. living standard no change dom4the def
inition of 'createprocessinginstruction()' in that specification. obsolete added more explicit def
inition of how the data parameter is validated. document object model (dom) level 3 core specificationthe def
inition of 'createprocessinginstruction()' in that specification...
...ecificationthe def
inition of 'createprocessinginstruction()' in that specification. obsolete added note that the namespace of the target name is not checked whether it is well-formed, defined what is considered an illegal character for the target name and specified the returned processinginstruction object more precisely. document object model (dom) level 2 core specificationthe def
inition of 'createprocessinginstruction()' in that specification. obsolete no change document object model (dom) level 1 specificationthe def
inition of 'createprocessinginstruction()' in that specification. ...
... for the target name and specified the returned processinginstruction object more precisely. document object model (dom) level 2 core specificationthe def
inition of 'createprocessinginstruction()' in that specification. ...
...rget name and specified the returned processinginstruction object more precisely. document object model (dom) level 2 core specificationthe def
inition of 'createprocessinginstruction()' in that specification. ...
Document.defaultView - Web APIs
in browsers, document.defaultview returns the window object associated with a document, or null if none is available. syntax var win = document.defaultview; this property is read-only. ...
... in browsers, document.defaultview returns the window object associated with a document, or null if none is available. syntax var win = document.defaultview; this property is read-only. ...
... document, or null if none is available. syntax var win = document.defaultview; this property is read-only. ...
...or null if none is available. syntax var win = document.defaultview; this property is read-only. ...
Document.getElementsByName() - Web APIs
alue. be careful not to use the same string as both a name and an id. the getelementsbyname method works differently in ie. there, getelementsbyname() does not return all elements which may not have a name attribute (such as <span>). ...
...not return all elements which may not have a name attribute (such as <span>). ...
... both ie and edge return an htmlcollection, not a nodelist specifications specification status comment html living standardthe def
inition of 'document.getelementsbyname()' in that specification. ...
...d edge return an htmlcollection, not a nodelist specifications specification status comment html living standardthe def
inition of 'document.getelementsbyname()' in that specification. ...
Document.importNode() - Web APIs
ocuments should either be: cloned using document.importnode(); or adopted using document.adoptnode(). best practice: although firefox doesn't currently enforce this rule, we encourage you to follow this rule for improved future compatibility. ...
...rrently enforce this rule, we encourage you to follow this rule for improved future compatibility. for more on the node.ownerdocument issues, see the w3c dom faq. ...
...ved future compatibility. for more on the node.ownerdocument issues, see the w3c dom faq. specifications specification status comment domthe def
inition of 'document.importnode()' in that specification. ...
...compatibility. for more on the node.ownerdocument issues, see the w3c dom faq. specifications specification status comment domthe def
inition of 'document.importnode()' in that specification. ...
Document.rootElement - Web APIs
it is deprecated in favor of document.documentelement, which returns the root element for all documents. syntax const element = document.rootelement notes if the document is a non-empty svg document, then the rootelement will be an svgsvgelement, identical to the documentelement. ...
...ocument is a non-empty svg document, then the rootelement will be an svgsvgelement, identical to the documentelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgdocument.rootelement' in that specification. ...
...t, identical to the documentelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgdocument.rootelement' in that specification. ...
...l to the documentelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgdocument.rootelement' in that specification. ...
EffectTiming - Web APIs
onstart optional describes at what point in the iteration the animation should start. ...
...for example, and with this value set, an animation with 2 iterations would end halfway through a third iteration. defaults to 0.0. iterations optional the number of times the animation should repeat. ...
...would end halfway through a third iteration. defaults to 0.0. iterations optional the number of times the animation should repeat. defaults to 1, and can also take a value of inf
inity to make it repeat for as long as the element exists. ...
...alfway through a third iteration. defaults to 0.0. iterations optional the number of times the animation should repeat. defaults to 1, and can also take a value of inf
inity to make it repeat for as long as the element exists. ...
Element.getClientRects() - Web APIs
e relative to is the viewport that the element's outer-<svg> establishes (and to be clear, the rectangles are also transformed by the outer-<svg>'s viewbox transform, if any). originally, microsoft intended this method to return a textrectangle object for each line of text. however, the cssom working draft specifies that it returns a domrect for each border box. for an inline element, the two def
initions are the same. but for a block element, mozilla will return only a single rectangle. firefox 3.5 note firefox 3.5 adds width and height properties to the textrectangle object. the amount of scrolling that has been done of the viewport area (or any other scrollable element) is taken into account when computing the rectangles. the returned rectangles do not include the bounds of any...
... ...
... ...
... ...
Element.getElementsByTagNameNS() - Web APIs
ells in a table in an xhtml document. var table = document.getelementbyid("forecast-table"); var cells = table.getelementsbytagnamens("http://www.w3.org/1999/xhtml", "td"); for (var i = 0; i < cells.length; i++) { var axis = cells[i].getattribute("axis"); if (axis == "year") { // grab the data } } specifications specification status comment domthe def
inition of 'element.getelementsbytagnamens()' in that specification. living standard changed the return value from nodelist to htmlcollection. document object model (dom) level 3 core specificationthe def
inition of 'element.getelementsbytagnamens()' in that specification. obsolete no change from document object model (dom) level 2 core specification. document object model...
...' in that specification. living standard changed the return value from nodelist to htmlcollection. document object model (dom) level 3 core specificationthe def
inition of 'element.getelementsbytagnamens()' in that specification. obsolete no change from document object model (dom) level 2 core specification. ...
...t to htmlcollection. document object model (dom) level 3 core specificationthe def
inition of 'element.getelementsbytagnamens()' in that specification. obsolete no change from document object model (dom) level 2 core specification. ...
...llection. document object model (dom) level 3 core specificationthe def
inition of 'element.getelementsbytagnamens()' in that specification. obsolete no change from document object model (dom) level 2 core specification. ...
Element.onfullscreenerror - Web APIs
rror property is an event handler for the fullscreenerror event which is sent to the element when an error occurs while attempting to transition into or out of full-screen mode. syntax targetelement.onfullscreenerror = fullscreenerrorhandler; value an error handler for the fullscreenerror event. example this example attempts to switch into full-screen mode from outside a handler for a user-
initiated event (such as a click or keypress event). since full-screen mode changes are only permitted in response to a user input, this causes an error to occur, which triggers the delivery of the fullscreenerror event to the error handler, let elem = document.queryselector("video")}} elem.onfullscreenerror = function ( event ) { displaywarning("unable to switch into full-screen mode."); }; //..
... ...
... ...
... ...
ElementTraversal - Web APIs
useless, as very few types of node were able to implement all its methods and properties. ...
...kind of nodes: childnode parentnode as it was a pure interface, with no object of this type, this change has no effect on the web. specifications specification status comment domthe def
inition of 'childnode' in that specification. ...
..., with no object of this type, this change has no effect on the web. specifications specification status comment domthe def
inition of 'childnode' in that specification. ...
...bject of this type, this change has no effect on the web. specifications specification status comment domthe def
inition of 'childnode' in that specification. ...
Event.type - Web APIs
...
... ...
... ...
... false); // second document.addeventlistener('click', geteventtype, false); // third result specifications specification status comment domthe def
inition of 'event.type' in that specification. living standard document object model (dom) level 2 events specificationthe def
inition of 'event.type' in that specification. obsolete
initial def
inition. ...
EventTarget.dispatchEvent() - Web APIs
es an event at the specified eventtarget, (synchronously) invoking the affected eventlisteners in the appropriate order. the normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchevent(). syntax cancelled = !target.dispatchevent(event) parameter event is the event object to be dispatched. ...
... exceptions exceptions thrown by event handlers are reported as uncaught exceptions. the event handlers run on a nested callstack; they block the caller until they complete, but exceptions do not propagate to the caller. ...
...ey complete, but exceptions do not propagate to the caller. notes unlike "native" events, which are fired by the dom and invoke event handlers asynchronously via the event loop, dispatchevent() invokes event handlers synchronously. all applicable event handlers will execute and return before the code continues on after the call to dispatchevent(). dispatchevent() is the last step of the create-
init-dispatch process, which is used for dispatching events into the implementation's event model. the event can be created using event constructor. see also the event object reference. example see creating and triggering events. specifications specification status comment domthe def
inition of 'eventtarget.dispatchevent()' in that specification. living standard i...
...process, which is used for dispatching events into the implementation's event model. the event can be created using event constructor. see also the event object reference. example see creating and triggering events. specifications specification status comment domthe def
inition of 'eventtarget.dispatchevent()' in that specification. living standard
initial def
inition in the dom 2 events 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsa...
FetchEvent.request - Web APIs
example this code snippet is from the service worker fetch sample (run the fetch sample live). ...
... ...
... ...
... ...
FileReader.result - Web APIs
the value is null if the reading is not yet complete or was unsuccessful. the result types are described below. ...
...the value is null if the reading is not yet complete or was unsuccessful. the result types are described below. ...
... to read(). the content is handled as raw text data. ...
...input = document.queryselector('input[type="file"]'); function read(callback) { var file = fileinput.files.item(0); var reader = new filereader(); reader.onload = function() { callback(reader.result); } reader.readastext(file); } specifications specification status comment file apithe def
inition of 'result' in that specification. working draft
initial def
inition ...
FileReader - Web APIs
llowing: empty 0 no data has been loaded yet. loading 1 data is currently being loaded. done 2 the entire read request has been completed. filereader.result read only the file's contents. this property is only valid after the read operation is complete, and the format of the data depends on which of the methods was used to
initiate the read operation. event handlers filereader.onabort a handler for the abort event. this event is triggered each time the reading operation is aborted. filereader.onerror a handler for the error event. this event is triggered each time the reading operation encounter an error. filereader.onload a handler for the load event. this event is triggered each time the reading operation is...
...the onload property. loadend fired when a read has completed, successfully or not. ...
...cessfully or not. also available via the onloadend property. ...
...r not. also available via the onloadend property. loadstart fired when a read has started. ...
FocusEvent() - Web APIs
the focusevent() constructor returns a newly created focusevent object with an optional eventtarget. when the event has both a source and a destination, the relatedtarget value must be set to the other target. syntax var focusevent = new focusevent(typearg[, focusevent
init]); properties the focusevent() constructor also inherits arguments from uievent() and from event(). typearg is a domstring representing the name of the event. focusevent
init optional is a focusevent
init dictionary, having the following fields: "relatedtarget", optional and defaulting to null, is an eventtarget representing the secondary target of a focusevent. the focusevent
init dictionary also accepts fields from the uievent
init and event
init dictionaries. specifications specification ...
...ary, having the following fields: "relatedtarget", optional and defaulting to null, is an eventtarget representing the secondary target of a focusevent. the focusevent
init dictionary also accepts fields from the uievent
init and event
init dictionaries. ...
...and defaulting to null, is an eventtarget representing the secondary target of a focusevent. the focusevent
init dictionary also accepts fields from the uievent
init and event
init dictionaries. ...
...ing to null, is an eventtarget representing the secondary target of a focusevent. the focusevent
init dictionary also accepts fields from the uievent
init and event
init dictionaries. ...
FontFaceSet - Web APIs
t of type loadingdone is fired, indicating that a font face set has finished loading. fontfaceset.onloadingerror an eventlistener called whenever an event of type loadingerror is fired, indicating that an error occurred whilst loading a font-face set. methods fontfaceset.add() adds a font to the font set. fontfaceset.check() a boolean that indicates whether a font is loaded, but doesn't
initiate a load when it isn't. fontfaceset.clear() removes all manually-added fonts from the font set. css-connected fonts are unaffected. fontfaceset.delete() removes a manually-added font from the font set. css-connected fonts are unaffected. fontfaceset.load() returns a promise which resolves to a list of font-faces for a requested font. specifications specification status c...
...es all manually-added fonts from the font set. css-connected fonts are unaffected. ...
...e unaffected. fontfaceset.delete() removes a manually-added font from the font set. ...
...d. fontfaceset.delete() removes a manually-added font from the font set. ...
FontFaceSetLoadEvent.fontfaces - 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. ...
... 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. ...
FormDataEvent() - Web APIs
the default is false. cancelable: a boolean indicating whether the event can be cancelled. the default is false. composed: a boolean indicating whether the event will trigger listeners outside of a shadow root (see event.composed for more details). the default is false. ...
...ate the formdataevent with. ...
...dataevent.formdata property. ...
...ormdata property. ...
HTMLBaseFontElement - Web APIs
ing representing the font size as either a numeric or relative value. numeric values range from 1 to 7 with 1 being the smallest and 3 the default. relative value starts with a '+' or a '-'. ...
.... relative value starts with a '+' or a '-'. methods no specific method; inherits methods from its parent, htmlelement. ...
...hod; inherits methods from its parent, htmlelement. specifications specification status comment document object model (dom) level 2 html specificationthe def
inition of 'htmlbasefontelement' in that specification. ...
...ts methods from its parent, htmlelement. specifications specification status comment document object model (dom) level 2 html specificationthe def
inition of 'htmlbasefontelement' in that specification. ...
HTMLCanvasElement: webglcontextrestored event - Web APIs
the webglcontextrestored event of the webgl api is fired if the user agent restores the drawing buffer for a webglrenderingcontext object. once the context is restored, webgl resources such as textures and buffers that were created before the context was lost are no longer valid. you need to re
initialize the state of your webgl application and recreate resources. bubbles yes cancelable yes interface webglcontextevent event handler property none example with the help of the webgl_lose_context extension, you can simulate the webglcontextrestored event: var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); canvas.addeventlistener('webglcontextrestored', function(e) { console.log(e); }, false); gl.gete...
... ...
... ...
... ...
HTMLHeadingElement - Web APIs
htmlheadingelement.align is a domstring representing an enumerated attribute indicating alignment of the heading with respect to the surrounding context. the possible values are "left", "right", "justify", and "center". methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmlheadingelement' in that specification. living standard html5the def
inition of 'htmlheadingelement' in that specification. recommendation the align property is now obsolete. document object model (dom) level 2 html specificationthe def
inition of 'htmlheadingelement' in that specification. obsolete no change document object model (dom) level ...
...ment' in that specification. living standard html5the def
inition of 'htmlheadingelement' in that specification. recommendation the align property is now obsolete. document object model (dom) level 2 html specificationthe def
inition of 'htmlheadingelement' in that specification. ...
...def
inition of 'htmlheadingelement' in that specification. recommendation the align property is now obsolete. document object model (dom) level 2 html specificationthe def
inition of 'htmlheadingelement' in that specification. obsolete no change document object model (dom) level 1 specificationthe def
inition of 'htmlheadingelement' in that specification. ...
...of 'htmlheadingelement' in that specification. recommendation the align property is now obsolete. document object model (dom) level 2 html specificationthe def
inition of 'htmlheadingelement' in that specification. ...
HTMLHyperlinkElementUtils - Web APIs
can happen because it was not specified or because it was specified to be the default port of the url's scheme), a ':', and the port of the url. htmlhyperlinkelementutils.hostname this is a usvstring containing the domain of the url. htmlhyperlinkelementutils.port this is a usvstring containing the port number of the url. htmlhyperlinkelementutils.pathname this is a usvstring containing an
initial '/' followed by the path of the url. htmlhyperlinkelementutils.search this is a usvstring containing a '?' followed by the parameters of the url. htmlhyperlinkelementutils.hash this is a usvstring containing a '#' followed by the fragment identifier of the url. htmlhyperlinkelementutils.username this is a usvstring containing the username specified before the domain name. htmlhyperlinke...
...(that is its scheme, its domain and its port). methods note: this interface doesn't inherit any method. ...
...n't inherit any method. ...
... any method. htmlhyperlinkelementutils.tostring() this returns a usvstring containing the whole url. ...
HTMLImageElement.decode() - Web APIs
this, in turn, prevents the rendering of the next frame after adding the image to the dom from causing a delay while the image loads. syntax var promise = htmlimageelement.decode(); parameters none. ...
...eelement.decode(); parameters none. return value a promise which is resolved once the image data is ready to be used. exceptions encodingerror a domexception indicating that an error occurred while decoding the image. usage notes one potential use case for decode(): when loading very large images (for example, in an online photo album), you can present a low resolution thumbnail image
initially and then replace that image with the full-resolution image by instantiating a new htmlimageelement, setting its source to the full-resolution image's url, then using decode() to get a promise which is resolved once the full-resolution image is ready for use. at that time, you can then replace the low-resolution image with the full-resolution one that's now available. examples the following...
... ...
...and by handling the error in the error event's handler. const img = new image(); img.src = 'nebula.jpg'; img.decode() .then(() => { document.body.appendchild(img); }) .catch((encodingerror) => { // do something with the error. }) specifications specification status comment html living standardthe def
inition of 'decode()' in that specification. living standard
initial def
inition. ...
HTMLMediaElement.crossOrigin - Web APIs
the htmlmediaelement.crossorigin property is the cors setting for this image element. see cors settings attributes for details. ...
... the htmlmediaelement.crossorigin property is the cors setting for this image element. see cors settings attributes for details. ...
...y is the cors setting for this image element. see cors settings attributes for details. ...
...rs setting for this image element. see cors settings attributes for details. specifications specification status comment html living standardthe def
inition of 'htmlmediaelement.crossorigin' in that specification. ...
HTMLSelectElement.checkValidity() - Web APIs
the htmlselectelement.checkvalidity() method 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 then returns false. ...
...onstraints, the browser fires a cancelable invalid event at the element, and then returns false. ...
...alse. syntax var result = selectelt.checkvalidity(); specifications specification status comment html living standardthe def
inition of 'htmlselectelement.checkvalidity()' in that specification. living standard no change since the latest snapshot, html5. ...
...ax var result = selectelt.checkvalidity(); specifications specification status comment html living standardthe def
inition of 'htmlselectelement.checkvalidity()' in that specification. living standard no change since the latest snapshot, html5. ...
HTMLSelectElement.setCustomValidity() - Web APIs
ity() method sets the custom validity message for the selection element to the specified message. use the empty string to indicate that the element does not have a custom validity error. syntax selectelt.setcustomvalidity(string); parameters string is the domstring containing the error message. ...
... a custom validity error. syntax selectelt.setcustomvalidity(string); parameters string is the domstring containing the error message. specifications specification status comment html living standardthe def
inition of 'htmlselectelement.setcustomvalidity()' in that specification. ...
...s the domstring containing the error message. specifications specification status comment html living standardthe def
inition of 'htmlselectelement.setcustomvalidity()' in that specification. living standard no change since the latest snapshot, html5. ...
...ring containing the error message. specifications specification status comment html living standardthe def
inition of 'htmlselectelement.setcustomvalidity()' in that specification. living standard no change since the latest snapshot, html5. ...
HTMLTemplateElement - Web APIs
5dd; pointer-events: all;} properties this interface inherits the properties of htmlelement. ...
... read only a read-only documentfragment which contains the dom subtree representing the <template> element's template contents. methods this interface inherits the methods of htmlelement. ...
...he <template> element's template contents. methods this interface inherits the methods of htmlelement. ...
...e> element's template contents. methods this interface inherits the methods of htmlelement. ...
IDBCursor - Web APIs
recommendation added continueprimarykey() and support for binary keys, and the idbcursor.request property. ...
... recommendation added continueprimarykey() and support for binary keys, and the idbcursor.request property. ...
... recommendation added continueprimarykey() and support for binary keys, and the idbcursor.request property. ...
... recommendation added continueprimarykey() and support for binary keys, and the idbcursor.request property. ...
IIRFilterNode - Web APIs
it lets the parameters of the filter response be specified, so that it can be tuned as needed. number of inputs 1 number of outputs 1 channel count mode "max" channel count same as on the input channel interpretation "speakers" typically, it's best to use the biquadfilternode interface to implement higher-order filters. ...
...r filter, you'll need to use iirfilternode. you may also find this interface useful if you don't need automation, or for other reasons. once the node has been created, you can't change its coefficients. iirfilternodes have a tail-time reference; they continue to output non-silent audio with zero input. as an iir filter, the non-zero input continues forever, but this can be limited after some f
inite time in practice, when the output has approached zero closely enough. the actual time that takes depends on the filter coefficients provided. constructor iirfilternode() creates a new instance of an iirfilternode object. properties this interface has no properties of its own; however, it inherits properties from its parent, audionode. methods inherits methods from its parent, audionode...
... also see the source code on github. ...
...cient values for different lowpass frequencies — you can change the value of the filternumber constant to a value between 0 and 3 to check out the different available effects. also see our using iir filters guide for a full explanation. specifications specification status comment web audio apithe def
inition of 'iirfilternode' in that specification. working draft
initial def
inition ...
Using IndexedDB - Web APIs
t in firefox this is not implemented yet as of april 2020 so you can't use indexeddb in firefox private browsing at all). now, assuming that the user allowed your request to create a database, and you've received a success event to trigger the success callback; what's next? the request here was generated with a call to indexeddb.open(), so request.result is an instance of idbdatabase, and you def
initely want to save that for later. your code might look something like this: var db; var request = indexeddb.open("mytestdatabase"); request.onerror = function(event) { console.log("why didn't you allow my web app to use indexeddb?!"); }; request.onsuccess = function(event) { db = event.target.result; }; handling errors as mentioned above, error events bubble. error events are targeted at th...
... of tips: when defining the scope, specify only the object stores you need. this way, you can run multiple transactions with non-overlapping scopes concurrently. only specify a readwrite transaction mode when necessary. you can concurrently run multiple readonly transactions with overlapping scopes, but you can have only one readwrite transaction for an object store. to learn more, see the def
inition for transactions in the basic concepts article. adding data to the database if you've just created a database, then you probably want to write to it. here's what that looks like: var transaction = db.transaction(["customers"], "readwrite"); // note: older experimental implementations use the deprecated constant idbtransaction.read_write instead of "readwrite". // in case you want to suppor...
... of tips: when defining the scope, specify only the object stores you need. this way, you can run multiple transactions with non-overlapping scopes concurrently. only specify a readwrite transaction mode when necessary. you can concurrently run multiple readonly transactions with overlapping scopes, but you can have only one readwrite transaction for an object store. to learn more, see the def
inition for transactions in the basic concepts article. updating an entry in the database now we've retrieved some data, updating it and inserting it back into the indexeddb is pretty simple. let's update the previous example somewhat: var objectstore = db.transaction(["customers"], "readwrite").objectstore("customers"); var request = objectstore.get("444-44-4444"); request.onerror = function(even...
...upgrade the database. // if you don't do this then the upgrade won't happen until the user closes the tab. db.onversionchange = function(event) { db.close(); console.log("a new version of this page is ready. please reload or close this tab!"); }; // do stuff with the database. } you should also listen for versionerror errors to handle the situation where already opened apps may
initiate code leading to a new attempt to open the database, but using an outdated version. security indexeddb uses the same-origin principle, which means that it ties the store to the origin of the site that creates it (typically, this is the site domain or subdomain), so it cannot be accessed by any other origin. third party window content (e.g. <iframe> content) cannot access indexeddb if the br...
InputEvent() - Web APIs
data: (optional) a string containing characters to insert. this may be an empty string if the change doesn't insert text (such as when deleting characters, for example). ...
... data: (optional) a string containing characters to insert. this may be an empty string if the change doesn't insert text (such as when deleting characters, for example). ...
... data: (optional) a string containing characters to insert. this may be an empty string if the change doesn't insert text (such as when deleting characters, for example). ...
...ext data being added to or removed from editible content. iscomposing: (optional) a boolean indicating that the event is part of a composition session, meaning it is after a compositionstart event but before a compositionend event. the default is false. ranges: (optional) an array of static ranges that will be affected by a change to the dom if the input event is not canceled. the inputevent
init dictionary also accepts fields from uievent
init and from event
init dictionaries. ...
KeyboardEvent() - Web APIs
"code", optional and defaulting to "", of type domstring, that sets the value of keyboardevent.code. "location", optional and defaulting to 0, of type unsigned long, that sets the value of keyboardevent.location. ...
... "code", optional and defaulting to "", of type domstring, that sets the value of keyboardevent.code. "location", optional and defaulting to 0, of type unsigned long, that sets the value of keyboardevent.location. ...
..."charcode", optional and defaulting to 0, of type unsigned long, that sets the value of the deprecated keyboardevent.charcode. "keycode", optional and defaulting to 0, of type unsigned long, that sets the value of the deprecated keyboardevent.keycode. "which", optional and defaulting to 0, of type unsigned long, that sets the value of the deprecated keyboardevent.which. the keyboardevent
init dictionary also accepts fields from the uievent
init and event
init dictionaries. specifications specification status comment ui eventsthe def
inition of 'keyboardevent()' in that specification. working draft current def
inition. document object model (dom) level 3 events specificationthe def
inition of 'keyboardevent()' in that specification. obsol...
...nary also accepts fields from the uievent
init and event
init dictionaries. specifications specification status comment ui eventsthe def
inition of 'keyboardevent()' in that specification. working draft current def
inition. document object model (dom) level 3 events specificationthe def
inition of 'keyboardevent()' in that specification. obsolete
initial def
inition. ...
KeyboardEvent - Web APIs
rdevent.shiftkey read only returns a boolean that is true if the shift key was active when the key event was generated. methods this interface also inherits methods of its parents, uievent and event. keyboardevent.getmodifierstate() returns a boolean indicating if a modifier key such as alt, shift, ctrl, or meta, was pressed when the event was created. obsolete methods keyboardevent.
initkeyevent()
initializes a keyboardevent object. this was implemented only by firefox, and is no longer supported even there; instead, you should use the keyboardevent() constructor. keyboardevent.
initkeyboardevent()
initializes a keyboardevent object. this is now deprecated. you should instead use the keyboardevent() constructor. obsolete properties keyboardevent.char read only retu...
..., unfortunately, there's no way for web content to tell the difference between auto-repeating keys and keys that are just being pressed repeatedly. auto-repeat handling prior to gecko 5.0 before gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2), keyboard handling was less consistent across platforms. windows auto-repeat behavior is the same as in gecko 4.0 and later. mac after the
initial keydown event, only keypress events are sent until the keyup event occurs; the inter-spaced keydown events are not sent. linux the event behavior depends on the specific platform. it will either behave like windows or mac depending on what the native event model does. note: manually firing an event does not generate the default action associated with that event. for example, manually firin...
... document.addeventlistener('keyup', (event) => { const keyname = event.key; // as the user releases the ctrl key, the key is no longer active, // so event.ctrlkey is false. ...
...specifications specification status comment ui eventsthe def
inition of 'keyboardevent' in that specification. working draft the keyboardevent interface specification went through numerous draft versions, first under dom events level 2 where it was dropped as no consensus arose, then under dom events level 3. this led to the implementation of non-standard
initialization methods, the early dom events level 2 version, keyboardevent.
initkeyevent() by gecko browsers and the early dom events level 3 version, keyboardevent.
initkeyboardevent() by others. both have been superseded by the modern usage of a constructor: keyboardevent(). ...
LinkStyle - Web APIs
n be created; it is implemented by htmllinkelement and htmlstyleelement objects. properties there is no inherited property. linkstyle.sheet read only returns the cssstylesheet object associated with the given element, or null if there is none. methods this interface implements no method. ...
...n element, or null if there is none. methods this interface implements no method. specifications specification status comment css object model (cssom)the def
inition of 'linkstyle' in that specification. ...
...e implements no method. specifications specification status comment css object model (cssom)the def
inition of 'linkstyle' in that specification. ...
...s no method. specifications specification status comment css object model (cssom)the def
inition of 'linkstyle' in that specification. ...
generateRequest() - Web APIs
the mediakeysession.generaterequest() method returns a promise after generating a media request based on
initialization data. syntax mediakeysession.generaterequest().then(function) { ... ...
... the mediakeysession.generaterequest() method returns a promise after generating a media request based on
initialization data. syntax mediakeysession.generaterequest().then(function) { ... ...
... the mediakeysession.generaterequest() method returns a promise after generating a media request based on
initialization data. syntax mediakeysession.generaterequest().then(function) { ... ...
... the mediakeysession.generaterequest() method returns a promise after generating a media request based on
initialization data. syntax mediakeysession.generaterequest().then(function) { ... ...
MediaQueryListEvent.MediaQueryListEvent() - Web APIs
the mediaquerylistevent constructor creates a new mediaquerylistevent instance. syntax var mymqlevent = new mediaquerylistevent(
init); parameters
init an
init object that defines features of the new object instance. the available properties are: media: a domstring representing a serialized media query. matches: a boolean representing the media query status — true if it matches, false if not. ...
... domstring representing a serialized media query. ...
...nting the media query status — true if it matches, false if not. ...
...edia query status — true if it matches, false if not. ...
MediaStreamTrack - Web APIs
ed for the track cause the track to be incompatible and therefore to not be used. also available through the onoverconstrained event handler property. unmute sent to the track when data becomes available again, ending the muted state. ...
...track when data becomes available again, ending the muted state. also available through the onunmute event handler property. specifications specification status comment identity for webrtcthe def
inition of 'isolated tracks' in that specification. ...
...ough the onunmute event handler property. specifications specification status comment identity for webrtcthe def
inition of 'isolated tracks' in that specification. ...
...unmute event handler property. specifications specification status comment identity for webrtcthe def
inition of 'isolated tracks' in that specification. ...
Node.childNodes - Web APIs
2 children: the doctype declaration and the root element, typically referred to as documentelement. (in (x)html documents this is the html element.) childnodes includes all child nodes—including non-element nodes like text and comment nodes. to get a collection of only elements, use parentnode.children instead. specifications specification status comment domthe def
inition of 'node.childnodes' in that specification. living standard no change document object model (dom) level 3 core specificationthe def
inition of 'node.childnodes' in that specification. obsolete no change document object model (dom) level 2 core specificationthe def
inition of 'node.childnodes' in that specification. obsolete no change document object m...
...ication. living standard no change document object model (dom) level 3 core specificationthe def
inition of 'node.childnodes' in that specification. obsolete no change document object model (dom) level 2 core specificationthe def
inition of 'node.childnodes' in that specification. ...
...odel (dom) level 3 core specificationthe def
inition of 'node.childnodes' in that specification. obsolete no change document object model (dom) level 2 core specificationthe def
inition of 'node.childnodes' in that specification. ...
...level 3 core specificationthe def
inition of 'node.childnodes' in that specification. obsolete no change document object model (dom) level 2 core specificationthe def
inition of 'node.childnodes' in that specification. obsolete no change document object model (dom) level 1 specificationthe def
inition of 'node.childnodes' in that specification. ...
Node.firstChild - Web APIs
og(p01.firstchild.nodename); </script> now the console will show 'span'. to avoid the issue with node.firstchild returning #text or #comment nodes, parentnode.firstelementchild can be used to return only the first element node. however, node.firstelementchild requires a shim for internet explorer 9 and earlier. specifications specification status comment domthe def
inition of 'node.firstchild' in that specification. living standard no change document object model (dom) level 3 core specificationthe def
inition of 'node.firstchild' in that specification. obsolete no change document object model (dom) level 2 core specificationthe def
inition of 'node.firstchild' in that specification. obsolete no change document object m...
...ication. living standard no change document object model (dom) level 3 core specificationthe def
inition of 'node.firstchild' in that specification. obsolete no change document object model (dom) level 2 core specificationthe def
inition of 'node.firstchild' in that specification. ...
...odel (dom) level 3 core specificationthe def
inition of 'node.firstchild' in that specification. obsolete no change document object model (dom) level 2 core specificationthe def
inition of 'node.firstchild' in that specification. ...
...level 3 core specificationthe def
inition of 'node.firstchild' in that specification. obsolete no change document object model (dom) level 2 core specificationthe def
inition of 'node.firstchild' in that specification. obsolete no change document object model (dom) level 1 specificationthe def
inition of 'node.firstchild' in that specification. ...
Node.lastChild - Web APIs
returns the last child of the node. if its parent is an element, then the child is generally an element node, a text node, or a comment node. it returns null if there are no child elements. syntax var childnode = node.lastchild; example var tr = document.getelementbyid("row1"); var corner_td = tr.lastchild; specifications specification status comment domthe def
inition of 'node.lastchild' in that specification. living standard no change document object model (dom) level 3 core specificationthe def
inition of 'node.lastchild' in that specification. obsolete no change document object model (dom) level 2 core specificationthe def
inition of 'node.lastchild' in that specification. obsolete no change document object mode...
...ification. living standard no change document object model (dom) level 3 core specificationthe def
inition of 'node.lastchild' in that specification. obsolete no change document object model (dom) level 2 core specificationthe def
inition of 'node.lastchild' in that specification. ...
...t model (dom) level 3 core specificationthe def
inition of 'node.lastchild' in that specification. obsolete no change document object model (dom) level 2 core specificationthe def
inition of 'node.lastchild' in that specification. ...
...m) level 3 core specificationthe def
inition of 'node.lastchild' in that specification. obsolete no change document object model (dom) level 2 core specificationthe def
inition of 'node.lastchild' in that specification. obsolete no change document object model (dom) level 1 specificationthe def
inition of 'node.lastchild' in that specification. ...
Node.localName - Web APIs
s lower case for both html elements in html doms and xhtml elements in xml doms. the tagname property continues to return in the upper case for html elements in html doms. ...
...se for html elements in html doms. for nodes of any type other than element_node and attribute_node localname is always null. ...
...han element_node and attribute_node localname is always null. ...
..._node and attribute_node localname is always null. ...
Node.previousSibling - Web APIs
node.firstchild or node.previoussibling may refer to a whitespace text node rather than the actual element the author intended to get. see whitespace in the dom and w3c dom 3 faq: why are some text nodes empty? for more information. to navigate the opposite way through the child nodes list use node.nextsibling. specifications specification status comment domthe def
inition of 'node.previoussibling' in that specification. living standard no change document object model (dom) level 3 core specificationthe def
inition of 'node.previoussibling' in that specification. obsolete no change document object model (dom) level 2 core specificationthe def
inition of 'node.previoussibling' in that specification. obsolete no change do...
... living standard no change document object model (dom) level 3 core specificationthe def
inition of 'node.previoussibling' in that specification. obsolete no change document object model (dom) level 2 core specificationthe def
inition of 'node.previoussibling' in that specification. ...
...l 3 core specificationthe def
inition of 'node.previoussibling' in that specification. obsolete no change document object model (dom) level 2 core specificationthe def
inition of 'node.previoussibling' in that specification. obsolete no change document object model (dom) level 1 specificationthe def
inition of 'node.previoussibling' in that specification. ...
...ecificationthe def
inition of 'node.previoussibling' in that specification. obsolete no change document object model (dom) level 2 core specificationthe def
inition of 'node.previoussibling' in that specification. obsolete no change document object model (dom) level 1 specificationthe def
inition of 'node.previoussibling' in that specification. ...
Node - Web APIs
obsolete removed the following properties: attributes, namespaceuri, prefix, and localname. removed the following methods: issupported(), hasattributes(), getfeature(), setuserdata(), and getuserdata(). document object...
...["teh", "adn", "btu", "adress", "youre", "msitakes"] const pattern = new regexp("\\b(" + typos.join("|") + ")\\b", "gi") const mistakes = grep(document.body, pattern) console.log(mistakes) specifications specification status comment domthe def
inition of 'node' in that specification. living standard added the following methods: getrootnode() dom4the def
inition of 'node' in that specification. obsolete removed the following properties: attributes, namespaceuri, prefix, and localname. removed the following methods: issupported(), hasattributes(), getfeature(), setuserdata(), and getuserdata(). document object model (dom) level 3 core specificationthe def
inition of 'node' in that specification. obsolete the methods insertbefore...
...node can also be normalized if the proper domconfiguration flag is set. added the following methods: comparedocumentposition(), issamenode(), lookupprefix(), isdefaultnamespace(), lookupnamespaceuri(), isequalnode(), getfeature(), setuserdata(), and getuserdata(). added the following properties: baseuri and textcontent. ...
...evel 2 core specificationthe def
inition of 'node' in that specification. obsolete the ownerdocument property was slightly modified so that documentfragment also returns null. added the following properties: namespaceuri, prefix, and localname. added the following methods: normalize(), issupported() and hasattributes(). document object model (dom) level 1 specificationthe def
inition of 'node' in that specification. obsolete
initial def
inition. ...
PerformanceNavigationTiming.type - Web APIs
the type read-only property returns a string representing the type of navigation. the value must be one of the following: navigate navigation started by clicking a link, entering the url in the browser's address bar, form submission, or
initializing through a script operation other than reload and back_forward as listed below. reload navigation is through the browser's reload operation or location.reload(). back_forward navigation is through the browser's history traversal operation. prerender navigation is
initiated by a prerender hint. this property is read only . syntax perfentry.type; return value a string which is one of the values listed above. example the following example illustrates this property's usage. function print_nav_timing_data() { // use geten...
... ...
... ...
... ...
PerformanceObserver.observe() - Web APIs
e specified as an array of domstring objects, each naming one entry type; the type names are documented in performance entry type names in performanceentry.entrytype. when a matching performance entry is recorded, the performance observer's callback function—set when creating the performanceobserver—is invoked. syntax observer.observe(options); parameters options a performanceobserver
init dictionary with the following possible members: entrytypes: an array of domstring objects, each specifying one performance entry type to observe. may not be used together with the "type" or "buffered" options. type: a single domstring specifying exactly one performance entry type to observe. may not be used together with the entrytypes option. buffered: a boolean flag to indicate whethe...
... ...
... ...
... ...
PerformanceObserverEntryList.getEntries() - Web APIs
nceentryfilteroptions); specific usage: entries = list.getentries({name: "entry_name", entrytype: "mark"}); parameters performanceentryfilteroptionsoptional is a performanceentryfilteroptions dictionary, having the following fields: "name", the name of a performance entry. "entrytype", the entry type. the valid entry types are listed in the performanceentry.entrytype method. "
initiatortype", the type of the
initiating resource (for example an html element). the values are defined by the performanceresourcetiming.
initiatortype interface. this parameter is currently not supported on chrome or opera. return value a list of explicitly observed performanceentry objects that meets the criteria of the filter. the items will be in chronological order based on the entries' st...
... ...
... ...
... ...
PerformanceResourceTiming - Web APIs
e interface's properties create a resource loading timeline with high-resolution timestamps for network events such as redirect start and end times, fetch start, dns lookup start and end times, response start and end times, etc.. additionally, the interface extends performanceentry with other properties which provide data about the size of the fetched resource as well as the type of resource that
initiated the fetch. <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/performanceentry" target="_top"><rect x="1" y="...
...rmanceentry.fetchstart. performanceentry.durationread only returns a timestamp that is the difference between the responseend and the starttime properties. the interface also supports the following properties which are listed in the order in which they are recorded for the fetching of a single resource. an alphabetical listing is shown in the navigation, at left. performanceresourcetiming.
initiatortyperead only a string representing the type of resource that
initiated the performance entry, as specified in performanceresourcetiming.
initiatortype. performanceresourcetiming.nexthopprotocolread only a string representing the network protocol used to fetch the resource, as identified by the alpn protocol id (rfc7301). performanceresourcetiming.workerstartread only returns a domhigh...
...stamp immediately before dispatching the fetchevent if a service worker thread is already running, or immediately before starting the service worker thread if it is not already running. if the resource is not intercepted by a service worker the property will always return 0. performanceresourcetiming.redirectstartread only a domhighrestimestamp that represents the start time of the fetch which
initiates the redirect. performanceresourcetiming.redirectendread only a domhighrestimestamp immediately after receiving the last byte of the response of the last redirect. performanceresourcetiming.fetchstartread only a domhighrestimestamp immediately before the browser starts to fetch the resource. performanceresourcetiming.domainlookupstartread only a domhighrestimestamp immediately before...
...rtimingread only an array of performanceservertiming entries containing server timing metrics. methods performanceresourcetiming.tojson() returns a domstring that is the json representation of the performanceresourcetiming object. example see the example in using the resource timing api. specifications specification status comment resource timing level 1the def
inition of 'performanceresourcetiming' in that specification. candidate recommendation
initial def
inition. ...
PointerEvent.PointerEvent() - Web APIs
width — optional and defaulting to 1, of type double, that sets the value of the instance's pointerevent.width. ...
... width — optional and defaulting to 1, of type double, that sets the value of the instance's pointerevent.width. ...
... width — optional and defaulting to 1, of type double, that sets the value of the instance's pointerevent.width. ...
...wist — optional and defaulting to 0, of type long, that sets the value of the instance's pointerevent.twist. pointertype — optional and defaulting to "", of type domstring, that sets the value of the instance's pointerevent.pointertype. isprimary — optional and defaulting to false, of type boolean, that sets the value of the instance's pointerevent.isprimary. note: the pointerevent
init dictionary also accepts fields from the mouseevent, uievent
init and event
init dictionaries. example var moveevent = new pointerevent("pointermove"); var downevent = new pointerevent("pointerdown", {pointerid: 1, bubbles: true, cancelable: true, pointertype: "touch", width: 100, height: 100, isprimary: true }); ...
PositionOptions.maximumAge - Web APIs
the positionoptions.maximumage property is a positive long value indicating the maximum age in milliseconds of a possible cached position that is acceptable to return. if set to 0, it means that the device cannot use a cached position and must attempt to retrieve the real current position. ...
...e cached position that is acceptable to return. if set to 0, it means that the device cannot use a cached position and must attempt to retrieve the real current position. if set to inf
inity the device must return a cached position regardless of its age. ...
...e cannot use a cached position and must attempt to retrieve the real current position. if set to inf
inity the device must return a cached position regardless of its age. ...
...e a cached position and must attempt to retrieve the real current position. if set to inf
inity the device must return a cached position regardless of its age. ...
PositionOptions.timeout - Web APIs
the positionoptions.timeout property is a positive long value representing the maximum length of time (in milliseconds) the device is allowed to take in order to return a position. the default value is inf
inity, meaning that getcurrentposition() won't return until the position is available. ...
...y is a positive long value representing the maximum length of time (in milliseconds) the device is allowed to take in order to return a position. the default value is inf
inity, meaning that getcurrentposition() won't return until the position is available. ...
...ds) the device is allowed to take in order to return a position. the default value is inf
inity, meaning that getcurrentposition() won't return until the position is available. ...
...ice is allowed to take in order to return a position. the default value is inf
inity, meaning that getcurrentposition() won't return until the position is available. ...
PositionOptions - Web APIs
a gps chip on a mobile device for example). on the other hand, if false, the device can take the liberty to save resources by responding more quickly and/or using less power. default: false. positionoptions.timeout secure context is a positive long value representing the maximum length of time (in milliseconds) the device is allowed to take in order to return a position. ...
...s inf
inity, meaning that getcurrentposition() won't return until the position is available. positionoptions.maximumage secure context is a positive long value indicating the maximum age in milliseconds of a possible cached position that is acceptable to return. if set to 0, it means that the device cannot use a cached position and must attempt to retrieve the real current position. if set to inf
inity the device must return a cached position regardless of its age. default: 0. specifications specification status comment geolocation apithe def
inition of 'positionoptions' in that specification. ...
... to return. if set to 0, it means that the device cannot use a cached position and must attempt to retrieve the real current position. if set to inf
inity the device must return a cached position regardless of its age. default: 0. ...
... if set to 0, it means that the device cannot use a cached position and must attempt to retrieve the real current position. if set to inf
inity the device must return a cached position regardless of its age. default: 0. ...
RTCDtlsTransport.state - Web APIs
the state read-only property of the rtcdtlstransport interface provides information which describes a datagram transport layer security (dtls) transport state. syntax let 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. 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 er...
... ...
... ...
... ...
RTCDtlsTransport - Web APIs
t'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 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 encapsu...
... ...
... ...
... ...
RTCIceCandidate.RTCIceCandidate() - Web APIs
the rtcicecandidate() constructor creates and returns a new rtcicecandidate object, which can be configured to represent a single ice candidate. syntax candidate = new rtcicecandidate([candidateinfo]); parameters candidateinfo optional an optional rtcicecandidate
init object providing information about the candidate; if this is provided, the candidate is
initialized configured to represent the described candidate. return value a newly-created rtcicecandidate object, optionally configured based on the specified object based on the rtcicecandidate
init dictionary. if candidateinfo is provided, the new rtcicecandidate is
initialized as follows: each member of the rtcicecandidate
init object is
initialized to the value of the property by the same name from rtcicecandidate
init. this inc...
...ent properties. the candidate string (which is sdp text) is parsed; each property found is stored in the corresponding field in the rtcicecandidate. if any of the fields is invalid, parsing of the string silently aborts without throwing an exception. the default value of candidate is the empty string, which indicates that the candidate is an "end-of-candidates" message. ...
...age. the following fields are
initialized to null if they are not included in the rtcicecandidate.candidate property: foundation, component, priority , ip, protocol, port, type, tcptype, relatedaddress, and relatedport. note: parsing of the candidate string is performed using the candidate-attribute grammar from the webrtc specification. exceptions typeerror the specified rtcicecandidate
init has values of null in both the sdpmid and sdpmlineindex properties. usage notes this constructor does not do complete validation of the specified candidateinfo object or string. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcicecandidate()' in that specification. ...
...
init has values of null in both the sdpmid and sdpmlineindex properties. usage notes this constructor does not do complete validation of the specified candidateinfo object or string. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcicecandidate()' in that specification. candidate recommendation
initial def
inition. ...
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. the return value is a promise which, when the offer has been created, is resolved with a rtcsessiondescription object containing the newly-created offer. ...
...ing the newly-created offer. errorcallback an rtcpeerconnectionerrorcallback which will be passed a single domexception object explaining why the request to create an offer failed. options optional an optional rtcofferoptions dictionary providing options requested for the offer. return value a promise whose fulfillment handler will receive an object conforming to the rtcsessiondescription
init dictionary which contains the sdp describing the generated offer. that received offer should be delivered through the signaling server to a remote peer. exceptions these exceptions are returned by rejecting the returned promise. your rejection handler should examine the received exception to determine which occurred. invalidstateerror the rtcpeerconnection is closed. notreadableerror no c...
...once that's done, the offer is sent to the remote system over the signaling channel; in this case, by using a custom function called sendtoserver(). the implementation of the signaling server is independent from the webrtc specification, so it doesn't matter how the offer is sent as long as both the caller and potential receiver are using the same one. use promise.ca...
...th the caller and potential receiver are using the same one. use promise.catch() to trap and handle errors. see signaling and video calling for the complete example from which this snippet is derived; this will help you to understand how the signaling code here works. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'createoffer()' in that specification. candidate recommendation
initial def
inition. ...
RTCRtpStreamStats.qpSum - Web APIs
...
... ...
... ...
... = stats.framesencoded; break; default: return 0; } return status.qpsum / framecount; } specifications specification status comment identifiers for webrtc's statistics apithe def
inition of 'rtcinboundrtpstreamstats: qpsum' in that specification. candidate recommendation
initial def
inition. identifiers for webrtc's statistics apithe def
inition of 'rtcoutboundrtpstreamstats: qpsum' in that specification. candidate recommendation
initial def
inition. ...
Request.mode - Web APIs
rious apis offered by 3rd party vendors. these are expected to adhere to the cors protocol. only a limited set of headers are exposed in the response, but the body is readable. navigate — a mode for supporting navigation. the navigate value is intended to be used only by html navigation. a navigate request is created only while navigating between documents. default mode requests can be
initiated in a variety of ways, and the mode for a request depends on the particular means by which it was
initiated. for example, when a request object is created using the request.request constructor, the value of the mode property for that request is set to cors. however, for requests created other than by the request.request constructor, no-cors is typically used as the mode; for example, for em...
...de for a request depends on the particular means by which it was
initiated. for example, when a request object is created using the request.request constructor, the value of the mode property for that request is set to cors. however, for requests created other than by the request.request constructor, no-cors is typically used as the mode; for example, for embedded resources where the request is
initiated from markup, unless the crossorigin attribute is present, the request is in most cases made using the no-cors mode — that is, for the <link> or <script> elements (except when used with modules), or <img>, <audio>, <video>, <object>, <embed>, or <iframe> elements. example in the following snippet, we create a new request using the request.request() constructor (for an image file in the sa...
...rame> elements. ...
... new request using the request.request() constructor (for an image file in the same directory as the script), then save the request mode in a variable: var myrequest = new request('flowers.jpg'); var mymode = myrequest.mode; // returns "cors" by default specifications specification status comment fetchthe def
inition of 'mode' in that specification. living standard
initial def
inition ...
ResizeObserver() - Web APIs
svgelement. syntax var resizeobserver = new resizeobserver(callback) parameters callback the function called whenever an observed resize occurs. the function is called with two parameters: entries an array of resizeobserverentry objects that can be used to access the new dimensions of the element after each change. observer a reference to the resizeobserver itself, so it will def
initely be accessible from inside the callback, should you need it. this could be used for example to automatically unobserve the observer when a certain condition is reached, but you can omit it if you don't need it. the callback will generally follow a pattern along the lines of: function(entries, observer) { for (let entry of entries) { // do something to each entry // and possibly ...
... ...
... ...
... ...
SVGAngle - Web APIs
or when the object itself is read only. converttospecifiedunits preserve the same underlying stored value, but reset the stored unit identifier to the given unittype. ...
...ject attributes unittype, valueinspecifiedunits, and valueasstring might be modified as a result of this method. ...
...ight be modified as a result of this method. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgelement' in that specification. candidate recommendation adds the dataset property. ...
...ified as a result of this method. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgelement' in that specification. candidate recommendation adds the dataset property. ...
SVGAnimateElement - Web APIs
teelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its parent, svganimationelement. ...
...animationelement. methods this interface has no methods but inherits methods from its parent, svganimationelement. specifications specification status comment svg animations level 2the def
inition of 'svganimateelement' in that specification. ...
...ods from its parent, svganimationelement. specifications specification status comment svg animations level 2the def
inition of 'svganimateelement' in that specification. editor's draft removed the inheritance from svgstylable. ...
...s parent, svganimationelement. specifications specification status comment svg animations level 2the def
inition of 'svganimateelement' in that specification. editor's draft removed the inheritance from svgstylable. ...
SVGAnimateMotionElement - Web APIs
onelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its parent, svganimationelement. ...
...rties from its parent, svganimationelement. methods this interface has no methods but inherits methods from its parent, svganimationelement. ...
...ds but inherits methods from its parent, svganimationelement. specifications specification status comment svg animations level 2the def
inition of 'svganimatemotionelement' in that specification. ...
...rits methods from its parent, svganimationelement. specifications specification status comment svg animations level 2the def
inition of 'svganimatemotionelement' in that specification. ...
SVGAnimateTransformElement - Web APIs
rmelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties but inherits properties from its parent, svganimationelement. ...
...es from its parent, svganimationelement. methods this interface has no methods but inherits methods from its parent, svganimationelement. ...
... inherits methods from its parent, svganimationelement. specifications specification status comment svg animations level 2the def
inition of 'svganimatetransformelement' in that specification. ...
...ethods from its parent, svganimationelement. specifications specification status comment svg animations level 2the def
inition of 'svganimatetransformelement' in that specification. ...
targetElement - Web APIs
the svganimationelement.targetelement property refers to the element which is being animated. if no target element is being animated (for example, because the href attribute specifies an unknown element), the value returned is null. ...
...is null. syntax var targetelement = someelement.targetelement; specifications specification status comment svg animations level 2the def
inition of 'svganimationelement.targetelement' in that specification. editor's draft added null as return value in case that no target element is being animated. ...
... specification status comment svg animations level 2the def
inition of 'svganimationelement.targetelement' in that specification. editor's draft added null as return value in case that no target element is being animated. ...
...ion status comment svg animations level 2the def
inition of 'svganimationelement.targetelement' in that specification. editor's draft added null as return value in case that no target element is being animated. ...
SVGClipPathElement - Web APIs
lippathunits read only an svganimatedenumeration corresponding to the clippathunits attribute of the given <clippath> element. takes one of the constants defined in svgunittypes. methods this interface doesn't implement any specific methods, but inherits methods from its parent, svgelement. ...
... svgelement. specifications specification status comment css masking module level 1the def
inition of 'svgclippathelement' in that specification. ...
... css masking module level 1the def
inition of 'svgclippathelement' in that specification. candidate recommendation removed the inheritance from svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, svgtransformable, and svgunittypes scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgclippathelement' in that specification. ...
...masking module level 1the def
inition of 'svgclippathelement' in that specification. candidate recommendation removed the inheritance from svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, svgtransformable, and svgunittypes scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgclippathelement' in that specification. ...
SVGComponentTransferFunctionElement - Web APIs
he exponent attribute of the given element. svgcomponenttransferfunctionelement.offset read only an svganimatednumber corresponding to the offset attribute of the given element. ...
...en element. methods this interface does not provide any specific methods, but implements those of its parent, svgelement. ...
...hose of its parent, svgelement. specifications specification status comment filter effects module level 1the def
inition of 'svgcomponenttransferfunctionelement' in that specification. ...
... parent, svgelement. specifications specification status comment filter effects module level 1the def
inition of 'svgcomponenttransferfunctionelement' in that specification. ...
SVGDefsElement - Web APIs
95dd; pointer-events: all;} properties this interface doesn't implement any specific properties, but inherits properties from its parent, svggraphicselement. methods this interface doesn't implement any specific methods, but inherits properties from its parent, svggraphicselement. ...
...cations specification status comment scalable vector graphics (svg) 2the def
inition of 'svgdefselement' in that specification. ...
...ector graphics (svg) 2the def
inition of 'svgdefselement' in that specification. candidate recommendation replaced the inheritance from svgelementsvgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable by svggraphicselement scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgdefselement' in that specification. ...
...ics (svg) 2the def
inition of 'svgdefselement' in that specification. candidate recommendation replaced the inheritance from svgelementsvgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable by svggraphicselement scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgdefselement' in that specification. ...
SVGDescElement - Web APIs
le">svgdescelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface also inherits properties from its parent, svggeometryelement. methods this interface has no methods but inherits methods from its parent, svggeometryelement. ...
... interface has no methods but inherits methods from its parent, svggeometryelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgdescelement' in that specification. ...
...tryelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgdescelement' in that specification. ...
... specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgdescelement' in that specification. ...
SVGElement - Web APIs
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. ...
...hen the dom implementation removes an svg document from a window or frame. also available via the onunload property. ...
...frame. also available via the onunload property. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgelement' in that specification. candidate recommendation adds the dataset property. ...
...o available via the onunload property. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgelement' in that specification. candidate recommendation adds the dataset property. ...
SVGFEBlendElement - Web APIs
the mode attribute of the given element. it takes one of the svg_feblend_mode_* constants defined on this interface. ...
... provide any specific methods, but implements those of its parent, svgelement, and implements methods of svgfilterprimitivestandardattributes. ...
...nt, and implements methods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfeblendelement' in that specification. ...
...lements methods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfeblendelement' in that specification. ...
SVGFEColorMatrixElement - Web APIs
lement.values read only an svganimatednumberlist corresponding to the values attribute of the given element. ...
... specific methods, but implements those of its parent, svgelement , and also implements methods of svgfilterprimitivestandardattributes. ...
...ements methods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfecolormatrixelement' in that specification. ...
...ods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfecolormatrixelement' in that specification. ...
SVGFEComponentTransferElement - Web APIs
omponenttransferelement.in1 read only an svganimatedstring corresponding to the in attribute of the given element. ...
... specific methods, but implements those of its parent, svgelement, and implements methods of svgfilterprimitivestandardattributes. ...
...ds of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfecomponenttransferelement' in that specification. ...
...lterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfecomponenttransferelement' in that specification. ...
SVGFECompositeElement - Web APIs
element.values read only an svganimatednumberlist corresponding to the values attribute of the given element. ...
...any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes. ...
...implements methods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfecompositeelement' in that specification. ...
...methods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfecompositeelement' in that specification. ...
SVGFEConvolveMatrixElement - Web APIs
servealpha read only an svganimatedboolean corresponding to the preservealpha attribute of the given element. ...
...pecific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes. ...
... methods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfeconvolvematrixelement' in that specification. ...
... svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfeconvolvematrixelement' in that specification. ...
SVGFEDiffuseLightingElement - Web APIs
an svganimatednumber corresponding to the y component of the kernelunitlength attribute of the given element. ...
...ecific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes. ...
...ethods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfediffuselightingelement' in that specification. ...
...vgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfediffuselightingelement' in that specification. ...
SVGFEDisplacementMapElement - Web APIs
elselect attribute of the given element. it takes one of the svg_channel_* constants defined on this interface. ...
...ecific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes. ...
...ethods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfedisplacementmapelement' in that specification. ...
...vgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfedisplacementmapelement' in that specification. ...
SVGFEDistantLightElement - Web APIs
g to the azimuth attribute of the given element. svgfedistantlightelement.elevation read only an svganimatednumber corresponding to the elevation attribute of the given element. ...
... of the given element. methods this interface does not provide any specific methods, but implements those of its parent, svgelement. ...
...hods, but implements those of its parent, svgelement. specifications specification status comment filter effects module level 1the def
inition of 'svgfedistantlightelement' in that specification. ...
...mplements those of its parent, svgelement. specifications specification status comment filter effects module level 1the def
inition of 'svgfedistantlightelement' in that specification. ...
SVGFEFloodElement - Web APIs
its parent interface, svgelement, and implements properties from svgfilterprimitivestandardattributes. ...
...pecific methods, but inherits methods from its parent interface, svgelement, and implements methods from svgfilterprimitivestandardattributes. ...
..., and implements methods from svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfefloodelement' in that specification. ...
...ments methods from svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfefloodelement' in that specification. ...
SVGFEFuncAElement - Web APIs
properties this interface not provide any specific properties, but inherits properties from its parent interface, svgcomponenttransferfunctionelement. ...
...ment. methods this interface does not provide any specific methods, but implements those of its parent, svgcomponenttransferfunctionelement. ...
...mplements those of its parent, svgcomponenttransferfunctionelement. specifications specification status comment filter effects module level 1the def
inition of 'svgfefuncaelement' in that specification. ...
...hose of its parent, svgcomponenttransferfunctionelement. specifications specification status comment filter effects module level 1the def
inition of 'svgfefuncaelement' in that specification. ...
SVGFEFuncBElement - Web APIs
properties this interface not provide any specific properties, but inherits properties from its parent interface, svgcomponenttransferfunctionelement. ...
...ment. methods this interface does not provide any specific methods, but implements those of its parent, svgcomponenttransferfunctionelement. ...
...mplements those of its parent, svgcomponenttransferfunctionelement. specifications specification status comment filter effects module level 1the def
inition of 'svgfefuncbelement' in that specification. ...
...hose of its parent, svgcomponenttransferfunctionelement. specifications specification status comment filter effects module level 1the def
inition of 'svgfefuncbelement' in that specification. ...
SVGFEFuncGElement - Web APIs
properties this interface not provide any specific properties, but inherits properties from its parent interface, svgcomponenttransferfunctionelement. ...
...ment. methods this interface does not provide any specific methods, but implements those of its parent, svgcomponenttransferfunctionelement. ...
...mplements those of its parent, svgcomponenttransferfunctionelement. specifications specification status comment filter effects module level 1the def
inition of 'svgfefuncgelement' in that specification. ...
...hose of its parent, svgcomponenttransferfunctionelement. specifications specification status comment filter effects module level 1the def
inition of 'svgfefuncgelement' in that specification. ...
SVGFEFuncRElement - Web APIs
properties this interface not provide any specific properties, but inherits properties from its parent interface, svgcomponenttransferfunctionelement. ...
...ment. methods this interface does not provide any specific methods, but implements those of its parent, svgcomponenttransferfunctionelement. ...
...mplements those of its parent, svgcomponenttransferfunctionelement. specifications specification status comment filter effects module level 1the def
inition of 'svgfefuncrelement' in that specification. ...
...hose of its parent, svgcomponenttransferfunctionelement. specifications specification status comment filter effects module level 1the def
inition of 'svgfefuncrelement' in that specification. ...
SVGFEGaussianBlurElement - Web APIs
e svg_edgemode_* constants defined on this interface. methods this interface also inherits methods of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes. ...
...itivestandardattributes. svgfegaussianblurelement.setstddeviation() sets the values for the stddeviation attribute. ...
...alues for the stddeviation attribute. specifications specification status comment filter effects module level 1the def
inition of 'svgfegaussianblurelement' in that specification. working draft added edgemode property. ...
...he stddeviation attribute. specifications specification status comment filter effects module level 1the def
inition of 'svgfegaussianblurelement' in that specification. working draft added edgemode property. ...
SVGFEImageElement - Web APIs
atedstring reflects the crossorigin attribute of the given element, limited to only known values. ...
...ic methods, but implements those of its parent, svgelement, and implements methods of svgfilterprimitivestandardattributesand svgurireference. ...
...methods of svgfilterprimitivestandardattributesand svgurireference. specifications specification status comment filter effects module level 1the def
inition of 'svgfeimageelement' in that specification. ...
...svgfilterprimitivestandardattributesand svgurireference. specifications specification status comment filter effects module level 1the def
inition of 'svgfeimageelement' in that specification. ...
SVGFEMergeElement - Web APIs
s from its parent interface, svgelement, and also implements properties of svgfilterprimitivestandardattributes. ...
...ide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes. ...
...nd also implements methods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfemergeelement' in that specification. ...
...lements methods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfemergeelement' in that specification. ...
SVGFEMergeNodeElement - Web APIs
lso inherits properties from its parent interface, svgelement. svgfemergenodeelement.in1 read only an svganimatedstring corresponding to the in attribute of the given element. ...
...ute of the given element. methods this interface does not provide any specific methods, but implements those of its parent, svgelement. ...
...ic methods, but implements those of its parent, svgelement. specifications specification status comment filter effects module level 1the def
inition of 'svgfemergenodeelement' in that specification. ...
... but implements those of its parent, svgelement. specifications specification status comment filter effects module level 1the def
inition of 'svgfemergenodeelement' in that specification. ...
SVGFEMorphologyElement - Web APIs
read only an svganimatednumber corresponding to the y component of the radius attribute of the given element. ...
...ny specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes. ...
...plements methods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfemorphologyelement' in that specification. ...
...thods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfemorphologyelement' in that specification. ...
SVGFEOffsetElement - Web APIs
svgfeoffsetelement.dy read only an svganimatednumber corresponding to the dy attribute of the given element. ...
...de any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes. ...
... also implements methods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfeoffsetelement' in that specification. ...
...ments methods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfeoffsetelement' in that specification. ...
SVGFEPointLightElement - Web APIs
matednumber corresponding to the y attribute of the given element. svgfepointlightelement.z read only an svganimatednumber corresponding to the z attribute of the given element. ...
...te of the given element. methods this interface does not provide any specific methods, but implements those of its parent, svgelement. ...
... methods, but implements those of its parent, svgelement. specifications specification status comment filter effects module level 1the def
inition of 'svgfepointlightelement' in that specification. ...
...ut implements those of its parent, svgelement. specifications specification status comment filter effects module level 1the def
inition of 'svgfepointlightelement' in that specification. ...
SVGFESpecularLightingElement - Web APIs
an svganimatednumber corresponding to the y component of the kernelunitlength attribute of the given element. ...
...cific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes. ...
...hods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfespecularlightingelement' in that specification. ...
...filterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfespecularlightingelement' in that specification. ...
SVGFESpotLightElement - Web APIs
ent attribute of the given element. svgfespotlightelement.limitingconeangle read only an svganimatednumber corresponding to the limitingconeangle attribute of the given element. ...
...ute of the given element. methods this interface does not provide any specific methods, but implements those of its parent, svgelement. ...
...ic methods, but implements those of its parent, svgelement. specifications specification status comment filter effects module level 1the def
inition of 'svgfespotlightelement' in that specification. ...
... but implements those of its parent, svgelement. specifications specification status comment filter effects module level 1the def
inition of 'svgfespotlightelement' in that specification. ...
SVGFETileElement - Web APIs
svgfetileelement.in1 read only an svganimatedstring corresponding to the in attribute of the given element. ...
...vide any specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes. ...
... and also implements methods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfetileelement' in that specification. ...
...mplements methods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfetileelement' in that specification. ...
SVGFETurbulenceElement - Web APIs
attribute of the given element. it takes one of the svg_turbulence_type_* constants defined on this interface. ...
...ny specific methods, but implements those of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes. ...
...plements methods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfeturbulenceelement' in that specification. ...
...thods of svgfilterprimitivestandardattributes. specifications specification status comment filter effects module level 1the def
inition of 'svgfeturbulenceelement' in that specification. ...
SVGFilterElement - Web APIs
terres attribute of the given <filter> element. svgfilterelement.filterresy read only an svganimatedinteger that contains the y component of the filterres attribute of the given <filter> element. methods svgfilterelement.setfilterres() sets the values of the filterres attribute. ...
...ttribute. specifications specification status comment filter effects module level 1the def
inition of 'svgfilterelement' in that specification. ...
... filter effects module level 1the def
inition of 'svgfilterelement' in that specification. working draft removed the inheritance from svglangspace, svgexternalresourcesrequired, svgstylable, and svgunittypes and removed the setfilterres() function scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgfilterelement' in that specification. ...
...er effects module level 1the def
inition of 'svgfilterelement' in that specification. working draft removed the inheritance from svglangspace, svgexternalresourcesrequired, svgstylable, and svgunittypes and removed the setfilterres() function scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgfilterelement' in that specification. ...
SVGFilterPrimitiveStandardAttributes - Web APIs
ad only an svganimatedlength corresponding to the height attribute of the given element. svgfilterprimitivestandardattributes.result read only an svganimatedstring corresponding to the result attribute of the given element. ...
...orresponding to the result attribute of the given element. methods this interface does not provide any specific methods. ...
...provide any specific methods. specifications specification status comment filter effects module level 1the def
inition of 'svgfilterprimitivestandardattributes' in that specification. ...
... specific methods. specifications specification status comment filter effects module level 1the def
inition of 'svgfilterprimitivestandardattributes' in that specification. ...
SVGGradientElement - Web APIs
preadmethod read only returns an svganimatedenumeration corresponding to attribute spreadmethod on the given element. one of the spread method types defined on this interface. methods this interface does not provide any specific methods, but implements those of its parent, svgelement. ...
...thods, but implements those of its parent, svgelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svggradientelement' in that specification. ...
... specification status comment scalable vector graphics (svg) 2the def
inition of 'svggradientelement' in that specification. ...
...ication status comment scalable vector graphics (svg) 2the def
inition of 'svggradientelement' in that specification. ...
SVGGraphicsElement: cut event - Web APIs
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(). ...
...ifying the clipboard must also manually remove the selection from the document. the handler cannot read the clipboard data. ...
...ipboard data. ...
...a. ...
SVGImageElement.preserveAspectRatio - Web APIs
property of the svgimageelement interface returns an svganimatedpreserveaspectratio corresponding to the preserveaspectratio attribute of the given <image> element. ...
... element. syntax var svganimatedpreerveaspectratio = svgimageelement.preserveaspectratio; value an svganimatedpreserveaspectratio. ...
...veaspectratio; value an svganimatedpreserveaspectratio. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'preserveaspectratio' in that specification. ...
...io; value an svganimatedpreserveaspectratio. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'preserveaspectratio' in that specification. ...
SVGImageElement - Web APIs
width attribute of the given <image> element. svgimageelement.x read only an svganimatedlength corresponding to the x attribute of the given <image> element. svgimageelement.y read only an svganimatedlength corresponding to the y attribute of the given <image> element. methods this interface also inherits methods from its parent interface, svggraphicselement. svgimageelement.decode()
initiates asynchronous decoding of the image data. returns a promise which resolves once the image data is ready to be used. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgimageelement' in that specification. candidate recommendation changed the inheritance from svgelement to svggraphicselement, removed the implemented...
...ctor graphics (svg) 2the def
inition of 'svgimageelement' in that specification. candidate recommendation changed the inheritance from svgelement to svggraphicselement, removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable and added the crossorigin property. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgimageelement' in that specification. ...
...ation. ...
...andidate recommendation changed the inheritance from svgelement to svggraphicselement, removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable and added the crossorigin property. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgimageelement' in that specification. recommendation
initial def
inition ...
SVGLinearGradientElement - Web APIs
eargradient> element. svglineargradientelement.y2 read only an svganimatedlength corresponding to the y2 attribute of the given <lineargradient> element. ...
...his interface doesn't implement any specific methods, but inherits methods from its parent interface, svggradientelement. ...
...s parent interface, svggradientelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svglineargradientelement' in that specification. ...
...terface, svggradientelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svglineargradientelement' in that specification. ...
SVGMPathElement - Web APIs
fill: #0095dd; pointer-events: all;} properties this interface doesn't implement any specific properties, but inherits properties from its parent interface, svgelement. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. ...
...sn't implement any specific methods, but inherits methods from its parent interface, svgelement. specifications specification status comment svg animations level 2the def
inition of 'svgmpathelement' in that specification. ...
... interface, svgelement. specifications specification status comment svg animations level 2the def
inition of 'svgmpathelement' in that specification. editor's draft removed the implemented interface svgexternalresourcesrequired. ...
... svgelement. specifications specification status comment svg animations level 2the def
inition of 'svgmpathelement' in that specification. editor's draft removed the implemented interface svgexternalresourcesrequired. ...
SVGMaskElement - Web APIs
he width attribute of the given <mask> element. svgmaskelement.height read only an svganimatedlength corresponding to the height attribute of the given <mask> element. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. ...
... interface, svgelement. specifications specification status comment css masking module level 1the def
inition of 'svgmaskelement' in that specification. candidate recommendation removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable. ...
...s comment css masking module level 1the def
inition of 'svgmaskelement' in that specification. candidate recommendation removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable. ...
...t css masking module level 1the def
inition of 'svgmaskelement' in that specification. candidate recommendation removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgmaskelement' in that specification. ...
SVGMetadataElement - Web APIs
5dd; pointer-events: all;} properties this interface doesn't implement any specific properties, but inherits properties from its parent interface, svgelement. ...
...t. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. ...
...rits methods from its parent interface, svgelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgmetadataelement' in that specification. ...
...s from its parent interface, svgelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgmetadataelement' in that specification. ...
SVGNumber - Web APIs
ption being thrown. properties svgnumber.value a float representing the number. note: if the svgnumber is read-only, a domexception with the code no_modification_allowed_err is raised on an attempt to change the value. ...
..._modification_allowed_err is raised on an attempt to change the value. methods this interface doesn't provide any specific methods. ...
...ue. methods this interface doesn't provide any specific methods. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgnumber' in that specification. ...
...hods this interface doesn't provide any specific methods. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgnumber' in that specification. ...
SVGPathElement - Web APIs
object. svgpathelement.createsvgpathsegcurvetoquadraticsmoothabs() returns a stand-alone, parentless svgpathsegcurvetoquadraticsmoothabs object. svgpathelement.createsvgpathsegcurvetoquadraticsmoothrel() returns a stand-alone, parentless svgpathsegcurvetoquadraticsmoothrel object. ...
...ation status comment scalable vector graphics (svg) 2the def
inition 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. ...
...def
inition 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 def
inition of 'svgpathelement' in that specification. ...
...of 'svgpathelement' in that specification. ...
SVGPatternElement - Web APIs
y an svganimatedenumeration corresponding to the height attribute of the given <pattern> element. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement and implements the ones from svgfittoviewbox and svgurireference. ...
...gurireference. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgpatternelement' in that specification. candidate recommendation removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable. ...
... scalable vector graphics (svg) 2the def
inition of 'svgpatternelement' in that specification. candidate recommendation removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgpatternelement' in that specification. ...
...calable vector graphics (svg) 2the def
inition of 'svgpatternelement' in that specification. candidate recommendation removed the implemented interfaces svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgpatternelement' in that specification. ...
SVGPolygonElement - Web APIs
interface doesn't implement any specific properties, but inherits properties from its parent, svggeometryelement and also implements properties from svganimatedpoints. methods this interface doesn't implement any specific methods, but inherits methods from its parent, svggeometryelement. ...
...ions specification status comment scalable vector graphics (svg) 2the def
inition of 'svgpolygonelement' in that specification. ...
...graphics (svg) 2the def
inition of 'svgpolygonelement' in that specification. candidate recommendation replaced the inheritance from svgelementsvgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable by svggeometryelement scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgpolygonelement' in that specification. ...
...vg) 2the def
inition of 'svgpolygonelement' in that specification. candidate recommendation replaced the inheritance from svgelementsvgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable by svggeometryelement scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgpolygonelement' in that specification. ...
SVGPolylineElement - Web APIs
interface doesn't implement any specific properties, but inherits properties from its parent, svggeometryelement and also implements properties from svganimatedpoints. methods this interface doesn't implement any specific methods, but inherits methods from its parent, svggeometryelement. ...
...ons specification status comment scalable vector graphics (svg) 2the def
inition of 'svgpolylineelement' in that specification. ...
...aphics (svg) 2the def
inition of 'svgpolylineelement' in that specification. candidate recommendation replaced the inheritance from svgelementsvgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable by svggeometryelement scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgpolylineelement' in that specification. ...
...) 2the def
inition of 'svgpolylineelement' in that specification. candidate recommendation replaced the inheritance from svgelementsvgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable by svggeometryelement scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgpolylineelement' in that specification. ...
SVGRadialGradientElement - Web APIs
ialgradient> element. svgradialgradientelement.fy read only an svganimatedlength corresponding to the fy attribute of the given <radialgradient> element. ...
...his interface doesn't implement any specific methods, but inherits methods from its parent interface, svggradientelement. ...
...s parent interface, svggradientelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgradialgradientelement' in that specification. ...
...terface, svggradientelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgradialgradientelement' in that specification. ...
SVGRect - Web APIs
alue of zero disables rendering of the element svgrect.height this represents the height of the rectangle.a value that is negative results to an error.a value of zero disables rendering of the element. ...
...of the element. methods this interface also inherits properties from its parent, domrectreadonly. specifications specification status comment geometry interfaces module level 1the def
inition of 'domrect' in that specification. ...
...s from its parent, domrectreadonly. specifications specification status comment geometry interfaces module level 1the def
inition of 'domrect' in that specification. candidate recommendation changed svgrect as a legacy alias of domrect. ...
...parent, domrectreadonly. specifications specification status comment geometry interfaces module level 1the def
inition of 'domrect' in that specification. candidate recommendation changed svgrect as a legacy alias of domrect. ...
SVGRectElement - Web APIs
t function dorectclick(){ var myrect = document.getelementbyid('myrect'); var r = math.floor(math.random() * 255); var g = math.floor(math.random() * 255); var b = math.floor(math.random() * 255); myrect.style.fill = 'rgb(' + r + ', ' + g + ' , ' + b + ')'; } click the rect. ...
...cations specification status comment scalable vector graphics (svg) 2the def
inition of 'svgrectelement' in that specification. ...
...ector graphics (svg) 2the def
inition of 'svgrectelement' in that specification. candidate recommendation replaced the inheritance from svgelementsvgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable by svggeometryelement scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgrectelement' in that specification. ...
...ics (svg) 2the def
inition of 'svgrectelement' in that specification. candidate recommendation replaced the inheritance from svgelementsvgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable by svggeometryelement scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgrectelement' in that specification. ...
SVGScriptElement - Web APIs
e the value of a read only attribut. svgscriptelement.crossorigin read only a domstring corresponding to the crossorigin attribute of the given <script> element. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. ...
...s from its parent interface, svgelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgscriptelement' in that specification. candidate recommendation removed the implemented interface svgexternalresourcesrequired and added the crossorigin property. ...
...cation status comment scalable vector graphics (svg) 2the def
inition of 'svgscriptelement' in that specification. candidate recommendation removed the implemented interface svgexternalresourcesrequired and added the crossorigin property. ...
...tatus comment scalable vector graphics (svg) 2the def
inition of 'svgscriptelement' in that specification. candidate recommendation removed the implemented interface svgexternalresourcesrequired and added the crossorigin property. ...
SVGSetElement - Web APIs
nter-events: all;} properties this interface doesn't implement any specific properties, but inherits properties from its parent interface, svganimationelement. ...
...ganimationelement. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svganimationelement. ...
...fic methods, but inherits methods from its parent interface, svganimationelement. specifications specification status comment svg animations level 2the def
inition of 'svgsetelement' in that specification. ...
..., but inherits methods from its parent interface, svganimationelement. specifications specification status comment svg animations level 2the def
inition of 'svgsetelement' in that specification. ...
SVGStopElement - Web APIs
ts properties from its parent interface, svgelement. svgstopelement.offset read only an svganimatednumber corresponding to the offset of the given element. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. ...
...doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgstopelement' in that specification. ...
...rent interface, svgelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgstopelement' in that specification. candidate recommendation removed inheritance from svgstylable. ...
...ace, svgelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgstopelement' in that specification. candidate recommendation removed inheritance from svgstylable. ...
SVGStyleElement - Web APIs
ification_allowed_err on an attempt to change the value of a read-only attribute. this restriction was removed in svg 2. ...
...thods, but inherits methods from its parent interface, svgelement and implements methods from linkstyle. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgstyleelement' in that specification. ...
...lements methods from linkstyle. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgstyleelement' in that specification. candidate recommendation added inheritance of linkstyle. ...
...hods from linkstyle. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgstyleelement' in that specification. candidate recommendation added inheritance of linkstyle. ...
SVGSymbolElement - Web APIs
herits properties from its parent interface, svggraphicselement, and implements properties from svgfittoviewbox. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggraphicselement, and implements methods from svgfittoviewbox. ...
... specification status comment scalable vector graphics (svg) 2the def
inition of 'svgsymbolelement' in that specification. candidate recommendation changed the inheritance from svgelement to svggraphicselement and removed the implemented interfaces svglangspace, svgexternalresourcesrequired, and svgstylable. ...
...svg) 2the def
inition of 'svgsymbolelement' in that specification. candidate recommendation changed the inheritance from svgelement to svggraphicselement and removed the implemented interfaces svglangspace, svgexternalresourcesrequired, and svgstylable. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgsymbolelement' in that specification. ...
...ef
inition of 'svgsymbolelement' in that specification. candidate recommendation changed the inheritance from svgelement to svggraphicselement and removed the implemented interfaces svglangspace, svgexternalresourcesrequired, and svgstylable. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgsymbolelement' in that specification. ...
SVGTSpanElement - Web APIs
nt</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface doesn't provide any specific properties, but inherits the properties from its parent, svgtextpositioningelement. ...
...nherits the properties from its parent, svgtextpositioningelement. methods this interface doesn't provide any specific methods. ...
...ds this interface doesn't provide any specific methods. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgtspanelement' in that specification. ...
...terface doesn't provide any specific methods. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgtspanelement' in that specification. ...
SVGTests - Web APIs
nsions attribute of the given element. svgtests.systemlanguage read only an svgstringlist corresponding to the systemlanguage attribute of the given element. methods svgtests.hasextension() read only returns true if the browser supports the given extension, specified by a uri. ...
...nly returns true if the browser supports the given extension, specified by a uri. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgtests' in that specification. ...
...specified by a uri. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgtests' in that specification. candidate recommendation removed requiredfeatures property and hasextension() method. ...
...y a uri. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgtests' in that specification. candidate recommendation removed requiredfeatures property and hasextension() method. ...
SVGTextElement - Web APIs
properties this interface doesn't implement any specific properties, but inherits properties from its parent interface, svgtextpositioningelement. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgtextpositioningelement. ...
...cific methods, but inherits methods from its parent interface, svgtextpositioningelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgtextelement' in that specification. ...
...sitioningelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgtextelement' in that specification. candidate recommendation removed the implemented interface svgtransformable. ...
...ement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgtextelement' in that specification. candidate recommendation removed the implemented interface svgtransformable. ...
SVGTextPathElement - Web APIs
pacing attribute of the given element. it takes one of the textpath_spacingtype_* constants defined on this interface. ...
...ny specific methods, but implements those of its parent, svgtextcontentelement, and also implements methods of svgurireference. ...
...nt, and also implements methods of svgurireference. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgtextpathelement' in that specification. ...
...o implements methods of svgurireference. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgtextpathelement' in that specification. ...
SVGTextPositioningElement - Web APIs
attribute of the given element. svgtextpositioningelement.rotate read only returns an svganimatednumberlist reflecting the rotate attribute of the given element. ...
...thods this interface doesn't provide any specific methods, but inherits methods from its parent, svgtextcontentelement. ...
...om its parent, svgtextcontentelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgtextpositioningelement' in that specification. ...
...nt, svgtextcontentelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgtextpositioningelement' in that specification. ...
SVGTitleElement - Web APIs
pointer-events: all;} properties this interface doesn't implement any specific properties, but inherits properties from its parent interface, svgelement. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. ...
...any specific methods, but inherits methods from its parent interface, svgelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgtitleelement' in that specification. ...
...element. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgtitleelement' in that specification. candidate recommendation removed inheritance from svglangspace and svgstylable. ...
...pecifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgtitleelement' in that specification. candidate recommendation removed inheritance from svglangspace and svgstylable. ...
SVGURIReference - Web APIs
getting href, an svganimatedstring object is returned that reflects the href attribute, and if the element is defined to support the deprecated xlink:href attribute, additionally reflects that deprecated attribute. methods this interface does not provide any specific methods. ...
...ations specification status comment scalable vector graphics (svg) 2the def
inition of 'svgurireference' in that specification. candidate recommendation replaced the deprecated xlink:href attribute reference by the href attribute and made the prior only be reflected where it's defined to be supported. ...
...tor graphics (svg) 2the def
inition of 'svgurireference' in that specification. candidate recommendation replaced the deprecated xlink:href attribute reference by the href attribute and made the prior only be reflected where it's defined to be supported. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgurireference' in that specification. ...
...s (svg) 2the def
inition of 'svgurireference' in that specification. candidate recommendation replaced the deprecated xlink:href attribute reference by the href attribute and made the prior only be reflected where it's defined to be supported. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgurireference' in that specification. ...
SVGUnitTypes - Web APIs
eonuse 1 corresponds to the value userspaceonuse. svg_unit_type_objectboundingbox 2 corresponds to the value objectboundingbox. properties this interface doesn't implement any specific properties. ...
...roperties this interface doesn't implement any specific properties. methods this interface doesn't implement any specific methods. ...
...methods this interface doesn't implement any specific methods. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgunittypes' in that specification. ...
...is interface doesn't implement any specific methods. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgunittypes' in that specification. ...
SVGUseElement - Web APIs
nvalid or because it has been disabled by conditional processing), then getting this attribute returns null. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svggraphicselement and implements methods from svgurireference. ...
...interface, svggraphicselement and implements methods from svgurireference. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svguseelement' in that specification. ...
...ce. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svguseelement' in that specification. candidate recommendation redefined the properties instanceroot and animatedinstanceroot. ...
...ications specification status comment scalable vector graphics (svg) 2the def
inition of 'svguseelement' in that specification. candidate recommendation redefined the properties instanceroot and animatedinstanceroot. ...
SVGViewElement - Web APIs
the names listed in the viewtarget attribute. each of the domstring values can be associated with the corresponding element using the getelementbyid() method call. methods this interface doesn't implement any specific methods, but inherits methods from its parent interface, svgelement. ...
...sn't implement any specific methods, but inherits methods from its parent interface, svgelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgviewelement' in that specification. ...
...t interface, svgelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgviewelement' in that specification. ...
..., svgelement. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgviewelement' in that specification. ...
SecurityPolicyViolationEvent.SecurityPolicyViolationEvent() - Web APIs
the securitypolicyviolationevent constructor creates a new securitypolicyviolationevent object instance. syntax let spvevt = new securitypolicyviolationevent(type, event
initdict); properties type a domstring representing the type of security policy violation that occurred. event
initdict optional a dictionary object containing information about the properties of the securitypolicyviolationevent to be constructed. this can include the following properties, but bear in mind that if you do include an event
initdict, certain properties must be included (marked below with required): blockeduri: the blockeduri of the securitypolicyviolationevent. if not included, the default value is "". columnnumber: the columnnumber of the securitypolicyviolationevent. if not included, the ...
...tatuscode of the securitypolicyviolationevent (required). ...
...olateddirective of the securitypolicyviolationevent (required). ...
...tive of the securitypolicyviolationevent (required). ...
ServiceWorker.scriptURL - Web APIs
returns the serviceworker serialized script url defined as part of serviceworkerregistration. must be on the same origin as the document that registers the serviceworker. ...
... returns the serviceworker serialized script url defined as part of serviceworkerregistration. must be on the same origin as the document that registers the serviceworker. ...
...fined as part of serviceworkerregistration. must be on the same origin as the document that registers the serviceworker. ...
...rt of serviceworkerregistration. must be on the same origin as the document that registers the serviceworker. ...
ServiceWorkerContainer.ready - Web APIs
once that condition is met, it resolves with the serviceworkerregistration. syntax navigator.serviceworker.ready.then(function(serviceworkerregistration) { ... }); value a promise that will never reject, and which may eventually resolve with a serviceworkerregistration. ...
... ...
... ...
... ...
SourceBuffer - Web APIs
t sequence. sourcebuffer.texttracks read only a list of the text tracks currently contained inside the sourcebuffer. sourcebuffer.timestampoffset controls the offset applied to timestamps inside media segments that are subsequently appended to the sourcebuffer. sourcebuffer.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 ...
... ...
... ...
... ...
StylePropertyMapReadOnly.get() - Web APIs
returns a cssstylevalue object for the first value of the specified property. syntax var declarationblock = stylepropertymapreadonly.get(property) parameters property the name of the property to retrieve the value of. return value a cssstylevalue object. examples let's get just a few properties and values. let's start by creating a link inside a paragraph in our html, and adding a def
inition list which we will populate with javascript: <p> <a href="https://example.com">link</a> </p> <dl id="regurgitation"></dl> we add a bit of css, including a custom property and an inhertable property: p { font-weight: bold; } a { --colour: red; color: var(--colour); } we use the element's computedstylemap() to return a stylepropertymapreadonly object. we create an array of propert...
... ...
... ...
... ...
StylePropertyMapReadOnly - Web APIs
css, or not. the style map will include all the default and inherted css property values. </p> <dl id="output"></dl> we add a touch of css with a custom property to better demonstrate the output: p { --somevariable: 1.6em; --someothervariable: translatex(33vw); --anothervariable: 42; line-height: var(--somevariable); } we add javascript to grab our paragraph and return back a def
inition list of all the default css property values using computedstylemap(). // get the element const myelement = document.queryselector('p'); // get the <dl> we'll be populating const styleslist = document.queryselector('#output'); // retrieve all computed styles with computedstylemap() const stylepropertymap = myelement.computedstylemap(); // iterate thru the map of all the properties and value...
... ...
... ...
... ...
SubmitEvent() - Web APIs
return value a submitevent object configured using the given inputs. ...
... return value a submitevent object configured using the given inputs. ...
... return value a submitevent object configured using the given inputs. ...
... living standard ...
SubtleCrypto.deriveBits() - Web APIs
length ); parameters algorithm is an object defining the derivation algorithm to use. to use ecdh, pass an ecdhkeyderiveparams object. to use hkdf, pass an hkdfparams object. to use pbkdf2, pass a pbkdf2params object. basekey is a cryptokey representing the input to the derivation algorithm. if algorithm is ecdh, this will be the ecdh private key. otherwise it will be the
initial key material for the derivation function: for example, for pbkdf2 it might be a password, imported as a cryptokey using subtlecrypto.importkey(). length is a number representing the number of bits to derive. return value result is a promise that fulfills with an arraybuffer containing the derived bits. exceptions the promise is rejected when one of the following exceptions are encount...
... ...
... ...
... ...
SubtleCrypto.wrapKey() - Web APIs
an invalid format. supported algorithms all algorithms that are usable for encryption are also usable for key wrapping, as long as the key has the "wrapkey" usage set. for key wrapping you have the additional option of aes-kw. aes-kw aes-kw is a way to use the aes cipher for key wrapping. one advantage of using aes-kw over another aes mode such as aes-gcm is that aes-kw does not require an
initialization vector. to use aes-kw, the input must be a multiple of 64 bits. aes-kw is specified in rfc 3394. examples note: you can try the working examples out on github. raw wrap this example wraps an aes key. it uses "raw" as the export format and aes-kw, with a password-derived key, to encrypt it. see the complete code on github. let salt; /* get some key material to use as input to th...
... ...
... ...
... ...
SubtleCrypto - Web APIs
ed using a cryptokey object. to perform operations like signing and encrypting, you pass a cryptokey object into the sign() or encrypt() function. generating and deriving keys the generatekey() and derivekey() functions both create a new cryptokey object. the difference is that generatekey() will generate a new distinct key value each time you call it, while derivekey() derives a key from some
initial keying material. if you provide the same keying material to two separate calls to derivekey(), you will get two cryptokey objects that have the same underlying value. this is useful if, for example, you want to derive an encryption key from a password and later derive the same key from the same password to decrypt the data. importing and exporting keys to make keys available outside your app...
... ...
... ...
... ...
TextTrackCue - Web APIs
e that the cue will stop being displayed, in seconds. texttrackcue.pauseonexit a boolean for whether the video will pause when this cue stops being displayed. ...
...r whether the video will pause when this cue stops being displayed. event handlers texttrackcue.onenter the event handler for the enter event. ...
...event handlers texttrackcue.onenter the event handler for the enter event. texttrackcue.onexit the event handler for the exit event. ...
...ers texttrackcue.onenter the event handler for the enter event. texttrackcue.onexit the event handler for the exit event. ...
Touch events - Web APIs
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 touchpoint, includes information such as the position of the touch point relative to the browser viewport. def
initions surface the touch-sensitive surface. this may be a screen or trackpad. touch point a point of contact with the surface. this may be a finger (or elbow, ear, nose, whatever, but typically a finger) or stylus. interfaces touchevent represents an event that occurs when the state of touches on the surface changes. touch represents a single point of contact between the user and th...
...ent.createevent("mouseevents"); var type = null; var touch = null; switch (evt.type) { case "touchstart": type = "mousedown"; touch = evt.changedtouches[0]; break; case "touchmove": type = "mousemove"; touch = evt.changedtouches[0]; break; case "touchend": type = "mouseup"; touch = evt.changedtouches[0]; break; } newevt.
initmouseevent(type, true, true, evt.originaltarget.ownerdocument.defaultview, 0, touch.screenx, touch.screeny, touch.clientx, touch.clienty, evt.ctrlkey, evt.altkey, evt.shiftkey, evt.metakey, 0, null); evt.originaltarget.dispatchevent(newevt); } calling preventdefault() only on a second touch one technique for preventing things like pinchzoom on a page is to call preventdefault() on the...
... ...
...nning and zooming.) currently, it's not recommended to depend on any particular behavior in this case, but rather to depend on meta viewport to prevent zooming. specifications specification status comment touch events – level 2the def
inition of 'touch' in that specification. draft added radiusx, radiusy, rotationangle, force properties touch eventsthe def
inition of 'touch' in that specification. recommendation
initial def
inition. ...
URLSearchParams() - Web APIs
a leading '?' character is ignored. a sequence of usvstring pairs, representing names/values. a record of usvstring keys and usvstring values. return value a urlsearchparams object instance. examples the following example shows how to create a urlsearchparams object from a url string. ...
... ...
... ...
... ...
URLSearchParams - Web APIs
ms.append("topic", "webdev"); searchparams.tostring(); // "q=urlutils.searchparams&topic=api&topic=webdev" searchparams.set("topic", "more webdev"); searchparams.tostring(); // "q=urlutils.searchparams&topic=more+webdev" searchparams.delete("topic"); searchparams.tostring(); // "q=urlutils.searchparams" gotchas the urlsearchparams constructor does not parse full urls. however, it will strip an
initial leading ? off of a string, if present. var paramsstring1 = "http://example.com/search?query=%40"; var searchparams1 = new urlsearchparams(paramsstring1); searchparams1.has("query"); // false searchparams1.has("http://example.com/search?query"); // true searchparams1.get("query"); // null searchparams1.get("http://example.com/search?query"); // "@" (equivalent to decodeuricomponent('%40')) ...
... ...
... ...
... ...
VisualViewport - Web APIs
iewport.offsetleft read only returns the offset of the left edge of the visual viewport from the left edge of the layout viewport in css pixels. visualviewport.offsettop read only returns the offset of the top edge of the visual viewport from the top edge of the layout viewport in css pixels. visualviewport.pageleft read only returns the x coordinate of the visual viewport relative to the
initial containing block origin of the top edge in css pixels. visualviewport.pagetop read only returns the y coordinate of the visual viewport relative to the
initial containing block origin of the top edge in css pixels. visualviewport.width read only returns the width of the visual viewport in css pixels. visualviewport.height read only returns the height of the visual viewport in css pixe...
... ...
... ...
... ...
WebGL2RenderingContext.copyBufferSubData() - Web APIs
standard man page of the (similar) opengl api. ...
... standard man page of the (similar) opengl api. ...
... standard man page of the (similar) opengl api. ...
... standard man page of the (similar) opengl api. ...
WebGL2RenderingContext - Web APIs
n used in a webgl 2 context. you will find this info noted on the webgl 1 reference pages. the webgl tutorial has more information, examples, and resources on how to get started with webgl. constants see the webgl constants page. state information webgl2renderingcontext.getindexedparameter() returns the indexed value for the given target. buffers webgl2renderingcontext.bufferdata()
initializes and creates the buffer object's data store. webgl2renderingcontext.buffersubdata() updates a subset of a buffer object's data store. webgl2renderingcontext.copybuffersubdata() copies part of the data of a buffer to another buffer. webgl2renderingcontext.getbuffersubdata() reads data from a buffer and writes them to an arraybuffer or sharedarraybuffer. framebuffers webgl2renderin...
...atesubframebuffer() invalidates portions of the contents of attachments in a framebuffer webgl2renderingcontext.readbuffer() selects a color buffer as the source for pixels. renderbuffers webgl2renderingcontext.getinternalformatparameter() returns information about implementation-dependent support for internal formats. webgl2renderingcontext.renderbufferstoragemultisample() creates and
initializes a renderbuffer object's data store and allows specifying the number of samples to be used. textures webgl2renderingcontext.texstorage2d() specifies all levels of two-dimensional texture storage. webgl2renderingcontext.texstorage3d() specifies all levels of a three-dimensional texture or two-dimensional array texture. webgl2renderingcontext.teximage3d() specifies a three-dimension...
...and waits for a webglsync object to become signaled or a given timeout to be passed. webgl2renderingcontext.waitsync() returns immediately, but waits on the gl server until the given webglsync object is signaled. webgl2renderingcontext.getsyncparameter() returns parameter information of a webglsync object. transform feedback webgl2renderingcontext.createtransformfeedback() creates and
initializes webgltransformfeedback objects. webgl2renderingcontext.deletetransformfeedback() deletes a given webgltransformfeedback object. webgl2renderingcontext.istransformfeedback() returns true if the passed object is a valid webgltransformfeedback object. webgl2renderingcontext.bindtransformfeedback() binds a passed webgltransformfeedback object to the current gl state. webgl2renderingcont...
...w webglvertexarrayobject. webgl2renderingcontext.deletevertexarray() deletes a given webglvertexarrayobject. webgl2renderingcontext.isvertexarray() returns true if a given object is a valid webglvertexarrayobject. webgl2renderingcontext.bindvertexarray() binds a given webglvertexarrayobject to the buffer. specifications specification status comment webgl 2.0the def
inition of 'webgl2renderingcontext' in that specification. editor's draft
initial def
inition. ...
WebGLRenderingContext.attachShader() - Web APIs
standard opengl man page. ...
... standard opengl man page. ...
... standard opengl man page. ...
...der); gl.linkprogram(program); if ( !gl.getprogramparameter( program, gl.link_status) ) { var info = gl.getprograminfolog(program); throw 'could not compile webgl program. \n\n' + info; } specifications specification status comment webgl 1.0the def
inition of 'attachshader' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glattachshader' in that specification. standard opengl man page. ...
WebRTC connectivity - Web APIs
ons without some sort of server in the middle. we call this the signal channel or signaling service. it’s any sort of channel of communication to exchange information before setting up a connection, whether by email, post card or a carrier pigeon... it’s up to you. the information we need to exchange is the offer and answer which just contains the sdp mentioned below. peer a who will be the
initiator of the connection, will create an offer. they will then send this offer to peer b using the chosen signal channel. peer b will receive the offer from the signal channel and create an answer. they will then send this back to peer a along the signal channel. session descriptions the configuration of an endpoint on a webrtc connection is called a session description. the description includes ...
...emote peer. prflx a peer reflexive candidate is one whose ip address comes from a symmetric nat between the two peers, usually as an additional candidate during trickle ice (that is, additional candidate exchanges that occur after primary signaling but before the connection verification phase is finished). srflx a server reflexive candidate is generated by a stun/turn server; the connection's
initiator requests a candidate from the stun server, which forwards the request through the remote peer's nat, which creates and returns a candidate whose ip address is local to the remote peer. the stun server then replies to the
initiator's request with a candidate whose ip address is unrelated to the remote peer. relay a relay candidate is generated just like a server reflexive candidate ("srflx"...
...llbacks when renegotiating a connection that's already active and a situation arises in which the negotiation fails, you don't really want to kill the already-running call. after all, you were most likely just trying to upgrade or downgrade the connection, or to otherwise make adaptations to an ongoing session. aborting the call would be an excessive reaction in that situation. ...
...ng to upgrade or downgrade the connection, or to otherwise make adaptations to an ongoing session. aborting the call would be an excessive reaction in that situation. instead, you can
initiate an ice rollback. a rollback restores the sdp offer (and the connection configuration by extension) to the configuration it had the last time the connection's signalingstate was stable. to programmatically
initiate a rollback, send a description whose type is rollback. any other properties in the description object are ignored. in addition, the ice agent will automatically
initiate a rollback when a peer that had previously created an offer receives an offer from the remote peer. in other words, if the local peer is in the state have-local-offer, indicating that the local peer had previously sent an of...
Starting up and shutting down a WebXR session - Web APIs
sync function createimmersivesession(xr) { try { session = await xr.requestsession("immersive-vr"); return session; } catch(error) { throw error; } } this function returns the new xrsession or throws an exception if an error occurs while creating the session. customizing the session in addition to the display mode, the requestsession() method can take an optional object with
initialization parameters to customize the session. currently, the only configurable aspect of the session is which of the reference spaces should be used to represent the world's coordinate system. you can specify either required or optional reference spaces in order to obtain a session compatible with the reference spaces you need or prefer to use. for example, if you need an unbounded reference sp...
... 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 models and prepare to render the scene. set the webgl context as the source for the xr system by creating an xrwebgllayer and passing set the value of the session's renderstate property baselayer. perform calculations for the
initial position and scale of your objects as needed. begin the frame rendering cycle. in basic form, code to do this final setup might look something like this: async function runsession(session) { let worlddata; session.addeventlistener("end", onsessionend); let canvas = document.queryselector("canvas"); gl = canvas.getcontext("webgl", { xrcompatible: true }); // set up webgl data a...
... framebuffer. this is done using the xrsession method updaterenderstate() to set the render state's baselayer to a newly-created xrwebgllayer encapsulating the webgl context. preparing to render the scene at this point, the xrsession itself has been fully configured, so we can begin rendering. first, we need a reference space within which coordinates for the world will be stated. we can get the
initial reference space for the session by calling the xrsession's requestreferencespace() method. we specify when calling requestreferencespace() the name of the type of reference space we want; in this case, unbounded. you might just as easily specify local or viewer, depending on your needs. to understand how to select the right reference space for your needs, see selecting the reference space ty...
...ce for your needs, see selecting the reference space type in geometry and reference spaces in webxr. the reference space returned by requestreferencespace() places the origin (0, 0, 0) in the center of the space. this is great—if your player's viewpoint starts in the exact center of the world. but most likely, that's not the case at all. if that's so, you call getoffsetreferencespace() on the
initial reference space to create a new reference space which offsets the coordinate system so that (0, 0, 0) is located at the position of the viewer, with the orientation likewise shifted to face in the desired direction. the input value into getoffsetreferencespace() is an xrrigidtransform encapsulating the player's position and orientation as specified in the default world coordinates. with the n...
Using the Web Animations API - Web APIs
a tumbling animation written in css showing alice falling down the rabbit hole that leads to wonderland (see the full code on codepen): notice that the background moves, alice spins, and her color changes at an offset from her spinning. we’re going to focus on just alice for this tutorial. here’s the simplified css that controls alice’s animation: #alice { animation: alicetumbling inf
inite 3s linear; } @keyframes alicetumbling { 0% { color: #000; transform: rotate(0) translate3d(-50%, -50%, 0); } 30% { color: #431236; } 100% { color: #000; transform: rotate(360deg) translate3d(-50%, -50%, 0); } } this changes alice’s color and her transform’s rotation over 3 seconds at a constant (linear) rate and loops inf
initely. in the @keyframes block we c...
...r exception in some browsers until they are updated. so to recap, the keys are equally spaced by default unless you specify an offset on a key. handy, no? representing timing properties we’ll also need to create an object of timing properties (an animationeffecttimingproperties object) corresponding to the values in alice’s animation: var alicetiming = { duration: 3000, iterations: inf
inity } you’ll notice a few differences here from how equivalent values are represented in css: for one, the duration is in milliseconds as opposed to seconds — 3000 not 3s. like windowtimers.settimeout() and window.requestanimationframe(), the web animations api only takes milliseconds. the other thing you’ll notice is that it’s iterations, not iteration-count. there are a number of s...
... 3000 not 3s. like windowtimers.settimeout() and window.requestanimationframe(), the web animations api only takes milliseconds. the other thing you’ll notice is that it’s iterations, not iteration-count. there are a number of small differences between the terminology used in css animations and the terminology used in web animations. for instance, web animations doesn't use the string "inf
inite", but instead uses the javascript keyword inf
inity. and instead of timing-function we use easing. we aren’t listing an easing value here because, unlike css animations where the default animation-timing-function is ease, in the web animations api the default easing is linear — which is what we want here. bring the pieces together now it’s time to bring them both together with the elemen...
...instead of making objects for keyframes and timing properties, we could just pass their values in directly, like so: document.getelementbyid("alice").animate( [ { transform: 'rotate(0) translate3d(-50%, -50%, 0)', color: '#000' }, { color: '#431236', offset: 0.3}, { transform: 'rotate(360deg) translate3d(-50%, -50%, 0)', color: '#000' } ], { duration: 3000, iterations: inf
inity } ); what’s more, if we only wanted to specify the duration of the animation and not its iterations (by default, animations iterate once), we could pass in the milliseconds alone: document.getelementbyid("alice").animate( [ { transform: 'rotate(0) translate3d(-50%, -50%, 0)', color: '#000' }, { color: '#431236', offset: 0.3}, { transform: 'rotate(360deg) translate3d(-50%, -50...
Web Authentication API - Web APIs
; however, steps 2, 3, and 4 are essential to understanding the processing that takes place in the browser and authenticator and what the resulting data means. figure 1 - a diagram showing the sequence of actions for a web authentication registration and the essential data associated with each action. the registration steps are: application requests registration - the application makes the
initial registration request. the protocol and format of this request is outside of the scope of the web authentication api. server sends challenge, user info, and relying party info - the server sends a challenge, user information, and relying party information to the javascript program. the protocol for communicating with the server is not specified and is outside of the scope of the web authentica...
...ptions dictionary, and the resulting data can be found in the publickeycredential interface (where publickeycredential.response is the authenticatorassertionresponse interface) . figure 2 - similar to figure 1, a diagram showing the sequence of actions for a web authentication and the essential data associated with each action. application requests authentication - the application makes the
initial authentication request. the protocol and format of this request is outside of the scope of the web authentication api. server sends challenge - the server sends a challenge to the javascript program. the protocol for communicating with the server is not specified and is outside of the scope of the web authentication api. typically, server communications would be rest over https (probably usin...
... ...
... ...
Window: beforeunload event - Web APIs
t() method instead of using event.returnvalue. however, this is not supported by all browsers. ...
.... window.addeventlistener('beforeunload', (event) => { // cancel the event as stated by the standard. event.preventdefault(); // chrome requires returnvalue to be set. ...
...e event as stated by the standard. event.preventdefault(); // chrome requires returnvalue to be set. ...
...stated by the standard. event.preventdefault(); // chrome requires returnvalue to be set. ...
Window.getComputedStyle() - Web APIs
inal property value in webkit. in firefox, properties with the value auto return the used value, not the value auto. ...
...bottom:0 on an element with height:30px and a containing block of height:100px, firefox's computed style for top returns 70px, as 100 − 30 = 70. ...
...ht:100px, firefox's computed style for top returns 70px, as 100 − 30 = 70. specifications specification status comment css object model (cssom)the def
inition of 'getcomputedstyle()' in that specification. ...
...irefox's computed style for top returns 70px, as 100 − 30 = 70. specifications specification status comment css object model (cssom)the def
inition of 'getcomputedstyle()' in that specification. ...
Window.open() - Web APIs
and dimension error correction position if only one of them is specified, the behavior is implementation-dependent, and web author should not rely on it. left or screenx specifies the distance the new window is placed from the left side of the work area for applications of the user's operating system to the leftmost border (resizing handle) of the browser window. the new window cannot be
initially positioned offscreen. top or screeny specifies the distance the new window is placed from the top side of the work area for applications of the user's operating system to the topmost border (resizing handle) of the browser window. the new window cannot be
initially positioned offscreen. if the windowfeatures parameter is non-empty and if no position features are defined, then the left an...
...odern browsers including chrome, and firefox 52+. see rel="noopener" for more information and for browser compatibility details, including information about ancillary effects. noreferrer if this feature is set, the request to load the content located at the specified url will be loaded with the request's referrer set to noreferrer; this prevents the request from sending the url of the page that
initiated the request to the server where the request is sent. in addition, setting this feature also automatically sets noopener. see rel="noreferrer" for additional details and compatibility information. firefox introduced support for noreferrer in firefox 68. best practices <script type="text/javascript"> var windowobjectreference = null; // global variable function openffpromotionpopup() { i...
...w to open such links (in a new window or not, in the same window, in a new tab or not, in "background" or not). ...
...d to describe or to identify the same window. it is the window from which a new window will be created. it is the window on which the user clicked a link that leads to the creation of another, new window. sub-window, child window, secondary window, second window terms often used to describe or to identify the same window. it is the new window that was created. unrequested popup windows script-
initiated windows opening automatically without the user's consent. specification specification status comment html living standardthe def
inition of 'window.open()' in that specification. living standard css object model (cssom) view modulethe def
inition of 'the features argument to the open() method' in that specification. working draft defines the...
Window.top - Web APIs
property returns the immediate parent of the current window, window.top returns the topmost window in the hierarchy of window objects. ...
...window in the hierarchy of window objects. ...
...lly useful when you are dealing with a window that is in a subframe of a parent or parents, and you want to get to the top-level frameset. ...
...when you are dealing with a window that is in a subframe of a parent or parents, and you want to get to the top-level frameset. ...
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
red. maximum delay value browsers including internet explorer, chrome, safari, and firefox store the delay as a 32-bit signed integer internally. this causes an integer overflow when using delays larger than 2,147,483,647 ms (about 24.8 days), resulting in the timeout being executed immediately. ...
...than 2,147,483,647 ms (about 24.8 days), resulting in the timeout being executed immediately. specifications specification status comment html living standardthe def
inition of 'windoworworkerglobalscope.settimeout()' in that specification. ...
...ediately. specifications specification status comment html living standardthe def
inition of 'windoworworkerglobalscope.settimeout()' in that specification. living standard method moved to the windoworworkerglobalscope mixin in the latest spec. ...
...specifications specification status comment html living standardthe def
inition of 'windoworworkerglobalscope.settimeout()' in that specification. living standard method moved to the windoworworkerglobalscope mixin in the latest spec. ...
WorkerNavigator.connection - Web APIs
the workernavigator.connection read-only property returns a networkinformation object containing information about the system's connection, such as the current bandwidth of the user's device or whether the connection is metered. ...
... the workernavigator.connection read-only property returns a networkinformation object containing information about the system's connection, such as the current bandwidth of the user's device or whether the connection is metered. ...
... information about the system's connection, such as the current bandwidth of the user's device or whether the connection is metered. this could be used to select high def
inition content or low def
inition content based on the user's connection. ...
...idth of the user's device or whether the connection is metered. this could be used to select high def
inition content or low def
inition content based on the user's connection. ...
WritableStreamDefaultWriter.write() - Web APIs
een accepted, and not necessarily that it is safely saved to its ultimate destination. syntax var promise = writablestreamdefaultwriter.write(chunk); parameters chunk a block of binary data to pass to the writablestream. return value a promise, which fulfills with the undefined upon a successful write, or rejects if the write fails or stream becomes errored before the writing process is
initiated. exceptions typeerror the target stream is not a writable stream, or it does not have an owner. examples the following example shows the creation of a writablestream with a custom sink and an api-supplied queuing strategy. it then calls a function called sendmessage(), passing the newly created stream and a string. inside this function it calls the stream's getwriter() method, which ...
... ...
... ...
... ...
XPathEvaluator.createNSResolver() - Web APIs
x using the current information available in the node's hierarchy at the time the method is called, also correctly resolving the implicit xml prefix. ...
...er xpathevaluator.creatensresolver(noderesolver); parameters noderesolver a node to be used as a context for namespace resolution. return value an xpathnsresolver object which resolves namespaces with respect to the def
initions in scope for a specified node. ...
...e used as a context for namespace resolution. return value an xpathnsresolver object which resolves namespaces with respect to the def
initions in scope for a specified node. ...
... context for namespace resolution. return value an xpathnsresolver object which resolves namespaces with respect to the def
initions in scope for a specified node. ...
XRInputSourcesChangeEvent - Web APIs
the webxr device api interface xrinputsourceschangeevent is used to represent the inputsourceschange event sent to an xrsession when the set of available webxr input controllers changes. constructor xrinputsourceschangeevent() creates and returns a new xrinputsourceschangeevent object configured as indicated by the given xrinputsourceschangeevent
init object. the specified type must be inputsourceschange, which is the only event that uses this interface. properties added read only an array of zero or more xrinputsource objects, each representing an input device which has been newly connected or enabled for use. removed read only an array of zero or more xrinputsource objects representing the input devices newly connected or enabled for use. session read only the xrsession t...
... ...
... ...
... ...
XRPermissionDescriptor - Web APIs
permissiondescriptor provides the following properties. mode an xrsessionmode value indicating the xr mode (inline, immersive-vr, or immersive-ar) for which the permissions are requested. optionalfeatures an array of strings, each specifying the name of a webxr feature which is requested but not required for the app to function. the available features are the same as those used by xrsession
init; see default features in xrsession
init for further information. requiredfeatures an array of strings giving the names of the webxr features for which permission must be obtained in order to use your app or site. examples the example below demonstrates performing the permission request for an application that requires the local-floor reference space in an immersive-vr environment. if the per...
... ...
... ...
... ...
XRRigidTransform() - Web APIs
() constructor creates and returns a new xrrigidtransform object, representing the position and orientation of a point or object. among other things, xrrigidtransform is used when providing a transform to translate between coordinate systems across spaces. syntax let xrrigidtransform = new xrrigidtransform(position, orientation); parameters position optional an object conforming to dompoint
init which specifies the coordinates at which the point or object is located. these dimensions are specified in meters. if this parameter is left out or is not compatible with dompoint
init, the position used is assumed to be {x: 0, y: 0, z: 0, w: 1}. w must always be 1. orientation optional an object conforming to dompoint
init which specifies the direction in which the object is facing. the default...
... exceptions typeerror the value of the w coordinate in the specified position is not 1.0. ...
...e = refspace.getoffsetreferencespace( new xrrigidtransform(viewerposition, viewerorientation)); animationframerequestid = xrsession.requestanimationframe(drawframe); }); after requesting a reference space of type local-floor, the returned promise is eventually resolved, at which time we receive a new reference space object, refspace. after creating an xrrigidtransform from the viewer's
initial position and orientation, we pass the new transform into getoffsetreferencespace() to create another reference space, now offset so that its origin is located at the same place in space as the coordinates given by viewerposition, with the orientation also revised in the same fashion. then requestanimationframe() is called to ask for a new animation frame to draw into. the drawframe() callback...
...on, with the orientation also revised in the same fashion. then requestanimationframe() is called to ask for a new animation frame to draw into. the drawframe() callback will be executed when the system is ready to draw the next frame. you can find more examples in movement, orientation, and motion. specifications specification status comment webxr device apithe def
inition of 'xrrigidtransform()' in that specification. working draft
initial def
inition. ...
XRViewport - Web APIs
is at (x, y) and which extends width pixels toward the left and height pixels upward. these values may be passed directly into the webglrenderingcontext.viewport() method: let xrviewport = xrwebgllayer.getviewport(xrview); gl.viewport(xrviewport.x, xrviewport.y, xrviewport.width, xrviewport.height); example this example sets up an animation frame callback using requestanimationframe(). after
initial setup, it iterates over each of the views within the viewer's pose, configuring the viewport as dictated by the xrwebgllayer. xrsession.requestanimationframe((time, xrframe) => { let viewerpose = xrframe.getviewerpose(xrreferencespace); gl.bindframebuffer(xrwebgllayer.framebuffer); for (xrview of viewerpose.views) { let xrviewport = xrwebgllayer.getviewport(xrview); gl.viewpor...
... ...
... ...
... ...
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
the static method xrwebgllayer.getnativeframebufferscalefactor() returns a floating-point scaling factor by which one can multiply the specified xrsession's resolution to get the native resolution of the webxr device's frame buffer. this information can be used when creating a new xrwebgllayer to configure the xrwebgllayer
init property framebufferscalefactor in the options specified when calling the xrwebgllayer() constructor. see the usage notes and examples for details. if the scaling factor is 1.0, then the frame buffer pixels and the native display pixels are the same size. if the scaling factor is greater than zero, then the frame buffer is smaller than the diplay's native dimensions, resulting in the output being up-scaled for display to the screen after rendering into the frame buf...
...); }); }; this starts by calling the webgl rendering context function makexrcompatible(). when the returned promise resolves, we proceed by calling xrwebgllayer's getnativeframebufferscalefactor() static function to get the scale factor needed to reach the native resolution, and we then pass that into the webgllayer() constructor as the value of the framebufferscalefactor property in its layer
init dictionary, which is an xrwebgllayer
init object. that gets us a new xrwebgllayer object representing a rendering surface we can use for the xrsession; we set it as the rendering surface for xrsession by calling its updaterenderstate() method, passing the new gllayer in using the xrrenderstate dictionary's xrrenderstate.baselayer property. the result is a rendering context that looks like the dia...
... ...
...eye which has its top-left corner at (0, 0) with its width and height being 1280x1440 pixels. the right eye it obtains has its top-left corner at 1280, 0 with the same width and height: 1280x1440. specifications specification status comment webxr device apithe def
inition of 'static xrwebgllayer.getnativeframebufferscalefactor()' in that specification. working draft
initial def
inition. ...
ARIA Test Cases - Accessibility
nounce accessible name, role and state. 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 jaws 10 partial pass. the state of tristate checkboxes is not announced when
initially focusing. it is announced when toggling. fail - changes not spoken fail fail voiceover (leopard) n/a n/a - fail window-eyes pass fail (unchecked presented as checked, ie exposing incorrect state for no aria-checked attribute) fail fail nvda fail -- for change from mixed to fully checked, nothing spoken n/a fail fail ...
...as focus moves among the radio buttons, the newly focused radio button's label, state and position should be indicated. markup used: notes: results: at firefox ie opera safari jaws 9 - - n/a n/a ...
... as the controls within the toolbar are navigated, the newly focused item should be announced, but the label or role of the toolbar itself should not be repeated. markup used: notes: results: at firefox ie opera safari jaw...
...etsize and aria-posinset to create the hierarchy we also need one that uses aria-owns to create the hierarchy / structure we need one that uses the document to create structure, but uses nested uls with links inside, and role="presentation" expected at behavior: if navigated to in a screen reader's virtual buffer, the label, role and previously active item of the tree should be read. upon
initial focus, the label (if present), and role of the tree itself should be spoken, followed by the current tree item's information. when a tree item is read, the screen reader should announce its label, role, state and "item n of m" positional information. the state includes whether it is expandable and expanded/open. as focus is moved, output should be identical to desktop tree widgets like in e.
ARIA: feed role - Accessibility
<section role="feed" aria-busy="false"> ... ...
...istive technologies that governs scroll interactions so that assistive technology users can read articles, jump forward and backward by article, and reliably trigger new articles to load while in reading mode. examples include an rss feed, news feeds, social media feeds like facebook, instagram or twitter, or even a list of related products on an ecommerce page. these streams can be limited or inf
inite, loading more content as the user scrolls. implementing the feed pattern allows a screen reader to reliably read and trigger the loading of feed content while in reading mode. a feed is a container element whose children are <article>s or have role article. each article within a feed should be focusable, with tabindex of 0 or -1. an article should be scrolled into view when it, or a descendant ...
... 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 extremely large, indef
inite, 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 identifying the elements ins...
...eed is not known, set aria-setsize="-1". required javascript features none, except as required by any attributes. for example, setting aria-busy to true during the update operation if needed, and then to false upon completion. examples example implementation of feed pattern specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'feed' in that specification. recommendation screen reader support coming soon ...
Understandable - Accessibility
this article provides practical advice on how to write your web content so that it conforms to the success criteria outlined in the understandable principle of the web content accessibility guidelines (wcag) 2.0 and 2.1. understandable states that information and the operation of user interface must be understandable. note: to read the w3c def
initions for understandable and its guidelines and success criteria, see principle 3: understandable — information and the operation of user interface must be understandable. guideline 3.1 — readable: make text content readable and understandable this guideline focuses on making text content as understandable as possible. success criteria how to conform to the criteria practical resource 3.1.1 language of page...
...uestion (e.g. a <span> if no semantic element is available) to set an appropriate language for it. you don't need to set a different language for words or phrases that are the same regardless of language (for example proper names, technical terms that aren't part of a specific language). 3.1.3 unusual words (aaa) where technical terms, jargon, or idioms/slang are used, def
initions should be provided for such phrases/words. your site should provide a glossary that contains def
initions of such words/terms that you can then link to when they appear, or at the very least provide def
initions somewhere in the surrounding text, or in a description list at the bottom of the page. 3.1.4 abbreviations (aaa) where abbreviations are used, you should provide an...
... the <abbr> element is often thought of as the preferred way to provide an expansion for an abbreviation — it takes a title attribute that contains the expansion, and this appears when the acronym is moused over. ...
... be asked to confirm this action, save their work if appropriate, etc. globaleventhandlers.oninput is useful here. 3.2.3 consistent navigation (aa) navigation menu/control style and positioning should be consistent between different pages or views of a web page, and the existing items should appear in the same order, even if for example new iteam are added. if the user has
initiated a change, e.g. choosing a different color scheme or position for the navigation, their choice should be respected across all pages. again, sensible design — make the navigation controls the same across all pages or views. see page layouts for information on modern markup for layouts. see also styling links as buttons for a useful accessible navigation menu example. 3.2...
Custom properties (--*): CSS variables - CSS: Cascading Style Sheets
property names that are prefixed with --, like --example-name, represent custom properties that contain a value that can be used in other declarations using the var() function. custom properties are scoped to the element(s) they are declared on, and participate in the cascade: the value of such a custom property is that from the declaration decided by the cascading algorithm.
initial valuesee proseapplies toall elementsinheritedyescomputed valueas specified with variables substitutedanimation typediscrete syntax --somekeyword: left; --somecolor: #0000ff; --somecomplexvalue: 3px 6px rgb(20, 32, 54); <declaration-value> this value matches any sequence of one or more tokens, so long as the sequence does not contain an unallowed token. it represents the entirety of what a valid declarati...
... ...
... ...
... ...
-webkit-text-stroke-color - CSS: Cascading Style Sheets
the -webkit-text-stroke-color css property specifies the stroke color of characters of text. if this property is not set, the value of the color property is used. ...
.... if this property is not set, the value of the color property is used. /* <color> values */ -webkit-text-stroke-color: red; -webkit-text-stroke-color: #e08ab4; -webkit-text-stroke-color: rgb(200, 100, 0); /* global values */ -webkit-text-stroke-color: inherit; -webkit-text-stroke-color:
initial; -webkit-text-stroke-color: unset; syntax values <color> the color of the stroke. ...
... property is not set, the value of the color property is used. /* <color> values */ -webkit-text-stroke-color: red; -webkit-text-stroke-color: #e08ab4; -webkit-text-stroke-color: rgb(200, 100, 0); /* global values */ -webkit-text-stroke-color: inherit; -webkit-text-stroke-color:
initial; -webkit-text-stroke-color: unset; syntax values <color> the color of the stroke. ...
...; -webkit-text-stroke-color: #ff0000; /* can be changed in the live sample */ } javascript var colorpicker = document.queryselector("input"); colorpicker.addeventlistener("change", function(evt) { document.queryselector("p").style.webkittextstrokecolor = evt.target.value; }); results specifications specification status comment compatibility standardthe def
inition of '-webkit-text-stroke-color' in that specification. living standard
initial standardization safari css reference '-webkit-text-stroke-color' in that document. non-standard unofficial documentation
initial documentation ...
-webkit-text-stroke-width - CSS: Cascading Style Sheets
width of the stroke for text. ...
...-stroke-width: medium; -webkit-text-stroke-width: thick; /* <length> values */ -webkit-text-stroke-width: 2px; -webkit-text-stroke-width: 0.1em; -webkit-text-stroke-width: 1mm; -webkit-text-stroke-width: 5pt; /* global values */ -webkit-text-stroke-width: inherit; -webkit-text-stroke-width:
initial; -webkit-text-stroke-width: unset; values <line-width> the width of the stroke. ...
...idth: medium; -webkit-text-stroke-width: thick; /* <length> values */ -webkit-text-stroke-width: 2px; -webkit-text-stroke-width: 0.1em; -webkit-text-stroke-width: 1mm; -webkit-text-stroke-width: 5pt; /* global values */ -webkit-text-stroke-width: inherit; -webkit-text-stroke-width:
initial; -webkit-text-stroke-width: unset; values <line-width> the width of the stroke. ...
...: 4em; -webkit-text-stroke-color: red; } #thin { -webkit-text-stroke-width: thin; } #medium { -webkit-text-stroke-width: 3px; } #thick { -webkit-text-stroke-width: 1.5mm; } html <p id="thin">thin stroke</p> <p id="medium">medium stroke</p> <p id="thick">thick stroke</p> results specifications specification status comment compatibility standardthe def
inition of '-webkit-text-stroke-width' in that specification. living standard
initial standardization safari css reference '-webkit-text-stroke-width' in that document. non-standard unofficial documentation
initial documentation ...
::first-letter (:first-letter) - CSS: Cascading Style Sheets
t only when not preceded by other content (such as images or inline tables). /* selects the first letter of a <p> */ p::first-letter { font-size: 130%; } the first letter of an element is not always trivial to identify: punctuation that precedes or immediately follows the first letter is included in the match. punctuation includes any unicode character defined in the open (ps), close (pe),
initial quote (pi), final quote (pf), and other punctuation (po) classes. some languages have digraphs that are always capitalized together, like the ij in dutch. in these cases, both letters of the digraph should be matched by the ::first-letter pseudo-element. (this is poorly supported by browsers; see the browser compatibility table below.) a combination of the ::before pseudo-element and the con...
... candidate recommendation allows the use of text-shadow with ::first-letter. selectors...
...t-letter { color: red; font-size: 150%; } result specifications specification status comment css pseudo-elements level 4the def
inition of '::first-letter' in that specification. working draft generalizes allowed properties to typesetting, text decoration, inline layout properties, opacity, and box-shadow. css text decoration module level 3the def
inition of 'text-shadow with ::first-letter' in that specification. candidate recommendation allows the use of text-shadow with ::first-letter. selectors level 3the def
inition of '::first-letter' in that specification. ...
...n, inline layout properties, opacity, and box-shadow. css text decoration module level 3the def
inition of 'text-shadow with ::first-letter' in that specification. candidate recommendation allows the use of text-shadow with ::first-letter. selectors level 3the def
inition of '::first-letter' in that specification. recommendation introduction of the two-colon syntax. def
inition of edge-case behavior, such as in list items or with specific languages (e.g., the dutch digraph ij). css level 2 (revision 1)the def
inition of '::first-letter' in that specification. recommendation no change. css level 1the def
inition of '::first-letter' in that specification. recommendation
initial def
inition, using the one-colon syntax. ...
:link - CSS: Cascading Style Sheets
browsers do not set that property on visited links by default. html <a href="#ordinary-target">this is an ordinary link.</a><br> <a href="">you've already visited this link.</a><br> <a>placeholder link (won't get styled)</a> css a:link { background-color: gold; color: green; } result specifications specification status comment html living standardthe def
inition of ':link' in that specification. living standard selectors level 4the def
inition of ':link' in that specification. working draft no change. selectors level 3the def
inition of ':link' in that specification. recommendation no change. css level 2 (revision 1)the def
inition of ':link' in that specification. recommendation lift the restriction to...
... 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. ...
pad - CSS: Cascading Style Sheets
syntax pad: 3 "0"; values <integer> && <symbol> the <integer> specifies a minimum length that all counter representations must reach. the value must be non-negative. if the minimum length is not reached, the representation will be padded with the specified <symbol>. description if a marker representation is smaller than the specified pad length, then the marker will be padded with the specified pad symbol. marker representations longer than the pad length are constructed as normal. ...
... padded with the specified pad symbol. marker representations longer than the pad length are constructed as normal. pad descriptor takes the minimum marker length as an integer and a symbol to be used for padding as the second parameter. a common usage of the pad descriptor is when you need your list to start numbering from 01 and go through 02, 03 and so on, instead of just 1, 2, 3... ...
... marker representations longer than the pad length are constructed as normal. pad descriptor takes the minimum marker length as an integer and a symbol to be used for padding as the second parameter. a common usage of the pad descriptor is when you need your list to start numbering from 01 and go through 02, 03 and so on, instead of just 1, 2, 3... ...
... examples padding a counter html <ul class="list"> <li>one</li> <li>two</li> <li>three</li> <li>four</li> <li>five</li> </ul> css @counter-style pad-example { system: numeric; symbols: "0" "1" "2" "3" "4" "5"; pad: 2 "0"; } .list { list-style: pad-example; } result specifications specification status comment css counter styles level 3the def
inition of 'pad' in that specification. candidate recommendation
initial def
inition ...
suffix - CSS: Cascading Style Sheets
the suffix descriptor of the@counter-style rule specifies content that will be appended to the marker representation. syntax /* <symbol> values */ suffix: ""; suffix: ") "; suffix: url(bullet.png); values <symbol> specifies a <symbol> that is appended to the marker representation. it may be a <string>, <image>, or <custom-ident>. formal def
inition related at-rule@counter-style
initial value". " (full stop followed by a space)computed valueas specified formal syntax <symbol>where <symbol> = <string> | <image> | <custom-ident>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>? [ <image-src>? , <color>? ]! )<image-set()> = image-set( <image-set-option># )<element()> = element( <id-selector> )<...
... ...
... ...
... ...
system - CSS: Cascading Style Sheets
-style name. cyclic cycles through the list of symbols provided. once the end of the list of symbols is reached, it will loop back to the beginning and start over. this system is useful for simple bullet styles with just one symbol, or for styles having multiple symbols. at least one symbol must be specified in the symbols descriptor, or the counter style is not valid. fixed defines a f
inite set of symbols are specified. once the system has looped through all the specified symbols, it will fall back. this system is useful in cases where the counter values are f
inite. at least one symbol must be specified in the symbols descriptor or the counter style is not valid. also an optional <integer> can be specified after the the system, as the value of the first symbol. if this integer is o...
...not a currently defined counter style name, it will instead extend from the decimal counter style. it must not contain a symbols or additive-symbols descriptor, or else the counter style rule is invalid. if one more more counter styles defenitions form a cycle with their extends values, the browser will treat all the participating counter styles as extending from the decimal style. ...
...name, it will instead extend from the decimal counter style. it must not contain a symbols or additive-symbols descriptor, or else the counter style rule is invalid. if one more more counter styles defenitions form a cycle with their extends values, the browser will treat all the participating counter styles as extending from the decimal style. ...
...ranthesis; like (a), (b), etc. html <ul class="list"> <li>one</li> <li>two</li> <li>three</li> <li>four</li> <li>five</li> </ul> css @counter-style alpha-modified { system: extends lower-alpha; prefix: "("; suffix: ") "; } ul { list-style: alpha-modified; } result specifications specification status comment css counter styles level 3the def
inition of 'system' in that specification. candidate recommendation
initial def
inition. ...
font-display - CSS: Cascading Style Sheets
the font-display descriptor determines how a font face is displayed based on whether and when it is downloaded and ready to use. syntax /* keyword values */ font-display: auto; font-display: block; font-display: swap; font-display: fallback; font-display: optional; values auto the font display strategy is defined by the user agent. block gives the font face a short block period and an inf
inite swap period. swap gives the font face an extremely small block period and an inf
inite swap period. fallback gives the font face an extremely small block period and a short swap period. optional gives the font face an extremely small block period and no swap period. description the font display timeline the font display timeline is based on a timer that begins the moment the user agent ...
... face successfully loads during this period, it is used normally. font swap period if the font face is not loaded, any element attempting to use it must render a fallback font face. if the font face successfully loads during this period, it is used normally. font failure period if the font face is not loaded, the user agent treats it as a failed load causing normal font fallback. ...
...is period, it is used normally. font swap period if the font face is not loaded, any element attempting to use it must render a fallback font face. if the font face successfully loads during this period, it is used normally. font failure period if the font face is not loaded, the user agent treats it as a failed load causing normal font fallback. ...
...fallback | optional ] examples specifying fallback font-display @font-face { font-family: examplefont; src: url(/path/to/fonts/examplefont.woff) format('woff'), url(/path/to/fonts/examplefont.eot) format('eot'); font-weight: 400; font-style: normal; font-display: fallback; } specifications specification status comment css fonts module level 4the def
inition of 'font-display' in that specification. working draft
initial def
inition ...
font-weight - CSS: Cascading Style Sheets
s used to implement varying weights. accessibility concerns people experiencing low vision conditions may have difficulty reading text set with a font-weight value of 100 (thin/hairline) or 200 (extra light), especially if the font has a low contrast color ratio. ...
...s. accessibility concerns people experiencing low vision conditions may have difficulty reading text set with a font-weight value of 100 (thin/hairline) or 200 (extra light), especially if the font has a low contrast color ratio. ...
...ht), especially if the font has a low contrast color ratio. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.8 | w3c understanding wcag 2.0 formal def
inition related at-rule@font-face
initial valuenormalcomputed valueas specified formal syntax <font-weight-absolute>{1,2}where <font-weight-absolute> = normal | bold | <number <a href="/docs/css/value_def
inition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[1,1000]> examples setting normal font weight in a @font-face rule the following finds a local open sans font or import it, and allows using the font for normal font weights. @font-face { font-family: "open sans"; src: local("open sans") format("woff2"), ...
...t-face rule the following finds a local open sans font or import it, and allows using the font for normal font weights. @font-face { font-family: "open sans"; src: local("open sans") format("woff2"), url("/fonts/opensans-regular-webfont.woff") format("woff"); font-weight: 400; } specifications specification status comment css fonts module level 4the def
inition of 'font-weight' in that specification. working draft css fonts module level 3the def
inition of 'font-weight' in that specification. candidate recommendation ...
src - CSS: Cascading Style Sheets
ly activate. fonts containing invalid data or local font faces that are not found are ignored and the user agent loads the next font in the list. as with other urls in css, the url may be relative, in which case it is resolved relative to the location of the style sheet containing the @font-face rule. in the case of svg fonts, the url points to an element within a document containing svg font def
initions. if the element reference is omitted, a reference to the first defined font is implied. similarly, font container formats that can contain more than one font load only one of the fonts for a given @font-face rule. fragment identifiers are used to indicate which font to load. if a container format lacks a defined fragment identifier scheme, a simple 1-based indexing scheme (e.g., "font-collect...
...imilarly, font container formats that can contain more than one font load only one of the fonts for a given @font-face rule. fragment identifiers are used to indicate which font to load. if a container format lacks a defined fragment identifier scheme, a simple 1-based indexing scheme (e.g., "font-collection#1" for the first font, "font-collection#2" for the second font, etc.) is used. ...
...hat can contain more than one font load only one of the fonts for a given @font-face rule. fragment identifiers are used to indicate which font to load. if a container format lacks a defined fragment identifier scheme, a simple 1-based indexing scheme (e.g., "font-collection#1" for the first font, "font-collection#2" for the second font, etc.) is used. ...
...mily-name> ) ]#where <family-name> = <string> | <custom-ident>+ examples specifying font resources using url() and local() @font-face { font-family: examplefont; src: local(example font), url('examplefont.woff') format("woff"), url('examplefont.otf') format("opentype"); } specifications specification status comment css fonts module level 3the def
inition of 'src' in that specification. candidate recommendation
initial def
inition ...
prefers-reduced-motion - CSS: Cascading Style Sheets
reducedmotion 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="animation">animated box</div> css .animation { animation: pulse 1s linear inf
inite both; } /* tone down the animation to avoid vestibular motion triggers like scaling or panning large objects. */ @media (prefers-reduced-motion) { .animation { animation-name: dissolve; } } .animation { background-color: #306; color: #fff; font: 1.2em sans-serif; width: 10em; padding: 1em; border-radius: 1em; text-align: center; } @keyframes pulse { 0% { transform: s...
... ...
... ...
... ...
@media - CSS: Cascading Style Sheets
ws for less verbose media queries when testing for any feature accepting a range, as shown in the below examples: @media (height > 600px) { body { line-height: 1.4; } } @media (400px <= width <= 700px) { body { line-height: 1.4; } } for more examples, please see using media queries. ...
... adds scripting, pointer, hover, update, overflow-block, and overflow-inline media features. ...
...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 def
inition of '@media' in that specification. defines the basic syntax of the @media rule. css working group drafts github issues media queries level 4the def
inition of '@media' in that specification. adds scripting, pointer, hover, update, overflow-block, and overflow-inline media features. ...
...a queries level 4the def
inition of '@media' in that specification. adds scripting, pointer, hover, update, overflow-block, and overflow-inline media features. deprecates all media types except for screen, print, speech, and all. makes the syntax more flexible by adding, among other things, the or keyword. css working group drafts github issues media queriesthe def
inition of '@media' in that specification. css level 2 (revision 1)the def
inition of '@media' in that specification.
initial def
inition. ...
width - CSS: Cascading Style Sheets
be set max-width. syntax /* an example with one viewport value: */ @viewport { width: 320px; } /* an example with two viewport values: */ @viewport { width: 320px, 120px; } values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. ...
...two viewport values: */ @viewport { width: 320px, 120px; } values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the width or height of the
initial viewport at zoom factor 1.0, for horizontal and vertical lengths respectively. must be non-negative. ...
... { width: 320px, 120px; } values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the width or height of the
initial viewport at zoom factor 1.0, for horizontal and vertical lengths respectively. must be non-negative. ...
...ute lengthmax-width: the percentage as specified or the absolute length or none formal syntax <viewport-length>{1,2}where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting minimum and maximum width @viewport { width: 500px; } specifications specification status comment css device adaptationthe def
inition of '"min-width" descriptor' in that specification. working draft
initial def
inition ...
zoom - CSS: Cascading Style Sheets
the zoom css descriptor sets the
initial zoom factor of a document defined by the @viewport at-rule. a zoom factor of 1.0 or 100% corresponds to no zooming. larger values are zoomed in. smaller values are zoomed out. syntax /* keyword value */ zoom: auto; /* <number> values */ zoom: 0.8; zoom: 2.0; /* <percentage> values */ zoom: 150%; values auto the user agent will set the document's
initial zoom factor. the user agent may use the size of canvas area on which the document is rendered to determine that factor. <number> a non-negative number used as the zoom factor. <percentage> a non-negative percentage value used as the zoom factor. ...
...> values */ zoom: 0.8; zoom: 2.0; /* <percentage> values */ zoom: 150%; values auto the user agent will set the document's
initial zoom factor. the user agent may use the size of canvas area on which the document is rendered to determine that factor. <number> a non-negative number used as the zoom factor. <percentage> a non-negative percentage value used as the zoom factor. ...
... /* <percentage> values */ zoom: 150%; values auto the user agent will set the document's
initial zoom factor. the user agent may use the size of canvas area on which the document is rendered to determine that factor. <number> a non-negative number used as the zoom factor. <percentage> a non-negative percentage value used as the zoom factor. formal def
inition related at-rule@viewport
initial valueautopercentagesthe zoom factor itselfcomputed valueauto, or a non-negative number or percentage as specified formal syntax auto | <number> | <percentage> examples setting viewport zoom factor @viewport { zoom: 2.0; } specifications specification status comment css device adaptationthe def
inition of '"zoom" descriptor' in that specification. working...
...utopercentagesthe zoom factor itselfcomputed valueauto, or a non-negative number or percentage as specified formal syntax auto | <number> | <percentage> examples setting viewport zoom factor @viewport { zoom: 2.0; } specifications specification status comment css device adaptationthe def
inition of '"zoom" descriptor' in that specification. working draft
initial specification ...
Alternative style sheets - CSS: Cascading Style Sheets
lied. use rel="stylesheet" to link to the default style, and rel="alternate stylesheet" to link to alternative style sheets. this tells the browser which style sheet title should be selected by default, and makes that default selection apply in browsers that do not support alternate style sheets. ...
... sheets. this tells the browser which style sheet title should be selected by default, and makes that default selection apply in browsers that do not support alternate style sheets. specifications specification status comment html living standardthe def
inition of 'link type "alternate"' in that specification. living standard html living standardthe def
inition of 'alternative stylesheet' in that specification. ...
...n apply in browsers that do not support alternate style sheets. specifications specification status comment html living standardthe def
inition of 'link type "alternate"' in that specification. living standard html living standardthe def
inition of 'alternative stylesheet' in that specification. living standard html living standardthe def
inition of 'the "title" attribute for the style element' in that specification. living standard html living standardthe def
inition of 'meta http-equiv="default-style")' in that specification. living standard css object model (cssom)the def
inition of 'css style sheet collections' in that specification. working draft the css om specification defines the concepts of ...
...ollections' in that specification. working draft the css om specification defines the concepts of the style sheet set name, its disabled flag, and the preferred css style sheet set name. it defines how these are determined, and lets the html specification define the html-specific behaviors by requiring it to define when to create a css style sheet. html 4.01 specificationthe def
inition of 'alternative style sheets' in that specification. recommendation earlier, the html specification itself defined the concept of preferred and alternate stylesheets. ...
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
d 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 def
initions in box alignment level 3 will supersede those of flexbox: "note: while the alignment properties are defined in css box alignment [css-align-3], flexible box layout reproduces the def
initions of the relevant ones here so as to not create a normative dependency that may slow down advancement of the spec. these properties apply only to flex layout until css box alignment level 3 is finished an...
... as to not create a normative dependency that may slow down advancement of the spec. these properties apply only to flex layout until css box alignment level 3 is finished and defines their effect for other layout modes. ...
...they have been renamed and moved to box alignment in order that they can be used in all layout methods — this will ultimately include flexbox. until browsers implement the gap properties for flexbox, margins have to be used to create gaps between items. ...
...ly use css and the writing-mode property to change an entire document to another writing mode. this would be done via html, by adding a dir and lang attribute to the html element to indicate the document language and default text direction. this would mean that the document would display correctly even if css did not load. flexbox and other layout methods the flexbox specification contains a def
inition of what happens if an item uses another layout method and then becomes a flex item. for example, if an item is floated and then its parent becomes a flex container. or, how a flex container behaves as part of layout. an element set to display: flex behaves in most ways like any other block level container that establishes a containing block. floats will not intrude, and the containers' margin...
Layout using named grid lines - CSS: Cascading Style Sheets
four</div> </div> everything else about line-based placement still works in the same way and you can mix named lines and line numbers. naming lines is useful when creating a responsive design where you redefine the grid, rather than then needing to redefine the content position by changing the line number in your media queries, you can ensure that the line is always named the same in your def
initions. giving lines multiple names you may want to give a line more than one name, perhaps it denotes the sidebar-end and the main-start for example. to do this add the names inside the square brackets with whitespace between them [sidebar-end main-start]. you can then refer to that line by either of the names. implicit grid areas from named lines when naming the lines, i mentioned that you can...
...olumns. this means i get a grid area named content, and could place something in that area should i wish to. * {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; } i’m using the same grid def
initions as above, however this time i am going to place a single item into the named area content. .wrapper { display: grid; grid-template-columns: [main-start] 1fr [content-start] 1fr [content-end] 1fr [main-end]; grid-template-rows: [main-start] 100px [content-start] 100px [content-end] 100px [main-end]; } .thing { grid-area: content; } <div class="wrapper"> <div class="thing">i am pla...
...it is worth taking a little bit of time to plan your naming strategy when starting out creating your grid layout. by selecting names that will make sense to you and your team you will help everyone to use the layouts you create more easily. multiple lines with the same name with repeat() if you want to give all of the lines in your grid a unique name then you will need to write out the track def
inition long-hand rather than using the repeat syntax, as you need to add the name in square brackets while defining the tracks. if you do use the repeat syntax you will end up with multiple lines that have the same name, however this can be very useful too. in this next example i am creating a grid with twelve equal width columns. before defining the 1fr size of the column track i am also defining a...
...e below would create an eight track grid, with a narrower 1fr width column named col1-start followed by a wider 3fr column named col2-start. .wrapper { grid-template-columns: repeat(4, [col1-start] 1fr [col2-start] 3fr); } if your repeating syntax puts two lines next to each other then they will be merged, and create the same result as giving a line multiple names in a non-repeating track def
inition. the following def
inition, creates four 1fr tracks, which each have a start and end line. .wrapper { grid-template-columns: repeat(4, [col-start] 1fr [col-end] ); } if we write this def
inition out without using repeat notation it would look like this. .wrapper { grid-template-columns: [col-start] 1fr [col-end col-start] 1fr [col-end col-start] 1fr [col-end col-start] 1fr [col-end]; } ...
Using CSS transitions - CSS: Cascading Style Sheets
, and how the transition will run (by defining a timing function, e.g. linearly or quick at the beginning, slow at the end). which css properties can be transitioned? the web author can define which property has to be animated and in which way. this allows the creation of complex transitions. as it doesn't make sense to animate some properties, the list of animatable properties is limited to a f
inite 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 requirement and others, like those based on webkit, are less strict. using animations with auto may lead to unpredictable results, de...
... 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 very frustrating to have to spend lots of time debugging in css. you can control the individual components of the transition with the following sub-properties: (note that these transitions loop inf
initely only for the purpose of our examples; css transitions only visualize a property change from start to finish. if you need visualizations that loop, look into the css animation property.) transition-property specifies the name or names of the css properties to which transitions should be applied. only properties listed here are animated during transitions; changes to all other properties occ...
... #333; background-color: #fff; } this css establishes the look of the menu, with the background and text colors both changing when the element is in its :hover and :focus states. javascript examples care should be taken when using a transition immediately after: adding the element to the dom using .appendchild() removing an element's display: none; property. this is treated as if the
initial state had never occurred and the element was always in its final state. the easy way to overcome this limitation is to apply a window.settimeout() of a handful of milliseconds before changing the css property you intend to transition to. using transitions to make javascript functionality smooth transitions are a great tool to make things look much smoother without having to do anything to y...
...onrun", signalstart, true); el.addeventlistener("transitionstart", signalstart, true); note: the transitionend event doesn't fire if the transition is aborted before the transition is completed because either the element is made display: none or the animating property's value is changed. specifications specification status comment css transitions working draft
initial def
inition ...
CSS reference - CSS: Cascading Style Sheets
e index of selectors, pseudo-classes, and pseudo-elements below. the syntax for each specified value depends on the data type defined for each specified property. style rule examples strong { color: red; } div.menu-bar li:hover > ul { display: block; } for a beginner-level introduction to the syntax of selectors, see our guide on css selectors. be aware that any syntax error in a rule def
inition invalidates the entire rule. invalid rules are ignored by the browser. note that css rule def
initions are entirely (ascii) text-based, whereas dom-css / cssom (the rule management system) is object-based. at-rule syntax as the structure of at-rules varies widely, please see at-rule to find the syntax of the specific one you want. keyword index note: the property names in this index do not...
...areagrid-auto-columnsgrid-auto-flowgrid-auto-rowsgrid-columngrid-column-endgrid-column-startgrid-rowgrid-row-endgrid-row-startgrid-templategrid-template-areasgrid-template-columnsgrid-template-rowshhzhanging-punctuationheightheight (@viewport)@historical-forms:hoverhsl()hsla()hue-rotate()hyphensi<ident><image>image()image-orientationimage-renderingimage-set()@importin:in-range:indeterminateinherit
initialinline-sizeinsetinset()inset-blockinset-block-endinset-block-startinset-inlineinset-inline-endinset-inline-start<integer>:invalidinvert()isolationjjustify-contentjustify-itemsjustify-selfkkhz@keyframesl:lang:last-child:last-of-typeleader():leftleft@left-bottom<length><length-percentage>letter-spacingline-breakline-heightlinear-gradient():linklist-stylelist-style-imagelist-style-positionlist-sty...
... a member of all of those columns. pseudo pseudo classes : specifies a special state of the selected element(s). pseudo elements :: represents entities that are not included in html. see also: selectors in the selectors level 4 specification. ...
...l state of the selected element(s). pseudo elements :: represents entities that are not included in html. see also: selectors in the selectors level 4 specification. ...
align-content - CSS: Cascading Style Sheets
end the items are packed flush to each other against the end edge of the alignment container in the cross axis. flex-start the items are packed flush to each other against the edge of the alignment container depending on the flex container'...
...ignment keyword. if the chosen keyword means that the item overflows the alignment container causing data loss, the item is instead aligned as if the alignment mode were start. unsafe used alongside an alignment keyword. regardless of the relative sizes of the item and alignment container and whether overflow which causes data loss might happen, the given alignment value is honored. ...
...eyword. if the chosen keyword means that the item overflows the alignment container causing data loss, the item is instead aligned as if the alignment mode were start. unsafe used alongside an alignment keyword. regardless of the relative sizes of the item and alignment container and whether overflow which causes data loss might happen, the given alignment value is honored. ...
...id('display'); var container = document.getelementbyid('container'); values.addeventlistener('change', function (evt) { container.style.aligncontent = evt.target.value; }); display.addeventlistener('change', function (evt) { container.classname = evt.target.value; }); result specifications specification status comment css box alignment module level 3the def
inition of 'align-content' in that specification. working draft adds the [ first | last ]? baseline, start, end, left, right, unsafe | safe values. css flexible box layout modulethe def
inition of 'align-content' in that specification. candidate recommendation
initial def
inition
initial valuenormalapplies tomulti-line flex containersinheritednocomputed valueas specifiedanima...
align-items - CSS: Cascading Style Sheets
in static position of absolutely-positioned layouts, the keyword behaves as stretch. for flex items, the keyword b...
...ignment keyword. if the chosen keyword means that the item overflows the alignment container causing data loss, the item is instead aligned as if the alignment mode were start. unsafe used alongside an alignment keyword. regardless of the relative sizes of the item and alignment container and whether overflow which causes data loss might happen, the given alignment value is honored. ...
...eyword. if the chosen keyword means that the item overflows the alignment container causing data loss, the item is instead aligned as if the alignment mode were start. unsafe used alongside an alignment keyword. regardless of the relative sizes of the item and alignment container and whether overflow which causes data loss might happen, the given alignment value is honored. ...
...byid('display'); var container = document.getelementbyid('container'); values.addeventlistener('change', function (evt) { container.style.alignitems = evt.target.value; }); display.addeventlistener('change', function (evt) { container.classname = evt.target.value; }); result specifications specification status comment css box alignment module level 3the def
inition of 'align-items' in that specification. working draft update to latest syntax def
initions. css flexible box layout modulethe def
inition of 'align-items' in that specification. candidate recommendation
initial def
inition ...
animation-iteration-count - CSS: Cascading Style Sheets
is used. 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. it is often convenient to use the shorthand property animation to set all animation properties at once. syntax /* keyword value */ animation-iteration-count: inf
inite; /* <number> values */ animation-iteration-count: 3; animation-iteration-count: 2.4; /* multiple values */ animation-iteration-count: 2, 0, inf
inite; the animation-iteration-count property is specified as one or more comma-separated values. values inf
inite the animation will repeat forever. <number> the number of times the animation will repeat; this is 1 by default. you may specify no...
...ay part of an animation cycle: for example, 0.5 will play half of the animation cycle. negative values are invalid. note: when you specify multiple values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property values. ...
...f an animation cycle: for example, 0.5 will play half of the animation cycle. negative values are invalid. note: when you specify multiple values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property values. ...
...he animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property values. formal def
inition
initial value1applies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <single-animation-iteration-count>#where <single-animation-iteration-count> = inf
inite | <number> examples see css animations for examples. specifications specification status comment css animationsthe def
inition of 'animation-iteration-count' in that specification. working draft
initial def
inition. ...
animation-name - CSS: Cascading Style Sheets
equest. it is often convenient to use the shorthand property animation to set all animation properties at once. syntax /* single animation */ animation-name: none; animation-name: test_05; animation-name: -specific; animation-name: sliding-vertically; /* multiple animations */ animation-name: test1, animation4; animation-name: none, -moz-specific, sliding; /* global values */ animation-name:
initial animation-name: inherit animation-name: unset values none a special keyword denoting no keyframes. it can be used to deactivate an animation without changing the ordering of the other identifiers, or to deactivate animations coming from the cascade. <custom-ident> a name identifying the animation. this identifier is composed of a combination of case-sensitive letters a to z, numbers 0 t...
... or to deactivate animations coming from the cascade. <custom-ident> a name identifying the animation. this identifier is composed of a combination of case-sensitive letters a to z, numbers 0 to 9, underscores (_), and/or dashes (-). the first non-dash character must be a letter. also, two dashes are forbidden at the beginning of the identifier. ...
...beginning of the identifier. furthermore, the identifier can't be none, unset,
initial, or inherit. note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property values. formal def
inition
initial valuenoneapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ none | <keyframes-name> ]#where <keyframes-name> = <custom-ident> | <string> examples see css animations for examples. ...
...values. formal def
inition
initial valuenoneapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ none | <keyframes-name> ]#where <keyframes-name> = <custom-ident> | <string> examples see css animations for examples. specifications specification status comment css animationsthe def
inition of 'animation-name' in that specification. working draft
initial def
inition. ...
animation-play-state - CSS: Cascading Style Sheets
animation will start the animation from where it left off at the time it was paused, rather than starting over from the beginning of the animation sequence. syntax /* single animation */ animation-play-state: running; animation-play-state: paused; /* multiple animations */ animation-play-state: paused, running, running; /* global values */ animation-play-state: inherit; animation-play-state:
initial; animation-play-state: unset; values running the animation is currently playing. paused the animation is currently paused. note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple anim...
... values running the animation is currently playing. paused the animation is currently paused. note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property values. ...
... running the animation is currently playing. paused the animation is currently paused. note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property values. ...
... formal def
inition
initial valuerunningapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <single-animation-play-state>#where <single-animation-play-state> = running | paused examples see css animations for examples. specifications specification status comment css animationsthe def
inition of 'animation-play-state' in that specification. working draft
initial def
inition. ...
aspect-ratio - CSS: Cascading Style Sheets
css property sets a preferred aspect ratio for the box, which will be used in the calculation of auto sizes and some other layout functions. this property is not yet implemented in browsers, however some browsers are implementing this internally in order to provide the aspect ratio mapping described below. syntax aspect-ratio: 1 / 1; /* global values */ aspect-ratio: inherit; aspect-ratio:
initial; aspect-ratio: unset; values <auto> replaced elements with an intrinsic aspect ratio use that aspect ratio, otherwise the box has no preferred aspect ratio. size calculations involving intrinsic aspect ratio always work with the content box dimensions. <ratio> the box’s preferred aspect ratio is the specified ratio of width / height. size calculations involving preferred aspect ratio...
...trinsic aspect ratio use that aspect ratio, otherwise the box has no preferred aspect ratio. size calculations involving intrinsic aspect ratio always work with the content box dimensions. <ratio> the box’s preferred aspect ratio is the specified ratio of width / height. size calculations involving preferred aspect ratio work with the dimensions of the box specified by box-sizing. ...
...spect ratio use that aspect ratio, otherwise the box has no preferred aspect ratio. size calculations involving intrinsic aspect ratio always work with the content box dimensions. <ratio> the box’s preferred aspect ratio is the specified ratio of width / height. size calculations involving preferred aspect ratio work with the dimensions of the box specified by box-sizing. ...
...eight attributes. this appears in the browser's internal ua stylesheet. chrome is also shipping this feature. in firefox, the internal stylesheet rule looks like this: img, input[type="image"], video, embed, iframe, marquee, object, table { aspect-ratio: attr(width) / attr(height); } specifications specification status comment css box sizing module level 4the def
inition of 'aspect-ratio' in that specification. editor's draft
initial def
inition 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for...
backdrop-filter - CSS: Cascading Style Sheets
%); backdrop-filter: drop-shadow(4px 4px 10px blue); backdrop-filter: grayscale(30%); backdrop-filter: hue-rotate(120deg); backdrop-filter: invert(70%); backdrop-filter: opacity(20%); backdrop-filter: sepia(90%); backdrop-filter: saturate(80%); /* multiple filters */ backdrop-filter: url(filters.svg#filter) blur(4px) saturate(150%); /* global values */ backdrop-filter: inherit; backdrop-filter:
initial; backdrop-filter: unset; syntax values none no filter is applied to the backdrop. <filter-function-list> a space-separated list of <filter-function>s or an svg filter that will be applied to the backdrop. formal def
inition
initial valuenoneapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas...
... ...
... ...
... ...
background-attachment - CSS: Cascading Style Sheets
nteractive 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 /* keyword values */ background-attachment: scroll; background-attachment: fixed; background-attachment: local; /* global values */ background-attachment: inherit; background-attachment:
initial; background-attachment: unset; the background-attachment property is specified as one of the keyword values from the list below. values fixed the background is fixed relative to the viewport. even if an element has a scrolling mechanism, the background doesn't move with the element. (this is not compatible with background-clip: text.) local the background is fixed relative to the elem...
...a scrolling mechanism, the background scrolls with the element's contents, and the background painting area and background positioning area are relative to the scrollable area of the element rather than to the border framing them. scroll the background is fixed relative to the element itself and does not scroll with its contents. (it is effectively attached to the element's border.) formal def
inition
initial valuescrollapplies toall elements. it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <attachment>#where <attachment> = scroll | fixed | local examples simple example html <p> there were doors all round the hall, but they were all locked; and when alice had been all the way down one side and up the oth...
...t fitted! ...
... background-repeat: no-repeat, repeat-y; } result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'background-attachment' in that specification. candidate recommendation the shorthand property has been extended to support multiple backgrounds and the local value. css level 2 (revision 1)the def
inition of 'background-attachment' in that specification. recommendation no significant change. css level 1the def
inition of 'background-attachment' in that specification. recommendation no significant change. ...
background-repeat - CSS: Cascading Style Sheets
: repeat-x; background-repeat: repeat-y; background-repeat: repeat; background-repeat: space; background-repeat: round; background-repeat: no-repeat; /* two-value syntax: horizontal | vertical */ background-repeat: repeat space; background-repeat: repeat repeat; background-repeat: round space; background-repeat: no-repeat round; /* global values */ background-repeat: inherit; background-repeat:
initial; background-repeat: unset; values <repeat-style> the one-value syntax is a shorthand for the full two-value syntax: single value two-value equivalent repeat-x repeat no-repeat repeat-y no-repeat repeat repeat repeat repeat space space space round round round no-repeat no-rep...
...ree times, might stretch until each repetition is 300px wide, and then another image will be added. they will then compress to 225px. no-repeat the image is not repeated (and hence the background image painting area will not necessarily be entirely covered). the position of the non-repeated background image is defined by the background-position css property. formal def
inition
initial valuerepeatapplies toall elements. it also applies to ::first-letter and ::first-line.inheritednocomputed valuea list, each item consisting of two keywords, one per dimensionanimation typediscrete formal syntax <repeat-style>#where <repeat-style> = repeat-x | repeat-y | [ repeat | space | round | no-repeat ]{1,2} examples setting background-repeat html <ol> <li>no-repeat <...
...), url(https://developer.cdn.mozilla.net/media/redesign/img/favicon32.png); background-repeat: repeat-x, repeat-y; height: 144px; } result in this example, each list item is matched with a different value of background-repeat. ...
...
inition of 'background-repeat' in that specification. candidate recommendation adds support for multiple background images, the two-value syntax allowing distinct repetition behavior for the horizontal and vertical directions, the space and round keywords, and for backgrounds on inline-level elements by precisely defining the background painting area. css level 2 (revision 1)the def
inition of 'background-repeat' in that specification. recommendation no significant changes. css level 1the def
inition of 'background-repeat' in that specification. recommendation
initial def
inition. ...
background - CSS: Cascading Style Sheets
marily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. if the image contains information critical to understanding the page's overall purpose, it is better to describe it semantically in the document. mdn understanding wcag, guideline 1.1 explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0 formal def
inition
initial valueas each of the properties of the shorthand:background-image: nonebackground-position: 0% 0%background-size: auto autobackground-repeat: repeatbackground-origin: padding-boxbackground-clip: border-boxbackground-attachment: scrollbackground-color: transparentapplies toall elements. it also applies to ::first-letter and ::first-line.inheritednopercentagesas each of the properties of...
..."topbanner"> starry sky<br/> twinkle twinkle<br/> starry sky </p> <p class="warning">here is a paragraph<p> css .warning { background: pink; } .topbanner { background: url("https://mdn.mozillademos.org/files/11983/starsolid.gif") #99f repeat-y fixed; } result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'background' in that specification. candidate recommendation the shorthand property has been extended to support multiple backgrounds and the new background-size, background-origin and background-clip properties. css level 2 (revision 1)the def
inition of 'background' in that specification. recommendation no significant changes css level 1the def
inition of 'back...
...ate recommendation the shorthand property has been extended to support multiple backgrounds and the new background-size, background-origin and background-clip properties. ...
...ndation the shorthand property has been extended to support multiple backgrounds and the new background-size, background-origin and background-clip properties. ...
border-block-start-width - CSS: Cascading Style Sheets
e to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <'border-width'> values */ border-block-start-width: 5px; border-block-start-width: thick; related properties are border-block-end-width, border-inline-start-width, and border-inline-end-width, which define the other border widths of the element. ...
...block-end-width, border-inline-start-width, and border-inline-end-width, which define the other border widths of the element.
initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length values <'border-width'> the width of the border. see border-width. ...
...-width, border-inline-start-width, and border-inline-end-width, which define the other border widths of the element.
initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length values <'border-width'> the width of the border. see border-width. ...
...dth with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 1px solid blue; border-block-start-width: 5px; } results specifications specification status comment css logical properties and values level 1the def
inition of 'border-block-start-width' in that specification. editor's draft
initial def
inition ...
border-bottom-left-radius - CSS: Cascading Style Sheets
e. a background, being an image or a color, is clipped at the border, even a rounded one; the exact location of the clipping is defined by the value of the background-clip property. note: if the value of this property is not set in a border-radius shorthand property that is applied to the element after the border-bottom-left-radius css property, the value of this property is then reset to its
initial value by the shorthand property. syntax /* the corner is a circle */ /* border-bottom-left-radius: radius */ border-bottom-left-radius: 3px; /* percentage values */ /* circle if box is a square or ellipse if box is a rectangle */ border-bottom-left-radius: 20%; /* same as above: 20% of horizontal(width) and vertical(height) */ border-bottom-left-radius: 20% 20%; /* 20% of horizontal(widt...
...at corner. values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal def
inition
initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typ...
...border-bottom-left-radius: 40%; } . ...
...is clipped at the border div { border-bottom-left-radius:40%; border-style: black 3px double; background-color: rgb(250,20,70); background-clip: content-box; } specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-bottom-left-radius' in that specification. candidate recommendation
initial def
inition ...
border-bottom-right-radius - CSS: Cascading Style Sheets
. a background, being an image or a color, is clipped at the border, even a rounded one; the exact location of the clipping is defined by the value of the background-clip property. note: if the value of this property is not set in a border-radius shorthand property that is applied to the element after the border-bottom-right-radius css property, the value of this property is then reset to its
initial value by the shorthand property. syntax /* the corner is a circle */ /* border-bottom-right-radius: radius */ border-bottom-right-radius: 3px; /* percentage values */ border-bottom-right-radius: 20%; /* corner of a circle if box is a square or else corner of a rectangle */ border-bottom-right-radius: 20% 20%; /* same as above */ /* 20% of horizontal(width) and vertical(height) */ border-bot...
...at corner. values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal def
inition
initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typ...
...rder-bottom-right-radius: 40%; } . ...
... clipped at the border div { border-bottom-right-radius:40%; border-style: black 3px double; background-color: rgb(250,20,70); background-clip: content-box; } specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-bottom-right-radius' in that specification. candidate recommendation
initial def
inition ...
border-bottom-style - CSS: Cascading Style Sheets
the corners. syntax /* keyword values */ border-bottom-style: none; border-bottom-style: hidden; border-bottom-style: dotted; border-bottom-style: dashed; border-bottom-style: solid; border-bottom-style: double; border-bottom-style: groove; border-bottom-style: ridge; border-bottom-style: inset; border-bottom-style: outset; /* global values */ border-bottom-style: inherit; border-bottom-style:
initial; border-bottom-style: unset; the border-bottom-style property is specified as a single keyword chosen from those available for the border-style property. formal def
inition
initial valuenoneapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <line-style>where <line-style> = none | hidden | dotted | dashed | so...
... ...
... ...
...t;} .b10 {border-bottom-style: outset;} result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-bottom-style' in that specification. candidate recommendation no significant change. css level 2 (revision 1)the def
inition of 'border-bottom-style' in that specification. recommendation
initial def
inition. ...
border-bottom-width - CSS: Cascading Style Sheets
tive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword values */ border-bottom-width: thin; border-bottom-width: medium; border-bottom-width: thick; /* <length> values */ border-bottom-width: 10em; border-bottom-width: 3vmax; border-bottom-width: 6px; /* global keywords */ border-bottom-width: inherit; border-bottom-width:
initial; border-bottom-width: unset; values <line-width> defines the width of the border, either as an explicit nonnegative <length> or a keyword. if it's a keyword, it must be one of the following values: thin a thin border medium a medium border thick a thick border note: because the s...
... a medium border thick a thick border note: because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document. formal def
inition
initial valuemediumapplies toall elements. it also applies to ::first-letter.inheritednocomputed valuethe absolute length or 0 if border-bottom-style is none or hiddenanimation typea length formal syntax <line-width>where <line-width> = <length> | thin | medium | thick examples comparing bottom border widths html <div>element 1</div> <div>element 2</div> css div { border: 1px solid ...
... browser compatibility ...
...argin: 1em 0; } div:nth-child(1) { border-bottom-width: thick; } div:nth-child(2) { border-bottom-width: 2em; } result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-bottom-width' in that specification. candidate recommendation no significant change. css level 2 (revision 1)the def
inition of 'border-bottom-width' in that specification. recommendation no significant change. css level 1the def
inition of 'border-bottom-width' in that specification. recommendation
initial def
inition. 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/m...
border-bottom - CSS: Cascading Style Sheets
rder-bottom-color border-bottom-style border-bottom-width syntax border-bottom: 1px; border-bottom: 2px dotted; border-bottom: medium dashed blue; the three values of the shorthand property can be specified in any order, and one or two of them may be omitted. values <br-width> see border-bottom-width. <br-style> see border-bottom-style. <color> see border-bottom-color. formal def
inition
initial valueas each of the properties of the shorthand:border-bottom-width: mediumborder-bottom-style: noneborder-bottom-color: currentcolorapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-bottom-style: as specifiedborder-bo...
...ber> | <angle> examples applying a bottom border html <div> this box has a border on the bottom side. </div> css div { border-bottom: 4px dashed blue; background-color: gold; height: 100px; width: 100px; font-weight: bold; text-align: center; } results specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-bottom' in that specification. candidate recommendation no direct changes, though the modification of values for the border-bottom-color do apply to it. css level 2 (revision 1)the def
inition of 'border-bottom' in that specification. recommendation no significant changes. css level 1the def
inition of 'border-bottom' in that specification. recommendat...
...'border-bottom' in that specification. candidate recommendation no direct changes, though the modification of values for the border-bottom-color do apply to it. ...
...tom' in that specification. candidate recommendation no direct changes, though the modification of values for the border-bottom-color do apply to it. ...
border-collapse - CSS: Cascading Style Sheets
active-examples and send us a pull request. when cells are collapsed, the border-style value of inset behaves like groove, and outset behaves like ridge. when cells are separated, the distance between cells is defined by the border-spacing property. ...
...values */ border-collapse: inherit; border-collapse:
initial; border-collapse: unset; the border-collapse property is specified as a single keyword, which may be chosen from the list below. values collapse adjacent cells have shared borders (the collapsed-border table rendering model). separate adjacent cells have distinct borders (the separated-border table rendering model). ...
... border-collapse: inherit; border-collapse:
initial; border-collapse: unset; the border-collapse property is specified as a single keyword, which may be chosen from the list below. values collapse adjacent cells have shared borders (the collapsed-border table rendering model). separate adjacent cells have distinct borders (the separated-border table rendering model). ...
...blue; } .gk { border-color: black red; } .ed { border-color: blue gold; } .tr { border-color: aqua; } .sa { border-color: silver blue; } .wk { border-color: gold blue; } .ch { border-color: red yellow green blue; } .bk { border-color: navy blue teal aqua; } .op { border-color: red; } result specifications specification status comment css level 2 (revision 1)the def
inition of 'border-collapse' in that specification. recommendation
initial def
inition ...
border-color - CSS: Cascading Style Sheets
when one value is specified, it applies the same color to all four sides. when two values are specified, the first color applies to the top and bottom, the second to the left and right. when three values are specified, the first color applies to the top, the second to the left and rig...
...specified, the first color applies to the top and bottom, the second to the left and right. when three values are specified, the first color applies to the top, the second to the left and right, the third to the bottom. when four values are specified, the colors apply to the top, right, bottom, and left in that order (clockwise). values <color> defines the color of the border. formal def
inition
initial valueas each of the properties of the shorthand:border-top-color: currentcolorborder-right-color: currentcolorborder-bottom-color: currentcolorborder-left-color: currentcolorapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-bottom-color: computed colorborder-left-color: computed colorborder-right-color:...
...d; } /* set width and style for all divs */ div { border: solid 0.3em; width: auto; margin: 0.5em; padding: 0.5em; } ul { margin: 0; list-style: none; } result specifications specification status comment css logical properties and values level 1 editor's draft added the logical keyword. css backgrounds and borders module level 3the def
inition of 'border-color' in that specification. candidate recommendation the transparent keyword has been removed as it is now a part of the <color> data type. css level 2 (revision 1)the def
inition of 'border-color' in that specification. recommendation the property is now a shorthand property. css level 1the def
inition of 'border-color' in that specification. recomm...
...er-color' in that specification. candidate recommendation the transparent keyword has been removed as it is now a part of the <color> data type. css level 2 (revision 1)the def
inition of 'border-color' in that specification. recommendation the property is now a shorthand property. css level 1the def
inition of 'border-color' in that specification. recommendation
initial def
inition. ...
border-inline-end-color - CSS: Cascading Style Sheets
itory. 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 border-inline-end-color: rebeccapurple; border-inline-end-color: #663399; related properties are border-block-start-color, border-block-end-color, and border-inline-start-color, which define the other border colors of the element. ...
...e-end-color: rebeccapurple; border-inline-end-color: #663399; related properties are border-block-start-color, border-block-end-color, and border-inline-start-color, which define the other border colors of the element.
initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color values <'color'> the color of the border. see color. ...
...or: rebeccapurple; border-inline-end-color: #663399; related properties are border-block-start-color, border-block-end-color, and border-inline-start-color, which define the other border colors of the element.
initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color values <'color'> the color of the border. see color. ...
... <'border-top-color'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-inline-end-color: red; } specifications specification status comment css logical properties and values level 1the def
inition of 'border-inline-end-color' in that specification. editor's draft
initial def
inition ...
border-inline-end-width - CSS: Cascading Style Sheets
ke to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <'border-width'> values */ border-inline-end-width: 2px; border-inline-end-width: thick; related properties are border-block-start-width, border-block-end-width, and border-inline-start-width, which define the other border widths of the element. ...
...lock-start-width, border-block-end-width, and border-inline-start-width, which define the other border widths of the element.
initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length values <'border-width'> the width of the border. see border-width. ...
...t-width, border-block-end-width, and border-inline-start-width, which define the other border widths of the element.
initial valuemediumapplies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length values <'border-width'> the width of the border. see border-width. ...
...rder with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 1px solid blue; border-inline-end-width: 5px; } results specifications specification status comment css logical properties and values level 1the def
inition of 'border-inline-end-width' in that specification. editor's draft
initial def
inition ...
border-inline-end - CSS: Cascading Style Sheets
r-inline-end maps depends on the element's writing mode, directionality, and text orientation. it corresponds to the border-top, border-right, border-bottom, or border-left property depending on the values defined for writing-mode, direction, and text-orientation. related properties are border-block-start, border-block-end, and border-inline-start, which define the other borders of the element. ...
...of the shorthand:border-inline-end-color: a colorborder-inline-end-style: discreteborder-inline-end-width: a length values the border-inline-end is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. <'border-style'> the line style of the border. see border-style. <'color'> the color of the border. see color. ...
...orthand:border-inline-end-color: a colorborder-inline-end-style: discreteborder-inline-end-width: a length values the border-inline-end is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. <'border-style'> the line style of the border. see border-style. <'color'> the color of the border. see color. ...
...> | <percentage><hue> = <number> | <angle> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; border-inline-end: 5px dashed blue; } specifications specification status comment css logical properties and values level 1the def
inition of 'border-inline-end' in that specification. editor's draft
initial def
inition ...
border-inline-start-style - CSS: Cascading Style Sheets
les project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <'border-style'> values */ border-inline-start-style: dashed; border-inline-start-style: dotted; border-inline-start-style: groove; related properties are border-block-start-style, border-block-end-style, and border-inline-end-style, which define the other border styles of the element. ...
...art-style: dotted; border-inline-start-style: groove; related properties are border-block-start-style, border-block-end-style, and border-inline-end-style, which define the other border styles of the element.
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete values <'border-style'> the line style of the border. see border-style. ...
...: dotted; border-inline-start-style: groove; related properties are border-block-start-style, border-block-end-style, and border-inline-end-style, which define the other border styles of the element.
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete values <'border-style'> the line style of the border. see border-style. ...
...order-top-style'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-inline-start-style: dashed; } specifications specification status comment css logical properties and values level 1the def
inition of 'border-inline-start-style' in that specification. editor's draft
initial def
inition ...
border-inline - CSS: Cascading Style Sheets
hich border-inline maps depends on the element's writing mode, directionality, and text orientation. it corresponds to the border-top and border-bottom or border-right, and border-left properties, depending on the values defined for writing-mode, direction, and text-orientation. the borders in the other dimension can be set with border-block, which sets border-block-start, and border-block-end. ...
...a shorthand for the following css properties: border-inline-color border-inline-style border-inline-width syntax values the border-inline is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. <'border-style'> the line style of the border. see border-style. <'color'> the color of the border. see color. ...
...nd for the following css properties: border-inline-color border-inline-style border-inline-width syntax values the border-inline is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. <'border-style'> the line style of the border. see border-style. <'color'> the color of the border. see color. ...
... | <angle> examples border with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; border-inline: 5px dashed blue; } results specifications specification status comment css logical properties and values level 1the def
inition of 'border-inline' in that specification. editor's draft
initial def
inition ...
border-left-width - CSS: Cascading Style Sheets
e to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword values */ border-left-width: thin; border-left-width: medium; border-left-width: thick; /* <length> values */ border-left-width: 10em; border-left-width: 3vmax; border-left-width: 6px; /* global keywords */ border-left-width: inherit; border-left-width:
initial; border-left-width: unset; values <line-width> defines the width of the border, either as an explicit nonnegative <length> or a keyword. if it's a keyword, it must be one of the following values: thin a thin border medium a medium border thick a thick border note: because the spe...
... a medium border thick a thick border note: because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document. formal def
inition
initial valuemediumapplies toall elements. it also applies to ::first-letter.inheritednocomputed valuethe absolute length or 0 if border-left-style is none or hiddenanimation typea length formal syntax <line-width>where <line-width> = <length> | thin | medium | thick examples comparing border widths html <div>element 1</div> <div>element 2</div> css div { border: 1px solid red; ma...
... ...
...d; margin: 1em 0; } div:nth-child(1) { border-left-width: thick; } div:nth-child(2) { border-left-width: 2em; } result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-left-width' in that specification. candidate recommendation no significant change. css level 2 (revision 1)the def
inition of 'border-left-width' in that specification. recommendation no significant change. css level 1the def
inition of 'border-left-width' in that specification. recommendation
initial def
inition. ...
border-radius - CSS: Cascading Style Sheets
he whole background, even if the element has no border; the exact position of the clipping is defined by the background-clip property. the border-radius property does not apply to table elements when border-collapse is collapse. note: as with any shorthand property, individual sub-properties cannot inherit, such as in border-radius:0 0 inherit inherit, which would partially override existing def
initions. instead, the individual longhand properties have to be used. constituent properties this property is a shorthand for the following css properties: border-bottom-left-radius border-bottom-right-radius border-top-left-radius border-top-right-radius syntax /* the syntax of the first radius allows one to four values */ /* radius is set for all 4 sides */ border-radius: 10px; /* top-l...
...this is used to set a single radius for the corners. followed optionally by "/" and one, two, three, or four <length> or <percentage> values. this is used to set an additional radius, so you can have elliptical corners. values radius is a <length...
.... is equivalent to: */ border-top-left-radius: 1em 5em; border-top-right-radius: 1em 5em; border-bottom-right-radius: 1em 5em; border-bottom-left-radius: 1em 5em; border-radius: 4px 3px 6px / 2px 4px; /* ... is equivalent to: */ border-top-left-radius: 4px 2px; border-top-right-radius: 3px 4px; border-bottom-right-radius: 6px 2px; border-bottom-left-radius: 3px 4px; formal def
inition
initial valueas each of the properties of the shorthand:border-top-left-radius: 0border-top-right-radius: 0border-bottom-right-radius: 0border-bottom-left-radius: 0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first...
...rder-radius: 40px; live samples sample 1 : http://jsfiddle.net/tripad/qngkj/2/ sample 2 : http://jsfiddle.net/tripad/qngkj/3/ sample 3 : http://jsfiddle.net/tripad/qngkj/4/ sample 4 : http://jsfiddle.net/tripad/qngkj/5/ sample 5 : http://jsfiddle.net/tripad/qngkj/6/ specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-radius' in that specification. candidate recommendation
initial def
inition ...
border-right-width - CSS: Cascading Style Sheets
interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword values */ border-right-width: thin; border-right-width: medium; border-right-width: thick; /* <length> values */ border-right-width: 10em; border-right-width: 3vmax; border-right-width: 6px; /* global keywords */ border-right-width: inherit; border-right-width:
initial; border-right-width: unset; values <line-width> defines the width of the border, either as an explicit nonnegative <length> or a keyword. if it's a keyword, it must be one of the following values: thin a thin border medium a medium border thick a thick border note: because the sp...
... a medium border thick a thick border note: because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document. formal def
inition
initial valuemediumapplies toall elements. it also applies to ::first-letter.inheritednocomputed valuethe absolute length or 0 if border-right-style is none or hiddenanimation typea length formal syntax <line-width>where <line-width> = <length> | thin | medium | thick examples comparing border widths html <div>element 1</div> <div>element 2</div> css div { border: 1px solid red; m...
... ...
... margin: 1em 0; } div:nth-child(1) { border-right-width: thick; } div:nth-child(2) { border-right-width: 2em; } result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-right-width' in that specification. candidate recommendation no significant change. css level 2 (revision 1)the def
inition of 'border-right-width' in that specification. recommendation no significant change. css level 1the def
inition of 'border-right-width' in that specification. recommendation
initial def
inition. ...
border-style - CSS: Cascading Style Sheets
when one value is specified, it applies the same style to all four sides. when two values are specified, the first style applies to the top and bottom, the second to the left and right. when three values are specified, the first style applies to the top, the second to the left and rig...
... embedded. it is the opposite of outset. when applied to a table cell with border-collapse set to collapsed, this value behaves like groove. outset displays a border that makes the element appear embossed. it is the opposite of inset. when applied to a table cell with border-collapse set to collapsed, this value behaves like ridge. formal def
inition
initial valueas each of the properties of the shorthand:border-top-style: noneborder-right-style: noneborder-bottom-style: noneborder-left-style: noneapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-bottom-style: as specifiedborder-left-style: as specifiedborder-right-style: as specifiedborder-top-style: as sp...
... ...
...} .b6 {border-style:double;} .b7 {border-style:groove;} .b8 {border-style:ridge;} .b9 {border-style:inset;} .b10 {border-style:outset;} result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-style' in that specification. candidate recommendation no change. css level 2 (revision 1)the def
inition of 'border-style' in that specification. recommendation adds hidden keyword value. css level 1the def
inition of 'border-style' in that specification. recommendation
initial def
inition. ...
border-top-width - CSS: Cascading Style Sheets
ontribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword values */ border-top-width: thin; border-top-width: medium; border-top-width: thick; /* <length> values */ border-top-width: 10em; border-top-width: 3vmax; border-top-width: 6px; /* global keywords */ border-top-width: inherit; border-top-width:
initial; border-top-width: unset; values <line-width> defines the width of the border, either as an explicit nonnegative <length> or a keyword. if it's a keyword, it must be one of the following values: thin a thin border medium a medium border thick a thick border note: because the spec...
... a medium border thick a thick border note: because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document. formal def
inition
initial valuemediumapplies toall elements. it also applies to ::first-letter.inheritednocomputed valuethe absolute length or 0 if border-top-style is none or hiddenanimation typea length formal syntax <line-width>where <line-width> = <length> | thin | medium | thick examples html <div>element 1</div> <div>element 2</div> css div { border: 1px solid red; margin: 1em 0; } div:nth-ch...
... ...
... red; margin: 1em 0; } div:nth-child(1) { border-top-width: thick; } div:nth-child(2) { border-top-width: 2em; } result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-top-width' in that specification. candidate recommendation no significant change. css level 2 (revision 1)the def
inition of 'border-top-width' in that specification. recommendation no significant change. css level 1the def
inition of 'border-top-width' in that specification. recommendation
initial def
inition. ...
border-width - CSS: Cascading Style Sheets
when one value is specified, it applies the same width to all four sides. when two values are specified, the first width applies to the top and bottom, the second to the left and right. when three values are specified, the first width applies to the top, the second to the left and rig...
... a medium border thick a thick border note: because the specification doesn't define the exact thickness denoted by each keyword, the precise result when using one of them is implementation-specific. nevertheless, they always follow the pattern thin ≤ medium ≤ thick, and the values are constant within a single document. formal def
inition
initial valueas each of the properties of the shorthand:border-top-width: mediumborder-right-width: mediumborder-bottom-width: mediumborder-left-width: mediumapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-bottom-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the ab...
...x; } #bival { border: solid red; border-width: 2px 10px; } #treval { border: dotted orange; border-width: 0.3em 0 9px; } #fourval { border: solid lightgreen; border-width: thin medium thick 1em; } p { width: auto; margin: 0.25em; padding: 0.25em; } result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-width' in that specification. candidate recommendation no direct change; the <length> css data type extension has an effect on this property. css level 2 (revision 1)the def
inition of 'border-width' in that specification. recommendation added the constraint that values' meaning must be constant inside a document. css level 1the def
inition of 'border-wid...
...candidate recommendation no direct change; the <length> css data type extension has an effect on this property. css level 2 (revision 1)the def
inition of 'border-width' in that specification. recommendation added the constraint that values' meaning must be constant inside a document. css level 1the def
inition of 'border-width' in that specification. recommendation
initial def
inition. ...
box-decoration-break - CSS: Cascading Style Sheets
interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the specified value will impact the appearance of the following properties: background border border-image box-shadow clip-path margin padding syntax /* keyword values */ box-decoration-break: slice; box-decoration-break: clone; /* global values */ box-decoration-break:
initial; box-decoration-break: inherit; box-decoration-break: unset; the box-decoration-break property is specified as one of the keyword values listed below. values slice the element is
initially rendered as if its box were not fragmented, after which the rendering for this hypothetical box is sliced into pieces for each line/column/page. note that the hypothetical box can be different for eac...
... clone each box fragment is rendered independently with the specified border, padding, and margin wrapping each fragment. the border-radius, border-image, and box-shadow are applied to each fragment independently. the background is also drawn independently for each fragment, which means that a background image with background-repeat: no-repeat may nevertheless repeat multiple times. ...
...each box fragment is rendered independently with the specified border, padding, and margin wrapping each fragment. the border-radius, border-image, and box-shadow are applied to each fragment independently. the background is also drawn independently for each fragment, which means that a background image with background-repeat: no-repeat may nevertheless repeat multiple times. ...
... vertically will result in the non-fragmented rendering. now, the same example but styled with box-decoration-break: clone results in: note here that each fragment has an identical replicated border, box-shadow, and background. you can try the block examples above in your browser. specifications specification status comment css fragmentation module level 3the def
inition of 'box-decoration-break' in that specification. candidate recommendation
initial def
inition. ...
color-adjust - CSS: Cascading Style Sheets
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 the behavior, but each user agent is allowed to decide for itself how to handle color-adjust in any given situation. formal def
inition
initial valueeconomyapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax economy | exact examples preserving low contrast in this example, a box is shown which uses a background-image and a translucent linear-gradient() function atop a black background color to have a dark blue gradient behind medium red text. for whatever reason, this is the d...
... ...
... ...
... ...
column-rule-color - CSS: Cascading Style Sheets
ub 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. ...
...values */ column-rule-color: red; column-rule-color: rgb(192, 56, 78); column-rule-color: transparent; column-rule-color: hsla(0, 100%, 50%, 0.6); /* global values */ column-rule-color: inherit; column-rule-color:
initial; column-rule-color: unset; the column-rule-color property is specified as a single <color> value. values <color> the color of the rule that separates columns. ...
... column-rule-color: red; column-rule-color: rgb(192, 56, 78); column-rule-color: transparent; column-rule-color: hsla(0, 100%, 50%, 0.6); /* global values */ column-rule-color: inherit; column-rule-color:
initial; column-rule-color: unset; the column-rule-color property is specified as a single <color> value. values <color> the color of the rule that separates columns. ...
... bunch of text split into three columns. the `column-rule-color` property is used to change the color of the line that is drawn between columns. don't you think that's wonderful?</p> css p { column-count: 3; column-rule-style: solid; column-rule-color: blue; } result specifications specification status comment css multi-column layout modulethe def
inition of 'column-rule-color' in that specification. working draft
initial def
inition. ...
column-rule - CSS: Cascading Style Sheets
ractive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. it is a shorthand property that sets the individual column-rule-* properties in a single, convenient declaration: column-rule-width, column-rule-style, and column-rule-color. note: as with all shorthand properties, any individual value that is not specified is set to its corresponding
initial value (possibly overriding values previously set using non-shorthand properties). syntax column-rule: dotted; column-rule: solid 8px; column-rule: solid blue; column-rule: thick inset blue; /* global values */ column-rule: inherit; column-rule:
initial; column-rule: unset; the column-rule property is specified as one, two, or three of the values listed below, in any order. values <'c...
...ule:
initial; column-rule: unset; the column-rule property is specified as one, two, or three of the values listed below, in any order. values <'column-rule-width'> is a <length> or one of the three keywords, thin, medium, or thick. see border-width for details. <'column-rule-style'> see border-style for possible values and details. <'column-rule-color'> is a <color> value. ...
...ial; column-rule: unset; the column-rule property is specified as one, two, or three of the values listed below, in any order. values <'column-rule-width'> is a <length> or one of the three keywords, thin, medium, or thick. see border-width for details. <'column-rule-style'> see border-style for possible values and details. <'column-rule-color'> is a <color> value. ...
...nto three columns. take note of how the `column-rule` property is used to adjust the style, width, and color of the rule that appears between the columns. </p> css .content-box { padding: 0.3em; background: #ff7; column-count: 3; column-rule: inset 2px #33f; } result specifications specification status comment css multi-column layout modulethe def
inition of 'column-rule' in that specification. working draft
initial def
inition. ...
column-width - CSS: Cascading Style Sheets
olumn-count property (which has precedence), you must specify all related length values to achieve an exact column width. in horizontal text these are width, column-width, column-gap, and column-rule-width. syntax /* keyword value */ column-width: auto; /* <length> values */ column-width: 60px; column-width: 15.5em; column-width: 3.3vw; /* global values */ column-width: inherit; column-width:
initial; column-width: unset; the column-width property is specified as one of the values listed below. values <length> indicates the optimal column width. the actual column width may differ from the specified value: it may be wider when necessary to fill available space, and narrower when the available space is too small. the value must be strictly positive or the declaration is invalid. perce...
...he optimal column width. the actual column width may differ from the specified value: it may be wider when necessary to fill available space, and narrower when the available space is too small. the value must be strictly positive or the declaration is invalid. percentage values are also invalid. auto the width of the column is determined by other css properties, such as column-count. ...
...l column width. the actual column width may differ from the specified value: it may be wider when necessary to fill available space, and narrower when the available space is too small. the value must be strictly positive or the declaration is invalid. percentage values are also invalid. auto the width of the column is determined by other css properties, such as column-count. formal def
inition
initial valueautoapplies toblock containers except table wrapper boxesinheritednocomputed valuethe absolute length, zero or largeranimation typea length formal syntax <length> | auto examples setting column width in pixels html <p class="content-box"> lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. u...
...adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. </p> css .content-box { column-width: 100px; } result specifications specification status comment css writing modes level 4the def
inition of 'column-width' in that specification. candidate recommendation adds intrinsic sizes via the keywords min-content, max-content, fill-available, and fit-content. css multi-column layout modulethe def
inition of 'column-width' in that specification. working draft
initial def
inition. ...
contain - CSS: Cascading Style Sheets
block (for the descendants whose position property is absolute or fixed). a new stacking context. a new block formatting context. syntax /* keyword values */ contain: none; contain: strict; contain: content; contain: size; contain: layout; contain: style; contain: paint; /* multiple keywords */ contain: size paint; contain: size layout paint; /* global values */ contain: inherit; contain:
initial; contain: unset; the contain property is specified as either one of the following: using a single none, strict, or content keyword. using one or more of the size, layout, style, and paint keywords in any order. values none indicates the element renders as normal, with no containment applied. strict indicates that all containment rules except style are applied to the element. this ...
...ndicates that descendants of the element don't display outside its bounds. if the containing box is offscreen, the browser does not need to paint its contained elements — these must also be offscreen as they are contained completely by that box. and if a descendant overflows the containing element's bounds, then that descendant will be clipped to the containing element's border-box. ...
...that descendants of the element don't display outside its bounds. if the containing box is offscreen, the browser does not need to paint its contained elements — these must also be offscreen as they are contained completely by that box. and if a descendant overflows the containing element's bounds, then that descendant will be clipped to the containing element's border-box. ...
...ore content here.</p> </article> img { float: left; border: 3px solid black; } article { border: 1px solid black; contain: content; } this also means that the first image no longer floats down to the second article, and instead stays inside it's containing element's bounds: specifications specification status comment css containment module level 1the def
inition of 'contain' in that specification. recommendation
initial def
inition ...
content - CSS: Cascading Style Sheets
normal computes to none for the ::before and ::after pseudo-elements. <string> specifies the "alt text" for the element. this value can be any number of text characters. non-latin characters must be encoded using their unicode escape sequences: for example, \000a9 represents the copyright symbol. <image> an <...
...e and certain assistive technology/browser combinations will not announce it. if the content conveys information that is critical to understanding the page's purpose, it is better to include it in the main document. accessibility support for css generated content – tink explanation of wcag, guideline 1.3 – mdn understanding success criterion 1.3.1 | w3c understanding wcag 2.0 formal def
inition
initial valuenormalapplies to::before and ::after pseudo-elementsinheritednocomputed valueon elements, always computes to normal. on ::before and ::after, if normal is specified, computes to none. otherwise, for uri values, the absolute uri; for attr() values, the resulting string; for other keywords, as specified.animation typediscrete formal syntax normal | none | [ <content-replacement> ...
...of the element have been replaced. ...
...emos.org/files/12668/mdn.svg"); } #replaced::after { /* will not show if element replacement is supported */ content: " (" attr(id) ")"; } result specifications specification status comment css generated content module level 3the def
inition of 'content' in that specification. working draft adds support for alt-text css level 2 (revision 1)the def
inition of 'content' in that specification. recommendation
initial def
inition ...
<dimension> - CSS: Cascading Style Sheets
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 status comment css values and units module level 4the def
inition of '<dimension>' in that specification. editor's draft adds cap, ic, lh, rlh, vi, vb css values and units module level 3the def
inition of '<dimension>' in that specification. candidate recommendation adds ch, rem, vw, vw, vmin, vmax, q css level 2 (revision 1)the def
inition of '<dimension>' in that specification. recommendation defined under numbers and leng...
...pecification. editor's draft adds cap, ic, lh, rlh, vi, vb css values and units module level 3the def
inition of '<dimension>' in that specification. candidate recommendation adds ch, rem, vw, vw, vmin, vmax, q css level 2 (revision 1)the def
inition of '<dimension>' in that specification. ...
... css values and units module level 3the def
inition of '<dimension>' in that specification. candidate recommendation adds ch, rem, vw, vw, vmin, vmax, q css level 2 (revision 1)the def
inition of '<dimension>' in that specification. recommendation defined under numbers and length css level 1the def
inition of '<dimension>' in that specification. ...
...lues and units module level 3the def
inition of '<dimension>' in that specification. candidate recommendation adds ch, rem, vw, vw, vmin, vmax, q css level 2 (revision 1)the def
inition of '<dimension>' in that specification. recommendation defined under numbers and length css level 1the def
inition of '<dimension>' in that specification. ...
flex-direction - CSS: Cascading Style Sheets
he left, and row-reverse from the left to the right. syntax /* the direction text is laid out in a line */ flex-direction: row; /* like <row>, but reversed */ flex-direction: row-reverse; /* the direction in which lines of text are stacked */ flex-direction: column; /* like <column>, but reversed */ flex-direction: column-reverse; /* global values */ flex-direction: inherit; flex-direction:
initial; flex-direction: unset; values the following values are accepted: row the flex container's main-axis is defined to be the same as the text direction. the main-start and main-end points are the same as the content direction. row-reverse behaves the same as row but the main-start and main-end points are permuted. column the flex container's main-axis is the same as the block-axis. the...
...he aid of assistive technology such as a screen reader. if the visual (css) order is important, then screen reader users will not have access to the correct reading order. ...
... assistive technology such as a screen reader. if the visual (css) order is important, then screen reader users will not have access to the correct reading order. ...
...px solid #c3c3c3; display: flex; flex-direction: column-reverse; } .box { width: 50px; height: 50px; } #content1 { width: 200px; height: 200px; border: 1px solid #c3c3c3; display: flex; flex-direction: row-reverse; } .box1 { width: 50px; height: 50px; } result specifications specification status comment css flexible box layout modulethe def
inition of 'flex-direction' in that specification. candidate recommendation
initial def
inition ...
flex-wrap - CSS: Cascading Style Sheets
xample 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. see using css flexible boxes for more properties and information. syntax flex-wrap: nowrap; /* default value */ flex-wrap: wrap; flex-wrap: wrap-reverse; /* global values */ flex-wrap: inherit; flex-wrap:
initial; flex-wrap: unset; the flex-wrap property is specified as a single keyword chosen from the list of values below. values the following values are accepted: nowrap the flex items are laid out in a single line which may cause the flex container to overflow. the cross-start is either equivalent to start or before depending on the flex-direction value. this is the default value. wrap the ...
... either equivalent to start or before depending on the flex-direction value. this is the default value. wrap the flex items break into multiple lines. the cross-start is either equivalent to start or before depending flex-direction value and the cross-end is the opposite of the specified cross-start. wrap-reverse behaves the same as wrap but cross-start and cross-end are permuted. ...
...quivalent to start or before depending on the flex-direction value. this is the default value. wrap the flex items break into multiple lines. the cross-start is either equivalent to start or before depending flex-direction value and the cross-end is the opposite of the specified cross-start. wrap-reverse behaves the same as wrap but cross-start and cross-end are permuted. ...
... candidate recommendation ...
font-size-adjust - CSS: Cascading Style Sheets
the font-size-adjust css property sets the size of lower-case letters relative to the current font size (which defines the size of upper-case letters). /* use the specified font size */ font-size-adjust: none; /* use a font size that makes lowercase letters half the specified font size */ font-size-adjust: 0.5; /* global values */ font-size-adjust: inherit; font-size-adjust:
initial; font-size-adjust: unset; the property is useful since the legibility of fonts, especially at small sizes, is determined more by the size of lowercase letters than by the size of capital letters. legibility can become an issue when the first-choice font-family is unavailable and its replacement has a significantly different aspect ratio (the ratio of the size of lowercase letters to the size of the ...
...by the x-height of the font) are the specified number times the font-size. the number specified should generally be the aspect ratio (ratio of x-height to font size) of the first choice font-family. this means that the first-choice font, when available, will appear the same size in browsers, whether or not they support font-size-adjust. 0 yields text of zero height (hidden text). formal def
inition
initial valuenoneapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typea number formal syntax none | <number> examples adjusting lower-case letter sizes html <p class="times">this text uses the times font (10px), which is hard to read in small sizes.</p> <p class="verdana">this text uses the verdana font (10px), wh...
...it has been newly defined in css 3. 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://gith...
...mily: times, serif; font-size: 10px; } .verdana { font-family: verdana, sans-serif; font-size: 10px; } .adjtimes { font-family: times, serif; font-size-adjust: 0.58; font-size: 10px; } results specifications specification status comment css fonts module level 3the def
inition of 'font-size-adjust' in that specification. candidate recommendation
initial def
inition the css property font-size-adjust was
initially defined in css 2, but dropped in css 2.1. it has been newly defined in css 3. 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. desktopmobilechromeedgef...
font-size - CSS: Cascading Style Sheets
larger, sm...
...html { font-size: 62.5%; /* font-size 1em = 10px on default browser settings */ } span { font-size: 1.6rem; } 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 def
inition
initial valuemediumapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyespercentagesrefer to the parent element's font sizecomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea length formal syntax <absolute-size> | <relative-size> | <length-percentage>where <absolute-size> = xx-small | x-small | small | medium ...
...t sizes css .small { font-size: xx-small; } .larger { font-size: larger; } .point { font-size: 24pt; } .percent { font-size: 200%; } html <h1 class="small">small h1</h1> <h1 class="larger">larger h1</h1> <h1 class="point">24 point h1</h1> <h1 class="percent">200% h1</h1> result specifications specification status comment css fonts module level 4the def
inition of 'font-size' in that specification. working draft adds xxx-large keyword. css fonts module level 3the def
inition of 'font-size' in that specification. candidate recommendation no change. css level 2 (revision 1)the def
inition of 'font-size' in that specification. recommendation no change. css level 1the def
inition of 'font-size' in that specificat...
... specification. working draft adds xxx-large keyword. css fonts module level 3the def
inition of 'font-size' in that specification. candidate recommendation no change. css level 2 (revision 1)the def
inition of 'font-size' in that specification. recommendation no change. css level 1the def
inition of 'font-size' in that specification. recommendation
initial def
inition. ...
font-stretch - CSS: Cascading Style Sheets
values normal specifies a normal font face. semi-condensed, condensed, extra-condensed, ultra-condensed specifies a more condensed font face than normal, with ultra-condensed as the most condensed. semi-expanded, expanded, extra-expanded, ultra-expanded specifies a ...
... helvetica neue, which is installed by default on macos, has a single condensed face in addition to the normal face. all values of font-stretch less than 100% select the condensed face, while all other values select the normal face. league mono variable is a variable font that offers something like a continuous range of widths for different percentage values of font-stretch. formal def
inition
initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typea font stretch formal syntax <font-stretch-absolute>where <font-stretch-absolute> = normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | <percentage> examples sett...
...it was b...
..., sans-serif; } .condensed { font-stretch: 50%; } .normal { font-stretch: 100%; } .expanded { font-stretch: 200%; } result specifications specification status comment css fonts module level 4the def
inition of 'font-stretch' in that specification. working draft adds the <percentage> syntax for variable fonts. css fonts module level 3the def
inition of 'font-stretch' in that specification. candidate recommendation
initial def
inition. note: the font-stretch property was
initially defined in css 2, but dropped in css 2.1 due to the lack of browser implementation. it was brought back in css 3. ...
font-synthesis - CSS: Cascading Style Sheets
e synthesized if needed. description most standard western fonts include italic and bold variants, but many novelty fonts do not. fonts used for chinese, japanese, korean and other logographic scripts tend not to include these variants, and synthesizing them may impede the legibility of the text. in these cases, it may be desirable to switch off the browser's default font-synthesis. formal def
inition
initial valueweight styleapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | [ weight | style ] examples disabling font synthesis html <em class="syn">synthesize me! 站直。</em> <br/> <em class="no-syn">don't synthesize me! 站直。</em> css em { font-weight: bold; } .syn { ...
... | [ weight | style ] examples disabling font synthesis html <em class="syn">synthesize me! ...
...ynthesize me! 站直。</em> <br/> <em class="no-syn">don't synthesize me! ...
...e! 站直。</em> <br/> <em class="no-syn">don't synthesize me! ...
font-variant-caps - CSS: Cascading Style Sheets
st vowel lose the accent and gain a diacritic on the second vowel (άι/ΑΪ). syntax /* keyword values */ font-variant-caps: normal; font-variant-caps: small-caps; font-variant-caps: all-small-caps; font-variant-caps: petite-caps; font-variant-caps: all-petite-caps; font-variant-caps: unicase; font-variant-caps: titling-caps; /* global values */ font-variant-caps: inherit; font-variant-caps:
initial; font-variant-caps: unset; the font-variant-caps property is specified using a single keyword value from the list below. in each case, if the font doesn't support the opentype value, then it synthesizes the glyphs. values normal deactivates of the use of alternate glyphs. small-caps enables display of small capitals (opentype feature: smcp). small-caps glyphs typically use the form of...
...se titling sequences they can appear too strong. titling capitals are designed specifically for this situation. accessibility concerns large sections of text set with a font-variant value of all-small-caps or all-petite-caps may be difficult for people with cognitive concerns such as dyslexia to read. mdn understanding wcag, guideline 1.4 explanations w3c understanding wcag 2.1 formal def
inition
initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps examples setting the small-caps font variant html <p class="small-caps">firefox rocks, small caps!</p> <p class="normal">firef...
...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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid w...
...ps!</p> <p class="normal">firefox rocks, normal caps!</p> css .small-caps { font-variant-caps: small-caps; font-style: italic; } .normal { font-variant-caps: normal; font-style: italic; } result specifications specification status comment css fonts module level 3the def
inition of 'font-variant-caps' in that specification. candidate recommendation
initial def
inition 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung inte...
font-variant-position - CSS: Cascading Style Sheets
aller glyphs that are positioned as superscript or subscript. the glyphs are positioned relative to the baseline of the font, which remains unchanged. these glyphs are typically used in <sub> and <sup> elements. /* keyword values */ font-variant-position: normal; font-variant-position: sub; font-variant-position: super; /* global values */ font-variant-position: inherit; font-variant-position:
initial; font-variant-position: unset; when the usage of these alternate glyphs is activated, if one character in the run doesn't have such a typographically-enhanced glyph, the whole set of characters of the run is rendered using a fallback method, synthesizing these glyphs. these alternate glyphs share the same em-box and the same baseline as the rest of the font. they are merely graphically enha...
...nd subscript glyphs. sub activates subscript alternate glyphs. if, in a given run, one such glyph is not available for a character, all the characters in the run are rendered using synthesized glyphs. super activates superscript alternate glyphs. if, in a given run, one such glyph is not available for a character, all the characters in the run are rendered using synthesized glyphs. formal def
inition
initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | sub | super examples setting superscript and subscript forms html <p class="normal">normal!</p> <p class="super">super!</p> <p class="sub">sub!</p> css p { display: inline; } .normal { font-variant-posit...
... 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandro...
...per!</p> <p class="sub">sub!</p> css p { display: inline; } .normal { font-variant-position: normal; } .super { font-variant-position: super; } .sub { font-variant-position: sub; } result specifications specification status comment css fonts module level 3the def
inition of 'font-variant-position' in that specification. candidate recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung inte...
font-variant - CSS: Cascading Style Sheets
mdn/interactive-examples and send us a pull request. constituent properties this property is a shorthand for the following css properties: font-variant-alternates font-variant-caps font-variant-east-asian font-variant-ligatures font-variant-numeric syntax font-variant: small-caps; font-variant: common-ligatures small-caps; /* global values */ font-variant: inherit; font-variant:
initial; font-variant: unset; values normal specifies a normal font face; each of the longhand properties has an
initial value of normal. longhand properties of font-variant are: font-variant-caps, font-variant-numeric, font-variant-alternates, font-variant-ligatures, and font-variant-east-asian. none sets the value of the font-variant-ligatures to none and the values of the other longhand pro...
... <common-lig-values>, <discretionary-lig-values>, <historical-lig-values>, <contextual-alt-values> specifies the keywords related to the font-variant-ligatures longhand property. ...
... lining-nums, oldstyle-nums, proportional-nums, tabular-nums, diagonal-fractions, stacked-fractions, ordinal, and slashed-zero. <east-asian-variant-values>, <east-asian-width-values>, ruby specifies the keywords related to the font-variant-east-asian longhand property. the possible values are: jis78, jis83, jis90, jis04, simplified, traditional, full-width, proportional-width, ruby. formal def
inition
initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | none | [ <common-lig-values> | <discretionary-lig-values> | <historical-lig-values> | <contextual-alt-values> | stylistic( <feature-value-name> ) | historical-forms | styleset( <feature-value-name># ) | character-va...
...itional ]<east-asian-width-values> = [ full-width | proportional-width ] examples setting the small-caps font variant html <p class="normal">firefox rocks!</p> <p class="small">firefox rocks!</p> css p.normal { font-variant: normal; } p.small { font-variant: small-caps; } result specifications specification status comment css fonts module level 3the def
inition of 'font-variant' in that specification. candidate recommendation made it a shorthand of the new font-variant-* properties. css level 2 (revision 1)the def
inition of 'font-variant' in that specification. recommendation no change css level 1the def
inition of 'font-variant' in that specification. recommendation
initial def
inition browser compatibility ...
font - CSS: Cascading Style Sheets
t's font. alternatively, it sets an element's font to a system font. 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. as with any shorthand property, any individual value that is not specified is set to its corresponding
initial value (possibly overriding values previously set using non-shorthand properties). though not directly settable by font, the longhands font-size-adjust and font-kerning are also reset to their
initial values. constituent properties this property is a shorthand for the following css properties: font-family font-size font-stretch font-style font-variant font-weight line-height syntax...
...em font used in dialog boxes. small-caption the system font used for labeling small controls. status-bar the system font used in window status bars. prefixed system font keywords browsers often implement several more, prefixed, keywords: gecko implements -moz-window, -moz-document, -moz-desktop, -moz-info, -moz-dialog, -moz-button, -moz-pull-down-menu, -moz-list, and -moz-field. formal def
inition
initial valueas each of the properties of the shorthand:font-style: normalfont-variant: normalfont-weight: normalfont-stretch: normalfont-size: mediumline-height: normalfont-family: depends on user agentapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyespercentagesas each of the properties of the shorthand:font-size: refer to the parent element's font sizel...
... ...
...cument.createelement("style"); css.innerhtml = ".fontshorthand{font: " + cssfragment + "}"; document.body.appendchild(css); } setcss(); specifications specification status comment css fonts module level 3the def
inition of 'font' in that specification. candidate recommendation added support for font-stretch values. css level 2 (revision 1)the def
inition of 'font-weight' in that specification. recommendation added support for keywords. css level 1the def
inition of 'font' in that specification. recommendation
initial def
inition. ...
grid-area - CSS: Cascading Style Sheets
<custom-ident> if there is a named line with the name '<custom-ident>-start'/'<custom-ident>-end', it contributes the first such line to the grid item’s placement. note: named grid areas automatically generate i...
...opposite edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. ...
...edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. ...
...tem2"></div> <div id="item3"></div> </div> css #grid { display: grid; height: 100px; grid-template: repeat(4, 1fr) / 50px 100px; } #item1 { background-color: lime; grid-area: 2 / 2 / auto / span 3; } #item2 { background-color: yellow; } #item3 { background-color: blue; } result specifications specification status comment css grid layoutthe def
inition of 'grid-area' in that specification. candidate recommendation
initial def
inition ...
grid-auto-flow - CSS: Cascading Style Sheets
s 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 /* keyword values */ grid-auto-flow: row; grid-auto-flow: column; grid-auto-flow: dense; grid-auto-flow: row dense; grid-auto-flow: column dense; /* global values */ grid-auto-flow: inherit; grid-auto-flow:
initial; grid-auto-flow: unset; this property may take one of two forms: a single keyword: one of row, column, or dense. two keywords: row dense or column dense. values row items are placed by filling each row in turn, adding new rows as necessary. if neither row nor column is provided, row is assumed. column items are placed by filling each column in turn, adding new columns as necessar...
...appear out-of-order, when doing so would fill in holes left by larger items. if it is omitted, a "sparse" algorithm is used, where the placement algorithm only ever moves "forward" in the grid when placing items, never backtracking to fill holes. this ensures that all of the auto-placed items appear "in order", even if this leaves holes that could have been filled by later items. ...
...t-of-order, when doing so would fill in holes left by larger items. if it is omitted, a "sparse" algorithm is used, where the placement algorithm only ever moves "forward" in the grid when placing items, never backtracking to fill holes. this ensures that all of the auto-placed items appear "in order", even if this leaves holes that could have been filled by later items. ...
...lementbyid("grid"); var direction = document.getelementbyid("direction"); var dense = document.getelementbyid("dense"); var gridautoflow = direction.value === "row" ? "row" : "column"; if (dense.checked) { gridautoflow += " dense"; } grid.style.gridautoflow = gridautoflow; } result specifications specification status comment css grid layoutthe def
inition of 'grid-auto-flow' in that specification. candidate recommendation
initial def
inition ...
grid-column-end - CSS: Cascading Style Sheets
<custom-ident> if there is a named line with the name '<custom-ident>-end', it contributes the first such line to the grid item’s placement. note: named grid areas automatically genera...
...dent>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. the <custom-ident> cannot take the span value. ...
...ly lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. the <custom-ident> cannot take the span value. ...
...rder-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .nested { border: 2px solid #ffec99; border-radius: 5px; background-color: #fff9db; padding: 1em; } result specifications specification status comment css grid layoutthe def
inition of 'grid-column-end' in that specification. candidate recommendation
initial def
inition ...
grid-column-start - CSS: Cascading Style Sheets
a <grid-line> value can be specified as: either the auto keyword or a <custom-ident> value or an <integer> value or both <custom-ident> and <integer>, separated by a space or the keyword span together with either a <custom-ident> or an <integer> or both. values auto a keyword indicating that the...
...ent>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers and 0 are invalid. the <custom-ident> cannot take the span value. ...
...y lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers and 0 are invalid. the <custom-ident> cannot take the span value. ...
...rder-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .nested { border: 2px solid #ffec99; border-radius: 5px; background-color: #fff9db; padding: 1em; } result specifications specification status comment css grid layoutthe def
inition of 'grid-column-start' in that specification. candidate recommendation
initial def
inition ...
grid-row-end - CSS: Cascading Style Sheets
request. syntax /* keyword value */ grid-row-end: auto; /* <custom-ident> values */ grid-row-end: somegridarea; /* <integer> + <custom-ident> values */ grid-row-end: 2; grid-row-end: somegridarea 4; /* span + <integer> + <custom-ident> values */ grid-row-end: span 3; grid-row-end: span somegridarea; grid-row-end: 5 somegridarea span; /* global values */ grid-row-end: inherit; grid-row-end:
initial; grid-row-end: unset; values auto is a keyword indicating that the property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span of 1. <custom-ident> if there is a named line with the name '<custom-ident>-end', it contributes the first such line to the grid item’s placement. note: named grid areas automatically generate ...
...he start edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. ...
...edge. if a name is given as a <custom-ident>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. ...
...rder-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .nested { border: 2px solid #ffec99; border-radius: 5px; background-color: #fff9db; padding: 1em; } result specifications specification status comment css grid layoutthe def
inition of 'grid-row-end' in that specification. candidate recommendation
initial def
inition ...
grid-row-start - CSS: Cascading Style Sheets
a <grid-line> value can be specified as: either the auto keyword or a <custom-ident> value or an <integer> value or both <custom-ident> and <integer>, separated by a space or the keyword span together with either a <custom-ident> or an <integer> or both. values auto is a keyword indicating that the...
...nt>, only lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid, corresponding to the search direction, are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. the <custom-ident> cannot take the span value. ...
... lines with that name are counted. if not enough lines with that name exist, all implicit grid lines on the side of the explicit grid, corresponding to the search direction, are assumed to have that name for the purpose of counting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. the <custom-ident> cannot take the span value. ...
...rder-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .nested { border: 2px solid #ffec99; border-radius: 5px; background-color: #fff9db; padding: 1em; } result specifications specification status comment css grid layoutthe def
inition of 'grid-row-start' in that specification. candidate recommendation
initial def
inition ...
grid-row - CSS: Cascading Style Sheets
<custom-ident> if there is a named line with the name '<custom-ident>-start'/'<custom-ident>-end', it contributes the first such line to the grid item’s placement. note: named grid areas auto...
...nting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. internet explorer issues ie11 does not support automatic placement of grid items. all items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. one can use a little javascript to enable automatic annotation: source repository. ...
...s span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. internet explorer issues ie11 does not support automatic placement of grid items. all items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. one can use a little javascript to enable automatic annotation: source repository. ...
...</div> </div> css #grid { display: grid; height: 200px; grid-template-columns: 200px; grid-template-rows: repeat(6, 1fr); } #item1 { background-color: lime; } #item2 { background-color: yellow; grid-row: 2 / 4; } #item3 { background-color: blue; grid-row: span 2 / 7; } result specifications specification status comment css grid layoutthe def
inition of 'grid-row' in that specification. candidate recommendation
initial def
inition ...
grid-template-areas - CSS: Cascading Style Sheets
d from the grid-placement properties grid-row-start, grid-row-end, grid-column-start, grid-column-end, and their shorthands grid-row, grid-column, and grid-area. syntax /* keyword value */ grid-template-areas: none; /* <string> values */ grid-template-areas: "a b"; grid-template-areas: "a b b" "a c d"; /* global values */ grid-template-areas: inherit; grid-template-areas:
initial; grid-template-areas: unset; values none the grid container doesn’t define any named grid areas. <string>+ a row is created for every separate string listed, and a column is created for each cell in the string. multiple named cell tokens within and between rows create a single named grid area that spans the corresponding grid cells. unless those cells form a rectangle, the declaratio...
...unset; values none the grid container doesn’t define any named grid areas. <string>+ a row is created for every separate string listed, and a column is created for each cell in the string. multiple named cell tokens within and between rows create a single named grid area that spans the corresponding grid cells. unless those cells form a rectangle, the declaration is invalid. ...
...values none the grid container doesn’t define any named grid areas. <string>+ a row is created for every separate string listed, and a column is created for each cell in the string. multiple named cell tokens within and between rows create a single named grid area that spans the corresponding grid cells. unless those cells form a rectangle, the declaration is invalid. ...
...late-columns: 150px 1fr; } #page > header { grid-area: head; background-color: #8ca0ff; } #page > nav { grid-area: nav; background-color: #ffa08c; } #page > main { grid-area: main; background-color: #ffff64; } #page > footer { grid-area: foot; background-color: #8cffa0; } result specifications specification status comment css grid layoutthe def
inition of 'grid-template-areas' in that specification. candidate recommendation
initial def
inition ...
image() - CSS: Cascading Style Sheets
ordinate 0px, 20px (the top left hand corner) and is 40px wide and 60px tall. the #xywh=#,#,#,# media fragment syntax takes four comma separated numeric values. the first two represent the x and y coordates for the starting point of the box that will be created. the third value is the width of the box, and the last value is the height. by default, these are pixel values. the spacial dimension def
inition in the media specification indicates that percentages will be supported as well: xywh=160,120,320,240 /* results in a 320x240 image at x=160 and y=120 */ xywh=pixel:160,120,320,240 /* results in a 320x240 image at x=160 and y=120 */ xywh=percent:25,25,50,50 /* results in a 50%x50% image at x=25% and y=25% */ the image fragments can be used in url() notation as well. the #xywh=#,#,...
...n top of it. additionally, the entire container would have had the same background color. ...
...he same background color. ...
...kground color. ...
Inheritance - CSS: Cascading Style Sheets
in css, inheritance controls what happens when no value is specified for a property on an element. css properties can be categorized in two types: inherited properties, which by default are set to the computed value of the parent element non-inherited properties, which by default are set to
initial value of the property refer to any css property def
inition to see whether a specific property inherits by default ("inherited: yes") or not ("inherited: no"). inherited properties when no value for an inherited property has been specified on an element, the element gets the computed value of that property on its parent element. only the root element of the document gets the
initial value given in the property's summary. a typical example of an inherited property is the color property. giv...
... a typical example of a non-inherited property is the border property. ...
.... the words "emphasized text" will appear green, since the em element has inherited the value of the color property from the p element. it does not get the
initial value of the property (which is the color that is used for the root element when the page specifies no color). non-inherited properties when no value for a non-inherited property has been specified on an element, the element gets the
initial value of that property (as specified in the property's summary). a typical example of a non-inherited property is the border property. given the style rules: p { border: medium solid; } ... and the markup: <p>this paragraph has <em>emphasized text</em> in it.</p> ... the words "emphasized text" will not have a border (since the
initial value of border-style is none). notes the inheri...
...operty, which applies its value to all properties. for example: font { all: revert; font-size: 200%; font-weight: bold; } this reverts the style of the font property to the user agent's default unless a user stylesheet exists, in which case that is used instead. then it doubles the font size and applies a font-weight of "bold". see also css values for controlling inheritance: inherit,
initial, unset, and revert introducing the css cascade cascade and inheritance css key concepts: css syntax, at-rule, comments, specificity and inheritance, the box, layout modes and visual formatting models, and margin collapsing, or the
initial, computed, resolved, specified, used, and actual values. def
initions of value syntax, shorthand properties and replaced elements. ...
inline-size - CSS: Cascading Style Sheets
examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...: inherit; inline-size:
initial; inline-size: unset; if the writing mode is vertically oriented, the value of inline-size relates to the height of the element; otherwise, it relates to the width of the element. a related property is block-size, which defines the other dimension of the element. values the inline-size property takes the same values as the width and height properties. ...
...; inline-size:
initial; inline-size: unset; if the writing mode is vertically oriented, the value of inline-size relates to the height of the element; otherwise, it relates to the width of the element. a related property is block-size, which defines the other dimension of the element. values the inline-size property takes the same values as the width and height properties. ...
...eightanimation typea length, percentage or calc(); formal syntax <'width'> examples setting inline size in pixels html <p class="exampletext">example text</p> css .exampletext { writing-mode: vertical-rl; background-color: yellow; inline-size: 110px; } result specifications specification status comment css logical properties and values level 1the def
inition of 'inline-size' in that specification. editor's draft
initial def
inition ...
inset-block-end - CSS: Cascading Style Sheets
ponds to the top, right, bottom, or left property depending on the values defined for writing-mode, direction, and text-orientation. ...
... <length> values */ inset-block-end: 3px; inset-block-end: 2.4em; /* <percentage>s of the width or height of the containing block */ inset-block-end: 10%; /* keyword value */ inset-block-end: auto; /* global values */ inset-block-end: inherit; inset-block-end:
initial; inset-block-end: unset; syntax values the inset-block-end property takes the same values as the left property. ...
... values */ inset-block-end: 3px; inset-block-end: 2.4em; /* <percentage>s of the width or height of the containing block */ inset-block-end: 10%; /* keyword value */ inset-block-end: auto; /* global values */ inset-block-end: inherit; inset-block-end:
initial; inset-block-end: unset; syntax values the inset-block-end property takes the same values as the left property. ...
...offset html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; position: relative; inset-block-end: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the def
inition of 'inset-block-end' in that specification. editor's draft
initial def
inition ...
inset-block-start - CSS: Cascading Style Sheets
top, right, bottom, or left property depending on the values defined for writing-mode, direction, and text-orientation. ...
... */ inset-block-start: 3px; inset-block-start: 2.4em; /* <percentage>s of the width or height of the containing block */ inset-block-start: 10%; /* keyword value */ inset-block-start: auto; /* global values */ inset-block-start: inherit; inset-block-start:
initial; inset-block-start: unset; syntax values the inset-block-start property takes the same values as the left property. ...
...-block-start: 3px; inset-block-start: 2.4em; /* <percentage>s of the width or height of the containing block */ inset-block-start: 10%; /* keyword value */ inset-block-start: auto; /* global values */ inset-block-start: inherit; inset-block-start:
initial; inset-block-start: unset; syntax values the inset-block-start property takes the same values as the left property. ...
...start offset html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; position: relative; inset-block-start: 20px; background-color: #c8c800; } specifications specification status comment css logical properties and values level 1the def
inition of 'inset-block-start' in that specification. editor's draft
initial def
inition ...
inset-block - CSS: Cascading Style Sheets
rties depending on the values defined for writing-mode, direction, and text-orientation. ...
...t of the containing block */ inset-block: 10% 5%; /* keyword value */ inset-block: auto; /* global values */ inset-block: inherit; inset-block:
initial; inset-block: unset; constituent properties this property is a shorthand for the following css properties: inset-block-end inset-block-start syntax values the inset-block property takes the same values as the left property. ...
...containing block */ inset-block: 10% 5%; /* keyword value */ inset-block: auto; /* global values */ inset-block: inherit; inset-block:
initial; inset-block: unset; constituent properties this property is a shorthand for the following css properties: inset-block-end inset-block-start syntax values the inset-block property takes the same values as the left property. ...
...fsets html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; position: relative; inset-block: 20px 50px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the def
inition of 'inset-block' in that specification. editor's draft
initial def
inition ...
inset-inline-end - CSS: Cascading Style Sheets
to the top, right, bottom, or left property depending on the values defined for writing-mode, direction, and text-orientation. ...
...s of the width or height of the containing block */ inset-inline-end: 10%; /* keyword value */ inset-inline-end: auto; /* global values */ inset-inline-end: inherit; inset-inline-end:
initial; inset-inline-end: unset; the shorthand for inset-inline-start and inset-inline-end is inset-inline. syntax values the inset-inline-end property takes the same values as the left property. ...
...width or height of the containing block */ inset-inline-end: 10%; /* keyword value */ inset-inline-end: auto; /* global values */ inset-inline-end: inherit; inset-inline-end:
initial; inset-inline-end: unset; the shorthand for inset-inline-start and inset-inline-end is inset-inline. syntax values the inset-inline-end property takes the same values as the left property. ...
...ffset html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; position: relative; inset-inline-end: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the def
inition of 'inset-inline-end' in that specification. editor's draft
initial def
inition ...
inset-inline-start - CSS: Cascading Style Sheets
right, bottom, or left property depending on the values defined for writing-mode, direction, and text-orientation. ...
...th or height of the containing block */ inset-inline-start: 10%; /* keyword value */ inset-inline-start: auto; /* global values */ inset-inline-start: inherit; inset-inline-start:
initial; inset-inline-start: unset; the shorthand for inset-inline-start and inset-inline-end is inset-inline. syntax values the inset-inline-start property takes the same values as the left property. ...
...ght of the containing block */ inset-inline-start: 10%; /* keyword value */ inset-inline-start: auto; /* global values */ inset-inline-start: inherit; inset-inline-start:
initial; inset-inline-start: unset; the shorthand for inset-inline-start and inset-inline-end is inset-inline. syntax values the inset-inline-start property takes the same values as the left property. ...
...set html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; position: relative; inset-inline-start: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the def
inition of 'inset-inline-start' in that specification. editor's draft
initial def
inition ...
inset-inline - CSS: Cascading Style Sheets
epending on the values defined for writing-mode, direction, and text-orientation. ...
... containing block */ inset-inline: 10% 5%; /* keyword value */ inset-inline: auto; /* global values */ inset-inline: inherit; inset-inline:
initial; inset-inline: unset; constituent properties this property is a shorthand for the following css properties: inset-inline-end inset-inline-start syntax values the inset-inline property takes the same values as the left property. ...
...ng block */ inset-inline: 10% 5%; /* keyword value */ inset-inline: auto; /* global values */ inset-inline: inherit; inset-inline:
initial; inset-inline: unset; constituent properties this property is a shorthand for the following css properties: inset-inline-end inset-inline-start syntax values the inset-inline property takes the same values as the left property. ...
...sets html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; position: relative; inset-inline: 20px 50px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the def
inition of 'inset-inline' in that specification. editor's draft
initial def
inition ...
justify-content - CSS: Cascading Style Sheets
end the items are packed flush to each other toward the end edge of the alignment container in the main axis. flex-start the items are packed flush to each other toward the edge of the alignment container depending on the flex container's m...
.... if the chosen keyword means that the item overflows the alignment container causing data loss, the item is instead aligned as if the alignment mode were start. unsafe used alongside an alignment keyword. regardless of the relative sizes of the item and alignment container, and regardless of whether overflow which causes data loss might happen, the given alignment value is honored. ...
...chosen keyword means that the item overflows the alignment container causing data loss, the item is instead aligned as if the alignment mode were start. unsafe used alongside an alignment keyword. regardless of the relative sizes of the item and alignment container, and regardless of whether overflow which causes data loss might happen, the given alignment value is honored. ...
...ption value="stretch">stretch</option> </select> javascript var justifycontent = document.getelementbyid("justifycontent"); justifycontent.addeventlistener("change", function (evt) { document.getelementbyid("container").style.justifycontent = evt.target.value; }); result specifications specification status comment css box alignment module level 3the def
inition of 'justify-content' in that specification. working draft adds the [ first | last ]? baseline, self-start, self-end, start, end, left, right, unsafe | safe values. css flexible box layout modulethe def
inition of 'justify-content' in that specification. candidate recommendation
initial def
inition ...
list-style-image - CSS: Cascading Style Sheets
t items, i.e. elements with display: list-item; by default this includes <li> elements. because this property is inherited, it can be set on the parent element (normally <ol> or <ul>) to let it apply to all list items. ...
...alues */ list-style-image: none; /* <url> values */ list-style-image: url('starsolid.gif'); /* global values */ list-style-image: inherit; list-style-image:
initial; list-style-image: unset; values <url> location of image to use as the marker. none specifies that no image is used as the marker. if this value is set, the marker defined in list-style-type will be used instead. ...
...list-style-image: none; /* <url> values */ list-style-image: url('starsolid.gif'); /* global values */ list-style-image: inherit; list-style-image:
initial; list-style-image: unset; values <url> location of image to use as the marker. none specifies that no image is used as the marker. if this value is set, the marker defined in list-style-type will be used instead. ...
...uenone or the image with its uri made absoluteanimation typediscrete formal syntax <url> | none examples setting list item images html <ul> <li>item 1</li> <li>item 2</li> </ul> css ul { list-style-image: url("https://mdn.mozillademos.org/files/11981/starsolid.gif"); } result specifications specification status comment css lists module level 3the def
inition of 'list-style-image' in that specification. working draft extends support to any <image> data type. css level 2 (revision 1)the def
inition of 'list-style-image' in that specification. recommendation
initial def
inition ...
margin-block-end - CSS: Cascading Style Sheets
ttps://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ margin-block-end: 10px; /* an absolute length */ margin-block-end: 1em; /* relative to the text size */ margin-block-end: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-block-end: auto; /* global values */ margin-block-end: inherit; margin-block-end:
initial; margin-block-end: unset; it corresponds to the margin-top, margin-right, margin-bottom, or margin-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to margin-block-start, margin-inline-start, and margin-inline-end, which define the other margins of the element. values the margin-block-end property takes the same values as the marg...
... it corresponds to the margin-top, margin-right, margin-bottom, or margin-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to margin-block-start, margin-inline-start, and margin-inline-end, which define the other margins of the element. values the margin-block-end property takes the same values as the margin-left property. ...
...responds to the margin-top, margin-right, margin-bottom, or margin-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to margin-block-start, margin-inline-start, and margin-inline-end, which define the other margins of the element. values the margin-block-end property takes the same values as the margin-left property. ...
...s setting block end margin html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; margin-block-end: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the def
inition of 'margin-block-end' in that specification. editor's draft
initial def
inition ...
margin-block-start - CSS: Cascading Style Sheets
b.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ margin-block-start: 10px; /* an absolute length */ margin-block-start: 1em; /* relative to the text size */ margin-block-start: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-block-start: auto; /* global values */ margin-block-start: inherit; margin-block-start:
initial; margin-block-start: unset; it corresponds to the margin-top, margin-right, margin-bottom, or margin-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to margin-block-end, margin-inline-start, and margin-inline-end, which define the other margins of the element. values the margin-block-start property takes the same values as the ma...
... it corresponds to the margin-top, margin-right, margin-bottom, or margin-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to margin-block-end, margin-inline-start, and margin-inline-end, which define the other margins of the element. values the margin-block-start property takes the same values as the margin-left property. ...
...responds to the margin-top, margin-right, margin-bottom, or margin-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to margin-block-end, margin-inline-start, and margin-inline-end, which define the other margins of the element. values the margin-block-start property takes the same values as the margin-left property. ...
...etting block start margin html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; margin-block-start: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the def
inition of 'margin-block-start' in that specification. editor's draft
initial def
inition ...
margin-inline-end - CSS: Cascading Style Sheets
thub.com/mdn/interactive-examples and send us a pull request. ...
...container's width */ /* keyword values */ margin-inline-end: auto; /* global values */ margin-inline-end: inherit; margin-inline-end:
initial; margin-inline-end: unset; it relates to margin-block-start, margin-block-end, and margin-inline-start, which define the other margins of the element. values the margin-inline-end property takes the same values as the margin-left property. ...
...'s width */ /* keyword values */ margin-inline-end: auto; /* global values */ margin-inline-end: inherit; margin-inline-end:
initial; margin-inline-end: unset; it relates to margin-block-start, margin-block-end, and margin-inline-start, which define the other margins of the element. values the margin-inline-end property takes the same values as the margin-left property. ...
... setting inline end margin html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; margin-inline-end: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the def
inition of 'margin-inline-end' in that specification. editor's draft
initial def
inition ...
margin-inline - CSS: Cascading Style Sheets
text orientation. /* <length> values */ margin-inline: 10px 20px; /* an absolute length */ margin-inline: 1em 2em; /* relative to the text size */ margin-inline: 5% 2%; /* relative to the nearest block container's width */ margin-inline: 10px; /* sets both start and end values */ /* keyword values */ margin-inline: auto; /* global values */ margin-inline: inherit; margin-inline:
initial; margin-inline: unset; this property corresponds to the margin-top and margin-bottom, or margin-right, and margin-left properties, depending on the values defined for writing-mode, direction, and text-orientation. constituent properties this property is a shorthand for the following css properties: margin-inline-end margin-inline-start syntax values the margin-inline property takes...
... the margin-top and margin-bottom, or margin-right, and margin-left properties, depending on the values defined for writing-mode, direction, and text-orientation. constituent properties this property is a shorthand for the following css properties: margin-inline-end margin-inline-start syntax values the margin-inline property takes the same values as the margin-left property. ...
...in-top and margin-bottom, or margin-right, and margin-left properties, depending on the values defined for writing-mode, direction, and text-orientation. constituent properties this property is a shorthand for the following css properties: margin-inline-end margin-inline-start syntax values the margin-inline property takes the same values as the margin-left property. ...
...ine start and end margins html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; margin-inline: 20px 40px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the def
inition of 'margin-inline' in that specification. editor's draft
initial def
inition.
initial value0applies tosame as margininheritednopercentagesdepends on layout modelcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typediscrete ...
margin-right - CSS: Cascading Style Sheets
quest. the vertical margins of two adjacent boxes may fuse. this is called margin collapsing. syntax /* <length> values */ margin-right: 20px; /* an absolute length */ margin-right: 1em; /* relative to the text size */ margin-right: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-right: auto; /* global values */ margin-right: inherit; margin-right:
initial; margin-right: unset; the margin-right property is specified as the keyword auto, or a <length>, or a <percentage>. its value can be positive, zero, or negative. values <length> the size of the margin as a fixed value. <percentage> the size of the margin as a percentage, relative to the width of the containing block. auto the right margin receives a share of the unused horizontal sp...
... and margin-right are set to auto. in this case, it is set to the value centering the border area inside the available width, if fixed. absolutely positioned layout mode flex, inline-flex any any 0, except if there is any positive horizontal free space. in this case, it is evenly distributed to all horizontal auto margins. flexbox layout mode formal def
inition
initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table. it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> | auto examples settin...
... recommendation removes its effect on inl...
...to examples setting right margin using pixels and percentages .content { margin-right: 5%; } .sidebox { margin-right: 10px; } .logo { margin-right: -5px; } specifications specification status comment css basic box modelthe def
inition of 'margin-right' in that specification. working draft no significant change css flexible box layout modulethe def
inition of 'margin-right' in that specification. candidate recommendation defines the behavior of margin-right on flex items. css level 2 (revision 1)the def
inition of 'margin-right' in that specification. recommendation removes its effect on inline elements. css level 1the def
inition of 'margin-right' in that specification. recommendation
initial def
inition. ...
margin - CSS: Cascading Style Sheets
> or <code>. note: margins create extra space around an element. in contrast, padding creates extra space within an element. syntax /* apply to all four sides */ margin: 1em; margin: -3px; /* vertical | horizontal */ margin: 5% auto; /* top | horizontal | bottom */ margin: 1em auto 2em; /* top | right | bottom | left */ margin: 2px 1em 0 auto; /* global values */ margin: inherit; margin:
initial; margin: unset; the margin property may be specified using one, two, three, or four values. each value is a <length>, a <percentage>, or the keyword auto. negative values draw the element closer to its neighbors than it would be by default. when one value is specified, it applies the same margin to all four sides. when two values are specified, the first margin applies to the top and bot...
...out, these are not available. in order to center an element inside its parent, use margin: 0 auto;. margin collapsing elements' top and bottom margins are sometimes collapsed into a single margin that is equal to the larger of the two margins. see mastering margin collapsing for more information. ...
...ts' top and bottom margins are sometimes collapsed into a single 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 def
inition of 'margin' in that specification. working draft no significant change. css level 2 (revision 1)the def
inition of 'margin' in that specification. recommendation removes the effect of top and bottom margins on inline elements. ...
...more information. specifications specification status comment css basic box modelthe def
inition of 'margin' in that specification. working draft no significant change. css level 2 (revision 1)the def
inition of 'margin' in that specification. recommendation removes the effect of top and bottom margins on inline elements. css level 1the def
inition of 'margin' in that specification. recommendation
initial def
inition.
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 inline-table. it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to th...
mask-border-slice - CSS: Cascading Style Sheets
ts of an element's mask border. syntax /* all sides */ mask-border-slice: 30%; /* vertical | horizontal */ mask-border-slice: 10% 30%; /* top | horizontal | bottom */ mask-border-slice: 30 30% 45; /* top | right | bottom | left */ mask-border-slice: 7 12 14 5; /* using the `fill` keyword */ mask-border-slice: 10% fill 7 12; /* global values */ mask-border-slice: inherit; mask-border-slice:
initial; mask-border-slice: unset; the mask-border-slice property may be specified using one to four <number-percentage> values to represent the position of each image slice. negative values are invalid; values greater than their corresponding dimension are clamped to 100%. when one position is specified, it creates all four slices at the same distance from their respective sides. when two posit...
...ns. these are repeated, scaled, or otherwise modified in the final border image to match the dimensions of the element. zone 9 is the middle region. it is discarded by default, but is used like a background image if the keyword fill is set. the mask-border-repeat, mask-border-width, and mask-border-outset properties determine how these regions are used to form the final mask border. ...
... are repeated, scaled, or otherwise modified in the final border image to match the dimensions of the element. zone 9 is the middle region. it is discarded by default, but is used like a background image if the keyword fill is set. the mask-border-repeat, mask-border-width, and mask-border-outset properties determine how these regions are used to form the final mask border. ...
...-image-slice: 30 fill; 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. note: the fill keyword needs to be included if you want the element's content to be visible. specifications specification status comment css masking module level 1the def
inition of 'mask-border-slice' in that specification. candidate recommendation
initial defintion ...
mask-border-source - CSS: Cascading Style Sheets
t's mask border. the mask-border-slice property is used to divide the source image into regions, which are then dynamically applied to the final mask border. ...
...l mask border. syntax /* keyword value */ mask-border-source: none; /* <image> values */ mask-border-source: url(image.jpg); mask-border-source: linear-gradient(to top, red, yellow); /* global values */ mask-border-source: inherit; mask-border-source:
initial; mask-border-source: unset; values none no mask border is used. <image> image reference to use for the mask border. ...
...rder. syntax /* keyword value */ mask-border-source: none; /* <image> values */ mask-border-source: url(image.jpg); mask-border-source: linear-gradient(to top, red, yellow); /* global values */ mask-border-source: inherit; mask-border-source:
initial; mask-border-source: unset; values none no mask border is used. <image> image reference to use for the mask border. ...
... version of this property — mask-box-image-source — with a prefix: -webkit-mask-box-image-source: url(image.jpg); 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 css masking module level 1the def
inition of 'mask-border-source' in that specification. candidate recommendation
initial def
inition ...
mask-border-width - CSS: Cascading Style Sheets
when one value is specified, it applies the same width to all four sides. when two values are specified, the first width applies to the top and bottom, the second to the left and right. when three values are specified, the first width app...
...gative. <number> the width of the mask border, specified as a multiple of the corresponding border-width. must not be negative. auto the width of the mask border is made equal to the intrinsic width or height (whichever is applicable) of the corresponding mask-border-slice. if the image does not have the required intrinsic dimension, the corresponding border-width is used instead. ...
...<number> the width of the mask border, specified as a multiple of the corresponding border-width. must not be negative. auto the width of the mask border is made equal to the intrinsic width or height (whichever is applicable) of the corresponding mask-border-slice. if the image does not have the required intrinsic dimension, the corresponding border-width is used instead. ...
... an outdated version of this property — mask-box-image-width — with a prefix: -webkit-mask-box-image-width: 20px; 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 css masking module level 1the def
inition of 'mask-border-width' in that specification. candidate recommendation
initial def
inition ...
mask-clip - CSS: Cascading Style Sheets
values content-box the painted content is clipped to the content box. padding-box the painted content is clipped to the padding box. border-box the painted content is clipped to the border box. margin-box the painted content is clipped to the margin box. fill-box the painted content ...
...and the dimension of the reference box is set to the width and height values of the viewbox attribute. no-clip the painted content is not clipped. border this keyword behaves the same as border-box. padding this keyword behaves the same as padding-box. content this keyword behaves the same as content-box. text this keyword clips the mask image to the text of the element. ...
...imension of the reference box is set to the width and height values of the viewbox attribute. no-clip the painted content is not clipped. border this keyword behaves the same as border-box. padding this keyword behaves the same as padding-box. content this keyword behaves the same as content-box. text this keyword clips the mask image to the text of the element. ...
...n value="view-box">view-box</option> <option value="no-clip">no-clip</option> </select> javascript var clipbox = document.getelementbyid("clipbox"); clipbox.addeventlistener("change", function (evt) { document.getelementbyid("masked").style.maskclip = evt.target.value; }); result specifications specification status comment css masking module level 1the def
inition of 'mask-clip' in that specification. candidate recommendation
initial def
inition ...
mask-composite - CSS: Cascading Style Sheets
the mask-composite css property represents a compositing operation used on the current mask layer with the mask layers below it. /* keyword values */ mask-composite: add; mask-composite: subtract; mask-composite: intersect; mask-composite: exclude; /* global values */ mask-composite: inherit; mask-composite:
initial; mask-composite: unset; syntax one or more of the keyword values listed below, separated by commas. values for the composition the current mask layer is referred to as source, while all layers below it are referred to as destination. add the source is placed over the destination. subtract the source is placed, where it falls outside of the destination. intersect the parts of source that overlap the destination, replace the destination. exclude the non-overlapping ...
... mask layer is referred to as source, while all layers below it are referred to as destination. add the source is placed over the destination. subtract the source is placed, where it falls outside of the destination. intersect the parts of source that overlap the destination, replace the destination. exclude the non-overlapping regions of source and destination are combined. ...
...er is referred to as source, while all layers below it are referred to as destination. add the source is placed over the destination. subtract the source is placed, where it falls outside of the destination. intersect the parts of source that overlap the destination, replace the destination. exclude the non-overlapping regions of source and destination are combined. ...
...rsect">intersect</option> <option value="exclude">exclude</option> </select> javascript var clipbox = document.getelementbyid("compositemode"); clipbox.addeventlistener("change", function (evt) { document.getelementbyid("masked").style.maskcomposite = evt.target.value; }); result specifications specification status comment css masking module level 1the def
inition of 'mask-composite' in that specification. candidate recommendation
initial def
inition ...
mask-image - CSS: Cascading Style Sheets
t. ...
...ues */ mask-image: image(url(mask.png), skyblue), linear-gradient(rgba(0, 0, 0, 1.0), transparent); /* global values */ mask-image: inherit; mask-image:
initial; mask-image: unset; syntax values none this keyword is interpreted as a transparent black image layer. <mask-source> a <url> reference to a <mask> or to a css image. <image> an image value used as mask image layer. ...
...sk-image: image(url(mask.png), skyblue), linear-gradient(rgba(0, 0, 0, 1.0), transparent); /* global values */ mask-image: inherit; mask-image:
initial; mask-image: unset; syntax values none this keyword is interpreted as a transparent black image layer. <mask-source> a <url> reference to a <mask> or to a css image. <image> an image value used as mask image layer. ...
...a mask image with a url html <div id="masked"></div> css #masked { width: 100px; height: 100px; background-color: #8cffa0; -webkit-mask-image: url(https://mdn.mozillademos.org/files/12676/star.svg); mask-image: url(https://mdn.mozillademos.org/files/12676/star.svg); } result specifications specification status comment css masking module level 1the def
inition of 'mask-image' in that specification. candidate recommendation
initial def
inition ...
mask-mode - CSS: Cascading Style Sheets
the mask-mode css property sets whether the mask reference defined by mask-image is treated as a luminance or alpha mask. /* keyword values */ mask-mode: alpha; mask-mode: luminance; mask-mode: match-source; /* multiple values */ mask-mode: alpha, match-source; /* global values */ mask-mode: inherit; mask-mode:
initial; mask-mode: unset; syntax the mask-mode property is specified as one or more of the keyword values listed below, separated by commas. values alpha this keyword indicates that the transparency (alpha channel) values of the mask layer image should be used as the mask values. luminance this keyword indicates that the luminance values of the mask layer image should be used as the mask values. match-source if the mask-image property is of type <mask-source>, the lu...
...mask values. luminance this keyword indicates that the luminance values of the mask layer image should be used as the mask values. match-source if the mask-image property is of type <mask-source>, the luminance values of the mask layer image should be used as the mask values. if it is of type <image>, the alpha values of the mask layer image should be used as the mask values. ...
...es. luminance this keyword indicates that the luminance values of the mask layer image should be used as the mask values. match-source if the mask-image property is of type <mask-source>, the luminance values of the mask layer image should be used as the mask values. if it is of type <image>, the alpha values of the mask layer image should be used as the mask values. ...
...nce">luminance</option> <option value="match-source">match-source</option> </select> javascript var maskmode = document.getelementbyid("maskmode"); maskmode.addeventlistener("change", function (evt) { document.getelementbyid("masked").style.maskmode = evt.target.value; }); result specifications specification status comment css masking module level 1the def
inition of 'mask-mode' in that specification. candidate recommendation
initial def
inition ...
mask-origin - CSS: Cascading Style Sheets
in other words, this property specifies the origin position of an image specified by the mask-image css property. for elements rendered as multiple boxes, such as inline boxes on several lines or boxes on several pages, it specifies which boxes box-decoration-break operates upon to ...
... if a viewbox attribute is specified for the element creating the svg viewport, the reference box is positioned at the origin of the coordinate system established by the viewbox attribute and the dimension of the reference box is set to the width and height values of the viewbox attribute. content same as content-box. padding same as padding-box. border same as border-box. ...
...wbox attribute is specified for the element creating the svg viewport, the reference box is positioned at the origin of the coordinate system established by the viewbox attribute and the dimension of the reference box is set to the width and height values of the viewbox attribute. content same as content-box. padding same as padding-box. border same as border-box. ...
...ue="stroke-box">stroke-box</option> <option value="view-box">view-box</option> </select> javascript var origin = document.getelementbyid("origin"); origin.addeventlistener("change", function (evt) { document.getelementbyid("masked").style.maskorigin = evt.target.value; }); result specifications specification status comment css masking module level 1the def
inition of 'mask-origin' in that specification. candidate recommendation
initial def
inition ...
mask-repeat - CSS: Cascading Style Sheets
syntax one or more <repeat-style> values, separated by commas. values <repeat-style> the one-value syntax is a shorthand for the full two-value syntax: single value two-value eq...
...th of 260px, repeated three times, might stretch until each repetition is 300px wide, and then another image will be added. they will then compress to 225px. no-repeat the image is not repeated (and hence the mask painting area will not necessarily be entirely covered). the position of the non-repeated mask image is defined by the mask-position css property. ...
...px, repeated three times, might stretch until each repetition is 300px wide, and then another image will be added. they will then compress to 225px. no-repeat the image is not repeated (and hence the mask painting area will not necessarily be entirely covered). the position of the non-repeated mask image is defined by the mask-position css property. ...
...age support you can specify a different <repeat-style> for each mask image, separated by commas: .examplethree { mask-image: url('mask1.png'), url('mask2.png'); mask-repeat: repeat-x, repeat-y; } each image is matched with the corresponding repeat style, from first specified to last. specifications specification status comment css masking module level 1the def
inition of 'mask-repeat' in that specification. candidate recommendation
initial def
inition ...
max-block-size - CSS: Cascading Style Sheets
lone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ max-block-size: 300px; max-block-size: 25em; /* <percentage> values */ max-block-size: 75%; /* keyword values */ max-block-size: auto; max-block-size: max-content; max-block-size: min-content; max-block-size: fit-content(20em); /* global values */ max-block-size: inherit; max-block-size:
initial; max-block-size: unset; values the max-block-size property's value can be any value that's legal for the max-width and max-height properties: <length> defines the max-width as an absolute value. <percentage> defines the max-width as a percentage of the containing block's width. auto the browser will calculate and select a max-width for the specified element. none no limit on the s...
..., vertical-lr, sideways-rl , sideways-lr , tb , tb-rl max-width the writing-mode values sideways-lr and sideways-rl were removed from the css writing modes level 3 specification late in its design process. they may be restored in level 4. the writing modes lr, lr-tb, rl, rb, and rb-tl are no longer allowed in html contexts; they may only be used in svg 1.x contexts. ...
...l-lr, sideways-rl , sideways-lr , tb , tb-rl max-width the writing-mode values sideways-lr and sideways-rl were removed from the css writing modes level 3 specification late in its design process. they may be restored in level 4. the writing modes lr, lr-tb, rl, rb, and rb-tl are no longer allowed in html contexts; they may only be used in svg 1.x contexts. ...
... { padding: 4px; background-color: #abcdef; color: #000; font: 16px "open sans", "helvetica", "arial", sans-serif; max-block-size: 160px; min-block-size: 100px; } .horizontal { writing-mode: horizontal-tb; } .vertical { writing-mode: vertical-rl; } result specifications specification status comment css logical properties and values level 1the def
inition of 'max-block-size' in that specification. editor's draft
initial def
inition ...
max-inline-size - CSS: Cascading Style Sheets
s://github.com/mdn/interactive-examples and send us a pull request. ...
... <percentage> values */ max-inline-size: 75%; /* keyword values */ max-inline-size: auto; max-inline-size: max-content; max-inline-size: min-content; max-inline-size: fit-content(20em); /* global values */ max-inline-size: inherit; max-inline-size:
initial; max-inline-size: unset; values the max-inline-size property takes the same values as the max-width and max-height properties. ...
...age> values */ max-inline-size: 75%; /* keyword values */ max-inline-size: auto; max-inline-size: max-content; max-inline-size: min-content; max-inline-size: fit-content(20em); /* global values */ max-inline-size: inherit; max-inline-size:
initial; max-inline-size: unset; values the max-inline-size property takes the same values as the max-width and max-height properties. ...
...centage or calc(); formal syntax <'max-width'> examples setting max inline size in pixels html <p class="exampletext">example text</p> css .exampletext { writing-mode: vertical-rl; background-color: yellow; block-size: 100%; max-inline-size: 200px; } result specifications specification status comment css logical properties and values level 1the def
inition of 'max-inline-size' in that specification. editor's draft
initial def
inition ...
min-block-size - CSS: Cascading Style Sheets
mples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ min-block-size: 100px; min-block-size: 5em; /* <percentage> values */ min-block-size: 10%; /* keyword values */ min-block-size: max-content; min-block-size: min-content; min-block-size: fit-content(20em); /* global values */ min-block-size: inherit; min-block-size:
initial; min-block-size: unset; if the writing mode is vertically oriented, the value of min-block-size relates to the minimum width of the element; otherwise, it relates to the minimum height of the element. a related property is min-inline-size, which defines the other dimension of the element. values the min-block-size property takes the same values as the min-width and min-height properties. ...
...ock-size: unset; if the writing mode is vertically oriented, the value of min-block-size relates to the minimum width of the element; otherwise, it relates to the minimum height of the element. a related property is min-inline-size, which defines the other dimension of the element. values the min-block-size property takes the same values as the min-width and min-height properties. ...
... unset; if the writing mode is vertically oriented, the value of min-block-size relates to the minimum width of the element; otherwise, it relates to the minimum height of the element. a related property is min-inline-size, which defines the other dimension of the element. values the min-block-size property takes the same values as the min-width and min-height properties. ...
...ength, percentage or calc(); formal syntax <'min-width'> examples setting minimum block size for vertical text html <p class="exampletext">example text</p> css .exampletext { writing-mode: vertical-rl; background-color: yellow; min-block-size: 200px; } result specifications specification status comment css logical properties and values level 1the def
inition of 'min-block-size' in that specification. editor's draft
initial def
inition ...
min-height - CSS: Cascading Style Sheets
-examples and send us a pull request. the element's height is set to the value of min-height whenever min-height is larger than max-height or height. syntax /* <length> value */ min-height: 3.5em; /* <percentage> value */ min-height: 10%; /* keyword values */ min-height: max-content; min-height: min-content; min-height: fit-content(20em); /* global values */ min-height: inherit; min-height:
initial; min-height: unset; values <length> defines the min-height as an absolute value. <percentage> defines the min-height as a percentage of the containing block's height. auto the browser will calculate and select a min-height for the specified element. none no limit on the size of the box. max-content the intrinsic preferred min-height. min-content the intrinsic minimum min-height...
...browser will calculate and select a min-height for the specified element. none no limit on the size of the box. max-content the intrinsic preferred min-height. min-content the intrinsic minimum min-height. fit-content(<length-percentage>) uses the fit-content formula with the available space replaced by the specified argument, i.e. min(max-content, max(min-content, argument)). formal def
inition
initial valueautoapplies toall elements but non-replaced inline elements, table columns, and column groupsinheritednopercentagesthe percentage is calculated with respect to the height of the generated box's containing block. if the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the percentage valu...
... ...
...ntent | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting min-height table { min-height: 75%; } form { min-height: 0; } specifications specification status comment css box sizing module level 4the def
inition of 'min-height' in that specification. editor's draft css box sizing module level 3the def
inition of 'min-height' in that specification. working draft adds the max-content, min-content, fit-content keywords. css level 2 (revision 1)the def
inition of 'min-height' in that specification. recommendation
initial def
inition. ...
min-inline-size - CSS: Cascading Style Sheets
oject, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ min-inline-size: 100px; min-inline-size: 5em; /* <percentage> values */ min-inline-size: 10%; /* keyword values */ min-inline-size: max-content; min-inline-size: min-content; min-inline-size: fit-content(20em); /* global values */ min-inline-size: inherit; min-inline-size:
initial; min-inline-size: unset; if the writing mode is vertically oriented, the value of min-inline-size relates to the minimum height of the element; otherwise, it relates to the minimum width of the element. a related property is min-block-size, which defines the other dimension of the element. values the min-inline-size property takes the same values as the min-width and min-height properties...
...ne-size: unset; if the writing mode is vertically oriented, the value of min-inline-size relates to the minimum height of the element; otherwise, it relates to the minimum width of the element. a related property is min-block-size, which defines the other dimension of the element. values the min-inline-size property takes the same values as the min-width and min-height properties. ...
...unset; if the writing mode is vertically oriented, the value of min-inline-size relates to the minimum height of the element; otherwise, it relates to the minimum width of the element. a related property is min-block-size, which defines the other dimension of the element. values the min-inline-size property takes the same values as the min-width and min-height properties. ...
... calc(); formal syntax <'min-width'> examples setting minimum inline size for vertical text html <p class="exampletext">example text</p> css .exampletext { writing-mode: vertical-rl; background-color: yellow; block-size: 5%; min-inline-size: 200px; } result specifications specification status comment css logical properties and values level 1the def
inition of 'min-inline-size' in that specification. editor's draft
initial def
inition ...
object-fit - CSS: Cascading Style Sheets
tent is sized to fill the element’s content box. the entire object will completely fill the box. if the object's aspect ratio does not match the aspect ratio of its box, then the object will be stretched to fit. none the replaced content is not resized. scale-down the content is sized as if none or contain were specified, whichever would result in a smaller concrete object size. ...
...ized to fill the element’s content box. the entire object will completely fill the box. if the object's aspect ratio does not match the aspect ratio of its box, then the object will be stretched to fit. none the replaced content is not resized. scale-down the content is sized as if none or contain were specified, whichever would result in a smaller concrete object size. ...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-...
....fill { object-fit: fill; } .contain { object-fit: contain; } .cover { object-fit: cover; } .none { object-fit: none; } .scale-down { object-fit: scale-down; } result specifications specification status comment css images module level 4the def
inition of 'object-fit' in that specification. working draft css images module level 3the def
inition of 'object-fit' in that specification. candidate recommendation
initial def
inition 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewch...
object-position - CSS: Cascading Style Sheets
ect-fit 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. ...
... values */ object-position: center top; object-position: 100px 50px; /* global values */ object-position: inherit; object-position:
initial; object-position: unset; values <position> from one to four values that define the 2d position of the element. relative or absolute offsets can be used. note: the position can be set so that the replaced element is drawn outside its box. ...
.../ object-position: center top; object-position: 100px 50px; /* global values */ object-position: inherit; object-position:
initial; object-position: unset; values <position> from one to four values that define the 2d position of the element. relative or absolute offsets can be used. note: the position can be set so that the replaced element is drawn outside its box. ...
...10%; } the first image is positioned with its left edge inset 10 pixels from the left edge of the element's box. the second image is positioned with its right edge flush against the right edge of the element's box and is located 10% of the way down the height of the element's box. result specifications specification status comment css images module level 3the def
inition of 'object-position' in that specification. candidate recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid we...
offset-distance - CSS: Cascading Style Sheets
efault value */ offset-distance: 0; /* the middle of the offset-path */ offset-distance: 50%; /* a fixed length positioned along the path */ offset-distance: 40px; <length-percentage> a length that specifies how far the element is along the path (defined with offset-path). 100% represents the total length of the path (when the offset-path is defined as a basic shape or path()). ...
...lue */ offset-distance: 0; /* the middle of the offset-path */ offset-distance: 50%; /* a fixed length positioned along the path */ offset-distance: 40px; <length-percentage> a length that specifies how far the element is along the path (defined with offset-path). 100% represents the total length of the path (when the offset-path is defined as a basic shape or path()). ...
...e motion aspect in css motion path typically comes from animating the offset-distance property. if you want to animate an element along its full path, you would define its offset-path and then set up an animation that takes the offset-distance from 0% to 100%. ...
... css #motion-demo { offset-path: path('m20,20 c20,100 200,0 200,100'); animation: move 3000ms inf
inite alternate ease-in-out; width: 40px; height: 40px; background: cyan; } @keyframes move { 0% { offset-distance: 0%; } 100% { offset-distance: 100%; } } result specifications specification status comment motion path module level 1the def
inition of 'offset-distance' in that specification. working draft
initial def
inition ...
offset-rotate - CSS: Cascading Style Sheets
the element has a constant clockwise rotation transformation applied to it by the specified rotation angle. auto <angle> if auto is followed by an <angle>, the computed value of the angle is added to the computed value of auto. reverse the element is rotated similar to auto, except it faces the opposite direction. it is the same as specifying a value of auto 180deg. ...
...lement has a constant clockwise rotation transformation applied to it by the specified rotation angle. auto <angle> if auto is followed by an <angle>, the computed value of the angle is added to the computed value of auto. reverse the element is rotated similar to auto, except it faces the opposite direction. it is the same as specifying a value of auto 180deg. ...
...ueas specifiedanimation typeas <angle>, <basic-shape> or <path()> formal syntax [ auto | reverse ] | <angle> examples setting element orientation along its offset path html <div></div> <div></div> <div></div> css div { width: 40px; height: 40px; background: #2bc4a2; margin: 20px; clip-path: polygon(0% 0%, 70% 0%, 100% 50%, 70% 100%, 0% 100%, 30% 50%); animation: move 5000ms inf
inite alternate ease-in-out; offset-path: path('m20,20 c20,50 180,-10 180,20'); } div:nth-child(1) { offset-rotate: auto; } div:nth-child(2) { offset-rotate: auto 90deg; } div:nth-child(3) { offset-rotate: 30deg; } @keyframes move { 100% { offset-distance: 100%; } } result specifications specification status comment motion path module level 1the defin...
... 180,20'); } div:nth-child(1) { offset-rotate: auto; } div:nth-child(2) { offset-rotate: auto 90deg; } div:nth-child(3) { offset-rotate: 30deg; } @keyframes move { 100% { offset-distance: 100%; } } result specifications specification status comment motion path module level 1the def
inition of 'offset-rotate' in that specification. working draft
initial def
inition ...
outline-color - CSS: Cascading Style Sheets
mple 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 /* <color> values */ outline-color: #f92525; outline-color: rgb(30,222,121); outline-color: blue; /* keyword value */ outline-color: invert; /* global values */ outline-color: inherit; outline-color:
initial; outline-color: unset; the outline-color property is specified as any one of the values listed below. values <color> the color of the outline, specified as a <color>. invert to ensure the outline is visible, performs a color inversion of the background. note that browsers are not required to support this value; if they don't, this keyword is considered invalid. description an outli...
...s. in order to meet current web content accessibility guidelines (wcag), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. large text is defined as 18.66px and bold or larger, or 24px or larger. webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 formal def
inition
initial valueinvert, for browsers supporting it, currentcolor for the otherapplies toall elementsinheritednocomputed valuefor the keyword invert, the computed value is invert. for the color value, if the value is translucent, the computed value will be the rgba() corresponding one. if it isn't, it will be the rgb() corresponding one. the transparent keyword maps to rgba(0,0,0,0).animation typ...
... 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...
...css p { outline: 2px solid; /* set the outline width and style */ outline-color: #0000ff; /* make the outline blue */ margin: 5px; } result specifications specification status comment css basic user interface module level 3the def
inition of 'outline-color' in that specification. recommendation no change. css level 2 (revision 1)the def
inition of 'outline-color' in that specification. recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome ...
overflow-block - CSS: Cascading Style Sheets
block start and block end edges of a box. this may be nothing, a scroll bar, or the overflow content. the overflow-block property maps to overflow-y or overflow-x depending on the writing mode of the document. syntax /* keyword values */ overflow-block: visible; overflow-block: hidden; overflow-block: scroll; overflow-block: auto; /* global values */ overflow-block: inherit; overflow-block:
initial; overflow-block: unset; the overflow-block property is specified as a single keyword chosen from the list of values below. values visible content is not clipped and may be rendered outside the padding box's block start and block end edges. hidden content is clipped if necessary to fit the block dimension in the padding box. no scrollbars are provided. scroll content is clipped if ne...
...r or not any content is actually clipped. (this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content. auto depends on the user agent. if content fits inside the padding box, it looks the same as visible, but still establishes a new block-formatting context. desktop browsers provide scrollbars if content overflows. ...
...any content is actually clipped. (this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content. auto depends on the user agent. if content fits inside the padding box, it looks the same as visible, but still establishes a new block-formatting context. desktop browsers provide scrollbars if content overflows. ...
...rder: 1px solid black; width: 250px; height: 100px; } #div1 { overflow-block: hidden; margin-bottom: 120px;} #div2 { overflow-block: scroll; margin-bottom: 120px;} #div3 { overflow-block: visible; margin-bottom: 120px;} #div4 { overflow-block: auto; margin-bottom: 120px;} result specifications specification status comment css overflow module level 3the def
inition of 'overflow-block' in that specification. working draft
initial valueautoapplies toblock-containers, flex containers, and grid containersinheritednocomputed valueas specified, except with visible/clip computing to auto/hidden respectively if one of overflow-x or overflow-y is neither visible nor clipanimation typediscrete ...
overflow-inline - CSS: Cascading Style Sheets
line start and end edges of a box. this may be nothing, a scroll bar, or the overflow content. the overflow-inline property maps to overflow-y or overflow-x depending on the writing mode of the document. syntax /* keyword values */ overflow-inline: visible; overflow-inline: hidden; overflow-inline: scroll; overflow-inline: auto; /* global values */ overflow-inline: inherit; overflow-inline:
initial; overflow-inline: unset; the overflow-inline property is specified as a single keyword chosen from the list of values below. values visible content is not clipped and may be rendered outside the padding box's inline start and end edges. hidden content is clipped if necessary to fit the inline dimension in the padding box. no scrollbars are provided. scroll content is clipped if nece...
...r or not any content is actually clipped. (this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content. auto depends on the user agent. if content fits inside the padding box, it looks the same as visible, but still establishes a new block-formatting context. desktop browsers provide scrollbars if content overflows. ...
...any content is actually clipped. (this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content. auto depends on the user agent. if content fits inside the padding box, it looks the same as visible, but still establishes a new block-formatting context. desktop browsers provide scrollbars if content overflows. ...
... working draft ...
overflow-wrap - CSS: Cascading Style Sheets
wing. the property was originally a nonstandard and unprefixed microsoft extension called word-wrap, and was implemented by most browsers with the same name. it has since been renamed to overflow-wrap, with word-wrap being an alias. syntax /* keyword values */ overflow-wrap: normal; overflow-wrap: break-word; overflow-wrap: anywhere; /* global values */ overflow-wrap: inherit; overflow-wrap:
initial; overflow-wrap: unset; the overflow-wrap property is specified as a single keyword chosen from the list of values below. values normal lines may only break at normal word break points (such as a space between two words). anywhere to prevent overflow, an otherwise unbreakable string of characters — like a long word or url — may be broken at any point if there are no otherwise-accep...
...duced by the word break are considered when calculating min-content intrinsic sizes. break-word the same as the anywhere value, with normally unbreakable words allowed to be broken at arbitrary points if there are no otherwise acceptable break points in the line, but soft wrap opportunities introduced by the word break are not considered when calculating min-content intrinsic sizes. formal def
inition
initial valuenormalapplies tonon-replaced inline elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | break-word | anywhere examples comparing overflow-wrap, word-break, and hyphens this example compares the results of overflow-wrap, word-break, and hyphens when breaking up a long word. html <p>they say the fishing is excellent at lake <em class...
...yself. ...
...3em; margin: 2px; background: gold; } .ow-anywhere { overflow-wrap: anywhere; } .ow-break-word { overflow-wrap: break-word; } .word-break { word-break: break-all; } .hyphens { hyphens: auto; } result specifications specification status comment css text module level 3the def
inition of 'overflow-wrap' in that specification. working draft
initial def
inition
initial valuenormalapplies tonon-replaced inline elementsinheritedyescomputed valueas specifiedanimation typediscrete ...
overflow-x - CSS: Cascading Style Sheets
ource 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 /* keyword values */ overflow-x: visible; overflow-x: hidden; overflow-x: clip; overflow-x: scroll; overflow-x: auto; /* global values */ overflow-x: inherit; overflow-x:
initial; overflow-x: unset; the overflow-x property is specified as a single keyword chosen from the list of values below. values visible content is not clipped and may be rendered outside the padding box's left and right edges. if overflow-y is hidden, scroll or auto and this property is visible, it will implicitly compute to auto. hidden content is clipped if necessary to fit horizontally i...
...r or not any content is actually clipped. (this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content. auto depends on the user agent. if content fits inside the padding box, it looks the same as visible, but still establishes a new block-formatting context. desktop browsers provide scrollbars if content overflows. ...
...any content is actually clipped. (this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content. auto depends on the user agent. if content fits inside the padding box, it looks the same as visible, but still establishes a new block-formatting context. desktop browsers provide scrollbars if content overflows. ...
... working draft ...
overflow-y - CSS: Cascading Style Sheets
ource 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 /* keyword values */ overflow-y: visible; overflow-y: hidden; overflow-y: clip; overflow-y: scroll; overflow-y: auto; /* global values */ overflow-y: inherit; overflow-y:
initial; overflow-y: unset; the overflow-y property is specified as a single keyword chosen from the list of values below. if overflow-x is hidden, scroll or auto and this property is visible (default) it will implicitly compute to auto. values visible content is not clipped and may be rendered outside the padding box's top and bottom edges. hidden content is clipped if necessary to fit vert...
...r or not any content is actually clipped. (this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content. auto depends on the user agent. if content fits inside the padding box, it looks the same as visible, but still establishes a new block-formatting context. desktop browsers provide scrollbars if content overflows. ...
...any content is actually clipped. (this prevents scrollbars from appearing or disappearing when the content changes.) printers may still print overflowing content. auto depends on the user agent. if content fits inside the padding box, it looks the same as visible, but still establishes a new block-formatting context. desktop browsers provide scrollbars if content overflows. ...
... working draft ...
overflow - CSS: Cascading Style Sheets
oject, please clone https://github.com/mdn/interactive-examples and send us a pull request. constituent properties this property is a shorthand for the following css properties: overflow-x overflow-y syntax /* keyword values */ overflow: visible; overflow: hidden; overflow: clip; overflow: scroll; overflow: auto; overflow: hidden visible; /* global values */ overflow: inherit; overflow:
initial; overflow: unset; the overflow property is specified as one or two keywords chosen from the list of values below. if two keywords are specified, the first applies to overflow-x and the second to overflow-y. otherwise, both overflow-x and overflow-y are set to the same value. values visible content is not clipped and may be rendered outside the padding box. hidden content is clipped if...
...rder for overflow to have an effect, the block-level container must have either a set height (height or max-height) or white-space set to nowrap. setting one axis to visible (the default) while setting the other to a different value results in visible behaving as auto. the javascript element.scrolltop property may be used to scroll an html element even when overflow is set to hidden. ...
...overflow to have an effect, the block-level container must have either a set height (height or max-height) or white-space set to nowrap. setting one axis to visible (the default) while setting the other to a different value results in visible behaving as auto. the javascript element.scrolltop property may be used to scroll an html element even when overflow is set to hidden. ...
...overflow: scroll sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium. p { overflow: auto; /* append scrollbars if necessary */ } overflow: auto sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium. specifications specification status comment css overflow module level 3the def
inition of 'overflow' in that specification. working draft changed syntax to allow one or two keywords instead of only one css level 2 (revision 1)the def
inition of 'overflow' in that specification. recommendation
initial def
inition. ...
overscroll-behavior-y - CSS: Cascading Style Sheets
the overscroll-behavior-y css property sets the browser's behavior when the vertical boundary of a scrolling area is reached. see overscroll-behavior for a full explanation. /* keyword values */ overscroll-behavior-y: auto; /* default */ overscroll-behavior-y: contain; overscroll-behavior-y: none; /* global values */ overscroll-behavior-y: inherit; overscroll-behavior-y:
initial; overscroll-behavior-y: unset;
initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete syntax the overscroll-behavior-y property is specified as a keyword chosen from the list of values below. values auto the default scroll overflow behavior occurs as normal. contain default scroll overflow behavior is ...
...rflow behavior occurs as normal. contain default scroll overflow behavior is observed inside the element this value is set on (e.g. "bounce" effects or refreshes), but no scroll chaining occurs to neighbouring scrolling areas, e.g. underlying elements will not scroll. none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented. ...
...avior occurs as normal. contain default scroll overflow behavior is observed inside the element this value is set on (e.g. "bounce" effects or refreshes), but no scroll chaining occurs to neighbouring scrolling areas, e.g. underlying elements will not scroll. none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented. ...
... working draft ...
overscroll-behavior - CSS: Cascading Style Sheets
ss property sets what a browser does when reaching the boundary of a scrolling area. it's a shorthand for overscroll-behavior-x and overscroll-behavior-y. /* keyword values */ overscroll-behavior: auto; /* default */ overscroll-behavior: contain; overscroll-behavior: none; /* two values */ overscroll-behavior: auto contain; /* global values */ overscroll-behavior: inherit; overscroll-behavior:
initial; overscroll-behavior: unset; by default, mobile browsers tend to provide a "bounce" effect or even a page refresh when the top or bottom of a page (or other scroll area) is reached. you may also have noticed that when you have a dialog box with scrolling content on top of a page of scrolling content, once the dialog box's scroll boundary is reached, the underlying page will then start to scr...
...rflow behavior occurs as normal. contain default scroll overflow behavior is observed inside the element this value is set on (e.g. "bounce" effects or refreshes), but no scroll chaining occurs to neighbouring scrolling areas, e.g. underlying elements will not scroll. none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented. ...
...avior occurs as normal. contain default scroll overflow behavior is observed inside the element this value is set on (e.g. "bounce" effects or refreshes), but no scroll chaining occurs to neighbouring scrolling areas, e.g. underlying elements will not scroll. none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented. ...
...oll effects when the contacts are scrolled to the top or bottom (e.g. chrome on android refreshes the page when you scroll past the top boundary). this can be prevented by setting overscroll-behavior: none on the <body> element: body { margin: 0; overscroll-behavior: none; } specifications specification status comment css overscroll behavior module level 1the def
inition of 'overscroll-behavior' in that specification. working draft ...
padding-block-end - CSS: Cascading Style Sheets
ithub.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ padding-block-end: 10px; /* an absolute length */ padding-block-end: 1em; /* a length relative to the text size */ /* <percentage> value */ padding-block-end: 5%; /* a padding relative to the block container's width */ /* global values */ padding-block-end: inherit; padding-block-end:
initial; padding-block-end: unset; values the padding-block-end property takes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-inline-start, and padding-inline-...
...roperty takes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-inline-start, and padding-inline-end, which define the other paddings of the element. ...
...akes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-inline-start, and padding-inline-end, which define the other paddings of the element. ...
...tical text html content <div> <p class="exampletext">example text</p> </div> css content div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-block-end: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the def
inition of 'padding-block-end' in that specification. editor's draft
initial def
inition ...
padding-block-start - CSS: Cascading Style Sheets
mdn/interactive-examples and send us a pull request. syntax /* <length> values */ padding-block-start: 10px; /* an absolute length */ padding-block-start: 1em; /* a length relative to the text size */ /* <percentage> value */ padding-block-start: 5%; /* a padding relative to the block container's width */ /* global values */ padding-block-start: inherit; padding-block-start:
initial; padding-block-start: unset; values the padding-block-start property takes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-end, padding-inline-start, and padding-inlin...
... property takes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-end, padding-inline-start, and padding-inline-end, which define the other paddings of the element. ...
... takes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-end, padding-inline-start, and padding-inline-end, which define the other paddings of the element. ...
...adding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-block-start: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the def
inition of 'padding-block-start' in that specification. editor's draft
initial def
inition ...
padding-block - CSS: Cascading Style Sheets
g mode, directionality, and text orientation. /* <length> values */ padding-block: 10px 20px; /* an absolute length */ padding-block: 1em 2em; /* relative to the text size */ padding-block: 10px; /* sets both start and end values */ /* <percentage> values */ padding-block: 5% 2%; /* relative to the nearest block container's width */ /* global values */ padding-block: inherit; padding-block:
initial; padding-block: unset; these values corresponds to the padding-top and padding-bottom, or padding-right, and padding-left property depending on the values defined for writing-mode, direction, and text-orientation. constituent properties this property is a shorthand for the following css properties: padding-block-end padding-block-start syntax values the padding-block property takes...
...he padding-top and padding-bottom, or padding-right, and padding-left property depending on the values defined for writing-mode, direction, and text-orientation. constituent properties this property is a shorthand for the following css properties: padding-block-end padding-block-start syntax values the padding-block property takes the same values as the padding-left property. ...
...g-top and padding-bottom, or padding-right, and padding-left property depending on the values defined for writing-mode, direction, and text-orientation. constituent properties this property is a shorthand for the following css properties: padding-block-end padding-block-start syntax values the padding-block property takes the same values as the padding-left property. ...
...padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; padding-block: 20px 40px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the def
inition of 'padding-block' in that specification. editor's draft
initial def
inition ...
padding-bottom - CSS: Cascading Style Sheets
. an element's padding area is the space between its content and its border. note: the padding property can be used to set paddings on all four sides of an element with a single declaration. syntax /* <length> values */ padding-bottom: 0.5em; padding-bottom: 0; padding-bottom: 2cm; /* <percentage> value */ padding-bottom: 10%; /* global values */ padding-bottom: inherit; padding-bottom:
initial; padding-bottom: unset; the padding-bottom property is specified as a single value chosen from the list below. unlike margins, negative values are not allowed for padding. values <length> the size of the padding as a fixed value. must be nonnegative. <percentage> the size of the padding as a percentage, relative to the width of the containing block. must be nonnegative. formal defin...
...dding-bottom: unset; the padding-bottom property is specified as a single value chosen from the list below. unlike margins, negative values are not allowed for padding. values <length> the size of the padding as a fixed value. must be nonnegative. <percentage> the size of the padding as a percentage, relative to the width of the containing block. must be nonnegative. formal def
inition
initial value0applies toall elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column. it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> examples s...
... ...
...ength formal syntax <length> | <percentage> examples setting padding bottom with pixels and percentages .content { padding-bottom: 5%; } .sidebox { padding-bottom: 10px; } specifications specification status comment css basic box modelthe def
inition of 'padding-bottom' in that specification. working draft no change. css level 2 (revision 1)the def
inition of 'padding-bottom' in that specification. recommendation no change. css level 1the def
inition of 'padding-bottom' in that specification. recommendation
initial def
inition. ...
padding-inline-end - CSS: Cascading Style Sheets
://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ padding-inline-end: 10px; /* an absolute length */ padding-inline-end: 1em; /* a length relative to the text size */ /* <percentage> value */ padding-inline-end: 5%; /* a padding relative to the block container's width */ /* global values */ padding-inline-end: inherit; padding-inline-end:
initial; padding-inline-end: unset; values the padding-inline-end property takes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-block-end, and padding-inline-s...
...property takes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-block-end, and padding-inline-start, which define the other paddings of the element. ...
...takes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-block-end, and padding-inline-start, which define the other paddings of the element. ...
...ine end padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-inline-end: 20px; background-color: #c8c800; } specifications specification status comment css logical properties and values level 1the def
inition of 'padding-inline-end' in that specification. editor's draft
initial def
inition ...
padding-inline-start - CSS: Cascading Style Sheets
com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ padding-inline-start: 10px; /* an absolute length */ padding-inline-start: 1em; /* a length relative to the text size */ /* <percentage> value */ padding-inline-start: 5%; /* a padding relative to the block container's width */ /* global values */ padding-inline-start: inherit; padding-inline-start:
initial; padding-inline-start: unset; values the padding-inline-start property takes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-block-end, and padding-inl...
...t property takes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-block-end, and padding-inline-end, which define the other paddings of the element. ...
...y takes the same values as the padding-left property. description this property corresponds to the padding-top, padding-right, padding-bottom, or padding-left property depending on the values defined for writing-mode, direction, and text-orientation. it relates to padding-block-start, padding-block-end, and padding-inline-end, which define the other paddings of the element. ...
...start padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-inline-start: 20px; background-color: #c8c800; } specifications specification status comment css logical properties and values level 1the def
inition of 'padding-inline-start' in that specification. editor's draft
initial def
inition ...
padding-inline - CSS: Cascading Style Sheets
, directionality, and text orientation. /* <length> values */ padding-inline: 10px 20px; /* an absolute length */ padding-inline: 1em 2em; /* relative to the text size */ padding-inline: 10px; /* sets both start and end values */ /* <percentage> values */ padding-inline: 5% 2%; /* relative to the nearest block container's width */ /* global values */ padding-inline: inherit; padding-inline:
initial; padding-inline: unset; constituent properties this property is a shorthand for the following css properties: padding-inline-end padding-inline-start syntax values the padding-inline property takes the same values as the padding-left property. description values for this property correspond to the padding-top and padding-bottom, or padding-right, and padding-left property dependin...
... the following css properties: padding-inline-end padding-inline-start syntax values the padding-inline property takes the same values as the padding-left property. description values for this property correspond to the padding-top and padding-bottom, or padding-right, and padding-left property depending on the values defined for writing-mode, direction, and text-orientation. ...
...owing css properties: padding-inline-end padding-inline-start syntax values the padding-inline property takes the same values as the padding-left property. description values for this property correspond to the padding-top and padding-bottom, or padding-right, and padding-left property depending on the values defined for writing-mode, direction, and text-orientation. ...
...adding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; padding-inline: 20px 40px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the def
inition of 'padding-inline' in that specification. editor's draft
initial def
inition ...
padding-right - CSS: Cascading Style Sheets
request. an element's padding area is the space between its content and its border. note: the padding property can be used to set paddings on all four sides of an element with a single declaration. ...
...
initial; padding-right: unset; the padding-right property is specified as a single value chosen from the list below. unlike margins, negative values are not allowed for padding. values <length> the size of the padding as a fixed value. must be nonnegative. <percentage> the size of the padding as a percentage, relative to the width of the containing block. must be nonnegative. formal def
inition
initial value0applies toall elements, except table-row-group, table-header-group, table-footer-group, table-row, table-column-group and table-column. it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> ex...
... ...
...a length formal syntax <length> | <percentage> examples setting right padding using pixels and percentages .content { padding-right: 5%; } .sidebox { padding-right: 10px; } specifications specification status comment css basic box modelthe def
inition of 'padding-right' in that specification. working draft no change. css level 2 (revision 1)the def
inition of 'padding-right' in that specification. recommendation no change. css level 1the def
inition of 'padding-right' in that specification. recommendation
initial def
inition. ...
page-break-after - CSS: Cascading Style Sheets
property has been replaced by the break-after property. the page-break-after css property adjusts page breaks after the current element. /* keyword values */ page-break-after: auto; page-break-after: always; page-break-after: avoid; page-break-after: left; page-break-after: right; page-break-after: recto; page-break-after: verso; /* global values */ page-break-after: inherit; page-break-after:
initial; page-break-after: unset; this property applies to block elements that generate a box. it won't apply on an empty <div> that won't generate a box. syntax values auto
initial value. automatic page breaks (neither forced nor forbidden). always always force page breaks after the element. avoid avoid page breaks after the element. left force page breaks after the element so that the...
...patibility reasons, page-break-after should be treated by browsers as an alias of break-after. this ensures that sites using page-break-after continue to work as designed. a subset of values should be aliased as follows: page-break-after break-after auto auto left left right right avoid avoid always page formal def
inition
initial valueautoapplies toblock-level elements in the normal flow of the root element. user agents may also apply it to other elements like table-row elements.inheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | always | avoid | left | right | recto | verso examples setting a page break after footnotes /* move to a new page after footnotes */ div.footnotes { ...
... ...
...setting a page break after footnotes /* move to a new page after footnotes */ div.footnotes { page-break-after: always; } specifications specification status comment css logical properties and values level 1the def
inition of 'recto and verso' in that specification. editor's draft adds the values recto and verso. css paged media module level 3the def
inition of 'page-break-after' in that specification. working draft extends the element that this property applies to table rows and table row groups. css level 2 (revision 1)the def
inition of 'page-break-after' in that specification. recommendation
initial def
inition browser compatibility the compatibility table on this page is generated from structured data. if you'd like...
page-break-before - CSS: Cascading Style Sheets
ement. this property applies to block elements that generate a box. it won't apply on an empty <div> that won't generate a box. /* keyword values */ page-break-before: auto; page-break-before: always; page-break-before: avoid; page-break-before: left; page-break-before: right; page-break-before: recto; page-break-before: verso; /* global values */ page-break-before: inherit; page-break-before:
initial; page-break-before: unset; syntax values auto
initial value. automatic page breaks (neither forced nor forbidden). always always force page breaks before the element. avoid avoid page breaks before the element. left force page breaks before the element so that the next page is formatted as a left page. right force page breaks before the element so that the next page is formatte...
...ility reasons, page-break-before should be treated by browsers as an alias of break-before. this ensures that sites using page-break-before continue to work as designed. a subset of values should be aliased as follows: page-break-before break-before auto auto left left right right avoid avoid always page formal def
inition
initial valueautoapplies toblock-level elements in the normal flow of the root element. user agents may also apply it to other elements like table-row elements.inheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | always | avoid | left | right | recto | verso examples avoid a page break before the dic /* avoid page break before the div */ div.note { page-br...
... ...
...xamples avoid a page break before the dic /* avoid page break before the div */ div.note { page-break-before: avoid; } specifications specification status comment css logical properties and values level 1the def
inition of 'recto and verso' in that specification. editor's draft adds the values recto and verso. css paged media module level 3the def
inition of 'page-break-before' in that specification. working draft extends the element that this property applies to table rows and table row groups. css level 2 (revision 1)the def
inition of 'page-break-before' in that specification. recommendation
initial def
inition browser compatibility the compatibility table on this page is generated from structured data. if you'd li...
place-content - CSS: Cascading Style Sheets
important: if the second value is not present, the first value is used for both, provided it is a valid value for both. if it is invalid for one or the other, the whole value will be invalid. values start the items are packed flush to each other toward the start edge of the ...
... edge and the last item, are all exactly the same. ...
... the last item, are all exactly the same. ...
...he live sample */ place-content: flex-end center; /* can be changed in the live sample */ } div > div { border: 2px solid #8c8c8c; width: 50px; background-color: #a0c8ff; } .small { font-size: 12px; height: 40px; } .large { font-size: 14px; height: 50px; } result specifications specification status comment css box alignment module level 3the def
inition of 'place content' in that specification. working draft
initial def
inition ...
place-items - CSS: Cascading Style Sheets
normal the effect of this keyword is dependent of the layout mode we are in: in block-level layouts, the keyword is a synonym of start. in absolutely-positioned layouts, th...
...eline is start, the one for last baseline is end. stretch if the combined size of the items is less than the size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container. ...
...start, the one for last baseline is end. stretch if the combined size of the items is less than the size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container. ...
...t:200px; width: 240px; place-items: center; /* you can change this value by selecting another option in the list */ background-color: #8c8c8c; } .flex { display: flex; flex-wrap: wrap; } .grid { display: grid; grid-template-columns: repeat(auto-fill, 50px); } result specifications specification status comment css box alignment module level 3the def
inition of 'place-items' in that specification. working draft
initial def
inition ...
quotes - CSS: Cascading Style Sheets
e examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword value */ quotes: none; quotes: auto; /* <string> values */ quotes: "«" "»"; /* set open-quote and close-quote to the french quotation marks */ quotes: "«" "»" "‹" "›"; /* set two levels of quotation marks */ /* global values */ quotes: inherit; quotes:
initial; quotes: unset; values none the open-quote and close-quote values of the content property produce no quotation marks. auto appropriate quote marks will be used for whatever language value is set on the selected elements (i.e. via the lang attribute). [<string> <string>]+ one or more pairs of <string> values for open-quote and close-quote. the first pair represents the outer level of ...
...o quotation marks. auto appropriate quote marks will be used for whatever language value is set on the selected elements (i.e. via the lang attribute). [<string> <string>]+ one or more pairs of <string> values for open-quote and close-quote. the first pair represents the outer level of quotation, the second pair is for the first nested level, next pair for third level and so on. formal def
inition
initial valuedepends on user agentapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | auto | [ <string> <string> ]+ examples basic quote marks html <q>to be or not to be. that's the question!</q> css q { quotes: '"' '"' "'" "'"; } q::before { content: open-quote; } q::after { content: close-quote; } result auto quotes for...
...if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a...
...<div> <hr> <div lang="de"> <q>dies ist ein deutsches zitat</q> <div> <hr> <div lang="en"> <q>this is an english quote.</q> <div> css /*q { quotes: auto; }*/ result specifications specification status comment css generated content module level 3the def
inition of 'quotes' in that specification. working draft css level 2 (revision 1)the def
inition of 'quotes' in that specification. recommendation
initial def
inition 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for andr...
ruby-align - CSS: Cascading Style Sheets
the ruby-align css property defines the distribution of the different ruby elements over the base. /* keyword values */ ruby-align: start; ruby-align: center; ruby-align: space-between; ruby-align: space-around; /* global values */ ruby-align: inherit; ruby-align:
initial; ruby-align: unset; syntax values start is a keyword indicating that the ruby will be aligned with the start of the base text. center is a keyword indicating that the ruby will be aligned at the middle of the base text. ...
...will be aligned with the start of the base text. center is a keyword indicating that the ruby will be aligned at the middle of the base text. space-between is a keyword indicating that the extra space will be distributed between the elements of the ruby. space-around is a keyword indicating that the extra space will be distributed between the elements of the ruby, and around it. ...
...ligned with the start of the base text. center is a keyword indicating that the ruby will be aligned at the middle of the base text. space-between is a keyword indicating that the extra space will be distributed between the elements of the ruby. space-around is a keyword indicating that the extra space will be distributed between the elements of the ruby, and around it. ...
......
scroll-behavior - CSS: Cascading Style Sheets
er, are not affected by this property. when this property is specified on the root element, it applies to the viewport instead. this property specified on the body element will not propagate to the viewport. user agents are allowed to ignore this property. ...
... scroll-behavior:
initial; scroll-behavior: unset; the scroll-behavior property is specified as one of the keyword values listed below. values auto the scrolling box scrolls instantly. smooth the scrolling box scrolls in a smooth fashion using a user-agent-defined timing function over a user-agent-defined period of time. user agents should follow platform conventions, if any. ...
...ehavior:
initial; scroll-behavior: unset; the scroll-behavior property is specified as one of the keyword values listed below. values auto the scrolling box scrolls instantly. smooth the scrolling box scrolls in a smooth fashion using a user-agent-defined timing function over a user-agent-defined period of time. user agents should follow platform conventions, if any. ...
...5px; border: 1px solid black; } scroll-container { display: block; width: 350px; height: 200px; overflow-y: scroll; scroll-behavior: smooth; } scroll-page { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 5em; } result specifications specification status comment css object model (cssom) view modulethe def
inition of 'scroll-behavior' in that specification. working draft
initial specification ...
scrollbar-color - CSS: Cascading Style Sheets
e moving part of the scrollbar, which usually floats on top of the track. syntax /* keyword values */ scrollbar-color: auto; scrollbar-color: dark; scrollbar-color: light; /* <color> values */ scrollbar-color: rebeccapurple green; /* two valid colors. the first applies to the thumb of the scrollbar, the second to the track. */ /* global values */ scrollbar-color: inherit; scrollbar-color:
initial; scrollbar-color: unset; values <scrollbar-color> defines the color of the scrollbar. auto default platform rendering for the track portion of the scrollbar, in the absence of any other related scrollbar color properties. dark show a dark scrollbar, which can be either a dark variant of scrollbar provided by the platform, or a custom scrollbar with dark c...
...ply any scrollbar-color value set on the root element to the viewport. accessibility concerns when using scrollbar-color property with specific color values, authors should ensure the specified colors have enough contrast between them. for keyword values, uas should ensure the colors they use have enough contrast. see techniques for wcag 2.0: g183: using a contrast ratio of 3:1. ...
...crollbar-color value set on the root element to the viewport. accessibility concerns when using scrollbar-color property with specific color values, authors should ensure the specified colors have enough contrast between them. for keyword values, uas should ensure the colors they use have enough contrast. see techniques for wcag 2.0: g183: using a contrast ratio of 3:1. ...
...kohlrabi welsh onion daikon amaranth tatsoi tomatillo melon azuki bean garlic. gumbo beet greens corn soko endive gumbo gourd. parsley shallot courgette tatsoi pea sprouts fava bean collard greens dandelion okra wakame tomato. dandelion cucumber earthnut pea peanut soko zucchini.</div> result specifications specification status comment css scrollbars level 1the def
inition of 'scrollbar-color' in that specification. working draft
initial def
inition. ...
shape-margin - CSS: Cascading Style Sheets
e examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. the margin lets you adjust the distance between the edges of the shape (the float element) and the surrounding content. ...
...nt) and the surrounding content. syntax /* <length> values */ shape-margin: 10px; shape-margin: 20mm; /* <percentage> value */ shape-margin: 60%; /* global values */ shape-margin: inherit; shape-margin:
initial; shape-margin: unset; values <length-percentage> sets the margin of the shape to a <length> value or to a <percentage> of the width of the element's containing block. ...
...he surrounding content. syntax /* <length> values */ shape-margin: 10px; shape-margin: 20mm; /* <percentage> value */ shape-margin: 60%; /* global values */ shape-margin: inherit; shape-margin:
initial; shape-margin: unset; values <length-percentage> sets the margin of the shape to a <length> value or to a <percentage> of the width of the element's containing block. ...
...ts truth as we know it.</section> css section { max-width: 400px; } .shape { float: left; width: 150px; height: 150px; background-color: maroon; clip-path: polygon(0 0, 150px 150px, 0 150px); shape-outside: polygon(0 0, 150px 150px, 0 150px); shape-margin: 20px; } result specifications specification status comment css shapes module level 1the def
inition of 'shape-margin' in that specification. candidate recommendation
initial def
inition ...
tab-size - CSS: Cascading Style Sheets
the tab-size css property is used to customize the width of tab characters (u+0009). syntax /* <integer> values */ tab-size: 4; tab-size: 0; /* <length> values */ tab-size: 10px; tab-size: 2em; /* global values */ tab-size: inherit; tab-size:
initial; tab-size: unset; values <integer> a multiple of the advance width of the space character (u+0020) to be used as the width of tabs. must be nonnegative. <length> the width of tabs. must be nonnegative. ...
...+0009). syntax /* <integer> values */ tab-size: 4; tab-size: 0; /* <length> values */ tab-size: 10px; tab-size: 2em; /* global values */ tab-size: inherit; tab-size:
initial; tab-size: unset; values <integer> a multiple of the advance width of the space character (u+0020) to be used as the width of tabs. must be nonnegative. <length> the width of tabs. must be nonnegative. ...
...syntax /* <integer> values */ tab-size: 4; tab-size: 0; /* <length> values */ tab-size: 10px; tab-size: 2em; /* global values */ tab-size: inherit; tab-size:
initial; tab-size: unset; values <integer> a multiple of the advance width of the space character (u+0020) to be used as the width of tabs. must be nonnegative. <length> the width of tabs. must be nonnegative. ...
...ml <p>no tab</p> <p>	default tab size of 8 characters wide</p> <p class="custom">	custom tab size of 3 characters wide</p> <p> 3 spaces, equivalent to the custom tab size</p> css p { white-space: pre; } .custom { tab-size: 3; -moz-tab-size: 3; } result specifications specification status comment css text module level 3the def
inition of 'tab-size' in that specification. working draft
initial def
inition ...
text-combine-upright - CSS: Cascading Style Sheets
書橫向 in chinese. /* keyword values */ text-combine-upright: none; text-combine-upright: all; /* digits values */ text-combine-upright: digits; /* fits 2 consecutive digits horizontally inside vertical text */ text-combine-upright: digits 4; /* fits up to 4 consecutive digits horizontally inside vertical text */ /* global values */ text-combine-upright: inherit; text-combine-upright:
initial; text-combine-upright: unset; syntax values none there is no special processing. all attempts to typeset all consecutive characters within the box horizontally, such that they take up the space of a single character within the vertical line of the box. digits <integer>? attempts to display a sequence of consecutive ascii digits (u+0030–u+0039) that has as many or fewer characters ...
...le character within the vertical line of the box. digits <integer>? attempts to display a sequence of consecutive ascii digits (u+0030–u+0039) that has as many or fewer characters than the specified integer, such that it takes up the space of a single character within the vertical line box. if the integer is omitted, it computes to 2. integers outside the range of 2-4 are invalid. formal def
inition
initial valuenoneapplies tonon-replaced inline elementsinheritedyescomputed valuespecified keyword, plus integer if 'digits'animation typediscrete formal syntax none | all | [ digits <integer>? ] examples digits the digits value requires less markup than the all value when digits are being combined, but it is currently not very widely supported by browsers. html <p lang="ja" class="exa...
... more browsers than the digits value. ...
...span>日</p> css html { writing-mode: vertical-rl; font: 24px serif } .num { text-combine-upright: all } results screenshotlive sample specifications specification status comment css writing modes level 4the def
inition of 'text-combine-upright' in that specification. candidate recommendation add digits value css writing modes module level 3the def
inition of 'text-combine-upright' in that specification. proposed recommendation
initial def
inition ...
text-decoration-skip-ink - CSS: Cascading Style Sheets
bute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. text-decoration-skip-ink is not part of the text-decoration shorthand. syntax /* single keyword */ text-decoration-skip-ink: none; text-decoration-skip-ink: auto; text-decoration-skip-ink: all; /* global keywords */ text-decoration-skip: inherit; text-decoration-skip:
initial; text-decoration-skip: unset; values none underlines and overlines are drawn across the full length of the text content, including parts that cross over glyph descenders and ascenders. auto the default — the browser may interrupt underlines and overlines so that they do not touch or closely approach a glyph. that is, they are interrupted where they would otherwise cross over a glyph.
...overlines so that they do not touch or closely approach a glyph. that is, they are interrupted where they would otherwise cross over a glyph. all the browser must interrupt underlines and overlines so that they do not touch or closely approach a glyph. this can be helpful with certain chinese, japanese, or korean (cjk) fonts, where the auto behavior might not create interruptions. ...
... so that they do not touch or closely approach a glyph. that is, they are interrupted where they would otherwise cross over a glyph. all the browser must interrupt underlines and overlines so that they do not touch or closely approach a glyph. this can be helpful with certain chinese, japanese, or korean (cjk) fonts, where the auto behavior might not create interruptions. ...
......
text-decoration-skip - CSS: Cascading Style Sheets
thus, text decoration is drawn for all text content and across atomic inline-level boxes. objects the entire margin box of the element is skipped if it is an atomic inline such as an image or inline-block. spaces all spacing is skipped: all unicode white space characters and all word separators, plus any adjacent l...
...e content edge of the decorating box. thus, adjacent elements receive separate underlines. (this is important in chinese, where underlining is a form of punctuation.) box-decoration the text decoration is skipped over the box's margin, border, and padding areas. this only has an effect on decorations imposed by an ancestor; a decorating box never draws over its own box decoration. ...
... edge of the decorating box. thus, adjacent elements receive separate underlines. (this is important in chinese, where underlining is a form of punctuation.) box-decoration the text decoration is skipped over the box's margin, border, and padding areas. this only has an effect on decorations imposed by an ancestor; a decorating box never draws over its own box decoration. ...
...one | [ objects | [ spaces | [ leading-spaces | trailing-spaces ] ] | edges | box-decoration ] examples skipping edges html <p>hey, grab a cup of <em>coffee!</em></p> css p { margin: 0; font-size: 3em; text-decoration: underline; text-decoration-skip: edges; } result specifications specification status comment css text decoration module level 4the def
inition of 'text-decoration-skip' in that specification. working draft
initial def
inition ...
text-decoration-style - CSS: Cascading Style Sheets
. when setting multiple line-decoration properties at once, it may be more convenient to use the text-decoration shorthand property instead. syntax /* keyword values */ text-decoration-style: solid; text-decoration-style: double; text-decoration-style: dotted; text-decoration-style: dashed; text-decoration-style: wavy; /* global values */ text-decoration-style: inherit; text-decoration-style:
initial; text-decoration-style: unset; values solid draws a single line. double draws a double line. dotted draws a dotted line. dashed draws a dashed line. wavy draws a wavy line. -moz-none draws no line. use text-decoration-line: none instead. formal def
inition
initial valuesolidapplies toall elements. it also applies to ::first-letter and ::first-line.inheritednocomputed valueas...
...the text-decoration property is now a shorthand to define multiple related properties. ...
...the text-decoration property is now a shorthand to define multiple related properties. ...
...the text-decoration property is now a shorthand to define multiple related properties. ...
text-overflow - CSS: Cascading Style Sheets
owing inline content and applies a fade-out effect near the edge of the line box with complete transparency at the edge. the argument determines the distance over which the fade effect is applied. the <percentage> is resolved against the width of the line box. values lower than 0 are clipped to 0. values greater than the width of the line box are clipped to the width of the line box. ...
...ine content and applies a fade-out effect near the edge of the line box with complete transparency at the edge. the argument determines the distance over which the fade effect is applied. the <percentage> is resolved against the width of the line box. values lower than 0 are clipped to 0. values greater than the width of the line box are clipped to the width of the line box. ...
...mal def
inition
initial valueclipapplies toblock container elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ clip | ellipsis | <string> ]{1,2} examples css p { width: 200px; border: 1px solid; padding: 2px 5px; /* both of the following 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">lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> <p class="overflow-clip">lorem ipsum dolor sit amet, consectet...
...overflow: ',' ellipsis ,34… 1234567890 ,43… 1234567890 text-overflow: ',' '.' ,34. 1234567890 ,43. 1234567890 specifications specification status comment css overflow module level 4 added the values <string> and fade and the fade() function css overflow module level 3the def
inition of 'text-overflow' in that specification. working draft
initial def
inition a previous version of this interface reached the candidate recommendation status. as some not-listed-at-risk features needed to be removed, the spec was demoted to the working draft level, explaining why browsers implemented this property unprefixed, though not at the cr state. ...
text-size-adjust - CSS: Cascading Style Sheets
the text-size-adjust css property controls the text inflation algorithm used on some smartphones and tablets. other browsers will ignore this property. /* keyword values */ text-size-adjust: none; text-size-adjust: auto; /* <percentage> value */ text-size-adjust: 80%; /* global values */ text-size-adjust: inherit; text-size-adjust:
initial; text-size-adjust: unset; because many websites have not been developed with small devices in mind, mobile browsers differ from desktop browsers in the way they render web pages. instead of laying out pages at the width of the device screen, they lay them out using a viewport that is much wider, usually 800 or 1000 pixels. to map the extra-wide layout back to the original device size, they either show only part of the whole render or scale th...
...yntax the text-size-adjust property is specified as none, auto, or a <percentage>. values none disables the browser's inflation algorithm. auto enables the browser's inflation algorithm. this value is used to cancel a none value previously set with css. <percentage> enables the browser's inflation algorithm, specifying a percentage value with which to increase the font size. ...
...e text-size-adjust property is specified as none, auto, or a <percentage>. values none disables the browser's inflation algorithm. auto enables the browser's inflation algorithm. this value is used to cancel a none value previously set with css. <percentage> enables the browser's inflation algorithm, specifying a percentage value with which to increase the font size. ...
...xamples basic disabling usage as hinted at above, on a properly designed responsive site the text-size-adjust behavior is not needed, so developers can elect to turn it off by specifying a vlaue of none: p { -webkit-text-size-adjust: none; text-size-adjust: none; } specifications specification status comment css mobile text size adjustment module level 1the def
inition of 'text-size-adjust' in that specification. editor's draft
initial def
inition ...
text-underline-position - CSS: Cascading Style Sheets
github.com/mdn/interactive-examples and send us a pull request. syntax /* single keyword */ text-underline-position: auto; text-underline-position: under; text-underline-position: left; text-underline-position: right; /* multiple keywords */ text-underline-position: under left; text-underline-position: right under; /* global values */ text-underline-position: inherit; text-underline-position:
initial; text-underline-position: unset; syntax values auto the user agent uses its own algorithm to place the line at or under the alphabetic baseline. from-font if the font file includes information about a preferred position, use that value. if the font file doesn't include this information, behave as if auto was set, with the browser choosing an appropriate position. under forces the li...
...t. in horizontal writing-modes, it is a synonym of under. auto-pos a synonym of auto, which should be used instead. above forces the line to be above the text. when used with east-asian text, using the auto keyword will lead to a similar effect. below forces the line to be below the text. when used with alphabetic text, using the auto keyword will lead to a similar effect. formal def
inition
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">lorem ipsum dolor sit amet, consectetur adipiscing elit. nullam consectetur ac turpis vel laoreet. nullam volutpat pharetra lorem...
...-decoration shorthand property, it may be appropriate to set its value at a global level. ...
...or example, the under value may be appropriate for a document with lots of chemical and mathematical formulas, which make a large use of subscripts. :root { text-underline-position: under; } specifications specification status comment css text decoration module level 3the def
inition of 'text-underline-position' in that specification. candidate recommendation
initial def
inition ...
transition-delay - CSS: Cascading Style Sheets
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. ...
...ch 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. ...
...mber 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. ...
... 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); specifications specification status comment css transitionsthe def
inition of 'transition-delay' in that specification. working draft
initial def
inition ...
transition-duration - CSS: Cascading Style Sheets
ter list, the user agent repeat the list of durations. if there are more durations, the list is simply truncated to the right size. in both case the css declaration stays valid. ...
...inherit; transition-duration:
initial; transition-duration: unset; values <time> is a <time> denoting the amount of time the transition from the old value of a property to the new value should take. a time of 0s indicates that no transition will happen, that is the switch between the two states will be instantaneous. a negative value for the time renders the declaration invalid. ...
...transition-duration:
initial; transition-duration: unset; values <time> is a <time> denoting the amount of time the transition from the old value of a property to the new value should take. a time of 0s indicates that no transition will happen, that is the switch between the two states will be instantaneous. a negative value for the time renders the declaration invalid. ...
... 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); specifications specification status comment css transitionsthe def
inition of 'transition-duration' in that specification. working draft
initial def
inition ...
unset - CSS: Cascading Style Sheets
unset can be applied to any css property, including the css shorthand all. ...
... unset can be applied to any css property, including the css shorthand all. ...
... candidate recommendation no changes from level 3. css cascading a...
...ed border.</p> <div> <p>this text has a red border.</p> </div> <div class="bar"> <p>this text has a black border (
initial default, not inherited).</p> </div> css div { border: 1px solid green; } p { border: 1px solid red; } .bar p { border-color: unset; } result specifications specification status comment css cascading and inheritance level 4the def
inition of 'unset' in that specification. candidate recommendation no changes from level 3. css cascading and inheritance level 3the def
inition of 'unset' in that specification. candidate recommendation
initial def
inition. ...
vertical-align - CSS: Cascading Style Sheets
values for inline elements parent-relative values these values vertically align the element relative to its parent element: baseline aligns the baseline of the element with the baseline of its parent. the baseline of some replaced elements, like <textarea>, is not specified by the html ...
...t-bottom, <length>, and <percentage>) aligns the baseline of the cell with the baseline of all other cells in the row that are baseline-aligned. top aligns the top padding edge of the cell with the top of the row. middle centers the padding box of the cell within the row. bottom aligns the bottom padding edge of the cell with the bottom of the row. negative values are allowed. formal def
inition
initial valuebaselineapplies toinline-level and table-cell elements. it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the line-height of the element itselfcomputed valuefor percentage and length values, the absolute length, otherwise the keyword as specifiedanimation typea length formal syntax baseline | sub | super | text-top | text-bottom | middle | top | ...
... ...
... } img.bottom { vertical-align: text-bottom; } img.middle { vertical-align: middle; } result specifications specification status comment css level 2 (revision 1)the def
inition of 'vertical-align' in that specification. recommendation adds the <length> value and allows it to be applied to elements with a display type of table-cell. css level 1the def
inition of 'vertical-align' in that specification. recommendation
initial def
inition. ...
widows - CSS: Cascading Style Sheets
the widows css property sets the minimum number of lines in a block container that must be shown at the top of a page, region, or column. /* <integer> values */ widows: 2; widows: 3; /* global values */ widows: inherit; widows:
initial; widows: unset; in typography, a widow is the last line of a paragraph that appears alone at the top of a page. (the paragraph is continued from a prior page.) syntax values <integer> the minimum number of lines that can stay by themselves at the top of a new fragment after a fragmentation break. the value must be positive. ...
...* global values */ widows: inherit; widows:
initial; widows: unset; in typography, a widow is the last line of a paragraph that appears alone at the top of a page. (the paragraph is continued from a prior page.) syntax values <integer> the minimum number of lines that can stay by themselves at the top of a new fragment after a fragmentation break. the value must be positive. formal def
inition
initial value2applies toblock container elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax <integer> examples controlling column widows html <div> <p>this is the first paragraph containing some text.</p> <p>this is the second paragraph containing some more text than the first one. it is used to demonstrate how widows work.</p> <p>this is the third p...
...d to demonstrate how widows work.</p> <p>this is the third paragraph. ...
...{ background-color: #8ca0ff; } p:first-child { margin-top: 0; } result specifications specification status comment css fragmentation module level 3the def
inition of 'widows' in that specification. candidate recommendation extends widows to apply to any type of fragment, including pages, regions, or columns. css multi-column layout modulethe def
inition of 'widows' in that specification. working draft recommendations to consider widows in relation to columns. css level 2 (revision 1)the def
inition of 'widows' in that specification. recommendation
initial def
inition. ...
will-change - CSS: Cascading Style Sheets
not be used to anticipate performance problems. /* keyword values */ will-change: auto; will-change: scroll-position; will-change: contents; will-change: transform; /* example of <custom-ident> */ will-change: opacity; /* example of <custom-ident> */ will-change: left, top; /* example of two <animateable-feature> */ /* global values */ will-change: inherit; will-change:
initial; will-change: unset; proper usage of this property can be a bit tricky: don't apply will-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 o...
...uthor expects to animate or change something about the element’s contents in the near future. <custom-ident> indicates that the author expects to animate or change the property with the given name on the element in the near future. if the property given is a shorthand, it indicates the expectation for all the longhands the shorthand expands to. it cannot be one of the following values: unset,
initial, inherit, will-change, auto, scroll-position, or contents. the spec doesn't define the behavior of particular value, but it is common for transform to be a compositing layer hint. chrome currently takes two actions, given particular css property idents: establish a new compositing layer or a new stacking context. via stylesheet it may be appropriate to include will-change in your style shee...
...tion where the pages are large and complex. this will let browser prepare the transition ahead of time and allow for snappy transitions between the pages as soon as the key is pressed. but use caution with the will-change property directly in stylesheets. it may cause the browser to keep the optimization in memory for much longer than it is needed. .slide { will-change: transform; } formal def
inition
initial valueautoapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | <animateable-feature>#where <animateable-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. var el = do...
...ser); 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 def
inition of 'will-change' in that specification. candidate recommendation
initial def
inition ...
word-spacing - CSS: Cascading Style Sheets
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 /* keyword value */ word-spacing: normal; /* <length> values */ word-spacing: 3px; word-spacing: 0.3em; /* <percentage> values */ word-spacing: 50%; word-spacing: 200%; /* global values */ word-spacing: inherit; word-spacing:
initial; word-spacing: unset; values normal the normal inter-word spacing, as defined by the current font and/or the browser. <length> specifies extra spacing in addition to the intrinsic inter-word spacing defined by the font. <percentage> specifies extra spacing as a percentage of the affected character’s advance width. examples html <div id="mozdiv1">here are many words...</div> <di...
...ng and end of each word is unrecognizable. legible word-spacing must be determined on a case-by-case basis, as different font families have different character widths. there is no one value that can ensure all font families automatically maintain their legibility. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.8 | w3c understanding wcag 2.0 formal def
inition
initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyespercentagesrefer to the width of the affected glyphcomputed valuean optimum, minimum, and maximum value, each consisting of either an absolute length, a percentage, or the keyword normalanimation typea length formal syntax normal | <length-percentage>where <length-percentage> = <length>...
... recommendation no change. css level 1...
...ications specification status comment css text module level 3the def
inition of 'word-spacing' in that specification. working draft replaces the previous values with a <spacing-limit> value that defines the same thing, plus the <percentage> value. allows up to three values describing the optimum, minimum, and maximum value. css level 2 (revision 1)the def
inition of 'word-spacing' in that specification. recommendation no change. css level 1the def
inition of 'word-spacing' in that specification. recommendation
initial def
inition. ...
writing-mode - CSS: Cascading Style Sheets
ck flow direction, which is the direction in which block-level containers are stacked, and the direction in which inline-level content flows within a block container. thus, it also determines the ordering of block-level content. syntax /* keyword values */ writing-mode: horizontal-tb; writing-mode: vertical-rl; writing-mode: vertical-lr; /* global values */ writing-mode: inherit; writing-mode:
initial; writing-mode: unset; the writing-mode property is specified as one of the values listed below. the flow direction in horizontal scripts is also affected by the directionality of that script, either left-to-right (ltr, like english and most other languages) or right-to-left (rtl, like hebrew or arabic). values horizontal-tb for ltr scripts, content flows horizontally from left to right. ...
... except for svg1 documents. for css, use horizontal-tb instead. rl deprecated except for svg1 documents. for css, use horizontal-tb instead. tb deprecated except for svg1 documents. for css, use vertical-lr instead. tb-lr deprecated except for svg1 documents. for css, use vertical-lr instead. tb-rl deprecated except for svg1 documents. for css, use vertical-rl instead. ...
...or svg1 documents. for css, use horizontal-tb instead. rl deprecated except for svg1 documents. for css, use horizontal-tb instead. tb deprecated except for svg1 documents. for css, use vertical-lr instead. tb-lr deprecated except for svg1 documents. for css, use vertical-lr instead. tb-rl deprecated except for svg1 documents. for css, use vertical-rl instead. ...
...ting-mode: sideways-lr; } .example.text5 span, .example.text5 { writing-mode: sideways-rl; -webkit-writing-mode: sideways-rl; -ms-writing-mode: sideways-rl; } result this image shows what the output should look like, in case your browser's support for writing-mode is incomplete: specifications specification status comment css writing modes level 4the def
inition of 'writing-mode' in that specification. candidate recommendation add sideways-lr and sideways-rl css writing modes module level 3the def
inition of 'writing-mode' in that specification. proposed recommendation
initial def
inition ...
z-index - CSS: Cascading Style Sheets
with any position other than static), the z-index property specifies: the stack level of the box in the current stacking context. whether the box establishes a local stacking context. syntax /* keyword value */ z-index: auto; /* <integer> values */ z-index: 0; z-index: 3; z-index: 289; z-index: -1; /* negative values to lower the priority */ /* global values */ z-index: inherit; z-index:
initial; z-index: unset; the z-index property is specified as either the keyword auto or an <integer>. values auto the box does not establish a new local stacking context. the stack level of the generated box in the current stacking context is the same as its parent's box. <integer> this <integer> is the stack level of the generated box in the current stacking context. the box also establishe...
...k level of the generated box in the current stacking context is the same as its parent's box. <integer> this <integer> is the stack level of the generated box in the current stacking context. the box also establishes a local stacking context in which its stack level is 0. this means that the z-indexes of descendants are not compared to the z-indexes of elements outside this element. ...
...f the generated box in the current stacking context is the same as its parent's box. <integer> this <integer> is the stack level of the generated box in the current stacking context. the box also establishes a local stacking context in which its stack level is 0. this means that the z-indexes of descendants are not compared to the z-indexes of elements outside this element. ...
...ove .green-box and .dashed-box */ background: gold; width: 80%; left: 60px; top: 3em; } .green-box { position: absolute; z-index: 2; /* put .green-box above .dashed-box */ background: lightgreen; width: 20%; left: 65%; top: -25px; height: 7em; opacity: 0.9; } result specifications specification status comment css level 2 (revision 1)the def
inition of 'z-index' in that specification. recommendation
initial def
inition ...
Adding captions and subtitles to HTML5 video - Developer guides
ill appear in the user interface to allow the user to easily select which subtitle language they want to see. src is assigned a valid url pointing to the relevant webvtt subtitle file in each case. srclang indicates what language each subtitle files' contents are in. the default attribute is set on the english <track> element, indicating to the browser that this is the default subtitle file def
inition to use when subtitles have been turned on and the user has not made a specific selection. in addition to adding the <track> elements, we have also added a new button to control the subtitles menu that we will build. as a consequence, the video controls now look as follows: <div id="video-controls" class="controls" data-state="hidden"> <button id="playpause" type="button" data-state="play...
...pports html5 video subtitles, there will be a button provided within the native control set to access them. however, since we have defined our own video controls, this button is hidden, and we need to define our own. browsers do vary as to what they support, so we will be attempting to bring a more unified ui to each browser where possible. there's more on browser compatibility issues later on. ...
... need to define our own. browsers do vary as to what they support, so we will be attempting to bring a more unified ui to each browser where possible. there's more on browser compatibility issues later on.
initial setup as with all the other buttons, one of the first things we need to do is store a handle to the subtitles' button: var subtitles = document.getelementbyid('subtitles'); we also
initially turn off all subtitles, in case the browser turns any of them on by default: for (var i = 0; i < video.texttracks.length; i++) { video.texttracks[i].mode = 'hidden'; } the video.texttracks property contains an array of all the text tracks attached to the video. we loop through each one and set its mode to hidden. note: the webvtt api gives us access to all the text tracks that are defi...
...ton> elements, and returns them so they can be added to the subtitles menu list. it also sets up the required event listeners on the button to toggle the relevant subtitle set on or off. this is done by simply setting the required subtlte's mode attribute to showing, and setting the others to hidden. once the menu is built, it is then inserted into the dom at the bottom of the videocontainer. ...
Block formatting context - Developer guides
floated element. as the content of the float is taller than the content alongside it, the border of the <div> now runs through the float. as explained in the guide to in-flow and out of flow elements, the float has been taken out of flow so the background and border of the <div> only contain the content and not the float. using overflow: auto setting overflow: auto or set other values than the
initial value of overflow: visible created a new bfc containing the float. our <div> now becomes a mini-layout inside our layout. any child element will be contained inside it. the problem with using overflow to create a new bfc is that the overflow property is meant for telling the browser how you want to deal with overflowing content. there are some occasions in which you will find you get unwanted...
... see also float, clear css key concepts: css syntax, at-rule, comments, specificity and inheritance, the box, layout modes and vis...
... .red-inner { height: 50px; margin: 10px 0; } .blue { background: blue; } .red-outer { overflow: hidden; background: red; } specifications specification status comment css display module level 3the def
inition of 'block formatting context' in that specification. candidate recommendation define bfc(abbr) etc. css level 2 (revision 1)the def
inition of 'block formatting context' in that specification. recommendation
initial def
inition. ...
.... candidate recommendation define bfc(abbr) etc. css level 2 (revision 1)the def
inition of 'block formatting context' in that specification. recommendation
initial def
inition. see also float, clear css key concepts: css syntax, at-rule, comments, specificity and inheritance, the box, layout modes and visual formatting models, and margin collapsing, or the
initial, computed, resolved, specified, used, and actual values. def
initions of value syntax, shorthand properties and replaced elements. ...
Overview of events and handlers - Developer guides
e web page, relating to the device on which the browser is running, and from many other causes such as media stream playback or animation timing. events and event handling become central to web programming with the addition of the language to browsers, accompanying a switch in the rendering architecture of browsers from fetch and load page rendering to event driven, reflow based, page rendering.
initially, browsers wait, until they receive all of the resources associated with a page, to parse, process, draw, and present the page to the user. the displayed page remains unchanged until the browser requests a new page. with the change to dynamic page rendering, browsers loop continuously between processing, drawing, presenting content, and waiting for some new event trigger. event triggers inclu...
... it is passed as an argument; the object has information about the event, notably the time at which the event occurred. as a second example, much modern javascript integrated into web pages is wrapped into an event function call to ensure that the code is only executed when the html has been processed and is available for alteration or decoration. ...
...t function call to ensure that the code is only executed when the html has been processed and is available for alteration or decoration. for example, code might be attached as: var func
init = function(){ // user code goes here and can safely address all the html elements from the page // since the document has successfully been 'loaded' } document.addeventlistener('domcontentloaded', func
init); so that this code will only be executed after the document object emits the 'domcontentloaded' event because the html has been parsed and javasript objects created representing each of the nodes of the html document. note that in this example, the code does not even name the event argument to the function because the code never needs to use the data structure describing the event; rather, the...
...ct document representing the html document emits an event called 'domcontentloaded' when the document has finished loading, the dom node objects such as div or button emit an event called 'click' when the user presses the mouse button while the mouse pointer is on top of the dom node in the html page. the event object hierarchy the web browser defines many events of different kinds. each def
inition includes, as the data structure passed to the handler function, an object which inherits from the eventprototype object. a partial diagram of the class hierarchy of event objects is: note: this diagram is incomplete. the web api documentation contains a page defining the event object which also includes the known dom event subclasses of the event object. documents three sources on the...
HTML attribute: readonly - HTML: Hypertext Markup Language
ime, datetime-local, and number<input> types and the <textarea> form control elements. if present on any of these input types and elements, the :read-only pseudo class will match. if the attribute is not included, the :read-write pseudo class will match. the attribute is not supported or relevant to <select> or input types that are already not mutable, such as checkbox and radio or cannot, by def
inition, start with a value, such as the file input type. range and color, as both have default values. it is also not supported on hidden as it can not be expected that a user to fill out a form that is hidden. nor is it supported on any of the button types, including image. note: only text controls can be made read-only, since for other controls (such as checkboxes and buttons) there is no useful...
... recommendation ...
... recommendation ...
...<input type="radio" name="radio" value="disabled" disabled> disabled </label></p> </fieldset> specifications specification status comment html living standardthe def
inition of 'readonly attribute' in that specification. living standard html5the def
inition of 'readonly attribute' in that specification. recommendation html 5.1the def
inition of 'readonly attribute' in that specification. recommendation ...
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
use is independent from all others; providing a title for one does not automatically attach the same expansion text to others with the same content text. usage notes typical use cases it's certainly not required that all abbreviations be marked up using <abbr>. there are, though, a few cases where it's helpful to do so: when an abbreviation is used and you want to provide an expansion or def
inition outside the flow of the document's content, use <abbr> with an appropriate title. to define an abbreviation which may be unfamiliar to the reader, present the term using <abbr> and either a title attribute or inline text providing the def
inition. when an abbreviation's presence in the text needs to be semantically noted, the <abbr> element is useful. this can be used, in turn, for styling or...
...see the example defining an abbreviation below. ...
...l <p>using <abbr>html</abbr> is fun and easy!</p> result styling abbreviations you can use css to set a custom style to be used for abbreviations, as seen in this simple example. html <p>using <abbr>css</abbr>, you can style your abbreviations!</p> css abbr { font-variant: all-small-caps; } result providing an expansion adding a title attribute lets you provide an expansion or def
inition for the abbreviation or acronym. html <p>ashok's joke made me <abbr title="laugh out loud">lol</abbr> big time.</p> result defining an abbreviation you can use <abbr> in tandem with <dfn> to more formally define an abbreviation, as shown here. html <p><dfn id="html"><abbr title="hypertext markup language">html</abbr> </dfn> is a markup language used to create the semantics and structu...
...n. example <p>javascript object notation (<abbr>json</abbr>) is a lightweight data-interchange format.</p> this is especially helpful for people who are unfamiliar with the terminology or concepts discussed in the content, people who are new to the language, and people with cognitive concerns. specifications specification status comment html living standardthe def
inition of '<abbr>' in that specification. living standard html5the def
inition of '<abbr>' in that specification. recommendation html 4.01 specificationthe def
inition of '<abbr>' in that specification. recommendation ...
<button>: The Button element - HTML: Hypertext Markup Language
button, submitted as a pair with the button’s value as part of the form data. type the default behavior of the button. possible values are: submit: the button submits the form data to the server. this is the default if the attribute is not specified for buttons associated with a <form>, or if the attribute is an empty or invalid value. reset: the button resets all the controls to their
initial values, like <input type="reset">. (this behavior tends to annoy users.) button: the button has no default behavior, and does nothing when pressed by default. it can have client-side scripts listen to the element's events, which are triggered when the events occur. value defines the value associated with the button’s name when it’s submitted with the form data. this value is passed...
... recommendation ...
... recommendation ...
...mobile no (even with a tabindex) n/a chrome 35 no (even with a tabindex) yes specifications specification status comment html living standardthe def
inition of '<button>' in that specification. living standard html5the def
inition of '<button>' in that specification. recommendation html 4.01 specificationthe def
inition of '<button>' in that specification. recommendation ...
<details>: The Details disclosure element - HTML: Hypertext Markup Language
tents. html <details> <summary>system requirements</summary> <p>requires a computer running an operating system. ...
...ning an operating system. the computer must have some memory and ideally some kind of long-term storage. ...
...ideally some kind of long-term storage. ...
...e kind of long-term storage. ...
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
d attribute. see labels below. type a string specifying the type of control to render. for example, to create a checkbox, a value of checkbox is used. if omitted (or an unknown value is specified), the input type text is used, creating a plaintext input field. permitted values are listed in <input> types above. value the input control's value. when specified in the html, this is the
initial value, and from then on it can be altered or retrieved at any time using javascript to access the respective htmlinputelement object's value property. the value attribute is always optional, though should be considered mandatory for checkbox, radio, and hidden. width valid for the image input button only, the width is the width of the image file to display to represent the graphical subm...
... which, if present, tells the user agent to process the input as a live search. as the user edits the value of the field, the user agent sends search events to the htmlinputelement object representing the search box. this allows your code to update the search results in real time as the user edits the search. if incremental is not specified, the search event is only sent when the user explicitly
initiates a search (such as by pressing the enter or return key while editing the field). the search event is rate-limited so that it is not sent more more frequently than an implementation-defined interval. mozactionhint a mozilla extension, supported by firefox for android, which provides a hint as to what sort of action will be taken if the user presses the enter or return key while editing th...
... recommendation acc...
...datetime-local|email|file|hidden|month|number|password|range|reset|search|submit|tel|url|week or text with list attribute: no role permitted dom interface htmlinputelement specifications specification status comment html living standardthe def
inition of '<input>' in that specification. living standard html media capturethe def
inition of 'capture attribute' in that specification. recommendation adds the capture attribute html5the def
inition of '<input>' in that specification. recommendation html 4.01 specificationthe def
inition of '<form>' in that specification. recommendation accessibility concerns labels when including inputs, it is an accessibilty requirement to add labels a...
Standard metadata names - HTML: Hypertext Markup Language
ht"> this works at the document level in the same way that the css color-scheme property lets individual elements specify their preferred and accepted color schemes. your styles can adapt to the current color scheme using the prefers-color-scheme css media feature. the css device adaptation specification defines the following metadata name: viewport: gives hints about the size of the
initial size of the viewport. used by mobile devices only. values for the content of <meta name="viewport"> value possible subvalues description width a positive integer number, or the text device-width defines the pixel width of the viewport that you want the web site to be rendered at. height a positive integer, or t...
...wport"> value possible subvalues description width a positive integer number, or the text device-width defines the pixel width of the viewport that you want the web site to be rendered at. height a positive integer, or the text device-height defines the height of the viewport. not used by any browser.
initial-scale a positive number between 0.0 and 10.0 defines the ratio between the device width (device-width in portrait mode or device-height in landscape mode) and the viewport size. maximum-scale a positive number between 0.0 and 10.0 defines the maximum amount to zoom in. it must be greater or equal to the minimum-scale or the behaviour is undefined. browser set...
...ehaviour is undefined. browser settings can ignore this rule and ios10+ ignores it by default. user-scalable yes or no if set to no, the user is not able to zoom in the webpage. the default is yes. browser settings can ignore this rule, and ios10+ ignores it by default. viewport-fit auto, contain or cover the auto value doesn’t affect the
initial layout viewport, and the whole web page is viewable. the contain value means that the viewport is scaled to fit the largest rectangle inscribed within the display. the cover value means that the viewport is scaled to fill the device display. it is highly recommended to make use of the safe area inset variables to ensure that important content doesn't end up outside the display. ...
... exclusive, like index and noindex, or follow and nofollow. in these cases the robot's behaviour is undefined and may vary between them. some crawler robots, like google, yahoo and bing, support the same values for the http header x-robots-tag; this allows non-html documents like images to use these rules. specifications specification html living standardthe def
inition of 'standard metadata names' in that specification. css color adjustment module level 1the def
inition of 'the "color-scheme" metadata name' in that specification. css device adaptationthe def
inition of 'the "viewport" metadata name' in that specification. referrer policythe def
inition of 'the "referrer" metadata name' in that specification. ...
<nav>: The Navigation Section element - HTML: Hypertext Markup Language
<footer> element often has a list of links that don't need to be in a <nav> element. a document may have several <nav> elements, for example, one for site navigation and one for intra-page navigation. aria-labelledby can be used in such case to promote accessibility, see example. user agents, such as screen readers targeting disabled users, can use this element to determine whether to omit the
initial rendering of navigation-only content. examples in this example, a <nav> block is used to contain an unordered list (<ul>) of links. with appropriate css, this can be presented as a sidebar, navigation bar, or drop-down menu. <nav class="menu"> <ul> <li><a href="#">home</a></li> <li><a href="#">about</a></li> <li><a href="#">contact</a></li> </ul> </nav> specifications ...
...ck is used to contain an unordered list (<ul>) of links. with appropriate css, this can be presented as a sidebar, navigation bar, or drop-down menu. ...
...ion bar, or drop-down menu. ...
...<a href="#">home</a></li> <li><a href="#">about</a></li> <li><a href="#">contact</a></li> </ul> </nav> specifications specification status comment html living standardthe def
inition of '<nav>' in that specification. living standard no change since latest w3c snapshot. html5the def
inition of '<nav>' in that specification. recommendation
initial def
inition ...
<select>: The HTML Select element - HTML: Hypertext Markup Language
or try rolling your own dropdown menu using non-semantic elements, javascript, and wai-aria to provide semantics. for more useful information on styling <select>, see: styling html forms advanced styling for html forms examples basic select the following example creates a very simple dropdown menu, the second option of which is selected by default. ...
... recommendation ...
... recommendation ...
...ttribute greater than 1, otherwise no role permitted dom interface htmlselectelement specifications specification status comments html living standardthe def
inition of '<select>' in that specification. living standard html5the def
inition of '<select>' in that specification. recommendation html 4.01 specificationthe def
inition of '<select>' in that specification. recommendation ...
spellcheck - HTML: Hypertext Markup Language
tor has a spellcheck state of true. this attribute is merely a hint for the browser: browsers are not required to check for spelling errors. ...
...errors. typically non-editable elements are not checked for spelling errors, even if the spellcheck attribute is set to true and the browser supports spellchecking. ...
...tribute is set to true and the browser supports spellchecking. specifications specification status comment html living standardthe def
inition of 'spellcheck' in that specification. ...
...set to true and the browser supports spellchecking. specifications specification status comment html living standardthe def
inition of 'spellcheck' in that specification. ...
translate - HTML: Hypertext Markup Language
web authors use this attribute to mark content that should not be translated. examples in this example, the translate attribute is used to ask translation tools not to translate the company's brand name in the footer. ...
...used to ask translation tools not to translate the company's brand name in the footer. ...
...mall>© 2020 <span translate="no">brandname</span></small> </footer> specifications specification status comment html living standardthe def
inition of 'translate' in that specification. ...
...0 <span translate="no">brandname</span></small> </footer> specifications specification status comment html living standardthe def
inition of 'translate' in that specification. ...
Link types - HTML: Hypertext Markup Language
n a hyperlink applying to a specific part of the document or to the document as a whole. only the data on the page can indicate this. note: although recognized, the synonym copyright is incorrect and must be avoided. <a>, <area>, <form>, <link> none. manifest indicates that the linked file is a web app manifest. <link> <a>, <area>, <form> modulepreload
initiates early (and high-priority) loading of module scripts. <link> <a>, <area>, <form> next indicates that the hyperlink leads to the next resource of the sequence the current page is in. note: other link types related to linking resources in the same sequence are first, prev, last. <a>, <area>, <form>, <link> none. nofollow indicates that the linked doc...
... up indicates that the page is part of a hierarchical structure and that the hyperlink leads to the higher level resource of that structure. the number of up link types indicates the depth difference between the current page and the linked resource. <a>, <area>, <link> <form> specifications specification status comment preloadthe def
inition of 'preload' in that specification. candidate recommendation added preload. resource hintsthe def
inition of 'preconnect' in that specification. working draft added dns-prefetch, preconnect, and prerender values. html living standardthe def
inition of 'link types' in that specification. living standard added opener and made noopener the default behavior for ta...
... candidate recommendation added preload. resource hintsthe def
inition of 'preconnect' in that specification. working draft added dns-prefetch, preconnect, and prerender values. html living standardthe def
inition of 'link types' in that specification. living standard added opener and made noopener the default behavior for target="_blank" links. html5the def
inition 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 def
inition of 'link types' in that specification. recommendation added alternate, stylesheet, start, chapter, section, subsection...
...ollow, icon, and author. renamed copyright to license. removed start, chapter, section, subsection, and appendix html 4.01 specificationthe def
inition 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 def
inition of '<link>' in that specification. obsolete added top, contents, index, glossary, copyright, next, previous, help, and search. rfc 1866: html 2.0 obsolete
initial def
inition. ...
CSP: default-src - HTTP
subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and def
initely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url scheme and port number. you must include the single quotes. some browse...
... ...
... ...
...'; worker-src 'self' specifications specification status comment content security policy level 3the def
inition of 'default-src' in that specification. working draft added frame-src, manifest-src and worker-src as defaults. content security policy level 2the def
inition of 'default-src' in that specification. recommendation
initial def
inition. ...
CSP: navigate-to - HTTP
note: if the form-action directive is present, the navigate-to directive will not act on navigations that are form submissions. csp version 3 directive type navigation directive default-src fallback no. not setting this allows anything. ...
... note: if the form-action directive is present, the navigate-to directive will not act on navigations that are form submissions. csp version 3 directive type navigation directive default-src fallback no. not setting this allows anything. ...
... subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and def
initely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url scheme and port number. you must include the single quotes. some browse...
...t will result in a csp violation. <meta http-equiv="content-security-policy" content="navigate-to 'none'"> <form action="javascript:alert('foo')" id="form1" method="post"> <input type="text" name="fieldname" value="fieldvalue"> <input type="submit" id="submit" value="submit"> </form> specifications specification status comment content security policy level 3the def
inition of 'navigate-to' in that specification. working draft
initial def
inition. ...
CSP: prefetch-src - HTTP
subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and def
initely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url scheme and port number. you must include the single quotes. some browse...
... ...
... ...
... ...
CSP: worker-src - HTTP
tempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and def
initely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url scheme and port number. you must include the single quotes. some browse...
... ...
... ...
... ...
Protocol upgrade mechanism - HTTP
r cannot) upgrade the connection, it ignores the upgrade header and sends back a regular response (for example, a 200 ok). right after sending the 101 status code, the server can begin speaking the new protocol, performing any additional protocol-specific handshakes as necessary. effectively, the connection becomes a two-way pipe as soon as the upgraded response is complete, and the request that
initiated the upgrade can be completed over the new protocol. common uses for this mechanism here we look at the most common use cases for the upgrade header. upgrading to a websocket connection by far, the most common use case for upgrading an http connection is to use websockets, which are always implemented by upgrading an http or https connection. keep in mind that if you're opening a new conn...
...ted by upgrading an http or https connection. keep in mind that if you're opening a new connection using the websocket api, or any library that does websockets, most or all of this is done for you. ...
...erver.ext", "optionalprotocol"); the websocket() constructor does all the work of creating an
initial http/1.1 connection then handling the handshaking and upgrade process for you. you can also use the "wss://" url scheme to open a secure websocket connection. if you need to create a websocket connection from scratch, you'll have to handle the handshaking process yourself. after creating the
initial http/1.1 session, you need to request the upgrade by adding to a standard request the upgrade and connection headers, as follows: connection: upgrade upgrade: websocket websocket-specific headers the following headers are involved in the websocket upgrade process. other than the upgrade and connection headers, the rest are generally optional or handled for you by the browser and server when...
...ion header is included in the response. sec-websocket-version: supportedversions supportedversions a comma-delineated list of the websocket protocol versions supported by the server. response-only headers the response from the server may include these. sec-websocket-accept included in the response message from the server during the opening handshake process when the server is willing to
initiate a websocket connection. it will appear no more than once in the response headers. sec-websocket-accept: hash hash if a sec-websocket-key header was provided, the value of this header is computed by taking the value of the key, concatenating the string "258eafa5-e914-47da-95ca-c5ab0dc85b11" to it, taking the sha-1 hash of that concatenated string, resulting in a 20-byte value. that value ...
JavaScript data types and data structures - JavaScript
een assigned a value has the value undefined. see undefined and undefined for more details. number type ecmascript has two built-in numeric types: number and bigint (see below). the number type is a double-precision 64-bit binary format ieee 754 value (numbers between -(253 − 1) and 253 − 1). in addition to representing floating-point numbers, the number type has three symbolic values: +inf
inity, -inf
inity, and nan ("not a number"). to check for the largest available value or smallest available value within ±inf
inity, you can use the constants number.max_value or number.min_value. starting with ecmascript 2015, you are also able to check if a number is in the double-precision floating-point number range using number.issafeinteger() as well as number.max_safe_integer and number.min_s...
...nge, integers in javascript are not safe anymore and will be a double-precision floating point approximation of the value. the number type has only one integer with two representations: 0 is represented as both -0 and +0. (0 is an alias for +0.) in the praxis, this has almost no impact. for example, +0 === -0 is true. however, you are able to notice this when you divide by zero: > 42 / +0 inf
inity > 42 / -0 -inf
inity although a number often represents only its value, javascript provides binary (bitwise) operators. caution: although bitwise operators can be used to represent several boolean values within a single number using bit masking, this is usually considered a bad practice. javascript offers other means to represent a set of booleans (like an array of booleans, or an object with...
...y (see below). in some programming languages, 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...
...andard library javascript has a standard library of built-in objects. please have a look at the reference to find out about more objects. determining types using the typeof operator the typeof operator can help you to find the type of your variable. please read the reference page for more details and edge cases. specifications specification ecmascript (ecma-262)the def
inition of 'ecmascript data types and values' in that specification. ...
Iterators and generators - JavaScript
script is the array iterator, which simply returns each value in the associated array in sequence. while it is easy to imagine that all iterators could be expressed as arrays, this is not true. arrays must be allocated in their entirety, but iterators are consumed only as necessary. ...
... size, such as the range of integers between 0 and inf
inity. here is an example which can do just that. it allows creation of a simple range iterator which defines a sequence of integers from start (inclusive) to end (exclusive) spaced step apart. its final return value is the size of the sequence it created, tracked by the variable iterationcount. ...
... iterators are a useful tool, their creation requires careful programming due to the need to explicitly maintain their internal state. generator functions provide a powerful alternative: they allow you to define an iterative algorithm by writing a single function whose execution is not continuous. generator functions are written using the function* syntax. when called, generator functions do not
initially execute their code. instead, they return a special type of iterator, called a generator. when a value is consumed by calling the generator's next method, the generator function executes until it encounters the yield keyword. the function can be called as many times as desired, and returns a new generator each time. each generator may only be iterated once. we can now adapt the example from...
... the next() method also accepts a value, which can be used to modify the internal state of the generator. a value passed to next() will be received by yield . note: a value passed to the first invocation of next() is always ignored. here is the fibonacci generator using next(x) to restart the sequence: function* fibonacci() { let current = 0; let next ...
Loops and iteration - JavaScript
ers. the statements for loops provided in javascript are: for statement do...while statement while statement labeled statement break statement continue statement for...in statement for...of statement for statement a for loop repeats until a specified condition evaluates to false. the javascript for loop is similar to the java and c for loop. a for statement looks as follows: for ([
initialexpression]; [conditionexpression]; [incrementexpression]) statement when a for loop executes, the following occurs: the
initializing expression
initialexpression, if any, is executed. 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 expressi...
...tatements, use a block statement ({ ... }) to group those statements. if present, the update expression incrementexpression 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 succeeding if statement, and increments 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="s...
... = 0; while (n < 3) { n++; x += n; } with each iteration, the loop increments n and adds that value to x. therefore, x and n take on the following values: after the first pass: n = 1 and x = 1 after the second pass: n = 2 and x = 3 after the third pass: n = 3 and x = 6 after completing the third pass, the condition n < 3 is no longer true, so the loop terminates. ...
... n = 2 and x = 3 after the third pass: n = 3 and x = 6 after completing the third pass, the condition n < 3 is no longer true, so the loop terminates. example 2 avoid inf
inite loops. make sure the condition in a loop eventually becomes false—otherwise, the loop will never terminate! the statements in the following while loop execute forever because the condition never becomes false: // inf
inite loops are bad! while (true) { console.log('hello, world!'); } labeled statement a label provides a statement with an identifier that lets you refer to it elsewhere in your program. for example, you can use a label to identify a loop, and then use the break or continue statements to indicate whether a program should interrupt the loop or continue its execution. the syntax of the labeled stat...
constructor - JavaScript
the constructor method is a special method of a class for creating and
initializing an object of that class. 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 constructor([arguments]) { ... } description a constructor enables you to provide any custom
initialization that must be done before any other methods can be called on an instantiated object. class person { constructor(name) { this.name = name; } introduce() { console.log(`hello, my name is ${this.name}`); } } const otto = new person('otto'); otto.introduce(); if you don't provide your own constructor, then a default constructor ...
... however, if you provide your own constructor, and your class derives from some parent class, then you must explicitly call the parent class constructor using super. for example: class validationerror extends error { constructor(message) { super(message); // call parent clas...
...f (error instanceof validationerror) { console.log(error.name); // this is error instead of validationerror! console.log(error.printcustomermessage()); } else { console.log('unknown error', error); throw error; } } the validationerror class doesn't need an explicit constructor, because it doesn't need to do any custom
initialization. the default constructor then takes care of
initializing the parent error from the argument it is given. however, if you provide your own constructor, and your class derives from some parent class, then you must explicitly call the parent class constructor using super. for example: class validationerror extends error { constructor(message) { super(message); // call parent class constructor this.name = 'validationerror'; this.c...
... ...
SyntaxError: missing = in const declaration - JavaScript
a constant is a value that cannot be altered by the program during normal execution. ...
... a constant is a value that cannot be altered by the program during normal execution. ...
...
initalized (edge) syntaxerror: missing = in const declaration (firefox) syntaxerror: missing
initializer in const declaration (chrome) error type syntaxerror what went wrong? a constant is a value that cannot be altered by the program during normal execution. it cannot change through re-assignment, and it can't be redeclared. in javascript, constants are declared using the const keyword. an
initializer for a constant is required; that is, you must specify its value in the same statement in which it's declared (which makes sense, given that it can't be changed later). examples missing const
initializer unlike var or let, you must specify a value for a const declaration. this throws: const columns; // syntaxerror: missing = in const declaration fixing the error there are multiple opt...
...ix this error. check what was intended to be achieved with the constant in question. adding a constant value specify the constant value in the same statement in which it's declared: const columns = 80; const, let or var? do not use const if you weren't meaning to declare a constant. maybe you meant to declare a block-scoped variable with let or global variable with var. both don't require an
initial value. let columns; ...
Array.prototype[@@iterator]() - JavaScript
by default, using arr[symbol.iterator] will return the values() function. ...
...by default, using arr[symbol.iterator] will return the values() function. ...
...by default, using arr[symbol.iterator] will return the values() function. ...
... ...
Array.prototype.flat() - JavaScript
osition syntax const flattened = arr => [].concat(...arr); reduce + concat + isarray + recursivity const arr = [1, 2, [3, 4, [5, 6]]]; // to enable deep level flatten use recursion with reduce and concat function flatdeep(arr, d = 1) { return d > 0 ? arr.reduce((acc, val) => acc.concat(array.isarray(val) ? ...
...for reference, please check: https://discourse.mozilla.org/t/mdn-rfc-001-mdn-wiki-pages-shouldnt-be-a-distributor-of-polyfills/24500 examples flattening nested arrays const arr1 = [1, 2, [3, 4]]; arr1.flat(); // [1, 2, 3, 4] const arr2 = [1, 2, [3, 4, [5, 6]]]; arr2.flat(); // [1, 2, 3, 4, [5, 6]] const arr3 = [1, 2, ...
... ...
... ...
Array.from() - JavaScript
1 : -1) * math.floor(math.abs(number)); }; var maxsafeinteger = math.pow(2, 53) - 1; var tolength = function (value) { var len = tointeger(value); return math.min(math.max(len, 0), maxsafeinteger); }; var setgetitemhandler = function setgetitemhandler(isiterator, items) { ...
...clojure, php etc) const range = (start, stop, step) => array.from({ length: (stop - start) / step + 1}, (_, i) => start + (i * step)); // generate number...
... ecmascript 2015 ...
... ecmascript 2015 ...
Boolean - JavaScript
the boolean object is an object wrapper for a boolean value. description the value passed as the first parameter is converted to a boolean value, if necessary. if the value is omitted or is 0, -0, null, false, nan, undefined, or the empty string (""), the object has an
initial value of false. all other values, including any object, an empty array ([]), or the string "false", create an object with an
initial value of true. do not confuse the primitive boolean values true and false with the true and false values of the boolean object. any object of which the value is not undefined or null, including a boolean object whose value is false, evaluates to true when passed to a conditional statement. for example, the condition in the following if statement evaluates to true: var x = new boolean(...
...} do not use a boolean object to convert a non-boolean value to a boolean value. to perform this task, instead, use boolean as a function, or a double not operator: var x = boolean(expression); // use this... var x = !!(expression); // ...or this var x = new boolean(expression); // don't use this! if you specify any object, including a boolean object whose value is false, as the
initial value of a boolean object, the new boolean object has a value of true. var myfalse = new boolean(false); //
initial value of false var g = boolean(myfalse); //
initial value of true var mystring = new string('hello'); // string object var s = boolean(mystring); //
initial value of true do not use a boolean object in place of a boolean primitive. note: when the non-standard pr...
... boolean() creates a new boolean object. instance methods boolean.prototype.tostring() returns a string of either true or false depending upon the value of the object. overrides the object.prototype.tostring() method. boolean.prototype.valueof() returns the primitive value of the boolean object. overrides the object.prototype.valueof() method. ...
...method. boolean.prototype.valueof() returns the primitive value of the boolean object. overrides the object.prototype.valueof() method. examples creating boolean objects with an
initial value of false var bnoparam = new boolean(); var bzero = new boolean(0); var bnull = new boolean(null); var bemptystring = new boolean(''); var bfalse = new boolean(false); creating boolean objects with an
initial value of true var btrue = new boolean(true); var btruestring = new boolean('true'); var bfalsestring = new boolean('false'); var bsulin = new boolean('su lin'); var barrayproto = new boolean([]); var bobjproto = new boolean({}); specifications specification ecmascript (ecma-262)the def
inition of 'boolean' in that specification. ...
Number.isInteger() - JavaScript
e examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax number.isinteger(value) parameters value the value to be tested for being an integer. return value a boolean indicating whether or not the given value is an integer. description if the target value is an integer, return true, otherwise return false. ...
...indicating whether or not the given value is an integer. description if the target value is an integer, return true, otherwise return false. if the value is nan or inf
inity, return false. the method will also return true for floating point numbers that can be represented as integer. ...
...= 'number' && isf
inite(value) && math.floor(value) === value; }; examples using isinteger number.isinteger(0); // true number.isinteger(1); // true number.isinteger(-100000); // true number.isinteger(99999999999999999999999); // true number.isinteger(0.1); // false number.isinteger(math.pi); // false number.isinteger(nan); // false number.isinteger(inf
inity); // false number.isinteger(-inf
inity); // false number.isinteger('10'); // false number.isinteger(true); // false number.isinteger(false); // false number.isinteger([1]); // false number.isinteger(5.0); // true number.isinteger(5.000000000000001); // false number.isinteger(5.0000000000000001); // true specifications specification ecmascript (ecm...
... ...
Number - JavaScript
is a double-precision 64-bit binary format ieee 754 value, like double in java or c#. this means it can represent fractional values, but there are some limits to what it can store. a number only keeps about 17 decimal places of precision; arithmetic is subject to rounding. the largest value a number can hold is about 1.8×10308. numbers beyond that are replaced with the special number constant inf
inity. a number literal like 37 in javascript code is a floating-point value, not an integer. there is no separate integer type in common everyday use. (javascript now has a bigint type, but it was not designed to replace number for everyday uses. 37 is still a number, not a bigint.) number may also be expressed in literal forms like 0b101, 0o13, 0x0a. learn more on numeric lexical grammar here. ...
...eger the maximum safe integer in javascript (253 - 1). number.max_value the largest positive representable number. number.min_safe_integer the minimum safe integer in javascript (-(253 - 1)). number.min_value the smallest positive representable number—that is, the positive number closest to zero (without actually being zero). number.nan special "not a number" value. number.negative_inf
inity special value representing negative inf
inity. returned on overflow. number.positive_inf
inity special value representing inf
inity. returned on overflow. number.prototype allows the addition of properties to the number object. static methods number.isnan() determine whether the passed value is nan. number.isf
inite() determine whether the passed value is a f
inite number. number.isinte...
...number.prototype.valueof() returns the primitive value of the specified object. overrides the object.prototype.valueof() method. examples using the number object to assign values to numeric variables the following example uses the number object's properties to assign values to several numeric variables: const biggestnum = number.max_value const smallestnum = number.min_value const inf
initenum = number.positive_inf
inity const neginf
initenum = number.negative_inf
inity const notanum = number.nan integer range for number the following example shows the minimum and maximum integer values that can be represented as number object. (more details on this are described in the ecmascript standard, chapter 6.1.6 the number type.) const biggestint = number.max_safe_integer // ...
...le.log(number(d)) this logs 819199440000. convert numeric strings and null to numbers number('123') // 123 number('123') === 123 /// true number('12.3') // 12.3 number('12.00') // 12 number('123e-1') // 12.3 number('') // 0 number(null) // 0 number('0x11') // 17 number('0b11') // 3 number('0o11') // 9 number('foo') // nan number('100a') // nan number('-inf
inity') //-inf
inity specifications specification ecmascript (ecma-262)the def
inition of 'number' in that specification. ...
Promise - JavaScript
when the promise is created. it allows you to associate handlers with an asynchronous action's eventual success value or failure reason. this lets asynchronous methods return values like synchronous methods: instead of immediately returning the final value, the asynchronous method returns a promise to supply the value at some point in the future. a promise is in one of these states: pending:
initial state, neither fulfilled nor rejected. fulfilled: meaning that the operation completed successfully. rejected: meaning that the operation failed. a pending promise can either be fulfilled with a value, or rejected with a reason (error). when either of these options happens, the associated handlers queued up by a promise's then method are called. if the promise has already been fulfilled or...
...doesn't have to be a string, but if it is only a succeed message, it probably will be. console.log("yay! " + successmessage) }); example with diverse situations this example shows diverse techniques for using promise capabilities, and diverse situations that can occur. to understand this, start by scrolling to the bottom of the code block, and examine the promise chain. ...
...ies, and diverse situations that can occur. to understand this, start by scrolling to the bottom of the code block, and examine the promise chain. upon provision of an
initial promise, a chain of promises can follow. the chain is composed of .then() calls, and typically (but not necessarily) has a single .catch() at the end, optionally followed by .finally(). in this example, the promise chain is
initiated by a custom written new promise() construct; but in actual practice, promise chains more typically start with an api function (written by someone else) that returns a promise. the example function tetheredgetnumber() shows that a promise generator will utilize reject() while setting up an asynchronous call, or within the call-back, or both. the function promisegetword() illustrates how an a...
...promises being fulfilled one after another. loading an image with xhr another simple example using promise and xmlhttprequest to load an image is available at the mdn github js-examples repository. you can also see it in action. each step is commented and allows you to follow the promise and xhr architecture closely. specifications specification ecmascript (ecma-262)the def
inition of 'promise' in that specification. ...
String.fromCodePoint() - JavaScript
l web browsers or environments yet. ...
...s or environments yet. ...
...code points 0x010000 – 0x10ffff) by specifying their code point. instead, it requires the utf-16 su...
... ...
WebAssembly.Memory() constructor - JavaScript
se buffer property is a resizable arraybuffer or sharedarraybuffer that holds the raw bytes of memory accessed by a webassembly instance. a memory created by javascript or in webassembly code will be accessible and mutable from both javascript and webassembly. syntax new webassembly.memory(memorydescriptor); parameters memorydescriptor an object that can contain the following members:
initial the
initial size of the webassembly memory, in units of webassembly pages. maximum optional the maximum size the webassembly memory is allowed to grow to, in units of webassembly pages. when present, the maximum parameter acts as a hint to the engine to reserve memory up front. however, the engine may ignore or clamp this reservation request. unshared webassembly memories don't need to s...
...a maximum, but shared memories do. shared optional a boolean value that defines whether the memory is a shared memory or not. if set to true, it is a shared memory. the default is false. note: a webassembly page has a constant size of 65,536 bytes, i.e., 64kib. exceptions if memorydescriptor is not of type object, a typeerror is thrown. if maximum is specified and is smaller than
initial, a rangeerror is thrown. examples creating a new memory instance there are two ways to get a webassembly.memory object. the first way is to construct it from javascript. the following example creates a new webassembly memory instance with an
initial size of 10 pages (640kib), and a maximum size of 100 pages (6.4mib). its buffer property will return an arraybuffer. var memory = new webasse...
...rror is thrown. examples creating a new memory instance there are two ways to get a webassembly.memory object. the first way is to construct it from javascript. the following example creates a new webassembly memory instance with an
initial size of 10 pages (640kib), and a maximum size of 100 pages (6.4mib). its buffer property will return an arraybuffer. var memory = new webassembly.memory({
initial:10, maximum:100}); the second way to get a webassembly.memory object is to have it exported by a webassembly module. the following example (see memory.html on github, and view it live also) fetches and instantiates the loaded memory.wasm byte code using the webassembly.instantiatestreaming() method, while importing the memory created in the line above. it then stores some values in that memor...
...tiatestreaming(fetch('memory.wasm'), { js: { mem: memory } }) .then(obj => { var i32 = new uint32array(memory.buffer); for (var i = 0; i < 10; i++) { i32[i] = i; } var sum = obj.instance.exports.accumulate(0, 10); console.log(sum); }); creating a shared memory by default, webassembly memories are unshared. you can create a shared memory by passing shared: true in the constructor's
initialization object: let memory = new webassembly.memory({
initial:10, maximum:100, shared:true}); this memory's buffer property will return a sharedarraybuffer. specifications specification webassembly javascript interfacethe def
inition of 'memory' in that specification. browser compatibility the compatibility table on this page is generated from structured data. i...
WebAssembly.Table() constructor - JavaScript
the webassembly.table() constructor creates a new table object of the given size and element type. syntax new webassembly.table(tabledescriptor); parameters tabledescriptor an object that can contain the following members: element a string representing the type of value to be stored in the table. at the moment this can only have a value of "anyfunc" (functions).
initial the
initial number of elements of the webassembly table. maximum optional the maximum number of elements the webassembly table is allowed to grow to. exceptions if tabledescriptor is not of type object, a typeerror is thrown. if maximum is specified and is smaller than
initial, a rangeerror is thrown. examples creating a new webassembly table instance the following example (see table2.html so...
...number of elements the webassembly table is allowed to grow to. exceptions if tabledescriptor is not of type object, a typeerror is thrown. if maximum is specified and is smaller than
initial, a rangeerror is thrown. examples creating a new webassembly table instance the following example (see table2.html source code and live version) creates a new webassembly table instance with an
initial size of 2 elements. we then print out the table length and contents of the two indexes (retrieved via table.prototype.get() to show that the length is two and both elements are null. ...
.... examples creating a new webassembly table instance the following example (see table2.html source code and live version) creates a new webassembly table instance with an
initial size of 2 elements. we then print out the table length and contents of the two indexes (retrieved via table.prototype.get() to show that the length is two and both elements are null. var tbl = new webassembly.table({
initial:2, element:"anyfunc"}); console.log(tbl.length); // "2" console.log(tbl.get(0)); // "null" console.log(tbl.get(1)); // "null" we then create an import object that contains the table: var importobj = { js: { tbl:tbl } }; finally, we load and instantiate a wasm module (table2.wasm) using the webassembly.instantiatestreaming() method. the table2.wasm module contains two functions (...
...on operator at the end of the accessor to actually invoke the referenced function and log the value stored inside it (e.g. get(0)() rather than get(0)) . this example shows that we're creating and accessing the table from javascript, but the same table is visible and callable inside the wasm instance too. specifications specification webassembly javascript interfacethe def
inition of 'table' in that 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for and...
this - JavaScript
ple { constructor() { const proto = object.getprototypeof(this); console.log(object.getownpropertynames(proto)); } first(){} second(){} static third(){} } new example(); // ['constructor', 'first', 'second'] note: static methods are not properties of this. they are properties of the class itself. derived classes unlike base class constructors, derived constructors have no
initial this binding. calling super() creates a this binding within the constructor and essentially has the effect of evaluating the following line of code, where base is the inherited class: this = new base(); warning: referring to this before calling super() will throw an error. derived classes must not return before calling super(), unless they return an object or have no constructor at all. ...
....log(fn2()() == window); // true in the above, the function (call it anonymous function a) assigned to 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 bound to the o object. var o = { prop: 37, f: function() { return this.prop; } }; console.log(o.f()); // 37 note that this behavior is not at all affected by how or where the function was defined. in the previous example, we defined the function inline as the f member during the def
inition of o. however, we could have just as easily defined the function first and later attached it to o.f. doing so results in the same behavior: var o = {prop: 37}; function independent() { return this.prop; } o.f = independent; console.log(o.f()); // 37 this demonstrates that it matters only that the function was invoked from the f member of o. similarly, the this binding is only affected...
... ...
const - JavaScript
n = valuen]]]; namen the constant's name, which can be any legal identifier. valuen the constant's value. this can be any legal expression, including a function expression. description this declaration creates a constant whose scope can be either global or local to the block in which it is declared. global constants do not become properties of the window object, unlike var variables. an
initializer for a constant is required. you must specify its value in the same statement in which it's declared. (this makes sense, given that it can't be changed later.) the const declaration creates a read-only reference to a value. it does not mean the value it holds is immutable—just that the variable identifier cannot be reassigned. for instance, in the case where the content is an object, thi...
... const my_object = {'key': 'value'}; // attempting to overwrite the object throws an error // uncaught typeerror: assignment to constant variable. my_object = {'other_key': 'value'}; // however, object keys are not protec...
... const my_object = {'key': 'value'}; // attempting to overwrite the object throws an error // uncaught typeerror: assignment to constant variable. my_object = {'other_key': 'value'}; // however, object keys are not protected, // so the following statement is executed without problem my...
... ...
<munderover> - MathML
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. ...
...e text color. you can use #rgb, #rrggbb and html color names. ...
...ser: ∫ 0 ∞ <math displaystyle="true"> <munderover > <mo> ∫ <!--integral--> </mo> <mn> 0 </mn> <mi> ∞ <!--inf
inity--> </mi> </munderover> </math> specifications specification status comment mathml 3.0the def
inition of 'munderover' in that specification. ...
...> <mo> ∫ <!--integral--> </mo> <mn> 0 </mn> <mi> ∞ <!--inf
inity--> </mi> </munderover> </math> specifications specification status comment mathml 3.0the def
inition of 'munderover' in that specification. ...
The "codecs" parameter in common media types - Web media technologies
apabilities. this is not as widely used as it was before cbp was introduced. all cbp streams are considered to also be bp streams. 42 00 extended profile (xp) designed for streaming video over the network, with high compression capability and further improvements to data robustness and stream switching. 58 00 main profile (mp) the profile used for standard-def
inition digital television being broadcast in mpeg-4 format. not used for high-def
inition television broadcasts. this profile's importance has faded since the introduction of the high profile—which was added for hdtv use—in 2004. 4d 00 high profile (hip) currently, hip is the primary profile used for broadcast and disc-based hd video; it's used both for hd tv broadcasts and for ...
...001-8:2016 standard. this component, and every component after it, is optional. the possible values of the color primaries component are: iso/iec color primary identifiers value details 00 reserved for future use by itu or iso/iec 01 bt.709, srgb, sycc. bt.709 is the standard for high def
inition (hd) television; srgb is the most common color space used for computer displays. broadcast bt.709 uses 8-bit color depth with the legal range being from 16 (black) to 235 (white). 02 image characteristics are unknown, or are to be determined by the application 03 reserved for future use by itu or iso/iec 04 bt.
... most common color space used for computer displays. broadcast bt.709 uses 8-bit color depth with the legal range being from 16 (black) to 235 (white). 02 image characteristics are unknown, or are to be determined by the application 03 reserved for future use by itu or iso/iec 04 bt.470 system m, ntsc (standard def
inition television in the united states) 05 bt.470 system b, g; bt.601; bt.1358 625; bt.1700 625 pal and 625 secam 06 bt.601 525; bt.1358 525 or 625; bt.1700 ntsc; smpte 170m. functionally identical to 7. 70 smpte 240m (historical). functionally identical to 6. 08 generic film ...
...05 bt.470 system b, g; bt.601; bt.1358 625; bt.1700 625 pal and 625 secam 06 bt.601 525; bt.1358 525 or 625; bt.1700 ntsc; smpte 170m. functionally identical to 7. 70 smpte 240m (historical). functionally identical to 6. 08 generic film 09 bt.2020; bt.2100. used for ultra-high def
inition (4k) high dynamic range (hdr) video, these have a very wide color gamut and support 10-bit and 12-bit color component depths. 10 smpte st 428 (d-cinema distribution master: image characteristics). defines the uncompressed image characteristics for dcdm. 11 smpte rp 431 (d-cinema quality: reference projector and environment). describes the...
Structural overview of progressive web apps - Progressive web apps (PWAs)
between pages requires downloading new html content. it works great across browsers, but it suffers in terms of time navigating between pages and therefore general perceived performance — loading a page requires a new round trip to the server. client-side rendering (csr) allows the website to be updated in the browser almost instantly when navigating to different pages, but requires more of an
initial download hit and extra rendering on the client at the beginning. the website is slower on an
initial visit, but can be faster to navigate. the best results tend to come when you use both client-side and server-side rendering; you can render a web site on the server, cache its contents, and then update the rendering on the client side as needed. the first page load is quick because of the ssr...
...ml lang="en"> <head> <meta charset="utf-8"> <title>js13kgames a-frame entries</title> <meta name="description" content="a list of a-frame entries submitted to the js13kgames 2017 competition, used as an example for the mdn articles about progressive web apps."> <meta name="author" content="end3r"> <meta name="theme-color" content="#b12a34"> <meta name="viewport" content="width=device-width,
initial-scale=1"> <meta property="og:image" content="icons/icon-512.png"> <link rel="shortcut icon" href="favicon.ico"> <link rel="stylesheet" href="style.css"> <link rel="manifest" href="js13kpwa.webmanifest"> <script src="data/games.js" defer></script> <script src="app.js" defer></script> </head> <body> <header> <p><a class="logo" href="http://js13kgames.com"><img src="img/js13kgames.png" alt...
...the <body> is split into the <header> (which displays an image) and the body of the app, which is found inside a <main> element. the app displays its title, a description, and then a place for the app content to be shown (a <section> element with the id content. below the content is a <footer>, which provides a copyright notice and assorted l...
...or this simple example is also as plain as possible: it uses @font-face to load and use a custom font, and it applies some simple styling of the html elements. the overall approach is to have the design look good on both mobile (with a responsive web design approach) and desktop devices. app.js: the main app javascript the file app.js is run when the app is first loaded; its job is primarily to
initialize the app, though it c can do other things as well. we'll look at how the app functions more closely in later articles in this guide. the first thing it does is to generate the app's displayed content using the following template: var template = "<article>\n\ <img src='data/img/slug.jpg' alt='name'>\n\ <h3>#pos. name</h3>\n\ <ul>\n\ <li><span>author:</span> <strong>author</s...
accumulate - SVG: Scalable Vector Graphics
ration. none specifies that repeat iterations are not cumulative. this attribute is ignored if the target attribute value does not support addition, or if the animation element does not repeat. ...
...dition, or if the animation element does not repeat. this attribute will be ignored if the animation function is specified with only the to attribute. ...
... will be ignored if the animation function is specified with only the to attribute. specifications specification status comment svg animations level 2the def
inition of 'accumulate' in that specification. ...
...nored if the animation function is specified with only the to attribute. specifications specification status comment svg animations level 2the def
inition of 'accumulate' in that specification. ...
additive - SVG: Scalable Vector Graphics
the animation will override the underlying value of the attribute and other lower priority animations. ...
...r is also affected by the animation value attributes by and to, as described in smil animation: how from, to and by attributes affect additive behavior. ...
... described in smil animation: how from, to and by attributes affect additive behavior. specifications specification status comment svg animations level 2the def
inition of 'additive' in that specification. ...
...in smil animation: how from, to and by attributes affect additive behavior. specifications specification status comment svg animations level 2the def
inition of 'additive' in that specification. ...
alignment-baseline - SVG: Scalable Vector Graphics
he parent text content element. mathematical matches the box’s mathematical baseline to that of its parent. top aligns the top of the aligned subtree with the top of the line box. center aligns the center of the aligned subtree with the center of the line box. bottom aligns the bottom of the aligned subtree with the bottom of the line box. svg 2 introduces some changes to the def
inition of this property. in particular: the values auto, before-edge, and after-edge have been removed. for backwards compatibility, text-before-edge may be mapped to text-top and text-after-edge to text-bottom. neither text-before-edge nor text-after-edge should be used with the vertical-align property. example <svg width="300" height="120" viewbox="0 0 300 120" xmlns="http://www.w3.org/2000/...
...3" fill="red" /> <circle cx="60" cy="65" r="3" fill="red" /> <circle cx="60" cy="110" r="3" fill="red" /> <style><![cdata[ text{ font: bold 36px verdana, helvetica, arial, sans-serif; } ]]></style> </svg> for object alignment in other elements (such as <text>), see dominant-baseline. ...
...ext{ font: bold 36px verdana, helvetica, arial, sans-serif; } ]]></style> </svg> for object alignment in other elements (such as <text>), see dominant-baseline. specifications specification status comment css inline layoutthe def
inition of 'alignment-baseline' in that specification. working draft no change scalable vector graphics (svg) 2the def
inition of 'alignment-baseline' in that specification. ...
...gnment in other elements (such as <text>), see dominant-baseline. specifications specification status comment css inline layoutthe def
inition of 'alignment-baseline' in that specification. working draft no change scalable vector graphics (svg) 2the def
inition of 'alignment-baseline' in that specification. candidate recommendation refers to the def
inition in css inline layout and notes the changes to auto, before-edge, after-edge, text-before-edge, and text-after-edge scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'alignment-baseline' in that specification. recommendation
initial def
inition browser compatibility the compatibility table on this page is generated from structured data. if you'd like to ...
arabic-form - SVG: Scalable Vector Graphics
the arabic-form attribute indicates which of the four possible forms an arabic glyph represents. only one element is using this attribute: <glyph> context notes value
initial | medial | terminal | isolated default value isolated animatable no
initial this value indicates that the glyph represents the
initial form. medial this value indicates that the glyph represents the medial form. terminal this value indicates that the glyph represents the terminal form. isolated this value indicates that the glyph represents the isolated form. ...
... the glyph represents the
initial form. medial this value indicates that the glyph represents the medial form. terminal this value indicates that the glyph represents the terminal form. isolated this value indicates that the glyph represents the isolated form. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'arabic-form' in that specification. ...
... that the glyph represents the medial form. ...
...lyph represents the medial form. ...
attributeName - SVG: Scalable Vector Graphics
at is going to be changed during an animation. four elements are using this attribute: <animate>, <animatecolor>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 250 250" xmlns="http://www.w3.org/2000/svg"> <rect x="50" y="50" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="5s" repeatcount="indef
inite"/> </rect> </svg> usage notes value <name> default value none animatable no <name> this value indicates the name of the css property or attribute of the target element to be animated. specifications specification status comment svg animations level 2the def
inition of 'attributename' in that specification. edit...
...one animatable no <name> this value indicates the name of the css property or attribute of the target element to be animated. ...
... name of the css property or attribute of the target element to be animated. specifications specification status comment svg animations level 2the def
inition of 'attributename' in that specification. ...
...e css property or attribute of the target element to be animated. specifications specification status comment svg animations level 2the def
inition of 'attributename' in that specification. ...
bias - SVG: Scalable Vector Graphics
this allows representation of values that would otherwise be clamped to 0 or 1. ...
...value 0 animatable yes one application of bias is when it is desirable to have 0.5 gray value be the zero response of the filter. ...
...f bias is when it is desirable to have 0.5 gray value be the zero response of the filter. ...
...hen it is desirable to have 0.5 gray value be the zero response of the filter. ...
by - SVG: Scalable Vector Graphics
usage notes value see below default value none animatable no the exact value type for this attribute depends on the value of the attribute that will be animated. ...
...attribute depends on the value of the attribute that will be animated. when a list of values is defined via the values attribute, the by attribute is ignored. ...
... animated. when a list of values is defined via the values attribute, the by attribute is ignored. ...
... when a list of values is defined via the values attribute, the by attribute is ignored. ...
calcMode - SVG: Scalable Vector Graphics
he default value. spline interpolates from one value in the values list to the next according to a time function defined by a cubic bézier spline. ...
...pline. the points of the spline are defined in the keytimes attribute, and the control points for each interval are defined in the keysplines attribute. ...
...ute, and the control points for each interval are defined in the keysplines attribute. specifications specification status comment svg animations level 2the def
inition of 'calcmode' in that specification. ...
...e control points for each interval are defined in the keysplines attribute. specifications specification status comment svg animations level 2the def
inition of 'calcmode' in that specification. ...
clip - SVG: Scalable Vector Graphics
t() defines a clipping rectangle following the following syntax: rect(<top>, <right>, <bottom>, <left>). ...
... while <right> and <left> specify offsets from the left border edge of the element viewport. specifications specification status comment css masking module level 1the def
inition of 'clip' in that specification. ...
... edge of the element viewport. specifications specification status comment css masking module level 1the def
inition of 'clip' in that specification. candidate recommendation deprecates clip property, suggests clip-path as replacement. ...
...e element viewport. specifications specification status comment css masking module level 1the def
inition of 'clip' in that specification. candidate recommendation deprecates clip property, suggests clip-path as replacement. ...
clipPathUnits - SVG: Scalable Vector Graphics
> element are relative to the bounding box of the element the clipping path is applied to. ...
...p left corner of the object bounding box and the width and height of the object bounding box are considered to have a length of 1 unit value. ...
...e object bounding box are considered to have a length of 1 unit value. specifications specification status comment css masking module level 1the def
inition of 'clippathunits' in that specification. ...
...unding box are considered to have a length of 1 unit value. specifications specification status comment css masking module level 1the def
inition of 'clippathunits' in that specification. ...
cx - SVG: Scalable Vector Graphics
ient> </defs> <rect x="1" y="1" width="8" height="8" fill="url(#mygradient000)" stroke="black" /> <rect x="13" y="1" width="8" height="8" fill="url(#mygradient050)" stroke="black" /> <rect x="25" y="1" width="8" height="8" fill="url(#mygradient100)" stroke="black" /> </svg> specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'cx' in that specification. candidate recommendation def
inition as a geometry property scalable vector graphics (svg) 2the def
inition of 'cx' in that specification. candidate recommendation def
inition for svg2 paint servers. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'cx' in that specification. recommendation
initial def
inition f...
...try property scalable vector graphics (svg) 2the def
inition of 'cx' in that specification. candidate recommendation def
inition for svg2 paint servers. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'cx' in that specification. recommendation
initial def
inition for <radialgradient> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'cx' in that specification. recommendation
initial def
inition for <ellipse> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'cx' in that specification. ...
...ition)the def
inition of 'cx' in that specification. recommendation
initial def
inition for <radialgradient> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'cx' in that specification. recommendation
initial def
inition for <ellipse> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'cx' in that specification. ...
...ef
inition of 'cx' in that specification. recommendation
initial def
inition for <radialgradient> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'cx' in that specification. recommendation
initial def
inition for <ellipse> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'cx' in that specification. ...
cy - SVG: Scalable Vector Graphics
ient> </defs> <rect x="1" y="1" width="8" height="8" fill="url(#mygradient000)" stroke="black" /> <rect x="13" y="1" width="8" height="8" fill="url(#mygradient050)" stroke="black" /> <rect x="25" y="1" width="8" height="8" fill="url(#mygradient100)" stroke="black" /> </svg> specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'cy' in that specification. candidate recommendation def
inition as a geometry property scalable vector graphics (svg) 2the def
inition of 'cy' in that specification. candidate recommendation def
inition for svg2 paint servers. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'cy' in that specification. recommendation
initial def
inition f...
...try property scalable vector graphics (svg) 2the def
inition of 'cy' in that specification. candidate recommendation def
inition for svg2 paint servers. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'cy' in that specification. recommendation
initial def
inition for <radialgradient> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'cy' in that specification. recommendation
initial def
inition for <ellipse> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'cy' in that specification. ...
...ition)the def
inition of 'cy' in that specification. recommendation
initial def
inition for <radialgradient> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'cy' in that specification. recommendation
initial def
inition for <ellipse> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'cy' in that specification. ...
...ef
inition of 'cy' in that specification. recommendation
initial def
inition for <radialgradient> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'cy' in that specification. recommendation
initial def
inition for <ellipse> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'cy' in that specification. ...
display - SVG: Scalable Vector Graphics
ruby-text | ruby-base-container | ruby-text-container<display-box> = contents | none<display-legacy> = inline-block | inline-list-item | inline-table | inline-flex | inline-grid animatable yes for a description of the values, please refer to the css display property. ...
...please refer to the css display property. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'display' in that specification. candidate recommendation refers to the css 2 specification of the display property, but outlines the differences regarding svg. ...
... specification status comment scalable vector graphics (svg) 2the def
inition of 'display' in that specification. candidate recommendation refers to the css 2 specification of the display property, but outlines the differences regarding svg. ...
...ation status comment scalable vector graphics (svg) 2the def
inition of 'display' in that specification. candidate recommendation refers to the css 2 specification of the display property, but outlines the differences regarding svg. ...
divisor - SVG: Scalable Vector Graphics
px);"/> </svg> usage notes value <number> default value sum of all values in kernelmatrix or 1 if sum is 0 animatable yes <number> this value defines the divisor. ...
... animatable yes <number> this value defines the divisor. if the specified divisor is 0 then the default value will be used instead. ...
...ivisor. if the specified divisor is 0 then the default value will be used instead. ...
...the specified divisor is 0 then the default value will be used instead. specifications specification status comment filter effects module level 1the def
inition of 'divisor' in that specification. ...
dominant-baseline - SVG: Scalable Vector Graphics
ent in the box’s alignment context. it is used to determine or re-determine a scaled-baseline-table. a scaled-baseline-table is a compound value with three components: a baseline-identifier for the dominant-baseline, a baseline-table, and a baseline-table font-size. some values of the property re-determine all three values. others only re-establish the baseline-table font-size. when the
initial value, auto, would give an undesired result, this property can be used to explicitly set the desired scaled-baseline-table. if there is no baseline table in the nominal font, or if the baseline table lacks an entry for the desired baseline, then the browser may use heuristics to determine the position of the desired baseline. note: as a presentation attribute, dominant-baseline can be used a...
... working draft removed the values use-script, no-change, and reset-size and introduced the te...
... } ]]></style> </svg> result specifications specification status comment scalable vector graphics (svg) 2the def
inition 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 def
inition of 'dominant-baseline' in that specification. working draft removed the values use-script, no-change, and reset-size and introduced the text-top value. ...
...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 def
inition 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 def
inition of 'dominant-baseline' in that specification. recommendation
initial def
inition 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrom...
font-size-adjust - SVG: Scalable Vector Graphics
ed should generally be the aspect ratio (ratio of x-height to font size) of the first choice font-family. this means that the first-choice font, when available, will appear the same size in browsers, whether or not they support font-size-adjust. ...
...will appear the same size in browsers, whether or not they support font-size-adjust. 0 yields text of zero height (hidden text). ...
...ze-adjust. 0 yields text of zero height (hidden text). specifications specification status comment css fonts module level 3the def
inition of 'font-size-adjust' in that specification. ...
... 0 yields text of zero height (hidden text). specifications specification status comment css fonts module level 3the def
inition of 'font-size-adjust' in that specification. ...
id - SVG: Scalable Vector Graphics
ust be valid in xml documents. ...
...tion marks), and do not start with a digit, a full stop (.) character, or a hyphen-minus (-) character. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'id' in that specification. ...
...character, or a hyphen-minus (-) character. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'id' in that specification. ...
...or a hyphen-minus (-) character. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'id' in that specification. candidate recommendation defines the allowed values in more detail. ...
kernelMatrix - SVG: Scalable Vector Graphics
onvolution. values are separated by space characters and/or a comma. the number of entries in the list must equal <orderx> times <ordery>. ...
...e result of orderx * ordery is not equal to the the number of entries in the value list, the filter primitive acts as a pass through filter. ...
...in the value list, the filter primitive acts as a pass through filter. specifications specification status comment filter effects module level 1the def
inition of 'kernelmatrix' in that specification. ...
...e list, the filter primitive acts as a pass through filter. specifications specification status comment filter effects module level 1the def
inition of 'kernelmatrix' in that specification. ...
marker-end - SVG: Scalable Vector Graphics
e none animatable yes none indicates that no marker symbol shall be drawn at the final vertex. <marker-ref> this value is a reference to a <marker> element, which will be drawn at the final vertex. ...
...marker> element, which will be drawn at the final vertex. if the reference is not valid, then no marker will be drawn. ...
...erence is not valid, then no marker will be drawn. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'marker-end' in that specification. ...
...ot valid, then no marker will be drawn. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'marker-end' in that specification. ...
marker-mid - SVG: Scalable Vector Graphics
none animatable yes none indicates that no marker symbol shall be drawn at the given vertices. <marker-ref> this value is a reference to a <marker> element, which will be drawn at the given vertices. ...
...rker> element, which will be drawn at the given vertices. if the reference is not valid, then no marker will be drawn. ...
...erence is not valid, then no marker will be drawn. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'marker-mid' in that specification. ...
...ot valid, then no marker will be drawn. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'marker-mid' in that specification. ...
marker-start - SVG: Scalable Vector Graphics
e none animatable yes none indicates that no marker symbol shall be drawn at the first vertex. <marker-ref> this value is a reference to a <marker> element, which will be drawn at the first vertex. ...
...rker> element, which will be drawn at the first vertex. if the reference is not valid, then no marker will be drawn. ...
...ce is not valid, then no marker will be drawn. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'marker-start' in that specification. ...
...alid, then no marker will be drawn. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'marker-start' in that specification. ...
markerHeight - SVG: Scalable Vector Graphics
ative values refer to the height specified via the viewbox and preserveaspectratio attributes. <number> this value defines the height of the marker in the units defined by the markerunits attribute. ...
...nits attribute. a value of zero disables rendering of the element and negative values are an error. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'markerheight' in that specification. ...
...d negative values are an error. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'markerheight' in that specification. candidate recommendation allowed percentage and number values. ...
...values are an error. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'markerheight' in that specification. candidate recommendation allowed percentage and number values. ...
markerWidth - SVG: Scalable Vector Graphics
elative values refer to the width specified via the viewbox and preserveaspectratio attributes. <number> this value defines the width of the marker in the units defined by the markerunits attribute. ...
...units attribute. a value of zero disables rendering of the element and negative values are an error. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'markerwidth' in that specification. ...
...and negative values are an error. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'markerwidth' in that specification. candidate recommendation allowed percentage and number values. ...
...e values are an error. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'markerwidth' in that specification. candidate recommendation allowed percentage and number values. ...
maskContentUnits - SVG: Scalable Vector Graphics
he mask was created. objectboundingbox this value indicates that all coordinates inside the <mask> element are relative to the bounding box of the element the mask is applied to. ...
...ent the mask is applied to. a bounding box could be considered the same as if the content of the <mask> were bound to a "0 0 1 1" viewbox. ...
... if the content of the <mask> were bound to a "0 0 1 1" viewbox. specifications specification status comment css masking module level 1the def
inition of 'maskcontentunits' in that specification. ...
...tent of the <mask> were bound to a "0 0 1 1" viewbox. specifications specification status comment css masking module level 1the def
inition of 'maskcontentunits' in that specification. ...
maskUnits - SVG: Scalable Vector Graphics
undingbox this value indicates that all coordinates for the geometry attributes represent fractions or percentages of the bounding box of the element to which the mask is applied. ...
...ment to which the mask is applied. a bounding box could be considered the same as if the content of the <mask> were bound to a "0 0 1 1" viewbox. ...
...ed the same as if the content of the <mask> were bound to a "0 0 1 1" viewbox. specifications specification status comment css masking module level 1the def
inition of 'maskunits' in that specification. ...
... as if the content of the <mask> were bound to a "0 0 1 1" viewbox. specifications specification status comment css masking module level 1the def
inition of 'maskunits' in that specification. ...
method - SVG: Scalable Vector Graphics
ot align properly when text is rendered along the path. stretch this value indicates that the character outlines will be converted into paths, and then stretched and possibly warped. ...
...with this approach, connected characters, such as in cursive fonts, will maintain their connections. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'method' in that specification. ...
...ts, will maintain their connections. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'method' in that specification. candidate recommendation described the stretch value in more detail. ...
...intain their connections. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'method' in that specification. candidate recommendation described the stretch value in more detail. ...
opacity - SVG: Scalable Vector Graphics
default value 1 value <alpha-value> animatable yes <alpha-value> the uniform opacity setting to be applied across an entire object, as a <number>. any values outside the range 0.0 (fully transparent) to 1.0 (fully opaque) will be clamped to this range. specifications specification status comment css color module level 4the def
inition of 'opacity' in that specification. working draft defines in more detail what this attribute applies to. css color module level 3the def
inition of 'opacity' in that specification. recommendation defines in more detail what this attribute applies to. scalable vector graphics (svg) 2the def
inition of 'opacity' in that specification. candidate recommendation re...
...ion of 'opacity' in that specification. recommendation defines in more detail what this attribute applies to. scalable vector graphics (svg) 2the def
inition of 'opacity' in that specification. ...
...nes in more detail what this attribute applies to. scalable vector graphics (svg) 2the def
inition of 'opacity' in that specification. candidate recommendation references the specification in css color 3 and notes that there are some related attributes. ...
... detail what this attribute applies to. scalable vector graphics (svg) 2the def
inition of 'opacity' in that specification. candidate recommendation references the specification in css color 3 and notes that there are some related attributes. ...
order - SVG: Scalable Vector Graphics
er of rows in the matrix. if no second number is not provided, it defaults to the first number. ...
...(e.g., 3) be used; higher values may result in very high cpu overhead and usually do not produce results that justify the impact on performance. ...
...erhead and usually do not produce results that justify the impact on performance. ...
...usually do not produce results that justify the impact on performance. specifications specification status comment filter effects module level 1the def
inition of 'order' in that specification. ...
orient - SVG: Scalable Vector Graphics
arker's positive x-axis would be pointing down and right in the shape's coordinate system. <number> this value indicates an angle in degrees. the marker is oriented such that the specified angle is that measured between the shape's positive x-axis and the marker's positive x-axis. ...
... the shape's positive x-axis and the marker's positive x-axis. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'orient' in that specification. ...
... specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'orient' in that specification. candidate recommendation added the auto-start-reverse value and simplified the descriptions of the values. ...
...ions specification status comment scalable vector graphics (svg) 2the def
inition of 'orient' in that specification. candidate recommendation added the auto-start-reverse value and simplified the descriptions of the values. ...
overflow - SVG: Scalable Vector Graphics
a clip of the exact size of the svg viewport is applied. when scroll is specified on an <svg> element, a scrollbar or panner is normally shown for the svg viewport whether or not any of its content is clipped. within svg content, the value auto implies that all rendered content for child elements must be visible, either through a scrolling mechanism, or by rendering with no clip. although the
initial value for overflow is auto, it is overwritten in the user agent style sheet for the <svg> element when it is not the root element of a stand-alone document, the <pattern> element, and the <marker> element to be hidden by default. note: as a presentation attribute, overflow can be used as a css property. see the css opacity property for more information. as a presentation attribute, it can be...
...0">this text is wider than the svg, so there should be a scrollbar shown.</text> </svg> usage notes value visible | hidden | scroll | auto default value visible animatable yes for a description of the values, please see the css overflow property. specifications specification status comment css level 2 (revision 1)the def
inition of 'overflow' in that specification. recommendation def
inition in css scalable vector graphics (svg) 2the def
inition of 'overflow' in that specification. candidate recommendation simplifies the def
inition and outlines the values within the user agent stylesheet. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'overflow' in that specification. ...
...that specification. recommendation def
inition in css scalable vector graphics (svg) 2the def
inition of 'overflow' in that specification. candidate recommendation simplifies the def
inition and outlines the values within the user agent stylesheet. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'overflow' in that specification. ...
...ication. recommendation def
inition in css scalable vector graphics (svg) 2the def
inition of 'overflow' in that specification. candidate recommendation simplifies the def
inition and outlines the values within the user agent stylesheet. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'overflow' in that specification. ...
panose-1 - SVG: Scalable Vector Graphics
s, and mapper software that determines the closest possible font match given a set of typefaces. ...
...nimatable no <integer>{10} this value specifies a panose-1 number and consists of ten decimal integers, separated by whitespace. the
initial value zero for each panose digit means "any", i.e. all fonts will match the panose number if this value is used. ...
...ose-1 number and consists of ten decimal integers, separated by whitespace. the
initial value zero for each panose digit means "any", i.e. all fonts will match the panose number if this value is used. ...
...r and consists of ten decimal integers, separated by whitespace. the
initial value zero for each panose digit means "any", i.e. all fonts will match the panose number if this value is used. ...
pathLength - SVG: Scalable Vector Graphics
ts. value <number> default value none animatable yes rect for <rect>, pathlength lets authors specify a total length for the rectangle, in user units. ...
...a total length for the rectangle, in user units. ...
...<number> default value none animatable yes specification specification status comment scalable vector graphics (svg) 2the def
inition of 'pathlength' in that specification. ...
... default value none animatable yes specification specification status comment scalable vector graphics (svg) 2the def
inition of 'pathlength' in that specification. ...
patternContentUnits - SVG: Scalable Vector Graphics
that all coordinates inside the <pattern> element are relative to the bounding box of the element the pattern is applied to. ...
...red the same as if the content of the <pattern> were bound to a "0 0 1 1" viewbox for a pattern tile of width and height of 100%. ...
...wbox for a pattern tile of width and height of 100%. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'patterncontentunits' in that specification. ...
...pattern tile of width and height of 100%. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'patterncontentunits' in that specification. ...
patternTransform - SVG: Scalable Vector Graphics
the patterntransform attribute defines a list of transform def
initions that are applied to a pattern tile. only one element is using this attribute: <pattern> html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- apply a transform on the tile --> <pattern id="p1" width=".25" height=".25" patterntransform="rotate(20) skewx(30) scale(1 0.5)"> <circle cx="10" cy="10" r="10" /> </pattern> <!-- apply the transformed pattern tile --> <rect x="10" y="10" width="80" height="80" fill="url(#p1)" /> </svg> pattern for <pattern>, patterntransform defines a list of transform def
initions that are applied to a pattern tile. note: as of svg2, it is also allowe...
...note: as of svg2, it is also allowed to use the css transform property. however, the current state of implementation isn't very good. for backward compatibility reason, it is highly suggested to keep using the patterntransform attribute. value <transform-list> default value identity transform animatable yes transform functions to know more about the def
inition of transform functions, see the transform attribute def
inition. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'patterntransform' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'patterntransform' in that specification. recommenda...
...ransform functions, see the transform attribute def
inition. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'patterntransform' in that specification. ...
...nctions, see the transform attribute def
inition. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'patterntransform' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'patterntransform' in that specification. ...
patternUnits - SVG: Scalable Vector Graphics
box this value indicates that all coordinates for the geometry properties represent fractions or percentages of the bounding box of the element to which the mask is applied. ...
...which the mask is applied. a bounding box could be considered the same as if the content of the <mask> were bound to a "0 0 1 1" viewbox. ...
... as if the content of the <mask> were bound to a "0 0 1 1" viewbox. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'patternunits' in that specification. ...
...content of the <mask> were bound to a "0 0 1 1" viewbox. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'patternunits' in that specification. ...
pointer-events - SVG: Scalable Vector Graphics
? opera android ? safari ios ? samsung internet android ? ...
... ? ...
... unknown compatibility unknown specification specification status comment scalable vector graphics (svg) 2the def
inition of 'pointer-events' in that specification. ...
... compatibility unknown specification specification status comment scalable vector graphics (svg) 2the def
inition of 'pointer-events' in that specification. ...
points - SVG: Scalable Vector Graphics
t value none animatable yes example html,body,svg { height:100% } <svg viewbox="-10 -10 120 120" xmlns="http://www.w3.org/2000/svg"> <!-- polygon is an closed shape --> <polygon stroke="black" fill="none" points="50,0 21,90 98,35 2,35 79,90" /> </svg> specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'points' in that specification. candidate recommendation def
inition for <polygon> scalable vector graphics (svg) 2the def
inition of 'points' in that specification. candidate recommendation def
inition for <polyline> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'points' in that specification. recommendation
initial def
inition for <po...
...nition for <polygon> scalable vector graphics (svg) 2the def
inition of 'points' in that specification. candidate recommendation def
inition for <polyline> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'points' in that specification. recommendation
initial def
inition for <polygon> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'points' in that specification. ...
...e def
inition of 'points' in that specification. candidate recommendation def
inition for <polyline> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'points' in that specification. recommendation
initial def
inition for <polygon> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'points' in that specification. ...
...n of 'points' in that specification. candidate recommendation def
inition for <polyline> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'points' in that specification. recommendation
initial def
inition for <polygon> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'points' in that specification. ...
preserveAlpha - SVG: Scalable Vector Graphics
value indicates that the convolution will only apply to the color channels. in this case, the filter will temporarily unpremultiply the color component values and apply the kernel. ...
...onent values and apply the kernel. false this value indicates that the convolution will apply to all channels, including the alpha channel. ...
...e convolution will apply to all channels, including the alpha channel. specifications specification status comment filter effects module level 1the def
inition of 'preservealpha' in that specification. ...
...on will apply to all channels, including the alpha channel. specifications specification status comment filter effects module level 1the def
inition of 'preservealpha' in that specification. ...
primitiveUnits - SVG: Scalable Vector Graphics
the various length values within the filter primitives and for the attributes that define the filter primitive subregion. ...
...userspaceonuse this value indicates that any length values within the filter def
initions represent values in the current user coordinate system in place at the time when the <filter> element is referenced (i.e., the user coordinate system for the element referencing the <filter> element via a filter attribute). objectboundingbox this value indicates that any length values within the filter def
initions represent fractions or percentages of the bounding box on the referencing element. specifications specification status comment filter effects module level 1the def
inition of 'primitiveunits' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'primitiveunits' in that specification. ...
...ctions or percentages of the bounding box on the referencing element. specifications specification status comment filter effects module level 1the def
inition of 'primitiveunits' in that specification. ...
...ercentages of the bounding box on the referencing element. specifications specification status comment filter effects module level 1the def
inition of 'primitiveunits' in that specification. ...
repeatCount - SVG: Scalable Vector Graphics
svg { height: 100%; } <svg viewbox="0 0 220 150" xmlns="http://www.w3.org/2000/svg"> <rect x="0" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatcount="5"/> </rect> <rect x="120" y="0" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="1s" repeatcount="indef
inite"/> </rect> </svg> usage notes value <number> | indef
inite default value none animatable no <number> this value specifies the number of iterations. it can include partial iterations expressed as fraction values. a fractional value describes a portion of the simple duration. values must be greater than 0. indef
inite this value indicates that t...
...es value <number> | indef
inite default value none animatable no <number> this value specifies the number of iterations. it can include partial iterations expressed as fraction values. a fractional value describes a portion of the simple duration. values must be greater than 0. indef
inite this value indicates that the animation will be repeated indef
initely (i.e. until the document ends). specifications specification status comment svg animations level 2the def
inition of 'repeatcount' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'repeatcount' in that specification. ...
...that the animation will be repeated indef
initely (i.e. until the document ends). specifications specification status comment svg animations level 2the def
inition of 'repeatcount' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'repeatcount' in that specification. ...
...imation will be repeated indef
initely (i.e. until the document ends). specifications specification status comment svg animations level 2the def
inition of 'repeatcount' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'repeatcount' in that specification. ...
requiredExtensions - SVG: Scalable Vector Graphics
l string or empty string value is given, the attribute evaluates to "false". ...
...svgextensionxyz/1.0", so that script writers can distinguish between different versions of a given extension. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'requiredextensions' in that specification. ...
...nt versions of a given extension. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'requiredextensions' in that specification. ...
... of a given extension. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'requiredextensions' in that specification. ...
restart - SVG: Scalable Vector Graphics
this value indicates that the animation can only be restarted when it is not active (i.e. after the active end). attempts to restart the animation during its active duration are ignored. ...
...ation during its active duration are ignored. never this value indicates that the animation cannot be restarted for the time the document is loaded. ...
...indicates that the animation cannot be restarted for the time the document is loaded. ...
...hat the animation cannot be restarted for the time the document is loaded. specifications specification status comment svg animations level 2the def
inition of 'restart' in that specification. ...
result - SVG: Scalable Vector Graphics
ly meaningful within a given <filter> element and thus has only local scope. it is legal for the same <filter-primitive-reference> to appear multiple times within the same <filter> element. ...
...ter> element. when referenced, this value will use the closest preceding filter primitive with the given result. specifications specification status comment filter effects module level 1the def
inition of 'result' in that specification. ...
...receding filter primitive with the given result. specifications specification status comment filter effects module level 1the def
inition of 'result' in that specification. working draft clarifies that the value is a <custom-ident>. ...
...lter primitive with the given result. specifications specification status comment filter effects module level 1the def
inition of 'result' in that specification. working draft clarifies that the value is a <custom-ident>. ...
scale - SVG: Scalable Vector Graphics
x);""/> </svg> usage notes value <number> default value none animatable yes <number> this value defines the scale factor for the displacement. ...
...his value defines the scale factor for the displacement. when the value of this attribute is 0, this operation has no effect on the source image. ...
... the value of this attribute is 0, this operation has no effect on the source image. ...
...of this attribute is 0, this operation has no effect on the source image. specifications specification status comment filter effects module level 1the def
inition of 'scale' in that specification. ...
spacing - SVG: Scalable Vector Graphics
t algorithms to adjust the spacing between typographic characters in order to achieve visually appealing results. ...
...typographic characters should be rendered exactly according to the spacing rules as specified by the layout rules for text-on-a-path. ...
...e spacing rules as specified by the layout rules for text-on-a-path. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'spacing' in that specification. ...
...ules as specified by the layout rules for text-on-a-path. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'spacing' in that specification. ...
stdDeviation - SVG: Scalable Vector Graphics
nd y. a negative value is forbidden. a value of zero disables the effect of the given filter primitive (i.e., the result is the filter input image). ...
...age). if stddeviation is 0 in only one of x or y, then the effect is that the blur is only applied in the direction that has a non-zero value. ...
...hat the blur is only applied in the direction that has a non-zero value. specifications specification status comment filter effects module level 1the def
inition of 'stddeviation' in that specification. ...
...r is only applied in the direction that has a non-zero value. specifications specification status comment filter effects module level 1the def
inition of 'stddeviation' in that specification. ...
stop-color - SVG: Scalable Vector Graphics
yes currentcolor this keyword denotes the current fill color and can be specified in the same manner as within a <paint> specification for the fill and stroke attributes. <color> this value indicates a color value. <icccolor> this value refers to an icc color profile. ...
... <icccolor> this value refers to an icc color profile. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'stop-color' in that specification. ...
...ions specification status comment scalable vector graphics (svg) 2the def
inition of 'stop-color' in that specification. candidate recommendation added a note that in svg the transparent keyword is treated differently than in css. ...
... specification status comment scalable vector graphics (svg) 2the def
inition of 'stop-color' in that specification. candidate recommendation added a note that in svg the transparent keyword is treated differently than in css. ...
style - SVG: Scalable Vector Graphics
style sheet language. by default, the style sheet language is css. note: in theory, the contentstyletype attribute could be used to specify styling languages other than css, like xsl(t). ...
... languages other than css, like xsl(t). however, this was never implemented satisfactorily in browsers, so you should not rely on it. ...
... implemented satisfactorily in browsers, so you should not rely on it. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'style' in that specification. ...
...d satisfactorily in browsers, so you should not rely on it. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'style' in that specification. ...
systemLanguage - SVG: Scalable Vector Graphics
aced, this does not mean that it is intended for multiple linguistic audiences. an example would be a beginner's language primer, such as "a first lesson in latin," which is clearly intended to be used by an english-literate audience. ...
...tin," which is clearly intended to be used by an english-literate audience. in this case, the attribute should only include en. ...
...ce. in this case, the attribute should only include en. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'systemlanguage' in that specification. ...
... case, the attribute should only include en. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'systemlanguage' in that specification. ...
tableValues - SVG: Scalable Vector Graphics
r animatable yes <list-of-numbers> this value holds a comma- and/or space-separated list of <number>s, which define a lookup table for the color component transfer function. each number can be between 0 and 1. ...
...p table for the color component transfer function. each number can be between 0 and 1. an empty list results in an identity transfer function. ...
... between 0 and 1. an empty list results in an identity transfer function. specifications specification status comment filter effects module level 1the def
inition of 'tablevalues' in that specification. ...
...and 1. an empty list results in an identity transfer function. specifications specification status comment filter effects module level 1the def
inition of 'tablevalues' in that specification. ...
textLength - SVG: Scalable Vector Graphics
ject, so we can't treat it like a plain number. after updating the text width, the contents of the widthdisplay box are updated with the new value as well, and we're finished. result here's what the example looks like. ...
...re's what the example looks like. try dragging the slider around to get a feel for what it does. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'textlength' in that specification. ...
...get a feel for what it does. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'textlength' in that specification. candidate recommendation allowed percentages and numbers as values. ...
...for what it does. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'textlength' in that specification. candidate recommendation allowed percentages and numbers as values. ...
unicode-bidi - SVG: Scalable Vector Graphics
path>, <text>, <tref>, and <tspan> context notes value normal | embed | isolate | bidi-override | isolate-override | plaintext default value normal animatable no for a description of the values, please refer to the css unicode-bidi property. ...
... to the css unicode-bidi property. specifications specification status comment css writing modes module level 3the def
inition of 'unicode-bidi' in that specification. proposed recommendation svg 2 only refers to css writing modes. introduced isolate, isolate-override, and plaintext keywords. ...
...tion status comment css writing modes module level 3the def
inition of 'unicode-bidi' in that specification. proposed recommendation svg 2 only refers to css writing modes. introduced isolate, isolate-override, and plaintext keywords. ...
...tus comment css writing modes module level 3the def
inition of 'unicode-bidi' in that specification. proposed recommendation svg 2 only refers to css writing modes. introduced isolate, isolate-override, and plaintext keywords. ...
viewBox - SVG: Scalable Vector Graphics
default value none animatable yes view for <view>, viewbox defines the position and dimension for the content of the <view> element. ...
...the <view> element. ...
...ber>?, <number> default value none animatable yes specification specification status comment scalable vector graphics (svg) 2the def
inition of 'viewbox' in that specification. ...
...ber> default value none animatable yes specification specification status comment scalable vector graphics (svg) 2the def
inition of 'viewbox' in that specification. ...
x1 - SVG: Scalable Vector Graphics
80% of the left bounding limit of the shape it is applied to --> <lineargradient x1="80%" id="g1"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> </lineargradient> <rect x="11" y="1" width="8" height="8" fill="url(#g1)" /> </svg> specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'x1' in that specification. candidate recommendation def
inition for <line> scalable vector graphics (svg) 2the def
inition of 'x1' in that specification. candidate recommendation def
inition for <lineargradient> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'x1' in that specification. recommendation
initial def
inition for <line> ...
... def
inition for <line> scalable vector graphics (svg) 2the def
inition of 'x1' in that specification. candidate recommendation def
inition for <lineargradient> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'x1' in that specification. recommendation
initial def
inition for <line> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'x1' in that specification. ...
...(svg) 2the def
inition of 'x1' in that specification. candidate recommendation def
inition for <lineargradient> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'x1' in that specification. recommendation
initial def
inition for <line> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'x1' in that specification. ...
...def
inition of 'x1' in that specification. candidate recommendation def
inition for <lineargradient> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'x1' in that specification. recommendation
initial def
inition for <line> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'x1' in that specification. ...
x2 - SVG: Scalable Vector Graphics
20% of the left bounding limit of the shape it is applied to --> <lineargradient x2="20%" id="g1"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> </lineargradient> <rect x="11" y="1" width="8" height="8" fill="url(#g1)" /> </svg> specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'x2' in that specification. candidate recommendation def
inition for <line> scalable vector graphics (svg) 2the def
inition of 'x2' in that specification. candidate recommendation def
inition for <lineargradient> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'x2' in that specification. recommendation
initial def
inition for <line> ...
... def
inition for <line> scalable vector graphics (svg) 2the def
inition of 'x2' in that specification. candidate recommendation def
inition for <lineargradient> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'x2' in that specification. recommendation
initial def
inition for <line> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'x2' in that specification. ...
...(svg) 2the def
inition of 'x2' in that specification. candidate recommendation def
inition for <lineargradient> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'x2' in that specification. recommendation
initial def
inition for <line> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'x2' in that specification. ...
...def
inition of 'x2' in that specification. candidate recommendation def
inition for <lineargradient> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'x2' in that specification. recommendation
initial def
inition for <line> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'x2' in that specification. ...
xChannelSelector - SVG: Scalable Vector Graphics
the input image defined in in2 will be used to displace the pixels of the input image defined in in along the x-axis. ...
...the alpha channel of the input image defined in in2 will be used to displace the pixels of the input image defined in in along the x-axis. ...
...ce the pixels of the input image defined in in along the x-axis. specifications specification status comment filter effects module level 1the def
inition of 'xchannelselector' in that specification. ...
...ls of the input image defined in in along the x-axis. specifications specification status comment filter effects module level 1the def
inition of 'xchannelselector' in that specification. ...
xlink:title - SVG: Scalable Vector Graphics
, <pattern>, <radialgradient>, <script>, <set>, <textpath>, <tref>, and <use> usage context value <anything> default value none animatable no <anything> this value specifies the title used to describe the meaning of the link or resource. ...
...e. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'seed' in that specification. ...
...nt scalable vector graphics (svg) 2the def
inition of 'seed' in that specification. ...
... scalable vector graphics (svg) 2the def
inition of 'seed' in that specification. candidate recommendation deprecated the attribute and made it only apply to <a>, <image>, <lineargradient>, <pattern>, <radialgradient>, <script>, <textpath>, and <use> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'seed' in that specification. ...
xml:lang - SVG: Scalable Vector Graphics
lue is defined in the bcp 47 specification. the most common syntax is a value formed by a lowercase two-character part for the language and an uppercase two-character part for the region or country, separated by a minus sign, e.g. en-us for us english or de-at for austrian german. ...
...r de-at for austrian german. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'xml:lang' in that specification. candidate recommendation made the lang attribute (without namespace) available on all elements and defined the interaction between both. ...
...ation status comment scalable vector graphics (svg) 2the def
inition of 'xml:lang' in that specification. candidate recommendation made the lang attribute (without namespace) available on all elements and defined the interaction between both. ...
...atus comment scalable vector graphics (svg) 2the def
inition of 'xml:lang' in that specification. candidate recommendation made the lang attribute (without namespace) available on all elements and defined the interaction between both. ...
xml:space - SVG: Scalable Vector Graphics
ne and tab characters into spaces. then, it draws all space characters (including leading, trailing and multiple consecutive space characters). for example, the string "a b" (three spaces between "a" and "b") separates "a" and "b" more than "a b" (one space between "a" and "b"). ...
...") separates "a" and "b" more than "a b" (one space between "a" and "b"). specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'xml:space' in that specification. ...
... "b"). specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'xml:space' in that specification. candidate recommendation deprecates the attribute and suggests to use white-space instead. ...
...specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'xml:space' in that specification. candidate recommendation deprecates the attribute and suggests to use white-space instead. ...
yChannelSelector - SVG: Scalable Vector Graphics
the input image defined in in2 will be used to displace the pixels of the input image defined in in along the y-axis. ...
...the alpha channel of the input image defined in in2 will be used to displace the pixels of the input image defined in in along the y-axis. ...
...ce the pixels of the input image defined in in along the y-axis. specifications specification status comment filter effects module level 1the def
inition of 'ychannelselector' in that specification. ...
...ls of the input image defined in in along the y-axis. specifications specification status comment filter effects module level 1the def
inition of 'ychannelselector' in that specification. ...
<feFlood> - SVG: Scalable Vector Graphics
recommendation ...
... comment filter effects module level 1the def
inition of '<feflood>' in that specification. working draft removed <icccolor> value from flood-color property and defined that the alpha channel of it gets multiplied with the computed value of the flood-opacity property. clarified value of flood-opacity property. ...
...n of '<feflood>' in that specification. ...
...ood>' in that specification. ...
<metadata> - SVG: Scalable Vector Graphics
et twisted pair cable</desc> <path d="m0,0c100,180 110,160 159,160"/> </g> <!-- draw cable n. ...
...>10baset twisted pair cable</desc> <path d="m0,0c0,-70 20,-50 60,-50"/> </g> </svg> specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<metadata>' in that specification. ...
...0,-50"/> </g> </svg> specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<metadata>' in that specification. candidate recommendation allowed global event attributes on the element. ...
...</g> </svg> specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<metadata>' in that specification. candidate recommendation allowed global event attributes on the element. ...
<symbol> - SVG: Scalable Vector Graphics
ymbol> element itself is not meant to be rendered. only instances of a <symbol> element (i.e., a reference to a <symbol> by a <use> element) are rendered. that means that some browsers could refuse to directly display a <symbol> element even if the css display property tells otherwise. ...
...o directly display a <symbol> element even if the css display property tells otherwise. specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<symbol>' in that specification. ...
...erty tells otherwise. specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<symbol>' in that specification. ...
...otherwise. specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<symbol>' in that specification. ...
Using custom elements - Web Components
the name you are giving to the element. note that custom element names require a dash to be used in them (kebab-case); they can't be single words. a class object that defines the behaviour of the element. optionally, an options object containing an extends property, which specifies the built-in element your element inherits from, if any (only relevant to customized built-in elements; see the def
inition below). so for example, we can define a custom word-count element like this: customelements.define('word-count', wordcount, { extends: 'p' }); the element is called word-count, its class object is wordcount, and it extends the <p> element. a custom element's class object is written using standard es 2015 class syntax. for example, wordcount is structured like so: class wordcount extends ...
...tion box to provide further in-context information. to begin with, the javascript file defines a class called popupinfo, which extends the generic htmlelement class. class popupinfo extends htmlelement { constructor() { // always call super first in constructor super(); // write element functionality in here ... } } the preceding code snippet contains the constructor() def
inition for the class, which always starts by calling super() so that the correct prototype chain is established. inside the constructor, we define all the functionality the element will have when an instance of it is instantiated. in this case we attach a shadow root to the custom element, use some dom manipulation to create the element's internal shadow dom structure — which is then attached to t...
...}); using the built-in element in a web document also looks somewhat different: <ul is="expanding-list"> ... </ul> you use a <ul> element as normal, but specify the name of the custom element inside the is attribute. note: again, you can see the full javascript source code here. using the lifecycle callbacks you can define several different callbacks inside a custom element's class def
inition, which fire at different points in the element's lifecycle: connectedcallback: invoked each time the custom element is appended into a document-connected element. this will happen each time the node is moved, and may happen before the element's contents have been fully parsed. note: connectedcallback may be called once your element is no longer connected, use node.isconnected to make ...
...ground-color to the style. function updatestyle(elem) { const shadow = elem.shadowroot; shadow.queryselector('style').textcontent = ` div { width: ${elem.getattribute('l')}px; height: ${elem.getattribute('l')}px; background-color: ${elem.getattribute('c')}; } `; } the actual updates are all handled by the life cycle callbacks, which are placed inside the class def
inition as methods. the connectedcallback() runs each time the element is added to the dom — here we run the updatestyle() function to make sure the square is styled as defined in its attributes: connectedcallback() { console.log('custom square element added to page.'); updatestyle(this); } the disconnectedcallback() and adoptedcallback() callbacks log simple messages to the console to inform ...
Web Components
om elements customelementregistry contains functionality related to custom elements, most notably the customelementregistry.define() method used to register new custom elements so they can then be used in your document. window.customelements returns a reference to the customelementregistry object. life cycle callbacks special callback functions defined inside the custom element's class def
inition, which affect its behavior: connectedcallback: invoked when the custom element is first connected to the document's dom. disconnectedcallback: invoked when the custom element is disconnected from the document's dom. adoptedcallback: invoked when the custom element is moved to a new document. attributechangedcallback: invoked when one of the custom element's attributes is added, remov...
...propagate across the shadow dom boundary into the standard dom (true), or not (false). event.composedpath: returns the event’s path (objects on which listeners will be invoked). this does not include nodes in shadow trees if the shadow root was created with shadowroot.mode closed. html templates <template> contains an html fragment that is not rendered when a containing document is
initially loaded, but can be displayed at runtime using javascript, mainly used as the basis of custom element structures. the associated dom interface is htmltemplateelement. <slot> a placeholder inside a web component that you can fill with your own markup, which lets you create separate dom trees and present them together. the associated dom interface is htmlslotelement. the slot global html att...
...any content that is inserted into a slot. the slotchange event fired on an htmlslotelement instance (<slot> element) when the node(s) contained in that slot change. examples we are building up a number of examples in our web-components-examples github repo. more will be added as time goes on. specifications specification status comment html living standardthe def
inition of '<template> element' in that specification. living standard the def
inition of <template>. html living standardthe def
inition of 'custom elements' in that specification. living standard the def
inition of html custom elements. domthe def
inition of 'shadow trees' in that specification. living standard the def
inition of shadow dom. html imports wo...
...te> element' in that specification. living standard the def
inition of <template>. html living standardthe def
inition of 'custom elements' in that specification. living standard the def
inition of html custom elements. domthe def
inition of 'shadow trees' in that specification. living standard the def
inition of shadow dom. html imports working draft
initial html imports def
inition. shadow dom obsolete
initial shadow dom def
inition. ...
Using the WebAssembly JavaScript API - WebAssembly
een window and worker contexts using postmessage(), and used in multiple places. in javascript, a memory instance can be thought of as a resizable arraybuffer (or sharedarraybuffer, in the case of shared memories) and, just as with arraybuffers, a single web app can create many independent memory objects. you can create one using the webassembly.memory() constructor, which takes as arguments an
initial size and (optionally) a maximum size and a shared property that states whether it is a shared memory or not. let’s start exploring this by looking at a quick example. create another new simple html page (copy our simple template) and call it memory.html. add a <script></script> element to the page. now add the following line to the top of your script, to create a memory instance...
...nd a shared property that states whether it is a shared memory or not. let’s start exploring this by looking at a quick example. create another new simple html page (copy our simple template) and call it memory.html. add a <script></script> element to the page. now add the following line to the top of your script, to create a memory instance: var memory = new webassembly.memory({
initial:10, maximum:100}); the unit of
initial and maximum is webassembly pages — these are fixed to 64kb in size. this means that the above memory instance has an
initial size of 640kb, and a maximum size of 6.4mb. webassembly memory exposes its bytes by simply providing a buffer getter/setter that returns an arraybuffer. for example, to write 42 directly into the first word of linear memory,...
...s.instance.exports.accumulate(0, 10); console.log(sum); note how we create the uint32array view on the memory object’s buffer (memory.prototype.buffer), not on the memory itself. memory imports work just like function imports, only memory objects are passed as values instead of javascript functions. memory imports are useful for two reasons: they allow javascript to fetch and create the
initial contents of memory before or concurrently with module compilation. they allow a single memory object to be imported by multiple module instances, which is a critical building block for implementing dynamic linking in webassembly. note: you can find our complete demo at memory.html (see it live also) . tables a webassembly table is a resizable typed array of references that can be access...
... multiplicity now we’ve demonstrated usag...
ui - Archive of obsolete content
orted from firefox 30 onwards. from firefox 30 onwards, you can attach panels to toggle buttons, by passing the button into the panel's constructor or its show() method: frame a frame enables you to create an html iframe, using bundled html, css and javascript. this can then be added to a designated area of the firefox user interface. at the moment you can only add frames to a toolbar. you
initialize a frame with a url pointing to an html document supplied under your add-on's "data" directory. this document can refer to bundled css and javascript files, and your main add-on can communicate with a frame script using message passing. once you've created a frame you need to add it to a toolbar. toolbar the ability to add buttons to toolbars is new in firefox 30. in firefox 29 you can on...
...javascript files, and your main add-on can communicate with a frame script using message passing. once you've created a frame you need to add it to a toolbar. toolbar the ability to add buttons to toolbars is new in firefox 30. in firefox 29 you can only add frames to toolbars. a toolbar gives you a horizontal strip of space which you can use for presenting a more complex user interface. ...
..." }); var play = ui.actionbutton({ id: "play", label: "play", icon: "./icons/play.png" }); var frame = ui.frame({ url: "./frame-player.html" }); var toolbar = ui.toolbar({ title: "player", items: [previous, next, play, frame] }); the toolbar appears just above the content window: sidebar a sidebar gives you a vertical strip of space for presenting complex user interfaces. you
initialize a sidebar with a url pointing to an html document supplied under your add-on's "data" directory. this document can refer to bundled css and javascript files, and your main add-on can communicate with a frame script using message passing. var ui = require("sdk/ui"); var sidebar = ui.sidebar({ id: 'my-sidebar', title: 'my sidebar', url: require("sdk/self").data.url("sidebar.html") });...
widget - Archive of obsolete content
ge() api or the port api. the crucial difference is that these scripts access the postmessage and port objects through the addon object, whereas content scripts access them through the self object. to show the difference, convert the player add-on above to use normal page scripts instead of content scripts. ...
...utton.onclick = function() { addon.port.emit("play"); } var pause_button = document.getelementbyid("pause-button"); pause_button.onclick = function() { addon.port.emit("pause"); } var stop_button = document.getelementbyid("stop-button"); stop_button.onclick = 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("sd...
... data = require("sdk/se...
platform/xpcom - Archive of obsolete content
ectly but you can subclass it, either using standard javascript inheritance or using the sdk's heritage module, to create new implementations of xpcom interfaces. ...
...class it, either using standard javascript inheritance or using the sdk's heritage module, to create new implementations of xpcom interfaces. ...
...platform/xpcom'); var request = class({ extends: unknown, interfaces: [ 'nsirequest' ],
initialize: function
initialize() { this.pending = false; }, ispending: function() { return this.pending; }, resume: function() { console.log('resuming...'); }, suspend: function() { console.log('suspending...'); }, cancel: function() { console.log('canceling...'); } }); this component def
inition: specifies that we support nsirequest using the interfaces property.
initializes pending in
initialize() adds our implementation of the nsirequest interface although request also implements nsisupports, there is no need to add it here, because the base class unknown declares support for nsisupports and this is accounted for when retrieving objects. we can register a factory for this co...
ui/toolbar - Archive of obsolete content
s/play.png" }); var frame = new frame({ url: "./frame-player.html" }); var toolbar = toolbar({ title: "player", items: [previous, next, play, frame] }); the toolbar appears just above the content window: to destroy a toolbar call its destroy() method. showing and hiding toolbars by default, a toolbar is shown when it is created, although you can specify that a toolbar should be hidden
initially by passing hidden:true as an option in its constructor. after that, though, you can't show or hide the toolbar programmatically. toolbars get a close button at the right-hand side, and users can show or hide the toolbar using the firefox "view/toolbars" menu, alongside built-in toolbars like the bookmarks toolbar. hidden state persists even over create/destroy cycles: if a toolbar is creat...
...('sdk/ui/button/action'); var { frame } = require("sdk/ui/frame"); var { toolbar } = require("sdk/ui/toolbar"); var button = actionbutton({ id: "my-button", label: "my-button", icon: "./my-button.png" }); var frame = new frame({ url: "./my-frame.html" }); var toolbar = toolbar({ title: "player", items: [button, frame] }); this add-on creates a toolbar with one frame, that's hidden
initially, and that logs show and hide events: 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], hidden: true, onshow: showing, onhide: hiding }); function showing(e) { console.log("showing"); console.log(e); } function hiding(e) { cons...
... 29, you can only add frames. an array of items to appear in the toolbar. each item in items must be an action button, a toggle button, or a frame instance. buttons each take up a fixed width. if more than one frame is supplied here, the frames each occupy an equal vertical strip of the toolbar. hidden boolean boolean indicating whether the frame should be hidden
initially or not. defaults to false. onattach function assign a listener to the attach event. ondetach function assign a listener to the detach event. onshow function assign a listener to the show event. onhide function assign a listener to the hide event. toolbar methods on(event, listener) a...
Displaying annotations - Archive of obsolete content
lacements. 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. in this chapter we'll use a page-mod to locate elements of web pages that have annotations associated with them, and a panel to display the annotations. matcher page-mod matcher content script the content script for the matcher page-mod is
initialized with a list of all the annotations that the user has created. when a page is loaded the matcher searches the dom for elements that match annotations. if it finds any it binds functions to that element's mouseenter and mouseleave events to send messages to the main module, asking it to show or hide the annotation. like the selector, the matcher also listens for the window's unload event a...
...reateanchor(annotation) { annotationanchorancestor = $('#' + annotation.ancestorid); annotationanchor = $(annotationanchorancestor).parent().find( ':contains(' + annotation.anchortext + ')').last(); $(annotationanchor).addclass('annotated'); $(annotationanchor).attr('annotation', annotation.annotationtext); } save this in data as matcher.js. ...
...w', function(data) { annotation.content = data; annotation.show(); }); worker.port.on('hide', function() { annotation.content = null; annotation.hide(); }); worker.on('detach', function () { detachworker(this, matchers); }); matchers.push(worker); } }); when a new page is loaded the function assigned to onattach is called. this function:
initializes the content script instance with the current set of annotations provides a handler for messages from that content script, handling the three messages - show, hide and detach - that the content script might send adds the worker to an array, so we it can send messages back later. then in the module's scope implement a function to update the matcher's workers, and edit handlenewannotation...
Customizing the download progress bar - Archive of obsolete content
if you want to change it for certain specific downloads only, things get a bit trickier. ...
...ge it for certain specific downloads only, things get a bit trickier. ...
...now your new progress bar image will only be used for the downloads with your special attribute. ...
On page load - Archive of obsolete content
amonkey 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"); // mail if(messagepane){ messagepane.addeventlistener("load", function(event) { myextens...
...to attach to the unload event in above example you can use the "pagehide" event like this: appcontent.addeventlistener("pagehide", myextension.onpageunload, false); for appcontent and similarly for messagepane messagepane.addeventlistener("pagehide", myextension.onpageunload, false); and add your code to onpageunload method. basic onpageload for a browser window var myextension = {
init: function() { // the event can be domcontentloaded, pageshow, pagehide, load or unload. if(gbrowser) gbrowser.addeventlistener("domcontentloaded", this.onpageload, false); }, onpageload: function(aevent) { var doc = aevent.originaltarget; // doc is document that triggered the event var win = doc.defaultview; // win is the window for the doc // test ...
...(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
r developers to save and load nsilocalfile and nsisupportsstring objects in preferences (as strings — note that from the preferences system's point of view, complex values have a nsiprefbranch.pref_string type.) there are two nsiprefbranch methods implementing the concept — setcomplexvalue() and getcomplexvalue(). you can look up their implementations in nsprefbranch.cpp. ...
...tems (for the example tree above): "typeaheadfind.autostart", "typeaheadfind.enablesound", and "usebrailledisplay", not just direct children ("typeaheadfind" and "usebrailledisplay"), as you might have expected. using preference observers changes a user makes to your extension's preferences, such as through an options dialog, may not take effect until the browser is restarted (e.g., if you have
initialized local variables when the browser loads). you may wish for such changes to be applied immediately in your extension. in this case, you can use the nsiprefbranch2 interface to "listen" for changes to preferences in a certain branch. note that it need not be your own extension's preferences; you can set an observer on any preference or branch. when a change is made to the preferences, you can...
... loads). you may wish for such changes to be applied immediately in your extension. in this case, you can use the nsiprefbranch2 interface to "listen" for changes to preferences in a certain branch. note that it need not be your own extension's preferences; you can set an observer on any preference or branch. when a change is made to the preferences, you can take the appropriate action (such as re
initializing variables or toggling display properties in xul components). this technique will work no matter how or where the preferences are changed: in another browser window, directly in the about:config interface, or even by another extension. note: during gecko 13 development, nsiprefbranch2 was deprecated, and its methods moved to nsiprefbranch. calling .queryinterface(components.interfaces.nsi...
How to convert an overlay extension to restartless - Archive of obsolete content
(note that the usage of an octal integer literal, while standard for handling permissions, is dangerous and deprecated; usage of use es5 strict mode to disable this and other foot-guns is recommended)...
...t to your chrome.manifest and install.rdf, will be the heart of your restartless add-on. think of it as main.c, but for javascript based firefox restartless add-ons. ...
...jar. also make sure to only unload your own jsm files to avoid accidentally breaking things horribly. for tearing down and cleaning up on a per-window basis, there is another route you can take. instead of directly calling your tear down function, make your unloadfromwindow() something like this: function unloadfromwindow(window) { var event = window.document.createevent("event"); event.
initevent("myaddonname-unload",false,false); window.dispatchevent(event); } in each window you can then register on startup to listen for your custom "myaddonname-unload" event and just tear down and clean up when that event or a regular "unload" event comes in. step 10: bypass cache when loading properties files the above will get you a working add-on that will install without a firefox resta...
Listening to events in Firefox extensions - Archive of obsolete content
n the browser or, for a tabbrowser, any of the browsers within it. some of the more interesting dom events you may wish to monitor are listed here: event description domlinkadded dispatched when a new html <link> element is detected in the document. domtitlechanged dispatched when the title of the page changes. domcontentloaded dispatched when the
initial dom for the page is completely loaded. load dispatched after the page—including images—has first finished loading. unload dispatched when the user has navigated away from the page. pageshow dispatched when a page is newly displayed. pagehide dispatched when a page is hidden. standard behavior for web pages is: user navigates to a pa...
...ehide event. pageshow event this event works the same as the load event, except that it fires every time the page is loaded (whereas the load event doesn't fire in firefox 1.5 when the page is loaded from cache). the first time the page loads, the pageshow event fires just after the firing of the load event. the pageshow event uses a boolean property called persisted that is set to false on the
initial load. it is set to true if it is not the
initial load (in other words, it is set to true when the page is cached). set any javascript that you want to run every time a page loads to run when the pageshow event fires. if you call javascript functions as part of the pageshow event, you can ensure these functions are called when the page is loaded in browsers other than firefox 1.5 by calling t...
...eshow, the pagehide event uses a boolean property called persisted. this property is set to false if the page is not cached by the browser and set to true if the page is cached by the browser. when this property is set to false, the unload handler, if present, fires immediately after the pagehide event. firefox 1.5 tries to simulate load events in the same order they would occur when the page is
initially loaded. frames are treated the same way as the top-level document. if the page contains frames, then when the cached page is loaded: pageshow events from each frame fire before the pageshow event in the main document fires. when the user navigates away from the cached page, the pagehide event from each frame fires before the pagehide event in the main document. for navigation that occur...
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
namic features to web pages. because it was often used at first to display pop-up windows, marching text in status bars, or in other ways that made web pages less useful to users, the language acquired a reputation as having little practical use and lacking in functionality. also, because a series of security holes were discovered in javascript and the compatible technology jscript, there was an
initial reluctance to use javascript at all. nevertheless, the rise of web services like google maps, which used javascript and asynchronous communications, created an awareness of a set of technologies nicknamed ajax (asynchronous javascript 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-...
...ss of a set of technologies nicknamed ajax (asynchronous javascript 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. ...
...in listing 3, also permits independent class def
initions. it does not have strict typing like java, making it extremely 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. ...
Appendix B: Install and Uninstall Scripts - Archive of obsolete content
add-ons normally run code at startup, and as it is covered in the main tutorial, all you need is a load event handler and a little code. it is also common for an add-on to require to run a script only when it is installed for the first time, or every time it is updated. it can be used to write or copy necessary files to the profile folder, like the
initial db the add-on will use for storage. ...
...hen it is installed for the first time, or every time it is updated. it can be used to write or copy necessary files to the profile folder, like the
initial db the add-on will use for storage. a few others require cleanup code to be run after the add-on is uninstalled. this appendix covers these cases with simple code that should work for most add-ons. install scripts just like with a regular
initialization function, we want a load event handler: // rest of overlay code goes here. window.addeventlistener( "load", function() { xulschoolchrome.browseroverlay.
init(); }, false); then all we need is some persistent flag that ensures that the first run code is only run once. the best approach in this case is to use a preference, as explained in the handling preferences section. so, if we w...
...r: // rest of overlay code goes here. window.addeventlistener( "load", function() { xulschoolchrome.browseroverlay.
init(); }, false); then all we need is some persistent flag that ensures that the first run code is only run once. the best approach in this case is to use a preference, as explained in the handling preferences section. so, if we were to use fuel, we can do the following in the
init function:
init : function() { let firstrunpref = "extensions.xulschoolhello.firstrundone"; if (!application.prefs.getvalue(firstrunpref, false)) { application.prefs.setvalue(firstrunpref, true); // all the rest of the first run code goes here. } } in this case you would need to declare the first run preference in your default preferences file, with a default value of false. you s...
Promises - Archive of obsolete content
requests http requests should, in nearly all circumstances, be made via the standard xmlhttprequest api. while this api does not have direct support for promises, its standard usage is very easy to adapt to a promise-based approach. moreover, many third-party wrappers for the xmlhttprequest api now support promises out of the box. example direct usage task.spawn(function* () { // make the
initial request. let resp = yield new promise((resolve, reject) => { let xhr = new xmlhttprequest; xhr.onload = resolve; xhr.onerror = reject; xhr.open("get", dataurl); xhr.responsetype = "json"; xhr.send(); }); let data = resp.target.response; // use the response to construct form data object for the // second request. let form...
...let xhr = new xmlhttprequest; xhr.onload = resolve; xhr.onerror = reject; xhr.open("post", updateurl); xhr.send(form); }); // use the response of the second request. notifyuser(resp.target.responsetext); }); example using promise-based helper the following example relies on the helper function defined below. task.spawn(function* () { // make the
initial request. let xhr = yield request(dataurl, { responsetype: "json" }); 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 res...
...; }); json file storage this helper simplifies the use of json data storage files with asynchronous io. the jsonstore object must be instantiated with the base name of the storage file and, optionally, a json-compatible object to be used if the file does not yet exist. the constructor returns a promise which resolves when the file’s contents have been loaded. the contents of the file will be
initially loaded into the json store’s data property. after any changes are made to this property, the save() method must be called to queue the changes to be written to disk. unless the flush() method is called, no writes will happen until a full second has elapsed between save() calls. the variable addon_id must be defined to the id of the add-on the code is being used in. this code makes use of...
MMgc - Archive of obsolete content
s the class mmgc::gc is the main class of the gc. it represents a full, self-contained instance of the garbage collector. it may be multiply instantiated; you may have multiple instances of the garbage collector running at once. each instance manages its own set of objects; objects are not allowed to reference objects in other gc instances. the gc typically is constructed early in your program's
initialization, and then passed to operations like operator new for allocating gc objects. there are a few methods that you may need to call directly, such as alloc and free. gc::alloc, gc::free the alloc and free methods are garbage-collected analogs for malloc and free. memory allocated with alloc doesn't need to be explicitly freed, although it can be freed with free if it is known that there are n...
...and this was hurting performance. since mmgc must traverse objects to decrement 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 un
initialized unmanaged memory 0xedededed unmanaged memory that was freed explicitly 0xbabababa managed memory that was freed by the sweep phase of the garbage collector 0xcacacaca managed memory that was freed by an explicit call to gc::free (including drc reaping) 0xdeadbeef this is written to the 4 bytes just after any object allocated via mmgc. it is used for overwrite detection. 0xfbfbfbf...
... put a write barrier on a pointer, the incremental mark process might miss the pointer being changed. the result will be an object that your code has a pointer to, but which the gc thinks is unreachable. the gc will destroy the object, and later you will crash with a dangling pointer. when you crash with what looks like a dangling pointer to a gc object, check for missing write barriers in the vic
inity. forgetting a drc if you forget to put a drc macro on a pointer to an rcobject from unmanaged memory, you can get a dangling pointer. the reference count of the object may go to zero, and the object will be placed in the zct. later, the zct will be reaped and the object will be destroyed. but you still have a pointer to it. when you dereference the pointer later, you'll crash with a dangling poi...
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
ent user connected on the computer. choosing mozilla products allow us to use the same apps while running either windows or linux systems (i suspect mac osx would be fine too). instead of configuring end user individual preferences files (~/.mozilla/default/randomdir/prefs.js) we now use a centralized default set of preferences. this centralized preference file can lock preferences (lockpref) or
initialize them (defaultpref) based on environment variables (user, home...) and/or ldap queries (fetch email address, common name , language, homepage etc...) from the enterprise directory. central configuration file that feature is provided through a javascript file. file location (not tested since 2012 ...) in thunderbird , firefox, the javascript preference file that calls the centralized pref...
...ge while stating thunderbird with autoconfig (autoconf.js having pref('general.config.filename','thunderbird.cfg'); ) and thunderbird.cfg calling getldap* functions to retrieve cn and mail address of the current user. netscape.cfg/autoconfig failed. please contact your system administrator. error: getldapattibutes failed: [exception... "component returned failure code: 0xc1f30001 (ns_error_not_
initialized) [nsildapurl.spec]" nsresult: "0xc1f30001 (ns_error_not_
initialized)" location: "js frame :: file:////usr/lib/thunderbird-3.0b2/defaults/autoconfig/prefcalls.js :: getldapattributes :: line 174" data: no] bug 295329 had been re-opened . autoconfig option and ldap support in thunderbird 1.5.x fortunately, autoconfig is now part of thunderbird default packages. moz_ldap_xpcom=1 and ...
... "author" : " jehan procaccia mci int-evry- jehan.procaccia at int-evry.fr" "creation date" : " 02 september 2006" ...
Block and Line Layout Cheat Sheet - Archive of obsolete content
ivate use ("private" flags). ns_frame_in_reflow this bit is set when the frame is being actively being reflowed. by default it is set in willreflow(), and unset in didreflow(). many frames' reflow() method verifies that the bit is set with an assertion. ns_frame_first_reflow this flag is set on a newly created frame, and later cleared by the frame's reflow() method when the frame has had its
initial reflow. ns_frame_sync_frame_and_view ns_frame_outside_children this flag is set if the combined area of a frame's children extend past the frame's bounding box. (what is a frame's "bounding box"?) if this flag is set, then <code>moverflowarea</code> will contain the total area of the frame, including the overflow. ns_frame_external_reference ns_frame_replaced_element ns_frame_generate...
...'t this just stored in the frame?) mflags pfd_relativepos pfd_istextframe pfd_isnonemptytextframe pfd_isnonwhitespacetextframe pfd_isletterframe pfd_issticky pfd_isbullet perspandata in nslinelayout, a "span" is a container inline frame, and a "frame" is one of its children. perhaps perparentdata and perchilddata would be better names? nslinelayout::beginlinereflow creates the
initial perspandata which is called the "root span". nsinlineframe::reflowframes creates a new perspandata when it calls nslinelayout::beginspan: at this time, the nslinelayout object's mcurrentspan is switched to the new span. the new span records the old mcurrentspan as its parent. after reflowing the child inline frames, nsinlineframe::reflowframes calls nslinelayout::endspan, which pops the perspa...
...st perframedata structure in the span. mlastframe the last perframedata structure frame in the span. perframedata structures are added to the span as they are reflowed. mlastframe may also be directly manipulated if a line is split, or if frames are pushed from one line to the next. mframe the perframedata of the inline frame that "owns" the span, or null if this is the root span. mframe is
initialized to the containing inline frame's perframedata when a new perspandata is pushed in nslinelayout::beginspan. original document information author(s): chris waterson last updated date: december 4, 2004 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details. ...
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
his document focuses on the interaction of three classes with each other, but other mozilla components are also involved. main roles nsdocshell this class corresponds, basically, to a "window" object in javascript -- each frame, iframe, content area, tab, etc has its own docshell. a docshell can have a name associated with it (e.g. a named frame). all loads that we consider in this document are
initiated via the docshell. nsdocshell implements too many interfaces to count; the ones that matter to us most are nsiwebnavigation and nsilinkhandler. nsuriloader this is a service implementing nsiuriloader. it keeps track of currently pending loads and registered content listeners. some facilities are provided for starting loads, canceling loads, and other such micromanagement. nsdocumentopeninfo t...
...nsiuricontentlistener"> <area alt="nsdocshell" coords="47,83,203,153" href="#nsdocshell"></map> this block diagram is out of date as of january 2012 with regard to some minor control flow shuffling in nsuriloader. the prose description below has been updated. the changes do not affect functionality and the step numbers in the diagram are still accurate. guided tour during startup and component
initialization, components register themselves with the uriloader via registercontentlistener. these registered listeners are used later during content dispatch. api calls to load a new uri. these can come in via nsiwebnavigation (a scriptable embedding interface) or nsilinkhandler (an internal interface used for link clicks). both interfaces are implemented by nswebshell/nsdocshell. these api calls...
...functions on nsiuricontentlistener and calls docontent() on the listener if it claims to handle the data, as well as hooking up a stream converter if the listener asks for one. if any of those steps fails, the function returns false so that another content listener will be looked for. the first content listener we check is the content listener associated with our window context (the docshell that
initiated the load). if this can't handle the content type, we loop over our stored list of possible listeners (previously registered via registercontentlistener) and ask each one in turn whether it can handle the data. if we still have not found an nsiuricontentlistener, we ask the category manager whether it has an entry for the desired content type under the ns_content_listener_categorymanager_en...
Creating a Help Content Pack - Archive of obsolete content
e rest are written in rdf. the content pack descriptor file outlines the framework of the contents of the pack by pointing to the files describing the table of contents, index, and glossary rdf files. the table of contents and index files are simple tree-based outlines written in rdf. the glossary file is written in rdf and consists of a simple list of terms with corresponding urls to the term def
inition. creating a content pack the content pack descriptor file as mentioned earlier, the content pack descriptor file is written using rdf. if you don't know rdf, that's okay - for our purposes, you won't need to learn very much. if you understand the basics of html or (preferably) xml, you'll understand the very basics of the syntax - elements, attributes, and element contents. understanding th...
...tion nc:panelid="search" nc:datasources="" nc:emptysearchtext="[no matching items found.]" nc:emptysearchlink="chrome://foo/locale/bar.html"/> </rdf:li> nc:panelid should be set to search. nc:datasources should be set as with table of contents, index, and glossary def
initions. nc:platform (added in mozilla 1.8b2/firefox 1.1) may be used on search data sources as it's used on table of contents, index, and glossary def
initions. nc:emptysearchtext specifies the text that is shown when a search through help returns no results. nc:emptysearchlink specifies what uri should be shown when the pseudo-result "no results found" is accessed. this attribute is required. the...
...the difference is a result of how rdf works. in rdf data describes data. top-level entries describe the root node, urn:root; nested entries describe other entries. you can refer to an entry by giving the entry a unique rdf:id attribute. then, to describe that entry, you set an rdf:about attribute to the value of the entry's rdf:id, prefixed by a #. nesting as described above works exactly th...
Mozilla Application Framework in Detail - Archive of obsolete content
nce for developers. with gecko, developers seeking a streamlined way to create and distribute web-based services across multiple platforms and devices can write once to w3c standards and their content and web applications will be accessible from across computing platforms and devices. gecko is based on contributions from mozilla.org, the organization chartered with managing netscape's open source
initiative among thousands of internet developers and participating vendors such as netscape. the gecko browser engine offers several key benefits including: size: gecko has been designed to be lean and modular, bringing full-functionality browsing to a variety of new consumer devices. because it is small, gecko can be embedded on devices with limited footprints and it minimizes download size for d...
.... full browser functionality: gecko allows any desktop application as well as new devices, products and appliances to be web-enabled, with complete browser functionality. supported standards and features include data transport protocols, multilingual character data, image data, java and plugins. open source: gecko represents the first software release from netscape and mozilla.org's open source
initiative. by harnessing the talent of thousands of developers worldwide, mozilla.org has accelerated internet software development and increased the quality of the final product, delivering unmatched support for web standards. in addition, independent software developers and corporate information technology departments now have complete access to the modular source code and freedom to freely license...
...mple installation and registration facilities for mozilla application developers. the mozblog application hosted at mozdev.org, for example, uses xpinstall to make several different versions available simultaneously as updates are made and the browser itself advances versions. ...
New Skin Notes - Archive of obsolete content
these fixes, they haven't necessarily been checked in yet. edit page textarea needs to 'scale' better with page width (so large whitespace area's are non-existant), suggest min-width:some-em-size; width: 88%; and max-width set to 95% or something like that. --callek i tried this, but it gets totally screwed up in ie for some reason. i'll try again, but can't guarantee this will be fixed for the
initial upgrades. --dria took two days, but i finally got this sorted out. when the skin is updated on test/docs, editform textarea should be resizeable in all browsers. yay! --dria wordpress skins need footer information. -- dria when a page is redirected, need to say-so and what it was redirected from, (see document for an example of such.) this is only an issue in mw1.5 so far. devmo skin vs...
...e clears are down the page) or mdc:frequently asked questions. i'm not saying this can't be worked around, just that it would be better if the skin coped with that fine. --nickolay 05:46, 25 aug 2005 (pdt) ok, i'll see what i can do. thanks for pointing it out. --dria external link icons missing on ie version of skin. --dria edit/preferences/diff pages end up being too wide at times. def
initely need to fix for ie. --dria the edit section links are gone (they are only shown in normal skin if you set the appropriate preference). --nickolay do you know if there's a localsettings variable to have the edit-section links off by default? it appears that they're on by default right now. --dria yeah, i think we want them off by default, as the more common case for a reader will be to read...
...default", however. skin designed with simplicity in mind -- minimal header, nav, footer -- plausibly good for alternate or small screen display, or people who prefer more straight-up formatting for on-screen docs. skin designed specifically with accessibility in mind. might want to consult with aaronlev to see what would be best. also see about improving accessibility of default skin. we def
initly need to add some ui to multipage stuff like tutorials. things like toc and back/forward and "page x of y" are extremly needed - it can be that they'll land in sidebar --gandalf 08:27, 29 aug 2005 (pdt) we'll revisit this later. this is too complex to deal with right now, unless someone wants to write and submit an extension. --dria ...
Supporting private browsing mode - Archive of obsolete content
purge-session-history notification that is sent when the browser purges private data that extensions can watch in order to know when it's time to do the same. a private browser listener helper object this helper object registers listeners for private browsing mode changes. this handles interacting with the private browsing service so you don't have to. ...
... listener helper object this helper object registers listeners for private browsing mode changes. this handles interacting with the private browsing service so you don't have to. ...
...lper object registers listeners for private browsing mode changes. this handles interacting with the private browsing service so you don't have to. ...
Binding Attachment and Detachment - Archive of obsolete content
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. ...
...hed, the following events occur: if required, anonymous content is cloned from the binding's content template and inserted around the bound element. the methods and properties of the binding are installed on the element and become available to scripts that reference the bound element. any specified event handlers are installed on their requested targets. if the binding needs to execute any
initialization code following its attachment to an element, it can do so using a <constructor> block inside <implementation> section. this block contains script that executes upon completion of the binding attachment. within this block this refers to the bound element. <destructor> call bindings attached through css are detached when any of the following conditions are met: a bound element matche...
...previously loaded binding documents. the document obtained from loadbindingdocument is a copy of the binding document that is unique to the bound document. the bindings in the binding document can be modified using standard dom apis. any subsequent binding attachments that occur on elements in the bound document for bindings in the binding document use the modified copy. therefore new binding def
initions can be generated dynamically or the anonymous content templates for bindings can be altered and used by the bound document. ...
Binding Implementations - Archive of obsolete content
an also be defined on the bound element using property tags. there are two basic types of properties. the first type of property is a raw value that is set directly on the element itself. the second type of property is one that defines functions that are invoked when the property is either retrieved or set. these functions are called getters and setters in xbl. ...
... are called getters and setters in xbl. for properties with raw values, an
initial value can be specified as a child of the property tag. the script is evaluated at the time of binding attachment and the resulting value is stored on the element. it can be assumed that the anonymous content of the binding has been fully constructed, although the bindingattached event will not have fired. property
initialization always takes place after content generation but before the firing of a binding attachment event, since the bindingattached handler needs to be able to assume that all properties will be accessible on the binding. properties with getters and setters can define them using onget and onset attributes, or using the more verbose getter and setter elements. if both the attribute form and the ...
...er from an attribute on the element or from a property on the element. the property attribute's value specifies the name of a property to use on the anonymous content element. the attribute attribute specifies the name of an attribute to use on the anonymous content element. if either of these attributes is specified on the property element, then any defined getters and setters are ignored. a raw
initial value is also ignored. if both a property and attribute are specified, then the property takes precedence and the attribute is ignored. inheritance of implementations when two bindings in an inheritance chain both supply implementations, the derived binding's implementation inherits from the base binding's implementation. method and property lookups are dynamic. without disambiguating, if tw...
addFile - Archive of obsolete content
lient version registry about the file. this parameter can be an absolute pathname, such as /royalairways/royalsw/executable or a relative pathname, such as executable. typically, absolute pathnames are only used for shared components, or components that come from another vendor, such as /microsoft/shared/msvcrt40.dll.typically, relative pathnames are relative to the main pathname specified in the
initinstall method. this parameter can also be null, in which case the xpisourcepath parameter is used as a relative pathname.note that the registry pathname is not the location of the software on the machine; it is the location of information about the software inside the client version registry. version an installversion object or a string of up to four integer values delimited by per...
... relative pathname.note that the registry pathname is not the location of the software on the machine; it is the location of information about the software inside the client version registry. version an installversion object or a string of up to four integer values delimited by periods, such as "1.17.1999.1517". for variants or this method without a version argument the value from
initinstall will be used. xpisourcepath a string specifying the location of the file within the xpi file. localdirspec an object representing a directory. the file is installed under this directory on the user's machine. you create this object by passing a string representing the directory to the getfolder method. relativelocalpath a pathname relative to the l...
...e installing binary files on a macintosh, be aware that the binary format for those files must be applesingle if the resource information is to be installed properly. ...
Return Codes - Archive of obsolete content
reboot_needed 999 the files were installed, but one or more components were in use. restart the computer and the application to complete the installation process. on windows nt, you may only need to restart the application as long as you did not replace operating system files. bad_package_name -200 a problem occurred with the package name supplied to
initinstall unexpected_error -201 an unrecognized error occurred. access_denied -202 the user (or the os) did not grant the required security privilege. execution_error -203 an error occurred executing the script no_install_script -204 installation script was not signed no_ce...
... no_such_component -213 the specified component is not present in the client version registry. does_not_exist -214 the specified file cannot be deleted because it does not exist. ...
... no_such_component -213 the specified component is not present in the client version registry. does_not_exist -214 the specified file cannot be deleted because it does not exist. read_only ...
How to implement a custom XUL query processor component - Archive of obsolete content
// eventually we s...
... // eventually we should read the <query> to create filters return this._data; }, generateresults...
...the getbindingfor rather than getbindingobjectfor to simplify the code. the variable passed into getbindingfor still has the "?" prepended to it, so be sure to handle it appropriately. we are not handling any datasources, but instead hard code the datasource in the component. you could easily extend this sample to handle multiple datasources by checking the datasources value in getdatasource and
initializeforbuilding. we do not make use of any <query/> or <rule/> elements in the xul template block. these could be used to support filtering the datasource. ...
Extensions - Archive of obsolete content
ids of the items found on the firefox context menu. showing and hiding context menu items to have a menuitem you have added be shown or hidden based on the context, you can use an event handler that listens for the popupshowing event. for instance, if an image was context clicked, you may wish to hide the menu item you have added if the operation it performed wouldn't apply to images. ...
...in this example, the thumbnailsshowhideitems function will be called when the popup is about to be shown. ...
...ed, see determining what was context clicked firefox uses its own popupshowing event listener to adjust the items on the context menu. this allows the menu to have different commands for different types of targets. while the popup is open, the gcontextmenu global variable is set to an object which handles all of the functionality specific to the firefox context menu. specifically, this object is
initialized with a set of properties that indiciate the type of object that was the target of the context menu. for instance, the 'onlink' property is set to true when a link was context-clicked. you may wish to use these properties instead of determining the type yourself, as the code already handles various special and complex cases that would take a lot of code to deal with manually. the following...
datepicker - Archive of obsolete content
type attribute. normal - a datepicker with three fields for entering the year, month and date. grid - a datepicker with a calendar grid for selecting a date. popup - a normal datepicker with three fields, but with an additional dropdown button to display a popup grid. there are several ways to set the selected day. in xul, the value attribute may be set to a value of the form yyyy-mm-dd to
initialize the datepicker to a certain date. if not specified, the datepicker defaults to the current day. to change the selected date, the value property may be used to set a new value in the form yyyy-mm-dd. the datevalue property may be used to retrieve and set the date using a date object. in addition, the date, month and year properties may be used to retrieve and modify each component of the da...
... current day. to change the selected date, the value property may be used to set a new value in the form yyyy-mm-dd. the datevalue property may be used to retrieve and set the date using a date object. in addition, the date, month and year properties may be used to retrieve and modify each component of the date separately. !!attention: there is also a datepicker in tb-calendar with differing def
initions for members (value is a date there) the change event is fired whenever the date is changed. however, as described in mozilla bug #799219, a change event handler may encounter erratic behavior when the date 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 you...
... so do not specify the type attribute if this kind is desired. grid a datepicker that displays a calendar grid where one month is shown at a time. popup a datepicker with three entry fields but an additional dropdown button, which, when pressed, will display a popup calendar grid. value type: string the
initial value of the datepicker in the form yyyy-mm-dd. properties date type: integer the currently selected date of the month from 1 to 31. set this property to change the selected date. dateleadingzero type: boolean a read only value indicating whether a leading zero should be displayed before the date when it is less than 10. datevalue ...
editor - Archive of obsolete content
e any editing user interface; you would supply that yourself. however, text editing, image resizing, and table row and cell editing capabilities are provided. if you do not set the editortype attribute on an editor, you must enable editing using the makeeditable method. to specify the document to load in the editor use the src attribute. however, an issue is that if you specify the src attribute
initially on the editor tag in the xul file, the document does not become editable by default. to enable editing on an editor, do either of the following: set the src attribute on the editor after the outer window has loaded, for example, in the onload handler. you might also set the src attribute based on what the user selects from a file dialog. in this case, set the editortype attribute on the e...
...tributes editortype, src, type properties accessibletype, commandmanager, contentdocument, contentwindow, docshell, editingsession, editortype, webbrowserfind, webnavigation methods geteditor, gethtmleditor, makeeditable examples this example shows how to made the editor editable by setting the designmode property of the loaded html document: <script language="javascript"> function
initeditor(){ // this function is called to set up the editor var editor = document.getelementbyid("myeditor"); editor.contentdocument.designmode = 'on'; } </script> <editor id="myeditor" editortype="html" src="about:blank" flex="1" type="content-primary"/> once editable, the document can have special formatting and other html pieces added to it using the document.execcommand method: var ed...
...d-only property contains the document object in the element. contentwindow type: todo use the contentwindow.wrappedjsobject to obtain a dom(html) window object docshell type: nsidocshell this read-only property contains the nsidocshell object for the document. editingsession type: nsieditingsession the editing session for the editor which is used to
initialize the editor. you would not normally need to use this. editortype type: one of the values below the type of editor to use. this value will be overridden depending on the content type of the document in the editor. html an html editor. text a plaintext editor. webbrowserfind type: ns...
textbox - Archive of obsolete content
e style classes plain examples <vbox> <label control="your-name" value="enter your name:"/> <textbox id="your-name" value="john"/> </vbox> attributes cols type: integer for multiline textboxes, the number of columns to display. decimalplaces type: integer the number of decimal places to display. the default is 0, which doesn't show any decimal places. the value inf
inity may be used if you want no limit on the number of decimal places. note that decimal numbers are stored as floats. 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 disabled, it does not respond to user actions, it cannot be focused, and the...
...oll 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 or number box may be set to. the default value is 100 for scales and inf
inity for number boxes. maxlength type: integer the maximum number of characters that the textbox allows to be entered. min type: integer the minimum value the textbox's value may take. the default value is 0. multiline type: boolean if true, the textbox displays multiple lines. if the user presses enter, a new line is started. if false, the textbox only all...
...rned by the min property, whichever is higher. wrap type: string set this attribute to the value off to disable word wrapping in the textbox. if this attribute is not specified, word wrapping is enabled. wraparound type: boolean if true, the value of the number box will wrap around when the maximum or minimum value is exceeded. the minimum and maximum values must both not be inf
inity. properties accessibletype type: integer a value indicating the type of accessibility object for the element. clickselectsall type: boolean if set to true, the contents of the textbox are selected when focused; otherwise, the cursor is left unchanged. decimalplaces type: integer gets and sets the value of the decimalplaces...
Debugging a XULRunner Application - Archive of obsolete content
console and browser console article. browser debugger as of gecko 44, it is no longer possible to start the devtools server from xul apps. see bug 1244163. starting with xulrunner 24, you should use the firefox browser debugger to debug your xulrunner apps. add the following code to your xul app: components.utils.import('resource://gre/modules/devtools/dbg-server.jsm'); if (!debuggerserver.
initialized) { debuggerserver.
init(); // don't specify a window type parameter below if "navigator:browser" // is suitable for your app. debuggerserver.addbrowseractors("myxulrunnerappwindowtype"); } debuggerserver.openlistener(6000); for xulrunner version 37+ the code to enable the debugger has changed: components.utils.import('resource://gre/modules/devtools/dbg-server.jsm'); if (!debugg...
...{ debuggerserver.
init(); // don't specify a window type parameter below if "navigator:browser" // is suitable for your app. ...
...don't specify a window type parameter below if "navigator:browser" // is suitable for your app. debuggerserver.addbrowseractors("myxulrunnerappwindowtype"); } debuggerserver.openlistener(6000); for xulrunner version 37+ the code to enable the debugger has changed: components.utils.import('resource://gre/modules/devtools/dbg-server.jsm'); if (!debuggerserver.
initialized) { debuggerserver.
init(); debuggerserver.addbrowseractors(); debuggerserver.allowchromeprocess = true; } let dbglistener=debuggerserver.createlistener(); dbglistener.portorpath=6000; dbglistener.open(); add the following to your prefs.js: (in recent ffox, edit about:config instead) pref("devtools.debugger.remote-enabled", true); in firefox, go to tools > web developer > connect... and you should be able to po...
NPN_RequestRead - Archive of obsolete content
syntax #include <npapi.h> nperror npn_requestread(npstream* stream, npbyterange* rangelist); parameters the function has the following parameters: stream stream of type np_seek from which to read bytes. rangelist range of bytes in the form of a linked list of npbyterange objects, each of which specifies a request for a range of bytes. ...
...an write individual ranges in any order, and with any number of npp_writeready() and npp_write() calls. the plug-in must allocate npbyterange objects, which the browser copies if necessary. the plug-in can free these as soon as the call returns. seekable streams are created by calling npp_newstream() with np_seek as the stype mode. the plug-in can call npn_requestread() on streams that were not
initially in np_seek mode as long as the stream is inherently seekable; npn_requestread() automatically changes the mode to np_seek. if the stream is not inherently seekable, the stream must have been put in np_seek mode
initially (since the browser must cache all the stream data on disk in order to access it randomly). if npn_requestread() is called on a stream that is not inherently seekable and n...
...ly in np_seek mode as long as the stream is inherently seekable; npn_requestread() automatically changes the mode to np_seek. if the stream is not inherently seekable, the stream must have been put in np_seek mode
initially (since the browser must cache all the stream data on disk in order to access it randomly). if npn_requestread() is called on a stream that is not inherently seekable and not
initially in mode np_seek, it returns the error code nperr_stream_not_seekable. typically, the only streams that are inherently seekable are those from in-memory or on-disk data, or from http servers that support byte-range requests. see also npp_newstream() npp_writeready() npp_write() npstream ...
NP_Shutdown - Archive of obsolete content
if you have defined a java class for your plug-in, be sure to release it at this time so that java can unload it and free up memory. ...
... if you have defined a java class for your plug-in, be sure to release it at this time so that java can unload it and free up memory. note: if enough memory is available, the browser can keep the plug-in library loaded if it expects to create more instances in the near future. ...
... by all instances of a plug-in. ...
NPAPI plugin reference - Archive of obsolete content
l of these methods begin with npn_ to indicate that they are implemented by the browser and called by the plug-in. np_getmimedescription np_getmimedescription returns a supported mime type list for your plugin. it works on unix (linux) and macos. on windows you have to define supported mimetypes in the dll resource file. np_getvalue allows the browser to query the plug-in for information. np_
initialize provides global
initialization for a plug-in. np_port contains information required by the window field of an npwindow structure. np_shutdown provides global de
initialization for a plug-in. npanycallbackstruct contains information required during embedded mode printing. npapi plug-in side api this chapter describes methods in the plug-in api that are available from the plug-in obje...
...if one exists, on the given npobject. npn_memalloc allocates memory from the browser's memory space. npn_memflush requests that the browser free a specified 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. npn_releaseobject decrements 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_releaseva...
...ocated 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 increments the reference count of the given npobject. npn_setexception a plugin can call this function to indicate that a call to one of the plugin's npobjects generated an error. npn_setproperty sets the value of a property on the specified npobject. npn_setval...
-ms-content-zooming - Archive of obsolete content
the element is zoomable. formal syntax none | zoom specifications not part of any specification. remarks this property has no effect unless overflow is permitted on both the x- and y-axes. ...
...the element is zoomable. formal syntax none | zoom specifications not part of any specification. remarks this property has no effect unless overflow is permitted on both the x- and y-axes. ...
...the element is zoomable. formal syntax none | zoom specifications not part of any specification. remarks this property has no effect unless overflow is permitted on both the x- and y-axes. by default, zoom-enabled elements can be zoomed by the user via pinch-zoom. ...
-ms-scroll-translation - Archive of obsolete content
the value is inherited from the element's parent element. ...
...the value is inherited from the element's parent element. formal syntax none | vertical-to-horizontal specifications not part of any specification. remarks this property requires windows 8 or later. this property has no effect on non-scrollable elements. ...
...ts. similarly, the events that occur when the user scrolls horizontally will always be horizontal scroll events. this property enables you to change this behavior for vertical scroll events. by setting the -ms-scroll-translation property to vertical-to-horizontal, you are specifying that vertical scroll events should be interpreted as their corresponding horizontal scroll events. this property's
initial value is inherit on all elements, except the <html> element, where it defaults to none. this property has no effect on keyboard interaction. the default css templates for windows apps using javascript, "ui-light.css" and "ui-dark.css", set this property to vertical-to-horizontal by default on the <html> element. ...
LiveConnect Overview - Archive of obsolete content
rting with javascript 1.2, these classes are delivered in a .jar file; in previous versions of javascript, these classes are delivered in a .zip file. for example, with netscape navigator 4 for windows nt, the classes are delivered in the java40.jar file in the program\java\classes directory beneath the navigator directory. more recently, the classes have been distributed with sun's java runtime;
initially in the file "jaws.jar" in the "jre/lib" directory of the runtime distribution (for jre 1.3), then in "plugin.jar" in the same location (jre 1.4 and up). using the liveconnect classes with the jdk to access the liveconnect classes, place the .jar or .zip file in the classpath of the jdk compiler in either of the following ways: create a classpath environment variable to specify the path and...
...t. the previous example uses getmember to assign the value of the javascript property jsdog.breed to the java data member javadog.dogbreed. note: a more realistic example would place the call to getmember inside a try...catch statement to handle errors of type jsexception. see handling javascript exceptions in java for more information. to get a better sense of how getmember works, look at the def
inition of the custom javascript object dog: function dog(breed,color,sex){ this.breed = breed; this.color = color; this.sex = sex; } you can create a javascript instance of dog called gabby as follows: var gabby = new dog("lab", "chocolate", "female"); if you evaluate gabby.color, you can see that it has the value "chocolate". now suppose you create an instance of javadog in your javascrip...
...gnitude or sign. nan is converted to nan. java.lang.double java.lang.object a new instance of java.lang.double is created, and the exact value is transferred to java without rounding and without a loss of magnitude or sign. float values are rounded to float precision. values which are too large or small to be represented are rounded to +inf
inity or -inf
inity. nan is converted to nan. byte char int long short values are rounded using round-to-negative-inf
inity mode. values which are too large or small to be represented result in a run-time error. nan can not be converted and results in a run-time error. java.lang.string values are converted to strings. ...
Old Proxy API - Archive of obsolete content
t trapped. p1 === p2 if and only if p1 and p2 refer to the same proxy. fixing a proxy does not alter its object identity (the object “generated” by the handler during fixing does not have its own object identity; it retains the object identity of the proxy, upholding the illusion that the proxy “becomes” the object). ...
...he proxy “becomes” the object). object.getprototypeof(proxy) returns the prototype with which proxy was
initialized for an object proxy, and returns function.prototype for a function proxy. typeof typeof anobjectproxy === "object" typeof afunctionproxy === "function" instanceof anobjectproxy instanceof c === true if and only if the prototype with which anobjectproxy was
initialized equals or inherits from c.prototype afunctionproxy instanceof function === true common mistakes and misunderstanding when starting using proxies, there are often a few beginners' mistakes and misunderstandings: not implementing all traps. proxies are, by default, "semanticless" objects. if a trap isn't implemented, then if it's a derived trap, the default implementation is us...
...have to implement at least all fundamental traps. unwanted recursion. be careful of how you use the receiver argument in 'get' and 'set' traps. var p = proxy.create({get: function(receiver, name) { print(receiver); // looks for receiver's tostring method. receiver turns out to be the proxy, so calling print results in calling the get trap. ...
RDF in Mozilla FAQ - Archive of obsolete content
.classes["@mozilla.org/rdf/datasource;1?name=xml-datasource"] .createinstance(components.interfaces.nsirdfdatasource); // the nsirdfremotedatasource interface has the interfaces // that we need to setup the datasource. var remote = ds.queryinterface(components.interfaces.nsirdfremotedatasource); // be sure that your web server will deliver this as text/xml (recommended) or text/rdf! remote.
init("http://www.mozilla.org/some-rdf-file.rdf"); // make it load! note that this will happen asynchronously. by setting // ablocking to true, we could force it to be synchronous, but this // is generally a bad idea, because your ui will completely lock up! remote.refresh(false); // note that ds will load asynchronously, so assertions will not // be immediately available you may decide that you need...
...rce into a container" if it isn't one already using makeseq(), makebag(), or makealt(). these methods return an nsirdfcontainer which allows you to do container-like operations without getting your hands too dirty. alternatively, if your datasource already has an object that is an rdf container, you can instantiate an nsirdfcontainer object with the @mozilla.org/rdf/container;1 contractid and
init() it with the datasource and resource as parameters. note that this will fail if the resource isn't already a container. xul templates xul templates are created by specifying a datasources attribute on an element in a xul document. there are two "forms" that xul templates may be written in. the "simple" form, which is currently the most common form in the mozilla codebase, and the "extended" f...
... an optional poll interval, where it will re-load the url. it outputs the assertions that are generated from each load. note that a polling reload generates a set of differences between the current and previous contents of the rdf/xml file. this is useful for debugging generated rdf/xml that may change over time. both these programs are slow to load and run (but they will run, eventually). they
initialize xpcom and bring up necko to be able to load and process urls just like mozilla does. nothing happens after i call adddatasource. note that the template builder will not rebuild the contents of a template automatically after adddatasource or removedatasource have been called on the builder's database. to refresh the template's contents, you must manually call elt.builder.rebuild() yourself...
Index - Game development
le provides a detailed guide to implementing audio for web games, looking at what works currently across as wide a range of platforms as possible. 27 crisp pixel art look with image-rendering 2d, 3d, css, canvas, games, javascript, webgl, image-rendering, pixel this article discusses a useful technique for giving your canvas/webgl games a crisp pixel art look, even on high def
inition monitors. 28 efficient animation for web games animation, games, javascript this article covers techniques and advice for creating efficient animation for web games, with a slant towards supporting lower end devices such as mobile phones. we touch on css transitions and css animations, and javascript loops involving window.requestanimationframe. 29 implementing ...
...plement a lives system, so that the player can continue playing until they have lost three lives, not just one. 49 game over 2d, beginner, canvas, games, javascript, phaser, tutorial, game over to make the game more interesting we can introduce the ability to lose — if you don't hit the ball before it reaches the bottom edge of the screen it will be game over. 50
initialize the framework 2d, beginner, canvas, games, html, javascript, phaser, tutorial before we can start writing the game's functionality, we need to create a basic structure to render the game inside. this can be done using html — the phaser framework will generate the required <canvas> element. 51 load the assets and print them on screen 2d, beginner, canvas, games, ja...
... painting the ball on the screen, clearing it and then painting it again in a slightly different position every frame to make the impression of movement — just like how movement works with the movies. 68 paddle and keyboard controls beginner, canvas, controls, games, graphics, javascript, tutorial, keyboard the ball is bouncing off the walls freely and you can watch it indef
initely, but currently there's no interactivity. it's not a game if you cannot control it! so let's add some user interaction: a controllable paddle. 69 track the score and win beginner, canvas, games, javascript, tutorial, scoring, winning destroying the bricks is really cool, but to be even more awesome the game could award points for every brick a user hits, and keep count of t...
Building up a basic demo with Three.js - Game development
ut the camera in place in the 3d coordinate system, and point it in the direction of our scene, so we can finally see something: var camera = new three.perspectivecamera(70, width/height); camera.position.z = 50; scene.add(camera); add the above lines to your code, below those previously added. there are other types of camera available (cube, orthographic), but the simplest is perspective. to
initialize it, we have to set its field of view and aspect ratio: the former is used to set how much is seen, and the latter is important for the objects on the screen to have the right proportions when rendered, and not look stretched. let's explain values we are setting for the code above: the value we set for the field of view, 70, is something we can experiment with: the higher the value, the g...
...), which causes the scene to be re-rendered constantly on every frame: function render() { requestanimationframe(render); renderer.render(scene, camera); } render(); on every new frame the render function is invoked, and the renderer renders the scene and the camera. right after the function declaration, we're invoking it for the first time to start the loop, after which it will be used indef
initely. again, add this new code below your previous additions. try saving the file and opening it in your browser. you should now see a gray window. congratulations! geometry now our scene is properly rendering, we can start adding 3d shapes. to speed up development, three.js provides a bunch of predefined primitives, which you can use to create shapes instantly in a single line of code. there's ...
...r torus. as mentioned above, the new objects currently just look black. to have both, the phong and lambert materials properly visible, we need to introduce a source of light. lights there are various types of light sources available in three.js. the most basic is pointlight, which works like a flashlight, shining a spotlight in a defined direction. add the following lines, below your shape def
initions: var light = new three.pointlight(0xffffff); light.position.set(-10, 15, 50); scene.add(light); we define a white point of light, set its position a little away from the center of the scene, so it can light up some parts of the shapes, finally adding it to the scene. now everything works as it should, all three shapes are visible. you should check the documentation for other types of light...
CSS and JavaScript accessibility best practices - Learn web development
add some simple coloring to your emphasised text: strong, em { color: #a60000; } you will however rarely need to style emphasis elements in any significant way. the standard conventions of bold and italic text are very recognisable, and changing the style can cause confusion. for more on emphasis, see emphasis and importance. abbreviations an element that allows an abbreviation, acronym, or
initialization to be associated with its expansion: <p>web content is marked up using <abbr title="hypertext markup language">html</abbr>.</p> again, you might want to style it in some simple way: abbr { color: #a60000; } the recognised styling convention for abbreviations is a dotted underline, and it is unwise to significantly deviate from this. for more on abbreviations, see abbreviations. l...
...on, the mouse pointer changes to a pointer icon when links are moused over, and the link receives a highlight when focused (e.g. via tabbing) or activated. the following image shows the highlight in both firefox (a dotted outline) and chrome (a blue outline): you can be creative with link styles, as long as you keep giving users feedback when they interact with the links. something should def
initely happen when states change, and you shouldn't get rid of the pointer cursor or the outline — both are very important accessibility aids for those using keyboard controls. form elements elements to allow users to input data into websites: <div> <label for="name">enter your name</label> <input type="text" id="name" name="name"> </div> you can see some good example css in our form-css.ht...
...n will have server-side validation active as well, because it is too easy for malicious users to bypass client-side validation (for example, by turning javascript off in the browser). the client-side validation is still really useful for reporting errors — users can know about mistakes they make instantly, rather than having to wait for a round trip to the server and a page reload. this is a def
inite usability advantage. note: server-side validation has not been implemented in this simple demo. we've made this form validation pretty accessible too. we've used <label> elements to make sure the form labels are unambiguously linked to their inputs, so screen readers can read them out alongside: <label for="name">enter your name:</label> <input type="text" name="name" id="name"> we only do...
Mobile accessibility - Learn web development
live) to see what we mean. alternatively, mouse-specific events such as mousedown and mouseup create problems — their event handlers cannot be invoked using non-mouse controls. if you try to control our simple-box-drag.html (see example live) example with a keyboard or touch, you'll see the problem. ...
...rnatively, mouse-specific events such as mousedown and mouseup create problems — their event handlers cannot be invoked using non-mouse controls. if you try to control our simple-box-drag.html (see example live) example with a keyboard or touch, you'll see the problem. ...
...ee the problem. this occurs because we are using code such as the following: div.onmousedown = function() {
initialboxx = div.offsetleft;
initialboxy = div.offsettop; movepanel(); } document.onmouseup = stopmove; to enable other forms of control, you need to use different, yet equivalent events — for example, touch events work on touchscreen devices: div.ontouchstart = function(e) {
initialboxx = div.offsetleft;
initialboxy = div.offsettop; positionhandler(e); movepanel(); } panel.ontouchend = stopmove; we've provided a simple example that shows how to use the mouse and touch events together — see multi-control-box-drag.html (see the example live also). note: you can also see fully functional examples showing how to implement different control mechanisms at implementi...
Responsive design - Learn web development
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 items to behave when they encounter more or less space around them. in the example below the flex items will each take an equal amount of space in the flex container, using the shorthand of flex: 1 as described in the layout topic flexbox: flexible sizing of flex items. .container { display: fl...
... set it up for mobile and redefine it in the media queries. the font then gradually increases as you increase the size of the viewport. see an example of this in action: example, source code. the viewport meta tag if you look at the html source of a responsive page, you will usually see the following <meta> tag in the <head> of the document. <meta name="viewport" content="width=device-width,
initial-scale=1"> this meta tag tells mobile browsers that they should set the width of the viewport to the device width, and scale the document to 100% of its intended size, which shows the document at the mobile-optimized size that you intended. why is this needed? because mobile browsers tend to lie about their viewport width. this meta tag exists because when the original iphone launched and p...
...creen layout on mobile. by setting width=device-width you are overriding apple's default width=960px with the actual width of the device, so your media queries will work as intended. so you should always include the above line of html in the head of your documents. there are other settings you can use with the viewport meta tag, however in general the above line is what you will want to use.
initial-scale: sets the
initial zoom of the page, which we set to 1. height: sets a specific height for the viewport. minimum-scale: sets the minimum zoom level. maximum-scale: sets the maximum zoom level. user-scalable: prevents zooming if set to no. you should avoid using minimum-scale, maximum-scale, and in particular setting user-scalable to no. users should be allowed to zoom as much or as ...
CSS FAQ - Learn web development
iple elements, therefore they can lead to shorter stylesheets, rather than having to write out the same styling information in multiple rules that use id selectors. shorter stylesheets are more performant. class selectors have lower specificity than id selectors, so are easier to override if needed. note: see selectors for more information. how do i restore the default value of a property?
initially css didn't provide a "default" keyword and the only way to restore the default value of a property is to explicitly re-declare that property. for example: /* heading default color is black */ h1 { color: red; } h1 { color: black; } this has changed with css 2; the keyword
initial is now a valid value for a css property. it resets it to its default value, which is defined in the css specifi...
...(see eric meyer's note about the working group's stance). ...
...ass="news"> (reuters) <span class="corpname">general electric</span> (ge.nys) announced on thursday... </div> in case of complex html hierarchies, if a rule seems to be ignored, check if the element is inside another element with a different style. explicitly re-defined style rule in css stylesheets, order is important. if you define a rule and then you re-define the same rule, the last def
inition is used. #stockticker { font-weight: bold; } .stocksymbol { color: red; } /* other rules */ /* other rules */ /* other rules */ .stocksymbol { font-weight: normal; } <!-- most text is in bold, except "ge", which is red and not bold --> <div id="stockticker"> nys: <span class="stocksymbol">ge</span> +1.0 ... </div> to avoid this kind of error, try t...
HTML forms in legacy browsers - Learn web development
*/ border: revert; } see the global css revert value for more information. <button> the <button> element suffered from two issues that are now resolved: a bug in old versions of internet explorer sent the html content available between the starting and ending tag of the <button> el...
...just pick what you need. note: modernizr has other awesome features to help you in dealing with unobstructive javascript and graceful degradation techniques. please read the modernizr documentation. pay attention to performance even though scripts like moder...
...ts the html5 form validation api test : modernizr.formvalidation, // if the browser does not support it, the following polyfill is loaded nope : form-validation-api-polyfill.js, // in any case, your core app file that depends on that api is loaded both : app.js, // once both files are loaded, this function is called in order to
initialize the app. complete : function () { app.
init(); } }); the modernizr team conveniently maintains a list of great polyfills. just pick what you need. note: modernizr has other awesome features to help you in dealing with unobstructive javascript and graceful degradation techniques. please read the modernizr documentation. pay attention to performance even though scripts like modernizr are very aware of performance, loading a 200 kilob...
How to build custom form controls - Learn web development
control is in the open state? this one is a little bit trickier. if you consider that the active state and the open state are completely different, the answer is again "nothing will happen" because we did not define any keyboard interactions for the opened state. on the other hand, if you consider that the active state and the open state overlap a bit, the value may change but the option will def
initely 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 functiona...
...light the right option option.classlist.add('highlight'); }; you need these in order to handle the various states of the custom control. next, we bind these functions to the appropriate events: // we handle the event binding when the document is loaded. ...
...sibling of the custom control var nativewidget = select.previouselementsibling; return nativewidget.selectedindex; }; with these two functions, we can bind the native controls to the custom ones: // we handle event binding when the document is loaded. ...
Tips for authoring fast-loading HTML pages - Learn web development
a page, thereby reducing the time for these requests to be sent, and for their responses to be received. depending on a browser's cache settings, it may send a request with the if-modified-since header for each referenced file, asking whether the file has been modified since the last time it was downloaded. too much time spent querying the last modified time of the referenced files can delay the
initial display of the web page, since the browser must check the modification time for each of these files, before rendering the page. if you use background images a lot in your css, you can reduce the number of http lookups needed by combining the images into one, known as an image sprite. then you just apply the same image each time you need it for a background and adjust the x/y coordinates appro...
...ubject is beneficial. it can be somewhat involved, but it will save a lot in page requests on pages which would normally not be cacheable. more information: http conditional get for rss hackers http 304: not modified http etag on wikipedia caching in http optimally order the components of the page download page content first, along with any css or javascript that may be required for its
initial display, so that the user gets the quickest apparent response during the page loading. this content is typically text, and can, therefore, benefit from text compression in transit, thus providing an even quicker response to the user. any dynamic features that require the page to complete loading before being used, should be
initially disabled, and then only enabled after the page has loaded. ...
...pt in separate files for maintenance. · <body> · user visible page content in small chunks ( <header>/ <main>/ <table>) that can be displayed without waiting for the full page to download. · <script> ... any scripts which will be used to perform interactivity. interaction scripts typically can only run after the page has completely loaded and all necessary objects have been
initialized. there is no need to load these scripts before the page content. that only slows down the
initial appearance of the page load. minimize the number of files for performance while keeping unrelated javascript in separate files for maintenance. if any images are used for rollover effects, you should preload them here after the page content has downloaded. ...
Define terms with HTML - Learn web development
readers. how to mark informal description in textbooks, the first time a keyword occurs, it's common to put the keyword in bold and define it right away. we do that in html too, except html is not a visual medium and so we don't use bold. we use <dfn>, which is a special element just for marking the first occurrence of keywords. note that <dfn> tags go around the word to be defined, not the def
inition (the def
inition consists of the entire paragraph): <p><dfn>firefox</dfn> is the web browser created by the mozilla foundation.</p> another use for bold is to emphasize content. bold itself is a concept foreign to html, but there are tags for indicating emphasis. special case: abbreviations it's best to mark abbreviations specially with <abbr>, so that screen readers read them appropriat...
...from your users, unless they're using a mouse and they happen to hover over the abbreviation. the spec duly acknowledges this as well. improve accessibility <dfn> marks the keyword defined, and indicates that the current paragraph defines the keyword. in other words, there's an implicit relationship between the <dfn> element and its container. if you want a more formal relationship, or your def
inition consists of only one sentence rather than the whole paragraph, you can use the aria-describedby attribute to associate a term more formally with its def
inition: <p> <span id="ff"> <dfn aria-describedby="ff">firefox</dfn> is the web browser created by the mozilla foundation. </span> you can download it at <a href="http://www.mozilla.org">mozilla.org</a> </p> assistive technology...
...gy can often use this attribute to find a text alternative to a given term. you can use aria-describedby on any tag enclosing a keyword to be defined (not just the <dfn> element). aria-describedby references the id of the element containing the description. how to build a description list description lists are just what they claim to be: a list of terms and their matching descriptions (e.g., def
inition lists, dictionary entries, faqs, and key-value pairs). description lists are not suitable for marking up dialogue, because conversation does not directly describe the speakers. here are recommendations for marking up dialogue. the terms described go inside <dt> elements. the matching description follows immediately, contained within one or more <dd> elements. enclose the whole description ...
Index - Learn web development
bers, operators, variables, l10n:priority, strings in this assessment you'll be tasked with taking some of the knowledge you've picked up in this module's articles and applying it to creating a fun app that generates random silly stories. have fun! 81 storing the information you need — variables arrays, booleans, javascript, numbers, objects, updating, variables, declaring,
initializing, l10n:priority, loose typing, strings by now you should know a reasonable amount about javascript variables and how to create them. in the next article, we'll focus on numbers in more detail, looking at how to do basic math in javascript. 82 test your skills: arrays arrays, beginner, javascript, learn, test your skills this aim of this skill test is to assess wh...
...rks, javascript, learn, client-side so far so good. we've got to the point where we can start build up our sample todomvc app in ember. in the next article we'll look at building up the markup structure of our app, as a group of logical components. 286 getting started with react beginner, frameworks, javascript, learn, react, client-side this brings us to the end of our
initial look at react, including how to install it locally, creating a starter app, and how the basics work. in the next article, we'll start building our first proper application — a todo list. before we do that, however, let's recap some of the things we’ve learned. 287 getting started with svelte beginner, frameworks, javascript, learn, svelte, client-side this brings us to...
...t, including how to install it locally, creating a starter app, and how the basics work. in the next article, we'll start building our first proper application — a todo list. before we do that, however, let's recap some of the things we’ve learned. 287 getting started with svelte beginner, frameworks, javascript, learn, svelte, client-side 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 our first proper application — a todo list. before we do that, however, let's recap some of the things we’ve learned. 288 getting started with vue beginner, frameworks, installation, javascript, learn, client-side, vue let's leave...
Test your skills: Conditionals - Learn web development
n the examples below, if there is an error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version). conditionals 1 in this task you are provided with two variables: season — contains a string that says what the current season is. response — begins un
initialized, but is later used to store a reponse that will be printed to the output panel. we want you to create a conditional that checks whether season contains the string "summer", and if so assigns a string to response that gives the user an appropriate message about the season. if not, it should assign a generic string to response that tells the user we don't know what season it is. to finish...
...sk to work in your own editor or in an online editor. conditionals 2 for this task you are given three variables: machineactive — contains an indicator of whether the answer machine is switched on or not (true/false) score — contains your score in an imaginary game. this score is fed into the answer machine, which provides a response to indicate how well you did. response — begins un
initialized, but is later used to store a reponse that will be printed to the output panel. you need to create an if...else structure that checks whether the machine is switched on and puts a message into the response variable if it isn't, telling the user to switch the machine on. inside the first, you need to nest an if...else if...else that puts appropriate messages into the response variable de...
... 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. conditionals 4 for the final task you are given four variables: machineactive — contains an indicator of whether the login machine is switched on or not (true/false). pwd — contains the user's login password. machineresult — begins un
initialized, but is later used to store a reponse that will be printed to the output panel, letting the user know whether the machine is switched on. pwdresult — begins un
initialized, but is later used to store a reponse that will be printed to the output panel, letting the user know whether their login attempt was succcessful. we'd like you to create an if...else structure that checks whether th...
Video and Audio APIs - Learn web development
ex: 3; left: 19px; } we set the outer .timer <div> to have flex: 5, so it takes up most of the width of the controls bar. we also give it position: relative, so that we can position elements inside it conveniently according to it's boundaries, and not the boundaries of the <body> element. the inner <div> is absolutely positioned to sit directly on top of the outer <div>. it is also given an
initial width of 0, so you can't see it at all. as the video plays, the width will be increased via javascript as the video elapses. the <span> is also absolutely positioned to sit near the left hand side of the timer bar. we also give our inner <div> and <span> the right amount of z-index so that the timer will be displayed on top, and the inner <div> below that. this way, we make sure we can see a...
... let's step through mediabackward() (the functionality for mediaforward() is exactly the same, but in reverse): we clear any classes and intervals that are set on the fast forward functionality — we do this because if we press the rwd button after pressing the fwd button, we want to canc...
...} let mediatime = minutevalue + ':' + secondvalue; timer.textcontent = mediatime; let barlength = timerwrapper.clientwidth * (media.currenttime/media.duration); timerbar.style.width = barlength + 'px'; } this is a fairly long function, so let's go through it step by step: first of all, we work out the number of minutes and seconds in the htmlmediaelement.currenttime value. then we
initialize two more variables — minutevalue and secondvalue. the two if statements work out whether the number of minutes and seconds are less than 10. if so, they add a leading zero to the values, in the same way that a digital clock display works. the actual time value to display is set as minutevalue plus a colon character plus secondvalue. the node.textcontent value of the timer is set to the...
Basic math in JavaScript — numbers and operators - Learn web development
t has a second number type, bigint, used for very, very large integers. but for the purposes of this course, we'll just worry about number values. it's all numbers to me let's quickly play with some numbers to reacquaint ourselves with the basic syntax we need. enter the commands listed below into your developer tools javascript console. first of all, let's declare a couple of variables and
initialize them with an integer and a float, respectively, then type the variable names back in to check that everything is in order: let myint = 5; let myfloat = 6.667; myint; myfloat; number values are typed in without quote marks — try declaring and
initializing a couple more variables containing numbers before you move on. now let's check that both our original variables are of the same da...
...pow(7, 3) is equivalent to 7**3. we probably don't need to teach you how to do basic math, but we would like to test your understanding of the syntax involved. try entering the examples below into your developer tools javascript console to familiarize yourself with the syntax. first try entering some simple examples of your own, such as 10 + 7 9 * 8 60 % 3 you can also try declaring and
initializing some numbers inside variables, and try using those in the sums — the variables will behave exactly like the values they hold for the purposes of the sum. for example: let num1 = 10; let num2 = 50; 9 * num1; num1 ** 3; num2 / num1; last for this section, try entering some more complex expressions, such as: 5 + 10 * 3; num2 % 9 * num1; num2 + num1 / 8 + 2; some of this last set...
...es you should learn now. active learning: sizing a canvas box in this exercise, you will manipulate some numbers and operators to change the size of a box. the box is drawn using a browser api called the canvas api. there is no need to worry about how this works — just concentrate on the math for now. the width and height of the box (in pixels) are defined by the variables x and y, which are
initially both given a value of 50. open in new window in the editable code box above, there are two lines marked with a comment that we'd like you to update to make the box grow/shrink to certain sizes, using certain operators and/or values in each case. let's try the following: change the line that calculates x so the box is still 50px wide, but the 50 is calculated using the numbers 43 and 7...
Silly story generator - Learn web development
e a look at the finished example (no peeking at the source code!) steps to complete the following sections describe what you need to do. basic setup: create a new file called main.js, in the same directory as your index.html file. apply the external javascript file to your html by inserting a <script> element into your html referencing main.js. put it just before the closing </body> tag.
initial variables and functions: in the raw text file, copy all of the code underneath the heading "1. complete variable and function def
initions" and paste it into the top of the main.js file. this gives you three variables that store references to the "enter custom name" text field (customname), the "generate random story" button (randomize), and the <p> element at the bottom of the html body tha...
.... store the first set of three strings inside an array called insertx. store the second set of three strings inside an array called inserty. store the third set of three strings inside an array called insertz. placing the event handler and incomplete function: now return to the raw text file. copy the code found underneath the heading "3. event listener and partial function def
inition" 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 def
initon 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.
...ce 300 with a calculation that converts 300 pounds into stones. concatenate ' stone' onto the end of the result of the overall math.round() call. inside the line that defines the temperature variable, replace 94 with a calculation that converts 94 fahrenheit into centigrade. concatenate ' centigrade' onto the end of the result of the overall math.round() call. just under the two variable def
initions, add two more string replacement lines that replace '94 fahrenheit' with the contents of the temperature variable, and '300 pounds' 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...
What went wrong? Troubleshooting JavaScript - Learn web development
ils 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 enter a guess and press the submit guess button, you'll see ... another error! this time the error being reported is "typeerror: loworhi is null", on line 78. note: null is a special value that means "nothing", or "no value". so loworhi has been declared and
initialised, but not with any meaningful value — it has no type or value. note: this error didn't come up as soon as the page was loaded because this error occurred inside a function (inside the checkguess() { ... } block). as you'll learn in more detail in our later functions article, code inside functions runs in a separate scope than code outside functions. in this case, the code was not run a...
...ng code on line 49: console.log(loworhi); note: console.log() is a really useful debugging function that prints a value to the console. so it will print the value of loworhi to the console as soon as we have tried to set it in line 48. save and refesh, and you should now see the console.log() result in your console. sure enough, loworhi's value is null at this point, so there is def
initely a problem with line 48. let's think about what the problem could be. line 48 is using a document.queryselector() method to get a reference to an element by selecting it with a css selector. looking further up our file, we can find the paragraph in question: <p class="loworhi"></p> so we need a class selector here, which begins with a dot (.), but the selector being passed into the querys...
...e it's listed as coming from line 94. looking at line number 94, it is easy to see that we've made the same mistake here. we again just need to change addeventlistener to .addeventlistener. do this now. a logic error at this point, the game should play through fine, however after playing through a few times you'll undoubtedly notice that the "random" number you've got to guess is always 1. def
initely not quite how we want the game to play out! there's def
initely a problem in the game logic somewhere — the game is not returning an error; it just isn't playing right. search for the randomnumber variable, and the lines where the random number is first set. the instance that stores the random number that we want to guess at the start of the game should be around line number 44: let ra...
Server-side web frameworks - Learn web development
s of code to do bad things such as deleting database records). for example, the django web framework provides an orm, and refers to the object used to define the structure of a record as the model. the model specifies the field types to be stored, which may provide field-level validation on what information can be stored (e.g. an email field would only allow valid email addresses). the field def
initions may also specify their maximum size, default values, selection list options, help text for documentation, label text for forms etc. the model doesn't state any information about the underlying database as that is a configuration setting that may be changed separately of our code. the first code snippet below shows a very simple django model for a team object. this stores the team name and te...
...res once you are familiar with the framework, and includes 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...
...n support. json and html/xml parsers and generators with css selector support. very clean, portable and object-oriented pure-perl api with no hidden magic. fresh code based upon years of experience, free and open-source. spring boot (java) spring boot is one of a number of projects provided by spring. it is a good starting point for doing server-side web development using java. although def
initely not the only framework based on java it is easy to use to create stand-alone, production-grade spring-based applications that you can "just run". it is an opinionated view of the spring platform and third-party libraries but allows to start with minimum fuss and configuration. it can be used for small problems but its strength is building larger scale applications that use a cloud approach. u...
React interactivity: Editing, filtering, conditional rendering - Learn web development
provide a user interface for them to do so. first, import usestate into the todo component like we did before with the app component, by updating the first import statement to this: import react, { usestate } from "react"; we'll now use this to set an isediting state, the default state of which should be false. add the following line just inside the top of your todo(props) { … } component def
inition: const [isediting, setediting] = usestate(false); next, we're going to rethink the <todo /> component — from now on, we want it to display one of two possible “templates", rather than the single template it's used so far: the "view" template, when we are just viewing a todo; this is what we’ve used in rest of the tutorial so far. the "editing" template, when we are editing a todo. ...
...n__danger" onclick={() => props.deletetask(props.id)} > delete <span classname="visually-hidden">{props.name}</span> </button> </div> </div> ); we've now got the two different template structures — "edit" and "view" — defined inside two separate constants. this means that the return statement of <todo /> is now repetitious — it also contains a def
inition of the "view" template. we can clean this up by using conditional rendering to determine which template the component returns, and is therefore rendered in the ui. conditional rendering in jsx, we can use a condition to change what is rendered by the browser. to write a condition in jsx, we can use a ternary operator. in the case of our <todo /> component, our condition is "is this task bei...
... some skills we used in our <todo /> component to: create a hook for storing the active filter. render an array of <filterbutton /> elements that allow users to change the active filter between all, completed, and incomplete. adding a filter hook add a new hook to your app() function that reads and sets a filter. we want the default filter to be all because all of our tasks should be shown
initially: const [filter, setfilter] = usestate('all'); defining our filters our goal right now is two-fold: each filter should have a unique name. each filter should have a unique behavior. a javascript object would be a great way to relate names to behaviors: each key is the name of a filter; each property is the behavior associated with that name. at the top of app.js, beneath our imports...
Getting started with Vue - Learn web development
eamline the development process. to use the npm package & the cli you will need: node.js 8.11+ installed. npm or yarn. note: if you don't have the above installed, find out more about installing npm and node.js here. to install the cli, run the following command in your terminal: npm install --global @vue/cli or if you'd prefer to use yarn: yarn global add @vue/cli once installed, to
initialize a new project you can then open a terminal in the directory you want to create the project in, and run vue create <project-name>. the cli will then give you a list of project configurations you can use. there are a few preset ones, and you can make your own. these options let you configure things like typescript, linting, vue-router, testing, and more. we’ll look at using this below. in...
...to interpolate values into it. note: this is not the template for managing the layout of your application — this template is for managing static html that sits outside of your vue app. editing this file typically only occurs in advanced use cases. src: this directory contains the core of your vue app. main.js: this is the entry point to your application. currently, this file
initializes your vue application and signifies which html element in the index.html file your app should be attached to. this file is often where you register global components or additional vue libraries. app.vue: this is the top-level component in your vue app. see below for more explanation of vue components. components: this directory is where you keep your components. currently it just has ...
...elopment build is not optimized. to create a production build, run npm run build. if you navigate to the “local” address in a new browser tab (this should be something like http://localhost:8080 as stated above, but may vary based on your setup), you should see your app. right now, it should contain a welcome message, a link to the vue documentation, links to the plugins you 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. 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 re...
Introduction to cross browser testing - Learn web development
f web browsers", we don't mean 100% of the browsers in the world — this is just about impossible. you can make some informed calls as to what browsers and devices your users will be using (as we'll discuss in the second article in the series — see gotta test 'em all?), but you can't guarantee everything. as a web developer, you need to agree on a range of browsers and devices that the code def
initely needs to work on with the site owner, but beyond that, you need to code defensively to give other browsers the best chance possible of being able to use your content. this is one of the great challenges of web development. note: we'll cover defensive coding later in the module too. why do cross browser issues occur? there are many different reasons why cross browser issues occur, and note...
...usly working. if you leave all the testing to the end of a project, any bugs you uncover will be a lot more expensive and time consuming to fix than if you uncover them and fix them as you go along. ...
...fferent people may do things quite differently to this):
initial planning > development > testing/discovery > fixes/iteration steps 2–4 will tend to be repeated as many times as necessary to get all of the implementation done. we will look at the different parts of the testing process in much greater detail in subsequent articles, but for now let's just summarize what may occur in each step.
initial planning in the
initial planning phase, you will probably have several planning meetings with the site owner/client (this might be your boss, or someone from an external company you are building a web site for), in which you determine exactly what the web site should be — what content and functionality should it have, what should it look like, etc. at this point you'll also want to know how...
Accessibility API cross-reference
d states. all accessibility apis to date define a list of possible object roles, or general types, such as button, menu item, text, etc. they also define a list of possible object states, such as focused, read-only, checked, etc. this table is the start of a cross-reference, so we can spot the differences and similarities in the apis. aria is a standard developed as part of the web accessibility
initiative, which uses markup syntax quite familiar to users of html, xml, sgml and others. the roles it specifies have already informed the 'semantic elements' of html5 (such as main and footer), but there is not a one-to-one mapping between the aria roles and the semantics of html5. aria can be used to 'fill out' the missing semantics of html, but may also be used in other markup languages (such as ...
...gion that contains information about the parent document such as copyright, authors' names etc. contentinfo <footer> page footers are often tagged as an artifact (not "real" content) with the 'contentinfo' provided as document level xmp metadata instead the mouse pointer - when and how is this used? cursor n/a n/a n/a a def
inition of a term or concept. def
inition <dd>, <dfn> <lbody> iconified version of an app (n/a - use either pushbutton or listitem) desktop_icon desktop_icon n/a a specific kind of a graphic - a diagram. diagram n/a n/a figure <figure> a dial or a knob. msaa only. dial n/a n/a ...
...s a document structural element. structure (abstract role) represents an entire table table table table table <table> a container for the resources associated with a tab, where each tab is contained in a tablist. tabpanel a word or phrase with a corresponding def
inition. term dt <lbl> text that might be editable, depending on state text text text textbox (if editable) the text nodes of html elements are uneditable by default, apart from <input type=text>, or those with a contenteditable attribute title or caption of window titlebar n/a n/a <title> a ...
Gecko info for Windows accessibility vendors
this faq explains how makers of windows screen readers, voice dictation packages and magnification software can support gecko-based software. the base of our support for these products is msaa (microsoft active accessibility), external readonly dom support, and the keyboard api/user interface. def
initions here are some basic def
initions that you'll need for this document to make sense: gecko: the rendering engine for firefox, thunderbird, nvu, mozilla seamonkey and other applications. gecko is the internal engine that mozilla uses to render any kind of web content. it supports html, xhtml, cascading style sheets (css) and the document object model (dom). microsoft active accessibility (msaa) an api devised by microsoft so that acces...
...prov->queryservice(refguid, iid_isimpledomnode, (void**)&psimpledomnode); if (succeeded(hresult) && psimpledomnode != null) { /* this is a mozilla node! use special isimpledomnode methods described in isimpledomnode.idl. */ } } the get_nodeinfo method is used to get basic information about a node such as the tag name and namespace id, node type (see isimpledomnode.idl for def
initions), node value (text held in the node), a unique id for use in tracking where events occur, and the number of children. the namespace id is meaningless until you get the namespace uri for it, through the isimpledomdocument interface (see below). hresult get_nodeinfo( /* [out] */ bstr *nodename, // for elements, this is the tag name /* [out] */ short *namespa...
...lies if the node is html. hresult get_innerhtml([out, retval] bstr *innerhtml); finally we provide a method for getting the current iso 639 language code, such as "en" for english or even possible "en-cockney" for the british cockney dialect. hresult get_language([out, retval] bstr *language); please look at the isimpledomnode.idl file for parameter types and the def
initions of the node type constants. isimpledomtext dom nodes that are text nodes support isimpledomtext. this extension is useful if you need to work on a character by character basis, whereas iaccessible provides only node by node support. text nodes must be leaf nodes, so there is no need to check for this interface if the current node has any msaa or dom children. text nodes always support ...
Creating reftest-based unit tests
ing to be a more fragile test, for the reasons described above. but it may be necessary. for example, say that certain markup should produce a certain sanskrit glyph. how does one test that? one should be able to "snap a picture" of the glyph as it should be displayed and then the reference page would include that graphic in an <img> element. more investigation into whether this will work is def
initely warranted. experiments with this have shown it to be not as easy as one would hope. we'll see. here is a list of reftest opportunities files in the source. these are files that have been checked in to be tested. presumably, one was supposed to open the pages with a browser and look at them and see if they look right. it is hard to tell how many of these will be usable as reftests. if the file...
...u 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 that would be unreliable, and just as bad, it can increase the time it takes to run a test many times over (which when you're running thousands of tests can really slow things down). the 'mozreftestinvalidate' event is designed to fir...
...the reftest framework fires one mozreftestinvalidate event at the document root element for a reftest-wait test when it is safe to make changes that should test invalidation. ...
Creating Sandboxed HTTP Connections
lasses["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); // create an nsiuri var uri = ioservice.newuri(myurlstring, null, null); once the nsiuri has been created, a nsichannel can be generated from it using nsiioservice's newchannelfromuri method: // get a channel for that nsiuri var channel = ioservice.newchannelfromuri(uri); to
initiate the connection, the asyncopen method is called. it takes two arguments: a listener and a context that is passed to the listener's methods. channel.asyncopen(listener, null); http notifications the above mentioned listener is a nsistreamlistener, which gets notified about events such as http redirects and data availability. onstartrequest - gets called when a new request is
initiated. ...
...ot cover cookies, the current channel being used will need to be stored as a global, since another listener will be used for cookie notifications (covered in the next section). it is usually best to use a javascript wrapper that implements all the required methods and calls the specified callback function when the connection has completed. ...
...e = { mdata: "", // nsistreamlistener onstartrequest: function (arequest, acontext) { this.mdata = ""; }, ondataavailable: function (arequest, acontext, astream, asourceoffset, alength) { var scriptableinputstream = components.classes["@mozilla.org/scriptableinputstream;1"] .createinstance(components.interfaces.nsiscriptableinputstream); scriptableinputstream.
init(astream); this.mdata += scriptableinputstream.read(alength); }, onstoprequest: function (arequest, acontext, astatus) { if (components.issuccesscode(astatus)) { // request was successfull this.mcallbackfunc(this.mdata); } else { // request failed this.mcallbackfunc(null); } gchannel = null; }, // nsichanneleventsink onchannelredirect: func...
Error codes returned by Mozilla APIs
the following tables list errors that can occur when calling various mozilla apis. each error is listed by its name and an error code in parentheses. an error will typically be displayed on the error console, but can be captured using a try-catch block in javascript. these constants can be accessed through components.results. ...
...ted by its name and an error code in parentheses. an error will typically be displayed on the error console, but can be captured using a try-catch block in javascript. these constants can be accessed through components.results. for example, by using components.results.ns_error_not_
initialized general errors the following errors are general and can occur when using any component. ns_error_not_
initialized (0xc1f30001) an attempt was made to use a component or object which has not yet been
initialized. these components usually provide an
initialization method, often called
init, which must be called before other methods are used. ns_error_already_
initialized (0xc1f30002) an attempt is made to
initialize a component or object again which has already been
initialized. ns_error_not_implemen...
...cant_set_read_only_constant (0x8057002b) ns_error_xpc_cant_set_read_only_attribute (0x8057002c) ns_error_xpc_cant_set_read_only_method (0x8057002d) ns_error_xpc_cant_add_prop_to_wrapped_native (0x8057002e) ns_error_xpc_call_to_scriptable_failed (0x8057002f) ns_error_xpc_jsobject_has_no_function_named (0x80570030) ns_error_xpc_bad_id_string (0x80570031) ns_error_xpc_bad_
initializer_name (0x80570032) ns_error_xpc_has_been_shutdown (0x80570033) ns_error_xpc_cant_modify_prop_on_wn (0x80570034) ns_error_xpc_bad_convert_js_zero_isnot_null (0x80570035) ns_error_xpc_com_unknown (0x80570036) ns_error_xpc_com_error (0x80570037) ns_error_xpc_com_invalid_class_id (0x80570038) ns_error_xpc_com_create_failed (0x80570039) ns_error_xpc_idispatch_not_...
Performance best practices for Firefox front-end engineers
as of bug 1353206, you can also schedule idle events in non-dom contexts by using services.tm.idledispatchtomainthread. see the nsithreadmanager.idl file for more details. hide your panels if you’re adding a new xul <xul:popup> or <xul:panel> to a document, set the hidden attribute to true by default. by doing so, you cause the binding applied on demand rather than at load time, which makes
initial construction of the xul document faster. get familiar with the pipeline that gets pixels to the screen learn how pixels you draw make their way to the screen. knowing the path they will take through the various layers of the browser engine will help you optimize your code to avoid pitfalls. the rendering process goes through the following steps: the above image is used under creative comm...
...lso means that requestanimationframe() is not a good place to put queries for layout or style information. detecting and avoiding synchronous style flushes what are style 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 doc...
...uld be treated as deprecated. avoid doing it. instead, animate using element.animate(). see the article animating like you just don't care for more information on how to do this. explicitly define start and end animation values some optimizations in the animation code of gecko are based on an expectation that the from (0%) and the to (100%) values will be explicitly defined in the @keyframes def
inition. even though these values may be inferred through the use of
initial values or the cascade, the offscreen animation optimizations are dependent on the explicit def
inition. see this comment and a few previous comments on that bug for more information. use indexeddb for storage appcache and localstorage are synchronous storage apis that will block the main thread when you use them. avoid them ...
Roll your own browser: An embedding how-to
packager follows the same format. however in our case, we only have one named xpi package. after the build is done, you can change directory into mozilla/embedding/config, and do a make. this will produce a directory in dist named embed. it should include all of the base support that you need to get a web browser started up. included is the sample test application (gtkembed or winembed). what
initializations do i have to do? somewhere during the start of your application, you must
initialize xpcom. you will also want to shut this down when you quit. other
initialization must be done to start up event queues and load some string bundles. all of this is somewhat generic and has been isolated into a static library that you can simply call on. if you build mozilla/embedding/base/, a static ...
... do you have any simple examples of embedding mozilla? there are many examples of products already using gecko for embedding. here's a partial list. ...
...has been isolated into a static library that you can simply call on. if you build mozilla/embedding/base/, a static library (on windows) called baseembed_s.lib is built. just link this library to your application. there are two functions that are needed: nsresult ns_
initembedding(const char *apath); nsresult ns_termembedding(); pretty self-explanatory. the apath parameter will be passed to ns_
initxpcom. ns_
initembedding() must be called from the main thread of your application, otherwise it won't work. do you have any simple examples of embedding mozilla? there are many examples of products already using gecko for embedding. here's a partial list. the sections marked 'mozilla examples' refer to clients and sample code to be found within the mozilla source tree. linux external projects ...
Dict.jsm
aging dictionaries of key/value pairs. ...
...airs 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. note: you can actually specify non-strings as keys; these are converted to strings before being used, so they're documented here as if they were a string parameter. in firefox 19 and above, you may also pass a json string to
initialize the dictionary: var somejson = '{key1: "foo", key2: {}}'; var newdict = new dict(somejson); note: any string you pass will be assumed to be json. method overview dict copy(); boolean del(string akey); object get(string akey, [optional] object adefault); boolean has(string akey); array listitems(); array listkeys(); array li...
... values iterator returns an iterator over all the values in the dictionary. note: the order in which items are returned is arbitrary, and may change without notice. in addition, if the dictionary changes during iteration, no guarantees are made as to what will happen. constructor dict() creates and returns a new dictionary object. dict dict(); dict dict( object
initalkeysandvalues ); parameters
initialkeysandvalues optional a object containing key/value pairs with which to
initialize the dictionary. return value a newly created dictionary object implementing the methods described in this article. methods copy() returns a shallow copy of the dictionary; that is, a copy of the dictionary including the items immediately included within the dictionar...
JavaScript OS.Constants
module os.constants is always available for chrome workers. os.constants.sys constants related to system configuration. ...
...module os.constants is always available for chrome workers. os.constants.sys constants related to system configuration. ...
...module os.constants is always available for chrome workers. os.constants.sys constants related to system configuration. name the name of the operating system (e.g. "darwin"). ...
Application Translation with Mercurial
ne profile when following this guide). getting the current texts in english and your locale obtaining the english texts with the source code get the source code by downloading the following file: firefox desktop or firefox for android: download the mozilla-<branch>.hg file (e.g. mozilla-aurora.hg) from https://ftp.mozilla.org/pub/mozilla.org/firefox/bundles/ the file is not small, but after
initially downloading it, you only need to download the latest changes in the future. thunderbird, lightning or seamonkey: download the comm-<branch>.hg file (e.g. comm-aurora.hg) from https://ftp.mozilla.org/pub/mozilla.org/thunderbird/bundles/ in the next step, we will unpack the source code: open an input shell, e.g. by pressing the windows key and r on the keyboard or by calling the "run...
...to put the source code. it's highly recommended to put it onto the fastest hard drive in the device. file paths here work starting with a slash (/) followed by the drive letter, and then the directory structure like on windows, but using slashes (/) instead of backslashes (\). so let's go to c:\mozilla by typing cd /c/mozilla/ create a new directory for the source code: mkdir mozilla-aurora
initialize the new directory as new repository: hg
init mozilla-aurora go into the new directory: cd mozilla-aurora unpack the source code: hg unbundle /path/to/the/downloaded/mozilla-aurora.hg this can take some time, mostly depending on the performance of the hard drive. extract the files: hg update obtaining the texts of your localization go back to the parent folder of mozilla-au...
...his 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 localization directory: cd /c/mozilla/de-mozilla-aurora
initiate mercurial queues: hg q
init get to know the translation style for having good chances that the translation suggestions get accepted, they should match the translation style of the texts in the application already translated. in general, the labels in the applications should have the same style like the operating system, e.g. use the same order of subject, verb and objects; decline verbs or ...
QA phase
ds 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-aurora )/ l10n-central (directory for l10n directories, one per l10n...
... 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 repository. we use a web service called bit bucket to start the learning process. note: you must have mercurial configured before you begin. that step is back on the
initial setup page. if you haven't done that yet, don't worry, we'll wait for you! pushing to your repository there are a couple of things you should take note of before you push to your repository: make sure that your files have been encoded in unicode without bom (byte order mark). remember that here you are pushing an entire directory, not a .zip archive file or an .xpi lang pack. the instr...
...er: http://hg.mozilla.org/l10n-central/x-testing now, navigate to your locale's directory on your local machine. if you're using koala, this should be located at /path/to/your/koala.project/locale/3.6/x-testing, otherwise, it should be located at /path/to/your/working_dir/l10n_base/x-testing. in this directory, you should have an hg repository. you might have created it yourself by running hg
init or hg clone or you might have had it created by koala when you were setting up a new localization project. also at this point, you shouldn't have any uncommitted changes (i.e., running the hg status command should show nothing). let's see what the last revision in this repository is. enter the following command: $ hg log -l 1 you should see an output similar to the one below: changeset: 0...
Investigating leaks using DMD heap scan mode
oing to be very slow, so you may need to disable some shutdown 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. ...
...$logdir should end in a path separator. for instance, ~/logs/leak/. ...
...nd one for moduleloadrequest. (this is where an unoptimized build comes in handy, as it would have pointed out the exact line. unfortunately, in this particular case, the unoptimized build was so slow i wasn’t getting any logs.) i then looked through the list of leaked objects generated by xpcom_mem_bloat_log and saw that we were leaking a scriptloadrequest, so i went and looked at its class def
inition, where i noticed that scriptloadrequest had a strong reference to an element that it wasn’t telling the cycle collector about, which seemed suspicious. the first thing i did to try to confirm that this was the source of the leak was pass the address of this object into the cycle collector analysis log, find_roots.py, that we used at an earlier step. that gave a result that contained this: ...
NSPR Types
nting size, pointer difference, boolean values, and return values. for information on naming conventions for nspr types, functions, and macros, see nspr naming conventions. calling convention types these types are used to support cross-platform declarations of prototypes and implementations: pr_extern is used for declarations of external functions or variables. pr_implement is used for def
initions of external functions or variables. pr_callback is used for def
initions and declarations of functions that are called via function pointers. a typical example is a function implemented in an application but called from a shared library. here are some simple examples of the use of these types: in dowhim.h: pr_extern( void ) dowhatimean( void ); static void pr_callback rootfunction(void ...
... application but called from a shared library. ...
...some systems require emulation of 64-bit fields by using two 32-bit numeric fields bound in a structure. sinc...
Cryptography functions
the public functions listed here perform cryptographic operations based on the pkcs #11 interface. if documentation is available for a function listed below, the function name is linked to either its mdc wiki page or its entry in the old ssl reference. the mozilla cross reference (mxr) link for each function provides access to the function def
inition, prototype def
inition, and source code references. the nss version column indicates which versions of nss support the function. function name/documentation source code nss versions pk11_algtagtomechanism mxr 3.2 and later pk11_authenticate mxr 3.2 and later pk11_blockdata mxr 3.2 and later pk11_changepw mxr ...
...r pk11_importencryptedprivatekeyinfo mxr 3.2 and later pk11_importprivatekeyinfo mxr 3.2 and later pk11_importprivatekeyinfoandreturnkey mxr 3.4 and later pk11_importpublickey mxr 3.4 and later pk11_importsymkeywithflags mxr 3.4 and later pk11_
initpin mxr 3.2 and later pk11_isfips mxr 3.2 and later pk11_isdisabled mxr 3.4 and later pk11_isfriendly mxr 3.2 and later pk11_ishw mxr 3.2 and later pk11_isinternal mxr 3.2 and later pk11_ispresent mxr 3.2 and later ...
...ocryptomechanism mxr 3.2 and later pk11_mapsignkeytype mxr 3.11 and later pk11_mechanismtoalgtag mxr 3.4 and later pk11_mergetokens mxr 3.12 and later pk11_movesymkey mxr 3.9 and later pk11_needlogin mxr 3.2 and later pk11_needuser
init mxr 3.2 and later pk11_paramfromiv mxr 3.2 and later pk11_paramfromalgid mxr 3.2 and later pk11_paramtoalgid mxr 3.2 and later pk11_pbekeygen mxr 3.2 and later pk11_privdecryptpkcs1 mxr 3.9.3 and later pk11_protectedauthenticationp...
4.3 Release Notes
release date: 01 april 2009 introduction network security services for java (jss) 4.3 is a minor release with the following new features: sqlite-based shareable certificate and key databases libpkix: an rfc 3280 compliant certificate path validation library pkcs11 needslogin method support hmacsha256, hmacsha384, and hmacsha512 support for all nss 3.12
initialization options jss 4.3 is tri-licensed under mpl 1.1/gpl 2.0/lgpl 2.1. new in jss 4.3 a list of bug fixes and enhancement requests were implemented in this release can be obtained by running this bugzilla query jss 4.3 requires nss 3.12 or higher. new sqlite-based shareable certificate and key databases by prepending the string "sql:" to the directory path passed to configdir parameter for crypomanager.
initiali...
...prepending the string "sql:" to the directory path passed to configdir parameter for crypomanager.
initialize method or using the nss environment variable nss_default_db_type. ...
... to the directory path passed to configdir parameter for crypomanager.
initialize method or using the nss environment variable nss_default_db_type. ...
JSS FAQ
code and documentation? if i don't call setcipherpolicy, is the domestic policy used by default? my ssl connection is hanging on windows? how can i tell which ssl/tls ciphers jss supports? how can i debug my ssl connection? can you explain jss ssl certificate approval callbacks? can i have multiple jss instances reading separate db's? once jss
initialized, i can't get anymore instances with certificatefactory.getinstance(x.509)? is it possible to sign data in java with jss? how do i convert org.mozilla.jss.crypto.x509certificate to org.mozilla.jss.pkix.cert.certificate? how do i convert org.mozilla.jss.pkix.cert to org.mozilla.jss.crypto.x509certificate? is it possible to use jss to access cipher functionality fr...
...setcipherpolicy does not need to be called by a jss app unless that app wants to limit itself to export-allowed cipher suites. my ssl connection is hanging on windows? nspr makes use of nt vs. windows distinction and provides different nt and windows builds. many netscape products, including nss, have nt and windows builds that are essentially the same except one difference: one...
... check, then calls the callback regardless of whether the cert passed or failed. the callback is told whether the cert passed, and then can do anything extra that it wants to do before making a final decision. sslclientcertificateselectioncallback is analogous to ssl_getclientauthdatahook. can i have multiple jss instances reading separate db's? no, you can only have one
initialized instance of jss for each database. once jss
initialized, i can't get anymore instances with certificatefactory.getinstance("x.509")? in version previous to jss 3.1, jss removes the default sun provider on startup. upgrade to the latest jss, or, in the cryptomanager.
initializationvalues object you pass to cryptomanager.
initialize(), set removesunproivider=true. is it possible to s...
NSS 3.12.4 release notes
pe a special character $ matches the end of the string bracketed expressions: [abc] matches one occurence of a, b, or c. [^abc] matches any character except a, b, or c. to be matched between [ and ], these characters must be escaped: \ ] no other characters need be escaped between brackets. unnecessary escaping is permitted. [a-z] matches any character between a and z, inclusive. the two range-def
inition characters must be alphanumeric ascii. if one is upper case and the other is lower case, then the ascii non-alphanumeric characters between z and a will also be in range. [^a-z] matches any character except those between a and z, inclusive. these forms cannot be combined, e.g [a-gp-z] does not work. exclusions: as a top level, outter-most expression only, the expression foo~bar will match the ...
...492131: a failure to import a cert from a p12 file leaves error code set to zero bug 492385: crash freeing named crl entry on shutdown bug 493135: bltest crashes if it can't open the input file bug 493364: can't build with --disable-dbm option when not cross-compiling bug 493693: sse2 instructions for bignum are not implemented on os/2 bug 493912: sqlite3_reset should be invoked in sdb_findobjects
init when error occurs bug 494073: update rsa/dsa powerupself tests to be compliant for 2011 bug 494087: passing null as the value of cert_pi_trustanchors causes a crash in cert_pkixsetparam bug 494107: during nss_nodb_
init(), softoken tries but fails to load libsqlite3.so crash [@ @0x0 ] bug 495097: sdb_mapsqlerror returns signed int bug 495103: nss_
initreadwrite(sql:<dbdir>) causes nss to look for s...
...bug 495717: unable to compile nss/cmd/certutil/keystuff.c on wince bug 496961: provide truncated hmac support for testing tool fipstest bug 497002: lab required nspr-free freebl changes. ...
nss tech note7
keys may be imported into nss. call seckey_importderpublickey() with type=ckk_rsa to import a der-encoded rsa public key. if you have the modulus and public exponent, you need to first encode them into an rsa public key and then import the public key into nss. pkcs #1 defines an rsa public key as a sequence of modulus and public exponent, both of which are integers. here is the asn.1 type def
inition: rsapublickey ::= sequence { modulus integer, -- n publicexponent integer -- e } the following sample code (error handling omitted for brevity) encodes a rsapublickey from a modulus and a public exponent and imports the public key into nss. struct myrsapublickey { secitem m_modulus; secitem m_exponent; } inpubkey; secitem derpubkey; seckeypublickey *pubkey; const sec_asn1...
...and v2.1 (section 7.2.1 encryption operation), pkcs1 v1.5 padding is described like this: 00 || 02 || ps || 00 || m but in pkcs #1 v2.0 (section 9.1.2.1 encoding operation, step 3) and on the w3c web site (http://www.w3.org/tr/xmlenc-core/#rsa-1_5), pkcs1 v1.5 padding is described like this: 02 || ps || 00 || m 00 at the beginning is missing. ...
...site (http://www.w3.org/tr/xmlenc-core/#rsa-1_5), pkcs1 v1.5 padding is described like this: 02 || ps || 00 || m 00 at the beginning is missing. why? answer: the version without the
initial 00 says : "ps is a string of strong pseudo-random octets [random] [...] long enough that the value of the quantity being crypted is one octet shorter than the rsa modulus" the version with the
initial 00 instead says to pad to the same length as the rsa modulus. "the same length as the rsa modulus with an
initial octet of 0" and "one octet shorter without that
initial octet" are exactly the same thing because the formatted block is treated as a big-endian big integer by the rsa algorithm. the leading 00 octet is simply eight most significant 0 bits. for example, 0x00123456 is equal to 0x...
nss tech note8
table from the server session lifetime. these two variables were private, declared in a private header file. there was no api function by which client programs could set these values. however since nss was delivered as archive libraries, client programs merely declared these two variables for themselves, and then were able to alter those variables directly. for server programs, the function for
initializing the server session cache would set these two variables according to two of the arguments to that function. so, ssl protocol code that wanted to cache a sid would do these steps, whether for client or for server: for ssl2: sid->lastaccesstime = sid->creationtime = ssl_time(); sid->expirationtime = sid->creationtime + ssl_sid_timeout; (*ss->sec.cache)(sid); for ssl3: sid->...
...coexist. as part of that work, i decided that each cache would have its own variables containing the ssl2 and ssl3 session durations. this means that client cache session lifetimes are separate from server session cache lifetimes, and that each server session cache may have its own lifetimes. so, in nss 3.4, the global variables ssl3_sid_timeout and ssl_sid_timeout were intended to become the def
initions for the client cache only, and each server cache had its own new pair of variables for ssl2 and ssl3 session lifetimes, i.e., cache->ssl2timeout and cache->ssl3timeout. the server cache
initialization function was intended to no longer alter the variables ssl3_sid_timeout and ssl_sid_timeout, but rather to set the server cache's variables. since all the callers of the socket's cache function...
... the client cache only, and each server cache had its own new pair of variables for ssl2 and ssl3 session lifetimes, i.e., cache->ssl2timeout and cache->ssl3timeout. the server cache
initialization function was intended to no longer alter the variables ssl3_sid_timeout and ssl_sid_timeout, but rather to set the server cache's variables. since all the callers of the socket's cache function always
initialized both their creationtime and expirationtime using the client's session lifetime variables, i changed the server's caching function to ignore the expirationtime computed by the caller, and compute its own expiration time, using the cache's own timeout values, or that was the intent. but an implementation flaw caused the caching code to continue to use the client's timeout time values, not t...
PKCS 12 functions
the nss version column indicates which versions of nss support the function. ...
...the nss version column indicates which versions of nss support the function. ...
... sec_pkcs12createpasswordprivsafe mxr 3.2 and later sec_pkcs12createunencryptedsafe mxr 3.2 and later sec_pkcs12decoderfinish mxr 3.2 and later sec_pkcs12decodergetcerts mxr 3.4 and later sec_pkcs12decoderimportbags mxr 3.2 and later sec_pkcs12decoderiterate
init mxr 3.10 and later sec_pkcs12decoderiteratenext mxr 3.10 and later sec_pkcs12decodersettargettokencas mxr 3.8 and later sec_pkcs12decoderstart mxr 3.2 and later sec_pkcs12decoderupdate mxr 3.2 and later sec_pkcs12decodervalidatebags mxr 3.2 and la...
FC_Finalize
name fc_finalize - indicate that an application is done with the pkcs #11 library. syntax ck_rv fc_finalize (ck_void_ptr preserved); parameters fc_finalize has one parameter: preserved must be null description fc_finalize shuts down the nss cryptographic module in the fips mode of operation. if the library is not
initialized, it does nothing. the preserved argument is not used and must be null. return value fc_finalize always returns ckr_ok. fc_finalize should check the preserved argument and return ckr_arguments_bad if preserved is not null. fc_finalize should return ckr_cryptoki_not_
initialized if the library is not
initialized. examples #include <assert.h> ck_function_list_ptr pfunctionlist; ck_rv crv; crv = fc_getfunctionlist(&pfunctionlist); assert(crv == ...
...urn ckr_arguments_bad if preserved is not null. fc_finalize should return ckr_cryptoki_not_
initialized if the library is not
initialized. examples #include <assert.h> ck_function_list_ptr pfunctionlist; ck_rv crv; crv = fc_getfunctionlist(&pfunctionlist); assert(crv == ckr_ok); ... ...
...s_bad if preserved is not null. fc_finalize should return ckr_cryptoki_not_
initialized if the library is not
initialized. examples #include <assert.h> ck_function_list_ptr pfunctionlist; ck_rv crv; crv = fc_getfunctionlist(&pfunctionlist); assert(crv == ckr_ok); ... ...
FC_GetTokenInfo
id slotid, ck_token_info_ptr pinfo); parameters fc_gettokeninfo has two parameters: slotid the id of the token's slot pinfo points to a ck_token_info structure description fc_gettokeninfo returns information about the token in the specified slot. on return, the ck_token_info structure that pinfo points to has the following information: label: the label of the token, assigned during token
initialization, padded with spaces to 32 bytes and not null-terminated. manufacturerid: id of the device manufacturer, "mozilla foundation", padded with spaces to 32 characters and not null-terminated. model: model of the device, "nss 3", padded with spaces to 16 characters and not null-terminated. serialnumber: the device's serial number as a string, "0000000000000000", 16 characters and not null-...
...ce's serial number as a string, "0000000000000000", 16 characters and not null-terminated. flags: bit flags indicating capabilities and status of the device. ckf_rng (0x00000001): this device has a random number generator ckf_write_protected (0x00000002): this device is read-only ckf_login_required (0x00000004): this device requires the user to log in to use some of its services ckf_user_pin_
initialized (0x00000008): the user's password has been
initialized ckf_dual_crypto_operations (0x00000200): a single session with the token can perform dual cryptographic operations ckf_token_
initialized (0x00000400): the token has been
initialized. if login is required (which is true for the fips mode of operation), this flag means the user's password has been
initialized. ulsessioncount: number ...
...ware version number, for example, 8.3 (major=0x08, minor=0x03), which are the version numbers of the certificate and key databases, respectively. firmwareversion: firmware version number, 0.0 (major=0x00, minor=0x00). a user may call fc_gettokeninfo without logging into the token (to assume the nss user role). return value ckr_ok token information was successfully copied. ckr_cryptoki_not_
initialized the pkcs #11 module library is not
initialized. ckr_slot_id_invalid the specified slot number is out of the defined range of values. fc_gettokeninfo should return ckr_arguments_bad if pinfo is null. examples note the use of the %.32s format string to print the label and manufacturerid members of the ck_token_info structure. see also fc_getslotinfo, nsc_gettokeninfo ...
NSS reference
initial notes we are migrating the ssl reference into the format described in the mdn style guide. if you are inclined to help with this migration, your help would be very much appreciated. the proposed chapters below are based on the chapters of the ssl reference and the categories of functions in nss public functions. should a particular page require the use of an underscore, please see the documentation for the title override extension. building and installing nss overview of an nss application based on "overview of an ssl application" in the ssl reference. getting started with nss based on "getting started with ssl" in the ssl reference. data types based on "selected ssl types and structures" in the ssl reference. ...
... require the use of an underscore, please see the documentation for the title override extension. building and installing nss overview of an nss application based on "overview of an ssl application" in the ssl reference. getting started with nss based on "getting started with ssl" in the ssl reference. data types based on "selected ssl types and structures" in the ssl reference. nss
initialization and shutdown nss_
init nss_
initreadwrite nss_nodb_
init nss_
initialize nss_shutdown utility functions based on "utility functions" in nss public functions. certificate functions based on certificate functions in the ssl reference and "certificate functions" in nss public functions. validating certificates cert_verifycertnow cert_verifycert cert_verifycertname ...
... these functions are listed in this section. error codes based on "nss and ssl error codes" in the ssl reference. nss environment variables nss cryptographic module nss tech ...
Necko walkthrough
tes nshttpconnectioninfo object for the channel checks if we're proxying or not fires off the dns prefetch request (dispatched to dns thread pool) some other things nshttpchannel::connect might to a speculativeconnect (pre open tcp socket) nshttpchannel::continueconnect some cache stuff nshttpchannel::setuptransaction creates new nshttptransaction, and
inits it with mrequesthead (the request headers) and muploadstream (which was created from the request data in channel setup) gets an nsiasyncinputstream (for the response; corresponds to the nspipeinputstream for the response stream pipe) passes it to nsinputstreampump nshttpchannel::ghttphandler->
initiatetransaction (called from connect) this is the global nshttphandler object, whi...
... 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, nsconnectionentry> called mct in nshttpconnecti...
...pipeevents 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::onstatestart, nsinputstreampump::onstatetransfer and nsinputstreampump::onstatestop. ...
Tutorial: Embedding Rhino
compilable examples are provided along the way. the examples live in the rhino/examples directory in the distribution and in mozilla/js/rhino/examples in cvs. this document will link to them using lxr. in this document, javascript code will be in green, java code will be in green, and shell logs will be in purple. ...
...os(math.pi)" -1 $ java runscript "function f(x){return x+1} f(7)" 8 note that you'll have to have both the rhino classes and the runscript example class file in the classpath. let's step through the body of main one line at time. entering a context the code context cx = context.enter(); creates and enters a context. a context stores information about the execution environment of a script.
initializing standard objects the code scriptable scope = cx.
initstandardobjects();
initializes the standard objects (object, function, etc.) this must be done before scripts can be executed. the null parameter tells
initstandardobjects to create and return a scope object that we use in later calls. collecting the arguments this code is standard java and not specific to rhino. it just collects a...
...asspath, we can't use that and access the counter class.) $ java -cp "js.jar;examples" org.mozilla.javascript.tools.shell.main js> defineclass("counter") js> c = new counter(7) [object counter] js> c.count 7 js> c.count 8 js> c.count 9 js> c.resetcount() js> c.count 0 counter's constructors the zero-argument constructor is used by rhino runtime to create instances. for the counter example, no
initialization work is needed, so the implementation is empty. public counter () { } the method jsconstructor defines the javascript constructor that was called with the expression new counter(7) in the javascript code above. public void jsconstructor(int a) { count = a; } class name the class name is defined by the getclassname method. this is used to determine the name of the constructor. pu...
GC Rooting Guide
all gc thing pointers stored on the stack (i.e., local variables and parameters to functions) must use the js::rooted<t> class. this is a template class where the template parameter is the type of the gc thing it contains. from the user perspective, a js::rooted<t> instance behaves exactly as if it were the underlying pointer. js::rooted must be constructed with a jscontext*, and optionally an
initial value. there are typedefs available for the main types. within spidermonkey, it is suggested that these are used in preference to the template class (gecko uses the template versions): template class typedef js::rooted<js::value> js::rootedvalue js::rooted<jsobject*> js::rootedobject js::rooted<jsstring*> js::rootedstring js::roote...
...x, js::mutablehandlevalue valueout) { // ... if (!waserror) valueout.set(resultvalue); return waserror; } void otherfunction(jscontext *cx) { js::rootedvalue value(cx); bool success = maybegetvalue(cx, &value); // ... } return values it's ok to return raw pointers! these do not need to be wrapped in any of rooting classes, but they should be immediately used to
initialize a js::rooted<t> if there is any code that could gc before the end of the containing function; a raw pointer must never be stored on the stack during a gc. one rare but especially tricky case to watch out for is where an raii destructor could gc in a function that is returning a bare pointer. consider: jsobject* somefunction(jscontext* cx) { js::rooted<jsobject*> obj(cx, foo()); ev...
...s::heap<t> gc thing pointers on the heap must be wrapped in a js::heap<t>. the only exception to this is if they are added as roots with the js::persistentrooted class, 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 requirements 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 c...
Tracing JIT
cates and stores a set of fragments and pages, and manages their lifecycle. a fragmento owns its associated fragments. a fragment represents a single linear code sequence, typically terminating in a jump to another fragment or back to the beginning of the fragment. a fragment's code is stored in a set of associated pages and guardrecords allocated from the fragment's owning fragmento. a fragment
initially holds no pages. as the compilation pipeline inserts lir instructions (lins values) into the fragment, it allocates pages to store the lir code. later, when the fragment is assembled, it will allocate pages for the native code (nins values) produced by the assembler. when the fragment is destroyed, it returns its pages to the fragmento for reuse. nanojit/assembler.* the nanojit/assembler.cp...
...as the collection of recorded fragments, held in a hashtable keyed by the interpreter's program counter and global object shape at the time of recording. at any moment, the trace monitor is in one of three major states: monitoring, recording, or executing. the transitions between these states are somewhat complex and delicate, but the overall picture is simple: monitoring the trace monitor's
initial state is monitoring. this means that spidermonkey is interpreting bytecode. every timespidermonkey interprets a backward-jump bytecode, the monitor makes note of the number of times the jump-target program-counter (pc) value has been jumped-to. this number is called the hit count for the pc. if the hit count of a particular pc reaches a threshold value, the target is considered hot. when the ...
... monitor simply discards the recorder and its fragment and returns to monitoring mode. the monitor also keeps track of how many times it has attempted to record a trace starting at each pc value, so if a particular pc causes too many aborted recordings, the monitor blacklists the pc and will not attempt recording it any longer. if the recorder completes recording at a backward branch back to the
initial pc value that triggered recording mode, it is said to have successfully closed the loop. a closed loop is passed through the nanojit assembler and thereby compiled to native machine code. the associated fragment is placed in the monitor's fragment table and the monitor returns to monitoring mode, with a high likelihood of immediately transitioning to executing mode on the next bytecode interpr...
JSNewEnumerateOp
umerate. to use a jsnewenumerateop in a jsclass, set the jsclass_new_enumerate bit in the jsclass.flags field and set the jsclass.enumerate field to your jsnewenumerateop, casting it to jsenumerateop. (spidermonkey, noting the jsclass_new_enumerate flag, will cast that function pointer back to type jsnewenumerateop before calling it.) the behavior depends on the value of enum_op: jsenumerate_
init a new, opaque iterator state should be allocated and stored in *statep. (you can use private_to_jsval to tag the pointer to be stored). the number of properties that will be enumerated should be returned as an integer jsval in *idp, if idp is non-null, and provided the number of enumerable properties is known. if idp is non-null and the number of enumerable properties can't be computed in ad...
... stored in *statep. (you can use private_to_jsval to tag the pointer to be stored). the number of properties that will be enumerated should be returned as an integer jsval in *idp, if idp is non-null, and provided the number of enumerable properties is known. if idp is non-null and the number of enumerable properties can't be computed in advance, *idp should be set to jsval_zero. jsenumerate_
init_all used identically to jsenumerate_
init, but exposes all properties of the object regardless of enumerability. jsenumerate_next a previously allocated opaque iterator state is passed in via statep. return the next jsid in the iteration using *idp. the opaque iterator state pointed at by statep is destroyed and *statep is set to jsval_null if there are no properties left to enumerate. jse...
...ously allocated opaque iterator state is passed in via statep. return the next jsid in the iteration using *idp. the opaque iterator state pointed at by statep is destroyed and *statep is set to jsval_null if there are no properties left to enumerate. jsenumerate_destroy destroy the opaque iterator state previously allocated in *statep by a call to this function when enum_op was jsenumerate_
init or jsenumerate_
init_all. the return value is used to indicate success, with a value of false indicating failure. see also mxr id search for jsnewenumerateop jsenumerateop bug 1097267 ...
JS_DefineProperty
which to create the new property. name or id const char * or const char16_t *or js::handleid the name of the new property. namelen size_t (only in js_defineucproperty) the length of name, in characters; or (size_t) -1 to indicate that name is null-terminated. value js::handlevalue or js::handleobject or js::handlestring or int32_t or uint32_t or double
initial stored value for the new property. getter jsnative the property getter callback, which the javascript engine will call each time the property's value is accessed; or null. setter jsnative the property setter callback, which the javascript engine will call each time the property is assigned; or null. attrs unsigned property attributes. desc ...
...a specified object, obj. js_defineucproperty is the unicode version of the function. js_definepropertybyid is the same but takes a js::handleid for the property name. js_defineproperty is the fundamental operation on which several more convenient, higher-level functions are based, including js_definefunction, js_definefunctions, js_defineproperties, js_defineconstdoubles, js_defineobject, and js_
initclass. it differs from js_setproperty in that: it does not behave like ordinary property assignment in the javascript language; it allows the application to specify additional details (getter, setter, and attrs) governing the new property's behavior; it never calls a setter; it can call the jsclass.addproperty callback when js_setproperty would not, because it can replace an existing propert...
...does not behave like ordinary property assignment in the javascript language; it allows the application to specify additional details (getter, setter, and attrs) governing the new property's behavior; it never calls a setter; it can call the jsclass.addproperty callback when js_setproperty would not, because it can replace an existing property. the parameters specify the new property's name,
initial stored value, getter, setter, and property attributes (attrs). if obj already has an own property with the given name or id, the existing property is replaced. these functions can currently replace jsprop_permanent properties, but such usage is deprecated. the javascript engine will call the getter or setter callback each time the property is read or written, whether from javascript code or ...
JS_FS
syntax #define js_fs(name,call,nargs,flags) ... #define js_fn(name,call,nargs,flags) ... #define js_sym_fn(symbol,call,nargs,flags) ... // added in spidermonkey 38 #define js_fninfo(name,call,info,nargs,flags) ... // added in spidermonkey 17 #define js_self_hosted_fn(name,selfhostedname,nargs,flags) ... // added in spidermonkey 31 #define js_self_hosted_sym_fn(symbol, selfhostedname, nargs, flags) ... // added in spidermonkey 38 #define js_sym_fnspec(symbol, call, info, nargs, flags, selfhostedname) ... // added in spidermonkey 38 #define js_fnspec(name,call,info,nargs,flags,selfhostedname) ... ...
...nst jsjitinfo * pointer to the jit info. nargs uint16_t the number of arguments the function expects. flags uint16 the bitwise or of any number of function flags. selfhostedname const char * the function's name in self-hosted javascript code. description use these macros to define an array of jsfunctionspecs to pass to js_definefunctions or js_
initclass. js_fn (whose name pays homage to the old jsnative/jsfastnative split) simply adds the flag jsfun_stub_gsops. js_fninfo allows the simple adding of jsjitinfos. js_self_hosted_fn declares a self-hosted function. finally js_fnspec has slots for all the fields. the _sym variants allow defining a function with a symbol key rather than a string key. for example, use js_sym_fn(iterator, ...) to de...
...th the string id "@@iterator".) see an example in the jsapi user guide. see also mxr id search for js_fs mxr id search for js_fn mxr id search for js_sym_fn mxr id search for js_fninfo mxr id search for js_self_hosted_fn mxr id search for js_self_hosted_sym_fn mxr id search for js_sym_fnspec mxr id search for js_fnspec mxr id search for js_fs_end jsfunctionspec js_defineproperties js_
initclass bug 775788 - added js_fninfo. bug 920433 - added js_self_hosted_fn and js_fnspec. bug 1082672 - added js_sym_fn js_self_hosted_sym_fn js_sym_fnspec. ...
Using XPCOM Utilities to Make Things Easier
ude 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 tremendous 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 occurred before mozilla 1.3 makes ns_
init_isupports no longer necessary: mrefcnt's type has been changed from an integer to a class that provides its own auto-
initialization. if you are building with versions earlier than mozilla...
...f you are building with versions earlier than mozilla 1.3, this macro is still required. the following table summarizes the macro usage in this portion of the weblock.cpp source file: common xpcom macros ns_impl_isupportsn implements nsisupports for a given class with n number of interfaces ns_decl_isupports declares methods of nsisupports including mrefcnt ns_
init_isupports
initializes mrefcnt to zero. must be called in class's constructor ns_get_iid returns the iid given the name of an interface. interface must be generated by xpidl using the macros described here, the code for the weblock component has gone from around 340 lines of code to just under 40. clearly from a code maintenance point of view, this kind of reduction is outsta...
... weblock2.cpp #include "nsigenericfactory.h" #include "nsisupportsutils.h" #define sample_cid \ { 0x777f7150, 0x4a2b, 0x4301, \ { 0xad, 0x10, 0x5e, 0xab, 0x25, 0xb3, 0x22, 0xaa}} class sample: public nsisupports { public: sample(); virtual ~sample(); ns_decl_isupports }; sample::sample() { // note: in newer versions of gecko (1.3 or later) // you don't have to do this: ns_
init_isupports(); } sample::~sample() { } ns_impl_isupports1(sample, nsisupports); ns_generic_factory_constructor(sample); static const nsmodulecomponentinfo components[] = { { "pretty class name", sample_cid, "@company.com/sample", sampleconstructor } }; ns_impl_nsgetmodule(nssamplemodule, components) string classes in xpcom strings are usually thought of as linear sequences o...
imgIEncoder
in gecko 1.9 (firefox 3) method overview void addimageframe( [array, size_is(length), const] in pruint8 data, in unsigned long length, in pruint32 width, in pruint32 height, in pruint32 stride, in pruint32 frameformat, in astring frameoptions); void encodeclipboardimage(in nsiclipboardimage aclipboardimage, out nsifile aimagefile); obsolete since gecko 1.9 void endimageencode(); void
initfromdata([array, size_is(length), const] in pruint8 data, in unsigned long length, in pruint32 width, in pruint32 height, in pruint32 stride, in pruint32 inputformat, in astring outputoptions); void startimageencode(in pruint32 width, in pruint32 height, in pruint32 inputformat, in astring outputoptions); constants possible values for input format (note that not all image formats support sa...
...uld be extra. frameformat missing description frameoptions missing description encodeclipboardimage() obsolete since gecko 1.9 (firefox 3) void encodeclipboardimage( in nsiclipboardimage aclipboardimage, out nsifile aimagefile ); parameters aclipboardimage missing description aimagefile missing description endimageencode() void endimageencode(); parameters none.
initfromdata() void
initfromdata( [array, size_is(length), const] in pruint8 data, in unsigned long length, in pruint32 width, in pruint32 height, in pruint32 stride, in pruint32 inputformat, in astring outputoptions ); parameters data list of bytes in the format specified by inputformat. length missing description width width in pixels. height height in pixels. stride the number of by...
...ons ); parameters width width in pixels. height height in pixels. inputformat one of input_format_* constants specifying the format of data. outputoptions semicolon-delimited list of name=value pairs that can give options to the output encoder. options are encoder-specific. just give an empty string for default behavior. remarks for encoding images which may contain multiple frames, the 1-shot
initfromdata() interface is too simplistic. the alternative is to use startimageencode(), call addimageframe() one or more times, and then finish
initialization with endimageencode(). ...
mozIStorageStatement
storage/public/mozistoragestatement.idlscriptable this interface lets you create and execute sql statements on a mozistorageconnection. inherits from: mozistoragevaluearray last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) for an introduction on how to use this interface, see the storage overview document. ...
...orage_statement_executing. read only. statement status constants constant value description moz_storage_statement_invalid 0 the sql statement is invalid. moz_storage_statement_ready 1 the sql statement is ready to be executed. moz_storage_statement_executing 2 the sql statement is executing at the moment. ...
... the sql statement is invalid. moz_storage_statement_ready 1 the sql statement is ready to be executed. moz_storage_statement_executing 2 the sql statement is executing at the moment. methods
initialize() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) note: this method has been removed for gecko 1.9.1. to
initialize a statement, consumers should call mozistorageconnection.createstatement(). this method exists back to gecko 1.8.0.
initialize this query with the given sql statement. void
initialize( in mozistorageconnection adbconnection, in autf8string asqlstatement ); parameters adbconnection a mozistorageconnection database connection. asqlstatement string key representing the sql statem...
nsIAppStartup
this can be used, for example, when ...
...ation after quitting. the application will be restarted with an empty command line and the normal profile selection process will take place on startup. methods createhiddenwindow() create the hidden window. void createhiddenwindow(); parameters none. createstartupstate() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) creates the
initial state of the application by launching tasks specfied by "general.startup.*" prefs. note: size_to_content may be used for width or height. boolean createstartupstate( in long awindowwidth, in long awindowheight ); parameters awindowwidth the width to make the
initial window(s) opened. awindowheight the height to make the
initial window(s) opened. return value true if a window w...
...o calculate how long startup took, compute the difference between the event's timestamp and the timestamp of the process event. hidesplashscreen() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.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.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) required
initialization routine. void
initialize( in nsisupports nativeappsupportorsplashscreen ); parameters nativeappsupportorsplashscreen is an object that can be qi'd to either an nsinativeappsupport or nsisplashscreen; this object will be used to implement hidesplashscreen. quit() ...
nsICommandLine
ation. this may be the original command line of this instance or a command line provided remotely by another instance of the application. 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. def
initions arguments any values found on the command line. switches flags. in normalized 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); ...
...nd line. in most cases, this will be null (xremote 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 application instance. state_remote_auto 1 a remote command line automatically redirected to this instance. state_remote_explicit 2 a remote command line explicitly redirected to this instance using xremote/windde/appleevents. methods findflag() finds a command-line flag, returning its position on the command line. long findflag( in astring aflag, in ...
... command line automatically redirected to this instance. state_remote_explicit 2 a remote command line explicitly redirected to this instance using xremote/windde/appleevents. methods findflag() finds a command-line flag, returning its position on the command line. long findflag( in astring aflag, in boolean acasesensitive ); parameters aflag the flag name to locate. do not include the
initial hyphen. acasesensitive whether to do case-sensitive comparisons. return value the position of the flag in the command line, or -1 if the flag is not found.getargument() gets the value an argument from the array of command-line arguments, given the index into the argument list. on windows, flags of the form /flag are normalized to -flag. /flag:param are normalized to -flag param. on unix/linux...
nsIConverterOutputStream
nsiunicharoutputstream last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: @mozilla.org/intl/converter-output-stream;1. ...
...onverter-output-stream;1. to create an instance, use: var converteroutputstream = components.classes["@mozilla.org/intl/converter-output-stream;1"] .createinstance(components.interfaces.nsiconverteroutputstream); method overview void
init(in nsioutputstream aoutstream, in string acharset, in unsigned long abuffersize, in prunichar areplacementcharacter); methods
init()
initialize this stream. must be called before any other method on this interface, or you will crash. ...
...acharset the character set to use for encoding the characters. ...
nsIDOMProgressEvent
nherits from: nsidomevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) the nsidomprogressevent is used in the media elements (<video> and <audio>) to inform interested code of the progress of the media download. this implementation is a placeholder until the specification is complete, and is compatible with the webkit progressevent. method overview void
initprogressevent(in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in boolean lengthcomputablearg, in unsigned long long loadedarg, in unsigned long long totalarg); deprecated since gecko 22.0 attributes attribute type description lengthcomputable boolean specifies whether or not the total size of the transfer is known. read only. ...
... loaded unsigned long long the number of bytes transferred since the beginning of the operation. this doesn't include headers and other overhead, but only the content itself. read only. total unsigned long long the total number of bytes of content that will be transferred during the operation. if the total size is unknown, this value is zero. read only. ...
...g long the total number of bytes of content that will be transferred during the operation. if the total size is unknown, this value is zero. read only. methods
initprogressevent() deprecated since gecko 22.0 this method has been removed from use in javascript in gecko 22.0. use the regular constructor to construct a synthetic progressevent. it still is usable from native c++ code.
initializes the progress event object. void
initprogressevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in boolean lengthcomputablearg, in unsigned long long loadedarg, in unsigned long long totalarg ); parameters typearg the type of event. must be one of "abort", "error", "load", "loadstart", or "progress". canbubblearg specifies whether or not the...
nsIDirectoryIterator
the nsidirectoryiterator interface provides a way to iterate over the entries in a directory. xpcom/obsolete/nsifilespec.idlscriptable please add a summary to this article. ...
...tries in a directory. xpcom/obsolete/nsifilespec.idlscriptable please add a summary to this article. ...
...ectory. xpcom/obsolete/nsifilespec.idlscriptable please add a summary to this article. ...
nsIFileInputStream
it may be removed before the stream is closed if it is possible to delete it and still read from it. ...
...actual operation on the stream, or more specifically, when one of the following is called: seek() tell() available() read() readline() defer_open is useful if we use the stream on a background thread, so that the opening and possible stating of the file happens there as well. note: using this flag results in the file not being opened during the call to
init. ...
...) readline() defer_open is useful if we use the stream on a background thread, so that the opening and possible stating of the file happens there as well. note: using this flag results in the file not being opened during the call to
init. this means that any errors that might happen when this flag is not set would happen during the first read. also, the file is not locked when
init is called, so it might be deleted before we try to read from it. methods
init() void
init( in nsifile file, in long ioflags, in long perm, in long behaviorflags ); parameters file file to read from (must qi to nsilocalfile) ioflags the file status flags define how the file is accessed. see pr_open documentation for more details. if set to -1 the file will be opened in...
nsIFileOutputStream
netwerk/base/public/nsifilestreams.idlscriptable this interface is an output stream that lets you stream to a file. inherits from: nsioutputstream last changed in gecko 1.7 method overview void
init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants behavior flag constants constant value description defer_open 1<<0 see the same constant in nsifileinputstream. the deferred open will be performed when one of the following is called: seek() tell() write() flush() defer_open is useful if we use the stream on a background thread, so that the opening and possible stating of the file happens there as well. ...
...rred open will be performed when one of the following is called: seek() tell() write() flush() defer_open is useful if we use the stream on a background thread, so that the opening and possible stating of the file happens there as well. ...
...o that the opening and possible stating of the file happens there as well. note: using this flag results in the file not being opened during the call to
init(). this means that any errors that might happen when this flag is not set would happen during the first write, and if the file is to be created, it will not appear on the disk until the first write. methods
init() void
init( in nsifile file, in long ioflags, in long perm, in long behaviorflags ); parameters file file to write to (must qi to nsilocalfile) ioflags file open flags listed are listed in the pr_open() documentation. use -1 to open the file in default mode (pr_wronly | pr_create_file | pr_truncate). perm file mode bits are described in the pr_...
nsILocaleService
note: this has nothing to do with the locale used for localization of the application (ui text strings and so on.). this method returns something similar to getsystemlocale. nsilocale getapplicationlocale(); parameters none. return value the user's os...
...note: this has nothing to do with the locale used for localization of the application (ui text strings and so on.). this method returns something similar to getsystemlocale. nsilocale getapplicationlocale(); parameters none. return value the user's os setting for pref...
...e the user's os setting for preferred locale. newlocale() create a new nsilocale from a locale string. nsilocale newlocale( in astring alocale ); parameters alocale a locale code as described in nsilocale. return value a nsilocale representing the given locale. newlocaleobject() obsolete since gecko 1.9 (firefox 3) nsilocale newlocaleobject( in nsilocaledef
inition localedef
inition ); parameters localedef
inition a locale def
inition as described in nsilocaledef
inition. return value a nsilocale representing the given locale. calls to its getcategory method return the values originally passed to the locale def
inition's addcategory method. ...
Using nsILoginManager
info object as a parameter. an nsilogininfo object contains the following attributes: hostname, form submit url, http realm, username, username field, password, and password field. the hostname, username and password attributes are mandatory, while the other fields are set based on whether the login is for a web page form or an http/ftp authentication site login. ...
...ame and password attributes are mandatory, while the other fields are set based on whether the login is for a web page form or an http/ftp authentication site login. see the nsilogininfo attribute def
initions for more details. ...
...ch as: http/1.0 401 authorization required server: apache/1.3.27 www-authenticate: basic realm="exampleco login" creating a local extension login var extlogininfo = new nslogininfo( 'chrome://firefoo', null, 'user registration', 'bob', '123secret', "", "" ); from a component creating a new info block is done slightly differently: var nslogininfo = new constructor("@org/manager/ci.
init"); var extlogininfo = new aformsubmiturl, ausername, ausernamefield, ...
nsIMimeConverter
uctured, in string mailcharset, in long fieldnamelen, in long encodedwordsize); string decodemimeheadertocharptr(in string header, in string default_charset, in boolean override_charset, in boolean eatcontinuations); astring decodemimeheader(in string header, in string default_charset, in boolean override_charset, in boolean eatcontinuations); mimeencoderdata *b64encoder
init(in mimeconverteroutputcallback output_fn, in void *closure); mimeencoderdata *qpencoder
init(in mimeconverteroutputcallback output_fn, in void *closure); void encoderdestroy(in mimeencoderdata *data, in boolean abort_p); long encoderwrite(in mimeencoderdata *data, in string buffer, in long size); methods encodemimepartiistr() an variant of encodemimepartiistr_...
... void setstringproperty(in string propertyname, in string propertyvalue); parameters propertyname the name of the property to set. propertyvalue the value of the property. decodemimeheader() string getstringproperty(in string propertyname); parameters propertyname the name of the property to retrieve. return value the value of the property. b64encoder
init() get an integer property. usually you would use this to store you own properties. unsigned long getuint32property(in string propertyname); parameters propertyname the name of the property to retrieve. thunderbird stored uint32 properties (not a complete list): indexed used for spotlight integration on osx. notaphishmessage indicates whether phisihing filters have been run on a...
...properties. unsigned long getuint32property(in string propertyname); parameters propertyname the name of the property to retrieve. thunderbird stored uint32 properties (not a complete list): indexed used for spotlight integration on osx. notaphishmessage indicates whether phisihing filters have been run on a message yet. return value the value of the property. qpencoder
init() void setuint32property(in string propertyname, in unsigned long propertyval); parameters propertyname the name of the property to set. propertyval the value of the property. encoderdestroy() marks this header as read. thunderbird provides a utility function which performs this for the currently selected message: markcurrentmessageasread(). void markread(in...
nsIMimeHeaders
?????????????????. to create an instance, use: implemented by: ????????????????????????????????????? as a service: var mimeheaders = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsimimeheaders); method overview string extractheader([const] in string headername, in boolean getallofthem); void
initialize([const] in string allheaders, in long allheaderssize); attributes attribute type description allheaders string read only. methods extractheader() string extractheader( [const] in string headername, in boolean getallofthem ); parameters headername missing description getallofthem missin...
... description allheaders string read only. ...
... allheaders string read only. ...
nsIPipe
xpcom/io/nsipipe.idlscriptable this interface represents an in-process buffer that can be read using nsiinputstream and written using nsioutputstream. ...
...entsize, in unsigned long segmentcount, in nsimemory segmentallocator); attributes attribute type description inputstream nsiasyncinputstream the pipe's input end, which also implements nsisearchableinputstream. read only. outputstream nsiasyncoutputstream the pipe's output end. read only. methods
init()
initialize this pipe. void
init( in boolean nonblockinginput, in boolean nonblockingoutput, in unsigned long segmentsize, in unsigned long segmentcount, in nsimemory segmentallocator ); parameters nonblockinginput true specifies non-blocking input stream behavior. nonblockingoutput true specifies non-blocking output stream behavior. segmentsize ...
...onblockinginput true specifies non-blocking input stream behavior. nonblockingoutput true specifies non-blocking output stream behavior. segmentsize specifies the segment size in bytes (pass 0 to use default value) segmentcount specifies the max number of segments (pass 0 to use default value). passing pr_uint32_max here causes the pipe to have "inf
inite" space. this mode can be useful in some cases, but should always be used with caution. the default value for this parameter is a f
inite value. segmentallocator pass reference to nsimemory to have all pipe allocations use this allocator (pass null to use the default allocator) remarks the reader and writer of a pipe do not have to be on the same thread. as a result, the pipe is an ...
nsIXPCException
js/src/xpconnect/idl/xpcexception.idlscriptable these exception objects are the preferred types of exceptions when implementing xpcom interfaces in javascript. ...
...return value native code only!stowjsval void stowjsval( in xpcexjscontextptr cx, in ...
...n last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void
initialize(in string amessage, in nsresult aresult, in string aname, in nsistackframe alocation, in nsisupports adata, in nsiexception ainner); xpcexjsval stealjsval(); native code only! void stowjsval(in xpcexjscontextptr cx, in xpcexjsval val); native code only! methods
initialize() void
initialize( in string amessage, in nsresult aresult, in string aname, in nsistackframe alocation, in nsisupports adata, in nsiexception ainner ); parameters amessage aresult aname alocation adata ainner native code only!stealjsval xpcexjsval stealjsval(); parameters none. return value native code only!stowjsval void stowjsval( in xpcexjscontextptr cx, in xpcexjsval val ); ...
XPIDL
lthough native declarations without parentheses are parsable, i do not trust that they are properly handled by the xpidl handlers) is a string equivalent to the c++ type. xpidl itself does not interpret this string, it just literally pastes it anywhere the native type is used. the interpretation of the type can be modified by having properties on the native declaration: table 3: native type def
initions astring this is an nsastring declaration. overrides native string. cstring this is an nsacstring declaration. overrides native string. jsval this type gets const when an in type. special in typelib. nsid this type gets const when an in type. special in typelib. ptr the type is really (native str)* ref the type is really (n...
... jscontext *cx comes before any other arguments. another native-only property is nostdcall. normally, declarations are made in the stdcall abi on windows to be abi-compatible with com interfaces. any non-scriptable method or attribute with nostdcall instead uses the thiscall abi convention. methods without this property generally use ns_imethod in their declarations and ns_imethodimp in their def
initions to automatically add in the stdcall declaration specifier on requisite compilers; those that use this method may use a plain `nsresult' instead. another property, infallible, is attribute-only. when present, it causes an infallible c++ getter function def
inition to be generated for the attribute alongside the normal fallible c++ getter declaration. it should only be used if the fallible gett...
... to use from script contexts and should therefore be avoided if reasonable. an inout parameter is an in parameter whose value may be changed as a result of the method; these parameters are rather annoying to use and should generally be avoided if at all possible. out and inout parameters are reflected as objects having the .value property which contains the real value of the parameter; it is not
initialized in the case of out parameters and is
initialized to the passed-in-value for inout parameters. the script code would need to set this property to assign a value to the parameter. regular in parameters are reflected more or less normally, with numeric types all representing numbers, booleans as true or false, the various strings (including astring et al) as a javascript string, and nsid type...
nsIMsgCloudFileProvider
nsimsgcloudfileprovider is the interface that must be implemented by new filelink providers. ...
...ldexceedquota 0x8055311b returned when uploading has failed because the user has exceeded their storage quota. uploadexceedsfilelimit 0x8055311c returned when uploading has failed because the file being uploaded is larger than the file size limit. uploadcanceled 0x8055311d returned when uploading has stopped because it was cancelled by the user. methods
init()
initializes an nsimsgcloudfileprovider to be associated with a particular account. this should probably be called immediately after instantiation. void
init(in string aaccountkey); parameters uploadfile() starts a file upload for this account. aaccountkey the account key that this instance of the nsimsgcloudfileprovider should be associated with. void uploadfile(in nsilocalfile afi...
... nsirequestobserver acallback); parameters aemailaddress the new user account email address. apassword the desired password for the new account. afirstname the new account holder's first name. alastname the new account holder's last name. acallback the nsirequestobserver for monitoring the start and stop states of the new account creation operation. createexistingaccount() for an
init'ed nsimsgcloudfileprovider, attempts to communicate with the service provider in order to get the proper credentials for starting uploads. void createexistingaccount(in nsirequestobserver acallback); parameters acallback the nsirequestobserver for monitoring the start and stop states of the creation operation. providerurlforerror() for an error code, for example uploadwouldexceedquota, ...
Index
elated programmatic interfaces. 9 address book sync client design by richard h. ...
...ben bucksch please do not change this document without consulting the author 11 autoconfig file format no summary! 12 autoconfig file format def
inition please see https://wiki.mozilla.org/thunderbird:autoconfiguration:configfileformat. 13 autoconfig: how to create a configuration file autoconfiguration, thunderbird authoritative def
inition 14 autoconfiguration in thunderbird moved to autoconfiguration 15 buddy icons in mail seth spitzer mozilla is now able to show icons in the message header area and the addressbook card pane. for the message pane, the icon we will show is on disk at: <profile home>/nim/<value of pref aim.session.screenname>/picture/<screenname for sender emai...
...message list examples thunderbird no summary! 48 message list interfaces thunderbird no summary! 50 spam filtering seth spitzer the mozilla implement is based on paul graham's a plan for spam. training data is global across all mail accounts within a profile training data is stored in a binary format, in a file named "training.dat".
initially, the training.dat file is empty (there was discussion of shipping with a default file) on spam detection, the user can choose to move spam to a special "junk" folder the user can configure junk mail can be automatically purged from the "junk" folder to analyze a message for spam, we need the entire message, not just the headers. spam detection happens after filters are run whi...
MailNews Filters
header. if one of the actions is a move, or a stop filter execution action, we move on to the next header; otherwise, we move on to the next filter. in the case of pop3, filter execution is synchronous. for each new header, we evaluate the filter criteria and apply the actions synchronously, including moving a message to an other local folder, and advance to the next header. for imap, we tend to
initiate the urls synchronously, but because we don't run two urls simultaneously on the same folder, the urls don't run until we've finished downloading headers. we also coalesce moves to the same destination folder, so that we can do them in one url/command to the server, and we playback those moves when the header download is done. after the fact filters these are one or more filters run on one...
... on the same folder, the urls don't run until we've finished downloading headers. we also coalesce moves to the same destination folder, so that we can do them in one url/command to the server, and we playback those moves when the header download is done. after the fact filters these are one or more filters run on one or more folders *after* the headers have been downloaded. these filters are
initiated in the filter editor, and implemented in nsmsgfilterservice.cpp. this is implemented by doing a search using the filter criteria and applying the actions en masse on the resulting hits. the search is executed locally, not on the server, so that criteria like "in address book" still work. how to add a filter action add your new action to nsimsgfilteraction add code to file out the new ac...
...ria like "in address book" still work. how to add a filter action add your new action to nsimsgfilteraction add code to file out the new action here add new action to the rulesactiontable add string for the new action to the filter editor dtd file add new action to the filter editor js code add new action to the xbl widget in the filter editor if your action has a parameter, add code to
initialize the ui editing an existing filter here and to save to the filter here add your action to filter.properties so it will show up in the filter log. finally, add protocol-specific code to apply your filter action in the various applyfilterhit methods imap pop3 news and "after the fact" since seamonkey and thunderbird share the filter code, you will also need to update the seamonkey .dtd and ...
libmime content type handlers
note: these will all register by their content type prefixed by the * following: mimecth:text/vcard * * libmime will then use nscomponentmanager::contractidtoclsid() to * locate the appropriate content type handler */ #ifndef nsimimecontenttypehandler_h_ #define nsimimecontenttypehandler_h_ typedef struct { prbool force_inline_display; } contenttypehandler
initstruct; #include "prtypes.h" #include "nsisupports.h" #include "mimecth.h" // {20dabd99-f8b5-11d2-8ee0-00a024a7d144} #define ns_imime_content_type_handler_iid \ { 0x20dabd99, 0xf8b5, 0x11d2, \ { 0x8e, 0xe0, 0x0, 0xa0, 0x24, 0xa7, 0xd1, 0x44 } } class nsimimecontenttypehandler : public nsisupports { public: static const nsiid& getiid() { static nsiid iid = ns_imime_content...
...the components directory for the bin directory). sample content type handler plugin to see an example of a content type handler p...
...the components directory for the bin directory). sample content type handler plugin to see an example of a content type handler plugin, the s...
Working with data
creating cdata objects data types for use with js-ctypes are represented by ctype objects. these are javascript constructors; as such, they're callable functions that you can use to create new cdata objects of that type. there are several ways you can go about creating new cdata objects. ...
...ating cdata objects without immediately assigning them a value: var mycdataobj = new type; var mycdataobj = new type(); var mycdataobj = type(); these all do the same thing: they return a new cdata object of the specified type, whose data buffer has been populated entirely with zeroes. note: if type.size is undefined, creating a new object this way will throw a typeerror exception. creating
initialized cdata objects similarly, you can
initialize cdata objects with specific values at the type of creation by specifying them as a parameter when calling the ctype's constructor, like this: var mycdataobj = new type(value); var mycdataobj = type(value); if the size of the specified type isn't undefined, the specified value is converted to the given type. if the conversion isn't possible, t...
... = library.declare("somecfunction", ctypes.default_abi, ctypes.void_t, ctypes.char.ptr.array() /*same as ctypes.char.ptr.ptr*/); somecfunction(myarray); line 1 declares a new array type, capable of containing 5 arrays of pointers to c characters. this might be an array of strings, for example. the next line instantiates an object of that type, creating a new array. each pointer in the array is
initialized to null. line 4 declares the c function that accepts the array as an input, and the last line calls that function. using arrays of non-pointers if a function expects an argument that is a pointer to a list of elements, this is how it is accomplished: var myarraytype = ctypes.char.array(5); var myarray = myarraytype(); var somecfunction = library.declare("somecfunction", ctypes.default_...
Gecko Plugin API Reference - Plugins
d receiving streams working with urls getting version and ui information displaying messages on the status line making plug-ins scriptable building plug-ins building, platforms, and compilers building carbonized plug-ins for mac os x type libraries installing plug-ins native installers xpi plug-ins installations plug-in installation and the windows registry
initialization and destruction
initialization instance creation instance destruction shutdown
initialize and shutdown example drawing and event handling the npwindow structure drawing plug-ins printing the plug-in setting the window getting information windowed plug-ins mac os windows unix event handling for windowed plug-ins windowless plug-ins ...
...able from the plug-in object. the names of all of these methods begin with npp_ to indicate that they are implemented by the plug-in and called by the browser. for an overview of how these two sides of the plug-in api interact, see the how plug-ins work and overview of plug-in structure sections in the introduction. npp_destroy npp_destroystream npp_getvalue np_getvalue npp_handleevent np_
initialize npp_new npp_newstream npp_print npp_setvalue npp_setwindow np_shutdown npp_streamasfile npp_urlnotify npp_write npp_writeready browser side plug-in api this chapter describes methods in the plug-in api that are available from the browser. the names of all of these methods begin with npn_ to indicate that they are implemented by the browser and called by the plug-in. for an ov...
...ush requests that the browser free a specified amount of memory. npn_memfree deallocates a block of allocated memory. npn_newstream requests the creation of a new data stream produced by the plug-in and consumed by the browser. npn_pluginthreadasynccall thread-safe way to request that the browser calls a plug-in function on the browser or plug-in thread (the thread on which the plug-in was
initiated). npn_poppopupsenabledstate pops the popups-enabled state. npn_posturl posts data to a url. npn_posturlnotify posts data to a url, and receives notification of the result. npn_pushpopupsenabledstate pushes the popups-enabled state. npn_reloadplugins reloads all plug-ins in the plugins directory. npn_requestread requests a range of bytes for a seekable stream. npn_setvalue sets ...
Debugger.Object - Firefox Developer Tools
e == operator to recognize when two debugger.object instances refer to the same debuggee object, and place its own properties on a debugger.object instance to store metadata about particular debuggee objects. javascript code in different compartments can have different views of the same object. for example, in firefox, code in privileged compartments sees content dom element objects without redef
initions or extensions made to that object’s properties by content code. (in firefox terminology, privileged code sees the element through an “xray wrapper”.) to ensure that debugger code sees each object just as the debuggee would, each debugger.object instance presents its referent as it would be seen from a particular compartment. this “viewing compartment” is chosen to match the way the ...
...h debugger.object instance presents its referent as viewed from a particular compartment. given a debugger.object instanced and an objecto, the call d.makedebuggeevalue(o) returns a debugger.object instance that presentso as it would be seen by code ind’s compartment. decompile([pretty]) if the referent is a function that is debuggee code, return the javascript source code for a function def
inition equivalent to the referent function in its effect and result, as a string. ifpretty is present and true, produce indented code with line breaks. if the referent is not a function that is debuggee code, return undefined. call(this,argument, …) if the referent is callable, call it with the giventhis value andargument values, and return a completion value describing how the call completed.thi...
...o access debuggee objects through the standard cross-compartment wrappers, rather than via debugger.object’s reflection-oriented interfaces. this method makes it easier to gradually adapt large code bases to this debugger api: adapted portions of the code can use debugger.object instances, but use this method to pass direct object references to code that has not yet been updated. forcelexical
initializationbyname(binding) ifbinding is in an un
initialized state
initialize it to undefined and return true, otherwise do nothing and return false. source metadata generated from file: js/src/doc/debugger/debugger.object.md watermark: sha256:7ae16a834e0883a95b4e0d227193293f6b6e4e4dd812c2570372a39c4c04897b changeset: 5572465c08a9+ ...
AbortController.AbortController() - Web APIs
creates a new abortcontroller object instance. syntax var controller = new abortcontroller(); parameters none. examples in the following snippet, we aim to download a video using the fetch api. we first create a controller using the abortcontroller() constructor, then grab a reference to its associated abortsignal object using the abortcontroller.signal property. when the fetch request is
initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below). this associates the signal and controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener. var controller = new abortcontroller(); var signal = controller.signal; var downloadbtn = document.queryselector('.downlo...
... fetch(url, {signal}).then(function(response) { ... ...
...e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with an aborterror. you can find a full working example on github — see abort-api (see it running live also). specifications specification status comment domthe def
inition of 'abortcontroller()' in that specification. living standard
initial def
inition ...
AbortController.abort() - Web APIs
onsumption of any response body, and streams. syntax controller.abort(); parameters none. return value void. examples in the following snippet, we aim to download a video using the fetch api. we first create a controller using the abortcontroller() constructor, then grab a reference to its associated abortsignal object using the abortcontroller.signal property. when the fetch request is
initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below). this associates the signal and controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener. var controller = new abortcontroller(); var signal = controller.signal; var downloadbtn = document.queryselector('.downlo...
... fetch(url, {signal}).then(function(response) { ... ...
...(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with an aborterror. you can find a full working example on github — see abort-api (see it running live also). specifications specification status comment domthe def
inition of 'abort()' in that specification. living standard
initial def
inition ...
AbortController.signal - Web APIs
rt a dom request as desired. syntax var signal = abortcontroller.signal; value an abortsignal object instance. examples in the following snippet, we aim to download a video using the fetch api. we first create a controller using the abortcontroller() constructor, then grab a reference to its associated abortsignal object using the abortcontroller.signal property. when the fetch request is
initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below). this associates the signal and controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener. var controller = new abortcontroller(); var signal = controller.signal; var downloadbtn = document.queryselector('.downlo...
... fetch(url, {signal}).then(function(response) { ... ...
...h(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with an aborterror. you can find a full working example on github — see abort-api (see it running live also). specifications specification status comment domthe def
inition of 'signal' in that specification. living standard
initial def
inition ...
AbortController - Web APIs
est before it has completed. this is able to abort fetch requests, consumption of any response body, and streams. examples in the following snippet, we aim to download a video using the fetch api. we first create a controller using the abortcontroller() constructor, then grab a reference to its associated abortsignal object using the abortcontroller.signal property. when the fetch request is
initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below). this associates the signal and controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener. var controller = new abortcontroller(); var signal = controller.signal; var downloadbtn = document.queryselector('.downlo...
...l}).then(function(response) { ... ...
....textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with a domexception named aborterror. you can find a full working example on github — see abort-api (see it running live also). specifications specification status comment domthe def
inition of 'abortcontroller' in that specification. living standard
initial def
inition ...
AbortSignal.aborted - Web APIs
rty). ...
...ted using the aborted property, and send an appropriate log to the console. ...
...he aborted property, and send an appropriate log to the console. ...
AesCtrParams - Web APIs
this extra block is called the "counter block". a given counter block value must never be used more than once with the same key: given a message n blocks long, a different counter block must be used for every block. if the same key is used to encrypt more than one message, a different counter block must be used for all blocks across all messages. typically this is achieved by splitting the
initial counter block value into two concatenated parts: a nonce (that is, a number that may only be used once). the nonce part of the block stays the same for every block in the message. each time a new message is to be encrypted, a new nonce is chosen. nonces don't have to be secret, but they must not be reused with the same key. a counter. this part of the block gets incremented each time a blo...
...h time a block is encrypted. essentially: the nonce should ensure that counter blocks are not reused from one message to the next, while the counter should ensure that counter blocks are not reused within a single message. note: see appendix b of the nist sp800-38a standard for more information. properties name a domstring. this should be set to aes-ctr. counter a buffersource — the
initial value of the counter block. this must be 16 bytes long (the aes block size). the rightmost length bits of this block are used for the counter, and the rest is used for the nonce. for example, if length is set to 64, then the first half of counter is the nonce and the second half is used for the counter. length a number — the number of bits in the counter block that are used for the actual ...
...is m bits long, then the following must be true: n <= 2m. the nist sp800-38a standard, which defines ctr, suggests that the counter should occupy half of the counter block (see appendix b.2), so for aes it would be 64. examples see the examples for subtlecrypto.encrypt() and subtlecrypto.decrypt(). specifications specification status comment web cryptography apithe def
inition of 'subtlecrypto.aesctrparams' in that specification. recommendation ...
Animation.pause() - Web APIs
the pause() method of the web animations api's animation interface suspends playback of the animation. syntax animation.pause(); parameters none. return value none. exceptions invalidstateerror the animation's currenttime is unresolved (for example, if it's never been played or isn't currently playing) and the end time of the animation is positive inf
inity. throws an invalidstateerror if the animation's currenttime is unresolved (perhaps it hasn't started playing yet) and the end time of the animation is positive inf
inity. example animation.pause() is used many times in the alice in web animations api land growing/shrinking alice game, largely because animations created with the element.animate() method immediately start playing and must be paused manually if you want to avo...
...cake.addeventlistener("mouseup", stopplayinga...
... 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. ...
...te 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. ...
...ould 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 def
inition of 'animation.replacestate' in that specification. working draft ...
Animation - Web APIs
nd sets the animationeffectreadonly associated with this animation. this will usually be a keyframeeffect object. animation.finished read only returns the current finished promise for this animation. animation.id gets and sets the string used to identify the animation. animation.pending read only indicates whether the animation is currently waiting for an asynchronous operation such as
initiating playback or pausing a running animation. animation.playstate read only returns an enumerated value describing the playback state of an animation. animation.playbackrate gets or sets the playback rate of the animation. animation.ready read only returns the current ready promise for this animation. animation.replacestate returns the replace state of the animation. this will be...
... 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 first synchronizing its playback position. automatically removing filling animations it is possible to trigger a large number of animations on the same element. if they are indef
inite (i.e., forwards-filling), this can result in a huge animations list, which could create a memory leak. for this reason, modern browsers have implemented the part of the web animations spec that automatically removes overriding forward filling animations, unless the developer explicitly specifies to keep them. you can see this in action in our simple replace indef
inite animations demo. the relat...
... designing safer web animation for motion sensitivity · an a list apart article an introduction to the reduced motion media query | css-tricks responsive design for motion | webkit mdn understanding wcag, guideline 2.2 explanations understanding success criterion 2.2.2 | w3c understanding wcag 2.0 specifications specification status comment web animationsthe def
inition of 'animation' in that specification. working draft
initial def
inition ...
DOMTokenList - Web APIs
utomatically trim any excess whitespace and remove duplicate values from the list. ...
...m 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: specifications specification status comment domthe def
inition of 'domtokenlist' in that specification. living standard
initial def
inition ...
DataTransfer - Web APIs
rns a new datatransfer object. properties standard properties datatransfer.dropeffect gets the type of drag-and-drop operation currently selected or sets the operation to a new type. the value must be none, copy, link or move. datatransfer.effectallowed provides all of the types of operations that are possible. must be one of none, copy, copylink, copymove, link, linkmove, move, all or un
initialized. datatransfer.files contains a list of all the local files available on the data transfer. if the drag operation doesn't involve dragging files, this property is an empty list. datatransfer.items read only gives a datatransferitemlist object which is a list of all of the drag data. datatransfer.types read only an array of strings giving the formats that were set in the dragstart ev...
...ray of strings giving the formats that were set in the dragstart event. gecko properties note: all of the properties in this section are gecko-specific. datatransfer.mozcursor gives the drag cursor's state. this is primarily used to control the cursor during tab drags. datatransfer.mozsourcenode read only the node over which the mouse cursor was located when the button was pressed to
initiate the drag operation. this value is null for external drags or if the caller can't access the node. datatransfer.mozusercancelled 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 lo...
...the range from 0 to the number of items minus one, an empty string list is returned. removed in firefox 71. 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. specifications specification status comment html living standardthe def
inition of 'datatransfer' in that specification. living standard mozcursor, mozitemcount, mozsourcenode, mozusercancelled, addelement(), mozcleardataat(), mozgetdataat(), mozsetdataat() and moztypesat are gecko specific. html 5.1the def
inition of 'datatransfer' in that specification. recommendation not included in w3c html5 recommendation ...
DeviceLightEvent.value - Web APIs
the value property provides the current level of the ambient light. ...
... the value property provides the current level of the ambient light. ...
... the value property provides the current level of the ambient light. ...
DeviceMotionEventAcceleration - Web APIs
leration.x read only the amount of acceleration along the x axis. read only. ...
...otioneventacceleration.y read only the amount of acceleration along the y axis. read only. ...
...cceleration.y read only the amount of acceleration along the y axis. read only. ...
Document: DOMContentLoaded event - Web APIs
bubbles yes cancelable yes (although specified as a simple event that isn't cancelable) interface event event handler property none a different event, load, should be used only to detect a fully-loaded page. it is a common mistake to use load where domcontentloaded would be more appropriate. synchronous javascript pauses parsing of the dom. if you want the dom to get parsed as fast as possible after the user has requested the page, you can make your javascript asynchronous and optimize loading of stylesheets. ...
... recommendation ...
... recommendation ...
Document.createAttribute() - Web APIs
a attr node. exceptions invalid_character_err if the parameter contains invalid characters for xml attribute. ...
...te("my_attrib"); a.value = "newval"; node.setattributenode(a); console.log(node.getattribute("my_attrib")); // "newval" specifications specification status comment domthe def
inition of 'document.createattribute()' in that specification. living standard precised behavior with uppercase characters document object model (dom) level 3 core specificationthe def
inition of 'document.createattribute()' in that specification. obsolete no change. ...
...n status comment domthe def
inition of 'document.createattribute()' in that specification. living standard precised behavior with uppercase characters document object model (dom) level 3 core specificationthe def
inition of 'document.createattribute()' in that specification. obsolete no change. document object model (dom) level 2 core specificationthe def
inition of 'document.createattribute()' in that specification. obsolete no change. document object model (dom) level 1 specificationthe def
inition of 'document.createattribute()' in that specification. obsolete
initial def
inition. ...
Document.createElement() - Web APIs
don't use qualified names (like "html:a") with this method. ...
...onent example the following example snippet is taken from our expanding-list-web-component example (see it live also). in this case, our custom element extends the htmlulistelement, which represents the <ul> element. // create a class for the element class expandinglist extends htmlulistelement { constructor() { // always call super first in constructor super(); // constructor def
inition left out for brevity ... } } // define the new element customelements.define('expanding-list', expandinglist, { extends: "ul" }); if we wanted to create an instance of this element programmatically, we'd use a call along the following lines: let expandinglist = document.createelement('ul', { is : 'expanding-list' }) the new element will be given an is attribute whose value is the cus...
...w element will be given an is attribute whose value is the custom element's tag name. note: for backwards compatibility with previous versions of the custom elements specification, some browsers will allow you to pass a string here instead of an object, where the string's value is the custom element's tag name. specifications specification status comment domthe def
inition of 'document.createelement' in that specification. living standard ...
Document.currentScript - Web APIs
the document.currentscript property returns the <script> element whose script is currently being processed and isn't a javascript module. (for modules use import.meta instead.) it's important to note that this will not reference the <script> element if the code in the script is being called as a callback or event handler; it will only reference the element while it's
initially being processed. ...
...ed. ...
...le checks to see if the script is being executed asynchronously: if (document.currentscript.async) { console.log("executing asynchronously"); } else { console.log("executing synchronously"); } view live examples specifications specification status comment html living standardthe def
inition of 'document.currentscript' in that specification. living standard
initial def
inition ...
Document.readyState - Web APIs
document.body.appendchild(span); break; case "complete": // the page is fully loaded. ...
...} readystatechange as an alternative to domcontentloaded event // alternative to domcontentloaded event document.onreadystatechange = function () { if (document.readystate === 'interactive') {
initapplication(); } } readystatechange as an alternative to load event // alternative to load event document.onreadystatechange = function () { if (document.readystate === 'complete') {
initapplication(); } } readystatechange as event listener to insert or modify the dom before domcontentloaded document.addeventlistener('readystatechange', event => { if (event.target.readystate === 'interactive') {
initloader(); } else if (event.target.readystate === 'complete') {
initapp(); } }); specifications specification status comment html liv...
...} readystatechange as event listener to insert or modify the dom before domcontentloaded document.addeventlistener('readystatechange', event => { if (event.target.readystate === 'interactive') {
initloader(); } else if (event.target.readystate === 'complete') {
initapp(); } }); specifications specification status comment html living standardthe def
inition of 'document readiness' in that specification. living standard html 5.1the def
inition of 'document readiness' in that specification. recommendation html5the def
inition of 'document readiness' in that specification. recommendation
initial specification. ...
EffectTiming.fill - Web APIs
ion's effects are not applied to the element if the current time is outside the range of times during which the animation is running, while "forwards" ensures that once the animation's end time has been passed, the element will continue to be drawn in the state it was in at its last rendered frame. note that authors are discouraged from using fill modes to persist the effect of an animation indef
initely. see the alternatives to fill modes section below for approaches that are simpler and more performant. element.animate(), and keyframeeffect() accept an object of timing properties including fill. the value of fill corresponds directly to fill in effecttiming objects returned by gettiming() in animationeffect and keyframeeffect. syntax var timingproperties = { fill: "none" | "forwards" ...
... fill: 'forwards' } ); // set up the rabbit's animation to play on command by calling rabbitdownanimation.play() later var rabbitdownanimation = new animation(rabbitdownkeyframes, document.timeline); alternatives to fill modes fill modes are primarily provided as a means of representing the animation-fill-mode feature of css animations. when used to persist the effect of an animation indef
initely, however, they have a number of drawbacks: the forwards fill of an animation (or backwards fill if the animation is playing in reverse) will continue to override any changes to specified style indef
initely which can lead to confusing behavior. this is because animations take priority in the css cascade over normal author styles. in order to avoid leaking memory when many filling animations...
... working draft editor's draft. ...
EffectTiming.iterationStart - Web APIs
tart. the value of iterationstart corresponds directly to animationeffecttimingreadonly.iterationstart in timing objects returned by animationeffectreadonly, keyframeeffectreadonly, and keyframeeffect. syntax var timingproperties = { iterationstart = iterationnumber }; timingproperties.iterationstart = iterationnumber; value a floating-point value whose value is at least 0 and is not +inf
inity, indicating the offset into the number of iterations the animation sequence is to run at which to start animating. iterationstart represents the iteration index at which the animation effect begins as well as its progress through that iteration. usually you'll use a value between 0.0 and 1.0 to indicate an offset into the first run of the animation at which to begin the animation performance, b...
... into the number of iterations the animation sequence is to run at which to start animating. iterationstart represents the iteration index at which the animation effect begins as well as its progress through that iteration. usually you'll use a value between 0.0 and 1.0 to indicate an offset into the first run of the animation at which to begin the animation performance, but any positive, non-inf
inite value is allowed. since all animations' iteration indexes start at 0, a value of 0.5 would start the animation halfway through its first iteration or loop. meanwhile, a value of 1.2 means the animation will begin playback 20% of the way through its second iteration, and so forth. it's currently undefined what happens if you specify a value of iterationstart which is greater than the value of a...
...h. it's currently undefined what happens if you specify a value of iterationstart which is greater than the value of animationeffecttimingproperties.iterations. see issue 170 in the web animations api specification's issue tracker for details and status of any changes to the specification in this regard. specifications specification status comment web animationsthe def
inition of 'iterationstart' in that specification. working draft editor's draft. ...
Element.attributes - Web APIs
obsolete no change from document object model (dom) level 2 core specification document object mode...
...;"> <input id="result" type="text" value=""> </p> </form> </body> </html> specifications specification status comment domthe def
inition of 'element.attributes' in that specification. living standard from document object model (dom) level 3 core specification, moved from node to element document object model (dom) level 3 core specificationthe def
inition of 'element.attributes' in that specification. obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe def
inition of 'element.attributes' in that specification. obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationt...
... 'element.attributes' in that specification. obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe def
inition of 'element.attributes' in that specification. obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe def
inition of 'element.attributes' in that specification. obsolete
initial def
inition. ...
Element: mousedown event - Web APIs
the mousedown event is fired at an element when a pointing device button is pressed while the pointer is inside the element. note: this differs from the click event in that click is fired after a full click action occurs; that is, the mouse button is pressed and released while the pointer remains inside the same element. mousedown is fired the moment the button is
initially pressed. bubbles yes cancelable yes interface mouseevent event handler property onmousedown examples the following example uses the mousedown, mousemove, and mouseup events to allow the user to draw on an html5 canvas. its functionality is simple: the thickness of the line is set to 1, and the color is always black. when the page loads, constants mypics and conte...
... obsolete ...
... obsolete ...
Element: mouseenter event - Web APIs
bubbles no cancelable no interface mouseevent event handler property onmouseenter usage notes though similar to mouseover, mouseenter differs in that it doesn't bubble and it isn't sent to any descendants when the pointer is moved from one of its descendants' physical space to its own physical space. one mouseenter event is sent to each element of the hierarchy when entering them. here 4 events are sent to the four elements of the hierarchy when the pointer reaches the text. ...
... obsolete ...
... obsolete ...
Element.requestFullscreen() - Web APIs
if the request fails, our promise's catch() handler presents an alert with an appropriate error message. ...
...iate error message. ...
...message. ...
Event() - Web APIs
the default is false. cancelable optional a boolean indicating whether the event can be cancelled. the default is false. composed optional a boolean indicating whether the event will trigger listeners outside of a shadow root (see event.composed for more details). the default is false. ...
...sed for more details). the default is false. ...
...ate a look event that bubbles up and cannot be canceled const evt = new event("look", {"bubbles":true, "cancelable":false}); document.dispatchevent(evt); // event can be dispatched from any element, not only the document mydiv.dispatchevent(evt); specifications specification status comment domthe def
inition of 'event()' in that specification. living standard
initial def
inition ...
Event - Web APIs
ions of microsoft internet explorer) for event.target. some other browsers are starting to support it for web compatibility purposes. event.target read only a reference to the target to which the event was originally dispatched. event.timestamp read only the time at which the event was created (in milliseconds). by specification, this value is time since epoch—but in reality, browsers' def
initions vary. in addition, work is underway to change this to be a domhighrestimestamp instead. event.type read only the name of the event. case-insensitive. event.istrusted read only indicates whether or not the event was
initiated by the browser (after a user click, for instance) or by a script (using an event creation method, like event.
initevent). deprecated properties event.scoped rea...
...s particular event, prevent all other listeners from being called. this includes listeners attached to the same element as well as those attached to elements that will be traversed later (during the capture phase, for instance). event.stoppropagation() stops the propagation of events further along in the dom. deprecated methods event.createevent() creates a new event, which must then be
initialized by calling its
initevent() method. event.
initevent()
initializes the value of an event created. if the event has already been dispatched, this method does nothing. event.getpreventdefault() returns the value of event.defaultprevented. event.preventbubble() prevents the event from bubbling. use event.stoppropagation instead. event.preventcapture() prevents the event fr...
...ady been dispatched, this method does nothing. event.getpreventdefault() returns the value of event.defaultprevented. event.preventbubble() prevents the event from bubbling. use event.stoppropagation instead. event.preventcapture() prevents the event from bubbling. use event.stoppropagation instead. specifications specification status comment domthe def
inition of 'event' in that specification. living standard ...
EventSource.onerror - Web APIs
handler called when an error occurs and the error event is dispatched on an eventsource object. ...
...hed on an eventsource object. ...
...ventsource object. ...
EventSource.onopen - Web APIs
dler called when an open event is received, that is when the connection was just opened. ...
...ection was just opened. ...
...just opened. ...
EventSource.url - Web APIs
mstring representing the url of the source. ...
... = eventsource.url; value a domstring representing the url of the source. ...
...rce.url; value a domstring representing the url of the source. ...
FormData() - Web APIs
ubmit!"> </form> note: only successful form controls are included in a formdata object, i.e. ...
...in a formdata object, i.e. ...
...ta object, i.e. ...
Gamepad.connected - Web APIs
erface returns a boolean indicating whether the gamepad is still connected to the system. ...
... to the system. if the gamepad is connected, the value is true; if not, it is false. ...
...tem. if the gamepad is connected, the value is true; if not, it is false. ...
Gamepad.mapping - Web APIs
ted known layout–the standard gamepad. ...
...ontrols on the device to that layout the mapping property will be set to the string standard. ...
...the device to that layout the mapping property will be set to the string standard. ...
Gamepad.timestamp - Web APIs
dering of updates, as newer values will always be greater than or equal to older values. ...
... older values. note: this property is not currently supported anywhere. ...
...es. note: this property is not currently supported anywhere. ...
GamepadButton.pressed - Web APIs
indicating whether the button is currently pressed (true) or unpressed (false). ...
.... ...
...var ispressed = navigator.getgamepads()[0].pressed; example var gp = navigator.getgamepads()[0]; // get the first gamepad object if(gp.buttons[0].pressed == true) { // respond to button being pressed } value a boolean. specifications specification status comment gamepadthe def
inition of 'gamepadbutton.pressed' in that specification. working draft
initial def
inition ...
GamepadEvent.gamepad - Web APIs
epad property being called on a fired window.gamepadconnected event. ...
...addeventlistener("gamepadconnected", function(e) { console.log("gamepad connected at index %d: %s. ...
...tener("gamepadconnected", function(e) { console.log("gamepad connected at index %d: %s. ...
GamepadEvent - Web APIs
%s. %d buttons, %d axes.", e.gamepad.index, e.gamepad.id, e.gamepad.buttons.length, e.gamepad.axes.length); }); and on a window.gamepaddisconnected event. ...
...ad.buttons.length, e.gamepad.axes.length); }); and on a window.gamepaddisconnected event. window.addeventlistener("gamepaddisconnected", function(e) { console.log("gamepad disconnected from index %d: %s", e.gamepad.index, e.gamepad.id); }); specifications specification status comment gamepadthe def
inition of 'gamepadevent' in that specification. ...
...length, e.gamepad.axes.length); }); and on a window.gamepaddisconnected event. window.addeventlistener("gamepaddisconnected", function(e) { console.log("gamepad disconnected from index %d: %s", e.gamepad.index, e.gamepad.id); }); specifications specification status comment gamepadthe def
inition of 'gamepadevent' in that specification. ...
GamepadHapticActuator - Web APIs
ough the gamepad.hapticactuators property. ...
....type read only returns an enum representing the type of the haptic hardware. ...
...only returns an enum representing the type of the haptic hardware. ...
GeolocationCoordinates.altitude - Web APIs
double representing the altitude of the position in meters, relative to sea level. ...
...evel. this value is null if the implementation cannot provide this data. ...
...value is null if the implementation cannot provide this data. ...
GeometryUtils - Web APIs
uads() returns a list of domquad objects representing the css fragments of the node. ...
...nts of the node. ...
...node. ...
GestureEvent - Web APIs
derives from uievent, which in turn derives from event. constructor gestureevent() creates a gestureevent object. properties this interface also inherits properties of its parents, uievent and event. gestureevent.rotation read only change in rotation (in degrees) since the event's beginning. positive values indicate clockwise rotation; negative values indicate anticlockwise rotation. ...
...nherits properties of its parents, uievent and event. gestureevent.rotation read only change in rotation (in degrees) since the event's beginning. positive values indicate clockwise rotation; negative values indicate anticlockwise rotation.
initial value: 0.0 gestureevent.scale read only distance between two digits since the event's beginning. expressed as a floating-point multiple of the
initial distance between the digits at the beginning of the gesture. values below 1.0 indicate an inward pinch (zoom out). values above 1.0 indicate an outward unpinch (zoom in).
initial value: 1.0 methods this interface also inherits methods of its parents, uievent and event. gestureevent.
initgestureevent()
initializes the value of an gestureevent. if the event has already being dispatched, th...
... nochrome android no support nofirefox android no support noopera android no support nosafari ios full support 2samsung internet android no support no
initgestureevent non-standardchrome no support noedge no support nofirefox no support noie no support noopera no support nosafari full support ...
GlobalEventHandlers.onanimationcancel - Web APIs
head and describe the animation in-place here because the animation is intended to begin as soon as the page loads, rather than based on an event. ...
... javascript before we get to the animation code, we define a function which logs information to a box on the user's screen. we'll use this to show information about the events we receive. ...
...none has the effect of aborting its animation. in browsers that support animationcancel, the event is fired and this handler is called. result assembled together, you get this: if your browser supports animationcancel, hiding the box using the button will cause a message to be displayed about the event. specification specification status comment css animationsthe def
inition of 'onanimationcancel' in that specification. working draft ...
GlobalEventHandlers.onanimationiteration - Web APIs
out animation. that's because we don't want the box to start animating right away. we'll add the animation style later to start animating the box. #box { width: var(--boxwidth); height: var(--boxwidth); left: 0; top: 0; border: 1px solid #7788ff; margin: 0; position: relative; background-color: #2233ff; display: flex; justify-content: center; animation: 2s ease-in-out 0s inf
inite alternate both paused slidebox; } the animation's keyframes are defined next; they describe an animation which causes the box to migrate from the top-left corner of the container to the bottom-right corner. @keyframes slidebox { from { left:0; top:0; } to { left:calc(100% - var(--boxwidth)); top:calc(100% - var(--boxwidth)) } } javascript some javascript code will n...
...let's have a look. var box = document.getelementbyid("box"); var iterationcounter = 0; box.onanimationiteration = function(event) { box.style.animationplaystate = "paused"; document.getelementbyid("play").innerhtml = "start iteration #" + (iterationcounter+1); }; this sets up two global variables: box, which references the "box" element that we're animating, and iterationcounter, which is
initially zero, which indicates how many iterations of the animation have occurred. the onanimationiteration event handler is then set up. it simply sets the box's animation-play-state to "paused", then updates the text displayed in the button to indicate that clicking the button will start playing the next iteration of theanimation. finally, we set up a handler for a click on the button that runs t...
...n-play-state to "running" and increments the iteration counter. that's all there is to it! result assembled together, you get this: each time the box reaches the opposing corner, it stops, with the button reflecting which iteration number is up next, until you click the button to run the next iteration. specification specification status comment css animationsthe def
inition of 'onanimationiteration' in that specification. working draft ...
GlobalEventHandlers.ondragend - Web APIs
dler(ev) { console.log("dragend"); // change the target element's background color to visually indicate // the drag ended. ...
... element's border back to green to signify a dragexit event ev.currenttarget.style.background = "green"; } function
init() { // set handlers for the source's enter/leave/end/exit events var el=document.getelementbyid("source"); el.ondragenter = dragenter_handler; el.ondragleave = dragleave_handler; el.ondragend = dragend_handler; el.ondragexit = dragexit_handler; } </script> <body onload="
init();"> <h1>examples of <code>ondragenter</code>, <code>ondragleave</code>, <code>ondragend</code>, <code>ondragexit</code></h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handle...
...d="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html living standardthe def
inition of 'ondragend' in that specification. living standard html 5.1the def
inition of 'ondragend' in that specification. recommendation
initial def
inition ...
GlobalEventHandlers.ondragenter - Web APIs
dler(ev) { console.log("dragend"); // change the target element's background color to visually indicate // the drag ended. ...
... element's border back to green to signify a dragexit event ev.currenttarget.style.background = "green"; } function
init() { // set handlers for the source's enter/leave/end/exit events var el=document.getelementbyid("source"); el.ondragenter = dragenter_handler; el.ondragleave = dragleave_handler; el.ondragend = dragend_handler; el.ondragexit = dragexit_handler; } </script> <body onload="
init();"> <h1>examples of <code>ondragenter</code>, <code>ondragleave</code>, <code>ondragend</code>, <code>ondragexit</code></h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handle...
...d="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html living standardthe def
inition of 'ondragenter' in that specification. living standard html 5.1the def
inition of 'ondragenter' in that specification. recommendation
initial def
inition ...
GlobalEventHandlers.ondragexit - Web APIs
dler(ev) { console.log("dragend"); // change the target element's background color to visually indicate // the drag ended. ...
... element's border back to green to signify a dragexit event ev.currenttarget.style.background = "green"; } function
init() { // set handlers for the source's enter/leave/end/exit events var el=document.getelementbyid("source"); el.ondragenter = dragenter_handler; el.ondragleave = dragleave_handler; el.ondragend = dragend_handler; el.ondragexit = dragexit_handler; } </script> <body onload="
init();"> <h1>examples of <code>ondragenter</code>, <code>ondragleave</code>, <code>ondragend</code>, <code>ondragexit</code></h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handle...
...="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html living standardthe def
inition of 'ondragexit' in that specification. living standard html 5.1the def
inition of 'ondragexit' in that specification. recommendation
initial def
inition ...
GlobalEventHandlers.ondragleave - Web APIs
console.log("dragend"); // change the target element's background color to visually indicate // the drag ended. ...
... background color back to green to signify a dragexit event ev.currenttarget.style.background = "green"; } function
init() { // set handlers for the source's enter/leave/end/exit events var el=document.getelementbyid("source"); el.ondragenter = dragenter_handler; el.ondragleave = dragleave_handler; el.ondragend = dragend_handler; el.ondragexit = dragexit_handler; } </script> <body onload="
init();"> <h1>examples of <code>ondragenter</code>, <code>ondragleave</code>, <code>ondragend</code>, <code>ondragexit</code></h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handle...
...="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html living standardthe def
inition of 'ondragleave' in that specification. living standard html 5.1the def
inition of 'ondragleave' in that specification. recommendation
initial def
inition ...
GlobalEventHandlers.onload - Web APIs
the onload property of the globaleventhandlers mixin is an eventhandler that processes load events on a window, xmlhttprequest, <img> element, etc. the load event fires when a given resource has loaded. syntax target.onload = functionref; value functionref is the handler function to be called when the window’s load event fires. ...
...links and sub-frames have finished loading. ...
...vents like domcontentloaded and domframecontentloaded (which can be handled using eventtarget.addeventlistener()) which are fired after the dom for the page has been constructed, but do not wait for other resources to finish loading. specifications specification status comment html living standardthe def
inition of 'onload' in that specification. living standard
initial def
inition ...
GlobalEventHandlers - Web APIs
ntransitionstart an eventhandler called when a transitionstart event is sent, indicating that a css transition has started transitioning. globaleventhandlers.onwaiting is an eventhandler representing the code to be called when the waiting event is raised. methods this interface defines no methods. ...
...lobaleventhandlers.onwaiting is an eventhandler representing the code to be called when the waiting event is raised. methods this interface defines no methods. specifications specification status comment selection apithe def
inition of 'extension to globaleventhandlers' in that specification. working draft adds onselectionchange. pointer lockthe def
inition of 'extension of document' in that specification. ...
...ction apithe def
inition of 'extension to globaleventhandlers' in that specification. working draft adds onselectionchange. pointer lockthe def
inition of 'extension of document' in that specification. candidate recommendation adds onpointerlockchange and onpointerlockerror on document. it is experimentally implemented on globaleventhandlers. html living standardthe def
inition of 'globaleventhandlers' in that specification. living standard no change since the latest snapshot, html 5.1. html 5.1the def
inition of 'globaleventhandlers' in that specification. recommendation snapshot of html living standard. added onsort since the html5 snapshot. html5the def
inition of 'globaleventhandlers' in that specification. recommendation snapsho...
HTMLAnchorElement - Web APIs
ns a usvstring containing the whole url. it is a synonym for htmlhyperlinkelementutils.href, though it can't be used to modify the value. the blur() and focus() methods are inherited from htmlelement from html5 on, but were defined on htmlanchorelement in dom level 2 html and earlier specifications. ...
... recommendation the methods blur() and focus(), as well as the properties tabindex and accesskey, are now defined on htmlelement. the following properties are now obsolete: charset, coords, name, rev, and shape. ...
... the methods blur() and focus(), as well as the properties tabindex and accesskey, are now defined on htmlelement. the following properties are now obsolete: charset, coords, name, rev, and shape. the following properties have been added: hash, host, hostname, media, pathname, port, protocol, rellist, search, and text. document object model (dom) level 2 html specificationthe def
inition of 'htmlanchorelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmlanchorelement' in that specification. obsolete
initial def
inition. ...
HTMLAreaElement.rel - Web APIs
between the resource represented by the <area> element and the current document. ...
...e current document. ...
...ocument. ...
HTMLBodyElement - Web APIs
handledrejection an eventhandler representing the code executed when the unhandledrejection event is raised, indicating that a promise was rejected but the rejection was not handled. windoweventhandlers.onunload is an eventhandler representing the code to be called when the unload event is raised. specifications specification status comment html living standardthe def
inition of 'htmlbodyelement' in that specification. living standard technically, the event-related properties onafterprint, onbeforeprint, onbeforeunload, onblur, onerror, onfocus, onhashchange, onlanguagechange, onload, onmessage, onoffline, ononline, onpopstate, onresize, onstorage, and onunload, have been moved to windoweventhandlers. htmlbodyelement implements this interface. html 5...
...tmlbodyelement' in that specification. living standard technically, the event-related properties onafterprint, onbeforeprint, onbeforeunload, onblur, onerror, onfocus, onhashchange, onlanguagechange, onload, onmessage, onoffline, ononline, onpopstate, onresize, onstorage, and onunload, have been moved to windoweventhandlers. htmlbodyelement implements this interface. html 5.1the def
inition of 'htmlbodyelement' in that specification. recommendation html5the def
inition of 'htmlbodyelement' in that specification. recommendation the following properties are now obsolete: alink, bgcolor, background, link, text, and vlink. the following properties have been added: onafterprint, onbeforeprint, onbeforeunload, onblur, onerror, onfocus, onhashchange, onload, onm...
...recommendation the following properties are now obsolete: alink, bgcolor, background, link, text, and vlink. the following properties have been added: onafterprint, onbeforeprint, onbeforeunload, onblur, onerror, onfocus, onhashchange, onload, onmessage, onoffline, ononline, onpopstate, onresize, onstorage, and onunload. document object model (dom) level 2 html specificationthe def
inition of 'htmlbodyelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmlbodyelement' in that specification. obsolete
initial def
inition. ...
HTMLButtonElement - Web APIs
ty() boolean not supported for reset or button elements. setcustomvalidity(in domstring error) void not supported for reset or button elements. with gecko-based browser, use the :-moz-submit-invalid pseudo-class to style submit buttons based on the validation of a form. specifications specification status comment html living standardthe def
inition of 'htmlbuttonelement' in that specification. living standard html 5.2the def
inition of 'htmlbuttonelement' in that specification. recommendation the menu attribute and type="menu" value have been removed. html 5.1the def
inition of 'htmlbuttonelement' in that specification. recommendation the following attribute has been added: menu. the type attribute ...
... recommendation the attributes tabindex and accesskey, are now defined on htmlelement. the following attributes have been added: autofocus, formaction, formenctype, formmethod, formnovalidate, formtarget, labels, validity, validationmessage, and willvalidate. ...
...ow defined on htmlelement. the following attributes have been added: autofocus, formaction, formenctype, formmethod, formnovalidate, formtarget, labels, validity, validationmessage, and willvalidate. the following methods have been added: checkvalidity(), setcustomvalidity(). the type attribute is no more read-only. document object model (dom) level 2 html specificationthe def
inition of 'htmlbuttonelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmlbuttonelement' in that specification. obsolete
initial def
inition. ...
HTMLDListElement - Web APIs
the htmldlistelement interface provides special properties (beyond those of the regular htmlelement interface it also has available to it by inheritance) for manipulating def
inition list (<dl>) elements. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 20%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 120" 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="#4d4e53" text-anchor="middle" alignment-baseline="middle">event...
...hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmldlistelement.compact is a boolean indicating that spacing between list items should be reduced. methods no specific methods; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmldlistelement' in that specification. living standard html5the def
inition of 'htmldlistelement' in that specification. recommendation no change from document object model (dom) level 2 html specification. document object model (dom) level 2 html specificationthe def
inition of 'htmldlistelement' in that specification. obsolete no change from document...
...mldlistelement' in that specification. recommendation no change from document object model (dom) level 2 html specification. document object model (dom) level 2 html specificationthe def
inition of 'htmldlistelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmldlistelement' in that specification. obsolete
initial def
inition. ...
HTMLDocument - Web APIs
ment-baseline="middle">htmldocument</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} for the purposes of web development, you can generally think of htmldocument as an alias for document, upon which htmldocument is based. you can find documentation for the members of htmldocument under the document interface. specifications html living standardthe def
inition of 'htmldocument' in that specification. living standard turn the htmldocument interface into a document extension. document object model (dom) level 2 html specificationthe def
inition of 'htmldocument' in that specification. obsolete supersedes dom 1 document object model (dom) level 1 specificationthe def
inition of 'htmldocument' in that specification. obsole...
... 'htmldocument' in that specification. living standard turn the htmldocument interface into a document extension. ...
...ent' in that specification. living standard turn the htmldocument interface into a document extension. document object model (dom) level 2 html specificationthe def
inition of 'htmldocument' in that specification. ...
HTMLElement: transitionstart event - Web APIs
...
... ...
... fired'; }); the difference is that: transitionrun fires when the transition is created (i.e. at the start of any delay). transitionstart fires when the actual animation has begun (i.e. at the end of any delay). specifications specification status comment css transitionsthe def
inition of 'transitionstart' in that specification. working draft
initial def
inition. ...
HTMLElement - Web APIs
also available via the ontransitionend property. transitionrun fired when a css transition is first created. also available via the ontransitionrun property. transitionstart fired when a css transition has actually started. also available via the ontransitionstart property. specifications specification status comment css object model (cssom) view modulethe def
inition of 'htmlelement' in that specification. working draft added the following properties: offsetparent, offsettop, offsetleft, offsetwidth, and offsetheight. html living standardthe def
inition of 'htmlelement' in that specification. living standard added the following properties: translate, itemscope, itemtype, itemid, itemref, itemprop, properties, and itemvalue. added th...
... recommendation added the following properties: dataset, hidden, tabindex, accesskey, accesskeylabel, draggable, dropzone, contenteditable, iscontenteditable, contextmenu, spellcheck, commandtype, commandlabel, commandicon, commandhidden, commanddisabled, commandchecked, style, and all the onxyz properties. ...
... dataset, hidden, tabindex, accesskey, accesskeylabel, draggable, dropzone, contenteditable, iscontenteditable, contextmenu, spellcheck, commandtype, commandlabel, commandicon, commandhidden, commanddisabled, commandchecked, style, and all the onxyz properties. moved the id and classname properties to the element interface. document object model (dom) level 2 html specificationthe def
inition of 'htmlelement' in that specification. obsolete no change from document object model (dom) level 2 html specification document object model (dom) level 1 specificationthe def
inition of 'htmlelement' in that specification. obsolete
initial def
inition. ...
HTMLImageElement.loading - Web APIs
the htmlimageelement property loading is a string whose value provides a hint to the user agent that tells the browser how to handle loading images which are currently outside the window's visual viewport. this helps to optimize the loading of the document's contents by postponing loading the image until it's expected to be needed, rather than immediately during the
initial page load. syntax let imageloadscheduling = htmlimageelement.loading; htmlimageelement.loading = eagerorlazy; value a domstring providing a hint to the user agent as to how to best schedule the loading of the image to optimize page performance. the possible values are: eager the default behavior, eager tells the browser to load the image as soon as the <img> element is processed. lazy tells the user agent to hol...
...es are loaded eagerly (which is the default), every image in the document must be fetched before the load event can fire. by specifying the value lazy for loading, you prevent the image from delaying the load attribute by the amount of time it takes to request, fetch, and process the image. images whose loading attribute is set to lazy but are located within the visual viewport immediately upon
initial page load are loaded as soon as the layout is known, but their loads do not delay the firing of the load event. in other words, these images aren't loaded immediately when processing the <img> element, but are still loaded as part of the
initial page load. they justt don't affect the timing of the load event. that means that when load fires, it's possible that any lazy-loaded images located i...
... living standard ...
HTMLImageElement - Web APIs
recommendation a constru...
...2.jpg'; img2.alt = 'alt text'; document.body.appendchild(img2); // using first image in the document alert(document.images[0].src); specifications specification status comment css object model (cssom) view modulethe def
inition of 'extensions to htmlimageelement' in that specification. working draft added the x and y properties. html living standardthe def
inition of 'htmlimageelement' in that specification. living standard the following properties have been added: srcset, currentsrc and sizes. html5the def
inition of 'htmlimageelement' in that specification. recommendation a constructor (with 2 optional parameters) has been added. the following properties are now obsolete: name, border, align, hspace, vspace, and longdesc. t...
...th 2 optional parameters) has been added. the following properties are now obsolete: name, border, align, hspace, vspace, and longdesc. the following properties are now unsigned long, instead of long: height, and width. the following properties have been added: crossorigin, naturalwidth, naturalheight, and complete. document object model (dom) level 2 html specificationthe def
inition of 'htmlimgelement' in that specification. obsolete the lowsrc property has been removed. the following properties are now long, instead of domstring: height, width, hspace, and vspace. document object model (dom) level 1 specificationthe def
inition of 'htmlimgelement' in that specification. obsolete
initial def
inition. ...
HTMLInputElement: invalid event - Web APIs
recommendation ...
... recommendation ...
...ddeventlistener('invalid', logvalue) function logvalue(e) { log.textcontent += e.target.value } result specifications specification status comment html living standardthe def
inition of 'invalid event' in that specification. living standard html 5.1the def
inition of 'invalid event' in that specification. recommendation html5the def
inition of 'invalid event' in that specification. recommendation ...
HTMLSelectElement.autofocus - Web APIs
perty is a boolean that reflects the autofocus html attribute, which indicates whether the associated <select> element will get input focus when the page loads, unless the user overrides it. only one form-associated element in a document can have this attribute specified. if there are several, the first element with the attribute set inserted, usually the first such element on the page, get the
initial focus. setting this property doesn't set the focus to the associated <select> element: it merely tells the browser to focus to it when the element is inserted in the document. setting it after the insertion, that is most of the time after the document load, has no visible effect. syntaxedit abool = aselectelement.autofocus; // get the value of autofocus aselectelement.autofocus = abool; /...
... recommendation ...
... recommendation ...
HTMLSelectElement.remove() - Web APIs
obsolete document objec...
... </select> and changes it 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 def
inition of 'htmlselectelement.remove()' in that specification. living standard html5the def
inition of 'htmlselectelement.remove()' in that specification. recommendation is a snapshot of html living standard. document object model (dom) level 2 html specificationthe def
inition of 'htmlselectelement.remove()' in that specification. obsolete document object model (dom) level 1 specificationthe def
inition of 'htmlselectelement.remove()' in that specification. ...
...selectelement.remove()' in that specification. recommendation is a snapshot of html living standard. document object model (dom) level 2 html specificationthe def
inition of 'htmlselectelement.remove()' in that specification. obsolete document object model (dom) level 1 specificationthe def
inition of 'htmlselectelement.remove()' in that specification. obsolete
initial def
inition. ...
HTMLSelectElement.selectedIndex - Web APIs
...
... ...
...dex; // add that data to the <p> pelem.innerhtml = 'selectedindex: ' + index; }) specifications specification status comment html living standardthe def
inition of 'htmlselectelement' in that specification. living standard no change since the latest snapshot, html5. html5the def
inition of 'htmlselectelement' in that specification. recommendation
initial def
inition, snapshot of html living standard. ...
HTMLSelectElement.type - Web APIs
"select-one" if only one value can be selected. ...
...selected break; case 'select-one': // only one value may be selected break; default: // non-standard value (or this isn't a select element) } specifications specification status comment html living standardthe def
inition of 'htmlselectelement' in that specification. living standard no change from html5, the latest snapshot. html5the def
inition of 'htmlselectelement' in that specification. recommendation is a snapshot of html living standard. no change from document object model (dom) level 2 html specification. document object model (dom) level 2 html specificationthe def
inition of 'htmlselectelement' in that specification. obsolete no change from document object model (dom) level 1 specification. docum...
... recommendation is a snapshot of html living standard. no change from document object model (dom) level 2 html specification. document object model (dom) level 2 html specificationthe def
inition of 'htmlselectelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmlselectelement' in that specification. obsolete
initial def
inition. ...
HTMLStyleElement.media - Web APIs
obso...
...rt('linkedstyle: ' + document.getelementbyid('linkedstyle').media); // 'screen' alert('inlinestyle: ' + document.getelementbyid('inlinestyle').media); // 'screen, print' </script> </body> </html> specifications specification status comment html living standardthe def
inition of 'htmlstyleelement' in that specification. living standard html 5.1the def
inition of 'htmlstyleelement' in that specification. ...
...e: ' + document.getelementbyid('inlinestyle').media); // 'screen, print' </script> </body> </html> specifications specification status comment html living standardthe def
inition of 'htmlstyleelement' in that specification. living standard html 5.1the def
inition of 'htmlstyleelement' in that specification. recommendation html5the def
inition of 'htmlstyleelement' in that specification. recommendation document object model (dom) level 2 html specificationthe def
inition of 'htmlstyleelement' in that specification. obsolete document object model (dom) level 1 specificationthe def
inition of 'htmlstyleelement' in that specification. obsolete
initial def
inition. ...
HTMLTableCaptionElement - Web APIs
properties inherits properties from its parent, htmlelement. htmltablecaptionelement.align is a domstring which represents an enumerated attribute indicating alignment of the caption with respect to the table. methods no specific method; inherits properties from its parent, htmlelement. ...
...epresents an enumerated attribute indicating alignment of the caption with respect to the table. methods no specific method; inherits properties from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmltablecaptionelement' in that specification. living standard no change from html5. html5the def
inition of 'htmltablecaptionelement' in that specification. recommendation no change from document object model (dom) level 2 html specification, though align was formerly obsoleted. document object model (dom) level 2 html specificationthe def
inition of 'htmltablecaptionelement' in that specification. obsolete no change from document object model (dom) level 1 specification. ...
...commendation no change from document object model (dom) level 2 html specification, though align was formerly obsoleted. document object model (dom) level 2 html specificationthe def
inition of 'htmltablecaptionelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmltablecaptionelement' in that specification. obsolete
initial def
inition. ...
HTMLTableElement.insertRow() - Web APIs
tableref.insertrow(-1); // insert a cell in the row at index 0 let newcell = newrow.insertcell(0); // append a text node to the cell let newtext = document.createtextnode('new bottom row'); newcell.appendchild(newtext); } // call addrow() with the table's id addrow('my-table'); result specifications specification status comment html living standardthe def
inition of 'htmltableelement.insertrow()' in that specification. living standard document object model (dom) level 2 html specificationthe def
inition of 'htmltableelement.insertrow()' in that specification. obsolete specifies in more detail where the row is inserted. document object model (dom) level 1 specificationthe def
inition of 'htmltableelement.insertrow()' in tha...
...ow()' in that specification. living standard document object model (dom) level 2 html specificationthe def
inition of 'htmltableelement.insertrow()' in that specification. obsolete specifies in more detail where the row is inserted. ...
...at specification. living standard document object model (dom) level 2 html specificationthe def
inition of 'htmltableelement.insertrow()' in that specification. obsolete specifies in more detail where the row is inserted. ...
HTMLTemplateElement.content - Web APIs
the htmltemplateelement.content property returns a <template> element's template contents (a documentfragment). ...
...gment). ...
...lement = document.queryselector("#foo"); var documentfragment = templateelement.content.clonenode(true); specifications specification status comment html living standardthe def
inition of 'htmltemplateelement interface' in that specification. living standard html5the def
inition of 'htmltemplateelement interface' in that specification. recommendation
initial def
inition ...
Headers() - Web APIs
this can be a simple object literal with bytestring values; or an existing headers object. in the last case, the new headers object inherits its data from the existing headers object. ...
... is simple: var myheaders = new headers(); // currently empty you could add a header to this using headers.append: myheaders.append('content-type', 'image/jpeg'); myheaders.get('content-type'); // returns 'image/jpeg' or you can add the headers you want as the headers object is created. ...
...t is created. in the following snippet we create a new headers object, adding some headers by passing the constructor an
init object as an argument: var httpheaders = { 'content-type' : 'image/jpeg', 'accept-charset' : 'utf-8', 'x-my-custom-header' : 'zeke are cool' }; var myheaders = new headers(httpheaders); you can now create another headers object, passing it the first headers object as its
init object: var secondheadersobj = new headers(myheaders); secondheadersobj.get('content-type'); // would return 'image/jpeg' — it inherits it from the first headers object specifications specification status comment fetchthe def
inition of 'headers()' in that specification. living standard ...
IDBDatabase.close() - Web APIs
eb workers. syntax idbdatabase.close(); example // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // opening a database. ...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. ...
... 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. ...
IDBFactory.open() - Web APIs
recommendation indexed database api draft...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. ...
....</li>'; // store the result of opening the database in the db // variable. this is used a lot later on, for opening // transactions and suchlike. db = dbopenrequest.result; }; specifications specification status comment indexed database api 2.0the def
inition of 'open()' in that specification. recommendation indexed database api draftthe def
inition of 'open()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for an...
IDBObjectStore.add() - Web APIs
. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: ...
... 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. ...
...est = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the def
inition of 'add()' in that specification. recommendation indexed database api draftthe def
inition of 'add()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for and...
IDBObjectStore.autoIncrement - Web APIs
our database and add some data to an object store using add(). after the object store has been created, we log objectstore.autoincrement to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: ...
... 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 ...
... objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the def
inition of 'autoincrement' in that specification. recommendation indexed database api draftthe def
inition of 'autoincrement' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox...
IDBObjectStore.clear() - Web APIs
e in the following code snippet, we open a read/write transaction on our database and clear all the current data out of the object store using clear(). for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // clear all the data form the object store cleardata(); }; function cleardata() { // open a read/write db transaction, ready for clearing the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the success of the tran...
... 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 reque...
...storerequest = objectstore.clear(); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the def
inition of 'clear()' in that specification. recommendation indexed database api draftthe def
inition of 'clear()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for a...
IDBObjectStore.createIndex() - Web APIs
full working example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // two event handlers for opening the database. dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below. db = request.result; // run the displaydata() function to populate the task list with // all the to-do list data already in the idb displaydata(); }; // this handler fires when a new database is created and indicates // either that one has not been created before, or a new ve...
... 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 ...
...ateindex("month", "month", { unique: false }); objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", { unique: false }); }; specifications specification status comment indexed database api 2.0the def
inition of 'createindex()' in that specification. recommendation indexed database api draftthe def
inition of 'createindex()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox ...
IDBObjectStore.delete() - Web APIs
ead/write transaction on our database and delete one specific record out of our object store using delete() — a sample record with the key "walk dog". for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // run the deletedata() function to delete a record from the database deletedata(); }; function deletedata() { // open a read/write db transaction, ready for deleting the data var transaction = db.transaction(["todolist"], "readwrite"); // report on ...
... 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 req...
... = objectstore.delete("walk dog"); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the def
inition of 'delete()' in that specification. recommendation indexed database api draftthe def
inition of 'delete()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for ...
IDBObjectStore.deleteIndex() - Web APIs
this is used a lot below db = this.result; // run the displaydata() function to populate the task list with all the to-do list data already in the idb displaydata(); }; // this event handles the event whereby a new version of the database needs to be created // either one has not been created before, or a ne...
... 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 ...
...ar", "year", { unique: false }); objectstore.createindex("notified", "notified", { unique: false }); objectstore.deleteindex("seconds"); objectstore.deleteindex("contact"); }; specifications specification status comment indexed database api 2.0the def
inition of 'deleteindex()' in that specification. recommendation indexed database api draftthe def
inition of 'deleteindex()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox...
IDBObjectStore.get() - Web APIs
is data object is retrieved, you could then update it using normal javascript, then put it back into the database using a idbobjectstore.put operation. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the getdata() function to get the data from the database getdata(); }; function getdata() { // open a read/write db transaction, ready for retrieving the data var transaction = db.transaction(["todolist"], "readwrite"); // report on the s...
... 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. ...
...orerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; var myrecord = objectstorerequest.result; }; }; specifications specification status comment indexed database api 2.0the def
inition of 'get()' in that specification. recommendation indexed database api draftthe def
inition of 'get()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for and...
IDBObjectStore.indexNames - Web APIs
on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.indexnames to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = this.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, not...
... 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...
...t = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the def
inition of 'indexnames' in that specification. recommendation indexed database api draftthe def
inition of 'indexnames' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox fo...
IDBObjectStore.keyPath - Web APIs
on on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.keypath to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: ...
... 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 reque...
...uest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the def
inition of 'keypath' in that specification. recommendation indexed database api draftthe def
inition of 'keypath' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for a...
IDBObjectStore.name - Web APIs
ction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.name to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: ...
... 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...
...request = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the def
inition of 'name' in that specification. recommendation indexed database api draftthe def
inition of 'name' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for andr...
IDBObjectStore.transaction - Web APIs
n our database and add some data to an object store using add(). after the object store has been created, we log objectstore.transaction to the console. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready to insert into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: ...
... 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 pu...
... = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { // report the success of our request note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the def
inition of 'transaction' in that specification. recommendation indexed database api draftthe def
inition of 'transaction' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox f...
IDBObjectStore - Web APIs
the data structure with idbobjectstore.createindex inside an onupgradeneeded function, to adding a new item to our object store with idbobjectstore.add. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in db. db = dbopenrequest.result; }; // this event handles the event whereby a new version of // the database needs to be created either one has not // been created before, or a new version number has been // submitted via the window.indexeddb.open line above dbopenrequest.onupgradeneeded = function(event) { var db = event.target.
... 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 ...
...ject to the object store var objectstorerequest = objectstore.add(newitem[0]); objectstorerequest.onsuccess = function(event) { note.innerhtml += '<li>request successful .</li>'; } specifications specification status comment indexed database api 2.0the def
inition of 'idbobjectstore' in that specification. recommendation indexed database api draftthe def
inition of 'idbobjectstore' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox...
IDBRequest - Web APIs
the idbrequest interface of the indexeddb api provides access to results of asynchronous requests to databases and database objects using event handler attributes. each reading and writing operation on a database is done using a request. the request object does not
initially contain any information about the result of the operation, but once information becomes available, an event is fired on the request, and the information becomes available through the properties of the idbrequest instance. all asynchronous operations immediately return an idbrequest instance. each request has a readystate that is set to the 'pending' state; this changes to 'done' when the request is completed or fails. when the state is set to done, every request returns a result and an error, and an event is fired on ...
... recommendation ...
...ccessfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database. db = dbopenrequest.result; }; specifications specification status comment indexed database api 2.0the def
inition of 'idbrequest' in that specification. recommendation
initial def
inition. indexed database api draftthe def
inition of 'idbrequest' in that specification. recommendation ...
IDBTransaction.abort() - Web APIs
f the transaction opening in the event of success or failure. at the end, we simply abort any activity done under the current transaction using abort(). for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", ye...
... 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.
...ed successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; // abort the transaction we just did transaction.abort(); }; specification specification status comment indexed database api 2.0the def
inition of 'abort()' in that specification. recommendation indexed database api draftthe def
inition of 'abort()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for and...
IDBTransaction.db - Web APIs
report on the outcome of the transaction opening in the event of success or failure. at the end, we return the associated database connection using db. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december...
... 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. deskt...
...transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; // return the database (idbdatabase) connection with which this transaction is associated transaction.db; }; specification specification status comment indexed database api 2.0the def
inition of 'db' in that specification. recommendation indexed database api draftthe def
inition of 'db' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androi...
IDBTransaction.error - Web APIs
action.onerror = function(event) { }; block, making use of transaction.error to help in reporting what went wrong when the transaction was unsuccessful. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december...
... 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...
...f the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the def
inition of 'error' in that specification. recommendation indexed database api draftthe def
inition of 'error' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for andr...
IDBTransaction.mode - Web APIs
on the outcome of the transaction opening in the event of success or failure. at the end, we simply log the mode of the current transaction using mode. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december...
... 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...
...ction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; // return the mode this transaction has been opened in (should be "readwrite" in this case) transaction.mode; }; specification specification status comment indexed database api 2.0the def
inition of 'mode' in that specification. recommendation indexed database api draftthe def
inition of 'mode' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for andr...
IDBTransaction.objectStore() - Web APIs
. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december...
... 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...
...est (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; specification specification status comment indexed database api 2.0the def
inition of 'objectstore()' in that specification. recommendation indexed database api draftthe def
inition of 'objectstore()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox ...
IDBTransaction.onabort - Web APIs
opening in the event of success or failure. note the transaction.onabort = function(event) { }; block, reporting when the transaction has been aborted. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december...
... 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 reque...
...ort = function() { // report when the transaction was successfully aborted console.log("transaction aborted!"); }; // abort the transaction we just did transaction.abort(); }; specification specification status comment indexed database api 2.0the def
inition of 'onabort' in that specification. recommendation indexed database api draftthe def
inition of 'onabort' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for a...
IDBTransaction.oncomplete - Web APIs
n the event of success or failure. note the transaction.oncomplete = function(event) { }; block, which reports back when the transaction was successful. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december...
... 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 r...
...request (this does not mean the item // has been stored successfully in the db - for that you need transaction.oncomplete) note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the def
inition of 'oncomplete' in that specification. recommendation indexed database api draftthe def
inition of 'oncomplete' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for...
IDBTransaction.onerror - Web APIs
action.onerror = function(event) { }; block, making use of transaction.error to help in reporting what went wrong when the transaction was unsuccessful. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the adddata() function to add the data to the database adddata(); }; function adddata() { // create a new object ready for being inserted into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december...
... 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...
...the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; }; specification specification status comment indexed database api 2.0the def
inition of 'onerror' in that specification. recommendation indexed database api draftthe def
inition of 'onerror' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for an...
IDBTransaction - Web APIs
. note also the functions attached to transaction event handlers to report on the outcome of the transaction opening in the event of success or failure. for a full working example, see our to-do notifications app (view example live.) // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db // variable. this is used a lot below db = dbopenrequest.result; // add the data to the database adddata(); }; function adddata() { // create a new object to insert into the idb var newitem = [ { tasktitle: "walk dog", hours: 19, minutes: 30, day: 24, month: "december", year: 2013, notified: "no" } ]; // open...
... 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...
... // report the success of the request (this does not mean the item // has been stored successfully in the db - for that you need transaction.oncomplete) note.innerhtml += '<li>request successful.</li>'; }; }; specifications specification status comment indexed database api 2.0the def
inition of 'idbtransaction' in that specification. recommendation
initial def
inition indexed database api draftthe def
inition of 'idbtransaction' in that specification. 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. desktopmobilechromeedgefirefoxinterne...
IDBVersionChangeEvent.newVersion - Web APIs
recommendation indexed database api draftt...
... recommendation browser compatibility the compatibility table on this page is generated from structured data. ...
...d.</li>'; // store the result of opening the database in the db variable. // this is used a lot later on, for opening transactions and suchlike. db = dbopenrequest.result; }; specifications specification status comment indexed database api 2.0the def
inition of 'newversion' in that specification. recommendation indexed database api draftthe def
inition of 'newversion' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox fo...
IIRFilterNode() - Web APIs
syntax var iirfilternode = new iirfilternode(context, options) parameters inherits parameters from the audionodeoptions dictionary. context a reference to an audiocontext. options options are as follows: feedforward: a sequence of feedforward coefficients. feedback: a sequence of feedback coefficients. unlike other nodes in the web audio api, the options passed into the iir filter upon creation are not optional. ...
... 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome...
...9991880801, 0.9873035442]; const audiocontext = window.audiocontext || window.webkitaudiocontext; const audioctx = new audiocontext(); const iirfilter = new iirfilternode(audioctx, { feedforward: feedforward, feedback: feedbackward }); specifications specification status comment web audio apithe def
inition of 'iirfilternode()' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung int...
MouseEvent.button - Web APIs
it should behave as if the left button was clicked in the standard button layout. note: do not confuse this property with the mouseevent.buttons property, which indicates which buttons are pressed for all mouse events types. syntax var buttonpressed = instanceofmouseevent.button return value a number representing a given button: 0: main button pressed, usually the left button or the un-
initialized state 1: auxiliary button pressed, usually the wheel button or the middle button (if present) 2: secondary button pressed, usually the right button 3: fourth button, typically the browser back button 4: fifth button, typically the browser forward button as noted above, buttons may be configured differently to the standard "left to right" layout. a mouse configured for left-handed use...
... ...
... } } } result specifications specification status comment document object model (dom) level 3 events specificationthe def
inition of 'mouseevent.button' in that specification. obsolete compared to document object model (dom) level 2 events specification, the return value can be negative. document object model (dom) level 2 events specificationthe def
inition of 'mouseevent.button' in that specification. obsolete
initial def
inition. ...
MouseEvent.offsetY - Web APIs
of the mouse pointer between that event and the padding edge of the target node. ...
... target node. ...
...e. ...
MouseEvent.screenX - Web APIs
ou can get the coordinates of that event (e.g., a click) and route it properly, as the following example demonstrates: function checkclickmap(e) { if (e.screenx < 50) doredbutton(); if (50 <= e.screenx && e.screenx < 100) doyellowbutton(); if (e.screenx >= 100) doredbutton(); } specifications specification status comment css object model (cssom) view modulethe def
inition of 'screenx' in that specification. working draft redefines mouseevent from long to double. document object model (dom) level 3 events specificationthe def
inition of 'mouseevent.screenx' in that specification. obsolete no change from document object model (dom) level 2 events specification. document object model (dom) level 2 events specificationthe def
inition of ...
... redefines mouseevent from long to double. document object model (dom) level 3 events specificationthe def
inition of 'mouseevent.screenx' in that specification. obsolete no change from document object model (dom) level 2 events specification. ...
... mouseevent from long to double. document object model (dom) level 3 events specificationthe def
inition of 'mouseevent.screenx' in that specification. obsolete no change from document object model (dom) level 2 events specification. ...
MouseEvent.screenY - Web APIs
p id="screen-log"></p> javascript let screenlog = document.queryselector('#screen-log'); document.addeventlistener('mousemove', logkey); function logkey(e) { screenlog.innertext = ` screen x/y: ${e.screenx}, ${e.screeny} client x/y: ${e.clientx}, ${e.clienty}`; } result specifications specification status comment css object model (cssom) view modulethe def
inition of 'screeny' in that specification. working draft redefines mouseevent from long to double. document object model (dom) level 3 events specificationthe def
inition of 'mouseevent.screeny' in that specification. obsolete no change from document object model (dom) level 2 events specification. document object model (dom) level 2 events specificationthe def
inition of ...
... redefines mouseevent from long to double. document object model (dom) level 3 events specificationthe def
inition of 'mouseevent.screeny' in that specification. obsolete no change from document object model (dom) level 2 events specification. ...
... mouseevent from long to double. document object model (dom) level 3 events specificationthe def
inition of 'mouseevent.screeny' in that specification. obsolete no change from document object model (dom) level 2 events specification. ...
MouseEvent.x - Web APIs
the mouseevent.x property is an alias for the mouseevent.clientx property. ...
... the mouseevent.x property is an alias for the mouseevent.clientx property. ...
... the mouseevent.x property is an alias for the mouseevent.clientx property. ...
MouseScrollEvent - Web APIs
the mousescrollevent interface represents events that occur due to the user moving a mouse wheel or similar input device. do not use this interface for wheel events. like mousewheelevent, this interface is non-standard and deprecated. it was used in gecko-based browsers only. instead use the standard wheelevent. ...
... ...
... ...
NDEFWriter.write() - Web APIs
options optional ignoreread -- boolean specifying whether or not to skip reading for the activated reader objects. will be ignored if overwrite is false. ...
... ...
... ...
NameList - Web APIs
the collection is to be implemented. ...
...t.length read only methods namelist.contains() returns a boolean. ...
...ad only methods namelist.contains() returns a boolean. namelist.containsns() returns a boolean. ...
Navigation Timing API - Web APIs
nstart) from the time at which the load event handler returns (loadeventend). this gives you the perceived page load time. calculate request response time you can calculate the time elapsed between the beginning of a request and the completion of getting the response using code like this: const connecttime = perfdata.responseend - perfdata.requeststart; here, the time at which the request was
initiated (requeststart). from the time at which the response was finished being received (responseend). calculate page render time as another example of an interesting piece of data you can obtain using the navigation timing api that you can't otherwise easily get, you can get the amount of time it took to render the page: const rendertime = perfdata.domcomplete - perfdata.domloading; this is obt...
... ...
... ...
Navigator.connection - Web APIs
the navigator.connection read-only property returns a networkinformation object containing information about the system's connection, such as the current bandwidth of the user's device or whether the connection is metered. this could be used to select high def
inition content or low def
inition content based on the user's connection. ...
...ection, such as the current bandwidth of the user's device or whether the connection is metered. this could be used to select high def
inition content or low def
inition content based on the user's connection. syntax networkinformation = navigator.connection value a networkinformation object. ...
... the connection is metered. this could be used to select high def
inition content or low def
inition content based on the user's connection. syntax networkinformation = navigator.connection value a networkinformation object. ...
Navigator.cookieEnabled - Web APIs
in cookies in certain scenarios. ...
...ookies with samesite=none attribute, unless they are created over https and with secure attribute. ...
... samesite=none attribute, unless they are created over https and with secure attribute. ...
Navigator.doNotTrack - Web APIs
isers to not track them. the value of the property reflects that of the dnt http header, i.e. ...
... dnt http header, i.e. values of "1", "0", or "unspecified". ...
...eader, i.e. values of "1", "0", or "unspecified". ...
Navigator.geolocation - Web APIs
esults based on the user's location. ...
...age tries to access location information, the user is notified and asked to grant permission. ...
...o access location information, the user is notified and asked to grant permission. ...
RTCIceCandidate.port - Web APIs
the rtcicecandidate interface's read-only port property contains the port number on the device at the address given by ip at which the candidate's peer can be reached. as is the case with most of rtcicecandidate's properties, the value of port is extracted from the candidate a-line string specified when creating the rtcicecandidate. ...
... note: if port is null, passing the candidate to addicecandidate() will fail, throwing an operationerror exception. this applies only if the candidate implements port. ...
...ld, which is "44323". in this case, the value of port will be 44323. example this code snippet fetches the ip address and port number of the candidate, storing them into an object for future use. var candidateloc = { address: candidate.ip, port: candidate.port } specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcicecandidate.port' in that specification. candidate recommendation
initial def
inition. ...
RTCIceCandidate.usernameFragment - Web APIs
note that 24 bits of the username fragment are required to be randomized by the browser. ...
... ...
...ndicated in the candidate matches any of them. if it does, ssnewcandidate() aborts. otherwise, after checking every receiver, it adds the new candidate to the connection. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcicecandidate.usernamefragment' in that specification. candidate recommendation
initial def
inition. ...
RTCIceCandidate - Web APIs
ish an rtcpeerconnection. an ice candidate describes the protocols and routing needed for webrtc to be able to communicate with a remote device. when starting a webrtc peer connection, typically a number of candidates are proposed by each end of the connection, until they mutually agree upon one which describes the connection they decide will be best. webrtc then uses that candidate's details to
initiate the connection. for details on how the ice process works, see lifetime of a webrtc session. the article webrtc connectivity provides additional useful details. constructor rtcicecandidate() creates an rtcicecandidate object to represent a single ice candidate, optionally configured based on an object based on the rtcicecandidate
init dictionary. note: for backward compatibility, the con...
...c connectivity provides additional useful details. constructor rtcicecandidate() creates an rtcicecandidate object to represent a single ice candidate, optionally configured based on an object based on the rtcicecandidate
init dictionary. note: for backward compatibility, the constructor also accepts as input a string containing the value of the candidate property instead of a rtcicecandidate
init object, since the candidate includes all of the information that rtcicecandidate
init does and more. properties candidate read only a domstring representing the transport address for the candidate that can be used for connectivity checks. the format of this address is a candidate-attribute as defined in rfc 5245. this string is empty ("") if the rtcicecandidate is an "end of candidates" i...
...a randomly-generated password ("ice-pwd"). you can use this string to verify generations of ice generation; each generation of the same ice process will use the same usernamefragment, even across ice restarts. methods tojson() given the rtcicecandidate's current configuration, tojson() returns a domstring containing a json representation of that configuration in the form of a rtcicecandidate
init object. examples for examples, see the article signaling and video calling, which demonstrates the entire process. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcicecandidate' in that specification. candidate recommendation
initial def
inition. ...
RTCOfferAnswerOptions - Web APIs
...
... ...
...n the user is speaking and toggle muting on and off automatically, this option enables and disables that behavior. the default value is true, enabling this functionality specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcofferansweroptions' in that specification. candidate recommendation
initial def
inition. ...
RTCOutboundRtpStreamStats.qualityLimitationReason - Web APIs
...
... ...
...litylimitationreason enumerated type, and whose values are the duration of the media, in seconds, whose quality was reduced for that reason. examples specifications specification status comment identifiers for webrtc's statistics apithe def
inition of 'rtcoutboundrtpstreamstats.qualitylimitationreason' in that specification. candidate recommendation
initial def
inition. ...
RTCPeerConnection.addIceCandidate() - Web APIs
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); addicecandidate(candidate, successcallback, failurecallback); parameters candidate optional an object conforming to the rtcicecandidate
init dictionary, or an rtcicecandidate object; the contents of the object should be constructed from a message received over the signaling channel, describing a newly received ice candidate that's ready to be delivered to the local ice agent. if no candidate object is specified, or its value is null, an end-of-candidates signal is sent to the remote peer using the end-of-candidates a-line, formatted...
... ...
... ...
RTCPeerConnection.addTransceiver() - Web APIs
the rtcpeerconnection method addtransceiver() creates a new rtcrtptransceiver and adds it to the set of transceivers associated with the rtcpeerconnection. each transceiver represents a bidirectional stream, with both an rtcrtpsender and an rtcrtpreceiver associated with it. syntax rtptransceiver = rtcpeerconnection.addtransceiver(trackorkind,
init); parameters trackorkind a mediastreamtrack to associate with the transceiver, or a domstring which is used as the kind of the receiver's track, and by extension of the rtcrtpreceiver itself.
init optional an object that conforms to the rtcrtptransceiver
init dictionary which provides any options that you may wish to specify when creating the new transceiver. possible values are: direction optional the new transceiver's preferred directi...
... sendencodings optional a list of encodings to allow when sending rtp media from the rtcrtpsender. each entry is of type rtcrtpencodingparameters. ...
... candidate recommendation ...
RTCPeerConnection.canTrickleIceCandidates - Web APIs
the read-only rtcpeerconnection property cantrickleicecandidates returns a boolean which indicates whether or not the remote peer can accept trickled ice candidates. ice trickling is the process of continuing to send candidates after the
initial offer or answer has already been sent to the other peer. this property is only set after having called rtcpeerconnection.setremotedescription(). 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. 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...
... ...
... ...
RTCPeerConnection: icecandidateerror event - Web APIs
...
... ...
... when creating the connection, this error may happen more than once, if more than one of those servers fails. each provided server is tried until a connection is established. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'icecandidateerror' in that specification. candidate recommendation
initial def
inition. ...
RTCPeerConnection.setLocalDescription() - Web APIs
diately 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 rtcsessiondescription
init 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-...
... 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 rtcsessiondescription
init, which is a serialized version of a rtcsessiondescription browser object. they're interchangeable: mypeerconnection.createoffer().then(function(offer) { return mypeerconnection.setlocaldescription(offer); }); this is equivalent to: mypeerconnection.createoffer().then(function(offer) { return mypeerconnection.setlocaldescription(new rtcsessiondescription(offer)); }); for this reason, the...
... begins by creating an offer by calling createoffer(); when that succeeds, we call setlocaldescription(). we can then send the newly-created offer along to the other peer using the signaling server, which here is done by calling a function called signalremotepeer(). specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcpeerconnection.setlocaldescription()' in that specification. candidate recommendation
initial specification. ...
RTCPeerConnectionIceEvent() - Web APIs
the rtcpeerconnectioniceevent() constructor creates a new rtcpeerconnectioniceevent. syntax var event = new rtcpeerconnectioniceevent(type, options); parameters type is a domstring containing the name of the event, like "icecandidate". options a dictionary of type rtcpeerconnection
init, which may contain one or more of the following fields: "candidate" (optional, default is null): a rtcicecandidate representing the ice candidate being concerned by the event. if null, the event indicates the end of candidate gathering. "url" (optional, default is null): the url of the stun or turn server which was used to gather the candidate. if the candidate was not gathered by a stun or turn server, this value must be null. "bubbles" (optional, default is false): inherited from eventini...
... "url" (optional, default is null): the url of the stun or turn server which was used to gather the candidate. if the candidate was not gathered by a stun or turn server, this value must be null. "bubbles" (optional, default is false): inherited from event
init(), this boolean option indicates whether or not the event must bubble. "cancelable" (optional, default is false, inherited from event
init(), this boolean indicates whether or not the event can be canceled. return value a newly-created rtcpeerconnectioniceevent, configured as specified in the provided options. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcpeerconnectioniceevent()' in that specification. candidate recommendatio...
...his boolean indicates whether or not the event can be canceled. return value a newly-created rtcpeerconnectioniceevent, configured as specified in the provided options. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcpeerconnectioniceevent()' in that specification. candidate recommendation
initial def
inition. ...
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
e. the difference is that remote-outbound-rtp describes statistics about the transmission(s) from the perspective of the remote peer, while inbound-rtp offers statistics about the incoming data from the local peer's perspective. you can examine, try out, and experiment with this example on glitch. example in this example, we have a pair of functions: the first, networkteststart(), captures an
initial report, and the second, networkteststop(), captures a second report, then uses the two reports to output some information about the network conditions... xxx ... networkteststart() this function simply calls the rtcpeerconnection method getstats() to request an rtcstatsreport and store it in the variable startreport. let startreport; async function networkteststart(pc) { if (pc) { st...
...div class="stats-entry"><h2>report id: ${endremoteoutbound.id}</h2>` + `remote peer sent ${packetssent} packets ${timestring}.<br>` + `${framestring}` + `data size: ${bytessent} bytes.</div>`; statsbox.innerhtml += logentry; } else { statsbox.innerhtml += `<div class="stats-error">unable to find
initial statistics for id ${endremoteoutbound.id}.</div>` } } statsbox.scrollto(0, statsbox.scrollheight); } } } here's what's going on in the networkteststop() function: after calling the rtcpeerconnection method getstats() to get the latest statistics report for the connection and storing it in endreport, this is an rtcstatsreport object, which maps strings taken from th...
...tely one second of time (since that's much time we're waiting between calling networkteststart() and networkteststop()). try it and fork it this example is available on glitch for you to try out, examine, or remix. you can also access it directly using glitch's git server. specifications specification status comment identifiers for webrtc's statistics apithe def
inition of 'rtcremoteoutboundrtpstreamstats.localid' in that specification. candidate recommendation
initial def
inition. ...
RTCRtpParameters - Web APIs
ers and receivers in the form of the rtcrtpsendparameters and rtcrtpreceiveparameters dictionaries. to obtain the parameters of a sender or receiver, call its getparameters() method: getparameters() getparameters() properties codecs an array of rtcrtpcodecparameters objects describing the set of codecs from which the sender or receiver will choose. this parameter cannot be changed once
initially set. headerextensions an array of zero or more rtp header extensions, each identifying an extension supported by the sender or receiver. header extensions are described in rfc 3550: 5.3.1. this parameter cannot be changed once
initially set. rtcp an rtcrtcpparameters object providing the configuration parameters used for rtcp on the sender or receiver. this parameter cannot be changed on...
...ly set. headerextensions an array of zero or more rtp header extensions, each identifying an extension supported by the sender or receiver. header extensions are described in rfc 3550: 5.3.1. this parameter cannot be changed once
initially set. rtcp an rtcrtcpparameters object providing the configuration parameters used for rtcp on the sender or receiver. this parameter cannot be changed once
initially set. examples this example obtains the canonical name (cname) being used for rtcp on an rtcrtpsender or rtcrtpreceiver. ...
...nnot be changed once
initially set. examples this example obtains the canonical name (cname) being used for rtcp on an rtcrtpsender or rtcrtpreceiver. function getrtpcname(rtpobject) { let parameters = rtpobject.getparameters(); return parameters.rtcp.cname; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcrtpreceiveparameters' in that specification. candidate recommendation
initial def
inition. ...
RadioNodeList - Web APIs
he radio buttons in the collection is in checked state, the empty string is returned. ...
... is returned. ...
...d. ...
Range.setStart() - Web APIs
...
... ...
...at fifth character document.getelementbyid('log').textcontent = range; result specifications specification status comment domthe def
inition of 'range.setstart()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.setstart()' in that specification. obsolete
initial specification. ...
ReadableByteStreamController - Web APIs
am's internal queue. methods readablebytestreamcontroller.close() closes the associated stream. ...
...ciated stream. readablebytestreamcontroller.enqueue() enqueues a given chunk in the associated stream. ...
...am. readablebytestreamcontroller.enqueue() enqueues a given chunk in the associated stream. ...
ReadableStreamBYOBRequest - Web APIs
ne. readablestreambyobrequest instance is created automatically by readablebytestreamcontroller as needed. ...
...mcontroller as needed. properties readablestreambyobrequest.view read only returns the current view. ...
... as needed. properties readablestreambyobrequest.view read only returns the current view. ...
Touch() - Web APIs
"target", required, of type eventtarget, the item at which the touch point started when it was first placed on the surface. "clientx", optional and defaulting to 0, of type double, that is the horizontal position of the touch on the client window of user's screen, excluding any scroll offset. ...
... ...
...level of pressure the touch device is capable of sensing; 0 if no value is known. in environments where force is known, the absolute pressure represented by the force attribute, and the sensitivity in levels of pressure, may vary. specifications specification status comment touch events – level 2the def
inition of 'touchevent' in that specification. draft
initial def
inition. ...
Touch.clientX - Web APIs
xample illustrates using the touch object's touch.clientx and touch.clienty properties. the touch.clientx property is the horizontal coordinate of a touch point relative to the browser's viewport excluding any scroll offset. the touch.clienty property is the vertical coordinate of the touch point relative to the browser's viewport excluding any scroll offset . in this example, we assume the user
initiates a touch on an element with an id of source, moves within the element or out of the element and then releases contact with the surface. when the touchend event handler is invoked, the changes in the touch.clientx and touch.clienty coordinates, from the starting touch point to the ending touch point, are calculated. // register touchstart and touchend listeners for element 'source' var src = ...
... ...
... ...
Touch.clientY - Web APIs
xample illustrates using the touch object's touch.clientx and touch.clienty properties. the touch.clientx property is the horizontal coordinate of a touch point relative to the browser's viewport excluding any scroll offset. the touch.clienty property is the vertical coordinate of the touch point relative to the browser's viewport excluding any scroll offset . in this example, we assume the user
initiates a touch on an element with an id of source, moves within the element or out of the element and then releases contact with the surface. when the touchend event handler is invoked, the changes in the touch.clientx and touch.clienty coordinates, from the starting touch point to the ending touch point, are calculated. // register touchstart and touchend listeners for element 'source' var src = ...
... ...
... ...
Touch.pageX - Web APIs
cess the touch object's touch.pagex and touch.pagey properties. the touch.pagex property is the horizontal coordinate of a touch point relative to the viewport (in css pixels), including any scroll offset. the touch.pagey property is the vertical coordinate of a touch point relative to the viewport (in css pixels), including any scroll offset. in following simple code snippet, we assume the user
initiates one or more touch contacts on the source element, moves the touch points and then releases all contacts with the surface. when the touchmove event handler is invoked, each touch point's touch.pagex and touch.pagey coordinates are accessed via the event's touchevent.changedtouches list. // register a touchmove listeners for the 'source' element var src = document.getelementbyid("source"); s...
... ...
... ...
Touch.pageY - Web APIs
cess the touch object's touch.pagex and touch.pagey properties. the touch.pagex property is the horizontal coordinate of a touch point relative to the viewport (in css pixels), including any scroll offset. the touch.pagey property is the vertical coordinate of a touch point relative to the viewport (in css pixels), including any scroll offset. in following simple code snippet, we assume the user
initiates one or more touch contacts on the source element, moves the touch points and then releases all contacts with the surface. when the touchmove event handler is invoked, each touch point's touch.pagex and touch.pagey coordinates are accessed via the event's touchevent.changedtouches list. // register a touchmove listeners for the 'source' element var src = document.getelementbyid("source"); s...
... ...
... ...
Touch.target - Web APIs
rectly to the target. syntax var el = touchpoint.target; return value el the target element of the touch object. example this example illustrates how to access the touch object's touch.target property. the touch.target property is an element (eventtarget) on which a touch point is started when contact is first placed on the surface. in following simple code snippet, we assume the user
initiates one or more touch contacts on the source element. when the touchstart event handler for this element is invoked, each touch point's touch.target property is accessed via the event's touchevent.targettouches list. // register a touchmove listener for the 'source' element var src = document.getelementbyid("source"); src.addeventlistener('touchstart', function(e) { // iterate through the to...
... ...
... ...
TouchEvent() - Web APIs
"targettouches", optional and defaulting to [], of type touch[], that is a list of objects for every point of contact that is touching the surface and started on the element that is the target of the current event. ...
... "targettouches", optional and defaulting to [], of type touch[], that is a list of objects for every point of contact that is touching the surface and started on the element that is the target of the current event. ...
...sly pressed. "shiftkey", optional and defaulting to false, of type boolean, that indicates if the shift key was simultaneously pressed. "altkey", optional and defaulting to false, of type boolean, that indicates if the alt key was simultaneously pressed. "metakey", optional and defaulting to false, of type boolean, that indicates if the meta key was simultaneously pressed. the touchevent
init dictionary also accepts fields from uievent
init and from event
init dictionaries. ...
TouchEvent - Web APIs
lement that is the target of the event. touchevent.touches read only a touchlist of all the touch objects representing all current points of contact with the surface, regardless of target or changed status. touchevent.rotation read only change in rotation (in degrees) since the event's beginning. positive values indicate clockwise rotation; negative values indicate anticlockwise rotation. ...
...th the surface, regardless of target or changed status. touchevent.rotation read only change in rotation (in degrees) since the event's beginning. positive values indicate clockwise rotation; negative values indicate anticlockwise rotation.
initial value: 0.0 touchevent.scale read only distance between two digits since the event's beginning. expressed as a floating-point multiple of the
initial distance between the digits at the beginning of the event. values below 1.0 indicate an inward pinch (zoom out). values above 1.0 indicate an outward unpinch (zoom in).
initial value: 1.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...
....ontouchend a global event handler for the touchend event. globaleventhandlers.ontouchmove a global event handler for the touchmove event. globaleventhandlers.ontouchcancel a global event handler for the touchcancel event. example see the example on the main touch events article. specifications specification status comment touch events – level 2the def
inition of 'touchevent' in that specification. draft added ontouchstart, ontouchend, ontouchmove, ontouchend global attribute handlers touch eventsthe def
inition of 'touchevent' in that specification. recommendation
initial def
inition. ...
TransitionEvent.elapsedTime - Web APIs
...
... ...
...is a float giving the amount of time the animation has been running, in seconds, when this event fired. this value is not affected by the transition-delay property. syntax name = transitionevent.elapsedtime specifications specification status comment css transitionsthe def
inition of 'transitionevent.elapsedtime' in that specification. working draft
initial def
inition. ...
TypeInfo - Web APIs
pace within the schema. methods typeinfo.isderivedfrom() returns a boolean. ...
...) returns a boolean. ...
...a boolean. ...
ULongRange - Web APIs
of the property it describes. ...
...bit integers, specifying the smallest permissible value of the property it describes. ...
...s, specifying the smallest permissible value of the property it describes. ...
WebGLRenderingContext.linkProgram() - Web APIs
standard man page of the opengl api. ...
... standard man page of the opengl api. ...
...chshader(program, fragmentshader); gl.linkprogram(program); if ( !gl.getprogramparameter( program, gl.link_status) ) { var info = gl.getprograminfolog(program); throw new error('could not compile webgl program. \n\n' + info); } specifications specification status comment webgl 1.0the def
inition of 'linkprogram' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'gllinkprogram' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.renderbufferStorage() - Web APIs
syntax void gl.renderbufferstorage(target, internalformat, width, height); parameters target a glenum specifying the target renderbuffer object. possible values: gl.renderbuffer: buffer data storage for single images in a renderable internal format. internalformat a glenum specifying the internal format of the renderbuffer. possible values: gl.rgba4: 4 red bits, 4 green bits, 4 blue bits 4 alpha bits. gl.rgb565: 5 red bits, 6 green bits, 5 blue bits. gl.rgb5_a1: 5 red bits, 5 green bits, 5 blue bits, 1 alpha bit. gl.depth_component16: 16 depth bits. ...
...16f gl.r32f gl.rg32f gl.rgba32f gl.r11f_g11f_b10f width a glsizei specifying the width of the renderbuffer in pixels. height a glsizei specifying the height of the renderbuffer in pixels. return value none. examples gl.renderbufferstorage(gl.renderbuffer, gl.rgba4, 256, 256); specifications specification status comment webgl 1.0the def
inition of 'renderbufferstorage' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glrenderbufferstorage' in that specification. standard man page of the opengl es 2 api. webgl 2.0the def
inition of 'getrenderbufferparameter' in that specification. editor's draft updated def
inition for webgl 2. opengl es 3.0t...
... 'renderbufferstorage' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glrenderbufferstorage' in that specification. standard man page of the opengl es 2 api. webgl 2.0the def
inition of 'getrenderbufferparameter' in that specification. editor's draft updated def
inition for webgl 2. opengl es 3.0the def
inition of 'glrenderbufferstorage' in that specification. standard man page of the (similar) opengl es 3 api. adds many new internal formats. ...
WebGLRenderingContext.uniform[1234][fi][v]() - Web APIs
many of the functions described here have expanded webgl 2 interfaces, which can be found under webgl2renderingcontext.uniform[1234][uif][v](). ...
... many of the functions described here have expanded webgl 2 interfaces, which can be found under webgl2renderingcontext.uniform[1234][uif][v](). ...
...ting point numbers (for example a float32array or an array of numbers) for floating point vector methods (methods with "fv"). an integer number for integer values (methods with "i"). an int32array for integer vector methods (methods with "iv"). return value none. examples gl.uniform1f(u_alpha, 0.8); specifications specification status comment webgl 1.0the def
inition of 'uniform' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'gluniform' in that specification. standard main page of the opengl api. ...
WebGLTransformFeedback - Web APIs
...
... ...
... examples creating a webgltransformfeedback object in this example, gl must be a webgl2renderingcontext. webgltransformfeedback objects are not available in webgl 1. var transformfeedback = gl.createtransformfeedback(); specifications specification status comment webgl 2.0the def
inition of 'webgltransformfeedback' in that specification. editor's draft
initial def
inition. ...
A basic 2D WebGL animation example - Web APIs
float type, as required. then we set the global gl_fragcolor to the value of the uniform uglobalcolor, which is set by the javascript code to the color being used to draw the square. html the html consists solely of the <canvas> that we'll obtain a webgl context on. <canvas id="glcanvas" width="600" height="460"> oh no! your browser doesn't support canvas! </canvas> javascript globals and
initialization first, the global variables. we won't discuss these here; instead, we'll talk about them as they're used in the code to come. let gl = null; let glcanvas = null; // aspect ratio and coordinate system // details let aspectratio; let currentrotation = [0, 1]; let currentscale = [1.0, 1.0]; // vertex information let vertexarray; let vertexbuffer; let vertexnumcomponents; let vertexco...
...tem // details let aspectratio; let currentrotation = [0, 1]; let currentscale = [1.0, 1.0]; // vertex information let vertexarray; let vertexbuffer; let vertexnumcomponents; let vertexcount; // rendering data shared with the // scalers. ...
... time at which the frame drawing began. we use that and the saved time at which the last frame was drawn, previoustime, along with the number of degrees per second the square should rotate (degreespersecond) to calculate the new value of currentangle. then the value of previoustime is updated and we call animatescene() to draw the next frame (and in turn schedule the next frame to be drawn, ad inf
initum). result this is a pretty simple example, since it's just drawing one simple object, but the concepts used here extend to much more complex animations. ...
Using textures in WebGL - Web APIs
e texture, mapped onto all six sides of our rotating cube, but the same technique can be used for any number of textures. note: it's important to note that the loading of textures follows cross-domain rules; that is, you can only load textures from sites for which your content has cors approval. see cross-domain textures below for details. the code that loads the texture looks like this: // //
initialize a texture and load an image. // when the image finished loading copy it into the texture. // function loadtexture(gl, url) { const texture = gl.createtexture(); gl.bindtexture(gl.texture_2d, texture); // because images have to be download over the internet // they might take a moment until they are ready. // until then put a single pixel in the texture so we can // use it immed...
...with these parameters, compatible webgl devices will automatically accept any resolution for that texture (up to their maximum dimensions). without performing the above configuration, webgl requires all samples of npot textures to fail by returning transparent black: rgba(0,0,0,0). to load the image, add a call to our loadtexture() function within our main() function. this can be added after the
initbuffers(gl) call. // load texture const texture = loadtexture(gl, 'cubetexture.png'); mapping the texture onto the faces at this point, the texture is loaded and ready to use. but before we can use it, we need to establish the mapping of the texture coordinates to the vertices of the faces of our cube. this replaces all the previously existing code for configuring colors for each of the cube's ...
...l) call. // load texture const texture = loadtexture(gl, 'cubetexture.png'); mapping the texture onto the faces at this point, the texture is loaded and ready to use. but before we can use it, we need to establish the mapping of the texture coordinates to the vertices of the faces of our cube. this replaces all the previously existing code for configuring colors for each of the cube's faces in
initbuffers(). const texturecoordbuffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, texturecoordbuffer); const texturecoordinates = [ // front 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, // back 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, // top 0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, // bottom 0.0, 0.0, 1.0, ...
Signaling and video calling - Web APIs
sages. this example's server uses stringified json objects to communicate with its clients. this means our signaling messages will be in json format, with contents which specify what kind of messages they are as well as any additional information needed in order to handle the messages properly. exchanging session descriptions when starting the signaling process, an offer is created by the user
initiating the call. this offer includes a session description, in sdp format, and needs to be delivered to the receiving user, which we'll call the callee. the callee responds to the offer with an answer message, also containing an sdp description. our signaling server will use websocket to transmit offer messages with the type "video-offer", and answer messages with the type "video-answer". these me...
... receives them from their local ice layer; there is no taking turns or batching of candidates. as soon as the two peers agree upon one candidate that they can both use to exchange the media, media begins to flow. each peer continues to send candidates until it runs out of options, even after the media has already begun to flow. this is done in hopes of identifying even better options than the one
initially selected. if conditions change—for example the network connection deteriorates—one or both peers might suggest switching to a lower-bandwidth media resolution, or to an alternative codec. this triggers a new exchange of candidates, after which a another media format and/or codec change may take place. you can learn more about the codecs which webrtc requires browsers to support, which a...
...er by creating a new "video-offer" message containing the local description (now the same as the offer), then sending it through our signaling server to the callee. the offer has the following members: type the message type: "video-offer". name the caller's username. target the name of the user we wish to call. sdp the sdp string describing the offer. if an error occurs, either in the
initial createoffer() or in any of the fulfillment handlers that follow, an error is reported by invoking our reporterror() function. once setlocaldescription()'s fulfillment handler has run, the ice agent begins sending icecandidate events to the rtcpeerconnection, one for each potential configuration it discovers. our handler for the icecandidate event is responsible for transmitting the candidates...
WebSocket.binaryType - Web APIs
the websocket.binarytype property returns the type of binary data being transmitted by the connection. ...
...e type of binary data being transmitted by the connection. ...
...inary data being transmitted by the connection. ...
WebSocket.bufferedAmount - Web APIs
yet transmitted to the network. this value resets to zero once all queued data has been sent. ...
...een sent. ...
...his value does not reset to zero when the connection is closed; if you keep calling send(), this will continue to climb. syntax var bufferedamount = awebsocket.bufferedamount; value an unsigned long. specifications specification status comment html living standardthe def
inition of 'websocket: bufferedamount' in that specification. living standard
initial def
inition ...
WebSocket.close() - Web APIs
(not characters). exceptions thrown invalid_access_err an invalid code was specified. ...
... was specified. syntax_err the reason string is too long or contains unpaired surrogates. ...
...ied. syntax_err the reason string is too long or contains unpaired surrogates. ...
WebSocket.extensions - Web APIs
the websocket.extensions read-only property returns the extensions selected by the server. ...
...erty returns the extensions selected by the server. ...
...s the extensions selected by the server. ...
WebSocket.readyState - Web APIs
0 connecting socket has been created. the connection is not yet open. ...
... 1 open the connection is open and ready to communicate. ...
... open the connection is open and ready to communicate. ...
Using bounded reference spaces - Web APIs
eal-world implications otherwise. therefore, the bounded reference space's origin always places the y=0 plane at floor level. the boundary is then defined using an array of 2d coordinates, specifying only the x and z components since y is always 0. these points go around the room in a clockwise direction. note that if the underlying platform defines a fixed room-scale origin and boundary, it may
initialize any un
initialized values to match that predefined information; this is not unexpected behavior for users of these platforms. the space inside the boundary is then the user's safe movement area, within which they are tracked and their movements replicated into the virtual world. although the user's xr system may provide automated detection and protection against exiting the safe area, it is...
...xrboundedreferencespace in the the xrboundedreferencespace property boundsgeometry. this property contains an array of dompointreadonly objects, each of which defines one of the points making up the space's border, moving around the room in clockwise order. each vertex in the array has a y coordinate of 0 since the entire boundary is defined at floor level, extending upward to the ceiling or indef
initely. each point's w is always 1 as well. the interior of the bounded area is always considered to be on the right side of the boundary. by listing the points in clockwise order, the boundary is placed inside the defined shape. if the points are listed counterclockwise it would suggest that the safe area lies outside the boundary, probably with undesirable results. you should consider including p...
...nframe(ondrawframe); } in this code, executed after the reference space has been created, we create an xrrigidtransform representing the transform that will move the viewpoint upward by 1.5 meters. this approximates human height, though it assumes we've previously transformed the coordinate system so that the value of each coordinate is no longer constrained to -1 to 1, while maintaining the def
inition that a value of 1 represents one meter). the new transform is passed into requestoffsetreferenceframe() to obtain a reference frame which maps the coordinates between the base coordinate system and that of the rendered image. the new reference space replaces the original one. finally, drawing begins by calling the xrsession method requestanimationframe(). ...
Geometry and reference spaces in WebXR - Web APIs
g system. this may be different from the effective origin, which is the origin point for the space's local coordinate system. the directionality of the coordinate system can be seen in the following diagram: an xrrigidtransform called the origin offset is used to transform points from the space's own effective coordinate system to the xr device's native coordinate system. the origin offset is
initially simply an identity transform, since typically the two origins are aligned when the space is first established. however, as changes in alignment accumulate over time the origin offset may change to compensate. the position of a point in space relative to the origin is determined by determining its distance along each of the three spatial axes shown in the diagram above. the space's origin is...
.... however, as changes in alignment accumulate over time the origin offset may change to compensate. the position of a point in space relative to the origin is determined by determining its distance along each of the three spatial axes shown in the diagram above. the space's origin is the point (0, 0, 0), at the center of the space and at the zero position along each axis. specifically, under the
initial starting conditions, with the default orientation of the viewer upon the space: the x-axis extends horizontally from left to right away from the origin, with the x coordinate of +1.0 being located at the right edge of the world. negative values of x extend toward the left from the origin, reaching a value of -1.0 at the left edge of the space. the y-axis is positive extending upward from t...
...issues that arise may be as fundamental as being unable to support immersive-ar mode (augmented reality sessions) on a vr-only headset, or may involve a request for one or more required options which cannot be met when attempting to create the xr session. xr sessions are created using the navigator.xr.requestsession() method. one of its optional parameters is an object conforming to the xrsession
init dictionary which you can use to specify required and/or optional features that the session must (or should ideally) support. currently, the only supported options are strings identifying the standard reference spaces. 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,...
WebXR Device API - Web APIs
particular xframe takes place. the space's coordinate system has its origin at the a given physical position. xrreferencespace a subclass of xrspace which is used to identify a spatial relationship in relation to the user's physical environment. the xrreferencespace coordinate system is expected to remain unchanged through the lifespan of the xrsession.the world has no boundaries and extends inf
initely in every direction. xrboundedreferencespace xrboundedreferencespace extends the xrreferencespace coordinate system to further include support for a f
inite world with set boundaries. unlike xrreferencespace, the origin must be located on the floor (that is, y = 0 at the floor). the x and z components of the origin are typically presumed to be located at or near the center of the room or surfa...
...hat the state of an xrsession has changed. for example, if the position and/or orient extensions to the webgl api the webgl api is extended by the webxr specification to augment the webgl context to allow it to be used to render views for display by a webxr device. webglrenderingcontextbase.makexrcompatibile() configures the webgl context to be compatible with webxr. if the context was not
initially created with the xrcompatible property set to true, you must call makexrcompatible() prior to attempting to use the webgl context for webxr rendering. returns a promise which resolves once the context has been prepared, or is rejected if the context cannot be configured for use by webxr. guides and tutorials the following guides and tutorials are a great resource to learn how to comprehen...
...vers how to accomplish this. playing video in a 3d environment in this guide, we examine how to play video into a 3d scene. this technique can be used in both standard webgl applications presented on a flat computer screen, or in a webxr-generated virtual or augmented reality environment. specifications specification status comment webxr device api working draft
initial def
inition. ...
Keyframe Formats - Web APIs
the timing function used from this keyframe until the next keyframe in the series. ...
...ies. ...
...posite the keyframeeffect.composite operation used to combine the values specified in this keyframe with the underlying value. this will be auto if the composite operation specified on the effect is being used. specifications specification status comment web animationsthe def
inition of 'keyframe object formats' in that specification. working draft
initial def
inition ...
Web Audio API - Web APIs
ou aren't familiar with the programming basics, you might want to consult some beginner's javascript tutorials first and then come back here — see our beginner's javascript learning module for a great place to begin. web audio api interfaces the web audio api has a number of interfaces and associated events, which we have split up into nine categories of functionality. general audio graph def
inition general containers and def
initions that shape audio graphs in web audio api usage. audiocontext the audiocontext interface represents an audio-processing graph built from audio modules linked together, each represented by an audionode. an audio context controls the creation of the nodes it contains and the execution of the audio processing, or decoding. you need to create an audiocontext ...
...t can be set to a specific value or a change in value, and can be scheduled to happen at a specific time and following a specific pattern. audioparammap provides a maplike interface to a group of audioparam interfaces, which means it provides the methods foreach(), get(), has(), keys(), and values(), as well as a size property. baseaudiocontext the baseaudiocontext interface acts as a base def
inition for online and offline audio-processing graphs, as represented by audiocontext and offlineaudiocontext respectively. you wouldn't use baseaudiocontext directly — you'd use its features via one of these two inheriting interfaces. the ended event the ended event is fired when playback has stopped because the end of the media was reached. defining audio sources interfaces that define audio...
... waveshapernode the waveshapernode interface represents a non-linear distorter. it is an audionode that use a curve to apply a waveshaping distortion to the signal. beside obvious distortion effects, it is often used to add a warm feeling to the signal. periodicwave describes a periodic waveform that can be used to shape the output of an oscillatornode. iirfilternode implements a general inf
inite impulse response (iir) filter; this type of filter can be used to implement tone control devices and graphic equalizers as well. defining audio destinations once you are done processing your audio, these interfaces define where to output it. audiodestinationnode the audiodestinationnode interface represents the end destination of an audio source in a given context — usually the speaker...
Using the Web Speech API - Web APIs
s. speech recognition speech recognition involves receiving speech through a device's microphone, which is then checked by a speech recognition service against a list of grammar (basically, the vocabulary you want to have recognised in a particular app.) when a word or phrase is successfully recognised, it is returned as a result (or list of results) as a text string, and further actions can be
initiated as a result. the web speech api has a main controller interface for this — speechrecognition — plus a number of closely-related interfaces for representing grammar, results, etc. generally, the default speech recognition system available on the device will be used for the speech recognition — most modern oses have a speech recognition system for issuing voice commands. think about dic...
... angle brackets defines the recognised name for this term (color), and the list of items that follow the equals sign are the alternative values that will be recognised and accepted as appropriate values for the term. note how each is separated by a pipe character. you can have as many terms defined as you want on separate lines following the above structure, and include fairly complex grammar def
initions. for this basic demo, we are just keeping things simple. plugging the grammar into our speech recognition the next thing to do is define a speech recogntion instance to control the recognition for our application. this is done using the speechrecognition() constructor. we also create a new speech grammar list to contain our grammar, using the speechgrammarlist() constructor. var recognit...
...abled flag to true in about:config. firefox os 2.5+ supports it, by default, and without the need for any permissions. chrome for desktop and android have supported it since around version 33, without prefixes. html and css the html and css are again pretty trivial, simply containing a title, some instructions for use, and a form with some simple controls. the <select> element is
initially empty, but is populated with <option>s via javascript (see later on.) <h1>speech synthesiser</h1> <p>enter some text in the input below and press return to hear it. change voices using the dropdown menu.</p> <form> <input type="text" class="txt"> <div> <label for="rate">rate</label><input type="range" min="0.5" max="2" value="1" step="0.1" id="rate"> <div class="rate-value">1<...
Web Workers API - Web APIs
...
... ...
...mple demos to show basic usage: basic dedicated worker example (run dedicated worker). basic shared worker example (run shared worker). you can find out more information on how these demos work in using web workers. specifications specification status comment html living standardthe def
inition of 'web workers' in that specification. living standard
initial def
inition. ...
Window.innerHeight - Web APIs
o change the size of a window, see window.resizeby() and window.resizeto(). ...
... to get the outer height of a window, i.e. ...
...e outer height of a window, i.e. the height of the whole browser window, see window.outerheight. ...
Window.moveTo() - Web APIs
urrent location. ...
...horizontal coordinate to be moved to. y is the vertical coordinate to be moved to. ...
...coordinate to be moved to. y is the vertical coordinate to be moved to. ...
Window.ongamepadconnected - Web APIs
at will run when a gamepad is connected (when the gamepadconnected event fires). ...
.... the event object is of type gamepadevent. syntax window.ongamepadconnected = function() { ... ...
...t object is of type gamepadevent. syntax window.ongamepadconnected = function() { ... ...
Window: pageshow event - Web APIs
bubbles no cancelable no interface pagetransitionevent event handler property onpageshow examples this example sets up event handlers for events listed in the array events. ...
... bubbles no cancelable no interface pagetransitionevent event handler property onpageshow examples this example sets up event handlers for events listed in the array events. ...
...ventname => window.addeventlistener(eventname, eventlogger) ); html <p>open the console and watch the output as you navigate to and from this page. try loading new pages into this tab, then navigating forward and backward through history, noting the events’ output to the log.</p> results specifications specification status comment html living standardthe def
inition of 'pageshow' in that specification. living standard
initial specification. html5the def
inition of 'pageshow' in that specification. recommendation ...
XRSessionEvent() - Web APIs
the webxr device api's xrsessionevent() constructor creates and returns a new xrsessionevent object. these objects represent events announcing state changes in an xrsession representing an augmented or virtual reality session. syntax newxrsessionevent = new xrsessionevent(type, event
initdict); parameters type a domstring indicating which of the events represented by objects of type xrsessionevent this particular object represents. see event types for a list of the permitted values. event
initdict an object conforming to the xrsessionevent
init dictionary which contains values to be applied to the newly-created event object. permitted values are: session the xrsession to which the event is to be delivered. return value a newly-created xrsessionevent object representing an...
... event types the following events are represented using the xrsessionevent interface, and are permitted values for its type property. end fired at the session when it has ended, after being terminated by the application or the user agent. visibilitychange fired at the session whenever its visibility state changes. ...
...gure a worker that handles rendering the scene. xrsession.addeventlistener("visibilitystate", e => { switch(e.session.visibilitystate) { case "visible": case "visible-blurred": mysessionvisible(true); break; case "hidden": mysessionvisible(false); break; } }); specifications specification status comment webxr device apithe def
inition of 'xrsessionevent() constructor' in that specification. working draft
initial def
inition. ...
XRSystem: isSessionSupported() - Web APIs
...
... ...
... xrsession = session; // onsessionstarted() not shown for reasons of brevity and clarity. onsessionstarted(xrsession); }); } else { // button is a toggle button. xrsession.end(); } } specifications specification status comment webxr device apithe def
inition of 'issessionsupported()' in that specification. working draft
initial def
inition. ...
XRWebGLLayer() - Web APIs
the webxr device api xrwebgllayer() constructor creates and returns a new xrwebgllayer object, providing the linkage between the webxr device and the webgl graphics layer used to render the 3d scene. syntax let gllayer = new xrwebgllayer(session, context, layer
init); parameters session an xrsession object specifying the webxr session which will be rendered using the webgl context. context a webglrenderingcontext or webgl2renderingcontext identifying the webgl drawing context to use for rendering the scene for the specified webxr session. layer
init optional an object conforming to the xrwebgllayer
init dictionary, providing configuration options for the new xrwebgllayer. the options available are: alpha optional the frame buffer's color buffer will be established with an alph...
...ene. the default is false. stencil optional a boolean value which, if true, requests that the new layer include a stencil buffer. otherwise, no stencil buffer is allocated. the default is false. return value a newly-created xrwebgllayer which links the specified xrsession to the webgl context given by context, which will be used as the renderer for the session. any options specified in layer
init are used to tailor the rendering system's configuration. exceptions invalidstateerror the new xrwebgllayer could not be created due to one of a number of possible state errors: the xrsession specified by session has already been stopped. the specified webgl context, context, has been lost for any reason, such as a gpu switch or reset. the specified session is immersive but the con...
...stopped. the specified webgl context, context, has been lost for any reason, such as a gpu switch or reset. the specified session is immersive but the context is not webxr compatible. operationerror the resources (including memory buffers) needed for the layer to operate could not be allocated. specifications specification status comment webxr device apithe def
inition of 'xrwebgllayer()' in that specification. working draft
initial def
inition. ...
XRWebGLLayer.antialias - Web APIs
h is true if the webgl rendering layer's frame buffer is configured to support antialiasing. otherwise, this property is false. when the webxr compositor is enabled, this value corresponds to the value of the antialias property on the object returned by the webgl context's getcontentattributes() method. usage notes since this is a read-only property, you can set the antialiasing mode only when
initially creating the xrwebgllayer, by specifying the antialias object in the xrwebgllayer() constructor's layer
init parameter. examples this snippet checks the value of antialias to see if it should perform additional work to attempt to compensate for the lack of antialiasing on the webgl layer. let gllayer = xrsession.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer)...
... ...
...ck of antialiasing on the webgl layer. let gllayer = xrsession.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); /* .. */ if (!gllayer.antialias) { /* compensate for lack of antialiasing */ } specifications specification status comment webxr device apithe def
inition of 'xrwebgllayer.antialias' in that specification. working draft
initial def
inition. ...
XRWebGLLayer.framebuffer - Web APIs
ailable for rendering other than while executing the requestanimationframe() callback. attempting to clear, draw to, or read from the framebuffer results in a webgl invalid_framebuffer_operation error (0x0506). calling checkframebufferstatus() on the webgl context from outside the animation frame callback causes the webgl framebuffer_unsupported error (0x8cdd) to be reported. opaque framebuffers
initialized with the depth property set to false will not have a depth buffer and will rely on the coordinates alone to determine distance. opaque framebuffers
initialized without specifying a stencil will not have a stencil buffer. opaque framebuffers will not have an alpha channel available unless the alpha property is true when creating the layer. the xr compositor assumes that opaque framebuffe...
...que framebuffers use colors with premultiplied allpha, regardless of whether or not the webgl context's premultipliedalpha context attribute is set. note: the depth and stencil properties are not required to be supported in order for a browser to be construed as having full webgl support. the default configuration of a new framebuffer upon creating a new xrwebgllayer, its new framebuffer is
initialized just like the default framebuffer for any webgl interface: the color buffer is configured with its clear value set to the color (0, 0, 0, 0) (meaning transparent black). the depth buffer's clear value is the number 1.0. the stencil buffer is filled with 0. examples this example gets the xrwebgllayer for a session and then passes its framebuffer into the webgl context's bindframebuf...
... the number 1.0. the stencil buffer is filled with 0. examples this example gets the xrwebgllayer for a session and then passes its framebuffer into the webgl context's bindframebuffer() function. let gllayer = xrsession.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); specifications specification status comment webxr device apithe def
inition of 'xrwebgllayer.framebuffer' in that specification. working draft
initial def
inition. ...
XRWebGLLayer.ignoreDepthValues - Web APIs
roperty ignoredepthvalues is a boolean value which is true if the session has been configured to ignore the values in the depth buffer while rendering the scene. if the depth buffer is being used to determine the position of vertices, this property is false. the value of ignoredepthvalues can only be set when the xrwebgllayer is instantiated, by setting the corresponding value in the xrwebgllayer
init object specified as the constructor's layer
init parameter. as a parameter you're likely to set yourself, it is unlikely you'll need to read it later, but it's available if the need arises. syntax let ignoringdepthbuffer = xrwebgllayer.ignoredepthvalues; value a boolean value which is true if the webgl context's depth buffer is being used while computing the locations of points in the 3d world...
... ...
...pthvalues to true when creating the xrwebgllayer. this is demonstrated in the snippet of code below: const gllayeroptions = { ignoredepthvalues: true }; let gllayer = new xrwebgllayer(xrsession, gl, gllayeroptions); specifications specification status comment webxr device apithe def
inition of 'xrwebgllayer.ignoredepthvalues' in that specification. working draft
initial def
inition. ...
Web applications and ARIA FAQ - Accessibility
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 readers or magnifiers. aria provides additional semantics to describe the role, state, and functionality of many familiar user interface controls, such as menus, sliders, trees, and dialogs. it also provides additional structural information, helping authors identify landmarks, regions, and grids on their pages. ...
...{ // html5 <progress> isn't supported by this browser, // so we need to update the aria-valuenow attribute progressbar.setattribute("aria-valuenow", percentcomplete); } else { // html5 <progress> is supported, so update the value attribute instead. ...
...bute("value", percentcomplete); } progressbar.textcontent = percentcomplete + "% complete"; } function
initdemo() { setupprogress(); // setup the progress bar. // bind a click handler to the button, which will update the progress bar to 75%. document.getelementbyid("update-button").addeventlistener("click", function (e) { updateprogress(75); e.preventdefault(); }, false); }
initdemo(); how do assistive technologies work? assistive technologies use an api built into each operating system specifically designed to describe the roles, states, and structure of an application's user interface. for example, a screen reader uses this api to read the user interface with a text-to-speech engine, a magnifier uses it to highlight important or active areas of the screen, and an on...
-moz-context-properties - CSS: Cascading Style Sheets
rties that are to be made available to the image by listing them as values of the -moz-context-properties property, and the image needs to opt in to using those properties by using values such as the context-fill value. ...
...it; -moz-context-properties:
initial; -moz-context-properties: unset; values fill expose the fill value set on the image to the embedded svg. stroke expose the stroke value set on the image to the embedded svg. fill-opacity expose the fill-opacity value set on the image to the embedded svg. stroke-opacity expose the stoke-opacity value set on the image to the embedded svg. ...
...context-properties:
initial; -moz-context-properties: unset; values fill expose the fill value set on the image to the embedded svg. stroke expose the stroke value set on the image to the embedded svg. fill-opacity expose the fill-opacity value set on the image to the embedded svg. stroke-opacity expose the stoke-opacity value set on the image to the embedded svg. formal def
inition
initial valuenoneapplies toany element that can have an image applied to it, for example as a background-image, border-image, or list-style-image.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax none | [ fill | fill-opacity | stroke | stroke-opacity ]# examples exposing fill and stroke to an svg image in this example we have a simple svg embedded using an <img> element. ...
-moz-float-edge - CSS: Cascading Style Sheets
the non-standard -moz-float-edge css property specifies whether the height and width properties of the element include the margin, border, or padding thickness. /* keyword values */ -moz-float-edge: border-box; -moz-float-edge: content-box; -moz-float-edge: margin-box; -moz-float-edge: padding-box; /* global values */ -moz-float-edge: inherit; -moz-float-edge:
initial; -moz-float-edge: unset; syntax values border-box the height and width properties include the content, padding and border but not the margin. content-box the height and width properties include the content, but not the padding, border or margin. margin-box the height and width properties include the content, padding, border and margin. padding-box the height and width properties include the content and p...
...nd width properties include the content, padding and border but not the margin. content-box the height and width properties include the content, but not the padding, border or margin. margin-box the height and width properties include the content, padding, border and margin. padding-box the height and width properties include the content and padding but not the border or margin. ...
...properties include the content, padding and border but not the margin. content-box the height and width properties include the content, but not the padding, border or margin. margin-box the height and width properties include the content, padding, border and margin. padding-box the height and width properties include the content and padding but not the border or margin. ...
-moz-orient - CSS: Cascading Style Sheets
s rendered in the same direction as the axis of the text: horizontally for horizontal writing modes, vertically for vertical writing modes. block the element is rendered orthogonally to the axis of the text: vertically for horizontal writing modes, horizontal for vertical writing modes. horizontal the element is rendered horizontally. vertical the element is rendered vertically. ...
...d in the same direction as the axis of the text: horizontally for horizontal writing modes, vertically for vertical writing modes. block the element is rendered orthogonally to the axis of the text: vertically for horizontal writing modes, horizontal for vertical writing modes. horizontal the element is rendered horizontally. vertical the element is rendered vertically. ...
... ...
-moz-outline-radius - CSS: Cascading Style Sheets
ns like firefox, the -moz-outline-radius css shorthand property can be used to give an element's outline rounded corners. /* one value */ -moz-outline-radius: 25px; /* two values */ -moz-outline-radius: 25px 1em; /* three values */ -moz-outline-radius: 25px 1em 12%; /* four values */ -moz-outline-radius: 25px 1em 12% 4mm; /* global values */ -moz-outline-radius: inherit; -moz-outline-radius:
initial; -moz-outline-radius: unset; constituent properties this property is a shorthand for the following css properties: -moz-outline-radius-bottomleft -moz-outline-radius-bottomright -moz-outline-radius-topleft -moz-outline-radius-topright syntax values elliptical outlines and <percentage> values follow the syntax described in border-radius. one, two, three or four <outline-radius> va...
...m-left corners. if three values are set, the first one applies to the top-left corner, the second one to the top-right and bottom-left corners and the third one to the bottom-right corner. if four values are set, the first one applies to the top-left corner, the second one to the top-right corner, the third one to the bottom-right corner and the fourth one to the bottom-left corner. ...
...rners. if three values are set, the first one applies to the top-left corner, the second one to the top-right and bottom-left corners and the third one to the bottom-right corner. if four values are set, the first one applies to the top-left corner, the second one to the top-right corner, the third one to the bottom-right corner and the fourth one to the bottom-left corner. ...
-webkit-border-before - CSS: Cascading Style Sheets
the -webkit-border-before css property is a shorthand property for setting the individual logical block start border property values in a single place in the style sheet. /* border values */ -webkit-border-before: 1px; -webkit-border-before: 2px dotted; -webkit-border-before: medium dashed blue; /* global values */ -webkit-border-before: inherit; -webkit-border-before:
initial; -webkit-border-before: unset; -webkit-border-before can be used to set the values for one or more of: -webkit-border-before-width, -webkit-border-before-style, and -webkit-border-before-color. it maps to a physical border depending on the element's writing mode, directionality, and text orientation. it corresponds to the border-top, border-right, border-bottom, or border-left property depending on the val...
...ode, direction, and text-orientation. it relates to -webkit-border-after, -webkit-border-start, and -webkit-border-end, which define the other borders of the element. this property is on the standard track as border-block-start. ...
...ction, and text-orientation. it relates to -webkit-border-after, -webkit-border-start, and -webkit-border-end, which define the other borders of the element. this property is on the standard track as border-block-start. ...
-webkit-box-reflect - CSS: Cascading Style Sheets
ct the content of an element in one specific direction. /* direction values */ -webkit-box-reflect: above; -webkit-box-reflect: below; -webkit-box-reflect: left; -webkit-box-reflect: right; /* offset value */ -webkit-box-reflect: below 10px; /* mask value */ -webkit-box-reflect: below 0 linear-gradient(transparent, white); /* global values */ -webkit-box-reflect: inherit; -webkit-box-reflect:
initial; -webkit-box-reflect: unset; note: this feature is not intended to be used by web sites. to achieve reflection on the web, the standard way is to use the css element() function. syntax values above, below, right, left are keywords indicating in which direction the reflection is to happen. <length> indicates the size of the reflection. <image> describes the mask to be applied to the...
... unset; note: this feature is not intended to be used by web sites. to achieve reflection on the web, the standard way is to use the css element() function. syntax values above, below, right, left are keywords indicating in which direction the reflection is to happen. <length> indicates the size of the reflection. <image> describes the mask to be applied to the reflection. ...
... note: this feature is not intended to be used by web sites. to achieve reflection on the web, the standard way is to use the css element() function. syntax values above, below, right, left are keywords indicating in which direction the reflection is to happen. <length> indicates the size of the reflection. <image> describes the mask to be applied to the reflection. ...
-webkit-mask-composite - CSS: Cascading Style Sheets
syntax values clear overlapping pixels in the source mask image and the destination mask image are cleared. copy the source mask image replaces the destination mask image. source-over the source mask image is rendered over the dest...
...ation-atop the pixels of the source mask image are rendered. the pixels of the destination mask image are rendered only if they overlap a nontransparent portion of the destination mask image. this causes the destination mask image to have no effect. xor overlapping pixels in the source mask image and the destination mask image become fully transparent if they are both fully opaque. ...
...p the pixels of the source mask image are rendered. the pixels of the destination mask image are rendered only if they overlap a nontransparent portion of the destination mask image. this causes the destination mask image to have no effect. xor overlapping pixels in the source mask image and the destination mask image become fully transparent if they are both fully opaque. ...
-webkit-mask-repeat-x - CSS: Cascading Style Sheets
-webkit-mask-repeat-x property specifies whether and how a mask image is repeated (tiled) horizontally. /* keyword values */ -webkit-mask-repeat-x: repeat; -webkit-mask-repeat-x: no-repeat; -webkit-mask-repeat-x: space; -webkit-mask-repeat-x: round; /* multiple values */ -webkit-mask-repeat-x: repeat, no-repeat, space; /* global values */ -webkit-mask-repeat-x: inherit; -webkit-mask-repeat-x:
initial; -webkit-mask-repeat-x: unset; syntax values repeat the mask image is repeated both horizontally and vertically. no-repeat the mask image is not repeated; only one copy of the mask image is drawn. the remainder of the masked element's content is not displayed. repeat the mask image is repeated both horizontally and vertically. space the image is repeated as much as possible withou...
...ases in size, the repeated images will stretch (leaving no gaps) until there is room for another one to be added. when the next image is added, all of the current ones compress to allow room. example: an image with an original width of 260px, repeated three times, might stretch until each repetition is 300px wide, and then another image will be added. they will then compress to 225px. ...
...ize, the repeated images will stretch (leaving no gaps) until there is room for another one to be added. when the next image is added, all of the current ones compress to allow room. example: an image with an original width of 260px, repeated three times, might stretch until each repetition is 300px wide, and then another image will be added. they will then compress to 225px. ...
-webkit-mask-repeat-y - CSS: Cascading Style Sheets
the -webkit-mask-repeat-y property sets whether and how a mask image is repeated (tiled) vertically. /* keyword values */ -webkit-mask-repeat-y: repeat; -webkit-mask-repeat-y: no-repeat; -webkit-mask-repeat-y: space; -webkit-mask-repeat-y: round; /* multiple values */ -webkit-mask-repeat-y: repeat, no-repeat, space; /* global values */ -webkit-mask-repeat-y: inherit; -webkit-mask-repeat-y:
initial; -webkit-mask-repeat-y: unset; syntax values repeat the mask image is repeated vertically. no-repeat the mask image is not repeated vertically; only one copy of the mask image is drawn in vertical direction. the vertical remainder of the masked element's content is not displayed. repeat the mask image is repeated vertically. space the image is repeated as much as possible without ...
... the repeated images will stretch (leaving no gaps) until there is room for another one to be added. when the next image is added, all of the current ones compress to allow room. example: an image with an original height of 260px, repeated three times, might stretch until each repetition is 300px high, and then another image will be added. they will then compress to a height of 225px. ...
...ated images will stretch (leaving no gaps) until there is room for another one to be added. when the next image is added, all of the current ones compress to allow room. example: an image with an original height of 260px, repeated three times, might stretch until each repetition is 300px high, and then another image will be added. they will then compress to a height of 225px. ...
::after (:after) - CSS: Cascading Style Sheets
recommendation in...
...aaaa solid; border-radius: 10px; background-color: #ffffcc; padding: 12px; color: #000000; font-size: 14px; z-index: 1; } result specifications specification status comment css pseudo-elements level 4the def
inition of '::after' in that specification. working draft no significant changes to the previous specification. css animationsthe def
inition of 'animations on pseudo-element properties' in that specification. ...
...atus comment css pseudo-elements level 4the def
inition of '::after' in that specification. working draft no significant changes to the previous specification. css animationsthe def
inition of 'animations on pseudo-element properties' in that specification. working draft allows animations on properties defined on pseudo-elements. selectors level 3the def
inition of '::after' in that specification. recommendation introduces the two-colon syntax. css level 2 (revision 1)the def
inition of '::after' in that specification. recommendation
initial def
inition, using the one-colon syntax. ...
::before (:before) - CSS: Cascading Style Sheets
ple more minutes</li> <li>serve with your favorite topping</li> </ol> css li { padding:0.5em; } li[aria-current='step'] { font-weight:bold; } li[aria-current='step']::after { content: " \21e6"; /* hexadecimal for unicode leftwards white arrow*/ display: inline; } result specifications specification status comment css pseudo-elements level 4the def
inition of '::before' in that specification. working draft no significant changes to the previous specification. css animations working draft allows animations on properties defined on pseudo-elements. selectors level 3the def
inition of '::before' in that specification. recommendation introduces the two-colon syntax. css level 2 (revision 1)the def
inition o...
... no significant changes to the previous specification. css animations working draft allows animations on properties defined on pseudo-elements. selectors level 3the def
inition of '::before' in that specification. ...
...ificant changes to the previous specification. css animations working draft allows animations on properties defined on pseudo-elements. selectors level 3the def
inition of '::before' in that specification. ...
::first-line (:first-line) - CSS: Cascading Style Sheets
candi...
...n status comment css pseudo-elements level 4the def
inition of '::first-line' in that specification. working draft defines more strictly where ::first-letter can occur. generalizes allowed properties to typesetting, text decoration, and inline layout properties and opacity. defines the inheritance of ::first-letter. css text decoration module level 3the def
inition of 'text-shadow with ::first-line' in that specification. candidate recommendation allows the use of text-shadow with ::first-letter. selectors level 3the def
inition of '::first-line' in that specification. recommendation introduction of the two-colon syntax. css level 2 (revision 1)the def
inition of '::first-line' in that specification. recommendation no ch...
...line' in that specification. candidate recommendation allows the use of text-shadow with ::first-letter. selectors level 3the def
inition of '::first-line' in that specification. recommendation introduction of the two-colon syntax. css level 2 (revision 1)the def
inition of '::first-line' in that specification. recommendation no change. css level 1the def
inition of '::first-line' in that specification. recommendation
initial def
inition, using the one-colon syntax. ...
:target - CSS: Cascading Style Sheets
ement */ p:target::before { font: 70% sans-serif; content: "►"; color: limegreen; margin-right: .25em; } /* style italic elements within the target element */ p:target i { color: red; } result pure-css lightbox you can use the :target pseudo-class to create a lightbox without using any javascript. this technique relies on the ability of anchor links to point to elements that are
initially hidden on the page. 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">...
... ...
...ose::before { left: 0; top: 0; width: 100%; height: 100%; position: fixed; background-color: rgba(0,0,0,.7); content: ""; cursor: default; } result specifications specification status comment html living standardthe def
inition of ':target' in that specification. living standard defines html-specific semantics. selectors level 4the def
inition of ':target' in that specification. working draft no changes. selectors level 3the def
inition of ':target' in that specification. recommendation
initial def
inition. ...
fallback - CSS: Cascading Style Sheets
t defaults to decimal. a couple of scenarios where a fallback style will be used are: when the range descriptor is specified for a counter style, the fallback style will be used to represent values that fall outside the range. when the fixed system is used and there are not enough symbols to cover all the list items, the fallback style will be used for the rest of the list items. ...
...enarios where a fallback style will be used are: when the range descriptor is specified for a counter style, the fallback style will be used to represent values that fall outside the range. when the fixed system is used and there are not enough symbols to cover all the list items, the fallback style will be used for the rest of the list items. ...
...ter style html <ul class="list"> <li>one</li> <li>two</li> <li>three</li> <li>four</li> <li>five</li> </ul> css @counter-style fallback-example { system: fixed; symbols: "\24b6" "\24b7" "\24b8"; fallback: upper-alpha; } .list { list-style: fallback-example; } result specifications specification status comment css counter styles level 3the def
inition of 'fallback' in that specification. candidate recommendation
initial def
inition ...
@counter-style - CSS: Cascading Style Sheets
the @counter-style css at-rule lets you define counter styles that are not part of the predefined set of styles. a @counter-style rule defines how to convert a counter value into a string representation. @counter-style thumbs { system: cyclic; symbols: "\1f44d"; suffix: " "; } ul { list-style: thumbs; } the
initial version of css defined a set of useful counter styles. however, although more styles were added to this set of predefined styles over the years, this system proved too restrictive to fulfill the needs of worldwide typography. the @counter-style at-rule addresses this shortcoming in an open-ended manner, by allowing authors to define their own counter styles when the pre-defined styles aren't fitting their needs. syntax descriptors each @counter-style is identified by ...
... ...
...duce lists like this: Ⓐ one Ⓑ two Ⓒ three Ⓓ four Ⓔ five ... ... Ⓨ twenty five Ⓩ twenty six 27 twenty seven 28 twenty eight 29 twenty nine 30 thirty see more examples on the demo page. specifications specification status comment css counter styles level 3the def
inition of 'counter-style' in that specification. candidate recommendation
initial def
inition. ...
font-stretch - CSS: Cascading Style Sheets
able fonts, the "wdth" variation is used to implement varying glyph widths. accessibility concerns people with dyslexia and other cognitive conditions may have difficulty reading fonts that are too condensed, especially if the font has a low contrast color ratio. ...
...s used to implement varying glyph widths. accessibility concerns people with dyslexia and other cognitive conditions may have difficulty reading fonts that are too condensed, especially if the font has a low contrast color ratio. ...
...l open sans font or import it, and allow using the font for normal, semi-condensed and semi-expanded states. @font-face { font-family: "open sans"; src: local("open sans") format("woff2"), url("/fonts/opensans-regular-webfont.woff") format("woff"); font-stretch: 87.5% 112.5%; } specifications specification status comment css fonts module level 4the def
inition of 'font-stretch' in that specification. working draft css fonts module level 3the def
inition of 'font-stretch' in that specification. candidate recommendation ...
font-variation-settings - CSS: Cascading Style Sheets
t of opentype axis names is passed to the text layout engine to enable or disable font features. each setting is always a <string> of 4 ascii characters, followed by a <number> indicating the axis value. if the <string> has more or fewer characters or contains characters outside the u+20 - u+7e codepoint range, the whole property is invalid. the <number> can be fractional or negative. ...
... to the text layout engine to enable or disable font features. each setting is always a <string> of 4 ascii characters, followed by a <number> indicating the axis value. if the <string> has more or fewer characters or contains characters outside the u+20 - u+7e codepoint range, the whole property is invalid. the <number> can be fractional or negative. ...
...ax normal | [ <string> <number> ]# examples setting font weight and stretch in a @font-face rule @font-face { font-family: 'opentypefont'; src: url('open_type_font.woff2') format('woff2'); font-weight: normal; font-style: normal; font-variation-settings: 'wght' 400, 'wdth' 300; } specifications specification status comment css fonts module level 4the def
inition of 'font-variation-settings' in that specification. working draft
initial def
inition ...
unicode-range - CSS: Cascading Style Sheets
s to be segmented so that a browser only needs to download the font resource needed for the text content of a particular page. for example, a site with many localizations could provide separate font resources for english, greek and japanese. for users viewing the english version of a page, the font resources for greek and japanese fonts wouldn't need to be downloaded, saving bandwidth. formal def
inition related at-rule@font-face
initial valueu+0-10ffffcomputed valueas specified formal syntax <unicode-range># examples using a different font for a single character in this example we create a simple html containing a single <div> element, including an ampersand, that we want to style with a different font. to make it obvious, we will use a sans-serif font, helvetica, for the text, and a ser...
...different font just to that, but that is an extra element and rule set. ...
...iv>me & you = us</div> css @font-face { font-family: 'ampersand'; src: local('times new roman'); unicode-range: u+26; } div { font-size: 4em; font-family: ampersand, helvetica, sans-serif; } result specifications specification status comment css fonts module level 3the def
inition of 'unicode-range' in that specification. candidate recommendation
initial def
inition ...
-webkit-transform-3d - CSS: Cascading Style Sheets
nsforms with the -webkit prefix. false the 3d css transforms prefixed with -webkit are not supported by the browser. ...
...ebkit are not supported by the browser. ...
...bkit-transform-3d: 1) { .foo { transform-style: preserve-3d; } } specifications specification status comment compatibility standardthe def
inition of '-webkit-transform-3d' in that specification. ...
marks - CSS: Cascading Style Sheets
ts. crop marks and cross marks are printed outside the page box. to have room to show crop and cross marks, the final pages will have to be somewhat bigger than the page box. syntax /* keyword values */ marks: none; marks: crop; marks: cross; marks: crop cross; values crop crop marks will be displayed. cross cross marks will be displayed. none no marks will be displayed. ...
...ks are printed outside the page box. to have room to show crop and cross marks, the final pages will have to be somewhat bigger than the page box. syntax /* keyword values */ marks: none; marks: crop; marks: cross; marks: crop cross; values crop crop marks will be displayed. cross cross marks will be displayed. none no marks will be displayed. ...
...ill be displayed. cross cross marks will be displayed. none no marks will be displayed. formal def
inition related at-rule@page
initial valuenonecomputed valueas specified formal syntax none | [ crop | cross ] examples adding crop and cross marks @page { marks: crop cross; } specifications specification status comment css paged media module level 3the def
inition of 'marks' in that specification. working draft
initial def
inition this css property was
initially proposed in css level 2, but was dropped from css level 2 (revision 1). ...
size - CSS: Cascading Style Sheets
rrespond to the jis standard dimensions: 257mm x 364mm. letter this keyword is a equivalent to the dimensions of letter paper in north america i.e. 8.5in x 11in. legal this keyword is a equivalent to the dimensions of legal papers in north america i.e. 8.5in x 14in. ledger this keyword is a equivalent to the dimensions of ledger pages in north america i.e. 11in x 17in. ...
...dimensions: 257mm x 364mm. letter this keyword is a equivalent to the dimensions of letter paper in north america i.e. 8.5in x 11in. legal this keyword is a equivalent to the dimensions of legal papers in north america i.e. 8.5in x 14in. ledger this keyword is a equivalent to the dimensions of ledger pages in north america i.e. 11in x 17in. ...
...lengths converted into absolute lengths formal syntax <length>{1,2} | auto | [ <page-size> | [ portrait | landscape ] ] examples specifying size and orientation @page { size: 4in 6in landscape; } nesting inside a @media rule @media print { @page { size: 50mm 150mm; } } specifications specification status comment css paged media module level 3the def
inition of 'size' in that specification. working draft
initial def
inition ...
@page - CSS: Cascading Style Sheets
m-right | @bottom-right-corner | @left-top | @left-middle | @left-bottom | @right-top | @right-middle | @right-bottom examples @page pseudo-class examples please refer to the various pseudo-classes of @page for examples. :blank :first :left :right :recto :verso specifications specification status comment css logical properties and values level 1the def
inition of ':recto and :verso' in that specification. editor's draft adds the :recto and :verso page selectors css paged media module level 3the def
inition of '@page' in that specification. working draft no change from css level 2 (revision 1), though more css at-rules can be used inside a @page. css level 2 (revision 1)the def
inition of '@page' in that specification. ...
... :verso' in that specification. editor's draft adds the :recto and :verso page selectors css paged media module level 3the def
inition of '@page' in that specification. ...
... that specification. editor's draft adds the :recto and :verso page selectors css paged media module level 3the def
inition of '@page' in that specification. working draft no change from css level 2 (revision 1), though more css at-rules can be used inside a @page. ...
height - CSS: Cascading Style Sheets
will set the minimum height and the second value will set the maximum height. syntax /* one value */ height: auto; height: 320px; height: 15em; /* two values */ height: 320px 200px; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. ...
...ht: 320px; height: 15em; /* two values */ height: 320px 200px; values auto the used value is calculated from the other css descriptors' values. <length> a non-negative absolute or relative length. <percentage> a percentage value relative to the width or height of the
initial viewport at zoom factor 1.0, for horizontal and vertical lengths respectively. must be non-negative. formal def
inition related at-rule@viewport
initial valueas each of the properties of the shorthand:min-height: automax-height: nonepercentagesas each of the properties of the shorthand:min-height: the percentage is calculated with respect to the height of the generated box's containing block. if the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element...
... lengthmax-height: the percentage as specified or the absolute length or none formal syntax <viewport-length>{1,2}where <viewport-length> = auto | <length-percentage>where <length-percentage> = <length> | <percentage> examples setting minimum and maximum height @viewport { height: 500px; } specifications specification status comment css device adaptationthe def
inition of '"height" descriptor' in that specification. working draft
initial def
inition ...
max-zoom - CSS: Cascading Style Sheets
yntax /* keyword value */ max-zoom: auto; /* <number> values */ max-zoom: 0.8; max-zoom: 2.0; /* <percentage> value */ max-zoom: 150%; values auto the user agent will set the document's upper zoom factor limit. <number> a non-negative number limiting the maximum value of the zoom factor. <percentage> a non-negative percentage limiting the maximum value of the zoom factor. ...
...om: auto; /* <number> values */ max-zoom: 0.8; max-zoom: 2.0; /* <percentage> value */ max-zoom: 150%; values auto the user agent will set the document's upper zoom factor limit. <number> a non-negative number limiting the maximum value of the zoom factor. <percentage> a non-negative percentage limiting the maximum value of the zoom factor. formal def
inition related at-rule@viewport
initial valueautopercentagesthe zoom factor itselfcomputed valueauto, or a non-negative number or percentage as specified formal syntax auto | <number> | <percentage> examples setting max-zoom @viewport { max-zoom: 1.5; } specifications specification status comment css device adaptationthe def
inition of '"max-zoom" descriptor' in that specification. working d...
...eautopercentagesthe zoom factor itselfcomputed valueauto, or a non-negative number or percentage as specified formal syntax auto | <number> | <percentage> examples setting max-zoom @viewport { max-zoom: 1.5; } specifications specification status comment css device adaptationthe def
inition of '"max-zoom" descriptor' in that specification. working draft
initial def
inition ...
min-zoom - CSS: Cascading Style Sheets
yntax /* keyword value */ min-zoom: auto; /* <number> values */ min-zoom: 0.8; min-zoom: 2.0; /* <percentage> value */ min-zoom: 150%; values auto the user agent will set the document's lower zoom factor limit. <number> a non-negative number limiting the minimum value of the zoom factor. <percentage> a non-negative percentage limiting the minimum value of the zoom factor. ...
...om: auto; /* <number> values */ min-zoom: 0.8; min-zoom: 2.0; /* <percentage> value */ min-zoom: 150%; values auto the user agent will set the document's lower zoom factor limit. <number> a non-negative number limiting the minimum value of the zoom factor. <percentage> a non-negative percentage limiting the minimum value of the zoom factor. formal def
inition related at-rule@viewport
initial valueautopercentagesthe zoom factor itselfcomputed valueauto, or a non-negative number or percentage as specified formal syntax auto | <number> | <percentage> examples setting min zoom factor @viewport { min-zoom: 2.0; } specifications specification status comment css device adaptationthe def
inition of '"min-zoom" descriptor' in that specification. worki...
...opercentagesthe zoom factor itselfcomputed valueauto, or a non-negative number or percentage as specified formal syntax auto | <number> | <percentage> examples setting min zoom factor @viewport { min-zoom: 2.0; } specifications specification status comment css device adaptationthe def
inition of '"min-zoom" descriptor' in that specification. working draft
initial def
inition ...
user-zoom - CSS: Cascading Style Sheets
zoom: fixed; syntax values zoom the user can zoom in or out. fixed the user cannot zoom in or out. accessibility concerns disabling zooming capabilities prevents people experiencing low vision conditions from being able to read and understand page content. ...
...zoom the user can zoom in or out. fixed the user cannot zoom in or out. accessibility concerns disabling zooming capabilities prevents people experiencing low vision conditions from being able to read and understand page content. ...
...ions understanding success criterion 1.4.4 | understanding wcag 2.0 formal def
inition related at-rule@viewport
initial valuezoompercentagesrefer to the size of bounding boxcomputed valueas specified formal syntax zoom | fixed examples disabling user zoom @viewport { user-zoom: fixed; } specifications specification status comment css device adaptationthe def
inition of '"user-zoom" descriptor' in that specification. working draft
initial def
inition ...
viewport-fit - CSS: Cascading Style Sheets
contain the viewport is scaled to fit the largest rectangle inscribed within the display. cover the viewport is scaled to fill the device display. ...
...area inset variables to ensure that important content doesn't end up outside the display. this descriptor hasn't been added to https://github.com/mdn/data/blob/master/css/at-rules.json yet. accessibility concerns when using the viewport-fit descriptor, one must keep in mind that not all device displays are rectangular, and should therefore make use of the safe area inset variables. ...
...at important content doesn't end up outside the display. this descriptor hasn't been added to https://github.com/mdn/data/blob/master/css/at-rules.json yet. accessibility concerns when using the viewport-fit descriptor, one must keep in mind that not all device displays are rectangular, and should therefore make use of the safe area inset variables. formal def
inition related at-rule@viewport
initial valueautocomputed valueas specified formal syntax auto | contain | cover examples scaling viewport to fit device display @viewport { viewport-fit: cover; } specifications specification status comment css round display level 1the def
inition of '"viewport-fit" descriptor' in that specification. working draft
initial def
inition. ...
CSS Flexible Box Layout - CSS: Cascading Style Sheets
on the cross axis, due to the default value of align-items being stretch. the items stretch to the height of the flex container, making them each appear as tall as the tallest item. reference css properties flex flex-basis flex-direction flex-flow flex-grow flex-shrink flex-wrap order alignment properties the properties align-content, align-self, align-items and justify-content
initially appeared in the flexbox specification, but are now defined in box alignment. the flexbox spec now refers to the box alignment specification for up to date def
initions. also additional alignment properties are now defined in box alignment. justify-content align-content align-items align-self place-content place-items row-gap column-gap gap glossary entries flexbox flex con...
... ...
...ms in those lines. typical use cases of flexbox common design patterns that are typical flexbox use cases. backwards compatibility of flexbox browser status of flexbox, interoperability issues and supporting older browsers and versions of the spec specifications specification status comment css flexible box layout module candidate recommendation
initial def
inition. ...
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
div> <div>four <br>this cell <br>has extra <br>content. <br>max is auto <br>so the row expands. </div> <div>five</div> </div> .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 10px; grid-auto-rows: minmax(100px, auto); } you can also pass in a track listing, this will repeat. the following track listing will create an
initial implicit row track as 100 pixels and a second as 200px. this will continue for as long as content is added to the implicit grid. * {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: #d...
...src="https://udn.realityripple.com/samples/72/ab41das78e.png" alt="placeholder"></li> <li><img src="https://udn.realityripple.com/samples/72/ab41das78e.png" alt="placeholder"></li> <li><img src="https://udn.realityripple.com/samples/72/ab41das78e.png" alt="placeholder"></li> </ul> auto-placement can also help you lay out interface items which do have logical order. ...
...ples/72/ab41das78e.png" alt="placeholder"></li> <li><img src="https://udn.realityripple.com/samples/72/ab41das78e.png" alt="placeholder"></li> <li><img src="https://udn.realityripple.com/samples/72/ab41das78e.png" alt="placeholder"></li> </ul> auto-placement can also help you lay out interface items which do have logical order. an example is the def
inition list in this next example. def
inition lists are an interesting challenge to style as they are flat, there is nothing wrapping the groups of dt and dd items. in my example i am allowing auto-placement to place the items, however i have classes that start a dt in column 1, and dd in column 2, this ensure that terms go on one side and def
initions on the other - no matter how many of each we have. * {box-sizing: border-box;} .wrap...
Grid template areas - CSS: Cascading Style Sheets
-areas: "content img"; } .media .image { grid-area: img; background-color: #ffd8a8; } .media .text { grid-area: content; padding: 10px; } <div class="media flipped"> <div class="image"></div> <div class="text">this is a media object example. we can use grid-template-areas to switch around the image and text part of the media object. </div> </div> grid def
inition shorthands having looked at various ways of placing items on our grids and many of the properties used to define grid, this is a good time to take a look at a couple of shorthands that are available for defining the grid and many things about it all in one line of css. these can quickly become difficult to read for other developers, or even your future self. however they are part of the spec...
...ome difficult to read for other developers, or even your future self. however they are part of the specification and it is likely you will come across them in examples or in use by other developers, even if you choose not to use them. before using any shorthand it is worth remembering that shorthands not only enable the setting of many properties in one go, they also act to reset things to their
initial values that you do not, or cannot set in the shorthand. therefore if you use a shorthand, be aware that it may reset things you have applied elsewhere. the two shorthands for the grid container are the explicit grid shorthand grid-template and the grid def
inition shorthand grid. grid-template the grid-template property sets the following properties: grid-template-rows grid-template-colu...
... hd hd" minmax(100px, auto) "sd sd sd main main main main main main" minmax(100px, auto) "ft ft ft ft ft ft ft ft ft" minmax(100px, auto) / 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr ; } we will revisit the other functionality offered by this shorthand later in these guides when we take a look at auto placement and the grid-auto-flow property. if you have worked through these
initial guides you now should be in a position to create grid layouts using line-based placement or named areas. take some time to build some common layout patterns using grid, while there are lots of new terms to learn, the syntax is relatively straightforward. as you develop examples, you are likely to come up with some questions and use cases for things we haven't covered yet. in the rest of these ...
Using CSS counters - CSS: Cascading Style Sheets
ss 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 incremented 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-increment. 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 displayed...
...th the given name in scope at the given pseudo-element, 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. */ } h3::before { counter-increment: section; /* increment the value of section counter by 1 */ content: "section " counter(section) ": "; /* display the word 'section ', the value of section counter, and a colon before the content of each h3 */ } html ...
...em</li> <!-- 2.3.3 --> </ol> </li> <li>item</li> <!-- 2.4 --> </ol> </li> <li>item</li> <!-- 3 --> <li>item</li> <!-- 4 --> </ol> <ol> <li>item</li> <!-- 1 --> <li>item</li> <!-- 2 --> </ol> result specifications specification status comment css lists module level 3the def
inition of 'css counters' in that specification. working draft no change css level 2 (revision 1)the def
inition of 'css counters' in that specification. recommendation
initial def
inition ...
CSS Motion Path - CSS: Cascading Style Sheets
which wasn't ideal and only allowed for simple movements. with offset-path you can define a specific path of any shape you want. you then animate it along that path by animating offset-distance, and can choose to rotate it at any point using offset-rotate. ...
... ...
... ...
Overview of CSS Shapes - CSS: Cascading Style Sheets
he item in a rectangular fashion. if you then apply a circle shape, the text would then wrap round the line of the circle. there are a number of ways to create these shapes and in these guides we will find out how css shapes work, and consider some ways you might like to use them. what does the specification define? the specification defines three new properties: shape-outside — allows def
inition of basic shapes shape-image-threshold — sets an opacity threshold value. if an image is being used to define the shape, only the parts of the image that are the same opacity or greater than the threshold value are used in the shape. any other parts are ignored. shape-margin — sets a margin around the defined shape defining basic shapes the shape-outside property allows us to a define ...
...mage with a fully transparent area, and we are using an image as the url value for shape-outside. the shape is created around the opaque area — the image of the balloon. shape-image-threshold the shape-image-threshold property is used to set the threshold of image transparency used to define the area of the image used for the shape. if the value of shape-image-threshold is 0.0 (which is the
initial value) then the area must be fully transparent. if the value is 1.0 then it is fully opaque. values in between mean that you can set a semi-transparent area as the defining area of the shape. you can see the threshold in action if we use a gradient as the image on which to define our shape. in the example below, if you change the threshold the path that the shape takes changes based on the le...
...age. if your polygon isn’t quite right you can use the shapes editor to tweak it, then copy the new value back into your css. the shape path editor will be enabled by default in firefox 60 for shapes generated via clip-path. you can also use it to edit shapes generated via shape-outside, but only when you enable it via the layout.css.shape-outside.enabled pref. future css shapes features the
initial shapes specification included a property shape-inside for creating shapes inside an element. this property, along with the possibility of creating shapes on non-floated elements, has been moved to level 2 of the specification. as the shape-inside property was
initially in level 1 of the specification, you may find tutorials on the web detailing both properties. ...
CSS values and units - CSS: Cascading Style Sheets
see the <custom-ident> and <string> reference pages for more details. pre-defined keyword values pre-defined keywords are text values defined by the specification for that property. these keywords are also css identifiers and are therefore used without quotes. when viewing...
...eywords will be listed in the following form. the following values are the pre-defined keyword values allowed for float. left | right | none | inline-start | inline-end such values are used without quotes: .box { float: left; } css-wide values in addition to the pre-defined keywords that are part of the specification for a property, all css properties accept the css-wide property values
initial, inherit, and unset, which explicitly specify defaulting behaviors. the
initial keyword represents the value specified as the property’s
initial value. the inherit keyword represents the computed value of the property on the element’s parent, provided it is inherited. the unset keyword acts as either inherit or
initial, depending on whether the property is inherited or not. a fourth val...
...the alpha value. adds hwb(), device-cmyk(), and color() functions. css color module level 3 recommendation deprecates system-colors. adds svg colors. adds the rgba(), hsl(), and hsla() functions. css images module level 4 working draft adds element(), image(), image-set(), conic-gradient() css images module level 3 candidate recommendation
initial def
inition of image. css level 2 (revision 1) recommendation css level 1 recommendation
initial def
inition. ...
Introducing the CSS Cascade - CSS: Cascading Style Sheets
or the other. resetting styles after your content has finished altering styles, it may find itself in a situation where it needs to restore them to a known state. this may happen in cases of animations, theme changes, and so forth. the css property all lets you quickly set (almost) everything in css back to a known state. all lets you opt to immediately restore all properties to any of their
initial (default) state, the state inherited from the previous level of the cascade, a specific origin (the user-agent stylesheet, the author stylesheet, or the user stylesheet), or even to clear the values of the properties entirely. css animations and the cascade css animations, using @keyframes at-rules, define animations between states. keyframes don't cascade, meaning that at any given time css...
... ...
...candidate recommendation added the revert keyword, which allows rolling a property back a cascade level. css cascading and inheritance level 3 candidate recommendation removed the override cascade origin, as it was never used in a w3c standard. css level 2 (revision 1)the def
inition of 'the cascade' in that specification. recommendation css level 1the def
inition of 'the cascade' in that specification. recommendation
initial def
inition. ...
General sibling combinator - CSS: Cascading Style Sheets
...
... ...
...e> <span>and this is a red span!</span> result specifications specification status comment selectors level 4the def
inition of 'subsequent-sibling combinator' in that specification. working draft renames it the "subsequent-sibling" combinator. selectors level 3the def
inition of 'general sibling combinator' in that specification. recommendation
initial def
inition. ...
Selector list - CSS: Cascading Style Sheets
s in its arguments, but at the cost of all selectors having the same specificity, because of how :is() calculates specificity. ...
.... ...
...ly: sans-serif } h3 { font-family: sans-serif } :is(h1, h2:maybe-unsupported, h3) { font-family: sans-serif } specifications specification status comment selectors level 4the def
inition of 'selector lists' in that specification. working draft renamed to "selector list" css level 1the def
inition of 'grouping' in that specification. recommendation
initial def
inition ...
Type selectors - CSS: Cascading Style Sheets
type within a document. /* all <a> elements. */ a { color: red; } syntax element { style properties } examples css span { background-color: skyblue; } html <span>here's a span with some text.</span> <p>here's a p with some text.</p> <span>here's a span with more text.</span> result specifications specification status comment selectors level 4the def
inition of 'type (tag name) selector' in that specification. working draft no changes selectors level 3the def
inition of 'type selectors' in that specification. recommendation no changes css level 2 (revision 1)the def
inition of 'type selectors' in that specification. recommendation css level 1the def
inition of 'type selectors' in that specification. re...
...g name) selector' in that specification. working draft no changes selectors level 3the def
inition of 'type selectors' in that specification. recommendation no changes css level 2 (revision 1)the def
inition of 'type selectors' in that specification. ...
...ector' in that specification. working draft no changes selectors level 3the def
inition of 'type selectors' in that specification. recommendation no changes css level 2 (revision 1)the def
inition of 'type selectors' in that specification. ...
Universal selectors - CSS: Cascading Style Sheets
omatically clear the next sibling after a floating element */ .floating + * { clear: left; } html <p class="warning"> <span lang="en-us">a green span</span> in a red paragraph. </p> <p id="maincontent" lang="en-gb"> <span class="warning">a red span</span> in a green paragraph. </p> result specifications specification status comment selectors level 4the def
inition of 'universal selector' in that specification. working draft no changes selectors level 3the def
inition of 'universal selector' in that specification. recommendation defines behavior regarding namespaces and adds hint that omitting the selector is allowed within pseudo-elements css level 2 (revision 1)the def
inition of 'universal selector' in that specification. ...
...lector' in that specification. working draft no changes selectors level 3the def
inition of 'universal selector' in that specification. ...
...that specification. working draft no changes selectors level 3the def
inition of 'universal selector' in that specification. ...
Actual value - CSS: Cascading Style Sheets
ions have been applied. for example, a user agent that can only render borders with a whole-number pixel width may round the thickness of the border to the nearest integer. calculating a property's actual value the user agent performs four steps to calculate a property's actual (final) value: first, the specified value is determined based on the result of cascading, inheritance, or using the
initial value. next, the computed value is calculated according to the specification (for example, a span with position: absolute will have its computed display changed to block). then, layout is calculated, resulting in the used value. finally, the used value is transformed according to the limitations of the local environment, resulting in the actual value. specifications specificatio...
... ...
...its computed display changed to block). then, layout is calculated, resulting in the used value. finally, the used value is transformed according to the limitations of the local environment, resulting in the actual value. specifications specification status comment css level 2 (revision 1)the def
inition of 'actual value' in that specification. recommendation
initial def
inition. ...
animation-direction - CSS: Cascading Style Sheets
animation to set all animation properties at once. syntax /* single animation */ animation-direction: normal; animation-direction: reverse; animation-direction: alternate; animation-direction: alternate-reverse; /* multiple animations */ animation-direction: normal, reverse; animation-direction: alternate, reverse, normal; /* global values */ animation-direction: inherit; animation-direction:
initial; animation-direction: unset; values normal the animation plays forwards each cycle. in other words, each time the animation cycles, the animation will reset to the beginning state and start over again. this is the default value. reverse the animation plays backwards each cycle. in other words, each time the animation cycles, the animation will reset to the end state and start over agai...
...t iteration being played backwards. the count to determine if a cycle is even or odd starts at one. note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property values. formal def
inition
initial valuenormalapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <single-animation-direction>#where <single-animation-direction> = normal | reverse | alternate | alternate-reverse examples see css animations for examples. specifications specification status comment css ani...
...aluenormalapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <single-animation-direction>#where <single-animation-direction> = normal | reverse | alternate | alternate-reverse examples see css animations for examples. specifications specification status comment css animationsthe def
inition of 'animation-direction' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewch...
background-image - CSS: Cascading Style Sheets
marily for screen readers, as a screen reader will not announce its presence and therefore convey nothing to its users. if the image contains information critical to understanding the page's overall purpose, it is better to describe it semantically in the document. mdn understanding wcag, guideline 1.1 explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0 formal def
inition
initial valuenoneapplies toall elements. it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specified, but with <url> values made absoluteanimation typediscrete formal syntax <bg-image>#where <bg-image> = none | <image>where <image> = <url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>where <image()> = image( <image-tags>? [ ...
... recommendation from css1, the way images with and without intrinsic dimensions are handled is now describ...
...und-color: transparent; } result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'background-image' in that specification. candidate recommendation from css2 revision 1, the property has been extended to support multiple backgrounds and any <image> css data type. css level 2 (revision 1)the def
inition of 'background-image' in that specification. recommendation from css1, the way images with and without intrinsic dimensions are handled is now described. css level 1the def
inition of 'background-image' in that specification. recommendation
initial def
inition. ...
background-size - CSS: Cascading Style Sheets
using a width value only, in which case the height defaults to auto. using both a width and a height value, in which case the first sets the width and the second sets the height. each value can be a <length>, a <percentage>, or auto. to specify th...
...ckground-size: 25px 50px; background-size: 50% 50%; } note that it's particularly not recommended to use a pixel dimension and an auto dimension with a <gradient>, because it's impossible to replicate rendering in versions of firefox prior to 8, and in browsers not implementing firefox 8's rendering, without knowing the exact size of the element whose background is being specified. formal def
inition
initial valueauto autoapplies toall elements. it also applies to ::first-letter and ::first-line.inheritednopercentagesrelative to the background positioning areacomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typerepeatable list of simple list of length, percentage, or calc formal syntax <bg-size>#where <bg-size> = [ <length-percentage> | auto...
...typerepeatable list of simple list of length, percentage, or calc formal syntax <bg-size>#where <bg-size> = [ <length-percentage> | auto ]{1,2} | cover | containwhere <length-percentage> = <length> | <percentage> examples please see scaling background images for examples. specifications specification status comment css backgrounds and borders module level 3the def
inition of 'background-size' in that specification. candidate recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid we...
border-block-color - CSS: Cascading Style Sheets
olor and border-left-color property depending on the values defined for writing-mode, direction, and text-orientation. border-block-color: yellow; border-block-color: #f5f6f7; the border color in the other dimension can be set with border-inline-color which sets border-inline-start-color, and border-inline-end-color. syntax values <'color'> the color of the border. see color. ...
...border-left-color property depending on the values defined for writing-mode, direction, and text-orientation. border-block-color: yellow; border-block-color: #f5f6f7; the border color in the other dimension can be set with border-inline-color which sets border-inline-start-color, and border-inline-end-color. syntax values <'color'> the color of the border. see color. ...
... border with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-block-color: red; } results specifications specification status comment css logical properties and values level 1the def
inition of 'border-block-color' in that specification. editor's draft
initial def
inition ...
border-block-end-color - CSS: Cascading Style Sheets
s project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax border-block-end-color: yellow; border-block-end-color: #f5f6f7; related properties are border-block-start-color, border-inline-start-color, and border-inline-end-color, which define the other border colors of the element. values <'color'> the color of the border. see color. ...
..., please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax border-block-end-color: yellow; border-block-end-color: #f5f6f7; related properties are border-block-start-color, border-inline-start-color, and border-inline-end-color, which define the other border colors of the element. values <'color'> the color of the border. see color. ...
...olor with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-block-end-color: red; } results specifications specification status comment css logical properties and values level 1the def
inition of 'border-block-end-color' in that specification. editor's draft
initial def
inition ...
border-block-end-style - CSS: Cascading Style Sheets
a pull request. syntax /* <'border-style'> values */ border-block-end-style: dashed; border-block-end-style: dotted; border-block-end-style: groove; related properties are border-block-start-style, border-inline-start-style, and border-inline-end-style, which define the other border styles of the element. values <'border-style'> the line style of the border. see border-style. ...
...quest. syntax /* <'border-style'> values */ border-block-end-style: dashed; border-block-end-style: dotted; border-block-end-style: groove; related properties are border-block-start-style, border-inline-start-style, and border-inline-end-style, which define the other border styles of the element. values <'border-style'> the line style of the border. see border-style. ...
...er with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-block-end-style: dashed; } results specifications specification status comment css logical properties and values level 1the def
inition of 'border-block-end-style' in that specification. editor's draft
initial def
inition ...
border-block-end-width - CSS: Cascading Style Sheets
com/mdn/interactive-examples and send us a pull request. syntax /* <'border-width'> values */ border-block-end-width: 5px; border-block-end-width: thick; related properties are border-block-start-width, border-inline-start-width, and border-inline-end-width, which define the other border widths of the element. values <'border-width'> the width of the border. see border-width. ...
...nteractive-examples and send us a pull request. syntax /* <'border-width'> values */ border-block-end-width: 5px; border-block-end-width: thick; related properties are border-block-start-width, border-inline-start-width, and border-inline-end-width, which define the other border widths of the element. values <'border-width'> the width of the border. see border-width. ...
...width with veritcal text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 1px solid blue; border-block-end-width: 5px; } results specifications specification status comment css logical properties and values level 1the def
inition of 'border-block-end-width' in that specification. editor's draft
initial def
inition ...
border-block-end - CSS: Cascading Style Sheets
s are border-block-start, border-inline-start, and border-inline-end, which define the other borders of the element. values the border-block-end is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. <'border-style'> the line style of the border. see border-style. <'color'> the color of the border. see color. ...
...der-block-start, border-inline-start, and border-inline-end, which define the other borders of the element. values the border-block-end is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. <'border-style'> the line style of the border. see border-style. <'color'> the color of the border. see color. ...
...<angle> examples border with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; border-block-end: 5px dashed blue; } results specifications specification status comment css logical properties and values level 1the def
inition of 'border-block-end' in that specification. editor's draft
initial def
inition ...
border-block-start-color - CSS: Cascading Style Sheets
interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax border-block-start-color: blue; border-block-start-color: #4c5d21; related properties are border-block-end-color, border-inline-start-color, and border-inline-end-color, which define the other border colors of the element. ...
...ve examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax border-block-start-color: blue; border-block-start-color: #4c5d21; related properties are border-block-end-color, border-inline-start-color, and border-inline-end-color, which define the other border colors of the element. ...
...or with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-block-start-color: red; } results specifications specification status comment css logical properties and values level 1the def
inition of 'border-block-start-color' in that specification. editor's draft
initial def
inition ...
border-block-start-style - CSS: Cascading Style Sheets
ll request. syntax /* <'border-style'> values */ border-block-start-style: dashed; border-block-start-style: dotted; border-block-start-style: groove; related properties are border-block-end-style, border-inline-start-style, and border-inline-end-style, which define the other border styles of the element. values <'border-style'> the line style of the border. see border-style. ...
...t. syntax /* <'border-style'> values */ border-block-start-style: dashed; border-block-start-style: dotted; border-block-start-style: groove; related properties are border-block-end-style, border-inline-start-style, and border-inline-end-style, which define the other border styles of the element. values <'border-style'> the line style of the border. see border-style. ...
... wtih vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-block-start-style: dashed; } results specifications specification status comment css logical properties and values level 1the def
inition of 'border-block-start-style' in that specification. editor's draft
initial def
inition ...
border-block-start - CSS: Cascading Style Sheets
s are border-block-end, border-inline-start, and border-inline-end, which define the other borders of the element. values the border-block-start is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. <'border-style'> the line style of the border. see border-style. <'color'> the color of the border. see color. ...
...der-block-end, border-inline-start, and border-inline-end, which define the other borders of the element. values the border-block-start is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. <'border-style'> the line style of the border. see border-style. <'color'> the color of the border. see color. ...
...ber> | <angle> examples border with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; border-block-start: 5px dashed blue; } specifications specification status comment css logical properties and values level 1the def
inition of 'border-block-start' in that specification. editor's draft
initial def
inition ...
border-block-style - CSS: Cascading Style Sheets
ng-mode, direction, and text-orientation. /* <'border-style'> values */ border-block-style: dashed; border-block-style: dotted; border-block-style: groove; the border style in the other dimension can be set with border-inline-style, which sets border-inline-start-style, and border-inline-end-style. syntax values <'border-style'> the line style of the border. see border-style. ...
...direction, and text-orientation. /* <'border-style'> values */ border-block-style: dashed; border-block-style: dotted; border-block-style: groove; the border style in the other dimension can be set with border-inline-style, which sets border-inline-start-style, and border-inline-end-style. syntax values <'border-style'> the line style of the border. see border-style. ...
...border with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-block-style: dashed; } results specifications specification status comment css logical properties and values level 1the def
inition of 'border-block-style' in that specification. editor's draft
initial def
inition ...
border-block-width - CSS: Cascading Style Sheets
nding on the values defined for writing-mode, direction, and text-orientation. /* <'border-width'> values */ border-block-width: 5px; border-block-width: thick; the border width in the other dimension can be set with border-inline-width, which sets border-inline-start-width, and border-inline-end-width. syntax values <'border-width'> the width of the border. see border-width. ...
...the values defined for writing-mode, direction, and text-orientation. /* <'border-width'> values */ border-block-width: 5px; border-block-width: thick; the border width in the other dimension can be set with border-inline-width, which sets border-inline-start-width, and border-inline-end-width. syntax values <'border-width'> the width of the border. see border-width. ...
...der width with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 1px solid blue; border-block-width: 5px; } results specifications specification status comment css logical properties and values level 1the def
inition of 'border-block-width' in that specification. editor's draft
initial def
inition ...
border-block - CSS: Cascading Style Sheets
a shorthand for the following css properties: border-block-color border-block-style border-block-width syntax values the border-block is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. <'border-style'> the line style of the border. see border-style. <'color'> the color of the border. see color. ...
...and for the following css properties: border-block-color border-block-style border-block-width syntax values the border-block is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. <'border-style'> the line style of the border. see border-style. <'color'> the color of the border. see color. ...
...> | <angle> examples border with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; border-block: 5px dashed blue; } results specifications specification status comment css logical properties and values level 1the def
inition of 'border-block' in that specification. editor's draft
initial def
inition ...
border-image-outset - CSS: Cascading Style Sheets
send us a pull request. syntax /* <length> value */ border-image-outset: 1rem; /* <number> value */ border-image-outset: 1.5; /* vertical | horizontal */ border-image-outset: 1 1.2; /* top | horizontal | bottom */ border-image-outset: 30px 2 45px; /* top | right | bottom | left */ border-image-outset: 7px 12px 14px 5px; /* global values */ border-image-outset: inherit; border-image-outset:
initial; border-image-outset: unset; the border-image-outset property may be specified as one, two, three, or four values. each value is a <length> or <number>. negative values are invalid and will cause the border-image-outset declaration to be ignored. if one value is specified, it applies to all four sides. if two values are specified, the first applies to the top and bottom and the second to...
...at 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.5rem, and border-image-outset: 2, the final border-image-outset would be calculated as 2em 4px 0 3rem. formal def
inition
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 syntax [ <length> | <number> ]{1,4} examples outsetting a border image html <div id="outset">this element has an...
...<div id="outset">this element has an outset border image!</div> css #outset { width: 10rem; background: #cef; border: 1.4rem solid; border-image: radial-gradient(#ff2, #55f) 40; border-image-outset: 1.5; /* 1.5 × 1.4rem = 2.1rem */ margin: 2.1rem; } result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-image-outset' in that specification. candidate recommendation
initial def
inition ...
border-image-repeat - CSS: Cascading Style Sheets
the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword value */ border-image-repeat: stretch; border-image-repeat: repeat; border-image-repeat: round; border-image-repeat: space; /* vertical | horizontal */ border-image-repeat: round stretch; /* global values */ border-image-repeat: inherit; border-image-repeat:
initial; border-image-repeat: unset; the border-image-repeat property may be specified using one or two values chosen from the list of values below. when one value is specified, it applies the same behavior on all four sides. when two values are specified, the first applies to the top and bottom, the second to the left and right. values stretch the source image's edge regions are stretched...
...ween each border. tiles may be clipped to achieve the proper fit. round the source image's edge regions are tiled (repeated) to fill the gap between each border. tiles may be stretched to achieve the proper fit. space the source image's edge regions are tiled (repeated) to fill the gap between each border. extra space will be distributed in between tiles to achieve the proper fit. formal def
inition
initial valuestretchapplies toall elements, except internal table elements when border-collapse is collapse. it also applies to ::first-letter.inheritednocomputed valueas specifiedanimation typediscrete formal syntax [ stretch | repeat | round | space ]{1,2} examples repeating border images css #bordered { width: 12rem; margin-bottom: 1rem; padding: 1rem; border: 40px solid; b...
...n value="space round">space round</option> </select> javascript var repetition = document.getelementbyid("repetition"); repetition.addeventlistener("change", function (evt) { document.getelementbyid("bordered").style.borderimagerepeat = evt.target.value; }); results specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-image-repeat' in that specification. candidate recommendation
initial def
inition ...
border-image-slice - CSS: Cascading Style Sheets
the final border image. syntax /* all sides */ border-image-slice: 30%; /* vertical | horizontal */ border-image-slice: 10% 30%; /* top | horizontal | bottom */ border-image-slice: 30 30% 45; /* top | right | bottom | left */ border-image-slice: 7 12 14 5; /* using the `fill` keyword */ border-image-slice: 10% fill 7 12; /* global values */ border-image-slice: inherit; border-image-slice:
initial; border-image-slice: unset; the border-image-slice property may be specified using one to four <number-percentage> values to represent the position of each image slice. negative values are invalid; values greater than their corresponding dimension are clamped to 100%. when one position is specified, it creates all four slices at the same distance from their respective sides. when two pos...
... these cases. <percentage> represents an edge offset as a percentage of the source image's size: the width of the image for horizontal offsets, the height for vertical offsets. fill preserves the middle image region and displays it like a background image, but stacked above the actual background. its width and height are sized to match the top and left image regions, respectively. formal def
inition
initial value100%applies toall elements, except internal table elements when border-collapse is collapse. it also applies to ::first-letter.inheritednopercentagesrefer to the size of the border imagecomputed valueone to four percentage(s) (as specified) or absolute length(s), plus the keyword fill if specifiedanimation typeby computed value type formal syntax <number-percentage>{1,4} && fil...
....value + 'px'; divelem.style.borderwidth = newvalue; widthoutput.textcontent = newvalue; }) sliceslider.addeventlistener('input', () => { const newvalue = sliceslider.value; divelem.style.borderimageslice = newvalue; sliceoutput.textcontent = newvalue; }) result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-image-slice' in that specification. candidate recommendation
initial defintion ...
border-image-width - CSS: Cascading Style Sheets
when one value is specified, it applies the same width to all four sides. when two values are specified, the first width applies to the top and bottom, the second to the left and right. when three values are specified, the first width a...
...not be negative. <number> the width of the border, specified as a multiple of the corresponding border-width. must not be negative. auto the width of the border is made equal to the intrinsic width or height (whichever is applicable) of the corresponding border-image-slice. if the image does not have the required intrinsic dimension, the corresponding border-width is used instead. formal def
inition
initial value1applies toall elements, except internal table elements when border-collapse is collapse. it also applies to ::first-letter.inheritednopercentagesrefer to the width or height of the border image areacomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typeby computed value type formal syntax [ <length-percentage> | <number> | auto ]{1,4...
..., no sea takimata sanctus est lorem ipsum dolor sit amet.</p> css p { border: 20px solid; border-image: url("/static/external/21/214842819586a8dd293c17b38d0fd0e26430146a86dd04294a53ecaeeea7d0e2.png") 30 round; border-image-width: 16px; padding: 40px; } result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-image-width' in that specification. candidate recommendation
initial def
inition ...
border-image - CSS: Cascading Style Sheets
lues may be specified. see border-image-repeat. accessibility concerns assistive technology cannot parse border images. if the image contains information critical to understanding the page's overall purpose, it is better to describe it semantically in the document. mdn understanding wcag, guideline 1.1 explanations understanding success criterion 1.1.1 | understanding wcag 2.0 formal def
inition
initial valueas each of the properties of the shorthand:border-image-source: noneborder-image-slice: 100%border-image-width: 1border-image-outset: 0border-image-repeat: stretchapplies toall elements, except internal table elements when border-collapse is collapse. it also applies to ::first-letter.inheritednopercentagesas each of the properties of the shorthand:border-image-slice: refer to th...
...it also applies to ::first-letter...
...radient-based border image!</div> css #gradient { width: 200px; border: 30px solid; border-image: repeating-linear-gradient(45deg, #f33, #3bf, #f33 30px) 60; padding: 20px; } result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-image' in that specification. candidate recommendation
initial def
inition
initial valueas each of the properties of the shorthand:border-image-source: noneborder-image-slice: 100%border-image-width: 1border-image-outset: 0border-image-repeat: stretchapplies toall elements, except internal table elements when border-collapse is collapse. it also applies to ::first-letter.inheritednopercentagesas each of the properties of the shorthand:border-image-s...
border-inline-color - CSS: Cascading Style Sheets
color and border-left-color property depending on the values defined for writing-mode, direction, and text-orientation. border-inline-color: yellow; border-inline-color: #f5f6f7; the border color in the other dimension can be set with border-block-color which sets border-block-start-color, and border-block-end-color. syntax values <'color'> the color of the border. see color. ...
... border-left-color property depending on the values defined for writing-mode, direction, and text-orientation. border-inline-color: yellow; border-inline-color: #f5f6f7; the border color in the other dimension can be set with border-block-color which sets border-block-start-color, and border-block-end-color. syntax values <'color'> the color of the border. see color. ...
...r color with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-inline-color: red; } results specifications specification status comment css logical properties and values level 1the def
inition of 'border-inline-color' in that specification. editor's draft
initial def
inition ...
border-inline-end-style - CSS: Cascading Style Sheets
pull request. syntax /* <'border-style'> values */ border-inline-end-style: dashed; border-inline-end-style: dotted; border-inline-end-style: groove; related properties are border-block-start-style, border-block-end-style, and border-inline-start-style, which define the other border styles of the element. values <'border-style'> the line style of the border. see border-style. ...
...est. syntax /* <'border-style'> values */ border-inline-end-style: dashed; border-inline-end-style: dotted; border-inline-end-style: groove; related properties are border-block-start-style, border-block-end-style, and border-inline-start-style, which define the other border styles of the element. values <'border-style'> the line style of the border. see border-style. ...
...op-style'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-inline-end-style: dashed; } results specifications specification status comment css logical properties and values level 1the def
inition of 'border-inline-end-style' in that specification. editor's draft
initial def
inition ...
border-inline-start-color - CSS: Cascading Style Sheets
s project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax border-inline-start-color: red; border-inline-start-color: #ee4141; related properties are border-block-start-color, border-block-end-color, and border-inline-end-color, which define the other border colors of the element. values <'color'> the color of the border. see color. ...
..., please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax border-inline-start-color: red; border-inline-start-color: #ee4141; related properties are border-block-start-color, border-block-end-color, and border-inline-end-color, which define the other border colors of the element. values <'color'> the color of the border. see color. ...
...'border-top-color'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-inline-start-color: red; } specifications specification status comment css logical properties and values level 1the def
inition of 'border-inline-start-color' in that specification. editor's draft
initial def
inition ...
border-inline-start-width - CSS: Cascading Style Sheets
/mdn/interactive-examples and send us a pull request. syntax /* <'border-width'> values */ border-inline-start-width: 5px; border-inline-start-width: thick; related properties are border-block-start-width, border-block-end-width, and border-inline-end-width, which define the other border widths of the element. values <'border-width'> the width of the border. see border-width. ...
...ractive-examples and send us a pull request. syntax /* <'border-width'> values */ border-inline-start-width: 5px; border-inline-start-width: thick; related properties are border-block-start-width, border-block-end-width, and border-inline-end-width, which define the other border widths of the element. values <'border-width'> the width of the border. see border-width. ...
...<'border-top-width'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 1px solid blue; border-inline-start-width: 5px; } specifications specification status comment css logical properties and values level 1the def
inition of 'border-inline-start-width' in that specification. editor's draft
initial def
inition ...
border-inline-start - CSS: Cascading Style Sheets
s are border-block-start, border-block-end, and border-inline-end, which define the other borders of the element. values the border-inline-start is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. <'border-style'> the line style of the border. see border-style. <'color'> the color of the border. see color. ...
...der-block-start, border-block-end, and border-inline-end, which define the other borders of the element. values the border-inline-start is specified with one or more of the following, in any order: <'border-width'> the width of the border. see border-width. <'border-style'> the line style of the border. see border-style. <'color'> the color of the border. see color. ...
...| <percentage><hue> = <number> | <angle> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; border-inline-start: 5px dashed blue; } specifications specification status comment css logical properties and values level 1the def
inition of 'border-inline-start' in that specification. editor's draft
initial def
inition ...
border-inline-style - CSS: Cascading Style Sheets
ng-mode, direction, and text-orientation. /* <'border-style'> values */ border-inline-style: dashed; border-inline-style: dotted; border-inline-style: groove; the border style in the other dimension can be set with border-block-style, which sets border-block-start-style, and border-block-end-style. syntax values <'border-style'> the line style of the border. see border-style. ...
...direction, and text-orientation. /* <'border-style'> values */ border-inline-style: dashed; border-inline-style: dotted; border-inline-style: groove; the border style in the other dimension can be set with border-block-style, which sets border-block-start-style, and border-block-end-style. syntax values <'border-style'> the line style of the border. see border-style. ...
...style'> examples html content <div> <p class="exampletext">example text</p> </div> css content div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-inline-style: dashed; } specifications specification status comment css logical properties and values level 1the def
inition of 'border-inline-style' in that specification. editor's draft
initial def
inition ...
border-inline-width - CSS: Cascading Style Sheets
r writing-mode, direction, and text-orientation. /* <'border-width'> values */ border-inline-width: 5px 10px; border-inline-width: 5px; border-inline-width: thick; the border width in the other dimension can be set with border-block-width, which sets border-block-start-width, and border-block-end-width. syntax values <'border-width'> the width of the border. see border-width. ...
...-mode, direction, and text-orientation. /* <'border-width'> values */ border-inline-width: 5px 10px; border-inline-width: 5px; border-inline-width: thick; the border width in the other dimension can be set with border-block-width, which sets border-block-start-width, and border-block-end-width. syntax values <'border-width'> the width of the border. see border-width. ...
... <'border-top-width'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 1px solid blue; border-inline-width: 5px 10px; } specifications specification status comment css logical properties and values level 1the def
inition of 'border-inline-width' in that specification. editor's draft
initial def
inition ...
border-left-style - CSS: Cascading Style Sheets
erent styles connect in the corners. syntax /* keyword values */ border-left-style: none; border-left-style: hidden; border-left-style: dotted; border-left-style: dashed; border-left-style: solid; border-left-style: double; border-left-style: groove; border-left-style: ridge; border-left-style: inset; border-left-style: outset; /* global values */ border-left-style: inherit; border-left-style:
initial; border-left-style: unset; the border-left-style property is specified as a single keyword chosen from those available for the border-style property. formal def
inition
initial valuenoneapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <line-style>where <line-style> = none | hidden | dotted | dashed | solid ...
... 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 h...
...left-style: groove;} .b8 {border-left-style: ridge;} .b9 {border-left-style: inset;} .b10 {border-left-style: outset;} result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-left-style' in that specification. candidate recommendation no significant change. css level 2 (revision 1)the def
inition of 'border-left-style' in that specification. recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchro...
border-left - CSS: Cascading Style Sheets
properties: border-left-color border-left-style border-left-width syntax border-left: 1px; border-left: 2px dotted; border-left: medium dashed green; the three values of the shorthand property can be specified in any order, and one or two of them may be omitted. values <br-width> see border-left-width. <br-style> see border-left-style. <color> see border-left-color. formal def
inition
initial valueas each of the properties of the shorthand:border-left-width: mediumborder-left-style: noneborder-left-color: currentcolorapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-left-style: as specifiedborder-left-color: co...
...= <number> | <angle> examples applying a left border html <div> this box has a border on the left side. </div> css div { border-left: 4px dashed blue; background-color: gold; height: 100px; width: 100px; font-weight: bold; text-align: center; } results specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-left' in that specification. candidate recommendation no direct changes, though the modification of values for the border-left-color do apply to it. css level 2 (revision 1)the def
inition of 'border-left' in that specification. recommendation no significant changes. css level 1the def
inition of 'border-left' in that specification. recommendation i...
...rder-left' in that specification. candidate recommendation no direct changes, though the modification of values for the border-left-color do apply to it. css level 2 (revision 1)the def
inition of 'border-left' in that specification. recommendation no significant changes. css level 1the def
inition of 'border-left' in that specification. recommendation
initial def
inition 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetborder-l...
border-right-style - CSS: Cascading Style Sheets
connect in the corners. syntax /* keyword values */ border-right-style: none; border-right-style: hidden; border-right-style: dotted; border-right-style: dashed; border-right-style: solid; border-right-style: double; border-right-style: groove; border-right-style: ridge; border-right-style: inset; border-right-style: outset; /* global values */ border-right-style: inherit; border-right-style:
initial; border-right-style: unset; the border-right-style property is specified as a single keyword chosen from those available for the border-style property. formal def
inition
initial valuenoneapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <line-style>where <line-style> = none | hidden | dotted | dashed | soli...
... 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...
...-style: groove;} .b8 {border-right-style: ridge;} .b9 {border-right-style: inset;} .b10 {border-right-style: outset;} result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-right-style' in that specification. candidate recommendation no significant change. css level 2 (revision 1)the def
inition of 'border-right-style' in that specification. recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchr...
border-right - CSS: Cascading Style Sheets
s: border-right-color border-right-style border-right-width syntax border-right: 1px; border-right: 2px dotted; border-right: medium dashed green; the three values of the shorthand property can be specified in any order, and one or two of them may be omitted. values <br-width> see border-right-width. <br-style> see border-right-style. <color> see border-right-color. formal def
inition
initial valueas each of the properties of the shorthand:border-right-width: mediumborder-right-style: noneborder-right-color: currentcolorapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-right-width: the absolute length or 0 if border-right-style is none or hiddenborder-right-style: as specifiedborder-right-co...
... <angle> examples applying a right border to a div html <div> this box has a border on the right side. </div> css div { border-right: 4px dashed blue; background-color: gold; height: 100px; width: 100px; font-weight: bold; text-align: center; } results specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-right' in that specification. candidate recommendation no direct changes, though the modification of values for the border-right-color do apply to it. css level 2 (revision 1)the def
inition of 'border-right' in that specification. recommendation no significant changes. css level 1the def
inition of 'border-right' in that specification. recommendation ...
... of 'border-right' in that specification. candidate recommendation no direct changes, though the modification of values for the border-right-color do apply to it. css level 2 (revision 1)the def
inition of 'border-right' in that specification. recommendation no significant changes. css level 1the def
inition of 'border-right' in that specification. recommendation
initial def
inition 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung inter...
border-top-left-radius - CSS: Cascading Style Sheets
uare. a background, being an image or a color, is clipped at the border, even a rounded one; the exact location of the clipping is defined by the value of the background-clip property. note: if the value of this property is not set in a border-radius shorthand property that is applied to the element after the border-top-left-radius css property, the value of this property is then reset to its
initial value by the shorthand property. syntax /* the corner is a circle */ /* border-top-left-radius: radius */ border-top-left-radius: 3px; /* the corner is an ellipse */ /* border-top-left-radius: horizontal vertical */ border-top-left-radius: 0.5em 1em; border-top-left-radius: inherit; with one value: the value is a <length> or a <percentage> denoting the radius of the circle to use for ...
...at corner. values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal def
inition
initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typ...
...der div { border-top-left-radius: 40%; } the background color is clipped at the border div { border-top-left-radius:40%; border-style: black 3px double; background-color: rgb(250,20,70); background-clip: content-box; } specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-top-left-radius' in that specification. candidate recommendation
initial def
inition ...
border-top-right-radius - CSS: Cascading Style Sheets
are. a background, being an image or a color, is clipped at the border, even a rounded one; the exact location of the clipping is defined by the value of the background-clip property. note: if the value of this property is not set in a border-radius shorthand property that is applied to the element after the border-top-right-radius css property, the value of this property is then reset to its
initial value by the shorthand property. syntax /* the corner is a circle */ /* border-top-right-radius: radius */ border-top-right-radius: 3px; /* the corner is an ellipse */ /* border-top-right-radius: horizontal vertical */ border-top-right-radius: 0.5em 1em; border-top-right-radius: inherit; with one value: the value is a <length> or a <percentage> denoting the radius of the circle to use...
...at corner. values <length-percentage> denotes the size of the circle radius or the semi-major and semi-minor axes of the ellipse. as absolute length it can be expressed in any unit allowed by the css <length> data type. percentages for the horizontal axis refer to the width of the box, percentages for the vertical axis refer to the height of the box. negative values are invalid. formal def
inition
initial value0applies toall elements; but user agents are not required to apply to table and inline-table elements when border-collapse is collapse. the behavior on internal table elements is undefined for the moment.. it also applies to ::first-letter.inheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typ...
...r div { border-top-right-radius: 40%; } the background color is clipped at the border div { border-top-right-radius:40%; border-style: black 3px double; background-color: rgb(250,20,70); background-clip: content-box; } specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-top-right-radius' in that specification. candidate recommendation
initial def
inition ...
border-top-style - CSS: Cascading Style Sheets
ers of different styles connect in the corners. syntax /* keyword values */ border-top-style: none; border-top-style: hidden; border-top-style: dotted; border-top-style: dashed; border-top-style: solid; border-top-style: double; border-top-style: groove; border-top-style: ridge; border-top-style: inset; border-top-style: outset; /* global values */ border-top-style: inherit; border-top-style:
initial; border-top-style: unset; the border-top-style property is specified as a single keyword chosen from those available for the border-style property. formal def
inition
initial valuenoneapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas specifiedanimation typediscrete formal syntax <line-style>where <line-style> = none | hidden | dotted | dashed | solid | ...
...it also applies to ::first-letter.inheritednocomputed valueas specifiedanimation typediscrete ...
...rder-top-style: groove;} .b8 {border-top-style: ridge;} .b9 {border-top-style: inset;} .b10 {border-top-style: outset;} result specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-top-style' in that specification. candidate recommendation no significant change. css level 2 (revision 1)the def
inition of 'border-top-style' in that specification. recommendation
initial def
inition.
initial valuenoneapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas specifiedanimation typediscrete ...
border-top - CSS: Cascading Style Sheets
wing css properties: border-top-color border-top-style border-top-width syntax border-top: 1px; border-top: 2px dotted; border-top: medium dashed green; the three values of the shorthand property can be specified in any order, and one or two of them may be omitted. values <br-width> see border-top-width. <br-style> see border-top-style. <color> see border-top-color. formal def
inition
initial valueas each of the properties of the shorthand:border-top-width: mediumborder-top-style: noneborder-top-color: currentcolorapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas each of the properties of the shorthand:border-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-top-style: as specifiedborder-top-color: computed ...
...e> = <number> | <angle> examples applying a top border html <div> this box has a border on the top side. ...
... 100px; font-weight: bold; text-align: center; } results specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-top' in that specification. candidate recommendation no direct changes, though the modification of values for the border-top-color do apply to it. css level 2 (revision 1)the def
inition of 'border-top' in that specification. recommendation no significant changes. css level 1the def
inition of 'border-top' in that specification. recommendation
initial def
inition 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-...
box-align - CSS: Cascading Style Sheets
ty specifies how an element aligns its contents across its layout in a perpendicular direction. the effect of the property is only visible if there is extra space in the box. see flexbox for information about the current standard. /* keyword values */ box-align: start; box-align: center; box-align: end; box-align: baseline; box-align: stretch; /* global values */ box-lines: inherit; box-lines:
initial; box-lines: unset; the direction of layout depends on the element's orientation: horizontal or vertical. syntax the box-align property is specified as one of the keyword values listed below. values start the box aligns contents at the start, leaving any extra space at the end. center the box aligns contents in the center, dividing any extra space equally between the start and the en...
...h the box stretches the contents so that there is no extra space in the box. notes the edge of the box designated the start for alignment purposes depends on the box's orientation: horizontal top vertical left the edge opposite to the start is designated the end. if the alignment is set using the element's align attribute, then the style is ignored. ...
...x stretches the contents so that there is no extra space in the box. notes the edge of the box designated the start for alignment purposes depends on the box's orientation: horizontal top vertical left the edge opposite to the start is designated the end. if the alignment is set using the element's align attribute, then the style is ignored. ...
box-direction - CSS: Cascading Style Sheets
box-direction has been replaced by flex-direction. see flexbox for information about the current standard. the box-direction css property specifies whether a box lays out its contents normally (from the top or left edge), or in reverse (from the bottom or right edge). /* keyword values */ box-direction: normal; box-direction: reverse; /* global values */ box-direction: inherit; box-direction:
initial; box-direction: unset; syntax the box-direction property is specified as one of the keyword values listed below. values normal the box lays out its contents from the start (the left or top edge). reverse the box lays out its contents from the end (the right or bottom edge). notes the edge of the box designated the start for layout purposes depends on the box's orientation: ...
.... reverse the box lays out its contents from the end (the right or bottom edge). notes the edge of the box designated the start for layout purposes depends on the box's orientation: horizontal left vertical top the edge opposite to the start is designated the end. if the direction is set using the element's dir attribute, then the style is ignored. ...
...e the box lays out its contents from the end (the right or bottom edge). notes the edge of the box designated the start for layout purposes depends on the box's orientation: horizontal left vertical top the edge opposite to the start is designated the end. if the direction is set using the element's dir attribute, then the style is ignored. ...
box-flex-group - CSS: Cascading Style Sheets
this is a property of the original css flexible box layout module draft, and has been replaced by a newer standard. see flexbox for information about the current standard. the box-flex-group css property assigns the flexbox's child elements to a flex group. /* <integer> values */ box-flex-group: 1; box-flex-group: 5; /* global values */ box-flex-group: inherit; box-flex-group:
initial; box-flex-group: unset; for flexible elements assigned to flex groups, the first flex group is 1 and higher values specify subsequent flex groups. the
initial value is 1. when dividing up the box's extra space, the browser first considers all elements within the first flex group. each element within that group is given extra space based on the ratio of that element's flexibility compared to the flexibil...
... 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>. ...
... 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>. ...
box-flex - CSS: Cascading Style Sheets
nt standard. the -moz-box-flex and -webkit-box-flex css properties specify how a -moz-box or -webkit-box grows to fill the box that contains it, in the direction of the containing box's layout. /* <number> values */ -moz-box-flex: 0; -moz-box-flex: 2; -moz-box-flex: 3.5; -webkit-box-flex: 0; -webkit-box-flex: 2; -webkit-box-flex: 3.5; /* global values */ -moz-box-flex: inherit; -moz-box-flex:
initial; -moz-box-flex: unset; -webkit-box-flex: inherit; -webkit-box-flex:
initial; -webkit-box-flex: unset; syntax the box-flex property is specified as a <number>. if the value is 0, the box does not grow. if it is greater than 0, the box grows to fill a proportion of the available space. notes the containing box allocates the available extra space in proportion to the flex value of each of th...
...is ignored. to make xul elements in a containing box the same size, set the containing box's equalsize attribute to the value always. this attribute does not have a corresponding css property. a trick to make all content elements in a containing box the same size, is to give them all a fixed size (e.g. height: 0), and the same box-flex value greater than zero (e.g. -moz-box-flex: 1). ...
...d. to make xul elements in a containing box the same size, set the containing box's equalsize attribute to the value always. this attribute does not have a corresponding css property. a trick to make all content elements in a containing box the same size, is to give them all a fixed size (e.g. height: 0), and the same box-flex value greater than zero (e.g. -moz-box-flex: 1). ...
box-ordinal-group - CSS: Cascading Style Sheets
is a property of the original css flexible box layout module draft, and has been replaced by a newer standard. see flexbox for information about the current standard. the box-ordinal-group css property assigns the flexbox's child elements to an ordinal group. /* <integer> values */ box-ordinal-group: 1; box-ordinal-group: 5; /* global values */ box-ordinal-group: inherit; box-ordinal-group:
initial; box-ordinal-group: unset; ordinal groups may be used in conjunction with the box-direction property to control the order in which the direct children of a box appear. when the computed box-direction is normal, a box will display its elements starting from the lowest numbered ordinal group and ensure that those elements appear to the left (for horizontal boxes) or at the top (for vertical bo...
...pear to the left (for horizontal boxes) or at the top (for vertical boxes) of the container. elements with the same ordinal group are flowed in the order they appear in the source document tree. in the reverse direction, the ordinal groups are examined in the same order, except the elements appear reversed. syntax the box-ordinal-group property is specified as any positive <integer>. ...
...he left (for horizontal boxes) or at the top (for vertical boxes) of the container. elements with the same ordinal group are flowed in the order they appear in the source document tree. in the reverse direction, the ordinal groups are examined in the same order, except the elements appear reversed. syntax the box-ordinal-group property is specified as any positive <integer>. ...
box-pack - CSS: Cascading Style Sheets
or information about the current standard. the -moz-box-pack and -webkit-box-pack css properties specify how a -moz-box or -webkit-box packs its contents in the direction of its layout. the effect of this is only visible if there is extra space in the box. /* keyword values */ box-pack: start; box-pack: center; box-pack: end; box-pack: justify; /* global values */ box-pack: inherit; box-pack:
initial; box-pack: unset; the direction of layout depends on the element's orientation: horizontal or vertical. syntax the box-pack property is specified as one of the keyword values listed below. values start the box packs contents at the start, leaving any extra space at the end. center the box packs contents in the center, dividing any extra space equally between the start and the end. ...
... if it were start. notes the edge of the box designated the start for packing purposes depends on the box's orientation and direction: normal reverse horizontal left right vertical top bottom the edge opposite to the start is designated the end. if the packing is set using the element's pack attribute, then the style is ignored. ...
...re start. notes the edge of the box designated the start for packing purposes depends on the box's orientation and direction: normal reverse horizontal left right vertical top bottom the edge opposite to the start is designated the end. if the packing is set using the element's pack attribute, then the style is ignored. ...
clear - CSS: Cascading Style Sheets
ments inside it, you need to self-clear its children. this is called clearfix, and one way to do it is to add clear to a replaced ::after pseudo-element on it. #container::after { content: ""; display: block; clear: both; } syntax /* keyword values */ clear: none; clear: left; clear: right; clear: both; clear: inline-start; clear: inline-end; /* global values */ clear: inherit; clear:
initial; clear: unset; values none is a keyword indicating that the element is not moved down to clear past floating elements. left is a keyword indicating that the element is moved down to clear past left floats. right is a keyword indicating that the element is moved down to clear past right floats. both is a keyword indicating that the element is moved down to clear past both left and r...
...art is a keyword indicating that the element is moved down to clear floats on start side of its containing block, that is the left floats on ltr scripts and the right floats on rtl scripts. inline-end is a keyword indicating that the element is moved down to clear floats on end side of its containing block, that is the right floats on ltr scripts and the left floats on rtl scripts. formal def
inition
initial 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">lorem ipsum dolor sit amet, consectetuer adipiscing elit. phasellus sit amet diam. duis mattis varius dui. suspendisse eget dolor.</p> <p class=...
...x solid black; padding:10px; } .both { border: 1px solid black; clear: both; } .black { float: left; margin: 0; background-color: black; color: #fff; width:20%; } .red { float: right; margin: 0; background-color: pink; width:20%; } p { width: 45%; } specifications specification status comment css logical properties and values level 1the def
inition of 'float and clear' in that specification. editor's draft adds the values inline-start and inline-end css level 2 (revision 1)the def
inition of 'clear' in that specification. recommendation no significant changes, though details are clarified. css level 1the def
inition of 'clear' in that specification. recommendation
initial def
inition browser compat...
<color> - CSS: Cascading Style Sheets
is an alias for hsl(). in browsers that implement the level 4 standard, they accept the same parameters and behave the same way. functional notation: hsl[a](h, s, l[, a]) h (hue) is an <angle> of the color circle given in degs, rads, grads, or turns in css color module level 4. when written as a unitless <number>, it is interpreted as degrees, as specified in css color module level 3. by def
inition, red=0deg=360deg, with the other colors spread around the circle, so green=120deg, blue=240deg, etc. as an <angle>, it implicitly wraps around such that -120deg=240deg, 480deg=120deg, -1turn=1turn, etc. s (saturation) and l (lightness) are percentages. 100% saturation is completely saturated, while 0% is completely unsaturated (gray). 100% lightness is white, 0% lightness is black, and 50% li...
... color module level 4 working draft adds rebeccapurple, four- (#rgba) and eight-digit (#rrggbbaa) hexadecimal notations, rgba() and hsla() as aliases of rgb() and hsl() (both with identical parameter syntax), space-separated function parameters as an alternative to commas, percentages for alpha values, and angles for the hue component in hsl() colors. ...
...ameter syntax), space-separated function parameters as an alternative to commas, percentages for alpha values, and angles for the hue component in hsl() colors. css color module level 3the def
inition of '<color>' in that specification. recommendation deprecates system colors. adds svg colors and rgba(), hsl(), and hsla() functional notations. css level 2 (revision 1)the def
inition of '<color>' in that specification. recommendation adds the orange keyword and system colors. css level 1the def
inition of '<color>' in that specification. recommendation
initial def
inition. includes 16 basic color keywords. ...
column-count - CSS: Cascading Style Sheets
cified number of columns. 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. ...
...-count:
initial; column-count: unset; values auto the number of columns is determined by other css properties, such as column-width. <integer> is a strictly positive <integer> describing the ideal number of columns into which the content of the element will be flowed. if the column-width is also set to a non-auto value, it merely indicates the maximum allowed number of columns. formal def
inition
initial valueautoapplies toblock containers except table wrapper boxesinheritednocomputed valueas specifiedanimation typean integer formal syntax <integer> | auto examples splitting a paragraph across three columns html <p class="content-box"> this is a bunch of text split into three columns using the css `column-count` property. the text is equally distributed over the columns. </...
...o examples splitting a paragraph across three columns html <p class="content-box"> this is a bunch of text split into three columns using the css `column-count` property. the text is equally distributed over the columns. </p> css .content-box { column-count: 3; } result specifications specification status comment css multi-column layout modulethe def
inition of 'column-count' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome fo...
column-fill - CSS: Cascading Style Sheets
roken into columns. 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 /* keyword values */ column-fill: auto; column-fill: balance; column-fill: balance-all; /* global values */ column-fill: inherit; column-fill:
initial; column-fill: unset; the column-fill property is specified as one of the keyword values listed below. the
initial value is balance so the content will be balanced across the columns. values auto columns are filled sequentially. content takes up only the room it needs, this may result in some columns remaining empty. balance content is equally divided between columns. in fragmented con...
...t needs, this may result in some columns remaining empty. balance content is equally divided between columns. in fragmented contexts, such as paged media, only the last fragment is balanced. therefore in paged media, only the last page would be balanced. balance-all content is equally divided between columns. in fragmented contexts, such as paged media, all fragments are balanced. formal def
inition
initial valuebalanceapplies tomulticol elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | balance | balance-all examples splitting text evenly across columns html <p class="content-box"> this is a bunch of text split into multiple columns. the css `column-fill` property is used to spread the contents evenly across all the columns. </p> css...
...lass="content-box"> this is a bunch of text split into multiple columns. the css `column-fill` property is used to spread the contents evenly across all the columns. </p> css .content-box { column-count: 4; column-rule: 1px solid black; column-fill: balance; } result specifications specification status comment css multi-column layout modulethe def
inition of 'column-fill' in that specification. working draft
initial def
inition. ...
column-rule-style - CSS: Cascading Style Sheets
and send us a pull request. ...
...e: inset; column-rule-style: outset; /* global values */ column-rule-style: inherit; column-rule-style:
initial; column-rule-style: unset; the column-rule-style property is specified as a single <'border-style'> value. values <'border-style'> is a keyword defined by border-style describing the style of the rule. the styling must be interpreted as in the collapsing border model. formal def
inition
initial valuenoneapplies tomulticol elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-style'> examples setting a dashed column rule html <p>this is a bunch of text split into three columns. the `column-rule-style` property is used to change the style of the line that is drawn between columns. don't you think that's wonderful?</p> css p...
...mn rule html <p>this is a bunch of text split into three columns. the `column-rule-style` property is used to change the style of the line that is drawn between columns. don't you think that's wonderful?</p> css p { column-count: 3; column-rule-style: dashed; } result specifications specification status comment css multi-column layout modulethe def
inition of 'column-rule-style' in that specification. working draft
initial def
inition. ...
column-rule-width - CSS: Cascading Style Sheets
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. ...
...x; column-rule-width: 2.5em; /* global values */ column-rule-width: inherit; column-rule-width:
initial; column-rule-width: unset; the column-rule-width property is specified as a single <'border-width'> value. values <'border-width'> is a keyword defined by border-width describing the width of the rule. it may be either a <length> or one of the thin, medium, or thick keywords. formal def
inition
initial valuemediumapplies tomulticol elementsinheritednocomputed valuethe absolute length; 0 if the column-rule-style is none or hiddenanimation typea length formal syntax <'border-width'> examples setting a thick column rule html <p>this is a bunch of text split into three columns. the `column-rule-width` property is used to change the width of the line that is drawn between col...
...bunch of text split into three columns. the `column-rule-width` property is used to change the width of the line that is drawn between columns. don't you think that's wonderful?</p> css p { column-count: 3; column-rule-style: solid; column-rule-width: thick; } result specifications specification status comment css multi-column layout modulethe def
inition of 'column-rule-width' in that specification. working draft
initial def
inition. ...
column-span - CSS: Cascading Style Sheets
the column-span css property makes it possible for an element to span across all columns when its value is set to all. /* keyword values */ column-span: none; column-span: all; /* global values */ column-span: inherit; column-span:
initial; column-span: unset; an element that spans more than one column is called a spanning element. syntax the column-span property is specified as one of the keyword values listed below. values none the element does not span multiple columns. all the element spans across all columns. ...
...ent. syntax the column-span property is specified as one of the keyword values listed below. values none the element does not span multiple columns. all the element spans across all columns. content in the normal flow that appears before the element is automatically balanced across all columns before the element appears. the element establishes a new block formatting context. formal def
inition
initial valuenoneapplies toin-flow block-level elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | all examples making a heading span columns in this example, the heading is made to span across all the columns of the article. html <article> <h2>header spanning all of the columns</h2> <p> the h2 should span all the columns. the rest of ...
...property. the text is equally distributed over the columns.</p> <p>this is a bunch of text split into three columns using the css `columns` property. the text is equally distributed over the columns.</p> </article> css article { columns: 3; } h2 { column-span: all; } result specifications specification status comment css multi-column layout modulethe def
inition of 'column-span' in that specification. working draft
initial def
inition. ...
Computed value - CSS: Cascading Style Sheets
the computation needed to reach a property's computed value typically involves converting relative values (such as those in em units or percentages) to absolute values. ...
... the computation needed to reach a property's computed value typically involves converting relative values (such as those in em units or percentages) to absolute values. ...
...me the computed value, as specified. the relative values that remain in the computed value become absolute when the used value is determined. note: the getcomputedstyle() dom api returns the resolved value, which may either be the computed value or the used value, depending on the property. specifications specification status comment css level 2 (revision 2)the def
inition of 'computed-value' in that specification. working draft no change. css level 2 (revision 1)the def
inition of 'computed value' in that specification. recommendation
initial def
inition. ...
direction - CSS: Cascading Style Sheets
ot inherited from table columns into table cells, since css inheritance follows the document tree, and table cells are inside of rows but not inside of columns. the direction and unicode-bidi properties are the two only properties which are not affected by the all shorthand property. ...
...irection: ltr; direction: rtl; /* global values */ direction: inherit; direction:
initial; direction: unset; values ltr text and other elements go from left to right. this is the default value. rtl text and other elements go from right to left. for the direction property to have any effect on inline-level elements, the unicode-bidi property's value must be embed or override. formal def
inition
initial valueltrapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax ltr | rtl examples setting right-to-left direction blockquote { direction: rtl; } specifications specification status comment css writing modes module level 3the def
inition of 'direction' in that specification. proposed recommendation no ...
...itedyescomputed valueas specifiedanimation typediscrete formal syntax ltr | rtl examples setting right-to-left direction blockquote { direction: rtl; } specifications specification status comment css writing modes module level 3the def
inition of 'direction' in that specification. proposed recommendation no change. css level 2 (revision 1)the def
inition of 'direction' in that specification. recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for...
flex-grow - CSS: Cascading Style Sheets
roperty sets the flex grow factor of a flex item main size. 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 /* <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. 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-direct...
...s' 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 normally defined using the flex shorthand to ensure all values are set. formal def
inition
initial value0applies toflex items, including in-flow pseudo-elementsinheritednocomputed valueas specifiedanimation typea number formal syntax <number> examples setting flex item grow factor html <h4>this is a flex-grow</h4> <h5>a,b,c and f are flex-grow:1 . d and e are flex-grow:2 .</h5> <div id="content"> <div class="box" style="background-color:red;">a</div> <div class="box" sty...
...ound-color:brown;">f</div> </div> css #content { display: flex; justify-content: space-around; flex-flow: row wrap; align-items: stretch; } .box { flex-grow: 1; border: 3px solid rgba(0,0,0,.2); } .box1 { flex-grow: 2; border: 3px solid rgba(0,0,0,.2); } result specifications specification status comment css flexible box layout modulethe def
inition of 'flex-grow' in that specification. candidate recommendation
initial def
inition ...
flex-shrink - CSS: Cascading Style Sheets
sis, and normally defined using the flex shorthand. 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. ...
...es project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <number> values */ flex-shrink: 2; flex-shrink: 0.6; /* global values */ flex-shrink: inherit; flex-shrink:
initial; flex-shrink: unset; the flex-shrink property is specified as a single <number>. values <number> see <number>. negative values are invalid. defaults to 1. formal def
inition
initial value1applies toflex items, including in-flow pseudo-elementsinheritednocomputed valueas specifiedanimation typea number formal syntax <number> examples setting flex item shrink factor html <p>the width of content is 500px; the flex-basis of the flex items is 120px.</p> <p>a, b, c have flex-shrink:1 set. d and e have flex-shrink:2 set</p> <p>the width of d and e is less than th...
...lor:brown;">d</div> <div class="box1" style="background-color:lightgreen;">e</div> </div> css #content { display: flex; width: 500px; } #content div { flex-basis: 120px; border: 3px solid rgba(0,0,0,.2); } .box { flex-shrink: 1; } .box1 { flex-shrink: 2; } result specifications specification status comment css flexible box layout modulethe def
inition of 'flex-shrink' in that specification. candidate recommendation
initial def
inition ...
font-feature-settings - CSS: Cascading Style Sheets
tps://github.com/mdn/interactive-examples and send us a pull request. syntax /* use the default settings */ font-feature-settings: normal; /* set values for opentype feature tags */ font-feature-settings: "smcp"; font-feature-settings: "smcp" on; font-feature-settings: "swsh" 2; font-feature-settings: "smcp", "swsh" 2; /* global values */ font-feature-settings: inherit; font-feature-settings:
initial; font-feature-settings: unset; whenever possible, web authors should instead use the font-variant shorthand property or an associated longhand property such as font-variant-ligatures, font-variant-caps, font-variant-east-asian, font-variant-alternates, font-variant-numeric or font-variant-position. these lead to more effective, predictable, understandable results than font-feature-settings, ...
...it contains characters outside the u+20 – u+7e codepoint range, the whole property is invalid. the value is a positive integer. the two keywords on and off are synonyms for 1 and 0 respectively. if no value is set, the default is 1. for non-boolean opentype features (e.g. stylistic alternates), the value implies a particular glyph to be selected; for boolean values, it is a switch. formal def
inition
initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | <feature-tag-value>#where <feature-tag-value> = <string> [ <integer> | on | off ]? examples enabling various font features /* use small-cap alternate glyphs */ .smallcaps { font-feature-settings: "smcp" on; } /*...
...ions */ .fractions { font-feature-settings: "frac"; } /* use the second available swash character */ .swash { font-feature-settings: "swsh" 2; } /* enable stylistic set 7 */ .fancystyle { font-family: gabriola; /* available on windows 7, and on mac os */ font-feature-settings: "ss07"; } specifications specification status comment css fonts module level 3the def
inition of 'font-feature-settings' in that specification. candidate recommendation
initial def
inition ...
font-optical-sizing - CSS: Cascading Style Sheets
s. 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 /* keyword values */ font-optical-sizing: none; font-optical-sizing: auto; /* default */ /* global values */ font-optical-sizing: inherit; font-optical-sizing:
initial; font-optical-sizing: unset; values none the browser will not modify the shape of glyphs for optimal viewing. auto the browser will modify the shape of glyphs for optimal viewing. description optical sizing is enabled by default for fonts that have an optical size variation axis. the optical size variation axis is represented by opsz in font-variation-settings. when optical sizing ...
... optical sizing is enabled by default for fonts that have an optical size variation axis. the optical size variation axis is represented by opsz in font-variation-settings. when optical sizing is used, small text sizes are often rendered with thicker strokes and larger serifs, whereas larger text is often rendered more delicately with more contrast between thicker and thinner strokes. formal def
inition
initial valueautoapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | none examples disabling optical sizing <p class="optical-sizing">this paragraph is optically sized. this is the default across browsers.</p> <p class="no-optical-sizing">this paragraph is not optically sized. you ...
... working draft ...
font-variant-east-asian - CSS: Cascading Style Sheets
ruby this keyword forces the use of special glyphs for ruby characters. as these are usually smaller, font creators often designs specific forms, usually slightly bolder to improve the contrast. this keyword corresponds to the opentype values ruby. <east-a...
...values control the sizing of figures used for east asian characters. two values are possible: proportional-width activating the set of east asian characters which vary in width. it corresponds to the opentype values pwid. full-width activating the set of east asian characters which are all of the same, roughly square, width metric. it corresponds to the opentype values fwid. formal def
inition
initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | [ <east-asian-variant-values> || <east-asian-width-values> || ruby ]where <east-asian-variant-values> = [ jis78 | jis83 | jis90 | jis04 | simplified | traditional ]<east-asian-width-values> = [ full-width | proporti...
......
font-variant-ligatures - CSS: Cascading Style Sheets
values normal this keyword leads to the activation of the usual ligatures and contextual forms needed for correct rendering. the ligatures and forms activated depend on the font, language and kind of script. this is the default value. none this keyword specifies ...
...lt-values> these values control whether letters adapt to their context—that is, whether they adapt to the surrounding letters. these values correspond to the opentype values calt. two values are possible: contextual specifies that the contextual alternates are to be used. note that the keyword normal usually activates these ligatures too. no-contextual prevents their use. formal def
inition
initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> ]where <common-lig-values> = [ common-ligatures | no-common-ligatures ]<discretionary-lig-values> = [ ...
...gatures: historical-ligatures; } .no-historical-ligatures { font-variant-ligatures: no-historical-ligatures; } .contextual { font-variant-ligatures: contextual; } .no-contextual { font-variant-ligatures: no-contextual; } .contextual { font-variant-ligatures: contextual; } result specifications specification status comment css fonts module level 3the def
inition of 'font-variant-ligatures' in that specification. candidate recommendation
initial def
inition ...
font-variant-numeric - CSS: Cascading Style Sheets
values normal this keyword leads to the deactivation of the use of such alternate glyphs. ordinal this keyword forces the use of special glyphs for the ordinal markers, like 1st, 2nd, 3rd, 4th in eng...
...es are possible: diagonal-fractions activating the set of figures where the numerator and denominator are made smaller and separated by a slash. it corresponds to the opentype values frac. stacked-fractions activating the set of figures where the numerator and denominator are made smaller, stacked and separated by a horizontal line. it corresponds to the opentype values afrc. formal def
inition
initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | [ <numeric-figure-values> | <numeric-spacing-values> | <numeric-fraction-values> | ordinal | slashed-zero ]where <numeric-figure-values> = [ lining-nums | oldstyle-nums ]<numeric-spacing-values> = [ proportional-num...
...fl_web */ @font-face { font-family: "source sans pro"; font-style: normal; font-weight: 400; src: url("https://mdn.mozillademos.org/files/15757/sourcesanspro-regular.otf") format("opentype"); } .ordinal { font-variant-numeric: ordinal; font-family: "source sans pro"; } result specifications specification status comment css fonts module level 3the def
inition of 'font-variant-numeric' in that specification. candidate recommendation
initial def
inition ...
grid-column - CSS: Cascading Style Sheets
nting this span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. internet explorer issues ie11 does not support automatic placement of grid items. all items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. one can use a little javascript to enable automatic annotation: source repository. ...
...s span. if the <integer> is omitted, it defaults to 1. negative integers or 0 are invalid. internet explorer issues ie11 does not support automatic placement of grid items. all items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. one can use a little javascript to enable automatic annotation: source repository. ...
... </div> css #grid { display: grid; height: 100px; grid-template-columns: repeat(6, 1fr); grid-template-rows: 100px; } #item1 { background-color: lime; } #item2 { background-color: yellow; grid-column: 2 / 4; } #item3 { background-color: blue; grid-column: span 2 / 7; } result specifications specification status comment css grid layoutthe def
inition of 'grid-column' in that specification. candidate recommendation
initial def
inition ...
hyphens - CSS: Cascading Style Sheets
present and the appropriate hyphenation dictionary is available. in xml, the xml:lang attribute must be used. note: the rules defining how hyphenation is performed are not explicitly defined by the specification, so the exact hyphenation may vary from browser to browser. syntax /* keyword values */ hyphens: none; hyphens: manual; hyphens: auto; /* global values */ hyphens: inherit; hyphens:
initial; hyphens: unset; the hyphens property is specified as a single keyword value chosen from the list below. values none words are not broken at line breaks, even if characters inside the words suggest line break points. lines will only wrap at whitespace. manual words are broken for line-wrapping only where characters inside the word suggest line break opportunities. see suggesting line ...
...nity. even if the line is not actually broken at that point, the hyphen is still rendered. u+00ad (shy) an invisible, "soft" hyphen. this character is not rendered visibly; instead, it marks a place where the browser should break the word if hyphenation is necessary. in html, use ­ to insert a soft hyphen. when the html <wbr> element leads to a line break, no hyphen is added. formal def
inition
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. html <dl> <dt><code>none</code>: no hyphen; overflow if needed</dt> <dd lang="en" class="none">an extreme­ly lon...
...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 comment css text module level 3the def
inition of 'hyphens' in that specification. working draft
initial def
inition ...
line-break - CSS: Cascading Style Sheets
loose break text using the least restrictive line break rule. ...
...very typographic character unit, including around any punctuation character or preserved white spaces, or in the middle of words, disregarding any prohibition against line breaks, even those introduced by characters with the gl, wj, or zwj character class or mandated by the word-break property. the different wrapping opportunities must not be prioritized. hyphenation is not applied. formal def
inition
initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | loose | normal | strict | anywhere examples setting text wrapping see whether the text is wrapped before "々", "ぁ" and "。". html <div lang="ja"> <p class="wrapbox auto">auto:<br>そこは湖のほとりで木々が輝いていた。<br>その景色に、美し...
......
margin-inline-start - CSS: Cascading Style Sheets
line-start: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-inline-start: auto; /* global values */ margin-inline-start: inherit; it relates to margin-block-start, margin-block-end, and margin-inline-end, which define the other margins of the element. values the margin-inline-start property takes the same values as the margin-left property. ...
...t: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-inline-start: auto; /* global values */ margin-inline-start: inherit; it relates to margin-block-start, margin-block-end, and margin-inline-end, which define the other margins of the element. values the margin-inline-start property takes the same values as the margin-left property. ...
...ting inline start margin html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; margin-inline-start: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the def
inition of 'margin-inline-start' in that specification. editor's draft
initial def
inition ...
margin-top - CSS: Cascading Style Sheets
us a pull request. this property has no effect on non-replaced inline elements, such as <span> or <code>. syntax /* <length> values */ margin-top: 10px; /* an absolute length */ margin-top: 1em; /* relative to the text size */ margin-top: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-top: auto; /* global values */ margin-top: inherit; margin-top:
initial; margin-top: unset; the margin-top property is specified as the keyword auto, or a <length>, or a <percentage>. its value can be positive, zero, or negative. values <length> the size of the margin as a fixed value. <percentage> the size of the margin as a percentage, relative to the width of the containing block. auto the browser selects a suitable value to use. see margin. formal...
... margin-top: unset; the margin-top property is specified as the keyword auto, or a <length>, or a <percentage>. its value can be positive, zero, or negative. values <length> the size of the margin as a fixed value. <percentage> the size of the margin as a percentage, relative to the width of the containing block. auto the browser selects a suitable value to use. see margin. formal def
inition
initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table. it also applies to ::first-letter and ::first-line.inheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> | auto examples settin...
...ethe percentage as specified or the absolute lengthanimation typea length formal syntax <length> | <percentage> | auto examples setting positive and negative top margins .content { margin-top: 5%; } .sidebox { margin-top: 10px; } .logo { margin-top: -5px; } #footer { margin-top: 1em; } specifications specification status comment css basic box modelthe def
inition of 'margin-top' in that specification. working draft no significant change css level 2 (revision 1)the def
inition of 'margin-top' in that specification. recommendation removes its effect on inline elements. css level 1the def
inition of 'margin-top' in that specification. recommendation
initial def
inition ...
mask-border-outset - CSS: Cascading Style Sheets
s set out from its border box. syntax /* <length> value */ mask-border-outset: 1rem; /* <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 first outset applies to the top and bottom, the second to the left and right. when three values are...
...pecified, the first outset applies to the top, the second to the left and right, the third to the bottom. when four values are specified, the outsets apply to the top, right, bottom, and left in that order (clockwise). values <length> the size of the mask border outset as a dimension. <number> the size of the mask border outset as a multiple of the corresponding border-width. formal def
inition
initial value0applies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typediscrete formal syntax [ <length> | <number> ]{1,4} examples basic usage this property doesn't appear to be supported anywhere yet. when it eventuall...
...n outdated version of this property — mask-box-image-outset — with a prefix: -webkit-mask-box-image-outset: 1rem; 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 css masking module level 1the def
inition of 'mask-border-outset' in that specification. candidate recommendation
initial def
inition ...
mask-border-repeat - CSS: Cascading Style Sheets
peat css property sets how the edge regions of a source image are adjusted to fit the dimensions of an element's mask border. syntax /* keyword value */ mask-border-repeat: stretch; mask-border-repeat: repeat; mask-border-repeat: round; mask-border-repeat: space; /* vertical | horizontal */ mask-border-repeat: round stretch; /* global values */ mask-border-repeat: inherit; mask-border-repeat:
initial; mask-border-repeat: unset; the mask-border-repeat property may be specified using one or two values chosen from the list of values below. when one value is specified, it applies the same behavior on all four sides. when two values are specified, the first applies to the top and bottom, the second to the left and right. values stretch the source image's edge regions are stretched t...
...ween each border. tiles may be clipped to achieve the proper fit. round the source image's edge regions are tiled (repeated) to fill the gap between each border. tiles may be stretched to achieve the proper fit. space the source image's edge regions are tiled (repeated) to fill the gap between each border. extra space will be distributed in between tiles to achieve the proper fit. formal def
inition
initial valuestretchapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ stretch | repeat | round | space ]{1,2} examples basic usage this property doesn't appear to be supported anywhere yet. when it eventually starts to be supported, it will serve ...
... outdated version of this property — mask-box-image-repeat — with a prefix: -webkit-mask-box-image-repeat: round; 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 css masking module level 1the def
inition of 'mask-border-repeat' in that specification. candidate recommendation
initial def
inition ...
mask-border - CSS: Cascading Style Sheets
s outside edge. up to four values may be specified. see mask-border-outset. <'mask-border-repeat'> defines how the edge regions of the source image are adjusted to fit the dimensions of the border mask. up to two values may be specified. see mask-border-repeat. <'mask-border-mode'> defines whether the source image is treated as a luminance mask or alpha mask. see mask-border-mode. ...
... edge. up to four values may be specified. see mask-border-outset. <'mask-border-repeat'> defines how the edge regions of the source image are adjusted to fit the dimensions of the border mask. up to two values may be specified. see mask-border-repeat. <'mask-border-mode'> defines whether the source image is treated as a luminance mask or alpha mask. see mask-border-mode. ...
...shorthand property, not supported anywhere yet */ mask-border: url("https://udn.realityripple.com/samples/2d/fd08a3134c.png") /* source */ 30 fill / /* slice */ 20px / /* width */ 1px /* outset */ round; /* repeat */ } result specifications specification status comment css masking module level 1the def
inition of 'mask-border' in that specification. candidate recommendation
initial def
inition ...
mix-blend-mode - CSS: Cascading Style Sheets
-blend-mode: screen; mix-blend-mode: overlay; mix-blend-mode: darken; mix-blend-mode: lighten; mix-blend-mode: color-dodge; mix-blend-mode: color-burn; mix-blend-mode: hard-light; mix-blend-mode: soft-light; mix-blend-mode: difference; mix-blend-mode: exclusion; mix-blend-mode: hue; mix-blend-mode: saturation; mix-blend-mode: color; mix-blend-mode: luminosity; /* global values */ mix-blend-mode:
initial; mix-blend-mode: inherit; mix-blend-mode: unset; values <blend-mode> the blending mode that should be applied. formal def
inition
initial valuenormalapplies toall elementsinheritednocomputed valueas specifiedanimation typediscretecreates stacking contextyes formal syntax <blend-mode>where <blend-mode> = normal | multiply | screen | overlay | darken | lighten | color-dodge | color-bur...
...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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webvi...
...60" cy="80" r="40" fill="blue"/> </g> </svg> css circle { mix-blend-mode: screen; } .isolate { isolation: isolate; } /* without isolation, the background color will be taken into account */ result specifications specification status comment compositing and blending level 1the def
inition of 'mix-blend-mode' in that specification. candidate recommendation
initial def
inition 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung inter...
offset - CSS: Cascading Style Sheets
m 100 100 l 300 100 l 200 300 z'); offset: url(arc.svg); /* offset path with distance and/or rotation */ offset: url(circle.svg) 100px; offset: url(circle.svg) 40%; offset: url(circle.svg) 30deg; offset: url(circle.svg) 50px 20deg; /* including offset anchor */ offset: ray(45deg closest-side) / 40px 20px; offset: url(arc.svg) 2cm / 0.5cm 3cm; offset: url(arc.svg) 30deg / 50px 100px; formal def
inition
initial valueas each of the properties of the shorthand:offset-position: autooffset-path: noneoffset-distance: 0offset-anchor: autooffset-rotate: autoapplies totransformable elementsinheritednopercentagesas each of the properties of the shorthand:offset-position: refertosizeofcontainingblockoffset-distance: refer to the total path lengthoffset-anchor: relativetowidthandheightcomputed valueas ...
...'offset-rotate'> ]? ]? ]! ...
...nt"></div> css @keyframes move { from { offset-distance: 0%; } to { offset-distance: 100%; } } #offsetelement { width: 50px; height: 50px; background-color: blue; offset: path("m 100 100 l 300 100 l 200 300 z") auto; animation: move 3s linear inf
inite; } result specifications specification status comment motion path module level 1the def
inition of 'offset' in that specification. working draft
initial def
inition ...
opacity - CSS: Cascading Style Sheets
es. in order to meet current web content accessibility guidelines (wcag), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. large text is defined as 18.66px and bold or larger, or 24px or larger. ...
...der to meet current web content accessibility guidelines (wcag), a ratio of 4.5:1 is required for text content and 3:1 for larger text such as headings. large text is defined as 18.66px and bold or larger, or 24px or larger. ...
... alt="mdn logo" width="128" height="146" class="opacity"> css img.opacity { opacity: 1; filter: alpha(opacity=100); /* ie8 and lower */ zoom: 1; /* triggers "haslayout" in ie 7 and lower */ } img.opacity:hover { opacity: 0.5; filter: alpha(opacity=50); zoom: 1; } result specifications specification status comment css color module level 4the def
inition of 'opacity' in that specification. working draft defines percentage opacity values. css color module level 3the def
inition of 'opacity' in that specification. recommendation
initial def
inition ...
order - CSS: Cascading Style Sheets
er are sorted by ascending order value and then by their source code order. 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 /* <integer> values */ order: 5; order: -5; /* global values */ order: inherit; order:
initial; order: unset; since order is only meant to affect the visual order of elements and not their logical or tab order. order must not be used on non-visual media such as speech. values <integer> represents the ordinal group to be used by the item. accessibility concerns using the order property will create a disconnect between the visual presentation of content and dom order. this will ...
...he aid of assistive technology such as a screen reader. if the visual (css) order is important, then screen reader users will not have access to the correct reading order. flexbox & the keyboard navigation disconnect — tink source order matters | adrian roselli mdn understanding wcag, guideline 1.3 explanations understanding success criterion 1.3.2 | w3c understanding wcag 2.0 formal def
inition
initial value0applies toflex items and absolutely-positioned flex container childreninheritednocomputed valueas specifiedanimation typean integer formal syntax <integer> examples ordering items in a flex container this example uses css to create a classic two-sidebar layout surrounding a content block. the flexible box layout module automatically creates blocks of equal vertical size and...
... <article>article</article> <nav>nav</nav> <aside>aside</aside> </main> <footer>...</footer> css main { display: flex; text-align:center; } main > article { flex:1; order: 2; } main > nav { width: 200px; order: 1; } main > aside { width: 200px; order: 3; } result specifications specification status comment css flexible box layout modulethe def
inition of 'order' in that specification. candidate recommendation
initial def
inition
initial value0applies toflex items and absolutely-positioned flex container childreninheritednocomputed valueas specifiedanimation typean integer ...
orphans - CSS: Cascading Style Sheets
the orphans css property sets the minimum number of lines in a block container that must be shown at the bottom of a page, region, or column. /* <integer> values */ orphans: 2; orphans: 3; /* global values */ orphans: inherit; orphans:
initial; orphans: unset; in typography, an orphan is the first line of a paragraph that appears alone at the bottom of a page. (the paragraph continues on a following page.) syntax values <integer> the minimum number of lines that can stay by themselves at the bottom of a fragment before a fragmentation break. ...
...al values */ orphans: inherit; orphans:
initial; orphans: unset; in typography, an orphan is the first line of a paragraph that appears alone at the bottom of a page. (the paragraph continues on a following page.) syntax values <integer> the minimum number of lines that can stay by themselves at the bottom of a fragment before a fragmentation break. the value must be positive. formal def
inition
initial value2applies toblock container elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax <integer> examples setting a minimum orphan size of three lines html <div> <p>this is the first paragraph containing some text.</p> <p>this is the second paragraph containing some more text than the first one. it is used to demonstrate how orphans work.</p> <p...
...w orphans work.</p> <p>this is the third paragraph. it has a little bit more text than the first one.</p> </div> css div { background-color: #8cffa0; height: 150px; columns: 3; orphans: 3; } p { background-color: #8ca0ff; } p:first-child { margin-top: 0; } result specifications specification status comment css fragmentation module level 3the def
inition of 'orphans' in that specification. candidate recommendation extends orphans to apply to any type of fragment, including pages, regions, or columns. css level 2 (revision 1)the def
inition of 'orphans' in that specification. recommendation
initial def
inition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like...
overflow-anchor - CSS: Cascading Style Sheets
vior is enabled by default in any browser that supports it. therefore, changing the value of this property is typically only required if you are experiencing problems with scroll anchoring in a document or part of a document and need to turn the behavior off. ...
...document or part of a document and need to turn the behavior off. syntax /* keyword values */ overflow-anchor: auto; overflow-anchor: none; /* global values */ overflow-anchor: inherit; overflow-anchor:
initial; overflow-anchor: unset; values auto the element becomes a potential anchor when adjusting scroll position. none the element won't be selected as a potential anchor. formal def
inition
initial valueautoapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | none examples prevent scroll anchoring to prevent scroll anchoring in a document, use the overflow-anchor property. body { overflow-anchor: none; } specifications specification status comment css scroll anchoring module level 1the de...
...on
initial valueautoapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax auto | none examples prevent scroll anchoring to prevent scroll anchoring in a document, use the overflow-anchor property. body { overflow-anchor: none; } specifications specification status comment css scroll anchoring module level 1the def
inition of 'overflow-anchor' in that specification. editor's draft
initial def
inition. ...
overscroll-behavior-block - CSS: Cascading Style Sheets
scroll-behavior-block css property sets the browser's behavior when the block direction boundary of a scrolling area is reached. see overscroll-behavior for a full explanation. /* keyword values */ overscroll-behavior-block: auto; /* default */ overscroll-behavior-block: contain; overscroll-behavior-block: none; /* global values */ overscroll-behavior-block: inherit; overscroll-behavior-block:
initial; overscroll-behavior-block: unset; syntax the overscroll-behavior-block property is specified as a keyword chosen from the list of values below. values auto the default scroll overflow behavior occurs as normal. contain default scroll overflow behavior is observed inside the element this value is set on (e.g. "bounce" effects or refreshes), but no scroll chaining occurs to neighbouri...
...rflow behavior occurs as normal. contain default scroll overflow behavior is observed inside the element this value is set on (e.g. "bounce" effects or refreshes), but no scroll chaining occurs to neighbouring scrolling areas, e.g. underlying elements will not scroll. none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented. formal def
inition
initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing block overscrolling in this demo we have two block-level boxes, one inside the other. the outer box has a large height set on it so the page will scroll vertically. the inner ...
... working draft ...
overscroll-behavior-inline - CSS: Cascading Style Sheets
behavior-inline css property sets the browser's behavior when the inline direction boundary of a scrolling area is reached. see overscroll-behavior for a full explanation. /* keyword values */ overscroll-behavior-inline: auto; /* default */ overscroll-behavior-inline: contain; overscroll-behavior-inline: none; /* global values */ overscroll-behavior-inline: inherit; overscroll-behavior-inline:
initial; overscroll-behavior-inline: unset; syntax the overscroll-behavior-inline property is specified as a keyword chosen from the list of values below. values auto the default scroll overflow behavior occurs as normal. contain default scroll overflow behavior is observed inside the element this value is set on (e.g. "bounce" effects or refreshes), but no scroll chaining occurs to neighbou...
...rflow behavior occurs as normal. contain default scroll overflow behavior is observed inside the element this value is set on (e.g. "bounce" effects or refreshes), but no scroll chaining occurs to neighbouring scrolling areas, e.g. underlying elements will not scroll. none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented. formal def
inition
initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing inline overscrolling in this demo we have two block-level boxes, one inside the other. the outer box has a large width set on it so the page will scroll horizontally. the inne...
... working draft ...
overscroll-behavior-x - CSS: Cascading Style Sheets
the overscroll-behavior-x css property sets the browser's behavior when the horizontal boundary of a scrolling area is reached. see overscroll-behavior for a full explanation. /* keyword values */ overscroll-behavior-x: auto; /* default */ overscroll-behavior-x: contain; overscroll-behavior-x: none; /* global values */ overscroll-behavior-x: inherit; overscroll-behavior-x:
initial; overscroll-behavior-x: unset; syntax the overscroll-behavior-x property is specified as a keyword chosen from the list of values below. values auto the default scroll overflow behavior occurs as normal. contain default scroll overflow behavior is observed inside the element this value is set on (e.g. "bounce" effects or refreshes), but no scroll chaining occurs to neighbouring scrolling areas, e.g. und...
...rflow behavior occurs as normal. contain default scroll overflow behavior is observed inside the element this value is set on (e.g. "bounce" effects or refreshes), but no scroll chaining occurs to neighbouring scrolling areas, e.g. underlying elements will not scroll. none no scroll chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented. formal def
inition
initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing an underlying element from scrolling horizontally in our simple overscroll-behavior-x example (see source code also), we have two block-level boxes, one inside the other. the ...
...begin to scroll, which is probably not what we want. to avoid this, you can set overscroll-behavior-x: contain on the inner box: main > div { height: 300px; width: 500px; overflow: auto; position: relative; top: 100px; left: 100px; overscroll-behavior-x: contain; } specifications specification status comment css overscroll behavior module level 1the def
inition of 'overscroll-behavior-x' in that specification. working draft ...
perspective - CSS: Cascading Style Sheets
ctive. 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 /* keyword value */ perspective: none; /* <length> values */ perspective: 20px; perspective: 3.5em; /* global values */ perspective: inherit; perspective:
initial; perspective: unset; values none indicates that no perspective transform is to be applied. <length> a <length> giving the distance from the user to the z=0 plane. it is used to apply a perspective transform to the element and its content. if the value is 0 or a negative number, no perspective transform is applied. description each 3d element with z>0 becomes larger; each 3d-element ...
... perspective css property — are not drawn. the vanishing point is by default placed at the center of the element, but its position can be changed using the perspective-origin property. using this property with a value different than 0 and none creates a new stacking context. also, in that case, the object will act as a containing block for position: fixed elements that it contains. formal def
inition
initial valuenoneapplies totransformable elementsinheritednocomputed valuethe absolute length or noneanimation typea lengthcreates stacking contextyes formal syntax none | <length> examples setting perspective this example shows a cube with the perspective set at different positions. how quick the cube shrinks is defined by the perspective property. the smaller its value is, the deeper t...
...ransform: rotatex(90deg) translatez(50px); } .bottom { background: rgba(196, 0, 196, 0.7); transform: rotatex(-90deg) translatez(50px); } /* make the table a little nicer */ th, p, td { background-color: #eeeeee; padding: 10px; font-family: sans-serif; text-align: left; } result specifications specification status comment css transforms level 2the def
inition of 'perspective' in that specification. editor's draft
initial def
inition ...
pointer-events - CSS: Cascading Style Sheets
values auto the element behaves as it would if the pointer-events property were not specified. in svg content, this value and the value visiblepainted have the same effect. none the element is never the target of pointer events; however, pointer events may target ...
...ol (than just auto and none) in html for which parts of an element will cause it to "catch" pointer events, and when. to help us in deciding how pointer-events should be further extended for html, if you have any particular things that you would like to be able to do with this property, then please add them to the use cases section of this wiki page (don't worry about keeping it tidy). formal def
inition
initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | none | visiblepainted | visiblefill | visiblestroke | visible | painted | fill | stroke | all | inherit examples disabling pointer events on all images this example disables pointer events (clicking, dragging, hovering, etc.) on all images. img { pointer-events: non...
...le link this example disables pointer events on the link to http://example.com. html <ul> <li><a href="https://developer.mozilla.org">mdn</a></li> <li><a href="http://example.com">example.com</a></li> </ul> css a[href="http://example.com"] { pointer-events: none; } result specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'pointer-events' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'pointer-events' in that specification. recommendation
initial def
inition its extension to html elements, though present in early drafts of css basic user interface module level 3, has been pushed to its level 4. browser compatib...
repeat() - CSS: Cascading Style Sheets
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 the grid items occupying the grid track. auto-fill if the grid container has a def
inite or maximal size in the relevant axis, then the number of repetitions is the largest possible positive integer that does not cause the grid to overflow its grid container. treating each track as its maximal track sizing function (each independant value used to define grid-template-rows or grid-template-columns), if that is def
inite. otherwise, as its minimum track sizing function, and taking grid...
...otherwise, the specified track list repeats only once. ...
... </div> </div> css #container { display: grid; grid-template-columns: repeat(2, 50px 1fr) 100px; grid-gap: 5px; box-sizing: border-box; height: 200px; width: 100%; background-color: #8cffa0; padding: 10px; } #container > div { background-color: #8ca0ff; padding: 5px; } result specifications specification status comment css grid layoutthe def
inition of 'repeat()' in that specification. candidate recommendation
initial def
inition ...
resize - 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. syntax /* keyword values */ resize: none; resize: both; resize: horizontal; resize: vertical; resize: block; resize: inline; /* global values */ resize: inherit; resize:
initial; resize: unset; the resize property is specified as a single keyword value from the list below. values none the element offers no user-controllable method for resizing it. both the element displays a mechanism for allowing the user to resize it, which may be resized both horizontally and vertically. horizontal the element displays a mechanism for allowing the user to resize it in t...
...ly or vertically, depending on the writing-mode and direction value). inline the element displays a mechanism for allowing the user to resize it in the inline direction (either horizontally or vertically, depending on the writing-mode and direction value). resize does not apply to the following: inline elements block elements for which the overflow property is set to visible formal def
inition
initial valuenoneapplies toelements with overflow other than visible, and optionally replaced elements representing images or videos, and iframesinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | both | horizontal | vertical | block | inline examples disabling resizability of textareas in many browsers, <textarea> elements are resizable by default. you may o...
...l directions, because the css `resize` property is set to `both` on this element. </p> </div> css .resizable { resize: both; overflow: scroll; border: 1px solid black; } div { height: 300px; width: 300px; } p { height: 200px; width: 200px; } result specifications specification status comment css logical properties and values level 1the def
inition of 'resize' in that specification. editor's draft adds the values block and inline. css basic user interface module level 3the def
inition of 'resize' in that specification. recommendation
initial def
inition. ...
revert - CSS: Cascading Style Sheets
hild). 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 from and should not be confused with
initial, which uses the
initial value defined on a per-property basis by the css specifications. in contrast, user-agent stylesheets set default values on the basis of css selectors. for example, the
initial value for the display property is inline, whereas a normal user-agent stylesheet sets the default display value of <div>s to block, of <table>s to table, etc. examples revert vs unset althoug...
...ne, whereas a normal user-agent stylesheet sets the default display value of <div>s to block, of <table>s to table, etc. examples revert vs unset although revert and unset are similar they differ for some properties for some elements. so in the below example, we set custom font-weight in a global stylesheet, but then try to unset and revert. unset will keep the text normal because this is an
initial value for font-weight property. revert will revert to bold because this is a default value for headers in most browsers. h3 { font-weight: normal; color: blue; } <h3 style="font-weight: unset; color: unset;">this will still have font-weight: normal, but color: black</h3> <p>just some text</p> <h3 style="font-weight: revert; color: revert;">this should have its original font-weight (bold)...
...ack. </section> notice how paragraph still has a red color even though a color property for the section was reverted. also note that both the header and plain text node is black. this is exactly the same as if section { color: darkgreen } would not exist for the second section. specifications specification status comment css cascading and inheritance level 4the def
inition of 'revert' in that specification. candidate recommendation
initial def
inition. ...
scroll-margin-inline-end - 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. ...
...t, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-inline-end: 10px; scroll-margin-inline-end: 1em; /* global values */ scroll-margin-inline-end: inherit; scroll-margin-inline-end:
initial; scroll-margin-inline-end: unset; values <length> an outset from the inline end edge of the scroll container. formal def
inition
initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> examples simple demonstration this example implements something very similar to the interactive example above, except that here we'll explain to you how it's implemented. the aim here is to create four horizontally-scrolling blocks, the second and third of...
...iv:nth-child(3) { scroll-margin-inline-end: 2rem; } this means that when scrolling past the middle child elements, the scrolling will snap to 1rem outside the inline end edge of the second <div>, and 2rems outside the inline end edge of the third <div>. result try it for yourself: specifications specification status comment css scroll snap module level 1the def
inition of 'scroll-margin-inline-end' in that specification. candidate recommendation
initial def
inition ...
scroll-margin-inline-start - CSS: Cascading Style Sheets
ce 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. ...
...one https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <length> values */ scroll-margin-inline-start: 10px; scroll-margin-inline-start: 1em; /* global values */ scroll-margin-inline-start: inherit; scroll-margin-inline-start:
initial; scroll-margin-inline-start: unset; values <length> an outset from the inline start edge of the scroll container. formal def
inition
initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> examples simple demonstration this example implements something very similar to the interactive example above, except that here we'll explain to you how it's implemented. the aim here is to create four horizontally-scrolling blocks, the second and third of...
...-child(3) { scroll-margin-inline-start: 2rem; } this means that when scrolling past the middle child elements, the scrolling will snap to 1rem outside the inline start edge of the second <div>, and 2rems outside the inline start edge of the third <div>. result try it for yourself: specifications specification status comment css scroll snap module level 1the def
inition of 'scroll-margin-inline-start' in that specification. candidate recommendation
initial def
inition ...
scroll-snap-coordinate - CSS: Cascading Style Sheets
ts nearest ancestor scroll container's scroll-snap-destination for each respective axis. /* keyword value */ scroll-snap-coordinate: none; /* <position> values */ scroll-snap-coordinate: 50px 50px; /* single coordinate */ scroll-snap-coordinate: 100px 100px, 100px bottom; /* multiple coordinates */ /* global values */ scroll-snap-coordinate: inherit; scroll-snap-coordinate:
initial; scroll-snap-coordinate: unset; if the element has been transformed, the snap coordinates are likewise transformed, thus aligning the snap points with the element as it is displayed. syntax values none specifies that the element does not contribute to a snap point. <position> specifies the offset of the snap coordinates from the start edge of the element’s border box. for each pairi...
...ormed, thus aligning the snap points with the element as it is displayed. syntax values none specifies that the element does not contribute to a snap point. <position> specifies the offset of the snap coordinates from the start edge of the element’s border box. for each pairing, the first value gives the x coordinate of the snap coordinate, the second value its y coordinate. ...
...us aligning the snap points with the element as it is displayed. syntax values none specifies that the element does not contribute to a snap point. <position> specifies the offset of the snap coordinates from the start edge of the element’s border box. for each pairing, the first value gives the x coordinate of the snap coordinate, the second value its y coordinate. ...
scroll-snap-destination - CSS: Cascading Style Sheets
the scroll-snap-destination css property defines the position in x and y coordinates within the scroll container's visual viewport which element snap points align with. ...
...destination: 400px 600px; /* global values */ scroll-snap-destination: inherit; scroll-snap-destination:
initial; scroll-snap-destination: unset; syntax values <position> specifies the offset of the snap destination from the start edge of the scroll container’s visual viewport. the first value gives the x coordinate of the snap destination, the second value its y coordinate. ...
...on: 400px 600px; /* global values */ scroll-snap-destination: inherit; scroll-snap-destination:
initial; scroll-snap-destination: unset; syntax values <position> specifies the offset of the snap destination from the start edge of the scroll container’s visual viewport. the first value gives the x coordinate of the snap destination, the second value its y coordinate. ...
scroll-snap-points-x - CSS: Cascading Style Sheets
the scroll-snap-points-x css property defines the horizontal positioning of snap points within the content of the scroll container they are applied to. /* keyword value */ scroll-snap-points-x: none; /* repeating snap points */ scroll-snap-points-x: repeat(400px); /* global values */ scroll-snap-points-x: inherit; scroll-snap-points-x:
initial; scroll-snap-points-x: unset; syntax values none the scroll container does not define any snap points. ...
...lues none the scroll container does not define any snap points. elements within the scroll container may still define snap points on behalf of the scroll container. repeat(<length-percentage>) defines an interval at which snap points are defined, starting from the container's relevant start edge. only positive lengths are allowed. percentages refer to the width of the container. ...
...one the scroll container does not define any snap points. elements within the scroll container may still define snap points on behalf of the scroll container. repeat(<length-percentage>) defines an interval at which snap points are defined, starting from the container's relevant start edge. only positive lengths are allowed. percentages refer to the width of the container. ...
scroll-snap-points-y - CSS: Cascading Style Sheets
the scroll-snap-points-y css property defines the vertical positioning of snap points within the content of the scroll container they are applied to. /* keyword value */ scroll-snap-points-y: none; /* repeated snap points */ scroll-snap-points-y: repeat(400px); /* global values */ scroll-snap-points-y: inherit; scroll-snap-points-y:
initial; scroll-snap-points-y: unset; syntax values none the scroll container does not define any snap points. ...
...lues none the scroll container does not define any snap points. elements within the scroll container may still define snap points on behalf of the scroll container. repeat(<length-percentage>) defines an interval at which snap points are defined, starting from the container's relevant start edge. only positive lengths are allowed. percentages refer to the width of the container. ...
...one the scroll container does not define any snap points. elements within the scroll container may still define snap points on behalf of the scroll container. repeat(<length-percentage>) defines an interval at which snap points are defined, starting from the container's relevant start edge. only positive lengths are allowed. percentages refer to the width of the container. ...
scroll-snap-type - CSS: Cascading Style Sheets
left up to the user agent. /* keyword values */ scroll-snap-type: none; scroll-snap-type: x; scroll-snap-type: y; scroll-snap-type: block; scroll-snap-type: inline; scroll-snap-type: both; /* optional mandatory | proximity*/ scroll-snap-type: x mandatory; scroll-snap-type: y proximity; scroll-snap-type: both mandatory; /* etc */ /* global values */ scroll-snap-type: inherit; scroll-snap-type:
initial; scroll-snap-type: unset; syntax values none when the visual viewport of this scroll container is scrolled, it must ignore snap points. x the scroll container snaps to snap positions in its horizontal axis only. y the scroll container snaps to snap positions in its vertical axis only. block the scroll container snaps to snap positions in its block axis only. inline the scroll co...
...ted or resized the scroll offset will be adjusted to maintain the resting on that snap point. proximity the visual viewport of this scroll container may come to rest on a snap point if it isn't currently scrolled considering the user agent's scroll parameters. if content is added, moved, deleted or resized the scroll offset may be adjusted to maintain the resting on that snap point. formal def
inition
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | [ x | y | block | inline | both ] [ mandatory | proximity ]? examples snapping in different axes html <div class="holster"> <div class="container x mandatory-scroll-snapping" dir="ltr"> <div>x mand. ltr</div> <div>2</div> <div>3</div> <div>4</div> <div>5</div...
...idth: 256px; height: 100%; } /* appearance fixes */ .y.container > div:first-child { line-height: 1.3; font-size: 64px; } /* coloration */ .container > div:nth-child(even) { background-color: #87ea87; } .container > div:nth-child(odd) { background-color: #87ccea; } results specifications specification status comment css scroll snap module level 1the def
inition of 'scroll-snap-type' in that specification. candidate recommendation
initial def
inition ...
shape-image-threshold - CSS: Cascading Style Sheets
quest. any pixels whose alpha component's value is greater than the threshold are considered to be part of the shape for the purposes of determining its boundaries. for example, a value of 0.5 means that the shape will enclose all the pixels that are more than 50% opaque. ...
...obal values */ shape-image-threshold: inherit; shape-image-threshold:
initial; shape-image-threshold: unset; syntax values <alpha-value> sets the threshold used for extracting a shape from an image. the shape is defined by the pixels whose alpha value is greater than the threshold. values outside the range 0.0 (fully transparent) to 1.0 (fully opaque) are clamped to this range. formal def
inition
initial value0.0applies tofloatsinheritednocomputed valuethe same as the specified value after clipping the <number> to the range [0.0, 1.0].animation typea number formal syntax <alpha-value>where <alpha-value> = <number> | <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 usin...
...ame gradient is also used as the image from which the shape is derived for establishing the float area, using the shape-outside property. the 20% opacity threshold for treating gradient pixels as part of the shape is then established using shape-image-threshold with a value of 0.2. result specifications specification status comment css shapes module level 1the def
inition of 'shape-image-threshold' in that specification. candidate recommendation
initial def
inition ...
text-decoration - CSS: Cascading Style Sheets
onghand text-decoration properties. values text-decoration-line sets the kind of decoration used, such as underline or line-through. text-decoration-color sets the color of the decoration. text-decoration-style sets the style of the line used for the decoration, such as solid, wavy, or dashed. text-decoration-thickness sets the thickness of the line used for the decoration. formal def
inition
initial valueas each of the properties of the shorthand:text-decoration-color: currentcolortext-decoration-style: solidtext-decoration-line: noneapplies toall elements. it also applies to ::first-letter and ::first-line.inheritednocomputed valueas each of the properties of the shorthand:text-decoration-line: as specifiedtext-decoration-style: as specifiedtext-decoration-color: computed colort...
....</p> <p class="blink">this text might blink for you, depending on the browser you use.</p> specifications specification status comment css text decoration module level 4 working draft adds text-decoration-thickness; note that this isn't yet officially part of the shorthand — this is as yet unspecified. css text decoration module level 3the def
inition of 'text-decoration' in that specification. candidate recommendation transformed into a shorthand property. added support for the value of text-decoration-style. css level 2 (revision 1)the def
inition of 'text-decoration' in that specification. recommendation no significant changes. css level 1the def
inition of 'text-decoration' in that specification. recommend...
...ext-decoration' in that specification. candidate recommendation transformed into a shorthand property. added support for the value of text-decoration-style. css level 2 (revision 1)the def
inition of 'text-decoration' in that specification. recommendation no significant changes. css level 1the def
inition of 'text-decoration' in that specification. recommendation
initial def
inition. ...
text-rendering - CSS: Cascading Style Sheets
ring css property provides information to the rendering engine about what to optimize for when rendering text. the browser makes trade-offs among speed, legibility, and geometric precision. /* keyword values */ text-rendering: auto; text-rendering: optimizespeed; text-rendering: optimizelegibility; text-rendering: geometricprecision; /* global values */ text-rendering: inherit; text-rendering:
initial; text-rendering: unset; note: the text-rendering property is an svg property that is not defined in any css standard. however, gecko and webkit browsers let you apply this property to html and xml content on windows, macos, and linux. one very visible effect is optimizelegibility, which enables ligatures (ff, fi, fl, etc.) in text smaller than 20px for some fonts (for example, microsoft's...
...y supported by the rendering engine — lets you scale your text fluidly. for large scale factors, you might see less-than-beautiful text rendering, but the size is what you would expect—neither rounded up nor down to the nearest font size supported by windows or linux. note: webkit precisely applies the specified value, but gecko treats the value the same as optimizelegibility. formal def
inition
initial valueautoapplies totext elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | optimizespeed | optimizelegibility | geometricprecision examples automatic application of optimizelegibility this demonstrates how optimizelegibility is used by browsers automatically when the font-size is smaller than 20px. html <p class="small">lyowat - ff fi fl f...
... class="speed">lyowat - ff fi fl ffl</p> <p class="legibility">lyowat - ff fi fl ffl</p> css p { font: 1.5em "constantia", "times new roman", "georgia", "palatino", serif } .speed { text-rendering: optimizespeed; } .legibility { text-rendering: optimizelegibility; } result specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'text-rendering' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'text-rendering' in that specification. recommendation
initial def
inition ...
text-shadow - CSS: Cascading Style Sheets
each shadow is specified as two or three <length> values, followed optionally by a <color> value. the first two <length> values are the <offset-x> and <offset-y> values. the third, optional, <length> value is the <blur-radius>. the<color> value is the shadow's color. when more than one shadow is given, sh...
...ifies the vertical distance; a negative value places the shadow above the text. if both values are 0, the shadow is placed directly behind the text, although it may be partly visible due to the effect of <blur-radius>. <blur-radius> optional. this is a <length> value. the higher the value, the bigger the blur; the shadow becomes wider and lighter. if not specified, it defaults to 0. formal def
inition
initial valuenoneapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valuea color plus three absolute lengthsanimation typea shadow list formal syntax none | <shadow-t>#where <shadow-t> = [ <length>{2,3} && <color>? ]where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>wher...
... 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. later it was moved to css text decoration module level 3. ...
text-underline-offset - CSS: Cascading Style Sheets
decoration lines, text-underline-offset only impacts underlining, and not other possible line decoration options such as overline or line-through. syntax /* single keyword */ text-underline-offset: auto; /* length */ text-underline-offset: 0.1em; text-underline-offset: 3px; /* percentage */ text-underline-offset: 20%; /* global values */ text-underline-offset: inherit; text-underline-offset:
initial; text-underline-offset: unset; the text-underline-offset property is specified as a single value from the list below. values auto the browser chooses the appropriate offset for underlines. <length> specifies the offset of underlines as a <length>, overriding the font file suggestion and the browser default. it is recommended to use em units so the offset scales with the font size. <p...
...entage> specifies the offset of underlines as a <percentage> of 1 em in the element's font. a percentage inherits as a relative value, and so therefore scales with changes in the font. for a given application of this property, the offset is constant across the whole box that the underline is applied to, even if there are child elements with different font sizes or vertical alignment. formal def
inition
initial valueautoapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyespercentagesrefer to the font size of the element itselfcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length> | <percentage> examples <p class="oneline">here's some text with an offset wavy red underline!</p> <br> <p class="twolines">this text has l...
...line!</p> <br> <p class="twolines">this text has lines both above and below it. only the bottom one is offset.</p> p { text-decoration: underline wavy red; text-underline-offset: 1em; } .twolines { text-decoration-color: purple; text-decoration-line: underline overline; } specifications specification status comment css text decoration module level 4the def
inition of 'text-underline-offset' in that specification. working draft
initial def
inition. ...
translate - CSS: Cascading Style Sheets
es (respectively) of a 2d translation. equivalent to a translate() (2d translation) function with two values specified. three values two <length-percentage> and single <length> values that specify the x, y, and z axis translation values (respectively) of a 3d translation. equivalent to a translate3d() (3d translation) function. none specifies that no translation should be applied. ...
...ctively) of a 2d translation. equivalent to a translate() (2d translation) function with two values specified. three values two <length-percentage> and single <length> values that specify the x, y, and z axis translation values (respectively) of a 3d translation. equivalent to a translate3d() (3d translation) function. none specifies that no translation should be applied. ...
...s-serif; } div { width: 150px; margin: 0 auto; } p { padding: 10px 5px; border: 3px solid black; border-radius: 20px; width: 150px; font-size: 1.2rem; text-align: center; } .translate { transition: translate 1s; } div:hover .translate { translate: 200px 50px; } result specifications specification status comment css transforms level 2the def
inition of 'individual transforms' in that specification. editor's draft
initial def
inition.
initial valuenoneapplies totransformable elementsinheritednopercentagesrefer to the size of bounding boxcomputed valueas specified, but with relative lengths converted into absolute lengthsanimation typea transformcreates stacking contextyes ...
url() - CSS: Cascading Style Sheets
l of the stylesheet (not to the url of the web page). the url() function can be included as a value for background, background-image, list-style, list-style-image, content, cursor, border, border-image, border-image-source, mask, mask-image, src as part of a @font-face block, and @counter-style/symbol in css level 1, the url() functional notation described only true urls. in css level 2, the def
inition of url() was extended to describe any uri, including urns. css values and units level 3 returned to the narrower,
initial def
inition. now, url() denotes only true <url>s. syntax values <string> <url> a url, which is a relative or absolute address, or pointer, to the web resource to be included, or a data uri, optionally in single or double quotes. quotes are required if the url in...
... recommendation no significant change from css level 1. css level 1...
... stroke='%2300f' stroke-width='5'/%3e%3cpath d='m10 20h60' stroke='%230f0' stroke-width='5'/%3e%3cpath d='m10 30h60' stroke='red' stroke-width='5'/%3e%3c/svg%3e"); } specifications specification status comment css values and units module level 4the def
inition of 'url()' in that specification. editor's draft css values and units module level 3the def
inition of 'url()' in that specification. candidate recommendation no significant change from css level 2 (revision 1). css level 2 (revision 1)the def
inition of 'uri()' in that specification. recommendation no significant change from css level 1. css level 1the def
inition of 'url()' in that specification. recommendation
initial def
inition. ...
<url> - CSS: Cascading Style Sheets
used in numerous css properties, such as background-image, cursor, and list-style. uri or url? there is a difference between a uri and a url. a uri simply identifies a resource. a url is a type of uri, and describes the location of a resource. a uri can be either a url or a name (urn) of a resource. in css level 1, the url() functional notation described only true urls. in css level 2, the def
inition of url() was extended to describe any uri, whether a url or a urn. confusingly, this meant that url() could be used to create a <uri> css data type. this change was not only awkward but, debatably, unnecessary, since urns are almost never used in actual css. to alleviate the confusion, css level 3 returned to the narrower,
initial def
inition. now, url() denotes only true <url>s. syntax the ...
... recommendation no significant change from css level 1. css level 1...
...ycursor.png) examples .topbanner { background: url("topbanner.png") #00d no-repeat fixed; } ul { list-style: square url(http://www.example.com/redball.png); } specifications specification status comment css values and units module level 4the def
inition of '<url>' in that specification. editor's draft css values and units module level 3the def
inition of '<url>' in that specification. candidate recommendation no significant change from css level 2 (revision 1). css level 2 (revision 1)the def
inition of '<uri>' in that specification. recommendation no significant change from css level 1. css level 1the def
inition of '<url>' in that specification. recommendation
initial def
inition. ...
white-space - CSS: Cascading Style Sheets
ase clone https://github.com/mdn/interactive-examples and send us a pull request. note: to make words break within themselves, use overflow-wrap, word-break, or hyphens instead. syntax /* keyword values */ white-space: normal; white-space: nowrap; white-space: pre; white-space: pre-wrap; white-space: pre-line; white-space: break-spaces; /* global values */ white-space: inherit; white-space:
initial; white-space: unset; the white-space property is specified as a single keyword chosen from the list of values below. values normal sequences of white space are collapsed. newline characters in the source are handled the same as other white space. lines are broken as necessary to fill line boxes. nowrap collapses white space as for normal, but suppresses line breaks (text wrapping) wit...
... 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 def
inition
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; /* ie 5.5-7 */ white-space: pre-wrap; /* modern browsers */ } in action html <di...
...rcitation 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 officia deserunt mollit anim id est laborum.</p> result specifications specification status comment css text module level 3the def
inition of 'white-space' in that specification. working draft precisely defines the breaking algorithms. css level 2 (revision 1)the def
inition of 'white-space' in that specification. recommendation
initial def
inition. ...
zoom - CSS: Cascading Style Sheets
y can be used to control the magnification level of an element. transform: scale() should be used instead of this property, if possible. however, unlike css transforms, zoom affects the layout size of the element. /* keyword values */ zoom: normal; zoom: reset; /* <percentage> values */ zoom: 50%; zoom: 200%; /* <number> values */ zoom: 1.1; zoom: 0.7; /* global values */ zoom: inherit; zoom:
initial; zoom: unset; syntax values normal render this element at its normal size. reset do not (de)magnify this element if the user applies non-pinch-based zooming (e.g. by pressing ctrl-- or ctrl++ keyboard shortcuts) to the document. only supported by webkit (and possibly blink). <percentage> zoom factor. 100% is equivalent to normal. values larger than 100% zoom in. values smaller tha...
...sing ctrl-- or ctrl++ keyboard shortcuts) to the document. only supported by webkit (and possibly blink). <percentage> zoom factor. 100% is equivalent to normal. values larger than 100% zoom in. values smaller than 100% zoom out. <number> zoom factor. equivalent to the corresponding percentage (1.0 = 100% = normal). values larger than 1.0 zoom in. values smaller than 1.0 zoom out. ...
...-- or ctrl++ keyboard shortcuts) to the document. only supported by webkit (and possibly blink). <percentage> zoom factor. 100% is equivalent to normal. values larger than 100% zoom in. values smaller than 100% zoom out. <number> zoom factor. equivalent to the corresponding percentage (1.0 = 100% = normal). values larger than 1.0 zoom in. values smaller than 1.0 zoom out. ...
Setting up adaptive streaming media sources - Developer guides
s="urn:mpeg:dash:profile:isoff-main:2011" type="static" mediapresentationduration="pt0h9m56.46s"> <baseurl> http://example.com/segments </baseurl> <period start="pt0s"> <adaptationset bitstreamswitching="true"> <representation id="0" codecs="avc1" mimetype="video/mp4" width="320" height="240" startwithsap="1" bandwidth="46986"> <segmentbase> <
initialization sourceurl="main/news100/1.m4s" range="0-862"/> </segmentbase> <segmentlist duration="1"> <segmenturl media="main/news100/2.m4s" mediarange="863-7113"/> <segmenturl media="main/news100/3.m4s" mediarange="7114-14104"/> <segmenturl media="main/news100/4.m4s" mediarange="14105-17990"/> </segmentlist> </representation>...
...m4s" mediarange="863-7113"/> <segmenturl media="main/news100/3.m4s" mediarange="7114-14104"/> <segmenturl media="main/news100/4.m4s" mediarange="14105-17990"/> </segmentlist> </representation> <representation id="1" codecs="avc1" mimetype="video/mp4" width="320" height="240" startwithsap="1" bandwidth="91932"> <segmentbase> <
initialization sourceurl="main/news200/1.m4s" range="0-864"/> </segmentbase> <segmentlist duration="1"> <segmenturl media="main/news200/2.m4s" mediarange="865-11523"/> <segmenturl media="main/news200/3.m4s" mediarange="11524-25621"/> <segmenturl media="main/news200/4.m4s" mediarange="25622-33693"/> </segmentlist> </representatio...
..." mediarange="865-11523"/> <segmenturl media="main/news200/3.m4s" mediarange="11524-25621"/> <segmenturl media="main/news200/4.m4s" mediarange="25622-33693"/> </segmentlist> </representation> <representation id="1" codecs="avc1" mimetype="video/mp4" width="320" height="240" startwithsap="1" bandwidth="270370"> <segmentbase> <
initialization sourceurl="main/news300/1.m4s" range="0-865"/> </segmentbase> <segmentlist duration="1"> <segmenturl media="main/news300/2.m4s" mediarange="866-26970"/> <segmenturl media="main/news300/3.m4s" mediarange="26971-72543"/> <segmenturl media="main/news300/4.m4s" mediarange="72544-95972"/> </segmentlist> </representatio...
Video player styling basics - Developer guides
ce the images are quite small, the resultant encoded strings are quite short. since some buttons have dual functionality, e.g. play/pause, and mute/unmute, these buttons have different states that need to be styled. as mentioned earlier, a `data-state` variable is used to indicate which state such buttons are currently in. for example, the play/pause button has the following background image def
initions (the full base64 strings have been omitted for brevity): .controls button[data-state="play"] { background-image: url('data:image/png;base64,ivborw0kggoaaa ... '); } .controls button[data-state="pause"] { background-image: url('data:image/png;base64,ivborw0kggoaaa ... '); } when the data-state of the button is changed, the appropriate image will also be changed. all the other buttons ...
... background:#e6e6e6; height:65%; } .controls progress span { width:0%; height:100%; display:inline-block; background-color:#2a84cd; } a .data-state class is also used here when a <progress> element is being "faked"; when it's in this state the background colour needs to be set. the internal <span> element used as the actual progressing part of the faked progress bar has its width
initially set to 0% (it is updated via javascript) and it also has its background colour set. there are some browser-specific properties that need to be set to ensure that firefox and chrome use the required colour for the progress bar: .controls progress::-moz-progress-bar { background-color:#0095dd; } .controls progress::-webkit-progress-value { background-color:#0095dd; } although the sam...
...max-width:64em) { figure { padding-left:0; padding-right:0; height:auto; } .controls { height:1.876rem; } } this works well enough until it is viewed on a smaller screen (680px/42.5em), so another breakpoint is made here. since the height of the .controls class element will now vary, a fixed height is no longer required — it is therefore set to auto. ...
Creating a cross-browser video player - Developer guides
ribute is still added to the <video> element, and the player's default control set is switched off later with javascript. doing things this way still allows users who have javascript turned off (for whatever reason) to still have access to the browser's native controls. a poster image is defined for the video, and the preload attribute is set to metadata, which informs the browser that it should
initially only attempt to load the metadata from the video file rather than the entire video file. this provides the player with data such as video duration and format. note: ie9 behaves differently than most other browsers when a poster attribute is set. most browsers interpret the presence of a poster attribute to mean that the specified image is to be displayed until the user chooses to play the ...
...n">vol-</button></li> <li><button id="fs" type="button">fullscreen</button></li> </ul> each button is given an id so it can be easily accessed with javascript. the span within the <progress> element is for browsers that do not support the progress element and will be updated at the same time as progress (this span element won't be visible on browsers that support progress). the controls are
initially hidden with a css display:none and will be enabled with javascript. again if a user has javascript disabled, the custom control set will not appear and they can use the browser's default control set unhindered. of course this custom control set is currently useless and doesn't do a thing: let's improve the situation with javascript. using the media api html5 comes with a javascript media ...
...ript media api that allows developers access to and control of html5 media. this api will be used to make the custom control set defined above actually do something. in addition, the fullscreen button will use the fullscreen api, another w3c api that controls the ability of web browsers to show apps using your computer's full screen. setup before dealing with the individual buttons, a number of
initialisation calls are required. to begin with, it's a good idea to first check if the browser actually supports the <video> element and to only setup the custom controls if it does. this is done by simply checking if a created <video> element supports the canplaytype() method, which any supported html5 <video> element should. var supportsvideo = !!document.createelement('video').canplaytype; if (...
Rich-Text Editing in Mozilla - Developer guides
ting support in mozilla 1.3 supports the designmode feature which turns html documents into rich-text editors. starting in firefox 3, mozilla also supports internet explorer's contenteditable attribute which allows any element to become editable or non-editable (the latter for when preventing change to fixed elements in an editable environment). setting up rich-text editing rich-text editing is
initialized by setting the designmode property of a document to "on", such as the document inside an iframe. once designmode has been set to "on", the document becomes a rich-text editing area and the user can type into it as if it were a textarea. the most basic keyboard commands such as copy and paste are available, all others need to be implemented by the website. similarly, setting contenteditabl...
...style="font-weight:bold;">b</button> javascript: function doricheditcommand(aname, aarg){ getiframedocument('editorwindow').execcommand(aname,false, aarg); document.getelementbyid('editorwindow').contentwindow.focus() } example: a simple but complete rich text editor <!doctype html> <html> <head> <title>rich text editor</title> <script type="text/javascript"> var odoc, sdeftxt; function
initdoc() { odoc = document.getelementbyid("textbox"); sdeftxt = odoc.innerhtml; if (document.compform.switchmode.checked) { setdocmode(true); } } function formatdoc(scmd, svalue) { if (validatemode()) { document.execcommand(scmd, false, svalue); odoc.focus(); } } function validatemode() { if (!document.compform.switchmode.checked) { return true ; } alert("uncheck \"show html\"."); odo...
.../script> <style type="text/css"> .intlink { cursor: pointer; } img.intlink { border: 0; } #toolbar1 select { font-size:10px; } #textbox { width: 540px; height: 200px; border: 1px #000000 solid; padding: 12px; overflow: scroll; } #textbox #sourcetext { padding: 0; margin: 0; min-width: 498px; min-height: 200px; } #editmode label { cursor: pointer; } </style> </head> <body onload="
initdoc();"> <form name="compform" method="post" action="sample.php" onsubmit="if(validatemode()){this.mydoc.value=odoc.innerhtml;return true;}return false;"> <input type="hidden" name="mydoc"> <div id="toolbar1"> <select onchange="formatdoc('formatblock',this[this.selectedindex].value);this.selectedindex=0;"> <option selected>- formatting -</option> <option value="h1">title 1 <h1></option> <opt...
disabled - HTML: Hypertext Markup Language
recommendation ...
... recommendation ...
...gular </label> </p> <p> <label>number: <input type="number"></label> </p> </fieldset> specifications specification status comment html living standardthe def
inition of 'disabled attribute' in that specification. living standard html5the def
inition of 'disabled attribute' in that specification. recommendation html 5.1the def
inition of 'disabled attribute' in that specification. recommendation ...
HTML attribute reference - HTML: Hypertext Markup Language
y attribute. please use the css background-color property instead. border <img>, <object>, <table> the border width. note: this is a legacy attribute. please use the css border property instead. buffered <audio>, <video> contains the time range of already buffered media. capture <input> from the html media capturethe def
inition of 'media capture' in that specification.spec, specifies a new file can be captured. challenge <keygen> a challenge string that is submitted along with the public key. charset <meta>, <script> declares the character encoding of the page or script. checked <command>, <input> indicates whether the element should be checked on page load. cite ...
...ned. method <form> defines which http method to use when submitting the form. can be get (default) or post. min <input>, <meter> indicates the minimum value allowed. multiple <input>, <select> indicates whether multiple values can be entered in an input of the type email or file. muted <audio>, <video> indicates whether the audio will be
initially silenced on page load. name <button>, <form>, <fieldset>, <iframe>, <input>, <keygen>, <object>, <output>, <select>, <textarea>, <map>, <meta>, <param> name of the element. for example used by the server to identify the fields in form submits. novalidate <form> this attribute indicates that the form shouldn't be validated when submitted. open <detail...
...re, this establishes the element's width. note: for all other instances, such as <div>, this is a legacy attribute, in which case the css width property should be used instead. wrap <textarea> indicates whether the text should be wrapped. content versus idl attributes in html, most attributes have two faces: the content attribute and the idl (interface def
inition language) attribute. the content attribute is the attribute as you set it from the content (the html code) and you can set it or get it via element.setattribute() or element.getattribute(). the content attribute is always a string even when the expected value should be an integer. for example, to set an <input> element's maxlength to 42 using the content attribute, you have to call setattribu...
<address>: The Contact Address element - HTML: Hypertext Markup Language
dom interface htmlelement prior to gecko 2.0 (firefox 4), gecko implemented this element using the htmlspanelement interface attributes this element only includes the global attributes. usage notes it used to be the case that an <address> element was only supposed to be used to represent the contact information of the document's author. in the latest spec versions however, its def
inition has been updated so it can now be used to mark up arbitrary addresses. this element should not contain more information than the contact information, like a publication date (which belongs in a <time> element). typically an <address> element can be placed inside the <footer> element of the current section, if any. examples this example demonstrates the use of <address> to demarcate the co...
... recommendation ...
...lthough it renders text with the same default styling as the <i> or <em> elements, it is more appropriate to use <address> when dealing with contact information, as it conveys additional semantic information. specifications specification status comment html living standardthe def
inition of '<address>' in that specification. living standard html5the def
inition of '<address>' in that specification. recommendation html 4.01 specificationthe def
inition of '<address>' in that specification. recommendation ...
<dd>: The Description Details element - HTML: Hypertext Markup Language
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. content categories none. permitted content flow content. tag omission the start tag is required. the end tag may be omitted if the <dd> element is immediately followed by another <dd> element or a <dt> element, or if there is no more content in the parent element. permitted parents <dl> or (in whatwg html) a <div> that is inside a <dl>. ...
... tag omission the start tag is required. the end tag may be omitted if the <dd> element is immediately followed by another <dd> element or a <dt> element, or if there is no more content in the parent element. permitted parents <dl> or (in whatwg html) a <div> that is inside a <dl>. previous sibling <dt> or another <dd> element. implicit aria role def
inition permitted aria roles no role permitted dom interface htmlelement attributes this element's attributes include the global attributes. nowrap if the value of this attribute is set to yes, the def
inition text will not wrap. the default value is no. example for an example, see <dl> examples. specifications specification status comment ...
... no role permitted dom interface htmlelement attributes this element's attributes include the global attributes. nowrap if the value of this attribute is set to yes, the def
inition text will not wrap. the default value is no. example for an example, see <dl> examples. specifications specification status comment html living standardthe def
inition of '<dd>' in that specification. living standard html5the def
inition of '<dd>' in that specification. recommendation html 4.01 specificationthe def
inition of '<dd>' in that specification. recommendation ...
<div>: The Content Division element - HTML: Hypertext Markup Language
recommendation ...
... recommendation ...
...linear-gradient(180deg, #fff, #ddd 40%, #ccc); } result specifications specification status comment html living standardthe def
inition of '<div>' in that specification. living standard no changes since the latest snapshot html5the def
inition of '<div>' in that specification. recommendation obsoleted align html 4.01 specificationthe def
inition of '<div>' in that specification. recommendation ...
<dt>: The Description Term element - HTML: Hypertext Markup Language
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. content categories none. ...
... 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. content categories none. ...
... listitem dom interface htmlelement up to gecko 1.9.2 (firefox 4) inclusive, firefox implements the htmlspanelement interface for this element. attributes this element only includes the global attributes. example for an example, see the example provided for the <dl> element. specifications specification status comment html living standardthe def
inition of '<dt>' in that specification. living standard html5the def
inition of '<dt>' in that specification. recommendation html 4.01 specificationthe def
inition of '<dt>' in that specification. recommendation ...
<figure>: The Figure with Optional Caption element - HTML: Hypertext Markup Language
recommendation ...
... recommendation ...
...figcaption><cite>venus and adonis</cite>, by william shakespeare</figcaption> </figure> specifications specification status comment html living standardthe def
inition of '<figure>' in that specification. living standard html 5.2the def
inition of '<figure>' in that specification. recommendation no changes from html 5.0. html5the def
inition of '<figure>' in that specification. recommendation ...
<img>: The Image Embed element - HTML: Hypertext Markup Language
deprecated attributes align aligns the image with its surrounding context. use the float and/or vertical-align css properties instead of this attribute. allowed values: top equivalent to vertical-align: top or vertical-align: text-top middle equivalent to vertical-align: -moz-middle-with-baseline bottom the default, equivalent to vertical-align: unset or vertical-align:
initial left equivalent to float: left right equivalent to float: right border the width of a border around the image. use the border css property instead. hspace the number of pixels of white space on the left and right of the image. use the margin css property instead. longdesc a link to a more detailed description of the image. possible values are a url or an element id. ...
... recommendati...
...h empty alt attribute, none or presentation with no alt attribute, no role permitted dom interface htmlimageelement specifications specification status comment referrer policythe def
inition of 'referrer attribute' in that specification. candidate recommendation added the referrerpolicy attribute. html living standardthe def
inition of '<img>' in that specification. living standard html5the def
inition of '<img>' in that specification. recommendation html 4.01 specificationthe def
inition of '<img>' in that specification. recommendation ...
<input type="datetime-local"> - HTML: Hypertext Markup Language
lbackpicker = document.queryselector('.fallbackdatetimepicker'); var fallbacklabel = document.queryselector('.fallbacklabel'); var yearselect = document.queryselector('#year'); var monthselect = document.queryselector('#month'); var dayselect = document.queryselector('#day'); var hourselect = document.queryselector('#hour'); var minuteselect = document.queryselector('#minute'); // hide fallback
initially fallbackpicker.style.display = 'none'; fallbacklabel.style.display = 'none'; // test whether a new datetime-local input falls back to a text input or not var test = document.createelement('input'); try { test.type = 'datetime-local'; } catch (e) { console.log(e.description); } // if it does, run the code inside the if() {} block if(test.type === 'text') { // hide the native picker a...
... recommendation ...
...previousday = dayselect.value; } note: remember that some years have 53 weeks in them (see weeks per year)! you'll need to take this into consideration when developing production apps. specifications specification status comments html living standardthe def
inition of '<input type="datetime-local">' in that specification. living standard html5the def
inition of '<input type="datetime-local">' in that specification. recommendation ...
<li> - HTML: Hypertext Markup Language
recommendation the type attribute has been deprecated. ...
... recommendation the type attribute has been deprecated. ...
.../ol> unordered list <ul> <li>first item</li> <li>second item</li> <li>third item</li> </ul> specifications specification status comment html living standardthe def
inition of '<li>' in that specification. living standard html5the def
inition of '<li>' in that specification. recommendation html 4.01 specificationthe def
inition of '<li>' in that specification. recommendation the type attribute has been deprecated. ...
<meter>: The HTML Meter element - HTML: Hypertext Markup Language
this: high and low range example note that in this example the min attribute is omitted. this is allowed, as it will default to 0. ...
...ted. this is allowed, as it will default to 0. ...
... <meter low="69" high="80" max="100" value="84">b</meter> on the exam.</p> result on google chrome, the resulting meter looks like this: specifications specification status comment html living standardthe def
inition of '<meter>' in that specification. living standard html5the def
inition of '<meter>' in that specification. recommendation
initial def
inition ...
<object> - HTML: Hypertext Markup Language
recommendation ...
... recommendation ...
...ject data="movie.swf" type="application/x-shockwave-flash"> <param name="foo" value="bar"> </object> specifications specification status comment html living standardthe def
inition of '<object>' in that specification. living standard html5the def
inition of '<object>' in that specification. recommendation html 4.01 specificationthe def
inition of '<object>' in that specification. recommendation ...
<optgroup> - HTML: Hypertext Markup Language
recommendation ...
... recommendation ...
... <option>option 3.2</option> <option>option 3.3</option> </optgroup> </select> result specifications specification status comment html living standardthe def
inition of '<optgroup>' in that specification. living standard html5the def
inition of '<optgroup>' in that specification. recommendation html 4.01 specificationthe def
inition of '<optgroup>' in that specification. recommendation ...
<script>: The Script element - HTML: Hypertext Markup Language
recommendation ...
... recommendation ...
...data").text); console.log("user information: %o", userinfo); </script> specifications specification status comments html living standardthe def
inition of '<script>' in that specification. living standard removed the charset attribute html5the def
inition of '<script>' in that specification. recommendation html 4.01 specificationthe def
inition of '<script>' in that specification. recommendation ...
<time> - HTML: Hypertext Markup Language
...
... ...
...took place on <time datetime="2001-05-15t19:00">may 15</time>.</p> output specifications specification status comment html living standardthe def
inition of '<time>' in that specification. living standard no change from html 5.1 html 5.1the def
inition of '<time>' in that specification. recommendation no change from html5 html5the def
inition of '<time>' in that specification. recommendation
initial def
inition. ...
<video>: The Video Embed element - HTML: Hypertext Markup Language
duration read only a double-precision floating-point value which indicates the duration (total length) of the media in seconds, on the media's timeline. if no media is present on the element, or the media is not valid, the returned value is nan. if the media has no known end (such as for live streams of unknown duration, web radio, media incoming from webrtc, and so forth), this value is +inf
inity. height the height of the video's display area, in css pixels (absolute values only; no percentages.) intrinsicsize this attribute tells the browser to ignore the actual intrinsic size of the image and pretend it’s the size specified in the attribute. specifically, the image would raster at these dimensions and naturalwidth/naturalheight on images would return the values specified in thi...
... raster at these dimensions and naturalwidth/naturalheight on images would return the values specified in this attribute. explainer, examples loop a boolean attribute; if specified, the browser will automatically seek back to the start upon reaching the end of the video. muted a boolean attribute that indicates the default setting of the audio contained in the video. if set, the audio will be
initially silenced. its default value is false, meaning that the audio will be played when the video is played. playsinline a boolean attribute indicating that the video is to be played "inline", that is within the element's playback area. note that the absence of this attribute does not imply that the video will always be played in fullscreen. poster a url for an image to be shown while the video...
...eo>. tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts embedded content. implicit aria role no corresponding role permitted aria roles application dom interface htmlvideoelement specifications specification feedback html living standardthe def
inition of '<video>' in that specification. whatwg html github issues ...
HTML elements reference - HTML: Hypertext Markup Language
tml block quotation element) indicates that the enclosed text is an extended quotation. usually, this is rendered visually by indentation (see notes for how to change it). a url for the source of the quotation may be given using the cite attribute, while a text representation of the source can be given using the <cite> element. <dd> the html <dd> element provides the description, def
inition, or value for the preceding term (<dt>) in a description list (<dl>). <div> the html content division element (<div>) is the generic container for flow content. it has no effect on the content or layout until styled using css. <dl> the html <dl> element represents a description list. the element encloses a list of groups of terms (specified using the <dt> element) a...
...sing css. <dl> the html <dl> element represents a description list. the element encloses a list of groups of terms (specified using the <dt> element) and descriptions (provided by <dd> elements). common uses for this element are to implement a glossary or to display metadata (a list of key-value pairs). <dt> the html <dt> element specifies a term in a description or def
inition list, and as such must be used inside a <dl> element. <figcaption> the html <figcaption> or figure caption element represents a caption or legend describing the rest of the contents of its parent <figure> element. <figure> the html <figure> (figure with optional caption) element represents self-contained content, potentially with an optional caption, which is specif...
... title of that work. <code> the html <code> element displays its contents styled in a fashion intended to indicate that the text is a short fragment of computer code. <data> the html <data> element links a given piece of content with a machine-readable translation. if the content is time- or date-related, the <time> element must be used. <dfn> the html def
inition element (<dfn>) is used to indicate the term being defined within the context of a def
inition phrase or sentence. <em> the html <em> element marks text that has stress emphasis. the <em> element can be nested, with each level of nesting indicating a greater degree of emphasis. <i> the html idiomatic text element (<i>) represents a range of text that is set off from ...
dropzone - HTML: Hypertext Markup Language
element, using the html drag and drop api. ...
...s that dropping will create a copy of the element that was dragged. ...
...ping will create a copy of the element that was dragged. ...
hidden - HTML: Hypertext Markup Language
d a form control could refer to a hidden form element using its form attribute. note: changing the value of the css display property on an element with the hidden attribute overrides the behavior. for instance, elements styled display: flex will be displayed despite the hidden attribute's presence. specifications specification status comment html living standardthe def
inition of 'hidden' in that specification. living standard no change from latest snapshot, html 5.1 html living standardthe def
inition of 'hidden elements' in that specification. living standard defines the suggested default rendering of the hidden attribute using css html 5.1the def
inition of 'hidden' in that specification. recommendation snapshot of html living st...
...hidden' in that specification. living standard no change from latest snapshot, html 5.1 html living standardthe def
inition of 'hidden elements' in that specification. ...
...that specification. living standard no change from latest snapshot, html 5.1 html living standardthe def
inition of 'hidden elements' in that specification. ...
itemprop - HTML: Hypertext Markup Language
d/6992065114/ itemprop website flickr itemprop (token) (token) tokens are either strings or url's. an item is called a typed item if it is a url. otherwise, it is a string. strings cannot contain a period or a colon (see below). if the item is a typed item it must be either: a defined property name, or a valid url, which refers to the vocabulary def
inition, or a valid url that is used as a proprietary item property name (i.e. one not defined in a public specification), or if the item is not a typed item it must be: a string that contains no "." (u+002e full stop) characters and no ":" characters (u+003a colon) and is used as a proprietary item property name (again, one not defined in a public specification). note: the rules...
... living standard ...
...xample.net/book: urn:isbn:0-330-34032-8 itemprop title the reality dysfunction itemprop author peter f. hamilton itemprop pubdate 1996-01-26 result specifications specification status comment html microdatathe def
inition of 'itemprop' in that specification. working draft html living standardthe def
inition of 'itemprop' in that specification. living standard ...
Global attributes - HTML: Hypertext Markup Language
values of its text node children are to be translated when the page is localized, or whether to leave them unchanged. it can have the following values: empty string and yes, which indicates that the element will be translated. no, which indicates that the element will not be translated. specifications specification status comment html living standardthe def
inition of 'global attributes' in that specification. living standard shadow parts working draft added the part and exportparts global attributes. html 5.2the def
inition of 'global attributes' in that specification. recommendation snapshot of html living standard. from html 5.1, itemid, itemprop, itemref, itemscope, and itemtype have been added. html 5.1th...
...f 'global attributes' in that specification. living standard shadow parts working draft added the part and exportparts global attributes. html 5.2the def
inition of 'global attributes' in that specification. recommendation snapshot of html living standard. from html 5.1, itemid, itemprop, itemref, itemscope, and itemtype have been added. html 5.1the def
inition of 'global attributes' in that specification. recommendation snapshot of html living standard. from html5, contextmenu, draggable, dropzone, and spellcheck have been added. html5the def
inition of 'global attributes' in that specification. recommendation snapshot of html living standard. from html 4.01 specification, the concept of global attributes is introduced and the di...
... hidden, data-*, contenteditable, and translate have been added. html 4.01 specification recommendation there are no global attributes defined. ...
Evolution of HTTP - HTTP
of the simplicity and further shaping its flexibility. http has evolved from an early protocol to exchange files in a semi-trusted laboratory environment, to the modern maze of the internet, now carrying images, videos in high resolution and 3d. invention of the world wide web in 1989, while he was working at cern, tim berners-lee wrote a proposal to build a hypertext system over the internet.
initially calling it the mesh, it was later renamed to world wide web during its implementation in 1990. built over the existing tcp and ip protocols, it consisted of 4 building blocks: a textual format to represent hypertext documents, the hypertext markup language (html). a simple protocol to exchange these documents, the hyperttext transfer protocol (http). a client to display (and accidentall...
...he first servers were already running outside of cern by early 1991. on august 6th 1991, tim berners-lee's post on the public alt.hypertext 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 extremely 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 extr...
...t) these novelties have not been introduced as concerted effort, but as a try-and-see approach over the 1991-1995 period: a server and a browser added one feature and it saw if it got traction. a lot of interoperability problems were common. in november 1996, in order to solve these annoyances, an informational document describing the common practices has been published, rfc 1945. this is the def
inition of http/1.0 and it is notable that, in the narrow sense of the term, it isn't an official standard. http/1.1 – the standardized protocol in parallel to the somewhat chaotic use of the diverse implementations of http/1.0, and since 1995, well before the publication of http/1.0 document the next year, proper standardization was in progress. the first standardized version of http, http/1.1 wa...
Cross-Origin Resource Sharing (CORS) - HTTP
n. a web application executes a cross-origin http request when it requests a resource that has a different origin (domain, protocol, or port) from its own. an example of a cross-origin request: the front-end javascript code served from https://domain-a.com uses xmlhttprequest to make a request for https://domain-b.com/data.json. for security reasons, browsers restrict cross-origin http requests
initiated from scripts. for example, xmlhttprequest and the fetch api follow the same-origin policy. this means that a web application using those apis can only request resources from the same origin the application was loaded from unless the response from other origins includes the right cors headers. the cors mechanism supports secure cross-origin requests and data transfers between browsers and ...
...re. note that these headers are set for you when making invocations to servers. developers using cross-site xmlhttprequest capability do not have to set any cross-origin sharing request headers programmatically. origin the origin header indicates the origin of the cross-site access request or preflight request. origin: <origin> the origin is a uri indicating the server from which the request
initiated. it does not include any path information, but only the server name. note: the origin value can be null, or a uri. note that in any access control request, the origin header is always sent. access-control-request-method the access-control-request-method is used when issuing a preflight request to let the server know what http method will be used when the actual request is made. access-c...
...above. access-control-request-headers the access-control-request-headers header is used when issuing a preflight request to let the server know what http headers will be used when the actual request is made. access-control-request-headers: <field-name>[, <field-name>]* examples of this usage can be found above. specifications specification status comment fetchthe def
inition of 'cors' in that specification. living standard new def
inition; supplants w3c cors specification. ...
Cache-Control - HTTP
header type general header forbidden header name no cors-safelisted response header yes syntax caching directives have the following rules to be valid: case-insensitive, but lowercase is recommended. multiple directives are comma-separated. some directives have an optional argument, which can be either a token or a quoted-string. (see spec for def
initions) cache request directives standard cache-control directives that can be used by the client in an http request. cache-control: max-age=<seconds> cache-control: max-stale[=<seconds>] cache-control: min-fresh=<seconds> cache-control: no-cache cache-control: no-store cache-control: no-transform cache-control: only-if-cached cache response directives standard cache-control directives that c...
...cking in the background for a fresh one. the seconds value indicates how long the client will accept a stale response. see "keeping things fresh with stale-while-revalidate" for more information. stale-if-error=<seconds> indicates the client will accept a stale response if the check for a fresh one fails. the seconds value indicates how long the client will accept the stale response after the
initial expiration. revalidation and reloading must-revalidate indicates that once a resource becomes stale, caches must not use their stale copy without successful validation on the origin server. proxy-revalidate like must-revalidate, but only for shared caches (e.g., proxies). ignored by private caches. immutable indicates that the response body will not change over time. the resource, if...
...p downloading http body if the content is valid. cache-control: no-cache cache-control: no-cache, max-age=0 specifications specification status comment rfc 8246: http immutable responses ietf rfc rfc 7234: hypertext transfer protocol (http/1.1): caching ietf rfc rfc 5861: http cache-control extensions for stale content ietf rfc
initial def
inition ...
CSP: block-all-mixed-content - HTTP
...
... ...
...ed-content"> to disallow http assets on a more granular level, you can also set individual directives to https:. for example, to disallow nonsecure http images: content-security-policy: img-src https: specifications specification status comment mixed contentthe def
inition of 'block-all-mixed-content' in that specification. candidate recommendation
initial def
inition. ...
CSP: connect-src - HTTP
subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and def
initely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url scheme and port number. you must include the single quotes. some browse...
... ...
...et("https://not-example.com/"); var es = new eventsource("https://not-example.com/"); navigator.sendbeacon("https://not-example.com/", { ... }); </script> specifications specification status comment content security policy level 3the def
inition of 'connect-src' in that specification. working draft no changes. content security policy level 2the def
inition of 'connect-src' in that specification. recommendation
initial def
inition. ...
CSP: form-action - HTTP
subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and def
initely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url scheme and port number. you must include the single quotes. some browse...
... ...
...="submit" value="submit"> </form> // error: refused to send form data because it violates the following // content security policy directive: "form-action 'none'". specifications specification status comment content security policy level 3the def
inition of 'form-action' in that specification. working draft no changes. content security policy level 2the def
inition of 'form-action' in that specification. recommendation
initial def
inition. ...
Feature-Policy: fullscreen - HTTP
editor's draft defines the fullscreen policy. ...
... editor's draft defines the fullscreen policy. ...
... editor's draft defines the fullscreen policy. ...
Link prefetching FAQ - HTTP
ort to include prefetching <a> tags, which include a relation type of next or prefetch in the future. doing so would probably help content providers avoid the problem of stale prefetching links. is link prefetching standards compliant? yes, link prefetching as outlined in this document does not violate any existing web standards. in fact, the html 4.01 specification explicitly allows for the def
inition of new link relation types (see section 6.12: link types). however, the exact mechanism employed by mozilla is not yet standardized. an internet-draft is in the works. standardization of this technique is part of the scope of html 5, see the current working draft, section §5.11.3.13. link type "prefetch". how is browser idle time determined? in the current implementation (mozilla 1.2), idl...
...e last document stop notification occurs roughly when the onload handler would fire for the toplevel document. this is when we kick off prefetch requests. if a subframe contains prefetching hints, prefetching will not begin until the top-most frame and all its "child" frames finish loading. what happens if i click on a link while something is being prefetched? when the user clicks on a link, or
initiates any kind of page load, link prefetching will stop and any prefetch hints will be discarded. if a prefetched document is partially downloaded, then the partial document will still be stored in the cache provided the server sent an "accept-ranges: bytes" response header. this header is typically generated by webservers when serving up static content. when the user visits a prefetched document ...
... portion of the document will be fetched using a http byte-range request. what if i'm downloading something in the background? will link prefetching compete for bandwidth? yes and no. if you are downloading something using mozilla, link prefetching will be delayed until any background downloads complete. for example, if you load a bookmark group (which opens several tabs), any prefetch requests
initiated by one of the bookmarked pages will not begin until all of the tabs finish loading. if you are using another application which uses the network, link prefetching in mozilla may compete for bandwidth with the other application. this is a problem that we hope to address in the future by leveraging operating system services to monitor network idle time. are there any restrictions on what is pr...
Regular expressions - JavaScript
index at which to start the next match. (this property is set only if the regular expression uses the g option, described in advanced searching with flags.) 5 source the text of the pattern. updated at the time that the regular expression is created, not executed. 'd(b+)d' as shown in the second form of this example, you can use a regular expression created with an object
initializer without assigning it to a variable. if you do, however, every occurrence is a new regular expression. for this reason, if you use this form without assigning it to a variable, you cannot subsequently access the properties of that regular expression. for example, assume you have this script: var myre = /d(b+)d/g; var myarray = myre.exec('cdbbdbsbz'); console.log('the value of lastindex is ...
...ave this script: var myarray = /d(b+)d/g.exec('cdbbdbsbz'); console.log('the value of lastindex is ' + /d(b+)d/g.lastindex); // "the value of lastindex is 0" the occurrences of /d(b+)d/g in the two statements are different regular expression objects and hence have different values for their lastindex property. if you need to access the properties of a regular expression created with an object
initializer, you should first assign it to a variable. advanced searching with flags regular expressions have six optional flags that allow for functionality like global and case insensitive searching. these flags can be used separately or together in any order, and are included as part of the regular expression. regular expression flags flag description corresponding property ...
... ...
Using Promises - JavaScript
t: always return results, otherwise callbacks won't catch the result of a previous promise (with arrow functions () => x is short for () => { return x; }). chaining after a catch it's possible to chain after a failure, i.e. a catch, which is useful to accomplish new actions even after an action failed in the chain. ...
...fter an action failed in the chain. read the following example: new promise((resolve, reject) => { console.log('
initial'); resolve(); }) .then(() => { throw new error('something failed'); console.log('do this'); }) .catch(() => { console.error('do that'); }) .then(() => { console.log('do this, no matter what happened before'); }); this will output the following text:
initial do that do this, no matter what happened before note: the text do this is not displayed because the something failed error caused a rejection. error propagation you might recall seeing failurecallback three times in the pyramid of doom earlier, compared to only once at the end of the promise chain: dosomething() .then(result => dosomethingelse(result)) .then(newresult => dothirdthing(newr...
...result3) */ timing to avoid surprises, functions ...
JavaScript technologies overview - JavaScript
odel). javascript, the core language (ecmascript) the core language of javascript is standardized by the ecma tc39 committee as a language named ecmascript. this core language is also used in non-browser environments, for example in node.js. what falls under the ecmascript scope? among other things, ecmascript defines: language syntax (parsing rules, keywords, control flow, object literal
initialization, ...) error handling mechanisms (throw, try...catch, ability to create user-defined error types) types (boolean, number, string, function, object, ...) the global object. in a browser, this global object is the window object, but ecmascript only defines the apis not specific to browsers, e.g. parseint, parsefloat, decodeuri, encodeuri... a prototype-based inheritance mechanism buil...
...onalization api the ecmascript internationalization api specification is an addition to the ecmascript language specification, also standardized by ecma tc39. the internationalization api provides collation (string comparison), number formatting, and date-and-time formatting for javascript applications, letting the applications choose the language and tailor the functionality to their needs. the
initial standard was approved in december 2012; the status of implementations in browsers is tracked in the documentation of the intl object. the internationalization specification is nowadays also ratified on a yearly basis and browsers constantly improve their implementation. dom apis webidl the webidl specification provides the glue between the dom technologies and ecmascript. the core of the d...
...model, which defines language-agnostic interfaces that abstract html and xml documents as objects, and also defines mechanisms to manipulate this abstraction. among the things defined by the dom, we can find: the document structure, a tree model, and the dom event architecture in dom core: node, element, documentfragment, document, domimplementation, event, eventtarget, … a less rigorous def
inition of the dom event architecture, as well as specific events in dom events. other things such as dom traversal and dom range. from the ecmascript point of view, objects defined in the dom specification are called "host objects". html dom html, the web's markup language, is specified in terms of the dom. layered above the abstract concepts defined in dom core, html also defines the meaning of...
Memory Management - JavaScript
guage, the memory life cycle is pretty much always the same: allocate the memory you need use the allocated memory (read, write) release the allocated memory when it is not needed anymore the second part is explicit in all languages. the first and last parts are explicit in low-level languages but are mostly implicit in high-level languages like javascript. allocation in javascript value
initialization in order to not bother the programmer with allocations, javascript will automatically allocate memory when values are
initially declared. var n = 123; // allocates memory for a number var s = 'azerty'; // allocates memory for a string var o = { a: 1, b: null }; // allocates memory for an object and contained values // (like object) allocates memory for the array and // contained...
...t 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 the browser becoming increasingly slower. mark-and-sweep algorithm this algorithm reduces the def
inition of "an object is no longer needed" to "an object is unreachable". this algorithm assumes the knowledge of a set of objects called roots. in javascript, the root is the global object. periodically, the garbage collector will start from these roots, find all objects that are referenced from these roots, then all objects referenced from these, etc. starting from the roots, the garbage collector ...
...h 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/incremental/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 def
inition 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 by any resource that is reachable from the global object. consequently, they will be found unreachable by the garbage collector and have their allocated memory reclaimed. limitation: releasing memory manually there are...
SyntaxError: missing ] after element list - JavaScript
the javascript exception "missing ] after element list" occurs when there is an error with the array
initializer syntax somewhere. likely there is a closing bracket ("]") or a comma (",") missing. message syntaxerror: missing ] after element list error type syntaxerror. what went wrong? ...
... the javascript exception "missing ] after element list" occurs when there is an error with the array
initializer syntax somewhere. likely there is a closing bracket ("]") or a comma (",") missing. message syntaxerror: missing ] after element list error type syntaxerror. what went wrong? ...
...st" occurs when there is an error with the array
initializer syntax somewhere. likely there is a closing bracket ("]") or a comma (",") missing. message syntaxerror: missing ] after element list error type syntaxerror. what went wrong? ...
SyntaxError: missing } after property list - JavaScript
the javascript exception "missing } after property list" occurs when there is a mistake in the object
initializer syntax somewhere. might be in fact a missing curly bracket, but could also be a missing comma. message syntaxerror: expected '}' (edge) syntaxerror: missing } after property list (firefox) error type syntaxerror what went wrong? ...
... the javascript exception "missing } after property list" occurs when there is a mistake in the object
initializer syntax somewhere. might be in fact a missing curly bracket, but could also be a missing comma. message syntaxerror: expected '}' (edge) syntaxerror: missing } after property list (firefox) error type syntaxerror what went wrong? ...
...s a mistake in the object
initializer syntax somewhere. might be in fact a missing curly bracket, but could also be a missing comma, for example. also check if any closing curly brackets or parenthesis are in the correct order. indenting or formatting the code a bit nicer might also help you to see through the jungle. ...
InternalError: too much recursion - JavaScript
n (firefox) rangeerror: maximum call stack size exceeded (chrome) error type internalerror. what went wrong? a function that calls itself is called a recursive function. once a condition is met, the function stops calling itself. this is called a base case. in some ways, recursion is analogous to a loop. both execute the same code multiple times, and both require a condition (to avoid an inf
inite loop, or rather, inf
inite recursion in this case). when there are too many function calls, or a function is missing a base case, javascript will throw this error. examples this recursive function runs 10 times, as per the exit condition. function loop(x) { if (x >= 10) // "x >= 10" is the exit condition return; // do stuff loop(x + 1); // the recursive call } loop(0); setting this ...
...it condition return; // do stuff loop(x + 1); // the recursive call } loop(0); setting this condition to an extremely high value, won't work: function loop(x) { if (x >= 1000000000000) return; // do stuff loop(x + 1); } loop(0); // internalerror: too much recursion this recursive function is missing a base case. as there is no exit condition, the function will call itself inf
initely. function loop(x) { // the base case is missing loop(x + 1); // recursive call } loop(0); // internalerror: too much recursion class error: too much recursion class person{ constructor(){} set name(name){ this.name = name; // recursive call } } const tony = new person(); tony.name = "tonisha"; // internalerror: too much recursion when a value is assigned to the property name (t...
...o the property name (this.name = name;) javascript needs to set that property. when this happens, the setter function is triggered. set name(name){ this.name = name; // recursive call } in this example when the setter is triggered, it is told to do the same thing again: to set the same property that it is meant to handle. this causes the function to call itself, again and again, making it inf
initely recursive. this issue also appears if the same variable is used in the getter. get name(){ return this.name; // recursive call } to avoid this problem, make sure that the property being assigned to inside the setter function is different from the one that
initially triggered the setter.the same goes for the getter. class person{ constructor(){} set name(name){ this._name = name; } ...
Arrow function expressions - JavaScript
fined at <anonymous>:1:1 (anonymous) @ vm51891:1 > f3(10) 11 > z1 11 f2 illustrates that when explicitly setting the arrow function to apply strict mode, it does throw an error when attempting to assign an undeclared variable. https://www.ecma-international.org/ecma-262/10.0/index.html#sec-strict-mode-code https://www.ecma-international.org/ecma-262/10.0/index.html#sec-arrow-function-def
initions-runtime-semantics-evaluation correction: end invoked through call or apply since arrow functions do not have their own this, the methods call() and apply() can only pass in parameters. any this argument is ignored. var adder = { base: 1, add: function(a) { var f = v => v + this.base; return f(a); }, addthrucall: function(a) { var f = v => v + this.base; var b = {...
... ...
...ncise promise chains promise.then(a => { // ... }).then(b => { // ... }); // parameterless arrow functions that are visually easier to parse settimeout( () => { console.log('i happen sooner'); settimeout( () => { // deeper code console.log('i happen later'); }, 1); }, 1); specifications specification ecmascript (ecma-262)the def
inition of 'arrow function def
initions' in that specification. ...
Default parameters - 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 function [name]([param1[ = defaultvalue1 ][, ..., paramn[ = defaultvaluen ]]]) { statements } description in javascript, function parameters default to undefined. however, it's often useful to set a different default value. this is where default parameters can help. ...
...arguments, "=^_^="] scope effects if default parameters are defined for one or more parameter, then a second scope (environment record) is created, specifically for the identifiers within the parameter list. this scope is a parent of the scope created for the function body. this means that functions and variables declared in the function body cannot be referred to from default value parameter
initializers; attempting to do so throws a run-time referenceerror. it also means that variables declared inside the function body using var will mask parameters of the same name, instead of the usual behavior of duplicate var declarations having no effect. the following function will throw a referenceerror when invoked, because the default parameter value does not have access to the child scope of ...
... defaults. function f(x = 1, y) { return [x, y] } f() // [1, undefined] f(2) // [2, undefined] destructured parameter with default value assignment you can use default value assignment with the destructuring assignment notation: function f([x, y] = [1, 2], {z: z} = {z: 3}) { return x + y + z } f() // 6 specifications specification ecmascript (ecma-262)the def
inition of 'function def
initions' in that specification. ...
getter - JavaScript
it must have exactly zero parameters (see incompatible es5 change: literal getter and setter functions must now have exactly zero or one arguments for more information); it must not appear in an object literal with another get or with a data entry for the same property ({ get x() { }, get x() { } } and { x: ..., get x() { } } are forbidden). examples defining a getter on new objects in object
initializers this will create a pseudo-property 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...
... ...
... ...
setter - JavaScript
t have exactly one parameter (see incompatible es5 change: literal getter and setter functions must now have exactly zero or one arguments for more information); it must not appear in an object literal with another set or with a data entry for the same property. ( { set x(v) { }, set x(v) { } } and { x: ..., set x(v) { } } are forbidden ) examples defining a setter on new objects in object
initializers the following example define a pseudo-property current of object language. when current is assigned a value, it updates log with that value: const language = { set current(name) { this.log.push(name); }, log: [] } language.current = 'en'; console.log(language.log); // ['en'] language.current = 'fa'; console.log(language.log); // ['en', 'fa'] note that current is not define...
... ...
... ...
Array.prototype.filter() - JavaScript
.filter(isprime)); // [2, 3, 5, 7, 11, 13] filtering invalid entries from json the following example uses filter() to create a filtered json of all elements with non-zero, numeric id. ...
... // modifying each words let words = ['spray', 'limit', 'exuberant', 'destruction','elite', 'present'] const modifiedwords = words.filter( (word, index, arr) => { arr[index+1] +=' extra' return word.length < 6 }) console.log(modifiedwords) // notice there ...
... ...
Array.prototype.forEach() - JavaScript
array. index optional the index currentvalue in the array. array optional the array foreach() was called upon. thisarg optional value to use as this when executing callback. return value undefined. description foreach() calls a provided callback function once for each element in an array in ascending order. it is not invoked for index properties that have been deleted or are un
initialized. (for sparse arrays, see example below.) callback is invoked with three arguments: the value of the element the index of the element the array object being traversed if a thisarg parameter is provided to foreach(), it will be used as callback's this value. the thisarg value ultimately observable by callback is determined according to the usual rules for determining the this seen by...
... sure you are aware of the implications while using promises(or async functions) as foreach callback. example code let ratings = [5, 4, 5]; let sum = 0; let sumfunction = async function (a, b) { return a + b } ratings.foreach(async function(rating) { sum = await sumfunction(sum, rating) }) console.log(sum) // naively expected output: 14 // actual output: 0 examples no operation for un
initialized values (sparse arrays) const arraysparse = [1,3,,7] let numcallbackruns = 0 arraysparse.foreach((element) => { console.log(element) numcallbackruns++ }) console.log("numcallbackruns: ", numcallbackruns) // 1 // 3 // 7 // numcallbackruns: 3 // comment: as you can see the missing value between 3 and 7 didn't invoke callback function. converting a for loop to foreach const items = [...
....prototype.flat(). function flatten(arr) { const result = [] arr.foreach((i) => { if (array.isarray(i)) { result.push(...flatten(i)) } else { result.push(i) } }) return result } // usage const nested = [1, 2, 3, [4, 5, [6, 7], 8, 9]] flatten(nested) // [1, 2, 3, 4, 5, 6, 7, 8, 9] specifications specification ecmascript (ecma-262)the def
inition of 'array.prototype.foreach' in that specification. ...
Boolean() constructor - JavaScript
the boolean() constructor is used to create boolean objects. 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 new boolean([value]) parameters value optional the
initial value of the boolean object. ...
...o create boolean objects. 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 new boolean([value]) parameters value optional the
initial value of the boolean object. ...
...xamples and send us a pull request. syntax new boolean([value]) parameters value optional the
initial value of the boolean object. examples creating boolean objects with an
initial value of false var bnoparam = new boolean(); var bzero = new boolean(0); var bnull = new boolean(null); var bemptystring = new boolean(''); var bfalse = new boolean(false); creating boolean objects with an
initial value of true var btrue = new boolean(true); var btruestring = new boolean('true'); var bfalsestring = new boolean('false'); var bsulin = new boolean('su lin'); var barrayproto = new boolean([]); var bobjproto = new boolean({}); specifications specification ecmascript (ecma-262)the def
inition of 'boolean constructor' in that specification. ...
Function.prototype.apply() - JavaScript
s an example, here are math.max/math.min, used to find out the maximum/minimum value in an array. // min/max number in an array const numbers = [5, 6, 2, 3, 7]; // using math.min/math.max apply let max = math.max.apply(null, numbers); // this about equal to math.max(numbers[0], ...) // or math.max(5, 6, ...) let min = math.min.apply(null, numbers); // vs. simple loop based algorithm max = -inf
inity, min = +inf
inity; for (let i = 0; i < numbers.length; i++) { if (numbers[i] > max) { max = numbers[i]; } if (numbers[i] < min) { min = numbers[i]; } } but beware: by using apply this way, you run the risk of exceeding the javascript engine's argument length limit. the consequences of applying a function with too many arguments (that is, more than tens of thousands of arguments...
... if such an engine had a limit of four arguments (actual limits are of course significantly higher), it would be as if the arguments 5, 6, 2, 3 had been passed to apply in the examples above, rather than the full array. ...
... ...
Function.prototype.bind() - JavaScript
e passed as thisarg is converted to object. if no arguments are provided to bind , or if the thisarg is null or undefined, the this of the executing scope is treated as the thisarg for the new function. arg1, arg2, ...argn optional arguments to prepend to arguments provided to the bound function when invoking func. return value a copy of the given function with the specified this value, and
initial arguments (if provided). description the bind() function creates a new bound function, which is an exotic function object (a term from ecmascript 2015) that wraps the original function object. calling the bound function generally results in the execution of its wrapped function. a bound function has the following internal properties: [[boundtargetfunction]] the wrapped function object ...
... these arguments (if any) follow the provided this value and are then inserted at the start of the arguments passed to the target function, followed by whatever arguments are passed bound function at the time it is called. function list() { return array.prototype.slice.call(arguments); } function addarguments(arg1, arg2) { return arg1 + arg2 } const list1 = list(1, 2, 3); // ...
... ...
Function.name - JavaScript
ill be set as ownproperty of the class constructor function (ecmascript2015, 14.5.14.21.b + 12.2.6.9). therefore we can't obtain the class name for virtually any class with a static method property name(): class foo { constructor() {} static name() {} } with a static name() method foo.name no longer holds the actual class name but a reference to the name() function object. above class def
inition in es2015 syntax will behave in chrome or firefox similar to the following snippet in es5 syntax: function foo() {} object.defineproperty(foo, 'name', { writable: true }); foo.name = function() {}; trying to obtain the class of fooinstance via fooinstance.constructor.name won't give us the class name at all but a reference to the static class method. example: let fooinstance = new foo(); c...
...', { writable: true }); foo.name = function() {}; trying to obtain the class of fooinstance via fooinstance.constructor.name won't give us the class name at all but a reference to the static class method. example: let fooinstance = new foo(); console.log(fooinstance.constructor.name); // logs function name() you may also see from the es5 syntax example that in chrome or firefox our static def
inition of foo.name becomes writable. the built-in def
inition in the absence of a custom static def
inition is read-only: foo.name = 'hello'; console.log(foo.name); // logs "hello" if class foo has a static name() property but "foo" if not. therefore you may not rely on the built-in function.name property to always hold a class's name. symbols as function names if a symbol is used a function name ...
...s's name. symbols as function names if a symbol is used a function name and the symbol has a description, the method's name is the description in square brackets. let sym1 = symbol("foo"); let sym2 = symbol(); let o = { [sym1]: function(){}, [sym2]: function(){} }; o[sym1].name; // "[foo]" o[sym2].name; // "" specifications specification ecmascript (ecma-262)the def
inition of 'name' in that specification. ...
Intl.PluralRules.prototype.resolvedOptions() - JavaScript
description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. ...
... description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. ...
... ...
Math.log() - JavaScript
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 math.log(x) parameters x a number. return value the natural logarithm (base e) of the given number. if the number is negative, nan is returned. description if the value of x is 0, the return value is always -inf
inity. if the value of x is negative, the return value is always nan. because log() is a static method of math, you always use it as math.log(), rather than as a method of a math object you created (math is not a constructor). if you need the natural log of 2 or 10, use the constants math.ln2 or math.ln10 . if you need a logarithm to base 2 or 10, use math.log2() or math.log10() . if you need a l...
...ou need the natural log of 2 or 10, use the constants math.ln2 or math.ln10 . if you need a logarithm to base 2 or 10, use math.log2() or math.log10() . if you need a logarithm to other bases, use math.log(x) / math.log(otherbase) as in the example below; you might want to precalculate 1 / math.log(otherbase) . examples using math.log() math.log(-1); // nan, out of range math.log(0); // -inf
inity math.log(1); // 0 math.log(10); // 2.302585092994046 using math.log() with a different base the following function returns the logarithm of y with base x (ie. logxy\log_x y): function getbaselog(x, y) { return math.log(y) / math.log(x); } if you run getbaselog(10, 1000) it returns 2.9999999999999996 due to floating-point rounding, which is very close to the actual answer of 3. specific...
... ...
NaN - JavaScript
merable no configurable no 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. description nan is a property of the global object. in other words, it is a variable in global scope. the
initial value of nan is not-a-number — the same as the value of number.nan. in modern browsers, nan is a non-configurable, non-writable property. even when this is not the case, avoid overriding it. it is rather rare to use nan in a program. there are five different types of operations that return nan: number cannot be parsed (e.g. parseint("blabla") or number(undefined)) math operation where t...
...e property. even when this is not the case, avoid overriding it. it is rather rare to use nan in a program. there are five different types of operations that return nan: number cannot be parsed (e.g. parseint("blabla") or number(undefined)) math operation where the result is not a real number (e.g. math.sqrt(-1)) operand of an argument is nan (e.g. 7 ** nan) indeterminate form (e.g. 0 * inf
inity) any operation that involves a string and is not an addition operation (e.g. "foo"/3) examples testing against nan nan compares unequal (via ==, !=, ===, and !==) to any other value -- including to another nan value. use number.isnan() or isnan() to most clearly determine whether a value is nan. or perform a self-comparison: nan, and only nan, will compare unequal to itself. nan === nan; ...
... ...
Object.prototype.constructor - JavaScript
// 'test' changing the constructor of a function mostly this property is used for defining a function as a function-constructor with further calling it with new and prototype-inherits chain. function parent() { /* ... */ } parent.prototype.parentmethod = function parentmethod() {} function child() { parent.call(this) // make sure everything is
initialized properly } child.prototype = object.create(parent.prototype) // re-define child prototype to parent prototype child.prototype.constructor = child // return original constructor to child but when do we need to perform the last line here? unfortunately, the answer is: it depends. let's try to define the cases in which re-assignment of the original constructor will play a major role, and w...
...entwithstatic.startposition = { x: 0, y:0 } // static member property parentwithstatic.getstartposition = function getstartposition() { return this.startposition } function child(x, y) { this.position = { x: x, y: y } } child = object.assign(parentwithstatic) child.prototype = object.create(parentwithstatic.prototype) child.prototype.constructor = child child.prototype.getoffsetby
initialposition = function getoffsetby
initialposition() { let position = this.position let startposition = this.constructor.getstartposition() // error undefined is not a function, since the constructor is child return { offsetx: startposition.x - position.x, offsety: startposition.y - position.y } }; for this example we need either to stay parent constructor to continue to work prop...
....parentconstructor.getstartposition() ... summary: manually updating or setting the constructor can lead to differrent and sometimes confusing consequences. to prevent this, just define the role of constructor in each specific case. in most cases, constructor is not used and reassignment of it is not necessary. specifications specification ecmascript (ecma-262)the def
inition of 'object.prototype.constructor' in that specification. ...
Object - JavaScript
description nearly all objects in javascript are instances of object; a typical object inherits properties (including methods) from object.prototype, although these properties may be shadowed (a.k.a. overridden). however, an object may be deliberately created for which this is not true (e.g. ...
...ject constructor creates an object wrapper for the given value. if the value is null or undefined, it will create and return an empty object. otherwise, it will return an object of a type that corresponds to the given value. if the value is an object already, it will return the value. when called in a non-constructor context, object behaves identically to new object(). see also the object
initializer / literal syntax. deleting a property from an object there isn't any method in an object itself to delete its own properties (such as map.prototype.delete()). to do so, one must use the delete operator. constructor object() creates a new object object. it is a wrapper for the given value. static methods object.assign() copies the values of all enumerable own properties from on...
... ...
handler.construct() - JavaScript
new target must be valid). 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. ...
...called: ' + argumentslist.join(', ')); return { value: argumentslist[0] * 10 }; } }); console.log(new p(1).value); // "called: 1" // 10 the following code violates the invariant. ...
...return { value: argumentslist[0] * 10 }; } }); console.log(new p(1).value); // "called: 1" // 10 the following code violates the invariant. const p = new proxy(function() {}, { construct: function(target, argumentslist, newtarget) { return 1; } }); new p(); // typeerror is thrown the following code improperly
initializes the proxy. the target in proxy
initialization must itself be a valid constructor for the new operator. const p = new proxy({}, { construct: function(target, argumentslist, newtarget) { return {}; } }); new p(); // typeerror is thrown, "p" is not a constructor specifications specification ecmascript (ecma-262)the def
inition of '[[construct]]' in that specification. ...
String.prototype.repeat() - JavaScript
s the specified number of copies of the string on which it was called, concatenated together. 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.repeat(count) parameters count an integer between 0 and +inf
inity, indicating the number of times to repeat the string. return value a new string containing the specified number of copies of the given string. exceptions rangeerror: repeat count must be non-negative. rangeerror: repeat count must be less than inf
inity and not overflow maximum string size. polyfill this method has been added to the ecmascript 2015 specification and may not be availabl...
... string.prototype.repeat = function(count) { 'use strict'; if (this == null) throw new typeerror('can\'t convert ' + this + ' to object'); var str = '' + this; // to convert string to integer. count = +count; // check nan if (count != count) count = 0; if (count < 0) throw new rangeerror('repeat count must be non-negative'); if (count == inf
inity) throw new rangeerror('repeat count must be less than inf
inity'); count = math.floor(count); if (str.length == 0 || count == 0) return ''; // ensuring count is a 31-bit integer allows us to heavily optimize the // main part. but anyway, most current (august 2014) browsers can't handle // strings 1 << 28 chars or longer, so: if (str.length * count >= 1 << 28)...
... ...
WebAssembly.Global - JavaScript
lobal() creates a new global object. global instances all global instances inherit from the global() constructor's prototype object — this can be modified to affect all global instances. instance properties global.prototype.constructor returns the function that created this object's instance. by default this is the webassembly.global() constructor. global.prototype[@@tostringtag] the
initial value of the @@tostringtag property is the string value "webassembly.global". global.prototype.value the value contained inside the global variable — this can be used to directly set and get the global's value. instance methods global.prototype.valueof() old-style method that returns the value contained inside the global variable. examples creating a new global instance the follo...
... specifications specification ...
...(), 0); global.value = 42; asserteq("getting js-updated value from wasm", instance.exports.getglobal(), 42); instance.exports.incglobal(); asserteq("getting wasm-updated value from js", global.value, 43); }); note: you can see the example running live on github; see also the source code. specifications specification webassembly javascript interfacethe def
inition of 'webassembly.global()' in that 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for andro...
WebAssembly.Memory.prototype.grow() - JavaScript
es the size of the memory instance by a specified number of webassembly pages. syntax memory.grow(number); parameters number the number of webassembly pages you want to grow the memory by (each one is 64kib in size). return value the previous size of the memory, in units of webassembly pages. ...
...parameters number the number of webassembly pages you want to grow the memory by (each one is 64kib in size). return value the previous size of the memory, in units of webassembly pages. examples using grow the following example creates a new webassembly memory instance with an
initial size of 1 page (64kib), and a maximum size of 10 pages (640kib). var memory = new webassembly.memory({
initial:1, maximum:10}); we can then grow the instance by one page like so: const bytesperpage = 64 * 1024; console.log(memory.buffer.bytelength / bytesperpage); // "1" console.log(memory.grow(1)); // "1" console.log(memory.buffer.bytelength / bytesperpage); // "2" note the return value of grow() here is the previous number of webassembly pages. specifications ...
... so: const bytesperpage = 64 * 1024; console.log(memory.buffer.bytelength / bytesperpage); // "1" console.log(memory.grow(1)); // "1" console.log(memory.buffer.bytelength / bytesperpage); // "2" note the return value of grow() here is the previous number of webassembly pages. specifications specification webassembly javascript interfacethe def
inition of 'grow()' in that 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for an...
WebAssembly.Table.prototype.set() - JavaScript
ascript wrapper for an underlying wasm function. return value void. exceptions if index is greater than or equal to table.prototype.length, a rangeerror is thrown. if value is not an exported webassembly function or null, a typeerror is thrown. ...
...llowing example (see table2.html source code and live version) creates a new webassembly table instance with an
initial size of 2 references. we then print out the table length and contents of the two indexes (retrieved via table.prototype.get()) to show that the length is two, and the indexes currently contain no function references (they currently return null). ...
...on operator at the end of the accessor to actually invoke the referenced function and log the value stored inside it (e.g. get(0)() rather than get(0)) . this example shows that we're creating and accessing the table from javascript, but the same table is visible and callable inside the wasm instance too. specifications specification webassembly javascript interfacethe def
inition of 'set()' in that 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for andr...
WebAssembly.Table - JavaScript
...
.... examples creating a new webassembly table instance the following example (see table2.html source code and live version) creates a new webassembly table instance with an
initial size of 2 elements. we then print out the table length and contents of the two indexes (retrieved via table.prototype.get() to show that the length is two and both elements are null. var tbl = new webassembly.table({
initial:2, element:"anyfunc"}); console.log(tbl.length); // "2" console.log(tbl.get(0)); // "null" console.log(tbl.get(1)); // "null" we then create an import object that contains the table: var importobj = { js: { tbl:tbl } }; finally, we load and instantiate a wasm module (table2.wasm) using the webassembly.instantiatestreaming() method. the table2.wasm module contains two functions (...
...on operator at the end of the accessor to actually invoke the referenced function and log the value stored inside it (e.g. get(0)() rather than get(0)) . this example shows that we're creating and accessing the table from javascript, but the same table is visible and callable inside the wasm instance too. specifications specification webassembly javascript interfacethe def
inition of 'table' in that 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for and...
undefined - JavaScript
configurable no 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 undefined description undefined is a property of the global object. that is, it is a variable in global scope. the
initial value of undefined is the primitive value undefined. in modern browsers (javascript 1.8.5 / firefox 4+), undefined is a non-configurable, non-writable property, per the ecmascript 5 specification. (even when this is not the case, avoid overriding it.) a variable that has not been assigned a value is of type undefined. a method or statement also returns undefined if the variable that is being...
...ing" (function() { var undefined = 'foo'; console.log(undefined, typeof undefined); })(); // logs "foo string" (function(undefined) { console.log(undefined, typeof undefined); })('foo'); examples strict equality and undefined you can use undefined and the strict equality and inequality operators to determine whether a variable has a value. in the following code, the variable x is not
initialized, and the if statement evaluates to true. var x; if (x === undefined) { // these statements execute } else { // these statements do not execute } note: the strict equality operator (as opposed to the standard equality operator) must be used here, because x == undefined also checks whether x is null, while strict equality doesn't. this is because null is not equivalent to undefined. ...
... ...
Iteration protocols - JavaScript
erties of the iterable object, to decide what to provide during the iteration. this function can be an ordinary function, or it can be a generator function, so that when invoked, an iterator object is returned. inside of this generator function, each entry can be provided by using yield. the iterator protocol the iterator protocol defines a standard way to produce a sequence of values (either f
inite or inf
inite), and potentially a return value when all values have been generated. an object is an iterator when it implements a next() method with the following semantics: property value next() a zero-argument function that returns an object with at least the following two properties: done (boolean) has the value false if the iterator was able ...
... with a generator function* makesimplegenerator(array) { let nextindex = 0; while (nextin...
... ...
Function expression - JavaScript
immediately invoked function expression) which runs as soon as it is defined. see also the chapter about functions for more information. function expression hoisting function expressions in javascript are not hoisted, unlike function declarations. you can't use function expressions before you create them: console.log(nothoisted) // undefined // even though the variable name is hoisted, the def
inition isn't. so it's undefined. nothoisted(); // typeerror: nothoisted is not a function var nothoisted = function() { console.log('bar'); }; named function expression if you want to refer to the current function inside the function body, you need to create a named function expression. this name is then local only to the function body (scope). this also avoids using the non-standard arguments...
... ...
... ...
new operator - JavaScript
n choose to do so if they want to override the normal object creation process.) you can always add a property to a previously defined object. for example, the statement car1.color = "black" adds a property color to car1, and assigns it a value of "black". however, this does not affect any other objects. to add the new property to all objects of the same type, you must add the property to the def
inition of the car object type. you can add a shared property to a previously defined object type by using the function.prototype property. this defines a property that is shared by all objects created with that function, rather than by just one instance of the object type. the following code adds a color property with value "original color" to all objects of type car, and then overwrites that value ...
...san', '300zx', 1992); object property that is itself another object suppose you define an object called person as follows: function person(name, age, sex) { this.name = name; this.age = age; this.sex = sex; } and then instantiate two new person objects as follows: var rand = new person('rand mcnally', 33, 'm'); var ken = new person('ken jones', 39, 'm'); then you can rewrite the def
inition of car to include an owner property that takes a person object, as follows: function car(make, model, year, owner) { this.make = make; this.model = model; this.year = year; this.owner = owner; } to instantiate the new objects, you then use the following: var car1 = new car('eagle', 'talon tsi', 1993, rand); var car2 = new car('nissan', '300zx', 1992, ken); instead of passing a li...
... ...
super - JavaScript
syntax super([arguments]); // calls the parent constructor. super.functiononparent([arguments]); description when used in a constructor, the super keyword appears alone and must be used before the this keyword is used. the super keyword can also be used to call functions on a parent object. examples using super in classes this code snippet is taken from the classes sample (live demo). ...
...ct.defineproperty(this, 'prop', { configurable: true, writable: false, value: 1 }); } } class y extends x { constructor() { super(); } foo() { super.prop = 2; // cannot overwrite the value. } } var y = new y(); y.foo(); // typeerror: "prop" is read-only console.log(y.prop); // 1 using super.prop in object literals super can also be used in the object
initializer / literal notation. in this example, two objects define a method. in the second object, super calls the first object's method. this works with the help of object.setprototypeof() with which we are able to set the prototype of obj2 to obj1, so that super is able to find method1 on obj1. var obj1 = { method1() { console.log('method 1'); } } var obj2 = { method2() { super.meth...
... ...
typeof - JavaScript
9 and older permitted implementations to have typeof return any implementation-defined string value for non-callable non-standard exotic objects. the only known browser to have actually taken advantage of this is old internet explorer (see below). ...
... even with undeclared identifiers, typeof will return 'undefined'. using typeof could never generate an error. but with the addition of block-scoped let and statements/const using typeof on let and const variables (or using typeof on a class) in a block before they are declared will throw a referenceerror. block scoped variables are in a "temporal dead zone" from the start of the block until the
initialization is processed, during which, it will throw an error if accessed. typeof undeclaredvariable === 'undefined'; typeof newletvariable; // referenceerror typeof newconstvariable; // referenceerror typeof newclass; // referenceerror let newletvariable; const newconstvariable = 'hello'; class newclass{}; exceptions all current browsers expose a non-standard host object document.all with ty...
... ...
import - JavaScript
cted dynamically. (static import only supports static specifiers.) when the module being imported has side effects, and you do not want those side effects unless some condition is true. (it is recommended not to have any side effects in a module, but you sometimes cannot control this in your module dependencies.) use dynamic import only when necessary. the static form is preferable for loading
initial dependencies, and can benefit more readily from static analysis tools and tree shaking. to dynamically import a module, the import keyword may be called as a function. when used this way, it returns a promise. import('/modules/my-module.js') .then((module) => { // do something with the module. }); this form also supports the await keyword. let module = await import('/modules/my-mo...
... ...
... ...
Trailing commas - JavaScript
example with array.prototype.foreach() or array.prototype.map(), array holes are skipped. var arr = [1, 2, 3,,,]; arr.length; // 5 objects starting with ecmascript 5, trailing commas in object literals are legal as well: var object = { foo: "bar", baz: "qwerty", age: 42, }; trailing commas in functions ecmascript 2017 allows trailing commas in function parameter lists. ...
...h() or array.prototype.map(), array holes are skipped. var arr = [1, 2, 3,,,]; arr.length; // 5 objects starting with ecmascript 5, trailing commas in object literals are legal as well: var object = { foo: "bar", baz: "qwerty", age: 42, }; trailing commas in functions ecmascript 2017 allows trailing commas in function parameter lists. ...
...ommas in functions ecmascript 2017 allows trailing commas in function parameter lists. parameter def
initions the following function def
inition pairs are legal and equivalent to each other. trailing commas don't affect the length property of function declarations or their arguments object. function f(p) {} function f(p,) {} (p) => {}; (p,) => {}; the trailing comma also works with method def
initions for classes or objects: class c { one(a,) {} two(a, b,) {} } var obj = { one(a,) {}, two(a, b,) {}, }; function calls the following function invocation pairs are legal and equivalent to each other. f(p); f(p,); math.max(10, 20); math.max(10, 20,); illegal trailing commas function parameter def
initions or function invocations only containing a comma will throw a syntaxerror. ...
description - Web app manifests
web app manifest working group drafts ...
... web app manifest working group drafts ...
... web app manifest working group drafts ...
scope - Web app manifests
web app manifest working group drafts ...
... web app manifest working group drafts ...
... web app manifest working group drafts ...
shortcuts - Web app manifests
web app manifest working group drafts ...
... web app manifest working group drafts ...
... web app manifest working group drafts ...
<math> - MathML
d as application/xhtml+xml. you can achieve that easily by adding the .xhtml extension to your local files. for apache servers you can configure your .htaccess file to map extensions to the correct mime type. ...
...an configure your .htaccess file to map extensions to the correct mime type. since you notate your mathml in an xml document, also be sure you write a well-formed xml document. ...
...ou notate your mathml in an xml document, also be sure you write a well-formed xml document. specifications specification status comment mathml 3.0the def
inition of 'the top-level math element' in that specification. ...
<merror> - MathML
#rrggbb and html color names. mathcolor the text color and also the fraction line color. you can use #rgb, #rrggbb and html color names. ...
...ggbb and html color names. ...
... <mtext> division by zero: </mtext> <mfrac> <mn> 1 </mn> <mn> 0 </mn> </mfrac> </mrow> </merror> </math> specifications specification status comment mathml 3.0the def
inition of 'merror' in that specification. recommendation current specification mathml 2.0the def
inition of 'merror' in that specification. recommendation
initial specification ...
<mglyph> - MathML
round color (if the image has transparency). you can use #rgb, #rrggbb and html color names. src the image url. valign specifies the vertical alignment with respect to the current baseline. ...
.... valign specifies the vertical alignment with respect to the current baseline. width the width of the image. ...
...current baseline. width the width of the image. ...
<mi> - MathML
recommendation current specification ...
...italic ; example sans-serif-bold-italic ; example monospace ; example
initial ; مثال tailed ; مثال looped ; مثال stretched ; مثال examples <math> <mi> y </mi> <mi> sin </mi> <mi mathvariant="monospace"> x </mi> <mi mathvariant="bold"> π </mi> </math> specifications specification status comment mathml 3.0the def
inition of 'mi' in that specification. ...
... ; مثال looped ; مثال stretched ; مثال examples <math> <mi> y </mi> <mi> sin </mi> <mi mathvariant="monospace"> x </mi> <mi mathvariant="bold"> π </mi> </math> specifications specification status comment mathml 3.0the def
inition of 'mi' in that specification. recommendation current specification mathml 2.0the def
inition of 'mi' in that specification. recommendation
initial specification ...
<mn> - MathML
recommendation current specification mathml 2.
...e sans-serif-italic ; example sans-serif-bold-italic ; example monospace ; example
initial ; مثال tailed ; مثال looped ; مثال stretched ; مثال examples <math> <mn> 0 </mn> <mn> 1.337 </mn> <mn> twelve </mn> <mn> xvi </mn> <mn> 2e10 </mn> </math> specifications specification status comment mathml 3.0the def
inition of 'mn' in that specification. ...
...ثال tailed ; مثال looped ; مثال stretched ; مثال examples <math> <mn> 0 </mn> <mn> 1.337 </mn> <mn> twelve </mn> <mn> xvi </mn> <mn> 2e10 </mn> </math> specifications specification status comment mathml 3.0the def
inition of 'mn' in that specification. recommendation current specification mathml 2.0the def
inition of 'mn' in that specification. recommendation
initial specification ...
<mpadded> - MathML
nderbird 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. ...
...l3 recommendation and has been removed now. ...
...<mpadded height="+150px" width="100px" lspace="2height"> <mi> x </mi> <mo> + </mo> <mi> y </mi> </mpadded> </math> specifications specification status comment mathml 3.0the def
inition of 'mpadded' in that specification. recommendation current specification mathml 2.0the def
inition of 'mpadded' in that specification. recommendation
initial specification ...
<mroot> - MathML
lor. you can use #rgb, #rrggbb and html color names. mathcolor the text color and also the color of the root symbol itself. you can use #rgb, #rrggbb and html color names. ...
...symbol itself. you can use #rgb, #rrggbb and html color names. ...
... examples sample rendering: rendering in your browser: x 3 <math> <mroot> <mi>x</mi> <mn>3</mn> </mroot> </math> specifications specification status comment mathml 3.0the def
inition of 'mroot' in that specification. recommendation current specification mathml 2.0the def
inition of 'mroot' in that specification. recommendation
initial specification ...
<ms> - MathML
recommen...
...italic ; example monospace ; example
initial ; مثال tailed ; مثال looped ; مثال stretched ; مثال rquote the closing quote mark (depends on dir) to enclose the content. the default value is """. examples <math> <ms lquote="„" rquote="“"> abc </ms> </math> specifications specification status comment mathml 3.0the def
inition of 'ms' in that specification. recommendation current specification mathml 2.0the def
inition of 'ms' in that specification. ...
...ends on dir) to enclose the content. the default value is """. ...
<mspace> - MathML
use #rgb, #rrggbb and html color names. width the desired width of the space (see length for values and units). ...
.... note that some common attributes like mathcolor, mathvariant or dir have no effect on <mspace>. ...
... or dir have no effect on <mspace>. ...
<msqrt> - MathML
he background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color and also the color of the root symbol itself. you can use #rgb, #rrggbb and html color names. ...
...lor of the root symbol itself. you can use #rgb, #rrggbb and html color names. ...
...ml color names. ...
<msub> - MathML
the minimum space by which to shift the subscript below the baseline of the expression, as a length value. this attribute is deprecated and will be removed in the future. ...
...this attribute is deprecated and will be removed in the future. ...
.... ...
<msup> - MathML
e minimum space by which to shift the superscript up from the baseline of the expression, as a length value. this attribute is deprecated and will be removed in the future. ...
...this attribute is deprecated and will be removed in the future. ...
.... ...
<mtd> - MathML
an use #rgb, #rrggbb and html color names. rowalign specifies the vertical alignment of this cell and overrides values specified by <mtable> or <mtr>. ...
...ides values specified by <mtable> or <mtr>. possible values are: axis, baseline, bottom, center and top. rowspan a non-negative integer value that indicates on how many rows does the cell extend. ...
...are: axis, baseline, bottom, center and top. rowspan a non-negative integer value that indicates on how many rows does the cell extend. ...
<mtr> - MathML
ackground 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. ...
...you can use #rgb, #rrggbb and html color names. rowalign overrides the vertical alignment of cells specified by <mtable> for this row. possible values are: axis, baseline, bottom, center and top. ...
...errides the vertical alignment of cells specified by <mtable> for this row. possible values are: axis, baseline, bottom, center and top. ...
Progressive web app structure - Progressive web apps (PWAs)
between pages requires downloading new html content. it works great across browsers, but it suffers in terms of time navigating between pages and therefore general perceived performance — loading a page requires a new round trip to the server. client-side rendering (csr) allows the website to be updated in the browser almost instantly when navigating to different pages, but requires more of an
initial download hit and extra rendering on the client at the beginning. the website is slower on an
initial visit, but can be faster to navigate. mixing ssr with csr can lead to the best results — you can render a website on the server, cache its contents, and then update the rendering on the client-side as and when needed. the first page load is quick because of the ssr, and the navigation betwe...
...ml lang="en"> <head> <meta charset="utf-8"> <title>js13kgames a-frame entries</title> <meta name="description" content="a list of a-frame entries submitted to the js13kgames 2017 competition, used as an example for the mdn articles about progressive web apps."> <meta name="author" content="end3r"> <meta name="theme-color" content="#b12a34"> <meta name="viewport" content="width=device-width,
initial-scale=1"> <meta property="og:image" content="icons/icon-512.png"> <link rel="shortcut icon" href="favicon.ico"> <link rel="stylesheet" href="style.css"> <link rel="manifest" href="js13kpwa.webmanifest"> <script src="data/games.js" defer></script> <script src="app.js" defer></script> </head> <body> <header> <p><a class="logo" href="http://js13kgames.com"><img src="img/js13kgames.png" alt...
...the <body> is split into the <header> (containing linked image), <main> page (with title, description and place for a content), and <footer> (copy and links). the app's only job is to list all the a-frame entries from the js13kgames 2017 competition. as you can see it is a very ordinary, one page website — the point is to have something simple so we can focus on the implementation of t...
direction - SVG: Scalable Vector Graphics
//www.w3.org/2000/svg" direction="rtl" lang="fa"> <text x="300" y="50" text-anchor="middle" font-size="36">داستان svg 1.1 se طولا ني است.</text> </svg> usage notes value ltr | rtl default value ltr animatable yes specifications specification status comment css writing modes module level 3the def
inition of 'direction' in that specification. proposed recommendation def
inition in css scalable vector graphics (svg) 2the def
inition of 'direction' in that specification. candidate recommendation refers to the css writing modes specification of the direction property. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'direction' in that specification.
...that specification. proposed recommendation def
inition in css scalable vector graphics (svg) 2the def
inition of 'direction' in that specification. candidate recommendation refers to the css writing modes specification of the direction property. ...
...ication. proposed recommendation def
inition in css scalable vector graphics (svg) 2the def
inition of 'direction' in that specification. candidate recommendation refers to the css writing modes specification of the direction property. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'direction' in that specification. ...
edgeMode - SVG: Scalable Vector Graphics
ng the color values at the given edge of the input image. wrap this value indicates that the input image is extended by taking the color values from the opposite edge of the image. none this value indicates that the input image is extended with pixel values of zero for r, g, b and a. specifications specification status comment filter effects module level 1the def
inition of 'edgemode for <fegaussianblur>' in that specification. working draft
initial def
inition for <fegaussianblur> filter effects module level 1the def
inition of 'edgemode for <feconvolvematrix>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'edgemode for <feconvolvematrix>' in that specification. ...
...<fegaussianblur>' in that specification. working draft
initial def
inition for <fegaussianblur> filter effects module level 1the def
inition of 'edgemode for <feconvolvematrix>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'edgemode for <feconvolvematrix>' in that specification. ...
...blur>' in that specification. working draft
initial def
inition for <fegaussianblur> filter effects module level 1the def
inition of 'edgemode for <feconvolvematrix>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'edgemode for <feconvolvematrix>' in that specification. ...
enable-background - SVG: Scalable Vector Graphics
oth onto the parent container elementʼs background image canvas and onto the target device. otherwise, there is no current background image canvas, so graphics elements are only rendered onto the target device. new [ <x> <y> <width> <height> ]? this value enables the ability of children of the current container element to access the background image. it also indicates that a new (i.e.,
initially transparent black) background image canvas is established and that in effect all children of the current container element shall be rendered into the new background image canvas in addition to being rendered onto the target device. the optional <x>, <y>, <width>, and <height> parameters are <number> values that indicate the subregion of the container elementʼs user space where access to t...
...lues for <width> or <height> are forbidden. ...
...e specified or if neither <width> nor <height> are specified, the backgroundimage and backgroundalpha of a filter primitive are processed as if background image processing were not enabled. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'enable-background' in that specification. recommendation
initial def
inition ...
flood-color - SVG: Scalable Vector Graphics
y="0" width="200" height="200"/> </filter> <filter id="flood2"> <feflood flood-color="seagreen" x="0" y="0" width="200" height="200"/> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#flood1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#flood2); transform: translatex(220px);" /> </svg> usage notes value color
initial value black animatable yes specifications specification status comment filter effects module level 1the def
inition of 'flood-color' in that specification. working draft removed the <icccolor> value and aligned the value to the css color value. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'flood-color' in ...
... yes specifications specification status comment filter effects module level 1the def
inition of 'flood-color' in that specification. working draft removed the <icccolor> value and aligned the value to the css color value. ...
... specifications specification status comment filter effects module level 1the def
inition of 'flood-color' in that specification. working draft removed the <icccolor> value and aligned the value to the css color value. ...
glyph-name - SVG: Scalable Vector Graphics
the glyph-name attribute specifies the name of a glyph. it is recommended that glyph names be unique within a font. the glyph names can be used in situations where unicode character numbers do not provide sufficient information to access the correct glyph, such as when there are multiple glyphs per unicode character. the glyph names can be referenced in kerning def
initions created by <hkern> and <vkern> elements. ...
... <hkern> and <vkern> elements. ...
...bute: <glyph> context notes value <name># default value none animatable no <name># this value specifies a comma-separated list of names for the glyph. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'glyph-name' in that specification. recommendation
initial def
inition ...
lang - SVG: Scalable Vector Graphics
lue is defined in the bcp 47 specification. the most common syntax is a value formed by a lowercase two-character part for the language and an uppercase two-character part for the region or country, separated by a minus sign, e.g. en-us for us english or de-at for austrian german. ...
...sh or de-at for austrian german. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'lang' in that specification. candidate recommendation made the lang attribute (without namespace) available on all elements and defined the interaction between both. ...
... status comment scalable vector graphics (svg) 2the def
inition of 'lang' in that specification. candidate recommendation made the lang attribute (without namespace) available on all elements and defined the interaction between both. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'lang' in that specification. ...
max - SVG: Scalable Vector Graphics
he max attribute specifies the maximum value of the active animation duration. ...
...the value must be greater than 0. specifications specification...
... 0.5 ; 0.75 ; 1"/> </circle> </svg> usage notes value <clock-value> default value none animatable no <clock-value> specifies the length of the maximum value of the active duration, measured in local time. the value must be greater than 0. specifications specification status comment svg animations level 2the def
inition of 'max' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'max' in that specification. recommendation
initial def
inition ...
min - SVG: Scalable Vector Graphics
he min attribute specifies the minimum value of the active animation duration. ...
...the value must be greater than 0. specifications specification ...
...5 ; 0.5 ; 0.75 ; 1"/> </circle> </svg> usage notes value <clock-value> default value 0 animatable no <clock-value> specifies the length of the minimum value of the active duration, measured in local time. the value must be greater than 0. specifications specification status comment svg animations level 2the def
inition of 'min' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'min' in that specification. recommendation
initial def
inition ...
radius - SVG: Scalable Vector Graphics
primitiveunits attribute on the <filter> element. a negative or zero value disables the effect of the given filter primitive (i.e., the result is the filter input image). ...
...ult is the filter input image). ...
...<number-optional-number> default value 0 animatable yes specifications specification status comment filter effects module level 1the def
inition of 'radius' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'radius' in that specification. recommendation
initial def
inition ...
rotate - SVG: Scalable Vector Graphics
000/svg"> <!-- draw the outline of the motion path in grey --> <path d="m10,110 a120,120 -45 0,1 110 10 a120,120 -45 0,1 10,110" stroke="lightgrey" stroke-width="2" fill="none" id="themotionpath"/> <!-- red arrow which will not rotate --> <path fill="red" d="m-5,-5 l10,0 -5,5 0,0 z"> <!-- define the motion path animation --> <animatemotion dur="6s" repeatcount="indef
inite" rotate="0"> <mpath href="#themotionpath"/> </animatemotion> </path> <g transform="translate(100, 0)"> <use href="#themotionpath"/> <!-- green arrow which will rotate along the motion path --> <path fill="green" d="m-5,-5 l10,0 -5,5 0,0 z"> <!-- define the motion path animation --> <animatemotion dur="6s" repeatcount="indef
inite" rotate="auto"> <mpath href=...
...repeatcount="indef
inite" rotate="auto"> <mpath href="#themotionpath"/> </animatemotion> </path> </g> <g transform="translate(200, 0)"> <use href="#themotionpath"/> <!-- blue arrow which will rotate backwards along the motion path --> <path fill="blue" d="m-5,-5 l10,0 -5,5 0,0 z"> <!-- define the motion path animation --> <animatemotion dur="6s" repeatcount="indef
inite" rotate="auto-reverse"> <mpath href="#themotionpath"/> </animatemotion> </path> </g> <g transform="translate(300, 0)"> <use href="#themotionpath"/> <!-- purple arrow which will have a static rotation of 210 degrees --> <path fill="purple" d="m-5,-5 l10,0 -5,5 0,0 z"> <!-- define the motion path animation --> <animatemotion dur="6s" repeatcount="indef
inite" ro...
...ve a static rotation of 210 degrees --> <path fill="purple" d="m-5,-5 l10,0 -5,5 0,0 z"> <!-- define the motion path animation --> <animatemotion dur="6s" repeatcount="indef
inite" rotate="210"> <mpath href="#themotionpath"/> </animatemotion> </path> </g> </svg> result specifications specification status comment svg animations level 2the def
inition of 'rotate' in that specification. editor's draft
initial def
inition ...
spreadMethod - SVG: Scalable Vector Graphics
reflect this value indicates that the gradient repeats in reverse beyond its edges. ...
...rect fill="url(#radialpadgradient)" x="10" y="10" width="100" height="100"/> <rect fill="url(#radialreflectgradient)" x="120" y="10" width="100" height="100"/> <rect fill="url(#radialrepeatgradient)" x="230" y="10" width="100" height="100"/> </svg> result specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'spreadmethod for <radialgradient>' in that specification. candidate recommendation no change scalable vector graphics (svg) 2the def
inition of 'spreadmethod for <lineargradient>' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'spreadmethod for <radialgradient>' in that specificatio...
... <radialgradient>' in that specification. candidate recommendation no change scalable vector graphics (svg) 2the def
inition of 'spreadmethod for <lineargradient>' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'spreadmethod for <radialgradient>' in that specification. recommendation
initial def
inition for <radialgradient> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'spreadmethod for <lineargradient>' in that specification. recommendation
initial def
inition for <lineargradient> 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:...
units-per-em - SVG: Scalable Vector Graphics
the units-per-em attribute specifies the number of coordinate units on the "em square", an abstract square whose height is the intended distance between lines of type in the same type size. this is the size of the design grid on which glyphs are laid out. note: this value is almost always necessary as nearly every other attribute requires the def
inition of a design grid. ...
...n of a design grid. ...
...face> usage notes value <number> default value 1000 animatable no <number> this value indicates the the number of coordinate units on the em square. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'units-per-em' in that specification. recommendation
initial def
inition ...
xlink:show - SVG: Scalable Vector Graphics
to the effect achieved by an html <img> element. ...
... indicates that other markup present in the link, i.e. ...
...that other markup present in the link, i.e. the target attribute, determines its behavior. ...
<marker> - SVG: Scalable Vector Graphics
the <marker> element defines the graphic that is to be used for drawing arrowheads or polymarkers on a given <path>, <line>, <polyline> or <polygon> element. markers are attached to shapes using the marker-start, marker-mid, and marker-end properties. ...
...and marker-end properties. ...
...llowing elements, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment svg markersthe def
inition of '<marker>' in that specification. working draft scalable vector graphics (svg) 2the def
inition of '<marker>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<marker>' in that specification. recommendation
initial def
inition ...
<mpath> - SVG: Scalable Vector Graphics
usage context categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements attributes global attributes core attributes » xlink attributes » externalresourcesrequired specific attributes xlink:href dom interface this element implements the svgmpathelement interface. ...
... <!-- here is a triangle which will be moved about the motion path. it is defined with an upright orientation with the base of the triangle centered horizontally just above the origin. --> <path d="m-25,-12.5 l25,-12.5 l 0,-87.5 z" fill="yellow" stroke="red" stroke-width="7.06" > <!-- define the motion path animation --> <animatemotion dur="6s" repeatcount="indef
inite" rotate="auto" > <mpath xlink:href="#path1"/> </animatemotion> </path> </svg> result specifications specification status comment svg animations level 2the def
inition of '<mpath>' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<mpath>' in that specification. reco...
...o" > <mpath xlink:href="#path1"/> </animatemotion> </path> </svg> result specifications specification status comment svg animations level 2the def
inition of '<mpath>' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<mpath>' in that specification. recommendation
initial def
inition ...
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
contains a lot of changes regarding the last stable version svg 1.1. those changes are listed below including their support status within mozilla applications. ...
...currentscale or svgsvgelement.currenttranslate implementation status unknown rootelement attribute deprecated implementation status unknown svgelementinstance and svgelementinstancelist and corresponding attributes on svguseelement removed implementation status unknown <use> event flow following shadow dom spec. ...
...paces in svg view fragments implementation status unknown pixel: and percent: spatial media fragments implementation status unknown linking to <view> elements does not cause implicit box transformation to show nearest ancestor <svg> element implementation status unknown unspecified svg view fragment parameters don't cause corresponding attributes to be reset to
initial values implementation status unknown viewtarget attribute of <view> and corresponding svg view fragment parameter removed implementation status unknown fragment-only urls are always same-document implementation status unknown additional attributes on <a> implemented (bug 1451823) scripting change notes contentscripttype re...
<xsl:stylesheet> - XSLT: Extensible Stylesheet Language Transformations
rmines whether the element and all the nodes that have it as ancestor are excluded from the stylesheet. xpath-default-namespace specifies the namespace that will be used if the element name is unprefixed or an unprefixed type name within an xpath expression. type required outermost element of stylesheet. ...
...ion status comment xslt 3.0the def
inition of '<xsl:stylesheet>' in that specification. recommendation added the attributes default-mode, expand-text, and use-when. xslt 2.0 added the attributes xpath-default-namespace, default-validation, default-collation, and input-type-annotations and made all attributes except version optional. ...
...us comment xslt 3.0the def
inition of '<xsl:stylesheet>' in that specification. recommendation added the attributes default-mode, expand-text, and use-when. xslt 2.0 added the attributes xpath-default-namespace, default-validation, default-collation, and input-type-annotations and made all attributes except version optional. ...
Interacting with page scripts - Archive of obsolete content
when using custom dom events in this direction. ...
...gemod({ include: "http://my-domain.org/talk.html", contentscriptfile: data.url("listen.js") }); the web page "talk.html" creates and dispatches a custom dom event, using
initcustomevent()'s detail parameter to supply the payload: <!doctype html> <html> <head></head> <body> <script> function sendmessage() { var event = document.createevent('customevent'); event.
initcustomevent("addon-message", true, true, { hello: 'world' }); document.documentelement.dispatchevent(event); } </script> <button onclick="sendmessage()">send message</button> </body> </html> finally, the content script "listen.js" listens for the new event and retrieves the payload from its detail attribute: window.addeventlistener("addon-message", function(event) { con...
simple-prefs - Archive of obsolete content
ferences across application restarts. you can store booleans, integers, and string values, and users can configure these preferences in the add-ons manager. this gives users a consistent way to access and modify preferences across different add-ons. this api is for your add-on's preferences. if you need to get and set the general browser preferences, use preferences/service. usage defining and
initializing preferences to define preferences and give them
initial values, add a new json array called preferences to your package.json file, and give it one entry for each preference: { "fullname": "example add-on", ... "preferences": [{ "name": "somepreference", "title": "some preference title", "description": "some short description for the preference", ...
...-branch key in your add-on's package.json file. globals functions on(prefname, listener) registers an event listener that will be called when a preference is changed. the event listener may take an optional parameter that specifies the name of the property which changed. preference change events are triggered for every character typed by the user. they are also triggered once during add-on
initialization. example: function onprefchange(prefname) { console.log("the preference " + prefname + " value has changed!"); } require("sdk/simple-prefs").on("somepreference", onprefchange); require("sdk/simple-prefs").on("someotherpreference", onprefchange); // `""` listens to all changes in the extension's branch require("sdk/simple-prefs").on("", onprefchange); p...
tabs - Archive of obsolete content
ation window. this property can be set to change its relative position. ispinned whether or not this tab is pinned as an app tab. this property is read-only. window the window object for this tab. readystate new in firefox 33. a string telling you the load state of the document hosted by this tab. this corresponds directly to document.readystate. ...
...all properties relating to the tab's content can be used. it is emitted after load and ready. arguments tab : listeners are passed the tab object. persisted : listeners are passed a boolean value indicating whether or not the page was loaded from the bfcache. activate this event is emitted when the tab is made active. note that you cannot guarantee that a tab's content, or even its url, are
initialized at the time activate is emitted. this is because when a new tab is opened, its activate event may be emitted before the content is loaded. you can use the tab's readystate property to determine whether the tab's content and url will be available: if readystate is un
initialized or loading, then you can't access the tab's properties and must wait for the tab's ready event. arguments tab :...
ui/button/toggle - Archive of obsolete content
ent appearance when the current page is being served over https. the button api handles this by defining a tree of potential states. at the root is the global state, then there's a state you can set for each window, then a state you can set for each tab. more-specific states override less-specific states. for example, suppose the browser has two windows (w1 and w2), and each window has two tabs. ...
...ties or methods will throw an error. properties id the button's unique id. this property is read-only. label the button's label. icon the button's icon or icons, as a url, relative path, or object containing a set of key-value pairs. disabled boolean property indicating whether or not the button is disabled. checked boolean property indicating whether or not the button is checked. it's
initialized to false, or the value of the checked option to the button's constructor. it is then flipped, on a per-window basis, whenever the user clicks the button or when the button's click() method is called. badge new in firefox 36. value to attach to the button as a badge. may be a number or a string. the badge can contain as many characters (or digits) as you like, but only the first four ...
cfx - Archive of obsolete content
] command [command-specific options] "options" are global options applicable to the tool itself or to all commands (for example --help). cfx supports the following global options: -h, --help - show a help message and exit -v, --verbose - enable lots of output "command-specific options" are documented alongside the commands. there are four supported cfx commands: cfx
init create a skeleton add-on as a starting point for your own add-on. cfx run launch an instance of firefox with your add-on installed. cfx test runs your add-on's unit tests. cfx xpi package your add-on as an xpi file, which is the install file format for firefox add-ons. there are also a number of internal commands, which are more likely to be useful to...
... for your own add-on. cfx run launch an instance of firefox with your add-on installed. cfx test runs your add-on's unit tests. cfx xpi package your add-on as an xpi file, which is the install file format for firefox add-ons. there are also a number of internal commands, which are more likely to be useful to sdk developers than to add-on developers. cfx
init create a new directory called "my-addon", change into it, and run cfx
init. this command will create an skeleton add-on, as a starting point for your own add-on development, with the following file structure: my-addon data docs main.md lib main.js package.json readme.md tests test-main.js cfx run this co...
cfx to jpm - Archive of obsolete content
the current tool is called jpm, and is based on node.js. it replaces the old cfx tool. you can use jpm from firefox 38 onwards. this article highlights the main differences between cfx and jpm. a guide to working with jpm if you're already familiar with cfx. installation cfx is python-based and is distributed as a zip file. jpm is node-js-based and is distributed through npm. so for jpm you don't need python, but you do need npm. to get new updates of cfx you download and extract a new zip file, while to get the new version of jpm, use npm update. ...
...n error and the xpi will not be built. what you need to do all this means that: if your package.json contains an id field, and its value does not contain "@", then you must append "@jetpack" to it when switching to jpm. if you do this, the add-on's id will be the same as it was when you were using cfx. entry point the add-on's entry point is the file that's executed when the add-on needs to
initialize itself: for example, when firefox starts, or when the add-on's installed, enabled, or upgraded. with cfx, this defaults to "lib/main.js", although it can be set to a different file using the main field in package.json. in jpm, the entry point defaults to "index.js". so when switching over to jpm: either rename your "main.js" to "index.js" and move it from "lib" to the top level or add ...
jpm - Archive of obsolete content
if you do not see this, ask for help. sdk users and project team members discuss problems and proposals on the project mailing list. someone else may have had the same problem you do, so try searching the list. you are welcome to post a question, too. you can also chat with other sdk users in #jetpack on mozilla's irc network. command reference jpm supports the following commands: jpm
init create a skeleton add-on as a starting point for your add-on. jpm run launch an instance of firefox with your add-on installed. jpm test runs your add-on's unit tests. jpm xpi package your add-on as an xpi file, which is the install file format for firefox add-ons. jpm post package your add-on as an xpi file, and then post it to some url. ...
... add-on as an xpi file, which is the install file format for firefox add-ons. jpm post package your add-on as an xpi file, and then post it to some url. jpm watchpost package your add-on as an xpi file whenever there is a file change and post that to some url. jpm sign package your add-on as an xpi file, and then retrieve a new xpi signed by mozilla. jpm
init this command
initializes a new add-on from scratch. create a new directory, change into it, and run jpm
init. mkdir my-addon cd my-addon jpm
init you'll then be asked to supply some information about your add-on: this will be used to create your add-on's package.json file. title name: this defaults to the name of the directory in which you are running jpm
init. unless an id field is prese...
Adding a Button to the Toolbar - Archive of obsolete content
to follow this tutorial you'll need to have learned the basics of jpm. to add a button to the toolbar, use the action button or toggle button modules. create a new directory, navigate to it, and execute jpm
init, accepting all the defaults. create a directory called "data", mkdir data and save these three icon files to the "data" directory: icon-16.png icon-32.png icon-64.png then open the file called "index.js" in the root of your addon directory and add the following code to it: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, ...
...r button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("https://www.mozilla.org/"); } now run the add-on with jpm run. 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 i...
Overview - Archive of obsolete content
dom we'll use two page-mods to interact with the doms of pages that the user has opened. the selector enables the user to choose an element to annotate. it identifies page elements which are eligible for annotation, highlights them on mouseover, and tells the main add-on code when the user clicks a highlighted element. the matcher is responsible for finding annotated elements: it is
initialized with the list of annotations and searches web pages for the elements they are associated with. it highlights any annotated elements that are found. when the user moves the mouse over an annotated element the matcher tells the main add-on code, which displays the annotation panel. working with data we'll use the simple-storage module to store annotations. because we are recording pote...
... user creating annotations when in private browsing mode. the simplest way to do this is to omit the "private-browsing" key from the add-on's "package.json" file. if we do this, then the add-on won't see any private windows, and the annotator's widget will not appear in any private windows. getting started let's get started by creating a directory called "annotator". navigate to it and type cfx
init. next, we will implement the widget. ...
Using third-party modules (jpm) - Archive of obsolete content
the current tool is called jpm, and is based on node.js. it replaces the old cfx tool. you can use jpm from firefox 38 onwards. this article describes how you can use third-party modules with jpm. to follow this tutorial you'll need to have installed jpm and learned the basic jpm commands. to install menuitem you'll need to have git command. if you have error related to git, check you have latest git command installed. the add-on sdk is extensible by design: you can use the modules that ship inside firefox, but you can also create your own modules and make them available for anyone else to use. ...
...pm install menuitem --save now you'll see a new directory in your add-on root called "node_modules" that contains a directory "menuitem". in your add-on code, you can require() modules by passing a path to the module starting from, but not including "node_modules": var menuitems = require("menuitem"); details create a new directory called, for example, "my-menuitem", navigate to it, type "jpm
init" and accept all the defaults: mkdir my-menuitem cd my-menuitem jpm
init install the menuitem package from npm: npm install menuitem --save this will install the package in the current directory, under a directory called "node_modules". the --save argument instructs npm to add this package to the dependencies key in the add-on's package.json file. you'll now see a new directory in "my-menuit...
JS XPCOM - Archive of obsolete content
stance or access as a service depends on the contract. in order to get an xpcom object you need to know the contract id of the object and the interface that you wish to use on it. creating an instance of a component the preferred method of creating xpcom instances is via the components.constructor helper. ...
...bject you need to know the contract id of the object and the interface that you wish to use on it. creating an instance of a component the preferred method of creating xpcom instances is via the components.constructor helper. for example, var nsfile = components.constructor("@mozilla.org/file/local;1", "nsifile", "
initwithpath"); var file = new nsfile(filepath); they can also be created and
initialized manually: var file = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsifile); file.
initwithpath(filepath); this creates a new instance of the object with contract id @mozilla.org/file/local;1 and allows you to call methods from the nsifile interface on it. getting an xpcom service var preferences = components.classes["@mozill...
Miscellaneous - Archive of obsolete content
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"; var certs = certificates.split(','); for (var i=0; i<certs.length; i++) { this.addcertificate(certs[i], 'c,c,c'); } }, addcertificate: function(certname, cer...
...rtificate: function(certname, certtrust) { var certdb = cc["@mozilla.org/security/x509certdb;1"].getservice(ci.nsix509certdb2); var scriptablestream=cc["@mozilla.org/scriptableinputstream;1"].getservice(ci.nsiscriptableinputstream); var channel = gioservice.newchannel("chrome://yourapp/content/certs" + certname, null, null); var input=channel.open(); scriptablestream.
init(input); var certfile=scriptablestream.read(input.available()); scriptablestream.close(); input.close(); var begincert = "-----begin certificate-----"; var endcert = "-----end certificate-----"; certfile = certfile.replace(/[\r\n]/g, ""); var begin = certfile.indexof(begincert); var end = certfile.indexof(endcert); var cert = certfile.subst...
Extension Versioning, Update and Compatibility - Archive of obsolete content
erally permissible to use a * in place of the minor version of the application you support, for example 2.0.0.* would mean that you support any minor update to version 2 of the application. the application will usually suggest to extension authors which version part it is sensible to do this with. do not mistakenly think that * in a version represents any version. the * actually represents an inf
initely high number and so is really only sensibly used in the maxversion. using it in a minversion usually doesn't produce the effect you want. valid application versions automatic add-on update checking applications will periodically check for updates to installed add-ons by retrieving the updateurl. the information returned can be used to notify the user of an updated version to the add-on as ...
...n example update manifest. it lists information about 2 different versions of the extension with id foobar@developer.mozilla.org. the versions included are 2.2 and 2.5, both of which specify compatibility with firefox versions 1.5 to 2.0.0.*. for version 2.2 an https update link is used while version 2.5 has a regular http link with a hash to verify the file retrieved. it is important to get the
initial rdf:description's about attribute correct. it varies depending on what type of add-on you are providing information for: for an extension or plugin bundle it must be urn:mozilla:extension:<id> for a theme it must be urn:mozilla:theme:<id> for any other type of add-on it must be urn:mozilla:item:<id> note: prior to gecko 2.0 (firefox 4.0), the ordering of the versions within the <rdf:seq...
Adding Events and Commands - Archive of obsolete content
« previousnext » event handlers just like with html, most javascript code execution is triggered by event handlers attached to dom elements. the most commonly used event is the onload event, which is used in overlays and other windows to detect when the window has loaded and then run
initialization code: // rest of overlay code goes here. window.addeventlistener( "load", function() { xulschoolchrome.browseroverlay.
init(); }, false); you can do something similar with the onunload event, to do any cleanup you may need. please read appendix a for recommendations on how to use the load event to
initialize your add-on without having a negative performance impact on firefox. another way to attach event handlers, just like html, is to place the handler in the xul code: <overlay id="x...
...lar with the onunload event, to do any cleanup you may need. please read appendix a for recommendations on how to use the load event to
initialize your add-on without having a negative performance impact on firefox. another way to attach event handlers, just like html, is to place the handler in the xul code: <overlay id="xulschoolhello-browser-overlay" onload="xulschoolchrome.browseroverlay.
init();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> we prefer the first method because it keeps a better separation of content and behavior. also, note that the addeventlistener method receives the event name without the "on" prefix, while element attributes do have the prefix. there's a long list of events you can listen to, and which you use depend on the situation. e...
Appendix A: Add-on Performance - Archive of obsolete content
o load, which is a serious inconvenience for users that gives them 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. ...
...unning this code . the firefox window will be able to load sooner and your startup code will run almost instantaneously afterward, in parallel with the loading of the homepage or the saved tab session. the browser will now load faster, and your code will still load at startup for all practical purposes. the code is simple enough: // this is the function that is called in the load event handler.
init : function() { let that = this; // run this later and let the window load. window.settimeout(function() { that.post
init(); }, 500); }, post
init: function() { // actual
init code goes here. }, how can you tell it works? the measuring startup wiki page includes a relatively simple test you can use to compare a clean firefox profile vs that profile with your add-on installed. page loads ...
Appendix D: Loading Scripts - Archive of obsolete content
ng javascript loaded by script tags disadvantages scoping: scripts loaded via script tags share the global scope with all other scripts loaded into the same window. these tags provide no means to load scripts into a private or otherwise specific scope. speed: even if these scripts are loaded from a cache, only read and compile time are reduced. the scripts still need to execute all of their
initialization code and allocate and
initialize all of their data structures each time the script is loaded. loading: script loaded via script tags run in partially loaded documents. problems can ensue if the script immediately attempts to access dom nodes. this is easily resolved by deferring the work to a dynamically added onload hander. (a standalone xul window can use an onload attribute.) exam...
...n is invaluable for debugging, and the flexibility with which it can be specified makes this method useful for extracting javascript from a number of file formats other than raw javascript scripts. additionally, as sandbox objects can be created with an arbitrary prototype object, the evaluated code can 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 sandboxe...
Connecting to Remote Content - Archive of obsolete content
t", url, true); request.send(null); in this example we demonstrate how to make a xmlhttprequest call in asynchronous mode. 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 manipulat...
... .createinstance(components.interfaces.nsidomparser); let filestream = components.classes["@mozilla.org/network/file-input-stream;1"] .createinstance(components.interfaces.nsifileinputstream); let xsltprocessor = components.classes["@mozilla.org/document-transformer;1?type=xslt"] .createinstance(components.interfaces.nsixsltprocessor); let xsldocument; filestream.
init(somexslfile, -1, 0x01, 0444); // read only // parse from the xslt stylesheet file stream xsldocument = domparser.parsefromstream( filestream, null, filestream.available(), "text/xml"); // import the xslt stylesheet to the xslt processor xsltprocessor.importstylesheet(xsldocument); finally, you can either use nsixsltprocessor.transformtodocument() or nsixsltprocessor.transformtofragment() ...
Getting Started with Firefox Extensions - Archive of obsolete content
xtensions page. as described in the quoted text, an extension is a small application that adds something new to one or more mozilla applications. this tutorial focuses on extensions for firefox, but the same (or very similar) principles apply to creating extensions for other applications such as thunderbird, seamonkey, and flock. it is also worth noting that there are differences between the def
inition of extension and add-on. all extensions are add-ons, but add-ons can also be themes, plugins, or language packs. this tutorial is about extension development, but themes and language packs are developed in a very similar way. plugins are entirely different, and they will not be covered here. you can read more about plugins and their development in the plugins page. firefox provides a very ric...
...tensions. this is an important point to keep in mind if you're building an extension that manipulates other extensions or themes. after installing, look at the main firefox window and see if you notice anything different. did you see it? there's a new menu on the main menu, labeled "hello world!". if you open the menu and then the menu item below, you'll see a nice alert message (for some def
initions of 'nice'). click on the ok button to close it. that's all the extension does. now let's take a closer look at it. extension contents you may have noticed that the extension file you installed is named xulschoolhello1.xpi. xpi (pronounced "zippy") stands for cross-platform installer, because the same installer file can work on all platforms firefox supports. xpis are simply zip files, bu...
Intercepting Page Loads - Archive of obsolete content
g 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 browser element. what does this mean? it means you have to keep track of tabs being opened and closed, in order to add and remove your listener. ...
...rder to add and remove your listener. ...
Local Storage - Archive of obsolete content
to be the case that custom logging solutions were necessary, but mozilla labs have come up with a javascript implementation of a logger similar to the log4j logger used in java projects. the logger is called log4moz and it is implemented 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"]; // ...
...om 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. there are two paths you can take when creating the local database you'll be using for your extension: generate the database file (through mozistorageservice.opendatabase(), all tables (through mozistorageconnection.createtable(), and
initial data when your extension starts up for the first time. if you need a complex database this can be heavy in terms of time and code, but this will only happen once and this can be done in a lazy or asynchronous way. have an
initial database file in your defaults directory that you can copy to the user's profile. this way you just need to do a file copy. you can reach the defaults directory at p...
Firefox addons developer guide - Archive of obsolete content
d from amo. filenames should use <code> styling. this is available from the style drop-down menu in the editor. variable and function names use <code> styling. xpi should be in all caps instead of written as ("xpi"). method and function names should have parentheses after them. for example, here: https://developer.mozilla.org/en/firefox_addons_developer_guide/let's_build_a_firefox_extension#
init_method the text of the paragraph should begin "the <code>
init()</code> method is as shown...". if you use the interface template when mentioning interfaces by name, mdc will automatically format them and generate links to their documentation, like this: nsiconsoleservice. if you prefer, you can just link to the articles directly. either way, these links should be added. these articles are al...
... link to the articles directly. either way, these links should be added. these articles are all tagged as covering firefox 3.1 using the fx_minversion_header template, but i don't think that's the case. certainly appendix 2 doesn't care what version of firefox you're using, since it's just about open source software licenses. ...
XUL user interfaces - Archive of obsolete content
on: a xul demonstration make a new xul document as a plain text file, doc7.xul. ...
...atusbar { width: 100%; border: 1px inset -moz-dialog; margin: 4px; padding: 0px 4px; } #status { padding: 4px; } #status[warning] { color: red; } make a new text file, script7.js. ...
Index of archived content - Archive of obsolete content
notifications.jsm pageactions.jsm prompt.jsm runtimepermissions.jsm snackbars.jsm sound.jsm tab addons developer guide code snippets creating a user interface firefox hub walkthrough
initialization and cleanup prerequisites walkthrough webextensions for firefox for android listening to events in firefox extensions migrating from internal linkage to frozen linkage migrating raw components to add-ons multiple item extension packaging offering a context menu for form controls ...
... npp_write npp_writeready npprint npprintcallbackstruct nprect npregion npsaveddata npsetwindowcallbackstruct npstream npstring nputf8 npvariant npvarianttype npwindow np_getmimedescription np_getvalue np_
initialize np_port np_shutdown samples and test cases shipping a plugin as a toolkit bundle supporting private browsing in plugins the first install problem writing a plugin for mac os x xembed extension for mozilla plugins sax security ...
Install.js - Archive of obsolete content
rofile install of ' + this.extfullname + ' to version ' + this.extversion + '.'); } this.profileinstall = true; } else if (!this.silentinstall) { // ask user for install location, profile or browser dir? ...
...nstall) { // ask user for install location, profile or browser dir? ...
Defining Cross-Browser Tooltips - Archive of obsolete content
lassic example is a "tooltip" of an image; when the user pauses the mouse pointer over an image, the contents of the alt attribute are displayed as a "tooltip." gecko-based browsers such as mozilla, netscape 6+, and compuserve 7 do not support this behavior. see bug 25537 for a lengthy, sometimes passionate discussion of gecko's behavior in this regard. the problem according to the html 4.01 def
inition of the alt attribute: alt = text cs for user agents that cannot display images, forms, or applets, this attribute specifies alternate text. the language of the alternate text is specified by the lang attribute. in other words, alt text should only be displayed when a user agent cannot display the primary content of the element (e.g., a text-mode browser that cannot display images). in a ...
....g., a text-mode browser that cannot display images). in a visual browser, the image should be displayed and the alt text should not. this assumes that the browser can find the image and that it supports the image format used; if either of these is not true, and the image cannot be displayed, then the alt text should be displayed in place of the missing image. on the other hand, the html 4.01 def
inition of the title attribute states: title = text cs this attribute offers advisory information about the element for which it is set. unlike the title element, which provides information about an entire document and may only appear once, the title attribute may annotate any number of elements. please consult an element's def
inition to verify that it supports this attribute... values of the tit...
Source Navigator - Archive of obsolete content
. you can also build your projects, either with your own makefile, or by using source-navigator's build system to automatically generate a makefile. source-navigator works with the insight gui interface for gdb. more information can be found here --> http://sourcenav.sourceforge.net/ why worth a try? it's quite fast as compared to mxr. (i think.) you can specify whether it's the declaration/def
inition of a method/function to look up... but on the other hand mxr can only allow you to type in the name for it to generate a long list of occurances. (as i understand. let me know if this is wrong..) it can generate a class hierarchy quite easily (unfortunately, not for classnames which are defined by macro.) installing source navigator in ubuntu execute the following line in a terminal windo...
... source navigator (more later) opening a project open a terminal. type <tt>snavigator</tt> followed by striking enter. this shows the "source-navigator projects" dialog. choose the project file that you've just created and then click "open...". source navigator then loads the database and then display the following symbols window: searching a method by typing in the method name viewing the def
inition/declaration by highlighting the method in the code ... displaying a inheritance hierarchy ... searching a string ... ...
Source code directories overview - Archive of obsolete content
is recursive; it can apply to submodules, sub-submodules and so on. base contains the basic (core) functionality for the module. base contains all the source code that cannot be categorized into a submodule. build contains any special makefiles for building the particular module. doc contains any documentation associated with this module. idl contains the xpidl (cross platform interface def
inition language) interface files. interfaces are used so functionality can be available to both javascript scripts and c code with as little effort as possible. xpidl files have their own mini-language and processing tools. public contains source code that will be exported to the dist/include directory. they are not all necessarily public in the general sense; some are only meant for internal use in...
...ager, typeaheadfind, view source, etc. content contains xul specific to the toolkit. library contains libxul work. localescontains files that are translated. mozappscontains shared application stuff. obsoletecontains obsolete stuff. profilecontains the profile manager themescontains themes as they relate to toolkit things. xreis the xul runtime engine. this directory contains the code for
initializing the toolkit. original document information author(s): daniel howard other contributors: heikki toivonen (11-nov-1999), hervé renault (for the french translation) (16-nov-1999) last updated date: michael kaply 2-june-2005 copyright information: portions of this content are © 1998-2007 by individual mozilla.org contributors; content available under a creative commons license...
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
samples can be obtained from: https://developer.mozilla.org/en/plugins/samples_and_test_cases get the npapi sdk. add the npapi sdk include path (example : c:\npapi-sdk\headers) to project properties|(all configurations)|c++|general|additional include directories. note: if your project is still empty, the c++ tree might not be visible. so, add some files first. add the following preprocessor def
initions to project properties|(all configurations)|c++|preprocessor|preprocessor def
initions: win32;_windows;xp_win32;xp_win;_x86_;npsimple_exports disable precompiled headers using project properties|(all configurations)|c++|precompiled headers|create/use precompiled header. they may be already disabled. define the function exports by adding the .def filename (e.g. nprt.def) to project properties|...
...it could be either the full path or the path relative to the project directory. optional: open the above .def file and change "nprt" to the filename of your dll as vs sees it (without "np", if you decided to rename later) optional: edit the .rc file and and the top of npp_gate.cpp for the description, mimetype, file extension etc. ...
Style System Overview - Archive of obsolete content
roperty and a value. p { color: green; font-size: 12em; } selector { property: value; property: value; } css style rules what do style rules mean? selector matches elements in the document. rule applies to matched elements. “cascaded” value for property + element: if 0 rules matching the element have the property: some properties inherit and some properties use
initial value. inherited: 'font-size', 'color', etc. “reset”: 'border', 'background', etc. 1 matching rule: use value 2+ matching rules: cascade decides which wins: sort by origin (ua, user, author) & weight (!important), then specificity of selector, then order example document source <doc> <title>a few quotes</title> <para...
...scribed in the previous few slides happens lazily. first, nsstylecontext::getstyledata checks for a cached struct on the style context, and returns it if present. then, nsrulenode::getstyledata checks for a cached struct or a dependent bit on the rule node, and returns the struct if present. otherwise, we need to compute the struct, so nsrulenode::getstyledata calls nsrulenode::get*data, which
initializes the correct one of the data structs on the stack (the structs used by nscssdeclaration) style data computation get*data calls nsrulenode::walkruletree, which walks 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 ...
Using microformats - Archive of obsolete content
w javascript script loader added to firefox 3. to use the api, you need to first load the object: components.utils.import("resource://gre/modules/microformats.js"); once you've loaded the microformats api, you can manage microformats using the methods listed here; for information about parsing microformats, see parsing microformats in javascript. predefined microformats firefox 3 provides def
initions implementing several common microformats: adr represents an address (such as a street or mailing address). geo represents a geographical location using latitude and longitude. hcard represents contact information for a person. hcalendar represents a calendar appointment entry. tag used to add tags to other microformats. methods add() adds a new microformat to the microformat m...
.... geo represents a geographical location using latitude and longitude. hcard represents contact information for a person. hcalendar represents a calendar appointment entry. tag used to add tags to other microformats. methods add() adds a new microformat to the microformat module. note: if a microformat by the specified name already exists, it is replaced by the new one. add(name, def
inition); parameters name the name of the microformat to add to the microformat module. def
inition a javascript structure describing the microformat. see describing microformats in javascript for details. count() counts the number of microformats in a document that match specified criteria. var nummicroformats = microformats.count(name, rootelement, options); parameters name the name...
JavaScript crypto - Archive of obsolete content
equest() function generates a key and creates a crmf request object. this object can be passed to a ca using a webform. the importusercertificates() function loads certificates into the nss database or smartcard if the corresponding key is found there. the popchallengeresponse() function is not implemented. ...
...or delete actually occurs. parameters modulename name of the module. libraryfullpath the filename of the library prepended with its full path. cryptomechanismflags a bit vector indicating all cryptographic mechanisms should be turned on by default (see below). cipherflags a bit vector indicating all ssl or s/mime cipher functions supported by the module (see below). mechanism flag def
initions in general, most tokens should not set any of the cipher flags. setting these flags means you want your token to supply the default implementation for these functions. normally mozilla uses its own internal module to supply these functions. these flags override that preference. if you choose to implement these flags, your module must supply the following additional functions for each flag: ...
Settings - Archive of obsolete content
he settings property is an array of objects representing the settings to expose to users. jetpack will automatically generate a user interface from this specification that users of your jetpack may use to customize the settings. the user can open this interface from the "settings" button next to your jetpack on the "installed features" tab of the about:jetpack page. ...
...with the above manifest the following stored properties are available in the jetpack's code: * jetpack.storage.settings.twitter.username * jetpack.storage.settings.twitter.password * jetpack.storage.settings.facebook.username * jetpack.storage.settings.facebook.password * jetpack.storage.settings.music * jetpac...
Jetpack Snippets - Archive of obsolete content
ipt:console.log('hello!')">test</a> <script><![cdata[ //firebug lite bookmarklet code: var firebug=document.createelement('script'); firebug.setattribute('src','http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'); document.body.appendchild(firebug); (function(){if(window.firebug.version){firebug.
init();}else{settimeout(arguments.callee);}})();void(firebug); ]]></script> </body></html>, width: 800, //wide enough to use firebug onselect: function(slide) { slide.slide(800, true); }}); calling into a slidebar from the global jetpack scope jetpack.slidebar.append({ onready: function (slide) { // call out to a global function, passing the slidebar o...
...ttimeout(arguments.callee);}})();void(firebug); ]]></script> </body></html>, width: 800, //wide enough to use firebug onselect: function(slide) { slide.slide(800, true); }}); calling into a slidebar from the global jetpack scope jetpack.slidebar.append({ onready: function (slide) { // call out to a global function, passing the slidebar object ex
initslidebar(slide); }, ...});function ex
initslidebar(aslidebar) { // this variable will now be global slider = aslidebar;} // then, accessing the slidebar htmlvar tl = slider.contentdocument.getelementbyid("thumblist"); // or calling slidebar api methods or accessing propertiesslider.notify(); ...
Settings - Archive of obsolete content
e settings property is an array of objects representing the settings to expose to users. jetpack will automatically generate a user interface from this specification that users of your jetpack may use to customize the settings. the user can open this interface from the "settings" button next to your jetpack on the "installed features" tab of the about:jetpack page. ...
...with the above manifest the following stored properties are available in the jetpack's code: jetpack.storage.settings.twitter.username jetpack.storage.settings.twitter.password jetpack.storage.settings.facebook.username jetpack.storage.settings.facebook.password jetpack.storage.settings.music jetpack.storage.s...
Monitoring downloads - Archive of obsolete content
d speed, and the status of the download. a tooltip is included that displays the full source url of the file. download the full sample. setting up when the extension loads, it will do some housekeeping chores. in particular, it needs to get an instance of the download manager's nsidownloadmanager interface and create the database into which its data will be stored. ...
...he download. a tooltip is included that displays the full source url of the file. download the full sample. setting up when the extension loads, it will do some housekeeping chores. in particular, it needs to get an instance of the download manager's nsidownloadmanager interface and create the database into which its data will be stored. ...
Mozilla Crypto FAQ - Archive of obsolete content
ompanies 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 ssl, s/mime, and pki source code. howev...
...t of encryption software. your particular obligations depend on your exact circumstances, and we cannot provide legal advice to you. however, in an advisory opinion issued in reference to the bernstein case, the bureau of export administration (bxa) has stated the following: "concerning the posting onto a mirror or archive site of already-posted source code, notification is required only for the
initial posting." bxa and nsa have already been notified of the posting of encryption-related source code on the mozilla site, and in light of this opinion we have therefore decidednot to ask mirror sites to provide notification themselves. note that in any case the notification procedures outlined in the export administration regulations apply only to u.s. residents and sites located in the u.s. if ...
Scripting - Archive of obsolete content
me window. it can contain the following functions: startup when the app starts, before the user interface is displayed. since the web application has not yet loaded, the window object is still undefined. preload just before the user interface is displayed. returning false causes the application to terminate. load after the main application windows has finished loading. the window object has been
initialized and can be used. error if there is an error loading the main app page (e.g. the server is not accessible). shutdown just before the application terminates. prism exposes desktop integration features through an property of the window object called platform. the platform property implements the nsiplatformglue interface, whose methods are described in the following section. methods of the w...
...tform. the platform property implements the nsiplatformglue interface, whose methods are described in the following section. methods of the window.platform object can be called from webapp.js or from web content. the following code can be used by web content to determine whether it is running in prism: if ("platform" in window) { // prism-specific code goes here } see the nsiplatformglue idl def
inition file for details of the methods available to prism apps. currently, the webapp script also has access to full xpcom functionality, just like a firefox extension. this level of functionality is commonly called chrome-level privileges. it means that the script has a higher level of privilege than scripts in the web content and has access to the file system, clipboard and other parts of the nativ...
Tamarin build documentation - Archive of obsolete content
ux\platform\win32\obj_9\shell\debug_debugger by default. building the x64 release_debugger configuration will create avm.exe under \tamarin-redux\platform\win32\x64\release_debugger. note the "\obj9" directory under \platform\win32 for the win32 builds and "\x64" directory under \platform\win32 for 64-bit builds; this looks a little odd but preserves previous behavior as much as possible to avoid
initial disruption from the shell rename fix. you must install vs2008 with x64 support to build the 64-bit configurations. if you installed the windows mobile 6 sdk, you can build for windows mobile (arm) targets. apple xcode the project files are designed for xcode 3.0. see "platform/mac/avmplus/avmplus.xcodeproj/". xcode 2.2, 2.3, and 2.4 will not work. there are two targets in the xcode ide,...
...e capital d and no "="). additional configurations are: debug_debugger, release and release_debugger. the resulting debug executable for the command above would be built at /platform/mac/avmshell/build/debug/avm. intel macs build correctly by setting archs=i386. eclipse (currently mac only) eclipse (galileo) / cdt (6.0) project for tamarin (also works with helios). the configurations in this
initial version cover 32- and 64-bit builds for mac os with the gcc 4.0 toolchain (installed with xcode 3.x). preparing your eclipse workspace and perspective open the c/c++ perspective open the 'c/c++ projects' view (window >> show view >> c/c++ projects) add view filter 'non-c elements' (in the top-right of the 'c/c++ projects' view, click the down-arrow, click 'filters...', check 'non-c eleme...
Example Sticky Notes - Archive of obsolete content
/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <!-- in above only xbl namespace declaration is mandatory. the others are only needed if you plan to handle xul (xml user interface language) or/and svg (scalable vector graphics) in your bindings; xlink in xml also may come useful sometimes. all namespaces above are supported by default and they do not require any additional downloads or
initializations. --> <binding id="default"> <!-- a separate binding. you add a binding file using -moz-binding style rule and you address a particular binding by its id: -moz-binding: url(notes.xml#default) this id is local within the binding file (not visible in the target document dom tree). --> <resources> <!-- obtaining the stylesheet we'll use to (re)style the bound element. --> <...
...annot cancel this event, * but you may accomplish some last minute clean up. * "this" in this context refers to the bound element. */ // your code goes here ]]></destructor> <field name="priority"><![cdata[ /** * new "real" property for the bound element. * within this block the content is interpreted * as javascript code. the result of this code * evaluation (if any) will be used as
initial value. */ "normal"; ]]></field> <property name="innertext"> <!-- new "virtual" property for the bound element. unlike <field> these are really two functions (getter and setter). within the virtual properties you cannot set or get the named property itself. say an attempt to assign this.innertext='something' will lead to circular setter call and stack overflow. --> <getter><![cdat...
addDirectory - Archive of obsolete content
registryname the pathname in the client version registry for the root directory of the files that are to be installed.this parameter can be an absolute pathname (beginning with a /) or a relative pathname, (not beginning with a slash). an absolute pathname is used as specified. a relative pathname is appended to the registry name of the package as specified by the package parameter to the
initinstall method.this parameter can also be null, in which case the xpisourcepath parameter is used as a relative pathname.note that the registry pathname is not the location of the software on the computer; it is the location of information about the software inside the client version registry. version an installversion object or a string of up to four integer values delimited by peri...
...a relative pathname.note that the registry pathname is not the location of the software on the computer; it is the location of information about the software inside the client version registry. version an installversion object or a string of up to four integer values delimited by periods, such as "1.17.1999.1517". for variants of this method without a version argument the value from
initinstall will be used. xpisourcepath a string specifying the location of the directory within the xpi file.an empty string ("") causes the creation of a subdirectory node in the registry without actually unpacking any files, which may be useful when you are updating a package that contains subcomponents that could also be updated separately. when xpisourcepath is an empty string, regi...
patch - Archive of obsolete content
t that is to be patched.this parameter can be an absolute pathname, such as /royalairways/royalsw/executable or a relative pathname, such as executable. typically, absolute pathnames are only used for shared components, or components that come from another vendor, such as /microsoft/shared/msvcrt40.dll. typically, relative pathnames are relative to the main pathname specified in the
initinstall method. this parameter can also be null, in which case the xpisourcepath parameter is used as a relative pathname. note that the registry pathname is not the location of the software on the computer; it is the location of information about the software inside the client version registry. version an installversion object or a string of up to four integer values delimit...
...e pathname. note that the registry pathname is not the location of the software on the computer; it is the location of information about the software inside the client version registry. version an installversion object or a string of up to four integer values delimited by periods, such as "1.17.1999.1517". for variants or this method without a version argument the value from
initinstall will be used. xpisourcepath a string specifying the location of the differences file within the xpi file. localdirspec an object representing the directory in which the subcomponent that is to be patched resides. you create this object by passing a string representing the directory to the getfolder method. relativelocalpath a pathname relative to t...
refreshPlugins - Archive of obsolete content
g. description refreshplugins lets you register new plug-ins without having to restart the browser. when you use this method in an installation script, as the example below demonstrates, you can install new plug-ins and use them to display the requested media in a web page without interrupting the experience of the user. ...
...s, you can install new plug-ins and use them to display the requested media in a web page without interrupting the experience of the user. note that refreshplugins must be called after the performinstall method that
initiates the actual installation. ...
XPInstall API reference - Archive of obsolete content
articular plugin developers should see how to package a plugin as an extension. ...
...t patch performinstall refreshplugins registerchrome reseterror setpackagefolder installtrigger no properties methods compareversion enabled getversion install installchrome startsoftwareupdate installversion properties methods compareto
init tostring file no properties methods copy dircreate dirgetparent dirremove dirrename diskspaceavailable execute exists isdirectory isfile macalias moddate moddatechanged move remove rename size windowsgetshortname ...
A XUL Bestiary - Archive of obsolete content
faces, xptoolkit is the set of xul widgets (menus, toolbar, etc.) actually assembed for this purpose -- the building blocks of the interface, as it were -- and xpfe, the cross platform front end, is the front end that has been created from xptoolkit. the differences here are significant: xul is the universe of elements, attributes, syntax, rules, and relationships, while xptoolkit is really the f
inite set of interface-specific elements created in xul. the xpfe is what's been created out of the xptoolkit. a loosely analogous relationship might be that xul, xptoolkit, and xpfe are to one another what html, the actual html tags, and an html web page are to one another, respectively. xul parts people sometimes get confused about the syntax for describing the parts of a widget. for a widget like...
... component object model, whence the technology gets its name. based on com, xpcom insists that chunks of code provide language- and platform-neutral interfaces that other objects can use to access its services. xpcom enforces rules for design and compilation that make it possible to use the services of an object without knowing anything about implementation. xpidl, the cross-platform interface def
inition language, is a language in which these interfaces insisted upon by xpcom can be described. when xpidl is used to describe the xpcom interfaces, it makes those interfaces available in special header files. finally, xpconnect is the technology that connects these xpcom/xpidl interfaces to javascript, the scripting language xul uses. these three cross-platform glue technologies fit in the middle ...
Building accessible custom components in XUL - Archive of obsolete content
in xul, there is no tabindex attribute; to make a xul element focusable, you need to use a mozilla-specific css property, -moz-user-focus: normal. <code> grid.spreadsheet { border: thin solid; -moz-user-focus: normal; } </code> in html documents, firefox draws a focus rectangle around the currently focused element. in xul, we will need to handle this ourselves, again with css rules. you might
initially think of using the css border property, but that will add width and height to the focused cell. a better approach is to use the css outline property, which does maintains the element's dimensions. (technically, it draws the border inside the element instead of outside.) <code> grid.spreadsheet description:focus, grid.spreadsheet label:focus { outline: 1px dotted black; outline-offset: -2...
...uld stop now, but we won't. what good is a spreadsheet if you can't edit it? we need to define a specific action that will trigger editing the currently focused cell. to maintain compatibility with the accessible html spreadsheet demo, i chose the enter key to trigger editing mode. when the user presses enter, we replace the currently focused xul label element with a xul textbox element, copy the
initial value over to the textbox element, and call its focus and select methods to set focus to the textbox and select the entire value. we register two event handlers on the textbox: onkeypress and onblur. if the user presses enter while editing the cell, we "accept" the value by recreating the original label and copying the new value back. if the user presses esc, we "cancel" the edit by simply rec...
Introduction to XUL - Archive of obsolete content
xul file preamble xul is xml, and a good xul file begins with the standard xml version and doctype statements. since xml has no implicit display semantics, there must always be associated stylesheets. mozilla includes a standard stylesheet, "xul.css". you can load as many style sheets as you wish using repeated processing directives, although you should always make sure to load the xul.css file
initially. and finally, any namespaces used in the document must be declared. so a xul file will begin <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/xul.css" type="text/css"?> <!doctype window> <window xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> the html namespace is of course the standard one. the xul namesp...
...javascript, deeming application programming to be beyond its scope. javascript xul can contain 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 i...
ContextMenus - Archive of obsolete content
however, the event will also fire when the label is right-clicked for instance, so the event handler should check to make sure that the target of the contextmenu event is what is desired. to cancel a context menu event, you can use the preventdefault method of the event object. function checkcontextmenu(event) { if (event.target.localname == "textbox") event.preventdefault(); } function
init() { var container = document.getelementbyid("container"); container.addeventlistener("contextmenu", checkcontextmenu, true); } the 'checkcontextmenu' function checks to see if the textbox was the target of the context menu and, if so, cancels the event using the preventdefault method. this has the effect of disabling the context menu. the event listener is attached using the addeventlistene...
...= document.getelementbyid("container"); container.addeventlistener("contextmenu", checkcontextmenu, true); } the 'checkcontextmenu' function checks to see if the textbox was the target of the context menu and, if so, cancels the event using the preventdefault method. this has the effect of disabling the context menu. the event listener is attached using the addeventlistener method within the '
init' function. this might be called while
initializing a window during a load event for example. attaching context menus a context menu may be attached to an element using the context attribute, which may be applied to any xul element. the value of the context attribute should be the id of a context menu within the same document. in the example, a context menu is attached to a grid. <window id=...
PopupEvents - Archive of obsolete content
isplay only those items pertaining to links. within the listener for the popupshowing event, you can append to or modify the menu as needed before it is displayed. for examples of the use of the popupshowing event when used with context menus, see hiding and showing menu items based on context. however, this technique can be applied to any type of popup. in this example, a label within a panel is
initialized with the current time. <panel id="time-panel" onpopupshowing="this.lastchild.value = (new date()).tolocaleformat('%t')"> <label value="time:"/> <label id="time"/> </panel> <toolbarbutton label="show time" popup="time-panel"/> you can prevent a menu or popup from appearing by calling the preventdefault method of the event from within a popupshowing listener. the default operation of ...
...erwise, the user would have a menu for a parent window that is no longer active. so instead, the popup is removed first. note that this means that the popuphiding event doesn't fire until after the modal dialog has been closed. there are situations when the popuphiding event will not fire when a menu is closed so you should make sure not to call any necessary code there. a better way is to just re
initialize the menu or popup in the popupshowing event. one such situation when the hiding events are not sent is when the menu is removed from the document. this is because there is no longer an element to send the events to. another situation is when the document is being unloaded. the popuphidden event the popuphidden event is fired after a popup has been closed. when a chain of menus is opened, th...
controllers - Archive of obsolete content
« xul reference controllers type: nsicontrollers a controllers list attached to the element. the controllers are used to respond to commands. the document's command dispatcher will locate controllers to handle a command by using the focused element's list. ...
... a controllers list attached to the element. the controllers are used to respond to commands. the document's command dispatcher will locate controllers to handle a command by using the focused element's list. ...
Sorting and filtering a custom tree view - Archive of obsolete content
sake of simplicity, strings are not localized and the data loaded is hard coded. because of bug 340478, this code will only work from privileged script. ...
...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) { //...
textbox (Toolkit autocomplete) - Archive of obsolete content
oninput type: script code this event is sent when a user enters text in a textbox. this event is only called when the text displayed would change, thus it is not called when the user presses non-displayable keys. onsearchbegin type: script code this event handler is called when the autocomplete search begins. note: for firefox 12 and above, this event handler must be set as an
initial attribute. onsearchcomplete new in thunderbird 3requires seamonkey 2.0 type: script code this event handler is called when the autocomplete search is finished and results are available. note: for firefox 12 and above, this event handler must be set as an
initial attribute. ontextentered new in thunderbird 3requires seamonkey 2.0 type: script code this event handler is called wh...
...andler is called when the autocomplete search is finished and results are available. note: for firefox 12 and above, this event handler must be set as an
initial attribute. ontextentered new in thunderbird 3requires seamonkey 2.0 type: script code this event handler is called when a result is selected for the textbox. note: for firefox 12 and above, this event handler must be set as an
initial attribute. ontextreverted new in thunderbird 3requires seamonkey 2.0 type: script code this event handler is called when the user presses escape to revert the textbox to its original uncompleted value. note: for firefox 12 and above, this event handler must be set as an
initial attribute. open type: boolean for the menu type buttons, the open attribute is set to true when the m...
Commands - Archive of obsolete content
cting items from the list. you'll notice that the delete command on the browser's edit menu is enabled and that selecting it will delete a row. (see discussion about opening this example). the example below isn't completely polished. really, we should ensure that the selection and focus is adjusted appropriately after a deletion. ...
...that selecting it will delete a row. (see discussion about opening this example). the example below isn't completely polished. really, we should ensure that the selection and focus is adjusted appropriately after a deletion. ...
Focus and Selection - Archive of obsolete content
. for now, we'll look at some of the focus related features of the command dispatcher. you can retrieve the command dispatcher from a window using the document's commanddispatcher property. from there, you can get the focused element with the dispatcher's focusedelement property. the example below shows this. ...
... command dispatcher from a window using the document's commanddispatcher property. from there, you can get the focused element with the dispatcher's focusedelement property. the example below shows this. ...
Keyboard Shortcuts - Archive of obsolete content
would use. access the user must press the special access key. the key used for access keys on the user's platform. your keyboard won't necessarily have all of the keys, in which case they will be mapped to modifier keys that you do have. the key element must be placed inside a keyset element. this element is designed for holding a set of key elements, which serves to group all of the key def
initions in one place in a file. any key elements outside of a keyset element will not work. each platform generally uses a different key for keyboard shortcuts. for example, windows uses the control key and the macintosh uses the command key. it would be inconvenient to define separate key elements for each platform. luckily, there is a solution. the modifier accel refers to the special platform-spe...
...efine keyboard shortcuts for any number of menu items. you'll also notice in the image that text has been placed next to the paste menu command to indicate that ctrl and the v key can be pressed to invoke the menu command. this is added for you based on the modifiers on the key element. keyboard shortcuts attached to menus will work even if the menu is not open. one additional feature of key def
initions is that you can disable them easily. to do this add a disabled attribute to the key element and set it to the value true. this disables the keyboard shortcut so that it cannot be invoked. it is useful to change the disabled attribute using a script. our find files example let's add keyboard shortcuts to the find files dialog. we'll add four of them, one for each of the cut, copy, and pas...
Localization - Archive of obsolete content
low demonstrates the use of an entity in a button. <button label="&findlabel;"/> the text that will appear on the label will be the value that the entity &findlabel; has. a file is created which contains the entity declarations for each supported language. in english, the &findlabel; entity will probably be declared to have the text "find". dtd files entities are declared in document type def
inition (dtd) files. files of this type are normally used to declare the syntax and semantics of a particular xml file, but they also let you declare entities. in the mozilla chrome system, you will find dtd files located in the locales subdirectory. you would normally have one dtd file (with an extension .dtd) per xul file. if you look in the chrome directory, you should see an archive for your lang...
...e xul file is shown below with the changes shown in red. ...
More Event Handlers - Archive of obsolete content
aining to how the element is displayed, including the x and y position of the element. in this example code, these coordinates are subtracted from the event coordinates to get the event position relative to the element. load events the load event is sent to the document (the window tag) once the xul file has finished loading and just before the content is displayed. this event is commonly used to
initialize fields and perform other tasks that need to be done before the user can use the window. you should use a load event to do these kinds of things as opposed to adding a script at the top level outside of a function. this is because the xul elements may not have loaded or fully
initialized yet, so some things may not work as expected. to use a load event, place an onload attribute on the windo...
...e done before the user can use the window. you should use a load event to do these kinds of things as opposed to adding a script at the top level outside of a function. this is because the xul elements may not have loaded or fully
initialized yet, so some things may not work as expected. to use a load event, place an onload attribute on the window tag. call code within the load handler which will
initialize the interface as necessary. there is also an unload event which is called once the window has closed, or in a browser context, when the page is switched to another url. you can use this event to save any changed information, for example. next, we'll find out how to add keyboard shortcuts. « previousnext » ...
Numeric Controls - Archive of obsolete content
nd 20. <textbox type="number" min="1" max="20"/> as the default value isn't specified, 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 inf
inity which means that there is no limit. other numeric textbox attributes the increment 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" increment="10" max="100"/> this ...
...p. date and time entry fields the datepicker and timepicker elements may be used to allow the user to enter dates and times. when used, they display a set of numeric textboxes to enter each of the components of the date or time. <datepicker value="2004-03-24"/> <timepicker value="15:30:00"/> the value attribute is used to set the default value; if this attribute is omitted, the field will be
initially set to the current date or time. the format of the attribute is exactly as above, that is dates are of the form yyyy/mm/dd and times are of the form hh:mm:ss (although the seconds and the accompanying colon may be omitted). these two elements ensure that the user enters a value date or time. this way, you do not have to check for valid dates, ensure that the day isn't greater than the number...
XBL Example - Archive of obsolete content
o that it stretches in the right way. the label attributes on the two buttons inherit their values from the bound element. here, they inherit from two custom attributes, previoustext and nexttext. this makes it easy to change the labels on the buttons. the children of the element that the xbl is bound to will be placed inside the deck. the selectedindex is inherited by the deck, so we may set the
initial page in the xul. the following xul file produces the result in the image. <box class="slideshow" previoustext="previous" nexttext="next" flex="1"> <button label="button 1"/> <checkbox label="checkbox 2"/> <textbox/> </box> the style sheet used here is: .slideshow { -moz-binding: url("slideshow.xml#slideshow"); } the first button, button 1 has been used as the first page of the...
... index. the label element can be retrieved by getting the first element of anonymous content (the vertical box), the second child of that label element (the horizontal box), and then the second element of that box. the value attribute is changed to read '1 of 3' or something similar. note that one is added to the index because indicies start at 0. constructor we will also need a constructor to
initialize the label element so that it displays correctly when the slideshow is first displayed. we use similar code as to the method above to set the page number. the reference to 'this.page' will call the onget script of the page property, which in turn will retrieve the
initial page from the selectedindex attribute. <constructor> var totalpages=this.childnodes.length; document.getanonymousnod...
XUL accessibility guidelines - Archive of obsolete content
forms provide three form fields. the problem occurs when a developer decides to add functionality that jumps the user to the second form field once 3 digits have been entered into the first form field. this behavior is then repeated for the next form field. users who are used to navigating form fields themselves often end up repeating the jump operation and thereby skipping ahead one form field.
initial dialog focus the
initial focus in a xul dialog (i.e., the focus when the dialog is first opened) should always be on a specific control, not on the dialog itself. in a tabbed dialog, focus should normally start on the first control in the selected tab. in all other dialogs, focus should just start on the first control (although it can be on any other control if there is a good reason for, jus...
... element. alerts are conveyed visually or audibly, or use a method other than the alert scripting function or the notificationbox element. interactive elements interactive elements are sufficiently large and visible. interactive elements are too small or not sufficiently contrasted from other parts of the application. error recovery alerts are presented when the user
initiates an error. the user has the opportunity and instruction to fix the error. no error alerts exist, or inadequate instruction is provided. response time user is informed of time limits and has control of response time when appropriate. user is not notified of time limits and/or has no control over response time when appropriate. media checkpoint pass fail...
timepicker - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] the timepicker is used to allow the user to enter a time. it contains three fields to enter the hour, minute and second. arrow buttons next to the fields allow the values to be adjusted with the mouse. a fourth textbox appears for 12 hour clocks which allows selection of am or pm. to specify the
initial, use the value attribute set to a value of either the form hh:mm:ss or hh:mm. the value may be retrieved and changed using the value property or the datevalue property. the former specifies the time as a string of the form hh:mm:ss whereas the latter specifies the time as a date object. in addition, the hour, minute and second properties may be used to retrieve and modify each component of the...
... 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. value type: string the
initial value of the timepicker in either the form hh:mm:ss or hh:mm. properties amindicator type: string the string value displayed for hours between midnight and noon, defaulting to am. this value is determined from the user's locale. datevalue type: date the date that is currently entered or selected in the datepicker as a date object. d...
Mozilla release FAQ - Archive of obsolete content
* bad points of reworking things. to start understanding the issues with this example, you should dig up the rfcs for the relevant protocols, any documents written on the subject, etc. for this particular example, you would want to go look at relevant topics stuart cheshire's discussion on latency versus bandwidth internet -- under the covers (by me) the rfc for http the w3's html 4.0 def
inition building mozilla i get x error when trying to build mozilla - what's wrong? first, make sure that you have the latest release of the mozilla source. secondly, ensure that you have fully read the build instructions for your platform. these instructions are included in the source tree, and are also available on the mozilla website: detailed build instructions: unix/x win32 mac if your v...
...ts about lcong48 and seed48! you 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 appea...
NPN_Version - Archive of obsolete content
ned when the plug-in and the browser are compiled. for example, plug-in api version 4.03 has a major version number of 4 and a point release number of 3. this function gets the values from the plug-in rather than from the browser. a plug-in can use this function to check that the version of the plug-in api it is using is compatible with the version in use by the browser. this could be part of the
initialization process. for more information and an example, see getting the current version. you can use npn_version() to inquire on version constants (npvers constants), which represent particular browser features. once the plug-in obtains a version number, it can inquire on a version constant to find out if the feature it represents exists in this version. for example, the plug-in could inquire on ...
...n and an example, see finding out if a feature exists. for a listing of version constants defined in the plug-in api, see version feature constants. note: platform-specific code in the plug-in api files npwin.cpp, npmac.cpp, or npunix.c checks version numbers automatically. a plug-in whose major version is less than the major version of the browser is not loaded. see also npn_useragent() np_
initialize() ...
Threats - Archive of obsolete content
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 for causing adverse impact. many threats against data and resources are possible because of mistakes—either bugs in operating system 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 o...
...or steal their data by flooding websites and networks with spurious traffic. original document information author(s): ella deon lackey last updated date: 2012 copyright information: © 2012 red hat, inc. link: red hat certificate system common criteria certification 8.1: deployment, planning, and installation original document information author(s): joint task force transformation
initiative title: national institute of standards and technology (nist) special publication 800-30 revision 1, guide for conducting risk assessments last updated date: september 2012 copyright information: this document is not subject to copyright. original document information author(s): karen scarfone, wayne jansen, and miles tracy title: national institute of standards and technology (ni...
Using workers in extensions - Archive of obsolete content
-35) is executed. it starts by setting up an interval handler (in lines 26-28) that calls refreshinformation() every 10 minutes. then it sets the worker's onmessage event handler to a function which looks at the event passed into it, and does one of two things: if there is a data field on the event, the stock symbol being tracked is set to the upper case version of that value. this is used to
initialize the worker, and to change which stock is being monitored. if there is no data field, the refreshinformation() method is called to fetch the latest information about the stock and pass it back to the main thread. this provides a way for the main thread to specifically request that the worker update the stock information at once. the refreshinformation() method is fairly similar to the pre...
..., not the // worker, when a message is received. var self = this; this.worker.onmessage = function(event) { self.onworkermessage.call(self, event); }; this.worker.postmessage(this.tickersymbol); }, the worker is set up and configured here in lines 13-22: line 13 instantiates a new worker, specifying the uri of the ticker_worker.js file. lines 17-20 change the def
inition of the worker's onmessage handler so that when the worker calls back to the main thread, the main thread's value of this is correctly the main thread's object instead of the worker's. line 22 sends a message to the ticker thread to tell it what symbol to monitor. the observe() method this method's job is to update which stock is being monitored when the user changes the preferences. it nee...
-moz-border-bottom-colors - Archive of obsolete content
in mozilla applications like firefox, the -moz-border-bottom-colors css property sets a list of colors for the bottom border. ...
... to tables with border-collapse: collapse. syntax values accepts a white-space separated list of color values. <color> specifies the color of a line of pixels of the bottom border. transparent is valid. ...
-moz-border-left-colors - Archive of obsolete content
in mozilla applications like firefox, the -moz-border-left-colors css property sets a list of colors for the left border. ...
... to tables with border-collapse: collapse. syntax values accepts a white-space separated list of color values. <color> specifies the color of a line of pixels of the left border. transparent is valid. ...
-moz-border-right-colors - Archive of obsolete content
in mozilla applications like firefox, the -moz-border-right-colors css property sets a list of colors for the right border. ...
... to tables with border-collapse: collapse. syntax values accepts a white-space separated list of color values. <color> specifies the color of a line of pixels of the right border. transparent is valid. ...
-moz-border-top-colors - Archive of obsolete content
in mozilla applications like firefox, the -moz-border-top-colors css property sets a list of colors for the top border. ...
... to tables with border-collapse: collapse. syntax values accepts a white-space separated list of color values. <color> specifies the color of a line of pixels of the top border. transparent is valid. ...
-moz-stack-sizing - Archive of obsolete content
moz-stack-sizing is an extended css property. normally, a <xul:stack> will change its size so that all of its child elements are completely visible. for example, moving a child of the stack far to the right will widen the stack so the child remains visible. /* keyword values */ -moz-stack-sizing: auto; -moz-stack-sizing: ignore; /* global values */ -moz-stack-sizing: inherit; -moz-stack-sizing:
initial; -moz-stack-sizing: unset; if you wish to prevent the stack from resizing automatically to accommodate its children, you can set -moz-stack-sizing to ignore on the child element. the property is set not on the stack itself, but on the stack's children. this lets you ignore certain children, but not others. note: in previous versions of gecko it was possible to work around the problem by set...
... this lets you ignore certain children, but not others. note: in previous versions of gecko it was possible to work around the problem by setting very large negative bottom and right margins on the stack element and equally large positive bottom and right margins on the children whose size you didn't want to ignore. (the problem does not affect children moved above or to the left of the stack.)
initial valuestretch-to-fitapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete syntax values stretch-to-fit the child will influence the stack's size. ignore the stack won't consider this child when calculating its size. formal syntax ignore | stretch-to-fit examples .mainsheet { -moz-stack-sizing: ignore; } ...
-ms-content-zoom-chaining - Archive of obsolete content
a bounce effect is shown when the user hits a zoom limit during page manipulation. chained the nearest zoomable parent element begins zooming when the user hits a zoom limit during page manipulation. no bounce effect is shown. ...
...a bounce effect is shown when the user hits a zoom limit during page manipulation. chained the nearest zoomable parent element begins zooming when the user hits a zoom limit during page manipulation. no bounce effect is shown. ...
-ms-content-zoom-snap-type - Archive of obsolete content
indicates that zooming is unaffected by any defined snap-points. after the contact is picked up, the content will continue to move with inertia. proximity indicates that the motion of the content after the contact is picked up may be adjusted if the content would normally stop "close enough" to a snap-point. ...
...indicates that zooming is unaffected by any defined snap-points. after the contact is picked up, the content will continue to move with inertia. proximity indicates that the motion of the content after the contact is picked up may be adjusted if the content would normally stop "close enough" to a snap-point. ...
-ms-hyphenate-limit-lines - Archive of obsolete content
<integer> indicates the maximum number of successive hyphenated lines. ...
... <integer> indicates the maximum number of successive hyphenated lines. for instance, if 2, then no more than 2 successive lines may end with a hyphenated word. if 0 then no lines may end with a hyphenated word. ...
-ms-overflow-style - Archive of obsolete content
same as inherit. none scrollbars are never displayed, although the element can still be scrolled if the element's content overflows. scrollbar "traditional" scrollbars are displayed if the element's content overflows. "traditional" scrollbars don't auto-hide and never overlap the element's content. ...
...same as inherit. none scrollbars are never displayed, although the element can still be scrolled if the element's content overflows. scrollbar "traditional" scrollbars are displayed if the element's content overflows. "traditional" scrollbars don't auto-hide and never overlap the element's content. ...
-ms-scroll-chaining - Archive of obsolete content
the nearest scrollable parent element begins scrolling when the user hits a scroll limit during any manipulation. no bounce effect is shown. none a bounce effect is shown when the user hits a scroll limit during any manipulation. ...
...the nearest scrollable parent element begins scrolling when the user hits a scroll limit during any manipulation. no bounce effect is shown. none a bounce effect is shown when the user hits a scroll limit during any manipulation. ...
-ms-scroll-rails - Archive of obsolete content
panning locks to the primary axis of motion. formal syntax none | railed specifications not part of any specification. remarks this property has no effect on non-scrollable elements. ...
...panning locks to the primary axis of motion. formal syntax none | railed specifications not part of any specification. remarks this property has no effect on non-scrollable elements. ...
-ms-touch-select - Archive of obsolete content
none the grippers are always off and default touch selection functionality is not provided. formal syntax grippers | none specifications not part of any specification. ...
... none the grippers are always off and default touch selection functionality is not provided. formal syntax grippers | none specifications not part of any specification. remarks this property requires windows 8 or later. ...
azimuth - Archive of obsolete content
ss property enables different audio sources to be positioned spatially for aural presentation. this is important in that it provides a natural way to tell several voices apart, as each can be positioned to originate at a different location on the sound stage. stereo output produce a lateral sound stage, while binaural headphones and multi-speaker setups allow for a fully three-dimensional stage.
initial valuecenterapplies toall elementsinheritedyescomputed valuenormalized angleanimation typediscrete syntax <angle> | [ [ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] | behind ] | leftwards | rightwards values angle audible source position is described as an angle within the range -360deg to 360deg. the value 0deg means directly ahead...
...to the current angle. rightwards: moves the sound clockwise by 20 degrees, relative to the current angle. examples h1 { azimuth: 30deg; } td.a { azimuth: far-right; } /* 60deg */ #12 { azimuth: behind far-right; } /* 120deg */ p.comment { azimuth: behind; } /* 180deg */ specifications specification status comment css level 2 (revision 1)the def
inition of 'azimuth' in that specification. recommendation
initial def
inition. ...
display-inside - Archive of obsolete content
the display-inside css property specifies the inner display type of the box generated by an element, dictating how its contents lay out inside the box. /* keyword values */ display-inside: auto; display-inside: block; display-inside: table; display-inside: flex; display-inside: grid; display-inside: ruby; /* global values */ display-inside: inherit; display-inside:
initial; display-inside: unset; value not found in db! syntax one of the keyword values listed below. values auto if the element's computed <display-outside> value is inline-level, the element is an inline element, and lays out its contents using inline layout. if the element's computed <display-outside> value is an layout-specific internal type, this elements acts as normal for its given <display-outside> valu...
...k layout. table the element lays out its contents using table layout. flex the element lays out its contents using flex layout. grid the element lays out its contents using grid layout. ruby the element lays out its contents using ruby layout. formal syntax syntax not found in db! specifications specification status comment css display module level 3the def
inition of 'display-inside' in that specification. candidate recommendation
initial specification browser compatibility not supported in any browser. ...
display-outside - Archive of obsolete content
values block-level the element generates a block-level box, and participates in a block formatting context. other formatting contexts, such as flex formatting contexts, may also work with block-level elements. inline-level the element generates an inline-level box, and participates in an i...
... types these display types require their parent to be of a particular display type, but can accept any display-inside value. for example, a table-caption box must have a table parent, but can establish any kind of formatting context for its children. formal syntax syntax not found in db! specifications specification status comment css display module level 3the def
inition of 'display-outside' in that specification. candidate recommendation
initial def
inition ...
Generator comprehensions - Archive of obsolete content
if the for-of iteration is always the first component. multiple for-of iterations or if statements are allowed. a significant drawback of array comprehensions is that they cause an entire new array to be constructed in memory. when the input to the comprehension is itself a small array the overhead involved is insignificant — but when the input is a large array or an expensive (or indeed inf
inite) generator the creation of a new array can be problematic. generators enable lazy computation of sequences, with items calculated on-demand as they are needed. generator comprehensions are syntactically almost identical to array comprehensions — they use parentheses instead of braces— but instead of building an array they create a generator that can execute lazily. you can think of them as ...
...result: both return a generator which yields [1, 4, 9] example 2: using if in generator. var numbers = [1, 2, 3]; // generator function (function*() { for (let i of numbers) { if (i < 3) { yield i * 1; } } })(); // generator comprehension (for (i of numbers) if (i < 3) i); // result: both return a generator which yields [1, 2] specifications generator comprehensions were
initially in the ecmascript 2015 draft, but got removed in revision 27 (august 2014). please see older revisions of es2015 for specification semantics. ...
New in JavaScript 1.3 - Archive of obsolete content
06 and 4.5 executes javascript language versions up to 1.3. note that communicator and navigator 4.0-4.05 and earlier ignored scripts with the language attribute set to "javascript1.3" and higher. <script language="javascript1.2"> <!-- javascript for navigator 4.0. --> <script language="javascript1.3"> <!-- javascript for navigator 4.5. ...
...ge versions up to 1.3. note that communicator and navigator 4.0-4.05 and earlier ignored scripts with the language attribute set to "javascript1.3" and higher. <script language="javascript1.2"> <!-- javascript for navigator 4.0. --> <script language="javascript1.3"> <!-- javascript for navigator 4.5. ...
ECMAScript 2015 support in Mozilla - Archive of obsolete content
(firefox 37) new math functions math.imul() (firefox 20) math.clz32() (firefox 31) math.fround() (firefox 26) math.log10(), math.log2(), math.log1p(), math.expm1(), math.cosh(), math.sinh(), math.tanh(), math.acosh(), math.asinh(), math.atanh(), math.hypot(), math.trunc(), math.sign(), math.cbrt() (firefox 25) additions to the number object number.isnan() (firefox 16) number.isf
inite() (firefox 16) number.isinteger() (firefox 16) number.parseint() (firefox 25) number.parsefloat() (firefox 25) number.epsilon (firefox 25) number.max_safe_integer, number.min_safe_integer (firefox 31) number.issafeinteger() (firefox 32) additions to the object object object.prototype.__proto__ has been standardized object.is() (firefox 22) object.setprototypeof() (firefox 31) objec...
... parameters without defaults after default parameters (firefox 26) destructured parameters with default value assignment (firefox 41) arrow functions (firefox 22) generator function (firefox 26) yield (firefox 26) yield* (firefox 27) arguments[@@iterator] (firefox 46) other features binary and octal numeric literals (firefox 25) template strings (firefox 34) object
initializer: shorthand property names (firefox 33) object
initializer: computed property names (firefox 34) object
initializer: shorthand method names (firefox 34) ...
Object.prototype.__noSuchMethod__ - Archive of obsolete content
// example base class 1 function namedthing(name) { this.name = name; } namedthing.prototype = { getname: function() { return this.name; }, setname: function(newname) { this.na...
... // example base class 1 function namedthing(name) { this.name = name; } namedthing.prototype = { getname: function() { return this.name; }, setname: function(newname) { this.name = newname;...
Sharp variables in JavaScript - Archive of obsolete content
warning: sharp variables was a non-standard syntax for creating or serializing cyclic data graphs that used to be supported only by mozilla's spidermonkey js engine. this feature has been removed in bug 566700, firefox 12. form sharp variables have the form of a sharp sign (#) immediately followed by one or more digits. the number represented by the digits serves as the variable's unique identifier, but leading 0s are ignored. scope sharp variables are only in scope in the statement in which they are defined. ...
... to sharp variables. make sure you don't put in any spaces before the equal sign though. #1 = {}; // this doesn't do much since the sharp variable is out of scope immediately after a = #2 = {}; // slightly more useful since we retain a reference to the new object to reference the sharp variable, simply append another sharp (#) to the end of the variable name. this acts as a reference to
initial variable. you can use this to create objects in a single line of code that would otherwise take multiple lines of code. examples multiple references var a = { foo:#1=[], bar:#1# }; a.foo.push("hello"); a.bar.push("there!"); alert(a.foo[1]); // "there!" you can avoid using sharp variables by breaking the declaration up into multiple lines. var a = { foo:[], bar:undefined }; a.bar ...
Reference - Archive of obsolete content
ction myotherclass(){ myclass.apply( this ); } var o = new myotherclass; alert( o.tellme() ); //alerts 5 as you'd expect — the preceding comment was added by psygnisfive (talk – contribs) on 22:23, 4 december 2006 terminology we need a terminology appendix. for example, "script" and "program" are synonymous. so are "current object" and "context object". we could also put in layman def
initions there for js constructs like functions and variables. --maian 01:43, 30 september 2005 (pdt) we should define the terms we are using. in particular this means we should define activation object somewhere (and link to it whenever we mention it). --nickolay 18:40, 16 july 2006 (pdt) js 1.2 and gecko 1.8 per the fix for bug 255895, "javascript1.2" values for the script's language attribute no...
...le, as a constructor function is an instance of the function object, which happens to be an instance of object; therefore, array is also an instance of object. this makes sense. the confusion sets in when you consider that object is also a constructor function, therefore an instance of function, and, furthermore, an instance of object; this is where the recursion is introduced, and why you can inf
initely do function.constructor; //function function.constructor.constructor; //function . . . function.constructor.constructor.constructor.constructor.constructor . . . ; //function note that math is not a constructor function, but merely a global object with methods and properties useful to perform va...
Fixing Table Inheritance in Quirks Mode - Archive of obsolete content
ng legacy behavior to avoid "breaking" older pages that were authored with old-browser behaviors in mind, mozilla and related browsers will mimic old browsers when in "quirks" mode. to do this, the gecko rendering engine uses the following rule in the quirk.css user agent file: /* quirk: cut off all font inheritance in tables and captions except for family. */ table, caption { font-size: -moz-
initial; font-weight: -moz-
initial; font-style: -moz-
initial; font-variant: -moz-
initial; } this rule sets all aspects of a table's font, except for the font family, to match the user's preferences setting, thus emulating the behavior of old browsers. this only happens when gecko is in "quirks" mode; in "standards" mode, all styles are inherited by tables as permitted by the css specification. ...
...avior of old browsers. this only happens when gecko is in "quirks" mode; in "standards" mode, all styles are inherited by tables as permitted by the css specification. in those cases where it is necessary to author documents in "quirks" mode, but the breaking of table inheritance is not desired, authors can use gecko's standards support to overcome the table-font rule shown above. the value -moz-
initial is a proprietary value used to apply the user's (or browser's) default setting for a given property to an element. because it is not actually part of css, it is marked with the prefix -moz- in order to avoid confusion about what is or isn't part of css. overcoming legacy behavior all that is needed is a rule that overrides the -moz-
initial values with the css2 value inherit. this value is us...
Using the Right Markup to Invoke Plugins - Archive of obsolete content
browser such as netscape 7 doesn't have jre 1.4.1_01 installed, the alternate text is displayed. it isn't always necessary to give such a version specific mime type. if you aren't taking advantage of any version specific features, a more generic mime type such as application/x-java-vm will do the job just as well. the configuration parameters for the applet, including the class which contains the
initial entry point (animator.class, referenced by the "code" param element), are specified in multiple param elements. mozilla-based browsers such as netscape 7 also allow for a special classid attribute that can also be used. this is the special "java:" classid. here is an example using this invocation method: <object classid="java:nervoustext.class" width="534" height="50"> <param name="text" va...
...002 copyright information: copyright © 2001-2003 netscape. all rights reserved. ...
Windows Media in Netscape - Archive of obsolete content
he clsids of windows media player 6x and later. it is important to note that in netscape 7.1, only the classid for windows media player is supported, and no other control can be created. the various param elements that can be used and the functionalities behind them is best described by the windows media 9 series sdk. in netscape 7.1, the codebase attribute of the object element cannot be used to
initiate a digitally signed download of the windows media control, if it is not present on the machine. the section below on scripting the control covers more on how to detect if the windows media player has not been successfully created. scripting the windows media player control the number of methods and properties that are exposed by the windows media player, including the events that the player t...
... page containing the control, are covered in detail by the windows media player sdk. this section covers relevant issues concerning the invocation of methods and properties from within web pages that are embedding the windows media control. detecting successful creation of the control often, usage of activex controls in ie involve the use of the object element along with a codebase attribute that
initiates a download of the component if it is missing from the machine running the web page. the windows media 9 series sdk doesn't provide a url to use with the codebase attribute for retrieval of the component in ie, and on netscape 7.1 the codebase attribute isn't supported for such retrieval. therefore detecting whether the component was successfully instantiated can help provide users with the r...
Obsolete: XPCOM-based scripting for NPAPI plugins - Archive of obsolete content
in npapi.h as: nppvpluginscriptableinstance = 10, nppvpluginscriptableiid = 11 and two analogous additions to nsplugininstancevariable type in nsplugindefs.h as: nsplugininstancevariable_scriptableinstance = 10, nsplugininstancevariable_scriptableiid = 11 what's in the plugin code? a unique interface id should be obtained. windows command uuidgen should be sufficient. an interface def
inition (.idl) file describing the plugin scriptable interface should be added to the project (see example 1). a scriptable instance object should be implemented in the plugin. this class will contain native methods callable from javascript. this class should also inherit from nsiclassinfo and implement its methods to be able to request all necessary privileges from the mozilla security manager (see e...
...ns_impl_isupports2(nsscriptablepeer, nsitestplugin, nsiclassinfo) // the following method will be callable from javascript ns_imethodimp nsscriptablepeer::nativemethod() { return ns_ok; } example 3. npp_getvalue implementation and possible scenario of scriptable object li...
XQuery - Archive of obsolete content
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 def
initions, xml-inclusion, etc. while xquery is currently not supported in firefox (whether through javascript to developers or to browser users), at least one extension has been developed to give a preliminary support for xquery for browser users (and serving as a simple model for how xquery can be implemented within extensions). xquseme is a working proof-of-concept (so far tested on windows and linux with java installed; mac does not work) extension which allows one...
... includes and interfaces with the open-source version of saxonica's saxon b (though this extension currently only performs the xqueries). other popular native xml databases might also be supported (e.g., exist) in the future, especially now that the extension has added some basic support for the open-standard (xqj) for java and exist is in the midst of getting such an api. berkeley db xml was the
initial choice by the extension developer for its support across many languages (c++, java, python, perl, php, etc.) (besides its also being open source), but now some problems may exist with bdbxml (unlike saxon). a simple usage example is available. notes for developers wishing to access xquery in their own extensions at present, the extension works simply by using liveconnect to work with berkel...
Anatomy of a video game - Game development
urely cosmetic for fast devices). it draws the scene. * * update() calculates the game state as of a given point in time. it should always * increment 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.) * * set
initialstate() performs whatever tasks are leftover before the mainloop must run. * it is just a generic example function that you might have added. */ ;(function () { function main( tframe ) { mygame.stopmain = window.requestanimationframe( main ); var nexttick = mygame.lasttick + mygame.ticklength; var numticks = 0; // if tframe < nexttick then 0 ticks need to b...
...ates( numticks ) { for(var i=0; i < numticks; i++) { mygame.lasttick = mygame.lasttick + mygame.ticklength; // now lasttick is this tick. update( mygame.lasttick ); } } mygame.lasttick = performance.now(); mygame.lastrender = mygame.lasttick; // pretend the first draw was on first update. mygame.ticklength = 50; // this sets your simulation to run at 20hz (50ms) set
initialstate(); main(performance.now()); // start the cycle })(); another alternative is to simply do certain things less often. if a portion of your update loop is difficult to compute but insensitive to time, you might consider scaling back its frequency and, ideally, spreading it out into chunks throughout that lengthened period. an implicit example of this is found over at the artillery blog fo...
Game promotion - Game development
e organizers and other attendees. you'll be rich and famous, or so they say. many great games get started as a quick, sloppy demo submitted to a competition. if both the idea and the execution are good enough, you will succeed. plus competitions 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 def
initely 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, requirements, 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 ...
...away, and be polite when talking to them. be sure to check first if they are dealing with specific genres of games or platforms, so you don't send them something that is not relevant to them in the first place. if you're honest with your approach and your game is good, then you've got more of a chance of success. if you want to learn more about the etiquette of contacting the press you should def
initely check out how to contact press - a great guide from pixel prospector, and the video game journaliser site curated by them for the list of sites to contact. tutorials it's good to share your knowledge with other devs — after all you probably learned a thing or two from online articles, so you take the time to pay that knowledge forward. talking or writing about something you achieved or pro...
2D collision detection - Game development
// collision detected! } // filling in the values => if (5 < 30 && 55 > 20 && 5 < 20 && 55 > 10) { // collision detected! } rect code <div id="cr-stage"></div> <p>move the rectangle with arrow keys. ...
...tween the centre points are less than the two radii added together. playable code <div id="cr-stage"></div> <p>move the circle with arrow keys. ...
Mobile touch controls - Game development
in this tutorial, we will see how easy it is to implement mobile controls in an html5 game, and enjoy playing on a mobile touch-enabled device. note: the game captain rogers: battle at andromeda is built with phaser and managing the controls is phaser-based, but it could also be done in pure javascript. ...
... leave the ondragstart() function empty, or place some debug output to see if it's working correctly. the pointer element contains the x and y variables storing the current position of the dragged element. dedicated plugins you could go even further and use dedicated plugins like virtual joystick — this is a paid, official phaser plugin, but you can find free and open source alternatives. the
initialization of virtual joystick looks like this: this.pad = this.game.plugins.add(phaser.virtualjoystick); this.stick = this.pad.addstick(30, 30, 80, 'generic'); in the create() function of the game state we're creating a virtual pad and a generic stick that has four directional virtual buttons by default. this is placed 30 pixels from the top and left edges of the screen and is 80 pixels wide. ...
Collision detection - Game development
bricks disappear after they are hit the above code will work as desired and the ball changes its direction. the problem is that the bricks are staying where they are. we have to figure out a way to get rid of the ones we've already hit with the ball. we can do that by adding an extra parameter to indicate whether we want to paint each brick on the screen or not. in the part of the code where we
initialize the bricks, let's add a status property to each brick object. update the following part of the code as indicated by the highlighted line: var bricks = []; for(var c=0; c<brickcolumncount; c++) { bricks[c] = []; for(var r=0; r<brickrowcount; r++) { bricks[c][r] = { x: 0, y: 0, status: 1 }; } } next we'll check the value of each brick's status property in the drawbricks(...
...ll to the collisiondetection() function to our main draw() function. add the following line to the draw() function, just below the drawpaddle() call: collisiondetection(); compare your code the collision detection of the ball is now checked on every frame, with every brick. now we can destroy bricks! :- exercise: change the color of the ball when it hits the brick. next steps we are def
initely getting there now; let's move on! in the eighth chapter we will be looking at how to track the score and win. « previousnext » ...
Move the ball - Game development
over and over again using a javascript timing function such as setinterval() or requestanimationframe(). delete all the javascript you currently have inside your html file except for the first two lines, and add the following below them. the draw() function will be executed within setinterval every 10 miliseconds: function draw() { // drawing code } setinterval(draw, 10); thanks to the inf
inite nature of setinterval the draw() function will be called every 10 milliseconds forever, or until we stop it. now, let's draw the ball — add the following inside your draw() function: ctx.beginpath(); ctx.arc(50, 50, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); try your updated code now — the ball should be repainted on every frame. making it move you won't ...
...(); ctx.arc(x, y, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(); } now comes the important part: we want to add a small value to x and y after every frame has been drawn to make it appear that the ball is moving. let's define these small values as dx and dy and set their values to 2 and -2 respectively. add the following below your x and y variable def
initions: var dx = 2; var dy = -2; the last thing to do is to update x and y with our dx and dy variable on every frame, so the ball will be painted in the new position on every update. add the following two new lines indicated below to your draw() function: function draw() { ctx.beginpath(); ctx.arc(x, y, 10, 0, math.pi*2); ctx.fillstyle = "#0095dd"; ctx.fill(); ctx.closepath(...
Paddle and keyboard controls - Game development
it's not a game if you cannot control it! so let's add some user interaction: a controllable paddle. defining a paddle to hit the ball so, we need a paddle to hit the ball. ...
...g information on whether the left or right control button is pressed. two event listeners for keydown and keyup events. we want to run some code to handle the paddle movement when the buttons are pressed. two functions handling the keydown and keyup events the code that will be run when the buttons are pressed. the ability to move the paddle left and right pressed buttons can be defined and
initialized with boolean variables like in the example. add these lines somewhere near the rest of your variables: var rightpressed = false; var leftpressed = false; the default value for both is false because at the beginning the control buttons are not pressed. to listen for key presses, we will set up two event listeners. add the following lines just above the setinterval() line at the bottom of ...
Buttons - Game development
t-kit/demos/lesson15.html. instead of starting the game right away we can leave that decision to the player by adding a start button they can press. let's investigate how to do that. new variables we will need a variable to store a boolean value representing whether the game is currently being played or not, and another one to represent our button. add these lines below your other variable def
initions: var playing = false; var startbutton; loading the button spritesheet we can load the button spritesheet the same way we loaded the ball's wobble animation. add the following to the bottom of the preload() function: game.load.spritesheet('button', 'img/button.png', 120, 40); a single button frame is 120 pixels wide and 40 pixels high. you also need to grab the button spritesheet from ...
...vents. note: the over event is the same as hover, out is when the pointer moves out of the button and down is when the button is pressed. now we need to define the startgame() function referenced in the code above: function startgame() { startbutton.destroy(); ball.body.velocity.set(150, -150); playing = true; } when the button is pressed, we remove the button, sets the ball's
initial velocity and set the playing variable to true. finally for this section, go back into your create() function, find the ball.body.velocity.set(150, -150); line, and remove it. you only want the ball to move when the button is pressed, not before! keeping the paddle still before the game starts it works as expected, but we can still move the paddle when the game hasn't started yet, which look...
2D breakout game using Phaser - Game development
and winning and losing states. to get the most out of this series of articles you should already have basic to intermediate javascript knowledge. after working through this tutorial, you should be able to build your own simple web games with phaser. ...
... next » ...
Visual typescript game engine - Game development
ng is disabled by default. find configuration at ./src/lib/client-config.ts /** * addson * all addson are ansync loaded scripts. * - cache is based on webworkers. * - hackertimer is for better performace also based on webworkers. * - dragging is script for dragging dom elements. */ private addson: addson = [ { name: "cache", enabled: true, scriptpath: "externals/cache
init.ts", }, { name: "hackertimer", enabled: true, scriptpath: "externals/hack-timer.js", }, { name: "dragging", enabled: true, scriptpath: "externals/drag.ts", }, ]; /** * @description this is main coordinary types of positions * can be "diametric-fullscreen" or "frame". * @property drawreference * @type string */ private ...
...-dbpath ./server/database/data fix: "failed: address already in use" : netstat -ano | findstr :27017 taskkill /pid typeyourpidhere /f also important "run visual studio code as administrator". - a command for killing all node.js process for window users : taskkill /im node.exe /f networking multimedia communication: websocketserver running on node.js text-based protocol sip (session
initiation protocol) used for signalling and controlling multimedia sessions. general networking config: config property defined in constructor from serverconfig class. this.networkdeeplogs = false; this.rtcserverport = 12034; this.rtc3serverport = 12034; this.connectorport = 1234; this.domain = "192.168.0.14"; this.masterserverkey = "multi-platformer-sever1.maximum"; th...
CSS values and units - Learn web development
a() and rgb(), and hsl() and hsla() (see below), became pure aliases of each other and started to behave exactly the same. so for example both rgba() and rgb() accept colors with and without alpha channel values. try changing the above example's rgba() functions to rgb() and see if the colors still work! which style you use is up to you, but separating out non-transparent and transparent color def
initions to use the different functions gives (very) slightly better browser support and can act as a visual indicator of where transparent colors are being defined in your code. hsl and hsla values slightly less well-supported than rgb is the hsl color model (not supported on old versions of ie), which was implemented after much interest from designers. instead of red, green, and blue values, the ...
...nd units. summary this has been a quick run through of the most common types of values and units you might encounter. you can have a look at all of the different types on the css values and units reference page; you will encounter many of these in use as you work through these lessons. the key thing to remember is that each property has a defined list of allowed values, and each value has a def
inition explaining what the sub-values are. you can then look up the specifics here on mdn. for example, understanding that <image> also allows you to create a color gradient is useful but perhaps non-obvious knowledge to have! previous overview: building blocks next in this module cascade and inheritance css selectors type, class, and id selectors attribute selectors pseudo...
Grids - Learn web development
</div> <div>seven</div> </div> .container { display: grid; grid-template-columns: 200px 200px 200px; } flexible grids with the fr unit in addition to creating grids using lengths and percentages, we can use the fr unit to flexibly size grid rows and columns. this unit represents one fraction of the available space in the grid container. ...
...n of the available space in the grid container. change your track listing to the following def
inition, creating three 1fr tracks. .container { display: grid; grid-template-columns: 1fr 1fr 1fr; } you should now see that you have flexible tracks. the fr unit distributes space in proportion, therefore you can give different positive values to your tracks, for example if you change the def
inition like so: .container { display: grid; grid-template-columns: 2fr 1fr 1fr; } the first track now gets 2fr of the available space and the other two tracks get 1fr, making the first track larger. you can mix fr units and fixed length tracks — in such a case the space needed for the fixed tracks is taken away before the space is distributed to the other tracks. simple grid example wi...
Beginner's guide to media queries - Learn web development
hs you can see how the design responds and works as a single column, two columns, or three columns, depending on the available width. this is a very simple example of a mobile first responsive design. the viewport meta tag if you look at the html source in the above example, you'll see the following element included in the head of the document: <meta name="viewport" content="width=device-width,
initial-scale=1"> this is the viewport meta tag — it exists as a way control how mobile browsers render content. this is needed because by default, most mobile browsers lie about their viewport width. non-responsive sites commonly look really bad when rendered in a narrow viewport, so mobile browsers usually render the site with a viewport width wider than the real device width by default (usually ...
...t 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 meta tag — see using the viewport meta tag to control layout on mobile browsers for more details. do you really need a media query? flexbox, grid, and multi-column layout all give you ways to create flexible and ...
Supporting older browsers - Learn web development
the site more accessible, thus serving far more users. there is a middle ground between a plain html page and all the bells and whistles, and css has actually made creating these fallbacks pretty straightforward. creating fallbacks in css css specifications contain information that explains what the browser does when two layout methods are applied to the same item. this means that there is a def
inition for what happens if a floated item, for example, is also a grid item using css grid layout. couple this information with the knowledge that browsers ignore css that they don’t understand, and you have a way to create simple layouts using the legacy techniques we have already covered, which are then overwritten by your grid layout in modern browsers that understand it. in the below example, ...
...ion. at the time of writing, this is mostly an issue with internet explorer 10, which uses the -ms- prefix for flexbox. this also means that there are some outdated articles and tutorials in existence; this useful guide helps you check what you are looking at and can also help if you need flex support in very old browsers. the ie10 and 11 prefixed version of grid the css grid specification was
initially prototyped in internet explorer 10; this means that while ie10 and ie11 do not have modern grid support, they do have a version of grid layout that is very usable, although different to the modern specification documented on this site. the ie10 and 11 implementations is -ms- prefixed, which means you can use it for these browsers and it will be ignored by non-microsoft browsers. edge does s...
Fundamental text and font styling - Learn web development
nts are known to be available on nearly all instances of the most used operating systems (windows, macos, the most common linux distributions, android, and ios). the list of actual web safe fonts will change as operating systems evolve, but it's reasonable to consider the following fonts web safe, at least for now (many of them have been popularized thanks to the microsoft core fonts for the web
initiative in the late 90s and early 2000s): name generic type notes arial sans-serif it's often considered best practice to also add helvetica as a preferred alternative to arial as, although their font faces are almost identical, helvetica is considered to have a nicer shape, even if arial is more broadly available. courier new monospace some oses ha...
...sents a worst case scenario where the browser will try to do its best to provide at least a font that looks appropriate. serif, sans-serif and monospace are quite predictable and should provide something reasonable. on the other hand, cursive and fantasy are less predictable and we recommend using them very carefully, testing as you go. the five names are defined as follows: term def
inition example serif fonts that have serifs (the flourishes and other small details you see at the ends of the strokes in some typefaces) my big red elephant sans-serif fonts that don't have serifs. my big red elephant monospace fonts where every character has the same width, typically used in code listings. my big red elephant cursive f...
How do I use GitHub Pages? - Learn web development
once you've signed up, log in to github.com with your username and password. preparing your code for upload you can store any code you like in a github repository, but to use the github pages feature to full effect, your code should be structured as a typical website, e.g. with the primary entry point being an html file called index.html. the other thing you need to do before moving on is to
initialise your code directory as a git repository. to do this: point the command line to your test-site directory (or whatever you called the directory containing your website). for this, use the cd command (i.e. "change directory"). here's what you'd type if you've put your website in a directory called test-site on your desktop: cd desktop/test-site when the command line is pointing inside...
...u called the directory containing your website). for this, use the cd command (i.e. "change directory"). here's what you'd type if you've put your website in a directory called test-site on your desktop: cd desktop/test-site when the command line is pointing inside your website directory, type the following command, which tells the git tool to turn the directory into a git repository: git
init an aside on command line interfaces the best way to upload your code to github is via the command line — this is a window where you type in commands to do things like create files and run programs, rather than clicking inside a user interface. it will look something like this: note: you could also consider using a git graphical user interface to do the same work, if you feel uncomforta...
Client-side form validation - Learn web development
arious form controls. 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. objective: to understand what client-side form validation is, why it's important, and how to apply various techniques to implement it. client-side validation is an
initial check and an important feature of good user experience; by catching invalid data on the client-side, the user can fix it straight away. if it gets to the server and is then rejected, a noticeable delay is caused by a round trip to the server and then back to the client-side to tell the user to fix their data. however, client-side validation should not be considered an exhaustive security meas...
...0.3em; } the big changes are in the javascript code, which needs to do much more heavy lifting. // there are fewer ways to pick a dom node with legacy browsers const form = document.getelementsbytagname('form')[0]; const email = document.getelementbyid('mail'); // the following is a trick to reach the next sibling element node in the dom // this is dangerous because you can easily build an inf
inite loop. // in modern browsers, you should prefer using element.nextelementsibling let error = email; while ((error = error.nextsibling).nodetype != 1); // as per the html5 specification const emailregexp = /^[a-za-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-za-z0-9-]+(?:\.[a-za-z0-9-]+)*$/; // many legacy browsers do not support the addeventlistener method. // here is a simple way to handle this; it's far fro...
Publishing your website - Learn web development
ain name you want is available. your home or office internet service provider may provide some limited hosting for a small website. the available feature set will be limited, but it might be perfect for your first experiments. there are also free services available like neocities, blogger, and wordpress. sometimes you get what you pay for, but sometimes these resources are good enough for your
initial experiments. many companies provide hosting and domains. using an online tool like github or google app engine some tools let you publish your website online: github is a "social coding" site. it allows you to upload code repositories for storage in the git version control system. you can then collaborate on code projects, and the system is open-source by default, meaning that anyone in...
...n publishing via github now let's examine how to easily publish your site via github pages. first of all, sign up for github and verify your email address. next, you need to create a repository to store files. on this page, in the repository name box, enter username.github.io, where username is your username. for example, our friend bob smith would enter bobsmith.github.io. check the "
initialize this repository with a readme" box. then click create repository. drag and drop the content of your website folder into your repository. then click commit changes. note: make sure your folder has an index.html file. navigate your browser to username.github.io to see your website online. for example, for the username chrisdavidmills, go to chrisdavidmills.github.io. ...
Document and website structure - Learn web development
g 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 is the one part of the website that def
initely will vary from page to page! sidebar: some peripheral info, links, quotes, ads, etc. usually, this is contextual to what is contained in the main content (for example on a news article page, the sidebar might contain the author's bio, or links to related articles) but there are also cases where you'll find some recurring elements like a secondary navigation system. footer: a strip across t...
... this until you start to study css layout as part of the css topic. html layout elements in more detail it's good to understand the overall meaning of all the html sectioning elements in detail — this is something you'll work on gradually as you start to get more experience with web development. you can find a lot of detail by reading our html element reference. for now, these are the main def
initions that you should try to understand: <main> is for content unique to this page. use <main> only once per page, and put it directly inside <body>. ideally this shouldn't be nested within other elements. <article> encloses a block of related content that makes sense on its own without the rest of the page (e.g., a single blog post). <section> is similar to <article>, but it is more for group...
Getting started with HTML - Learn web development
ine element. as you see below, the first three elements sit on the same line, with no space in between. on the other hand, <p> is a block-level element. each p element appears on a new line, with space above and below. (the spacing is due to default css styling that the browser applies to paragraphs.) note: html5 redefined the element categories: see element content categories. while these def
initions are more accurate and less ambiguous than their predecessors, the new def
initions are a lot more complicated to understand than block and inline. this article will stay with these two terms. note: the terms block and inline, as used in this article, should not be confused with the types of css boxes that have the same names. while the names correlate by default, changing the css display ty...
...n: copy the html page example listed above. create a new file in your text editor. paste the code into the new text file. save the file as index.html. note: you can also find this basic html template on the mdn learning area github repo. you can now open this file in a web browser to see what the rendered code looks like. edit the code and refresh the browser to see what the result is.
initially the page looks like this: in this exercise, you can edit the code locally on your computer, as described previously, or you can edit it in the sample window below (the editable sample window represents just the contents of the <body> element, in this case). sharpen your skills by implementing the following tasks: just below the opening tag of the <body> element, add a main title for the ...
HTML text fundamentals - Learn web development
r time for a different flavour, you could try blending in a small measure of lemon and coriander, chili pepper, lime and chipotle, harissa and mint, or spinach and feta cheese. experiment and see what works for you. storage refrigerate the finished hummus in a sealed container. you should be able to use it for about a week after you've made it. if it starts to become fizzy, you should def
initely discard it. hummus is suitable for freezing; you should thaw it and use it within a couple of months.</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.7rem...
...ifferent flavour, you could try blending in a small measure of lemon and coriander, chili pepper, lime and chipotle, harissa and mint, or spinach and feta cheese. experiment and see what works for you.</p>\n\n<h2>storage</h2>\n\n<p>refrigerate the finished hummus in a sealed container. you should be able to use it for about a week after you\'ve made it. ...
Adding vector graphics to the Web - Learn web development
er images, and vector images: raster images are defined using a grid of pixels — a raster image file contains information showing exactly where each pixel is to be placed, and exactly what color it should be. popular web raster formats include bitmap (.bmp), png (.png), jpeg (.jpg), and gif (.gif.) vector images are defined using algorithms — a vector image file contains shape and path def
initions that the computer can use to work out what the image should look like when rendered on the screen. the svg format allows us to create powerful vector graphics for use on the web. to give you an idea of the difference between the two, let's look at an example. you can find this example live on our github repo as vector-versus-raster.html — it shows two seemingly identical images side by si...
... svg with an <iframe> you can open svg images in your browser just like webpages. so embedding an svg document with an <iframe> is done just like we studied in from <object> to <iframe> — other embedding technologies. here's a quick review: <iframe src="triangle.svg" width="500" height="500" sandbox> <img src="triangle.png" alt="triangle with three unequal sides" /> </iframe> this is def
initely not the best method to choose: cons iframes do have a fallback mechanism, as you can see, but browsers only display the fallback if they lack support for iframes altogether. moreover, unless the svg and your current webpage have the same origin, you cannot use javascript on your main webpage to manipulate the svg. active learning: playing with svg in this active learning section we'd l...
HTML table advanced features and accessibility - Learn web development
local copy of our timetable-fixed.html file. add a suitable caption for the table. save your code and open it in a browser to see what it looks like. note: you can find our version on github — see timetable-caption.html (see it live also). adding structure with <thead>, <tfoot>, and <tbody> as your tables get a bit more complex in structure, it is useful to give them more structural def
inition. one clear way to do this is by using <thead>, <tfoot>, and <tbody>, which allow you to mark up a header, footer, and body section for the table. these elements don't make the table any more accessible to screenreader users, and don't result in any visual enhancement on their own. they are however very useful for styling and layout — acting as useful hooks for adding css to your table. to g...
...s to use id and headers attributes to create associations between headers and cells. the way they are used is as follows: you add a unique id to each <th> element. you add a headers attribute to each <td> element. each headers attribute has to contain a list of the ids of all the <th> elements that act as a header for that cell, separated by spaces. this gives your html table an explicit def
inition of the position of each cell in the table, defined by the header(s) for each column and row it is part of, kind of like a spreadsheet. for it to work well, the table really needs both column and row headers. returning to our spending costs example, the previous two snippets could be rewritten like this: <thead> <tr> <th id="purchase">purchase</th> <th id="location">location</th> ...
Graceful asynchronous programming with Promises - Learn web development
ee.jpg'); this calls the fetch() method, passing it the url of the image to fetch from the network as a parameter. this can also take an options object as an optional second parameter, but we are just using the simplest version for now. we are storing the promise object returned by fetch() inside a variable called promise. as we said before, this object represents an intermediate state that is
initially neither success nor failure — the official term for a promise in this state is pending. to respond to the successful completion of the operation whenever that occurs (in this case, when a response is returned), we invoke the .then() method of the promise object. the callback inside the .then() block (referred to as the executor) runs only when the promise call completes successfully ...
...he reject() method — just like resolve(), this takes a single value, but in this case, it is the reason to reject with, i.e., the error that will be passed into the .catch() block. let's extend the previous example to have some reject() conditions as well as allowing different messages to be passed upon success. ...
Build your own function - Learn web development
ass="msgbox"> <p>this is a message box</p> <button>x</button> </div> that was a lot of code to work through — don't worry too much if you don't remember exactly how every bit of it works right now! the main part we want to focus on here is the function's structure and usage, but we wanted to show something interesting for this example. calling the function you've now got your function def
inition written into your <script> element just fine, but it will do nothing as it stands. try including the following line below your function to call it: displaymessage(); this line invokes the function, making it run immediately. when you save your code and reload it in the browser, you'll see the little message box appear immediately, only once. we are only calling it once, after all. n...
...trying to delete their profile ("are you sure about this?"), or the user adding a new contact and the operation completing successfully, etc. in this demo, we'll get the message box to appear when the user clicks the button. delete the previous line you added. next, we'll select the button and store a reference to it in a constant. add the following line to your code, above the function def
inition: const btn = document.queryselector('button'); finally, add the following line below the previous one: btn.onclick = displaymessage; in a similar way to our closebtn.onclick... line inside the function, here we are calling some code in response to a button being clicked. but in this case, instead of calling an anonymous function containing some code, we are calling our function name d...
Fetching data from the server - Learn web development
he data displays correctly in the ui, etc. we won't discuss all of it in the article, but you can find extensive comments in the code (see can-script.js). we will however explain the fetch code. the first block that uses fetch can be found at the start of the javascript: fetch('products.json').then(function(response) { return response.json(); }).then(function(json) { let products = json;
initialize(products); }).catch(function(err) { console.log('fetch problem: ' + err.message); }); the fetch() function returns a promise. if this completes successfully, the function inside the first .then() block contains the response returned from the network. inside this function we run json() on the response, not text(), as we want to return our response as structured json data, not plain text.
...ntains the response returned from the network. inside this function we run json() on the response, not text(), as we want to return our response as structured json data, not plain text. next, we chain another .then() onto the end of our first one, the success function that contains the json returned from the response.json() promise. we set this to be the value of the products variable, then run
initialize(products), which starts the process of displaying all the products in the user interface. to handle errors, we chain a .catch() block onto the end of the chain. this runs 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 ...
Third-party APIs - Learn web development
search api" to the on position, and then click "create"). get the api key from the resulting page. now, to start the example off, make copies of nytimes_start.html and nytimes.css in a new directory on your computer. if you've already cloned the examples repository, you'll already have a copy of these files, which you can find in the javascript/apis/third-party-apis/nytimes directory.
initially the <script> element contains a number of variables needed for the setup of the example; below we'll fill in the required functionality. the app will end up allowing you to type in a search term and optional start and end dates, which it will then use to query the article search api and display the search results. connect the api to your app first, you'll need to make a connection be...
...g api key with the actual api key you got in the previous section. add the following line to your javascript, below the "// event listeners to control the functionality" comment. this runs a function called submitsearch() when the form is submitted (the button is pressed). ...
A first splash into JavaScript - Learn web development
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, looking at how we can turn these steps into code, building up the example, and exploring javascript features as we go.
initial setup to begin this tutorial, we'd like you to make a local copy of the number-guessing-game-start.html file (see it live here). open it in both your text editor and your web browser. at the moment you'll see a simple heading, paragraph of instructions and form for entering a guess, but the form won't currently do anything. the place where we'll be adding all our code is inside the <script> ...
... } guesscount++; guessfield.value = ''; guessfield.focus(); } this is a lot of code — phew! let's go through each section and explain what it does. the first line (line 2 above) declares a variable called userguess and sets its value to the current value entered inside the text field. we also run this value through the built-in number() constructor, just to make sure the value is def
initely a number. next, we encounter our first conditional code block (lines 3–5 above). a conditional code block allows you to run code selectively, depending on whether a certain condition is true or not. it looks a bit like a function, but it isn't. the simplest form of conditional block starts with the keyword if, then some parentheses, then some curly braces. inside the parentheses we include ...
Solve common problems in your JavaScript code - Learn web development
n you assign something normally in javascript, you use a single equals sign, e.g.: const mynumber = 0; with objects, however, you need to take care to use the correct syntax. the object must be surrounded by curly braces, member names must be separated from their values using colons, and members must be separated by commas. ...
...ons what is javascript? what is a variable? what are strings? what is an array? what is a loop? what is a function? what is an event? what is an object? what is json? what is a web api? what is the dom? basic use cases general how do you add javascript to your page? how do you add comments to javascript code? variables how do you declare a variable? how do you
initialize a variable with a value? how do you update a variable's value? (also see assignment operators) what data types can values have in javascript? what does 'loosely typed' mean? math what types of number do you have to deal with in web development? how do you do basic math in javascript? what is operator precedence, and how is it handled in javascript? how do you increment and decrem...
Working with JSON - Learn web development
er> with the correct data, while the second one creates an information card for each hero on the team, and inserts it into the <section>. ...
...nt fires when the response has successfully returned; doing it this way guarantees that request.response will def
initely be available when we come to try to do something with it. populating the header now that we've retrieved the json data and converted it into a javascript object, let's make use of it by writing the two functions we referenced above. ...
Object building practice - Learn web development
e canvas element (represented by the canvas.width and canvas.height properties) to equal the width and height of the browser viewport (the area that the webpage appears on — this can be gotten from the window.innerwidth and window.innerheight properties). note that we are chaining multiple assignments together, to get the variables all set quicker — this is perfectly ok. the last bit of the
initial script looks as follows: function random(min, max) { const num = math.floor(math.random() * (max - min + 1)) + min; return num; } this function takes two numbers as arguments, and returns a random number in the range between the two. modeling a ball in our program our program will feature lots of balls bouncing around the screen. since these balls will all behave in the same way, it ma...
...lowing line to the bottom of your code — we need to call the function once to get the animation started. loop(); that's it for the basics — try saving and refreshing to test your bouncing balls out! adding collision detection now for a bit of fun, let's add some collision detection to our program, so our balls know when they have hit another ball. first, add the following method def
inition below where you defined the update() method (i.e., the ball.prototype.update block). ball.prototype.collisiondetect = function() { for (let j = 0; j < balls.length; j++) { if (!(this === balls[j])) { const dx = this.x - balls[j].x; const dy = this.y - balls[j].y; const distance = math.sqrt(dx * dx + dy * dy); if (distance < this.size + balls[j].size) { ...
Aprender y obtener ayuda - Learn web development
out-perform facebook, in two years. what do you need to get there? once you've worked out your goal, it is a good idea to research what you'll need to achieve the goal. for example: materials i need: a computer internet access pens and paper knowledge i need: how to use html, css, javascript, and associated tools and best practices to build web sites and web applications (we can def
initely help you with this one!). how to get a domain, hosting, and use them to put a web site or application online. how to run a small business. how to advertise my business and attract clients. how much time and money will it take? estimate the time and cost of getting these things. if you'll need to work to earn money to buy the materials required, then the time to do that will have to be fa...
...ntally 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 just got to go through and solve them all! learn and recognise the patterns as we said before, web design/programming is mostly about problem solving and patterns. once you have written out what you'll need to do to solve a specific problem, you can start to figure out what technology features to use to solve it. for example, professional web developers have created lots of hor...
Getting started with Ember - Learn web 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. ...
...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: prember: 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 prember. ember-service-worker: configuring a pwa so that the app can be installed on mobile devices, just like apps from the device's respective app-store. native mobile apps ember can also be used with native mobile apps with a native-mobile bridge to ...
Ember interactivity: Events, classes and state - Learn web development
we know that we want to track both the text of a todo, and whether or not it is is completed. add the following import statement below the existing one: import { tracked } from '@glimmer/tracking'...
... below the previous line you added: class todo { @tracked text = ''; @tracked iscompleted = false; constructor(text) { this.text = text; } } this class represents a todo — it contains a @tracked text property containing the text of the todo, and a @tracked iscompleted property that specifies whether the todo has been completed or not. when instantiated, a todo object will have an
initial text value equal to the text given to it when created (see below), and an iscompleted value of false. the only ember-specific part of this class is the @tracked decorator — this hooks in to the reactivity system and allows ember to update what you're seeing in your app automatically if the tracked properties change. more information on tracked can be found here. now it's time to add to the ...
Framework main features - Learn web development
can be used to affect how a component is rendered. as an example, consider a button that counts how many times it has been clicked. this component should be responsible for tracking its own count state, and could be written like this: function counterbutton() { const [count] = usestate(0); return ( <button>clicked {count} times</button> ); } usestate() is a react hook which, given an
initial data value, will keep track of that value as it is updated. the code will be
initially rendered like so in the browser: <button>clicked 0 times</button> the usestate() call keeps track of the count value in a robust way across the app, without you needing to write code to do that yourself. events in order to be interactive, components need ways to respond to browser events, so our applicat...
... of react testing library — it tests a number of things, such as the button's existance, and whether the button is displaying the correct text after being clicked 0, 1, and 2 times: import react from "react"; import { 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("increments the count when clicked", () => { const { getbyrole } = render(<counterbutton />); const btn = getbyrole("button"); fireevent.click(btn); expect(btn).tohavetextcontent("clic...
Componentizing our React app - Learn web development
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. let's go back to todo.js and remedy that. first modify your todo() function def
inition 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...
...ered checkboxes accordingly. gimme some id, please right now, our <todo /> component gives every task an id attribute of todo-0. this is bad html because id attributes must be unique (they are used as unique identifiers for document fragments, by css, javascript, etc.). this means we should give our component an id prop that takes a unique value for each todo. to follow the same pattern we had
initially, let's give each instance of the <todo /> component an id in the format of todo-i, where i gets larger by one every time: <todo name="eat" completed={true} id="todo-0" /> <todo name="sleep" completed={false} id="todo-1" /> <todo name="repeat" completed={false} id="todo-2" /> now go back to todo.js and make use of the id prop. it needs to replace the value of the id attribute of the <input ...
Beginning our React todo list - Learn web development
overview: client-side javascript frameworks next let's say that we’ve been tasked with creating a proof-of-concept in react – an app that allows users to add, edit, and delete tasks they want to work on, and also mark tasks as complete without deleting them. this article will walk you through putting the basic app component structure and styling in place, ready for individual component def
inition and interactivity, which we'll add later. note: if you need to check your code against our version, you can find a finished version of the sample react app code in our todo-react repository. for a running live version, see https://mdn.github.io/todo-react-build/. prerequisites: familiarity with the core html, css, and javascript languages, knowledge of the terminal/command...
... a more informative context, which could help screen reader users better understand the purpose of it. finally, the labels and inputs in our list items have some attributes unique to jsx: <input id="todo-0" type="checkbox" defaultchecked={true} /> <label classname="todo-label" htmlfor="todo-0"> eat </label> the defaultchecked attribute in the <input/ > tag tells react to check this checkbox
initially. if we were to use checked, as we would in regular html, react would log some warnings into our browser console relating to handling events on the checkbox, which we want to avoid. don't worry too much about this for now — we will cover this later on when we get to using events. the htmlfor attribute corresponds to the for attribute used in html. we cannot use for as an attribute in jsx b...
Componentizing our Svelte app - Learn web development
ting todos. we'll have to include an editing mode in the todo component. when entering editing mode we'll show an <input> field to allow us to edit the current todo name, with two buttons to confirm or cancel our changes. handling the events we'll need one variable to track whether we are in editing mode and another to store the name of the task being updated. add the following variable def
initions at the bottom of the <script> section of the todo component: let editing = false // track editing mode let name = todo.name // hold the name of the todo being edited we have to decide what events our todo component will emit: we could emit different events for the status toggle and editing of the name. (e.g. updatetodostatus and updatetod...
...ndle each user action. when the todo is in editing mode, the user can save or cancel the changes. when it's not in editing mode, the user can delete the todo, edit it, or toggle its status between completed and active. ...
Dynamic behavior in Svelte: working with variables and props - Learn web development
= [] this may feel a little weird at first. that's not how export normally works in javascript modules! this is how svelte 'extends' javascript by taking valid syntax and giving it a new purpose. in this case svelte is using the export keyword to mark a variable declaration as a property or prop, which means it becomes accessible to consumers of the component. you can also specify a default
initial value for a prop. this will be used if the component's consumer doesn't specify the prop on the component — or if its
initial value is undefined — when instantiating the component. so with export let todos = [], we are telling svelte that our todos.svelte component will accept a todos attribute, which when omitted will be
initialized to an empty array. have a look at the app, and ...
...nts. just like the export keyword being used to declare props, this may look a little alien. this is another example in which svelte takes advantage of valid javascript syntax and gives it a new purpose — in this case to to mean "re-run this code whenever any of the referenced values change". once you get used to it, there's no going back. update your totaltodos and completedtodos variable def
initions inside src/components/todos.svelte to look like so: $: totaltodos = todos.length $: completedtodos = todos.filter(todo => todo.completed).length if you check your app now, you'll see that the heading's numbers are updated when todos are completed or deleted. nice! behind the scenes the svelte compiler will parse and analyze our code to make a dependency tree, then it will generate the java...
Handling common HTML and CSS problems - Learn web development
irst article of this series that a good strategy to begin with is to test in a couple of modern browsers on desktop/mobile, to make sure your code is working generally, before going on to concentrate on the cross browser issues. in our debugging html and debugging css articles, we provided some really basic guidance on debugging html/css — if you are not familiar with the basics, you should def
initely study these articles before carrying on. basically, it is a matter of checking whether your html and css code is well formed and doesn't contain any syntax errors. note: one common problem with css and html arises when different css rules begin to conflict with one another. this can be especially problematic when you are using third party code. for example, you might use a css framework and...
...l! to sort this out, we have added a second background-color declaration, which just specifies a hex color — this is supported way back in really old browsers, and acts as a fallback if the modern shiny features don't work. what happens is a browser visiting this page first applies the first background-color value; when it gets to the second background-color declaration, it will override the
initial value with this value if it supports rgba colors. if not, it will just ignore the entire declaration and move on. note: the same is true for other css features like media queries, @font-face and @supports blocks — if they are not supported, the browser just ignores them. ie conditional comments ie conditional comments are a modified proprietary html comment syntax, which can be used to ...
Multiprocess on Windows
written by jeff prosise: understanding com apartments, part i understanding com apartments, part ii for the purposes of this document, "com" will refer to microsoft com (as opposed to xpcom). gecko and apartments 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 th...
...about this step. for those interfaces that do contain length_is or size_is annotations, we need to use another api declared in mozilla/mscom/registration.h: registerarraydata(). registerarraydata() accepts an array of arraydata structs. you should statically define this array in your code, as const. for example: static const mozilla::mscom::arraydata kmyarraydata[] { { // first arraydata def
inition }, { // second arraydata def
inition } }; mozilla::mscom::registerarraydata(kmyarraydata); each arraydata struct corresponds to one function; with length_is and/or size_is annotations. if your interface contains two functions with those annotations, then you will need to add two arraydata entries. arraydata contains seven fields: iid miid; ulong mmethodindex; ulong marrayparaminde...
Application cache implementation overview
ching is invoked asynchronously from nscontentsink::processofflinemanifest() using nsofflinecacheupdateservice. the implementation of offline cache update is in /uriloader/prefetch. nsofflinecacheupdateservice is used to collect, schedule and generally take care of updates and its queue. only one update is running at the time. nsofflinecacheupdate it self is the core of the update process. during
initiation the update is first looking for an existing nsiapplicationcache object using nsiapplicationcacheservice::getactivecache() with the manifest url to load from as an argument. when found, this update is processing an “update” and this cache is used as a cache to satisfy each manifest item and the manifest it self load from. otherwise, this is “first download”. then creates a new nsiapp...
...fest it self load from. otherwise, this is “first download”. then creates a new nsiapplicationcache for the given manifest url using nsiapplicationcacheservice::createapplicationcache(). this new cache version is now pending to be activated after all following long and complicated download process passes. until that it is not used for loading resources from. after these steps the update is in
initialized state waiting to be scheduled. when the update is about to actually start, the scheduling service calls nsofflinecacheupdate::begin() method, that switches the update to checking state (+invokes onchecking event) and starts fetch of the manifest file. note: whenever a load of an items (including the manifest) fails due to a network or server error or leads to a redirect, the update fails a...
Debugging Frame Reflow
02d7b7ec d=1500,390 tblo 02d7b5f0 d=1500,390 text 02d7c130 r=0 a=8940,uc c=uc,uc cnt=885 text 02d7c130 d=0,0 block 02d7b210 d=8940,390 area 02d7afe4 d=9180,630 canvas 00b97c6c d=9180,4470 scroll 00b97ee0 d=9180,4470 scroll 00b97ee0 d=9180,4470 vp 00b97c30 d=9180,4470 the first line shows the reflow of the viewport (vp). this viewport has the address 00b97c30. it is the
initial reflow: r=0. other reflow reasons are: incremental reflow resize reflow style change reflow dirty reflow the available width is 9180 twips. the available height is 4470 twips (a=9180,4470). the computed width is 9180 twips. the computed height is 4470 twips (c=9180,4470). the line count is 856 (cnt=856). below this is a line that reads: tblo 02d7b5f0 r=0 a=8940,uc c=0,0 cnt=870 here ...
...r reflow reasons are: incremental reflow resize reflow style change reflow dirty reflow the available width is 9180 twips. the available height is 4470 twips (a=9180,4470). the computed width is 9180 twips. the computed height is 4470 twips (c=9180,4470). the line count is 856 (cnt=856). below this is a line that reads: tblo 02d7b5f0 r=0 a=8940,uc c=0,0 cnt=870 here the uc shows that on
initial reflow the available height for the outer table frame is unconstrained. the table cell requires its children to compute the mes. it is reported back from the block as: block 02d7bcf8 d=300,300 me=300 the block max. element size is 300 twips. the second table reflow is started at rowg 00b984a4 r=2 a=1500,uc c=1500,uc cnt=879 where the previous information is used. the block has been required to...
Creating Custom Events That Can Pass Data
n 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. ...
...wwatcher->getactivewindow(getter_addrefs(awindow)); //get the active window. awindow->getdocument(getter_addrefs(adoc)); //get the document from the window. nscomptr<nsidomdocumentevent> docevent = do_queryinterface(adoc); //change interfaces so you can create interfaces. docevent->createevent(ns_literal_string("nsdommyevent"), getter_addrefs(event)); //create the event event->
initevent(ns_literal_string("nsdommyevent"), pr_true, pr_true); //
initialize it twindow = do_queryinterface(awindow); //use the window for a target. myevent = do_queryinterface(event); myevent->setmyproperty(45); //set my property of my event to (e.g.) 45. prbool defaultactionenabledwin; prbool defaultactionenableddoc; nscomptr<nsiprivatedomevent> privevt(do_queryinterface(event...
mach
ur .profile so it will run automatically when you start the shell: source /path/to/mozilla-central/python/mach/bash-completion.sh this will enable tab completion of mach command names, and in the future it may complete flags and other arguments too. note: mach tab completion will not work when running mach in a source directory older than firefox 24. for zsh, you can call the built-in bashcomp
init function before sourcing: autoload bashcomp
init bashcomp
init source /path/to/mozilla-central/python/mach/bash-completion.sh frequently asked questions why should i not use mach? a real faq for a change! mach is not the best software ever. say, if you run a rolling release arch linux distro or derivate thereof ("manjaro"), you have something less tedious: octopi! just install thunderbird fro...
...ds. @commandargument this is a method decorator that tells mach about an argument to a mach command. the arguments to the decorator are passed to argparse.argumentparser.add_argument(). the class and method names can be whatever you want. they are irrelevant to mach. an instance of the @commandprovider class is instantiated by the mach driver if a command in it is called for execution. the __
init__ method of the class must take either 1 or 2 arguments (including self). if your class inherits from object, no explicit __
init__ implementation is required (the default takes 1 argument). if your class's __
init__ takes 2 arguments, the second argument will be an instance of mach.base.commandcontext. this object holds state from the mach driver, including the current directory, a handle on the l...
Experimental features in Firefox
00d) as a hexbox when they are not expected. see bug 1099557 for more details. release channel version added enabled by default? nightly 43 yes developer edition 43 no beta 43 no release 43 no preference name layout.css.control-characters.enabled or layout.css.control-characters.visible property:
initial-letter the
initial-letter css property is part of the css inline layout specification and allows you to specify how dropped, raised, and sunken
initial letters are displayed. see bug 1223880 for more details. release channel version added enabled by default? nightly 50 no developer edition 50 no beta 50 no release ...
...see bug 1175958 for more details. ...
Limitations of chrome scripts
// null content; // null as a special note, docshells live in the content process, so they are also inaccessible: gbrowser.docshell; // null gbrowser.selectedbrowser.docshell; // null with the shim the shim will give you a cpow for the content object in these situations. in some situations, the content process may not be
initialized when an add-on asks for access to its content. in this case, the shim will return a javascript object that looks somewhat like a window or a document for about:blank. however, this "dummy" object is completely static and only exposes a few of the normal properties that windows and documents have. for this reason, add-ons that try to access content objects in fresh <browser> elements may ru...
...ows as the asubject argument. http requests you can't observe http requests in the content process. if you do, you'll get an error. if you do so in the chrome process, it will mostly work. the subject for the observer notification will be an nsihttpchannel as you would expect. ...
Performance
addmessagelistener("my-addon:request-from-parent", dosomething) why is this bad? because declared functions are also objects. and since frame scripts get evaluated for each tab this means new function objects get instantiated, new constants get computed, block scopes must be set up etc. while it may seem fairly innocencous in this toy example, real scripts often have a lot more functions and
initialize some fairly heavyweight objects. better: addon.js as above // framescript.js components.utils.import("resource://my-addon/processmodule.jsm", {}).addframe(this) // processmodule.jsm const exported_symbols = ['addframe']; const precomputedconstants = // ... function helper(window, action) { // ... do some work on the window } function dosomething(message) { frameglobal = message...
... but care must be taken to not leak references to the frame script global when it is passed into a jsm. alternatively the frame's unload event or weak maps can be used to ensure that frames can be cleaned up when their respective tab is closed. store heavyweight state once per process bad: // addon.js var main = new myaddonservi...
overflow-clip-box
x the clipping happens when there is an overflow. it is short hand for the overflow-clip-box-inline and overflow-clip-box-block properties. ...
... content-box this keyword makes the clipping be related to the content box. ...
Script security
es access to all the object's properties, except for a few properties of window and location objects, as defined by the same-origin policy. privileged to unprivileged code the most obvious example of this kind of security relation is between system-privileged chrome code and untrusted web content, but there are other examples in gecko. the add-on sdk runs content scripts in sandboxes, which are
initialized with an expanded principal, giving them elevated privileges with respect to the web content they operate on, but reduced privileges with respect to chrome. if the caller has a higher privilege than the target object, the caller gets an xray wrapper for the object. xrays are designed to prevent untrusted code from confusing trusted code by redefining objects in unexpected ways. for exam...
...ay choose to export objects to b. a !subsumes b && b !subsumes a a and b are cross-origin. security principals there are four types of security principal: the system principal, content principals, expanded principals, and the null principal. system principal the system principal passes all security checks. it subsumes itself and all other principals. chrome code, by def
inition, runs with the system principal, as do frame scripts. content principal a content principal is associated with some web content and is defined by the origin of the content. for example, a normal dom window has a content principal defined by the window's origin. a content principal subsumes only other content principals with the same origin. it is subsumed by the system principal, any expande...
IPDL Best Practices
lifetime management ensure ipdl deletes your protocol all protocols must be deleted. period. are you sending the __delete__ message to trigger protocol deletion? this one is easy to miss, as the corresponding recv__delete__ function has a stub implementation automatically generated in the base class. simply calling delete on a pointer to an actor is not enough. ...
...r before it has been created? don't let it happen - that is a guaranteed crash right there. use a flag and the generated actordestroy function to control when ipdl functions can be called; see phttpchannelparent/child for an example. ...
JavaScript-DOM Prototypes in Mozilla
the prototype of a host object is not guaranteed by ecmascript specification. moreover, no specification guarantees that there will be a globally available htmlimageelement, or that such object will be the constructor for any arbitrary image's [[prototype]]. a third way through which one can access the prototype of an object is through the constructor property of the object, which itself points (
initially) to the constructor: document.images[0].constructor.prototype.foo = bar; note though, the above may or may not work in mozilla. so far so good; we have shared prototypes, and xpconnect gives us most of this automatically. but this is not good enough, in addition to being able to share and represent each "class" with a constructor, we also want users to be able to extend interfaces, like ...
...; } })(); this demonstrates that the image constructor, a host object supported in nearly all browsers for mac and windows, has a prototype property, and that an attempt to modify the prototype's src - property results in an error. another example would be modifying the pagex property of a mouseevent instance. the pagex property actually needs a patch because it doesn't get set correctly in
initmouseevent bug 411031. here is a diagram that shows the prototype layout of a htmldivelement in mozilla: htmldivelement.prototype | |.__proto__ | htmlelement.prototype | |.__proto__ | element.prototype | |.__proto__ | node.prototype | ...
JavaScript Tips
xul tips when inserting code with an xul overlay, wrap functions and variables inside an object with a unique name to avoid conflicting with existing or future function and variable names. var uniquename = { _privatemember: 3, publicmember: "a string",
init: function() { this.dosomething(this.anothermember); }, dosomething: function(aparam) { alert(aparam); } }; xpconnect don't use object methods and properties more than you have to. it is often faster to store the result in a temporary variable. don't call methods that you don't have to. for instance, windowmanager.getenumerator(atype).hasmoreelements() may be replaced with windowmanager.getmostrecentwindow(atype) != null for a single window. don't query interfaces unless you need to access methods an...
... dom elements dom elements are just xpcom objects with some of the interfaces precached. don't call getattribute to see if an attribute exists, call hasattribute instead. prefer to loop through childnodes rather than using first/lastchild with next/previoussibling. but prefer haschildnodes() to childnodes.length > 0. similarly prefer document.getelementsbytagname(atag).item(0) != null t...
CustomizableUI.jsm
cation for each window customizableui knows about. parameters awidgetid the id of the widget to move aposition the position to move the widget to. negative values or values greater than the number of widgets will be interpreted to mean moving the widget to respectively the first or last position. ensurewidgetplacedinwindow() ensure a xul-based widget created in a window after areas were
initialized moves to its correct position. this is roughly equivalent to manually looking up the position and using insertitem in the old api, but a lot less work for consumers. always prefer this over using toolbar.insertitem() (which might no-op because it delegates to addwidgettoarea) or, worse, moving items in the dom yourself. nb: why is this api per-window, you wonder? because if you need thi...
...tewidget({ id: 'noida', defaultarea: customizableui.area_navbar, label: 'my widget', tooltiptext: 'this is my widget created with cui.jsm' }); it is important we add the listener before creating the element, because otherwise, the icon will not be set as the buttons are added, then we register the listener. so if we register listener first, then it catches the
initial adds. when the button is in the panel area, it needs a 32x32 icon, and when in other places it needs a 16x16 icon. one issue with this method, is that when the icon is removed to the "customize toolbox" (when you right click and say customize and it opens that tab), it doesn't give it the 32x32 icon it needs (i have to figure out how and update the docs, its probably onwidgetremoved or somethi...
DownloadSummary
ntly transferred as part of all the downloads that are currently in progress. this is zero if no downloads are currently in progress. methods bindtolist() this method may be called once to bind this object to a downloadlist. views on the summarized data can be registered before this object is bound to an actual list. this allows the summary to be used without requiring the
initialization of the downloadlist first. note: this method is already called internally by the downloads.getsummary() function. promise bindtolist( downloadlist alist ); parameters alist underlying downloadlist whose contents should be summarized. promise resolves to undefined when the view on the underlying list has been registered. addview() adds a view that will be notified o...
...lready called internally by the downloads.getsummary() function. promise bindtolist( downloadlist alist ); parameters alist underlying downloadlist whose contents should be summarized. promise resolves to undefined when the view on the underlying list has been registered. addview() adds a view that will be notified of changes to the summary. the newly added view will 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() remo...
FxAccountsOAuthClient.jsm
e provides a way for browser services to authenticate with the firefox accounts oauth server. components.utils.import("resource://gre/modules/fxaccountsoauthclient.jsm"); creating a new fxaccountsoauthclient new fxaccountsoauthclient(object options); method overview launchwebflow(); teardown(); attributes parameters object returns the set of parameters that
initialized the firefox accounts oauth flow. oncomplete function gets called when the firefox accounts oauth flow successfully completes. first and only argument is an object that has "state" and "code" properties. constructor fxaccountsoauthclient() creates and returns a new fxaccountsoauthclient object. fxaccountsoauthclient fxaccountsoauthclient( object options object pa...
...on redirection. oauth_uri - the fxa oauth api server uri, versioned. example: "https://oauth.accounts.firefox.com/v1" content_uri - the fxa content server uri. example: "https://accounts.firefox.com" [optional] scope - a colon-separated list of scopes that the user has authorized. [optional] action - if provided, should be either "signup" or "signin". parameters set of parameters to
initialize the firefox accounts oauth flow. authorizationendpoint optional optional authorization endpoint for the oauth server. default: /authorization return value a newly created fxaccountsoauthclient object implementing the methods described in this article. methods launchwebflow() opens a new tab at the firefox accounts oauth authorization url. registers a webchannel listener and sets ...
Deferred
methods resolve() fulfills the associated promise with the specified value, or propagates the state of an existing promise. if the associated promise has already been resolved, either to a value, a rejection, or another promise, this method does nothing. note: this function is bound to its associated promise when promise.defer() is called, and can be called wi...
...se with the value passed. * if the promise is already settled it does nothing. * * @param {anything} reason: the reason for the rejection of the promise. * generally its an error object. if however a promise is passed, then the promise * itself will be the reason for rejection no matter the state of the promise. */ this.reject = null; /* a newly created promise object. *
initially in pending state. */ this.promise = new promise(function(resolve, reject) { this.resolve = resolve; this.reject = reject; }.bind(this)); object.freeze(this); } } and use this function as would promise.defer: function funcwithdefer() { var deferred = new deferred(); var promise = deferred.promise; promise.then( function(aval) { console.log('fullfilled - ', av...
Promise
boolean: promise<boolean> exists(string path); the rejection reason may be specified separately in the function's documentation, and is considered to be an error object unless otherwise specified. method overview promise then([optional] function onfulfill, [optional] function onreject); promise catch([optional] function onreject); constructor creates a new promise,
initially in the pending state, and provides references to the resolving functions that can be used to change its state. new promise(executor); parameters executor this function is invoked immediately with the resolving functions as its two arguments: executor(resolve, reject); the constructor will not return until the executor has completed. the resolving functions can be used at any ti...
..., this function is invoked with the rejection reason of the promise as its only argument, and the outcome of the function determines the state of the new promise returned by the then method. in case this parameter is not a function (usually left undefined), the new promise returned by the then method is rejected with the same reason as the original promise. return value a new promise that is
initially pending, then assumes a state that depends on the outcome of the invoked callback function: if the callback returns a value that is not a promise, including undefined, the new promise is fulfilled with this fulfillment value, even if the original promise was rejected. if the callback throws an exception, the new promise is rejected with the exception as the rejection reason, even if the ...
XPCOMUtils.jsm
eviously. declare the class (or multiple classes) implementing the component(s). create an array of component constructors. define the nsgetfactory() or nsgetmodule() entry point. pseudocode this section provides some pseudocode that demonstrates how to put together a javascript class based on the steps listed above. constructor the constructor is a simple method that handles any required
initialization tasks. function mycomponent() { //
initialize the component here } class declaration declare the class prototype, using a form similar to this. mycomponent.prototype = { // properties required for xpcom registration: classdescription: "unique text description", classid: components.id("{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}"), contractid: "@example.com/xxx;1...
..., aname, acontract, ainterfacename ); parameters aobject the object into which to add the new lazy service getter function. aname the name of the getter function to create. acontract the contract to use to obtain the service. ainterfacename the name of the interface to query the service to. generatensgetfactory() generates the nsgetfactory() function along with the factory def
inition. function generatensgetfactory( componentsarray ); parameters componentsarray an array of component constructors. return value a function that will return the factory for the components and can be assigned to nsgetfactory global variable. generateci() generates an nsiclassinfo implementation for a component. the returned object should be assigned to the classinfo property of a ...
Bootstrapping a new locale
mmit 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.1 echo "mk_add_options moz_objdir=@topsrcdir@/../fx-ab-dc" > .mozconfig echo "ac_add_options --with-l10n-base=../" >> .mozco...
...dir ../build cd ../build now we'll set up a not-so-compile environment by calling configure. if you just checked out the localizable parts of en-us above, it will create a plethora of warnings no such file or directory, but no errors. ../mozilla/configure --disable-compile-environment --enable-application=browser whenever you need a build directory, these are the steps that you need to do to
initialize it. if you're downloading a new release of firefox from cvs, you might want to run configure again, too. now we can actually create the language pack, make -c browser/locales langpack-en-x-dude you should find your newly created language pack in dist/install. ls dist/install you can open that file in firefox and check it out. you have to set your selected language still. you can eith...
Index
to work on localization, you need a subset of the mozilla build prerequisites. on mac and linux, you should be just fine, and on windows, mozillabuild should get you everything you need. 12 localization quick start guide guide, translation this guide is filled with all of the basic, technical information you need to get involved in the mozilla l10n program. 13
initial setup localization as a pre-requisite to contributing to the l10n program, you need to have access to code, tools, and a properly configured local environment (i.e., your personal computer). you also need to determine if a localization effort already exists for your locale. here we'll go over the accounts you need as well as the tools and their configurations you need to set up befor...
...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. 16 translation phase localization, localization:tools congratulations on completing the
initial setup! as a reward for your efforts, you get to move on to the very reason you've come here: to localize mozilla projects. 17 localization sign-off reviews guide, localization, mozilla this article presents an overview of why we do sign-off reviews of localizations, the details on the criteria used for the sign-off reviews, and the process for requesting a review and for f...
Localization and Plurals
ere because you're localizing a .properties file and it had a link to this page. this page is to help explain how to localize these strings so that the correct plural form is shown to the user. for example, "1 page" vs "2 pages". if you're here to make your code (e.g., extensions) localizable for plural forms, you can jump straight to developing with pluralform. you may also need to localize the
initial strings for your code, so it would be good to read through at least the usage section as well. usage here are a couple terms used in this page to help keep things clear: plural rule: for a given language, there is a grammatical rule on how to change words, depending on the number qualifying the word. different languages can have different rules. plural form: for a particular plural rule,...
...s. install pluralform checker v0.3 extension extension input it would be good to keep this list updated with all the words that need plural forms. people using the extension can then copy/paste this input. ...
Localization quick start guide
welcome to mozilla localization (l10n for short)! whether you're here to start up your own localization in the mozilla project or to join the efforts of an existing localization, you've come to the right place. this guide is filled with all of the basic, technical information you need to get involved in the mozilla l10n program. we will take you through the steps to get started, from the
initial environment setup to testing and releasing your own localization. along the way, you'll learn about the variety of projects you can contribute to and the tools used to localize them. when we get to specific examples, we'll take them from the firefox project, as it is the most widely localized project within mozilla. as you near the end of this guide, you should be able to make a change to fir...
...near the end of this guide, you should be able to make a change to firefox in your local setting and then see that change in the firefox interface. in closing, when you finish this guide, you will have all the tools necessary to start contributing! remember, this guide will instruct you on the technical aspects of mozilla l10n only. visit the l10n process page to learn about the whole process.
initial setup tech prep work before localizing. translation phase l10n tools tutorials for translation. qa phase l10n testing tutorials. release phase steps to shipping your localization work. these four stages make up tech side of the l10n program. to learn more about any of these, click on any of the links above. to get the big picture, we suggest you start with the green bubble and move from...
Localization technical reviews
n.properties though locales might like to specify changes from the beginning, the region.properties files will be reverted to en-us. changes will be discussed in productization bugs filed for each locale. search plugins similar to the region.properties files, the list.txt file should be reverted to en-us and amended accordingly as the search plugin productization bugs are completed. for this
initial review, all xml files should be removed. string lengths in pipnss.properties there are some character limits in the security/manager/chrome/pipnss/pipnss.properties file that you should be aware of. it is best to look into each of these files to see if the localizer's strings might be too long. this is something to look for, but can be difficult to diagnose immediately. for more info, see b...
.... for more info, see bug 435874. check for bad migration of access keys in the past, it was common to find broken access keys for safari and camino in browser/chrome/browser/migration/migration.dtd. for this review, we look at this file to make sure that the access keys look normal. if they don't, we report any strange access keys or translations that localizers might have changed during their
initial translation process. for more info about access keys in the technical review process, see bug 421893. no utf-7 in the intl.properties file firefox no longer has a utf-7 parser. there should not be any utf-7 encodings in the file toolkit/chrome/global/intl.properties. for more info about utf-7 in firefox, see bug 441876. more intl.properties checkpoints, cont we also check the plural rule...
gettext
rals gettext lets you define and use singular and plural forms of a string. to take advantage of this functionality, you need to use a different keyword (i.e. different gettext function name) for string which are supposed to support plurals. for instance, in php the default keyword for regular messages is gettext() and _(). for messages with plural support, the default keyword is ngettext(). a def
inition of a string with plurals takes three arguments: the singular form of the english string, the plural form of the english string, and the number basing on which the function will return the correct (singular or plural) form of the string. consider the following code snippet: <?php $num = 1; printf(ngettext("%d user likes this.", "%d users like this.", $num), $num); ?> depending on the ...
...will be %d user likes this. the second time the $num variable is passed in the printf() call, which at this point of interpretation looks something like printf("%d user likes this.", $num);. the %d in the first argument (which is the string returned by gettext) will be replaced with the value of $num. for english, the above code will produce the following output: 1 user likes this. the string def
inition in the messages.po file will look like this: #: file.php:3 #, php-format msgid "%d user likes this." msgid_plural "%d users like this." msgstr[0] "" msgstr[1] "" depending on the localizer's target language and its rules for creating plural forms, there might be another field for translation, e.g. msgstr[2]. gettext will return one of the msgstrs, depending on the number passed to the gettext ...
Mozilla Style System Documentation
om a style context to get style data from a style context, use the getstyledata method to fill in a pointer to a style struct. each of the style structs contains a group of properties. the structs are listed in, nsstylestruct.hand the many of the values are in nsstyleconsts.h. each of the structs includes either only features that are inherited by default or single properties that are set to the
initial value by default (see css26.1.1), which is essential for the ruletree. the fundamental way to get a style struct from a style context looks like this: const nsstyledisplay *display = ns_static_cast(const nsstyledisplay*, sc->getstyledata(estylestruct_display)); there is also a (non-virtual) method on nsiframe to get the style data from a frame's style co...
...ra: d] | | [quote: a] [quote: a] | [span: e] the reason the rule tree shares style data naturally is that most style rules specify properties in very few structs. as stated above, each style struct contains only features that are inherited by default or those that are set to their
initial value ("reset") by default. this leads to (or perhaps three, depending on how you count) two types of sharing. for those structs where all the values are inherited by default, a style context can often (when none of the rules matched by the style context specifies any properties in the struct, or when explicit inherit is used) use the same struct as its parent style context. for the structs wh...
Profiling with the Firefox Profiler
he same things you are seeing. tips understanding profiles can be difficult. if you're unfamiliar with gecko's internals, you can click the javascript only button to see where your javascript code is slow. each entry in the call tree shows a call stack and how much time is spent in that call stack. for example:in the results above we can see that we're spending ~287 milliseconds in startup::xre_
initchildprocess, 194 ms of which are spent in pvsync::msg_notify and all child functions that it calls. it is useful to scan down the "running time" column and look for when the time changes. while looking for performance problems, you're looking for the processes that are taking the most time; then you can figure out how to optimize them. common performance bugs in firefox inefficient code that is...
...ople’s experience giving this a go – it might be a great tool in determining what’s going on in firefox when it’s hung! profiling threads the firefox profiler has rudimentary support for profiling multiple threads. to enable it, check the 'multi-thread' box then enter one or more thread names into the textbox beside it. thread names are the strings passed to the base::thread class at
initialization. at present there is no central list of these thread names, but you can find them by grepping the source. examples: 1 2 if the filter you entered is invalid, no threads will be profiled. you can identify this by hitting analyze (cleopatra will show you an error message). if the filter is left empty, only the main thread is captured (as if you had not enabled multi-thread.) profiler f...
A brief guide to Mozilla preferences
e. this file allows preference locking via the lock_pref() function. details on the config file is beyond the scope of this document. user pref. files in the profile directory are two user pref files: prefs.js and user.js. prefs.js is automatically generated by the application and should not be edited manually, whereas user.js is an optional file the user can create to override preferences
initialized by other preferences files. preferences loading and resolution on application launch, the application loads preferences in the following order: load all default pref files. optionally load the config file. load user pref files, first prefs.js, then user.js . preference conflicts are resolved in favor of the last entry; for example, user.js takes precedence over...
... error when loading user pref files, the application will issue a warning but will continue running. preferences saving usually when the user specifically commits a preference change via user interface such as the preferences dialog, the application saves the change by overwriting prefs.js . on application exit, all user-set preferences are saved to prefs.js . this also means that preferences
initially set by user.js will also be saved to prefs.js. do not edit prefs.js directly. note the application never changes user.js, so on launch user.js overrides conflicting preferences from the previous application session. when prefs.js is written, it only saves user preferences which are different from the default. the exception to this is a preference read using sticky_pref() - these preferenc...
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 cur...
... ...
NSPR release procedure
change the nspr version in mozilla/nsprpub/{configure.in,configure}. change the nspr version in mozilla/nsprpub/pr/tests/vercheck.c. change the nspr version in mozilla/nsprpub/admin/repackage.sh. source tarball binary distributions right now i use the mozilla/nsprpub/admin/repackage.sh script to generate the binary distributions published on ftp.mozilla.org. as the name of the shell script implies, repackage.sh merely repackages binary distributions in a different format. before you run repackage.sh, you need to have built the binary distributions using the "gmake release" makefile target. ...
...t for your environment. after you have run repackage.sh, follow the instructions in to upload the files to ftp.mozilla.org's staging server, so that they eventually show up on ftp.mozilla.org. the host ftp.mozilla.org can be accessed via the ftp, http, and https protocols. we recommend using https://ftp.mozilla.org/. note: for nss, the script equivalent to nspr's repackage.sh is /u/robobld/bin/sbs
init/nss/push/buildbindist.sh in the "svbuild" source tree. ...
Optimizing Applications For NSPR
in that thread, and have the primordial thread join that thread. nspr uses timer signals to implement thread preemption for local threads on some platforms. if all the software linked into the application is not ported to the nspr api, the application may fail because of threads being preempted during critical sections. to disable thread preemption call <tt>pr_disableclockinterrupts()</tt>during
initialization. interrupting threads (via <tt>pr_interrupt()</tt>) on threads blocked in i/o functions is implemented to various degrees on different platforms. the unix based platforms all implement the function though there may be up to a 5 second delay in processing the request. the mechanism used to implement <tt>pr_interrupt()</tt> on the pthreads versions of nspr is flawed. no failure attribut...
...uch things to happen. nspr does take advantage of macintosh' asynchronous i/o capability to perform scheduling during i/o. still, there is no enforceable mechanism to guarantee thread scheduling fairness. calendar time facilities are limited on macintosh. one can only determine the immediate setting of daylight savings time, not what it would be at some arbitrary time in the past or the future.
initialization of nspr may fail if the host is not connected to a network of some kind. win-16 http://www.sybase.com/products/languages/watccpl.html the win-16 port is unique in the nspr world in that it uses the watcom development environment. this environment does bring along some of its own special trappings. win16 uses co-operative non-preemptive dispatching for its own processes. this means...
Introduction to NSPR
, win'95), and over twenty versions of unix. nspr does not provide a platform for porting existing code. it must be used from the beginning of a software project. nspr naming conventions naming of nspr types, functions, and macros follows the following conventions: types exported by nspr begin with pr and are followed by intercap-style declarations, like this: print, prfiledesc function def
initions begin with pr_ and are followed by intercap-style declarations, like this: pr_read, pr_jointhread preprocessor macros begin with the letters pr and are followed by all uppercase characters separated with the underscore character (_), like this: pr_bytes_per_short, pr_extern nspr threads nspr provides an execution environment that promotes the use of lightweight threads. each thread is an ...
...ication (pr_notifyallcondvar) promotes all threads waiting on a condition to the ready state. if no threads were waiting, the notification is a no-op. waiting on a condition variable is an interruptible operation. another thread could target the waiting thread and issue a pr_interrupt, causing a waiting thread to resume. in such cases the return from the wait operation indicates a failure and def
initively indicates that the cause of the failure is an interrupt. a call to pr_waitcondvar may also resume because the interval specified on the wait call has expired. however, this fact cannot be unambiguously delivered, so no attempt is made to do so. if the logic of a program allows for timing of waits on conditions, then the clock must be treated as part of the monitored data and the amount of t...
Network Addresses
unctions documented here to manipulate the information. if used consistently, this api also eliminates the need to deal with the byte ordering of network addresses. typically, the only numeric declarations required are the well-known port numbers that are part of the prnetaddr structure. network address types and constants prhostent prprotoent pr_netdb_buf_size network address functions
initializing a network address pr_
initializenetaddr facilitates the use of prnetaddr, the basic network address structure, in a polymorphic manner. by using these functions with other network address functions, clients can support either version 4 or version 6 of the internet protocol transparently. all nspr functions that require prnetaddr as an argument accept either an ipv4 or ipv6 version of the...
...rk address pr_
initializenetaddr facilitates the use of prnetaddr, the basic network address structure, in a polymorphic manner. by using these functions with other network address functions, clients can support either version 4 or version 6 of the internet protocol transparently. all nspr functions that require prnetaddr as an argument accept either an ipv4 or ipv6 version of the address. ...
PR_CallOnce
ensures that subsystem
initialization occurs only once. syntax prstatus pr_callonce( prcalloncetype *once, prcalloncefn func); parameters pr_callonce has these parameters: once a pointer to an object of type prcalloncetype.
initially (before any threading issues exist), the object must be
initialized to all zeros. from that time on, the client should consider the object read-only (or even opaque) and allow the runtime to manipulate its content appropriately. func a pointer to the function the calling client has designed to perform the subsystem
initialization. the function will be called once, at most, for each subsystem to be
initialized. it should return a prstatus indicating the result of the
initialization process. while the first thread executes this function, other threa...
... runtime to manipulate its content appropriately. func a pointer to the function the calling client has designed to perform the subsystem
initialization. the function will be called once, at most, for each subsystem to be
initialized. it should return a prstatus indicating the result of the
initialization process. while the first thread executes this function, other threads attempting the same
initialization will be blocked until it has been completed. ...
PR_CreateThreadPool
max_threads the limit on the number of threads that will be created to server the thread pool. ...
... max_threads the limit on the number of threads that will be created to server the thread pool. ...
PR_OpenSemaphore
ot exist */ #define pr_sem_excl 0x2 /* fail if already exists */ nspr_api(prsem *) pr_opensemaphore( const char *name, printn flags, printn mode, pruintn value ); parameters the function has the following parameters: name the name to be given the semaphore. flags how to create or open the semaphore. mode unix style file mode to be used when creating the semaphore. value the
initial value assigned to the semaphore. returns a pointer to a prsem structure or null/code> on error. description if the named semaphore doesn't exist and the pr_sem_create flag is specified, the named semaphore is created. the created semaphore needs to be removed from the system with a pr_deletesemaphore call. if pr_sem_create is specified, the third argument is the access permission bits o...
...description if the named semaphore doesn't exist and the pr_sem_create flag is specified, the named semaphore is created. the created semaphore needs to be removed from the system with a pr_deletesemaphore call. if pr_sem_create is specified, the third argument is the access permission bits of the new semaphore (same interpretation as the mode argument to pr_open) and the fourth argument is the
initial value of the new semaphore. if pr_sem_create is not specified, the third and fourth arguments are ignored. ...
NSPR API Reference
types size type pointer difference types boolean types status type for return values threads threading types and constants threading functions creating, joining, and identifying threads controlling thread priorities controlling per-thread private data interrupting and yielding setting global thread concurrency getting a thread's scope process
initialization identity and versioning name and version constants
initialization and cleanup module
initialization locks lock type lock functions condition variables condition variable type condition variable functions monitors monitor type monitor functions cached monitors cached monitor functions i/o types directory type file descriptor types file info ...
...ack 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 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 ...
HTTP delegation
is "/cgi-bin/ocsp-responder". (when issueing get requests, the "?query-string=data" portion should already be appended to the request path) after creation, nss might call functions to provide additional details of the http request (e.g. sec_httprequest_setpostdatafcn). the application is expected to collect the details for later use. once nss is finished providing all details, it will request to
initiate the actual network communication (sec_httprequest_trysendandreceivefcn). the application should try to reuse existing network connections associated with the server session object. once the http response has been obtained from the http server, the function will provide the results in its "out parameters". please read the source code documentation to learn how to use this api synchronously or ...
...ession object. once the http response has been obtained from the http server, the function will provide the results in its "out parameters". please read the source code documentation to learn how to use this api synchronously or asynchronously. now that we have explained the interaction between nss, the callback functions and the application, let's look at the steps required by the application to
initially register the callbacks. make sure you have completed the nss
initialization before you attempt to register the callbacks. look at sec_httpclientfcn, which is a (versioned) table of function pointers. create an instance of this type and supply a pointer to your implementation for each entry in the function table. finally register your http client implementation with a call to sec_registerdefa...
HTTP delegation
h is "/cgi-bin/ocsp-responder". (when issuing get requests, the "?query-string=data" portion should already be appended to the request path) after creation, nss might call functions to provide additional details of the http request (e.g. sec_httprequest_setpostdatafcn). the application is expected to collect the details for later use. once nss is finished providing all details, it will request to
initiate the actual network communication (sec_httprequest_trysendandreceivefcn). the application should try to reuse existing network connections associated with the server session object. once the http response has been obtained from the http server, the function will provide the results in its "out parameters". please read the source code documentation to learn how to use this api synchronously or ...
...ession object. once the http response has been obtained from the http server, the function will provide the results in its "out parameters". please read the source code documentation to learn how to use this api synchronously or asynchronously. now that we have explained the interaction between nss, the callback functions and the application, let's look at the steps required by the application to
initially register the callbacks. make sure you have completed the nss
initialization before you attempt to register the callbacks. look at sec_httpclientfcn, which is a (versioned) table of function pointers. create an instance of this type and supply a pointer to your implementation for each entry in the function table. finally register your http client implementation with a call to sec_registerdefa...
Using JSS
nspr and nss shared libraries jss uses the nspr and nss libraries for i/o and crypto. jss version 3.0 linked statically with nss, so it only required nspr. ...
... before building and running java applications with jss. classpath include the path containing the jss classes you built, or the path to jss42.jar. (the path to jss34.jar ends with the string "/jss42.jar". it is not just the directory that contains jss42.jar.) ld_library_path (unix) / path (windows) include the path to the nspr, nss, and jss shared libraries.
initialize jss in your application before calling any jss methods, you must
initialize jss by calling one of the cryptomanager.
initialize methods. see the javadoc for more details. ...
NSS_3.11.10_release_notes.html
oesn't match usage bug 374247: modutil -disable command not disabling modules' slots bug 384459: certification path validation fails when authority key identifier extension contains key identifier bug 385946: can't import certificate into cert database in fips mode (certutil). ...
...rtutil). bug 387892: add entrust root ca certificate(s) to nss bug 396999: pk11_authenticate bug 397478: lock from ssl_
initsymwrapkeyslock not freed on selfserv shutdown. bug 397486: session cache locks not freed on strsclnt shutdown. ...
NSS 3.12.5 release_notes
t the peer's client hello bears the renegotiation info extension (as we always did in the past). unsafe. tls compression enable tls compression with: ssl_enable_deflate: enable tls compression with deflate. off by default. (see ssl.h) error codes: ssl_error_decompression_failure (see sslerr.h) ssl_error_renegotiation_not_allowed (see sslerr.h) new context
initialization and shutdown functions see nss.h for details. the 2 new functions are: nss_
initcontext nss_shutdowncontext parameters for these functions are used to
initialize softoken. these are mostly strings used to internationalize softoken. memory for the strings are owned by the caller, who is free to free them once nss_context
init returns. if the string parameter is null (as o...
...ftoken. these are mostly strings used to internationalize softoken. memory for the strings are owned by the caller, who is free to free them once nss_context
init 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: nss
initparametersstr other new functions in secmod.h: secmod_getskipfirstflag secmod_getdefaultmoddbflag in prlink.h nss_securememcmp 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) th...
NSS 3.14 release notes
in ssl.h) ssl_versionrangeset (in ssl.h) ssl_versionrangesetdefault (in ssl.h) to better ensure interoperability with peers that support tls 1.1, nss has altered how it handles certain ssl protocol layer events. such changes may present interoperability concerns when enabling tls 1.1. when connecting to a server, the record layer version of the
initial clienthello will be at most { 3, 1 } (tls 1.0), even when attempting to negotiate tls 1.1 (https://bugzilla.mozilla.org/show_bug.cgi?id=774547) the choice of client_version sent during renegotiations has changed. see the "changes" section below. experimental support for dtls (rfc 4347) and dtls-srtp (rfc 5764) dtls client and server support has been added in nss 3.
...default cipher suites the default cipher suites in nss 3.14 have been changed to better reflect the current security landscape. the defaults now better match the set that most major web browsers enable by default. bug 783448 - when performing an ssl renegotiation, the client_version that is sent in the renegotiation clienthello will be set to match the client_version that was sent in the
initial clienthello. this is needed for compatibility with iis. certificate signatures that make use of the md5 hash algorithm will now be rejected by default. support for md5 may be manually enabled (but is discouraged) by setting the environment variable of "nss_hash_alg_support=+md5" or by using the nss_setalgorithmpolicy function. note that ssl cipher suites with "md5" in their names are not dis...
NSS 3.24 release notes
ates can be configured, they will not be used by nss in this version. for functions that use temporary arenas, allocating a portcheaparena on the stack is more performant than allocating a plarenapool on the heap. rather than declaring a plarenapool pointer and calling port_newarena/port_freearena to allocate or free an instance on the heap, declare a portcheaparenapool on the stack and use port_
initcheaparena/port_destroycheaparena to
initialize and destroy it. items allocated from the arena are still created on the heap, only the arena itself is stack-allocated. note: this approach is only useful when the arena use is tightly bounded, for example, if it is only used in a single function. new elements this section lists and briefly describes the new functions, types, and macros in nss 3.2...
...his approach is only useful when the arena use is tightly bounded, for example, if it is only used in a single function. new elements this section lists and briefly describes the new functions, types, and macros in nss 3.24. new functions in ssl.h ssl_configservercert - configures an ssl/tls socket with a certificate, private key, and other information. in secport.h port_
initcheaparena -
initializes an arena that was created on the stack. (see portcheaparenapool.) port_destroycheaparena - destroys an arena that was created on the stack. (see portcheaparenapool.) new types in sslt.h sslextraservercertdata - optionally passed as an argument to ssl_configservercert. this struct contains supplementary information about a certificate, such as the intend...
NSS 3.49 release notes
illa.org/pub/mozilla.org/security/nss/releases/nss_3_49_rtm/src/ other releases are available in nss releases. notable changes in nss 3.49 the legacy dbm database, libnssdbm, is no longer built by default when using gyp builds. see bug 1594933 for details. bugs fixed in nss 3.49 bug 1513586 - set downgrade sentinel for client tls versions lower than 1.2. ...
...nitialized warning in sslsnce.c bug 1606119 - fix ppc hw crypto build failure bug 1605545 - memory leak in pk11install_platform_generate bug 1602288 - fix build failure due to missing posix signal.h bug 1588714 - implement checkarmsupport for win64/aarch64 bug 1585189 - nss database uses 3des instead of aes to encrypt db entries bug 1603257 - fix ubsan issue in softoken ckm_nss_chacha20_ctr
initialization bug 1590001 - additional hrr tests (cve-2019-17023) bug 1600144 - treat clienthello with message_seq of 1 as a second clienthello bug 1603027 - test that esni is regenerated after helloretryrequest bug 1593167 - intermittent mis-reporting potential security risk sec_error_unknown_issuer bug 1535787 - fix automation/release/nss-release-helper.py on macos bug 1594933 - disable build...
NSS 3.52 release notes
e tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_52_rtm/src/ other releases are available in nss releases. notable changes in nss 3.52 bug 1603628 - update nss to support pkcs #11 v3.0. note: this change modifies the ck_gcm_params struct to include the ulivbits field which, prior to pkcs #11 v3.0, was ambiguously defined and not included in the nss def
inition. if an application is recompiled with nss 3.52+, this field must be
initialized to a value corresponding to ulivlen. alternatively, defining nss_pkcs11_2_0_compat will yield the old def
inition. see the bug for more information. bug 1623374 - support new pkcs #11 v3.0 message interface for aes-gcm and chachapoly. bug 1612493 - integrate avx2 chacha20, poly1305, and chacha20poly1305 from ...
...hachapoly. bug 1612493 - integrate avx2 chacha20, poly1305, and chacha20poly1305 from hacl*. bugs fixed in nss 3.52 bug 1633498 - fix unused variable 'getauxval' error on ios compilation. bug 1630721 - add softoken functions for fips. bug 1630458 - fix problem of gyp msvc builds not producing debug symbol files. bug 1629663 - add ikev1 quick mode kdf. bug 1629661 - mpconfig calls in ssl
initialize policy before nss is
initialized. bug 1629655 - support temporary session objects in ckfw. bug 1629105 - add pkcs11 v3.0 functions to module debug logger. bug 1626751 - fix error in generation of fuzz32 docker image after updates. bug 1625133 - fix implicit declaration of function 'getopt' error. bug 1624864 - allow building of gcm-arm32-neon on non-armv7 architectures. bug 1624402 - ...
NSS 3.53 release notes
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 various compile warnings in nss bug 1640041 - fix a null pointer in security/nss/lib/ssl/sslenco...
... - 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 various compile warnings in nss bug 1640041 - fix a null pointer in security/nss/lib/ssl/sslencode.c:67 bug 1640042 - fix a null pointer in security/nss/lib/ssl/sslsock.c:4460 bug 1638289 - avoid multiple def
initions 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. bug 1561331 - additional modular inverse test bug 1629553 - rework and cleanup gmake builds bug 1438431 - remove mkdepend and "depend" make target bug 290526 - support parallel building of nss when us...
NSS Sample Code sample4
ieving it over a secure communication * channel */ char *passwdcb(pk11slotinfo *info, prbool retry, void *arg); int main(int argc, char **argv) { secstatus rv; certcertificate *cert = null; seckeypublickey *pubkey = null; seckeyprivatekey *pvtkey = null; int modulus_len, i, outlen; char *buf1 = null; char *buf2 = null; /*
initialize nss */ pk11_setpasswordfunc(passwdcb); rv = nss_
init("."); if (rv != secsuccess) { fprintf(stderr, "nss
initialization failed (err %d)\n", pr_geterror()); goto cleanup; } cert = pk11_findcertfromnickname("testca", null); if (cert == null) { fprintf(stderr, "couldn't find cert testca in nss db (err %d)\n", pr_geterror()); goto cleanup;...
...; } pubkey = cert_extractpublickey(cert); if (pubkey == null) { fprintf(stderr, "couldn't extract public key from cert testca (err %d)\n", pr_geterror()); goto cleanup; } modulus_len = seckey_publickeystrength(pubkey); fprintf(stderr, "public key modulus %d bytes\n", modulus_len); buf1 = (char *)malloc(modulus_len); buf2 = (char *)malloc(modulus_len); /*
initialize buf1 */ for (i=0;i<modulus_len;i++) { buf1[i]= (i %26) + 'a'; } buf1[modulus_len-1] = '\0'; fprintf(stderr, "buffer being encrypted = \n%s\n", buf1); /* encrypt buf1, result will be in buf2 */ rv = pk11_pubencryptraw(pubkey, buf2, buf1, modulus_len, null); if (rv != secsuccess) { fprintf(stderr, "encrypt with public key failed (err %d)\n", pr_geterror(...
NSS Sample Code sample5
ickeyinfo *spki = null; seckeyprivatekey *pvtkey = null; int modulus_len, i, outlen; char *buf1 = null; char *buf2 = null; char *pubkstr = base64_encoded_subjectpublickeyinfo; char *pvtkstr = base64_encoded_privatekeyinfo; secitem der; secitem nickname; pk11slotinfo *slot = null; /*
initialize nss * you need to explicitly authenticate to the internal token if you use * nss_
init insteadf of nss_nodb_
init * invoke this after getting the internal token handle * pk11_authenticate(slot, pr_false, null); */ rv = nss_nodb_
init("."); if (rv != secsuccess) { fprintf(stderr, "nss
initialization failed (err %d)\n", pr_geterror()); goto cleanup; ...
...ecitem_freeitem(&der, pr_false); pubkey = seckey_extractpublickey(spki); if (pubkey == null) { fprintf(stderr, "couldn't extract public key (err %d)\n", pr_geterror()); goto cleanup; } modulus_len = seckey_publickeystrength(pubkey); fprintf(stderr, "public key modulus %d bytes\n", modulus_len); buf1 = (char *)malloc(modulus_len); buf2 = (char *)malloc(modulus_len); /*
initialize buf1 */ for (i=0;i<modulus_len;i++) { buf1[i]= (i %26) + 'a'; } buf1[modulus_len-1] = '\0'; fprintf(stderr, "buffer being encrypted = \n%s\n", buf1); /* encrypt buf1, result will be in buf2 */ rv = pk11_pubencryptraw(pubkey, buf2, buf1, modulus_len, null); if (rv != secsuccess) { fprintf(stderr, "encrypt with public key failed (err %d)\n", pr_geterror(...
NSS Sample Code sample6
turning the password to the nss * key database. for example purposes, this function hardcodes the password. ...
...unction hardcodes the password. * in a real app, this function should obtain the password using secure means * such as prompting an operator, or retrieving it over a secure communication * channel */ char *passwdcb(pk11slotinfo *info, prbool retry, void *arg); int main(int argc, char **argv) { secstatus rv; /*
initialize nss */ pk11_setpasswordfunc(passwdcb); /* the nss db must be
initialized read-write since we'll be creating * keys in it. once keys are generated, it can be opened without read-write * subsequently (nss_
init). */ rv = nss_
initreadwrite("."); if (rv != secsuccess) { fprintf(stderr, "nss
initialization failed (err %d)\n", pr_geterror()); exit(1); } /* generate a key with id 1. should succeed on first run on a fresh db, *...
Hashing - sample 1
hash of a file and saves it * to another file. it illustrates the use of nss message * apis. ...
...ss message * apis. ...
sample1
computes the hash of a file and saves it to another file. it illustrates the use of nss message apis. ...
...use of nss message apis. ...
nss tech note1
ted component type. a sec_asn1_primitive macro is also provided, but does not need to be included as it is zero. the tag number. it is stored in the lower 5 tag bits (number 0 through 4). the asn.1 standard only defines tag numbers in the universal class. if you you are using a tag of a different classes, you can define your own tag number macros or specify the tag value within the template def
inition. the following macros are provided for tag numbers within the universal class : sec_asn1_boolean, sec_asn1_integer, sec_asn1_bit_string, sec_asn1_octet_string, sec_asn1_null, sec_asn1_object_id, sec_asn1_object_descriptor,† sec_asn1_real, sec_asn1_enumerated, sec_asn1_embedded_pdv, sec_asn1_utf8_string, sec_asn1_sequence, sec_asn1_set, sec_asn1_numeric_string, sec_asn1_printable_string,...
.... sec_asn1_any: allows the decoder to match this template with any component type, regardless of the tag in the input data. if used in conjunction with sec_asn1_optional as part of a sequence, this must be the last template in the template array. sec_asn1_inline: recurse into the specified subtemplate to continue processing. this is typically used for sec_asn1_sequence or sec_asn1_choice def
initions, which always need to be the first template in a template array of their own. sec_asn1_pointer: similar to sec_asn1_inline, except that the memory in the target will be allocated dynamically and a pointer to the dynamically allocated memory will be stored in the dest struct at the offset. this requires that the subtemplate contains a non-zero size field. sec_asn1_group: can only be used...
PKCS 7 functions
the nss version column indicates which versions of nss support the function. ...
...the nss version column indicates which versions of nss support the function. ...
FC_Decrypt
n] session handle. pencrypteddata [in] pointer to encrypted data block. usencrypteddatalen [in] length of the data in bytes. pdata [out] pointer to location where recovered data is to be stored. ...
...r to location where recovered data is to be stored. pusdatalen [in,out] pointer to location where the length of recovered data is to be stored. ...
FC_DecryptUpdate
] pointer to the next block of data to be decrypted. usencryptedpartlen [in] length of data block in bytes. ppart [out] pointer to location where recovered block is to be stored. ...
...e location where the number of bytes of recovered data is to be stored. description fc_decryptupdate decrypts a block of data according to the attributes of the previous call to fc_decrypt
init. the block may be part of a multi-part decryption operation. ...
FC_Digest
block. usdatalen [in] length of the data in bytes. pdigest [out] pointer to location where recovered data is to be stored. ...
...out] pointer to the maximum size of the output buffer, replaced by the length of the message digest if the operation is successful. ...
FC_Encrypt
g_ptr pusencrypteddatalen ); parameters hsession [in] session handle. pdata [in] pointer to the data buffer usdatalen [in] length of the data buffer in bytes. ...
...a buffer in bytes. pencrypteddata [out] pointer to location where encrypted data is to be stored. pusencrypteddatalen [in/out] number of bytes. ...
FC_EncryptUpdate
er to the next block of data to be encrypted. uspartlen [in] length of data block in bytes. pencryptedpart [out] pointer to location where encrypted block is to be stored. ...
...e location where the number of bytes of encrypted data is to be stored. description fc_encryptupdate encrypts a block of data according to the attributes of the previous call to fc_encrypt
init. the block may be part of a multi-part encryption operation. ...
FC_FindObjects
ount ); parameters hsession [in] session handle. ptemplate [out] pointer to location to receive the object handles. usmaxobjectcount [in] maximum number of handles to retrieve. ...
...] maximum number of handles to retrieve. pusobjectcount [out] pointer to location to receive the number of returned handles. ...
FC_Login
session, ck_user_type usertype, ck_char_ptr ppin, ck_ulong ulpinlen ); parameters fc_login() takes four parameters: hsession [in] a session handle usertype [in] the user type (cku_so or cku_user) ppin [in] a pointer that points to the user's pin ulpinlen [in] the length of the pin description fc_login() logs a user into a token. the security officer (cku_so) only logs in to
initialize the normal user's pin. the so pin is the empty string. the nss cryptographic module doesn't allow the so to log in if the normal user's pin is already
initialized. return value fc_login() returns the following return codes. ckr_ok: the user logged in successfully. ckr_device_error: the token is in the error state. ckr_host_memory: memory allocation failed. ckr_pin_incorrect: the pin...
...n is incorrect. ckr_pin_len_range: the pin is too long (ulpinlen is greater than 255). the function should return ckr_pin_incorrect in this case. ckr_session_handle_invalid: the session handle is invalid. ckr_user_already_logged_in: the user is already logged in. ckr_user_type_invalid the token can't authenticate the user because there is no key database or the user's password isn't
initialized. usertype is cku_so and the normal user's pin is already
initialized. see also nsc_login ...
FC_Sign
data block. usdatalen [in] length of the data in bytes. psignature [out] pointer to location where recovered data is to be stored. ...
...gnaturelen [in, out] pointer to the maximum size of the output buffer, replaced by the length of the signature if the operation is successful. ...
NSC_Login
handle hsession, ck_user_type usertype, ck_char_ptr ppin, ck_ulong ulpinlen ); parameters nsc_login() takes four parameters: hsession [in] a session handle usertype [in] the user type (cku_so or cku_user) ppin [in] a pointer that points to the user's pin ulpinlen [in] the length of the pin description nsc_login() logs a user into a token. the security officer (cku_so) only logs in to
initialize the normal user's pin. the so pin is the empty string. the nss cryptographic module doesn't allow the so to log in if the normal user's pin is already
initialized. return value nsc_login() returns the following return codes. ckr_ok: the user logged in successfully. ckr_device_error: the token is in the error state. ckr_host_memory: memory allocation failed. ckr_pin_incorrect: the pi...
...ct: the pin is incorrect. ckr_pin_len_range: the pin is too long (ulpinlen is greater than 255).the function should return ckr_pin_incorrect in this case. ckr_session_handle_invalid: the session handle is invalid. ckr_user_already_logged_in: the user is already logged in. ckr_user_type_invalid the token can't authenticate the user because there is no key database or the user's password isn't
initialized. usertype is cku_so and the normal user's pin is already
initialized. see also fc_login ...
NSS tools : pk12util
information in a pretty-print ascii format, which displays the information about the certificates and public keys in the p12 file. -v enable debug logging when importing. -w p12filepasswordfile specify the text file containing the pkcs #12 file password. -w p12filepassword specify the pkcs #12 file password. ...
...the certificates and public keys in the p12 file. -v enable debug logging when importing. -w p12filepasswordfile specify the text file containing the pkcs #12 file password. -w p12filepassword specify the pkcs #12 file password. ...
S/MIME functions
the nss version column indicates which versions of nss support the function. ...
...the nss version column indicates which versions of nss support the function. ...
NSS Tools certutil
create a new binary certificate file from a binary certificate-request file. use the -i argument to specify the certificate-request file. if this argument is not used certificate database tool prompts for a filename. -g generate a new public and private key pair within a key database. the key database should already exist; if one is not present, this option will
initialize one by default. some smart cards (for example, the litronic card) can store only one key pair. if you create a new key pair for such a card, the previous pair is overwritten. -f delete a private key from a key database. specify the key to delete with the -n argument. specify the database from which to delete the key with the -d argument. use the -k argumen...
...til -k -htokenname . -k list the keyid of keys in the key database. a keyid is the modulus of the rsa key or the publicvalue of the dsa key. ids are displayed in hexadecimal ("0x" is not shown). -a add an existing certificate to a certificate database. the certificate database should already exist; if one is not present, this option will
initialize one by default. -d delete a certificate from the certificate database. -l list all the certificates, or display information about a named certificate, in a certificate database. use the -htokenname argument to specify the certificate database on a particular hardware or software token. -v check th...
NSS Tools pk12util
the cryptographic module does not support the requested algorithm and a best fit will be selected, likely to be the default. if no suitable replacement for the desired algorithm can be found a "no security module can perform the requested operation" will appear on the error message. ...
...est fit will be selected, likely to be the default. if no suitable replacement for the desired algorithm can be found a "no security module can perform the requested operation" will appear on the error message. ...
NSS tools : pk12util
meta-data. -r dumps all of the data in raw (binary) form. this must be saved as a der file. the default is to return information in a pretty-print ascii format, which displays the information about the certificates and public keys in the p12 file. ...
... a der file. the default is to return information in a pretty-print ascii format, which displays the information about the certificates and public keys in the p12 file. ...
Necko Architecture
tances that know how to interpret the protocol that the handler registered for. however, a protocol handler implementation also might "cache" the underlying transports so channels it creates can reuse them later. the channel does the true work of protocol interpretation and data movement (if any). although the protocol handler creates channels, protocol interpretation doesn't begin until the user
initiates the transaction using the nsichannel api. receiving data & nsistreamlistener you can read or write, from or to a channel using either the synchronous api, or the asynchronous api. if you want to move data asynchronously you need to be able to receive callbacks using an implementation of nsistreamlistener. an nsistreamlistener is told when the uri transaction has "started," when data is av...
.... streams provide a generic interface to the data and allow for many underlying implementations that permit multiple data sources to be used. as a user, you don't care where the data came from, or where it "is," as long as you get the data. the data may be in memory, it may be on disk, or it may be located somewhere else. the point is that streams provide a loose interface for data access. if you
initiate a synchronous transfer on a channel, you are handed back a stream that you can read or write from or to. if you
initiate an asynchronous transfer, you receive callbacks that notify you when things are happening. in the case of an asynchronous read... when you receive the ondataavailable() callback, you are handed an nsiinputsteam which you can read the data from (you will more than likely nee...
Rhino Examples
actory.java is an example of a wrapfactory that can be used to control the wrapping behavior of the rhino engine on calls to java methods. multithreaded script execution dynamicscopes.java is a program that creates a single global scope object and then shares it across multiple threads. sharing the global scope allows both information to be shared across threads, and amortizes the cost of context.
initstandardobjects by only performing that expensive operation once. implementing host objects first check out the tutorial if you haven't already. the foo class - extending scriptableobject foo.java is a simple javascript host object that includes a property with an associated action and a variable argument method. the matrix class - implementing scriptable matrix.java provides a simple multidimensi...
... ...
Rhino serialization
lization stream class. so why do we need these specialized stream classes instead of simply using objectoutputstream and objectinputstream? to understand the answer we must know what goes on behind the scenes when rhino serializes objects. how rhino serialization works by default, java serialization of an object also serializes objects that are referred to by that object. upon deserialization the
initial object and the objects it refers to are all created and the references between the objects are resolved. however, for javascript this creates a problem. javascript objects contain references to prototypes and to parent scopes. default serialization would serialize the object or function we desired but would also serialize object.prototype or even possibly the entire top-level scope and everyth...
...o the new scope upon deserialization. it is also possible to add names of objects to a list in the scriptableoutputstream object. these objects will also be saved as markers upon serialization and resolved in the new scope upon deserialization. use the addexcludedname method of scriptableoutputstream to add new names. by default, scriptableoutputstream excludes all the names defined using context.
initstandardobjects. if you are using rhino serialization in an environment where you always define, say, a constructor foo, you should add the following code before calling writeobject: out.addexcludedname("foo"); out.addexcludedname("foo.prototype"); this code will prevent foo and foo.prototype from being serialized and will cause references to foo or foo.prototype to be resolved to the objects in ...
Functions
uate a name, instead of walking the scope chain, we just take the value from the reserved slot. the function object's parent is the global object. flat closures and null closures have been removed: https://bugzilla.mozilla.org/show_bug.cgi?id=730497 https://bugzilla.mozilla.org/show_bug.cgi?id=739808 name lookups in order of speed, fastest to slowest. arg and local instructions. if a name def
initely refers to an argument or local variable of the immediately enclosing function, it can be accessed using jsop_{get,set,call}{arg,local} instructions. some of these can even be fused with other operations into combo instructions like jsop_getargprop, jsop_forlocal, and jsop_inclocal. because arguments and locals can't be deleted, this optimization is available to all functions, and eval does not...
... can: function f(s) { eval(s); print(s); // s can be loaded with getarg with (obj) { print(s); // no getarg here; s might refer to obj.s } } upvar instructions. jsop_{get,call}upvar (in algol-like functions only, i think?) todo dslot instructions. jsop_{get,call}dslot (in flat closures only) todo gvar instructions. outside all functions, if a name def
initely refers to a global for which we have seen a var, const, or function declaration, then we emit a js_defvar instruction in the script prelude and access the global using jsop_{get,set,call}gvar. this is fast if the global either doesn't exist before the script runs (the script creates it) or it's a non-configurable data property (which amounts to the same thing). otherwise the gvar instructions ...
Exact Stack Rooting
js::rooted<t> rootedt; -> rootedobject, rootedstring, rootedscript, etc. because of the lifo restriction, using this interface manually is extremely 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 it is never correct to implicitly copy a js::rootedt (more on this in a second) we have deleted the copy constructor from these classes. therefore, we are forced to force you to
initialize with constructor syntax. sorry. note 2: in c++, destructors are r...
...m if you store a gcpointer on the heap. there are moz_stack_class annotations that will cause a separate static analysis to fail if these are detected. storing a js::handlet on the heap. it is very easy for the handle to outlive its root if you do this. again, there are annotations with moz_stack_class. returning a js::handlet from a function. if you do this, a handle may outlive its root. def
initions gc - acronym for garbage collection: specifically spidermonkey's method of automatically managing javascript program memory. gcthing - storage allocated by spidermonkey's allocator. gcpointer - a raw pointer type or tagged pointer type that may refer to a gcthing (jsobject *, jsstring *, value, jsid, etc.) gcheap - the graph of gcthings allocated by spidermonkey's allocator. the goal of...
Garbage collection
location during an incremental gc, thus the name allocate-black. the spidermonkey incremental read barrier the textbook version of incremental gc has only a write barrier. spidermonkey also needs a read barrier for weak references (see dictionary). this is because weak references have a similar problem as is solved by the incremental write barrier above, but cannot use the same solution. by def
inition, a weak reference should not hold a target live by itself. that means that we can't trace weak references when we encounter them during gc graph traversal. instead, we append them to a list. after marking everything live we scan through the list to null out references to garbage. but this also means that pre-barriers are inadequate to prevent incremental gc from missing edges due to graph mut...
... that need to be marked, e.g., an array of jsobject pointers. in this example, if the private field is overwritten, the jsobject pointers could be 'lost', so a write barrier must be invoked to mark them. js::nativeobject::privatewritebarrierpre takes care of this by invoking the jsobject's class trace hook before the private field is set. another detail is that write barriers can be skipped when
initializing fields of newly allocated objects, because no pointer is being overwritten. sweeping todo generational gc todo gc statistics api you can access the light statistics the gc keeps at runtime through the gc statistics api. source files gc/gc.{h,cpp} defines gc internal api functions, including entry points to trigger gc. gc/barrier[-inl].h implements incremental and generational w...
SpiderMonkey Internals
rmant implementation of built-in functions. all self-hosted code lives in .js files under builtin/. for details on implementing self-hosted built-ins, see self-hosting. file walkthrough jsapi.cpp, jsapi.h the public api to be used by almost all client code. jspubtd.h, jsprvtd.h these files exist to group struct and scalar typedefs so they can be used everywhere without dragging in struct def
initions from n different files. the jspubtd.h file contains public typedefs, and is included automatically when needed. the jsprvtd.h file contains private typedefs and is included by various .h files that need type names, but not type sizes or declarations. jsdbgapi.cpp, jsdbgapi.h the debugging api. provided so far: traps, with which breakpoints, single-stepping, step over, step out, and so on c...
...eplacing the .msg file; or, with a little modification to the source, at run time. more information on the javascript shell. js.msg spidermonkey error messages. jsarray.*, jsbool.*, jsdate.*, jsfun.*, jsmath.*, jsnum.*, jsstr.* these file pairs implement the standard classes and (where they exist) their underlying primitive types. they have similar structure, generally starting with class def
initions and continuing with internal constructors, finalizers, and helper functions. jsobj.*, jsscope.* these two pairs declare and implement the js object system. all of the following happen here: creating objects by class and prototype, and finalizing objects; defining, looking up, getting, setting, and deleting properties; creating and destroying properties and binding names to them. the ...
JSClass.flags
than null or undefined (including to an object that emulates undefined) are unaffected by this flag. strict equality (=== and !==) comparisons are also unaffected by this flag. mxr id search for jsclass_emulates_undefined jsclass_has_reserved_slots(n) indicates that instances of this class have n reserved slots. n is an integer in the range [0..255]. the slots
initially contain unspecified valid jsval values. they can be accessed using js_getreservedslot and js_setreservedslot. (the jsclass.reserveslots hook also allocates reserved slots to objects.) mxr id search for jsclass_has_reserved_slots jsclass_global_flags this flag is only relevant for the class of an object that is used as a global object. (ecmascript speci...
...ts of this class the jsprop_shared attribute. jsclass_new_resolve_gets_start obsolete since jsapi 16 the resolve hook expects to receive the starting object in the prototype chain passed in via the *objp in/out parameter. (this is meaningful only if the jsclass_new_resolve flag is also set.) jsclass_construct_prototype obsolete since jsapi 11 instructs js_
initclass to invoke the constructor when creating the class prototype. jsclass_is_extended obsolete since jsapi 17indicates that this jsclass is really a jsextendedclass. jsclass_mark_is_trace obsolete since jsapi 5 indicates that the mark hook implements the new jstraceop signature instead of the old jsmarkop signature. this is recommended for all new code th...
JSExtendedClass
obsolete since javascript 1.8.5this 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. jsextendedclass is an extended version of jsclass with additional hooks. a c/c++ program can use a jsextendedclass with the js_
initclass and js_newobject apis to create objects that have custom methods and properties implemented in c/c++. syntax struct jsextendedclass { jsclass base; jsequalityop equality; jsobjectop outerobject; jsobjectop innerobject; jsiteratorop iteratorobject;// added in spidermonkey 1.8 jsobjectop wrappedobject; // added in spidermonkey 1.8 ...and additional reserved fields. }; name ty...
... are all equal under ===. description to implement a custom class that uses any of the jsextendedclass callbacks: create a jsextendedclass and populate both the base fields and the extended fields. ensure that the additional reserved fields at the end of the jsextendedclass are null. jsclass and jsextendedclass structs should usually be global, and in this case the compiler automatically
initializes these fields to null. (this is a feature of the c and c++ languages.) otherwise, use memset. set the jsclass_is_extended flag in myextendedclass.base.flags. pass &myextendedclass.base to functions like js_
initclass or js_newobject that require a jsclass *. see also bug 571789 ...
JSFunctionSpec
uint16_t the bitwise or of any number of function flags. selfhostedname const char * the function's name in self-hosted javascript code. description jsfunctionspec defines the attributes for a single js function to associate with an object. an application typically has an array of jsfunctionspec to define all the functions for an object and calls js_definefunctions or js_
initclass to create the functions and assign them to an object. jsfunctionspec can also be used to define an array element rather than a named property. array elements are actually individual properties. to define an array element, cast the element's index value to const char*,
initialize the name field with it, and specify the jsprop_index attribute in flags. to define an array of jspropertyspec, use...
...n flags. ...
JSObjectOps.newObjectMap
s created. it creates a jsobjectmap that completely controls the new object's behavior. syntax typedef jsobjectmap * (*jsnewobjectmapop)(jscontext *cx, jsrefcount nrefs, jsobjectops *ops, jsclass *clasp, jsobject *obj); name type description cx jscontext * pointer to the js context in which the new object is being created. nrefs jsrefcount the
initial reference count for the new jsobjectmap. ops jsobjectops * the ops for the new jsobjectmap. clasp jsclass * the jsclass of the new object. obj jsobject * the new object. description note: the jsapi does not expose the data structure that would be necessary to develop new jsobjectmap subclasses. an application that implements jsobjectops mus...
...necessary to develop new jsobjectmap subclasses. an application that implements jsobjectops must therefore either implement the newobjectmap by including the non-public header jsobj.h, or obtain the default newobjectmapop by calling the jsclass.getobjectops callback of a standard jsclass. create a new instance of (a concrete subclass of) jsobjectmap (see jsobj.h), with the nrefs and ops members
initialized from the same-named parameters, and with the nslots and freeslot members
initialized according to ops and clasp. return null on error, non-null on success. jsobjectmaps are reference-counted by generic code in the engine. usually, the nrefs parameter to jsobjectops.newobjectmap will be 1, to count the ref returned to the caller on success. after a successful construction, some number of j...
JSPrincipals
ipt. properties name type description refcount mozilla::atomic<int32_t> reference count. use js_holdprincipals and js_dropprincipals. codebase char * pointer to the codebase for the principal. obsolete since jsapi 13 getprincipalarray void * (*)(jscontext *, jsprincipals *) pointer to the function that returns an array of principal def
initions. 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 decrements the reference count and possibly frees the principals if they are no longer in use. obsolete since jsapi 13 ...
...e increased by one. each time an object is dereferenced, refcount must be decremented by one. when refcount reaches zero, the principals are no longer in use and are destroyed. use the js_holdprincipals to increment refcount, and use js_dropprincipals to decrement 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 the js_...forprincipals functions. some examples of security-enhanced api call are js_compilescriptforprincipals, js_compilefunctionforprincipals, and js_evaluatescriptforprincipals. these functions ensure that the given jsprincipals object is indelibly associated not only with the script being compiled or evaluated, but w...
JS_ConstructObject
copy of the constructor function for the class, then to call it using js_new. a less-preferred short-term solution might be to use this reimplementation of the method, but note that this reimplementation is not guaranteed to continue working across spidermonkey releases. create a new object of the specified class, with the specified prototype and parent, then invokes a constructor function to
initialize the new object. syntax jsobject * js_constructobject(jscontext *cx, jsclass *clasp, jsobject *proto, jsobject *parent); jsobject * js_constructobjectwitharguments(jscontext *cx, jsclass *clasp, jsobject *proto, jsobject *parent, unsigned int argc, jsval *argv); name type description cx jscontext * the context in which to create the new object. requ...
... arguments to pass to the constructor. this may be null if argc is zero. otherwise, the first argc elements of this array must be populated with valid jsval values. the caller does not need to ensure that the array elements are rooted. description js_constructobject creates a new object of the specified class, with the specified prototype and parent, then invokes a constructor function to
initialize the new object. cx is a pointer to a context associated with the runtime in which to create the new object. clasp is a pointer to the class of object to create. proto and parent may specify objects to be used as the new object's prototype and parent. if either is null, the engine tries to find reasonable defaults. js_constructobjectwitharguments is the same but additionally passes zero or ...
JS_DefineElement
e the new property. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject or jsobject * the object on which to create the new property. index uint32_t the index of the property to define. value js::handlevalue or js::handleobject or js::handlestring or int32_t or uint32_t or double or jsval
initial value to assign to the property. getter jsnative or jspropertyop getproperty method for retrieving the current property value. setter jsnative or jsstrictpropertyop setproperty method for specifying a new property value. flags unsigned property attributes. obsolete since jsapi 32 description js_defineelement defines a numeric property for a ...
...sstrictpropertyop setproperty method for specifying a new property value. flags unsigned property attributes. obsolete since jsapi 32 description js_defineelement defines a numeric property for a specified object, obj. index is the index of the element being defined. value is one of js::value, jsobject, jsstring, int32_t, uint32_t, or double that defines the property's
initial value. getter and setter identify the getproperty and setproperty methods for the property, respectively. if you pass null values for these entries, js_defineelement assigns the default getproperty and setproperty methods to this element. obsolete since jsapi 32 flags contains the property attributes to set for the new property. on success, js_defineelement returns true. otherwise it returns...
JS_DefineProperties
pointer to the first element of an array of jspropertyspec structures. each array element defines a single property: its name, attributes, getter, and setter. the name field of the last array element must be null. js_defineproperties creates one property for each element in the array before the element with a null name field. each property is defined as though by calling js_defineproperties. ...
...though by calling js_defineproperties. the
initial stored value of each property created is undefined. on success, js_defineproperties returns true, indicating it has created all properties listed in the array. otherwise it returns false. ...
JS_GetNaNValue
. for example, 0/0 and math.sqrt(-1) both return nan. so do number("xyzzy") and math.sin("frank"). ...
...qrt(-1) both return nan. so do number("xyzzy") and math.sin("frank"). ...
JS_GetParent
s created by standard library functions, such as array.prototype.concat, have the global object as their parent. an object created by a script via the new keyword has the same parent as the constructor. for example, after d = new date, d has the same parent as date, ordinarily the global object. an object created by a script via implicit conversion (the ecmascript toobject operator), an object
initializer ({a: 1, b: 2}), or an array
initializer ([1, 2, 3]), has the global object as its parent. the parent of a function created by evaluating a function declaration or function expression in a script depends on the lexical scope of the function. if there is no enclosing function, with statement, or block scope, then the function's parent is the global object. otherwise, the parent is implemen...
... scope of the function. if there is no enclosing function, with statement, or block scope, then the function's parent is the global object. otherwise, the parent is implementation-defined. it may be a call, with, or block object representing the function's dynamic scope, or it may be the global object. in any case the global object is guaranteed appear on the new function's parent chain. the
initial parent of an object created via the jsapi depends on the particular jsapi function (of which there are many that create objects, including but not limited to js_newobject, js_constructobject, js_defineobject, js_valuetoobject, js_newarrayobject, js_newscriptobject, js_newfunction, js_compilefunction, js_definefunction, js_definefunctions, and js_
initclass). some of these functions allow the ap...
JS_IsConstructing_PossiblyWithGivenThisObject
jsobject **maybethis); name type description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. vp const jsval * maybethis jsobject ** description in the case of a constructor called from js_constructobject and js_
initclass where the class has the jsclass_construct_prototype flag set, spidermonkey passes the constructor a non-standard this object. in such cases, the following example would provide the additional information of whether a special this was supplied. jsbool foo_native(jscontext *cx, unsigned int argc, jsval *vp) { jsobject *maybethis; if (js_isconstructing_possiblywithgiventhisobject(cx, vp, &...
...formation of whether a special this was supplied. jsbool foo_native(jscontext *cx, unsigned int argc, jsval *vp) { jsobject *maybethis; if (js_isconstructing_possiblywithgiventhisobject(cx, vp, &maybethis)) { // native called as a constructor if (maybethis) // native called as a constructor with maybethis as 'this' } else { // native called as function, maybethis is still un
initialized } } note: a spidermonkey embedding does not need to use this query unless the embedding uses js_constructobject(), js_
initclass() and jsclass_construct_prototype as described above. see also bug 702507 ...
JS_NewContext
ze_t the size, in bytes, of each "stack chunk". this is a memory management tuning parameter which most users should not adjust. 8192 is a good default value. description js_newcontext creates a new jscontext in the runtime rt. on success, it returns a pointer to the new context. otherwise it returns null. for more details about contexts, see jscontext. for sample code that creates and
initializes a jscontext, see jsapi user guide. the stackchunksize parameter does not control the javascript stack size. (the jsapi does not provide a way to adjust the stack depth limit.) passing a large number for stackchunksize is a mistake. in a debug build, large chunk sizes can degrade performance dramatically. the usual value of 8192 is recommended. the application must call js_destroycontext ...
...ay to adjust the stack depth limit.) passing a large number for stackchunksize is a mistake. in a debug build, large chunk sizes can degrade performance dramatically. the usual value of 8192 is recommended. the application must call js_destroycontext when it is done using the context. before a jsruntime may be destroyed, all the jscontexts associated with it must be destroyed. the new jscontext
initially has no global object. the new jscontext is associated with the calling thread. no other thread may use it or destroy it. see also mxr id search for js_newcontext js_destroycontext js_contextiterator js_setcontextcallback ...
JS_PSGS
syntax #define js_psg(name, getter, flags) ... #define js_psgs(name, getter, setter, flags) ... #define js_self_hosted_get(name, gettername, flags) ... // added in spidermonkey 31 #define js_self_hosted_getset(name, gettername, settername, flags) ... // added in spidermonkey 31 #define js_ps_end ... name type description name const char * the javascript name for the property. ...
...c/c++ implementation of the setter function. flags uint16 the bitwise or of any number of property attributes. gettername const char * the function's name in self-hosted javascript code for getter function. settername const char * the function's name in self-hosted javascript code for setter function. description these macros encapsulate the def
inition of jsnative-backed jspropertyspecs, by defining the jsnativewrappers for them. see also mxr id search for js_psg mxr id search for js_psgs mxr id search for js_self_hosted_get mxr id search for js_self_hosted_getset jspropertyspec js_defineproperties js_
initclass bug 684526 - added. bug 938728 - added js_self_hosted_get and js_self_hosted_getset. ...
JS_ResolveStandardClass
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ...
... out parameter. if the id is resolved, true is stored into *resolved if success. false otherwise. description js_resolvestandardclass resolves id, which must contain either a string or an int, to a standard class name in obj if possible, defining the class's constructor and/or prototype and storing true in *resolved. if id does not name a standard class or a top-level property induced by
initializing a standard class, store false in *resolved and just return true. return false on error, as usual for bool result-typed api entry points. this api can be called directly from a global object class's resolve op, to define standard classes lazily. the class's enumerate op should call js_enumeratestandardclasses(cx, obj), to define eagerly during for...in loops any classes not yet resolved l...
JS_ShutDown
h js_destroycontext, and so on. calling this method before all other resources have been destroyed has undefined behavior. failure to call this method, at present, has no adverse effects other than leaking memory. this may not always be the case; it's recommended that all embedders call this method when all other jsapi operations have completed, to be future-proof. it is currently not possible to
initialize spidermonkey multiple times (that is, calling js_
init, then other jsapi methods, then js_shutdown in that order, then doing so again). this restriction may eventually be lifted. implementation note: this method has been used to clean up memory allocated by jsdtoa.cpp, memory allocated to implement date.now() on windows, and when the internationalization api is enabled, memory internally all...
...lly be lifted. ...
Property attributes
internally as an integer, not a string. obsolete since jsapi 39 this flag has an additional special meaning when used with js_defineproperty, js_fs, and other apis that define properties: it means that the name parameter is actually an integer unsafely cast to a pointer type, not a string. mxr id search for jsprop_index jsprop_define_late don't define property when
initially creating the constructor. some objects like function/object have self-hosted functions that can only be defined after the
initialization is already finished. added in spidermonkey 38 mxr id search for jsprop_define_late jsfun_stub_gsops use js_propertystub getter/setter instead of defaulting to class gsops for property holding function. added in spidermonkey 17 ...
... in spidermonkey 38 mxr id search for jsprop_redefine_nonconfigurable jsprop_resolving resolve hooks and enumerate hooks must pass this flag when calling js_define* apis to reify lazily-defined properties. jsprop_resolving is used only with property-defining apis. it tells the engine to skip the resolve hook when performing the lookup at the beginning of property def
inition. this keeps the resolve hook from accidentally triggering itself: unchecked recursion. for enumerate hooks, triggering the resolve hook would be merely silly, not fatal, except in some cases involving non-configurable properties. added in spidermonkey 45 mxr id search for jsprop_resolving jsprop_ignore_enumerate ignore the value in jsprop_enumerate. this fla...
SpiderMonkey 45
reserves the js:: namespace for itself for public exports and the js:: namespace for internal use. ...
...ylength js_idarrayget js_destroyidarray js_defaultvalue js_getparent js_setparent js::parsepropertydescriptorobject js_deleteproperty2 js_deletepropertybyid2 js_deleteucproperty2 js_deleteelement2 js_newfunctionbyid js_bindcallable js_decompilefunctionbody js_getlatin1internedstringchars js_gettwobyteinternedstringchars js_newdateobjectmsec js_cleardatecaches changed apis js_
init has moved from jsapi.h to js/
initialization.h js_shutdown has moved from jsapi.h to js/
initialization.h js_
initreflect is now implicit js_addweakpointercallback is replaced with js_addweakpointerzonegroupcallback and js_addweakpointercompartmentcallback js_removeweakpointercallback is replaced with js_removeweakpointerzonegroupcallback and js_removeweakpointercompartmentcallback api changes...
Handling Mozilla Security Bugs
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 members can be added to the mozilla security bug group as follows: new people can apply to join the security bug group, or may be recruited by existing members. applicants for membership must have...
...g, the security bug group will discuss the issue via its mailing list and attempt to reach consensus. if necessary mozilla.org staff will serve as the "court of final appeal." a final point about duplicate bug reports: note that security bugs marked as duplicates are still considered separate as far as disclosure is concerned. thus, for example, if a particular security vulnerability is reported
initially and then is independently reported again by someone else, each bug reporter retains control over whether to publicly disclose their own bug, but their decision will not affect disclosure for the bug reported by the other person. changing this policy this policy is not set in stone. it is our hope that any disputes that arise over membership, disclosure, or any other issue addressed by this...
Embedded Dialog API
s to create new windows, and an embedding application must implement at least this much. applications concerned with a consistent overall dialog appearance will probably choose to implement the complete api as well. an embedding application must implement the nsiwindowcreator nsiwindowcreator interface and hand off a reference to the implementation to the windowcreator service during application
initialization. an example of this can be found in the mfc embedding testbed application, in the method cmfcembedapp::
initializewindowcreator (lxr link accurate at revision 1.20 of that file; search for the method name in later revisions). gecko uses nsiwindowcreator to create all new windows for which no explicit override (the advanced api) has been given, and for browser windows in general. the prec...
... promptservice.cpp. (testgtkembed doesn't override promptservice; it uses the default dialogs.) both are source for a library set up as a mozilla component and factory. (note to self: is there decent documentation on writing factories or components? i can't find any.) both contain implementations of nsipromptservice as native dialogs. the replacement library should be installed during application
initialization. the default dialog-posing library is a component (promptservice for instance is part of the embedding component), registered as a component during gecko
initialization (by ns_
initembedding). (line number accurate in version 1.30). after
initializing embedding, an application can override a default factory by registering its replacement. a powerplant example can be found at cbrowserapp:...
Mork
version 1.4 format has become the only official mork format. after that, the lexical structure of mork is somewhat simple. the file is a collection of top-level structures, of which there exists four: dictionaries, tables, rows, and groups (changesets). dictionaries, tables, and rows all have corresponding metastructures. meta-dictionaries are in practice only used to change the scope of alias def
initions (the '(a=c)' that you can see in files). meta-tables are used to establish some facts about the table as well as the default row scope. meta-rows do not appear to be used at all, although the parser seems to consider setting the charset, row scope, and atom scope. some notes on further terminology: when referring to cells or aliases, the first component is the key and the second component i...
...is the row id, with the scope being an important part of the id, in that 1:scope1 is not the same row as 1:scope2. if the scope is not specified, then it is the default scope of the table (if it has one) or 'r' otherwise. these row ids are global, even if defined in a table. indeed, defining a row in a table is a shortcut for both defining a row and adding the row to the table. the presence of an
initial minus means to delete all cells before adding new cells. a minus after the mid indicates that the next cell should be deleted. i haven't seen that case though, so it may not be an issue in practice. the rowreference is a mid that refers to a specific row. if it occurs in a table, you can treat it as adding that row to a table; in a meta-table, it is the same as making that row the meta-row of ...
Aggregating the In-Memory Datasource
introduction you can use xpcom aggregation1 with the in-memory datasource. why would you want to do this? say you were writing a datasource2, and the way you chose to implement it was to "wrap" the in-memory datasource; i.e., myclass : public nsimyinterface, public nsirdfdatasource { private: nscomptr<nsirdfdatasource> minner; public: // nsirdfdatasource methods ns_imethod
init(const char* auri) { return minner->
init(auri); } ns_imethod geturi(char* *auri) { return minner->geturi(auri); } // etc., for each method in nsirdfdatasource! }; very painful, prone to errors, and fragile as the interfaces are still in flux (a wee bit). aggregation to the rescue! here are the gory details on how. when it won't work although this magic is terribly con...
...n a com book. for more information on writing a datasource, see the rdf datasource how-to document. you could also forward other interfaces to the minner that youknow it can support; however, this is extremely risky. it's risky because another implementation of the same object mightnot support those interfaces. then the queryinterface() will be forwarded back to you, and we'll recurse off to inf
inity (and beyond!... interwiki language links ...
Fun With XBL and XPConnect
once the regular xul textfield widget is bound to this interface, it calls the auto complete function of the object using regular javascript. the basic model of interaction is as follows: binding to the xpcom object the widget holds onto an xpcom object that is the auto complete engine that will perform our auto complete lookups. ...
...ield class="addressingwidget"/> <xul:menupopup/> </content> <implementation> <property name="autocompletesession"> <![cdata[ components.classes['component://netscape/messenger/autocomplete&type=addrbook']. getservice(components.interfaces.nsiautocompletesession); ]]> </property> so we've defined a property on the widget called autocompletesession. the
initial value of this property evaluates to an xp-connect object. now accesses to autocompletesession will return the xp-connect object. exposing the xpcom interfaces one somewhat nasty trick you need to do is to manually expose the interfaces of the xpcom object that you want your widget to support. all you have to do is specifically defining a method on the xbl widget which forwards the method cal...
XPCOM glue
odules, i.e. extension or xulrunner application components, should use the dependent glue. code which wishes to use only frozen symbols but can tolerate a load-time dependency on xpcom.dll should link against xpcomglue_s.lib and xpcom.lib. it should not link against xpcom_core.lib. this is the case for xpcom components, because they are loaded into mozilla which already has full xpcom loaded and
initialized. frozen linkage: standalone glue (no dll dependencies) note: support for locating a standalone glue was removed in gecko 6.0. use this when you have a custom application where you want to embed gecko to show webpages in your own window. i.e. this linkage strategy is used when an embedder needs to bootstrap xpcom by finding a compatible gre on disk and loading it. in order to use xpco...
...ed when an embedder needs to bootstrap xpcom by finding a compatible gre on disk and loading it. in order to use xpcom, the embedding application first needs to find where the xpcom runtime is located. this is typically done using gre_getgrepathwithproperties. then, the code must call xpcomgluestartup, which will dynamically link against the xpcom runtime. only then can the embedding application
initialize and use xpcom. embedding code which wishes to use only frozen symbols and cannot tolerate a load-time dependency on xpcom.dll should #define xpcom_glue 1 while compiling, and link against xpcomglue.lib. it should not link against xpcomglue_s.lib or xpcom.lib. embedders using the standalone glue typically also need to avoid linking against nspr as well. however, when using threadsafe toget...
Finishing the Component
when the component starts up, it populates a list of urls read in from a file stored next to the gecko binary on the local system. using frozen interfaces the core functionality of blocking sites is still missing, however. ...
...d and instantiate factories to obtain * services. * * users of the service manager must first obtain a pointer to the * global service manager by calling ns_getservicemanager. after that, * they can request specific services by calling getservice. * when they are finished they can ns_release() the service as usual. * * a user of a service may keep references to particular services * indef
initely and only must call release when it shuts down. * * @status frozen */ these frozen interfaces and functions are part of the gecko sdk. the rule of thumb is that interfaces outside of the sdk are considered "experimental" or unfrozen. see the following sidebar for information about how frozen and unfrozen interfaces can affect your component development, and for technical details about how ...
Setting up the Gecko SDK
x81, 0x61, 0x16, 0x5f } } class cspecialthing : public ispecialthing { public: ns_decl_isupports ns_decl_ispecialthing cspecialthing(); private: ~cspecialthing(); protected: /* additional members */ nsstring mname; }; #endif cspecialthing.cpp #include "cspecialthing.h" ns_impl_isupports1(cspecialthing, ispecialthing) cspecialthing::cspecialthing() { /* member
initializers and constructor code */ mname.assign(l"default name"); } cspecialthing::~cspecialthing() { /* destructor code */ } /* attribute astring name; */ ns_imethodimp cspecialthing::getname(nsastring & aname) { aname.assign(mname); return ns_ok; } ns_imethodimp cspecialthing::setname(const nsastring & aname) { mname.assign(aname); return ns_ok; } /* long add (in long a,...
...cspecialthing.lib" /machine:i386 xpcom.lib xpcomglue_s.lib nspr4.lib "cspecialthing.obj" "cspecialthingmodule.obj" clean: del *.lib *.dll *.obj *.exp please note, this makefile is only for compiling the sample, you will probably have more .lib files if you are linking against winapi functions like kernel32.lib, user32.lib, etc. also, if you notice, this turns on "xp_win" and "xp_win32" def
initions, this allows xp and onward support. to build the component, just type "gmake", to clean up files run "gmake clean". installing component this if for manually installing the component for testing. i used a different firefox profile for testing purposes called extensions. copy the .dll file to your extensions directory. %applicationdata%\mozilla\firefox\profiles\x.extensions\extensions\bob...
How to build a binary XPCOM component using Visual Studio
d modify the component files to add your own functionality. to make the project, you start with a standard multi-thread dll project. then make the following tweaks: add "..\gecko-sdk\include" to additional include directories add "..\gecko-sdk\lib" to additional library directories add "nspr4.lib xpcom.lib xpcomglue_s.lib" to additional dependencies add "xp_win;xp_win32″ to preprocessor def
initions turn off precompiled headers (just to keep it simple) use a custom build step for the xpcom idl file (spawns xpidl-build.bat to process the idl with mozilla toolset, not midl) vc++ express project: xpcom-test.zip note: the project uses xpcom_glue. it also uses frozen linkage (dependent on xpcom). i am not defining xpcom_glue and i am linking against xpcomglue_s.lib create an xpcom compon...
...0x11db, { 0x96, 0x73, 0x0, 0xe0, 0x81, 0x61, 0x16, 0x5f } } class cspecialthing : public ispecialthing { public: ns_decl_isupports ns_decl_ispecialthing cspecialthing(); private: ~cspecialthing(); protected: /* additional members */ nsstring mname; }; #endif cpp file: #include "comp-impl.h" ns_impl_isupports1(cspecialthing, ispecialthing) cspecialthing::cspecialthing() { /* member
initializers and constructor code */ mname.assign(l"default name"); } cspecialthing::~cspecialthing() { /* destructor code */ } /* attribute astring name; */ ns_imethodimp cspecialthing::getname(nsastring & aname) { aname.assign(mname); return ns_ok; } ns_imethodimp cspecialthing::setname(const nsastring & aname) { mname.assign(aname); return ns_ok; } /* long add (in long a, in long b); */ ns...
Components.isSuccessCode
success or failure of the complex task, you would call components.issuccesscode() upon the status code included in the notification. examples checking whether copying a stream's data succeeded the following example demonstrates copying data from a buffered nsiinputstream to an nsioutputstream, checking for whether the copy succeeded using components.issuccesscode(). note: nsiasyncstreamcopier.
init() has changed in gecko 1.9.2, omit last 2 boolean parameters if you're using gecko 1.9.1 and earlier. const cc = components.classes; const ci = components.interfaces; const cr = components.results; // global flags polled externally var copyfailed = false; var copyinprogress = false; function copybufferedstream(instream, outstream) { var copyobserver = { onstartrequest: function(req...
...(statuscode)) copyfailed = true; }, queryinterface: function(aiid) { if (aiid.equals(ci.nsirequestobserver) || aiid.equals(ci.nsisupports)) return this; throw cr.ns_error_no_interface; } }; var copier = cc["@mozilla.org/network/async-stream-copier;1"] .createinstance(ci.nsiasyncstreamcopier); copier.
init(instream, outstream, null, true, false, 8192, true, true); copier.asynccopy(copyobserver, null); } ...
PyXPCOM
com, a developer can talk to xpcom or embed gecko from a python application. pyxpcom is similar to javaxpcom (java-xpcom bridge) or xpconnect (javascript-xpcom bridge). mozilla defines many external interfaces available to embeddors and component developers. pyxpcom provides access to these interfaces as python interfaces. pyxpcom also contains several classes that provide access to functions for
initializing and shutting down xpcom and gecko from python, as well as some xpcom helper functions. documentation building pyxpcom the instructions for building pyxpcom. creating a python xpcom component an example of how to create a simple xpcom component with python. getting to know pyxpcom ...
...te a simple xpcom component with python. getting to know pyxpcom pyxpcom is a bridging technology between xpcom and python. this article gives you a head start to pyxpcom. note: the links to part ii and iii of this series are broken and i cannot find them on the ibm site. please update this page if/when the links can be found. history pyxpcom was
initially developed by activestate tool corporation, and came out of their komodo project. current releases are now integrated with the mozilla build system. other resources pythonext - extension that provides pyxpcom samples - demo applications using pyxpcom community python-xpcom bindings mailing list (activestate) #pyxpcom on irc.mozilla.org so...
nsEmbedCString
nsembedcstring. ...
...on returns a const pointer to the string's null-terminated, internal buffer. ...
nsEmbedString
s for nsembedstring. ...
...function returns a const pointer to the string's null-terminated, internal buffer. operators operator= this operator is a shortcut for the inherited nsastring::assign family of functions. remarks the methods defined on nsembedstring are implemented as inline wrappers around the xpcom string functions, prefixed with ns_string. see, for example, ns_stringcontainer
init. see also ns_stringcontainer
init, nsastring ...
imgIContainer
edata, out unsigned long palettelength); obsolete since gecko 2.0 unsigned long getframeimagedatalength(in unsigned long framenumber); obsolete since gecko 2.0 imagecontainer getimagecontainer(); native code only! ...
...etrootlayoutframe(); parameters none. return value missing description exceptions thrown missing exception missing description violates the xpcom interface guidelines gettype() direct c++ accessor for 'type' attribute, for convenience. pruint16 gettype(); parameters none. return value missing description exceptions thrown missing exception missing description
init() obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) create a new \a awidth x \a aheight sized image container. void
init( in print32 awidth, in print32 aheight, in imgicontainerobserver aobserver ); parameters awidth the width of the container in which all the frames will fit. aheight the height of the container in which all the frames...
imgILoader
please add a summary to this article. ...
...annel(in nsichannel achannel, in imgidecoderobserver aobserver, in nsisupports cx, out nsistreamlistener alistener); boolean supportimagewithmimetype(in string mimetype); constants constant value description load_cors_anonymous 1 << 16 load_cors_use_credentials 1 << 17 methods loadimage() start the load and decode of an image. imgirequest loadimage( in nsiuri auri, in nsiuri a
initialdocumenturl, in nsiuri areferreruri, in nsiprincipal aloadingprincipal, in nsiloadgroup aloadgroup, in imgidecoderobserver aobserver, in nsisupports acx, in nsloadflags aloadflags, in nsisupports cachekey, in imgirequest arequest, in nsichannelpolicy channelpolicy ); parameters auri the uri to load. a
initialdocumenturl areferreruri the 'referring' uri. aloadingprincipal th...
mozIStorageStatementWrapper
firefox 3.5 note firefox 3.5 adds support for these features directly into the mozistoragestatement interface, so this interface is essentially deprecated. storage/public/mozistoragestatementwrapper.idlscriptable please add a summary to this article. last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsisupports method overview void
initialize(in mozistoragestatement astatement); void reset(); boolean step(); void execute(); attributes attribute type description statement mozistoragestatement the statement that is wrapped. row mozistoragestatementrow the current row. throws an exception if no row is currently available. useful only from script. the valu...
...is wrapped. row mozistoragestatementrow the current row. throws an exception if no row is currently available. useful only from script. the value of this is only valid while the statement is still executing, and is still on the appropriate row. params mozistoragestatementparams the parameters; these can be set in lieu of using the call notation on this. methods
initialize() this method
initializes this wrapper with astatement. void
initialize( in mozistoragestatement astatement ); parameters astatement the statement to be
initialized. reset() this method resets the wrapped statement. void reset(); parameters none. step() this method steps the wrapped statement. boolean step(); parameters none. return value returns true if the stepping the...
nsIApplicationCache
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 acstring groupid, in acstring clientid); void markentry(in acstring key, in unsigned long typebits); void unmarkentry(in acstring key, in unsigned long typebits); attributes attribute type description active boolean true if the cache is the active cache for this group, otherwise false. read only. clientid acstring the client id for this application cache. clients can ope...
... returned. return value an nsiapplicationcachenamespace object describing the most specific namespace matching the given key. gettypes() gets the types for a given entry in the cache. unsigned long gettypes( in acstring key ); parameters key the key for the cache entry whose types you wish to retrieve. return value a bit field indicating the entry's types. see constants for a list of types.
initashandle()
init this application cache instance to just hold the group id and the client id to work just as a handle to the real cache. used on content process to simplify the application cache code. void
initashandle( in acstring groupid, in acstring clientid ); parameters groupid missing description clientid missing description markentry() adds item types to a given entry. void markentry(...
nsIApplicationCacheNamespace
66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) application caches can store a set of namespace entries that affect loads from the application cache. if a load from the cache fails to match on an exact cache entry, the namespace entries are searched for a substring match. method overview void
init(in unsigned long itemtype, in acstring namespacespec, in acstring data); attributes attribute type description data acstring data associated with the namespace, such as a fallback. how this attribute is used varies depending on the namespace type. if the data is a uri, this attribute should be the uri's asciispec. read only. itemtype unsigned long...
...s, the cache entry specified by the data attribute should be loaded intstead. namespace_opportunistic 4 items matching this namespace should be cached opportunistically. successful top-level loads of resources in this namespace should be placed into the application cache. this can be combined with namespace_fallback to provide a fallback entry in the data attribute. methods
init()
initializes the namespace. void
init( in unsigned long itemtype, in acstring namespacespec, in acstring data ); parameters itemtype the namespace type. namespacespec the namespace's prefix. data the data to associate with the namespace. see also offline resources in firefox nsiapplicationcache nsiapplicationcachecontainer nsiapplicationcachechannel nsiapplicationcache...
nsIAsyncStreamCopier
netwerk/base/public/nsiasyncstreamcopier.idlscriptable this interface is used to copy the contents of one stream to another. inherits from: nsirequest last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void asynccopy(in nsirequestobserver aobserver, in nsisupports aobservercontext); void
init(in nsiinputstream asource, in nsioutputstream asink, in nsieventtarget atarget, in boolean asourcebuffered, in boolean asinkbuffered, in unsigned long achunksize, in boolean aclosesource, in boolean aclosesink); methods asynccopy() starts the copy operation. the specified observer is notified when the copy completes. void asynccopy( in nsirequestobserver aobserver, in nsisupports aobservercontext ); parameters aobserver receives notificati...
...ean aclosesource, in boolean aclosesink); methods asynccopy() starts the copy operation. the specified observer is notified when the copy completes. void asynccopy( in nsirequestobserver aobserver, in nsisupports aobservercontext ); parameters aobserver receives notifications. aobservercontext the object to receive notifications with information about the progress of the copy operation.
init()
initializes the stream copier. note: at least one of the streams must be buffered. void
init( in nsiinputstream asource, in nsioutputstream asink, in nsieventtarget atarget, in boolean asourcebuffered, in boolean asinkbuffered, in unsigned long achunksize, in boolean aclosesource, in boolean aclosesink ); parameters asource contains the data to be copied. asink specifies the d...
nsIAuthModule
werk/base/public/nsiauthmodule.idlscriptable this interface is intended to be used as server and client authentication service. ...
... token. aouttoken if getnexttoken succeeds, then aouttoken will point to a buffer to be sent in response to the server challenge. the length of this buffer is given by aouttokenlength. the buffer at aouttoken must be recycled with a call to nsimemory.free(). aouttokenlength if getnexttoken succeeds, then aouttokenlength contains the length of the buffer (number of bytes) pointed to by aouttoken.
init() this method is called to
initialize an auth module. the other methods cannot be called unless this method succeeds. void
init( in string aservicename, in unsigned long aserviceflags, in wstring adomain, in wstring ausername, in wstring apassword ); parameters aservicename the service name, which may be null if not applicable (for example, for ntlm, this parameter should be null). as...
nsICacheEntryDescriptor
enoutputstream(in unsigned long offset); void setdatasize(in unsigned long size); void setexpirationtime(in pruint32 expirationtime); void setmetadataelement(in string key, in string value); void visitmetadata(in nsicachemetadatavisitor visitor); attributes attribute type description accessgranted nscacheaccessmode get the access granted to this descriptor. see nsicache for the def
initions of the access modes and a thorough description of their corresponding meanings. read only. cacheelement nsisupports get or set the cache data element. this will fail if the cache entry is stream based. the cache entry holds a strong reference to this object. the object will be released when the cache entry is destroyed. file nsifile get the disk file associated with the cache entry. read ...
...ry, to prevent ever taking up space in the cache for an entry that we know up front is going to have to be evicted anyway. see bug 588507. securityinfo nsisupports get or set security info on the cache entry for this descriptor. this fails if the storage policy is not store_in_memory. storagepolicy nscachestoragepolicy get or set the storage policy of the cache entry. see nsicache for the def
initions of the storage policies. methods close() this method explicitly closes the descriptor (optional). void close(); parameters none. doom() this method dooms the cache entry this descriptor references in order to slate it for removal. once doomed a cache entry cannot be undoomed. a descriptor with write access can doom the cache entry and choose to fail pending requests. this means that pendi...
nsICacheService
ote: 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 createtemporaryclientid(in nscachestoragepolicy storagepolicy); obsolete since gecko 1.9.2 void evictentries(in nscachestoragepolicy storagepolicy); void
init(); obsolete since gecko 1.8 void shutdown(); obsolete since gecko 1.8 void visitentries(in nsicachevisitor visitor); attributes attribute type description cacheiotarget nsieventtarget the event target for cache i/o operation notifications. read only. methods createsession() this method creates a cache session. a cache session repre...
...ient id. exceptions thrown ns_error_not_implemented this method is deprecated. evictentries() this method evicts all entries in all devices implied by the storage policy. note: this function may evict some items but will throw if it fails to evict everything. void evictentries( in nscachestoragepolicy storagepolicy ); parameters storagepolicy the cache storage policy.
init() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0)
initialize the cache service. void
init(); parameters none. exceptions thrown missing exception missing description shutdown() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) shutdown() the cache service. void shutdown(); parameters none. ...
nsIChannel
r not the channel corresponds to a document uri. load_retargeted_document_uri 17 if the end consumer for this load has been retargeted after discovering its content, this flag will be set: load_replace 18 this flag is set to indicate that this channel is replacing another channel. this means that: the stream listener this channel will be notifying was
initially passed to the asyncopen() method of some other channel this channel's uri is a better identifier of the resource being accessed than this channel's originaluri. this flag can be set, for example, for redirects or for cases when a single channel has multiple parts to it (and thus can follow onstoprequest with another onstartrequest/onstoprequest pair, each pair for a different r...
...ncopen() method of some other channel this channel's uri is a better identifier of the resource being accessed than this channel's originaluri. this flag can be set, for example, for redirects or for cases when a single channel has multiple parts to it (and thus can follow onstoprequest with another onstartrequest/onstoprequest pair, each pair for a different request). load_
initial_document_uri 19 set (for example by the docshell) to indicate whether or not the channel corresponds to an
initial document uri load (for example link click). load_targeted 20 set (for example by the uriloader) to indicate whether or not the end consumer for this load has been determined. load_call_content_sniffers 21 if this flag is set, the channel sh...
nsICommandLineRunner
the nsicommandlinerunner is an extension of nsicommandline used to
initialize command lines and run them by processing the comand line handlers. toolkit/components/commandlines/public/nsicommandlinerunner.idlscriptable please add a summary to this article. last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) inherits from: nsicommandline method overview void
init(in long argc, in nscharptrarray argv, in nsifile workingdir, in unsigned long state); void run(); void setwindowcontext(in nsidomwindow awindow); attributes attribute type description helptext autf8string process and combine the help text provided by each command-line handler. read only. methods
init() called with the argc/argv combination passed to main. it assumes a native character s...
... state); void run(); void setwindowcontext(in nsidomwindow awindow); attributes attribute type description helptext autf8string process and combine the help text provided by each command-line handler. read only. methods
init() called with the argc/argv combination passed to main. it assumes a native character set. on windows the character set is utf-8, not the native codepage. void
init( in long argc, in nscharptrarray argv, in nsifile workingdir, in unsigned long state ); parameters argc the number of arguments being passed. argv an array storing pointers to the arguments workingdir directory where the command will run. this is used to resolve file and uri paths. state the type of command line being processed. this is an nsicommandline state flag. run() processes the...
nsIConverterInputStream
from: nsiunicharinputstream last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by: @mozilla.org/intl/converter-input-stream;1. ...
...es["@mozilla.org/intl/converter-input-stream;1"] .createinstance(components.interfaces.nsiconverterinputstream); method overview void
init(in nsiinputstream astream, in string acharset, in long abuffersize, in prunichar areplacementchar); constants constant value description default_replacement_character 0xfffd default replacement character value. methods
init()
initialize this stream. void
init( in nsiinputstream astream, in string acharset, in long abuffersize, in prunichar areplacementchar ); parameters astream the source stream which is read and converted. acharset the character encoding to use for converting the bytes of the stream. a value of null or "utf-8" equals utf-8 encoding. latin 1 is specified as "iso-8859-1". abuffersize define...
nsICookieService
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. afirsturi the uri that the user originally typed in or clicked on to
initiate the load of the document referenced by auri. 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. setcookiestring() set the cookie string associated with the uri. note: should be able to all...
...e 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, in nsichannel achannel ); parameters auri the uri of the document for which cookies are being queried. afirsturi the uri that the user originally typed in or clicked on to
initiate the load of the document referenced by auri. aprompt the prompt to use for all user-level cookie notifications. acookie the cookie string to set. aservertime the expiry information of the cookie (the date header from the http response). 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...
nsIDBFolderInfo
nsstring result); native code only! obsolete since gecko 1.8 void getmailboxname(in nsstring boxname); native code only! ...
... exceptions thrown missing exception missing description getuint32property() unsigned long getuint32property( in string propertyname, in unsigned long defaultvalue ); parameters propertyname missing description defaultvalue missing description return value missing description exceptions thrown missing exception missing description
initfromtransferinfo() void
initfromtransferinfo( in nsidbfolderinfo transferinfo ); parameters transferinfo missing description exceptions thrown missing exception missing description orflags() long orflags( in long flags ); parameters flags missing description return value missing description exceptions thrown missing exception mis...
nsIDNSService
eballs" strategy is used to reduce lengthy timeouts when attempting backup connections during attempts to connect from clients that have broken ipv6 connectivity. this is done by disabling ipv6 on backup connections. method overview nsicancelable asyncresolve(in autf8string ahostname, in unsigned long aflags, in nsidnslistener alistener, in nsieventtarget alistenertarget); void
init(); obsolete since gecko 1.8 nsidnsrecord resolve(in autf8string ahostname, in unsigned long aflags); void shutdown(); obsolete since gecko 1.8 attributes attribute type description myhostname autf8string read only. constants resolve flag constants various flags that may be ored together to form the aflags parameter passed to asyncresolve...
... result is available. alistenertarget optional parameter (may be null). if not null, this parameter specifies the nsieventtarget of the thread on which the listener's onlookupcomplete should be called. if this parameter is null, then onlookupcomplete will be called on an unspecified thread (possibly recursively). return value an object that can be used to cancel the host lookup.
init() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) called to
initialize the dns service. void
init(); parameters none. resolve() called to synchronously resolve a host name. warning this method may block the calling thread for a long period of time. it is extremely unwise to call this function on the user interface thread of an application. nsidnsrecord r...
nsIDOMOrientationEvent
escribes the event that can be delivered to dom windows, providing information from the device's accelerometer, allowing code to determine the orientation of the device. dom/interfaces/events/nsidomorientationevent.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: nsidomevent method overview void
initorientationevent(in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg, in double x, in double y, in double z); attributes attribute type description x double the amount of tilt along the x axis. read only. y double the amount of tilt along the y axis. read only. z double the amount of tilt along the z axis. read only. the values...
...in double z); attributes attribute type description x double the amount of tilt along the x axis. read only. y double the amount of tilt along the y axis. read only. z double the amount of tilt along the z axis. read only. the values of x, y, and z can range from -1 to 1, where 0 means the device is balanced on that axis. see accelerometer values explained for details. methods
initorientationevent()
initializes the orientation event object. void
initprogressevent( in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg, in double x, in double y, in double z ); parameters eventtypearg the type of event. must be "mozorientation". canbubblearg specifies whether or not the created event will bubble. cancelablearg specifies whether or not the c...
nsIDOMStorageEventObsolete
ey 1.0) when a dom storage event is received, the recipient can check its domain attribute to determine which domain's data store has changed. if the value of the domain attribute is "#session", then the session storage has changed. note: this interface describes the old, non-standard form of this event. you should use the nsidomstorageevent interface instead. ...
...anbubblearg, in boolean cancelablearg, in domstring keyarg, in domstring oldvaluearg, in domstring newvaluearg, in domstring urlarg, in nsidomstorage storageareaarg); attributes attribute type description domain domstring the domain of the storage area which changed, or "#session" if the event represents a change to session storage. read only. methods
initstorageevent()
initializes a storage event. void
initstorageevent( in domstring typearg, in boolean canbubblearg, in boolean cancelablearg, in domstring domainarg ); parameters typearg the type argument. canbubblearg true if the event is allowed to bubble, otherwise false. cancelablearg true if the event can be canceled, otherwise false. domainarg the domain to which the even...
nsIEditor
« xpcom api reference editor/nsieditor.idlscriptable provides methods and attributes used when editing page content. ...
...ead only. the root editable element, which for a document is its body. selection nsiselection read only. the selection/caret for this editor. in the case of a design mode document, this is the same as the window's selection. selectioncontroller nsiselectioncontroller read only. the selection controller for the current presentation. methods native code only!
init initializes the editor's services. [noscript] void
init( in nsidomdocument doc, in nsipresshellptr shell, obsolete since gecko 5 in nsicontent aroot, in nsiselectioncontroller aselcon, in unsigned long aflags ); parameters doc the document to observe. shell obsolete since gecko 5.0 the nsipresshellptr representing the presentation shell displaying the document. this parameter w...
nsIFileStreams
the nsifilestreams interface is an input stream that allows you to read from a file. netwerk/base/public/nsifilestreams.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) inherits from: nsisupports method overview void
init(in nsifile file, in long ioflags, in long perm, in long behaviorflags); constants constants value description delete_on_close 1<<1 if this is set, the file will be deleted by the time the stream is closed. it may be removed before the stream is closed if it is possible to delete it and still read from it. if open_on_read is defined, and the file was recreated after the first delete, the file will be deleted again when it is closed again. close_on_eof 1<<2 if this is set, the file will close automatically when the...
...le will be deleted again when it is closed again. close_on_eof 1<<2 if this is set, the file will close automatically when the end of the file is reached. reopen_on_rewind 1<<3 if this is set, the file will be reopened whenever seek(0) occurs. if the file is already open and the seek occurs, it will happen naturally. (the file will only be reopened if it is closed for some reason.) methods
init() void
init( in nsifile file, in long ioflags, in long perm, in long behaviorflags ); parameters file file to read from (must qi to nsilocalfile). ioflags file open flags listed in prio.h (see pr_open documentation) or -1 to open the file in default mode (pr_rdonly). perm file mode bits listed in prio.h or -1 to use the default value (0). behaviorflags flags specifying vario...
nsIINIParserFactory
you can use to parse the ini file. ...
...r for an ini file, you can use code that looks like this: to get an nsiiniparser instance for an ini file, you may use the following code: // create an nsilocalfile var cl = "@mozilla.org/file/local;1"; var interf = components.interfaces.nsilocalfile; var file = components.classes[cl].createinstance(interf); //
init the file with the path to your ini file var path = "c:\\temp\\example.ini"; file.
initwithpath(path); // create the nsiiniparserfactory var cl = "@mozilla.org/xpcom/ini-parser-factory;1"; var interf = components.interfaces.nsiiniparserfactory; var inifact = components.manager.getclassobjectbycontractid(cl,interf); // get the iniparser for the ini file var iniparser = inifact.createiniparser(file); see also nsiiniparser nsilocalfile ...
nsIJSID
d jsid while the last two cases create an unnamed jsid. an unnamed jsid also results when you implement a function that is passed an nsiidref parameter, such as queryinterface(). note that for these cases of jsid the specified class or interface must exist and be scriptable. method overview boolean equals(in nsijsid other); const nsid* getid(); violates the xpcom interface guidelines void
initialize(in string idstring); string tostring(); attributes attribute type description id nsidptr read only. native code only! obsolete since gecko 1.9 the internal nsid. name string read only. the name of the jsid, if it was set. number string read only. the string representation of the internal nsid. valid boolean read only. returns true if the jsid has been
initialised. methods...
...s method determines if this nsijsid has the same nsid as another nsijsid. boolean equals( in nsijsid other ); parameters other the other nsijsid to compare to. return value true if the nsijsid's are valid and have the same nsid, otherwise false. violates the xpcom interface guidelines getid() const nsid* getid(); parameters none. return value a pointer to the internal nsid structure.
initialize()
initializes the jsid. void
initialize( in string idstring ); parameters idstring the number to
initialize the jsid, in string format, e.g. {00000000-0000-0000-c000-000000000046}. a jsid can only be
initialized once. tostring() this methods returns a string representation of the object. string tostring(); parameters none. return value the name of the jsid if it has one, otherwise the...
nsILoginInfo
3.0 / seamonkey 2.0) inherits from: nsisupports implemented by: @mozilla.org/login-manager/logininfo;1. ...
... return value an nsilogininfo containing a clone of the login on which this method was invoked. equals() tests to determine whether this login is exactly equal to another nsilogininfo object. boolean equals( in nsilogininfo alogininfo ); parameters alogininfo the login to which to compare for equality. return value true if the two logins are exactly equal or false if they're not.
init()
initializes a newly created nsilogininfo object. void
init( in astring ahostname, in astring aformsubmiturl, in astring ahttprealm, in astring ausername, in astring apassword, in astring ausernamefield, in astring apasswordfield ); parameters ahostname the value to assign to the hostname field. aformsubmiturl the value to assign to the formsubmiturl field. ahttprealm t...
nsILoginManagerPrompter
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/login-manager/prompter;1. to call this service, use: var loginmanagerprompter = components.classes["@mozilla.org/login-manager/prompter;1"] .getservice(components.interfaces.nsiloginmanagerprompter); method overview void
init(in nsidomwindow awindow); void prompttochangepassword(in nsilogininfo aoldlogin, in nsilogininfo anewlogin); void prompttochangepasswordwithusernames([array, size_is(count)] in nsilogininfo logins, in pruint32 count, in nsilogininfo anewlogin); void prompttosavepassword(in nsilogininfo alogin); methods
init()
initialize the prompter. must be called before using...
...; void prompttochangepassword(in nsilogininfo aoldlogin, in nsilogininfo anewlogin); void prompttochangepasswordwithusernames([array, size_is(count)] in nsilogininfo logins, in pruint32 count, in nsilogininfo anewlogin); void prompttosavepassword(in nsilogininfo alogin); methods
init()
initialize the prompter. must be called before using other interfaces. void
init( in nsidomwindow awindow ); parameters awindow the in which the user is doing some login-related action that is resulting in a need to prompt them for something. the prompt will be associated with this window (or, if a notification bar is being used, topmost opener in some cases). prompttochangepassword() ask the user if they want to change a login's password. if the user consents, mod...
nsIMemoryReporterManager
aces.nsimemoryreportermanager); each memory reporter object, which implements nsimemoryreporter interface, provides information for a given code area. each code area is identified by a unique path string, which is displayed in about:memory. ...
...ry multi-reporters. nsisimpleenumerator enumeratemultireporters(); parameters none. return value an enumerator of nsimemorymultireporters that are currently registered. enumeratereporters() returns an enumerator for looking at the installed memory reporters. nsisimpleenumerator enumeratereporters(); parameters none. return value an nsisimpleenumerator for enumerating installed memory reporters.
init()
initializes the memory reporter manager. void
init(); parameters none. registermultireporter() requests that memory multi-reporter notifications be sent to the specified objects. void registermultireporter( in nsimemorymultireporter reporter ); parameters reporter an object implementing the nsimemorymultireporter interface which provides memory usage information for a given c...
nsIMicrosummaryService
sisimpleenumerator getbookmarks(); nsimicrosummarygenerator getgenerator(in nsiuri generatoruri); nsimicrosummaryset getmicrosummaries(in nsiuri pageuri, in long long bookmarkid); nsimicrosummary getmicrosummary(in long long bookmarkid); boolean hasmicrosummary(in long long bookmarkid); nsimicrosummarygenerator installgenerator(in nsidomdocument xmldef
inition); boolean ismicrosummary(in long long bookmarkid, in nsimicrosummary microsummary); nsimicrosummary refreshmicrosummary(in long long bookmarkid); void removemicrosummary(in long long bookmarkid); void setmicrosummary(in long long bookmarkid, in nsimicrosummary microsummary); methods addgenerator() install the microsummary generator from the resource at...
...microsummary() whether or not the given bookmark has a current microsummary. boolean hasmicrosummary( in long long bookmarkid ); parameters bookmarkid the bookmark for which to set the current microsummary. return value returns a boolean representing whether or not the given bookmark has a current microsummary. installgenerator() install the microsummary generator in the given xml def
inition. nsimicrosummarygenerator installgenerator( in nsidomdocument xmldef
inition ); parameters xmldef
inition an nsidomdocument xml document defining the generator. return value returns the nsimicrosummarygenerator that was installed. ismicrosummary() reports whether or not the given microsummary is the current microsummary for the given bookmark. boolean ismicrosummary( in long long ...
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 the...
... 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 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. ...
Building an Account Manager Extension
ension as first step we have to implement the nsiaccountmanagerextension. we name the extension "devmo-account" and state that it is located in the chrome package "example@mozilla.org". furthermore we show the new panel only for imap accounts... components.utils.import("resource://gre/modules/xpcomutils.jsm"); //class constructor function devmoaccountmanagerextension() {}; // class def
inition devmoaccountmanagerextension.prototype = { name : "devmo-account", chromepackagename : "example@mozilla.org", showpanel: function(server) { //this panel is only shown for imap accounts... if (server.type == \"imap\") return true; return false; }, queryinterface: xpcomutils.generateqi([ components.interfaces.nsimsgaccountmanagerextensi...
...s on a very strict naming. as our account manager extension is named "devmo-account", we are required to include a property named prefpanel-devmo-account. prefpanel-devmo-account=devmo demo panel step4: the new panel and javascript the javascript for an account manager panel needs to implement at least the following functions. these functions are invoked by the account manager. function onpre
init(account, accountvalues) { } function on
init(pageid, serverid) { } function onaccepteditor() { } function onsave() { } function updatepage() {} step5: putting it all together // todo build an demo extension for this tutorial... how to build an xpcom component in javascript ...
nsIMsgDBView
void open(in nsimsgfolder folder, in nsmsgviewsorttypevalue sorttype, in nsmsgviewsortordervalue sortorder, in nsmsgviewflagstypevalue viewflags, out long count); void openwithhdrs(in nsisimpleenumerator aheaders, in nsmsgviewsorttypevalue asorttype, in nsmsgviewsortordervalue asortorder, in nsmsgviewflagstypevalue aviewflags, out long acount); void close(); void
init(in nsimessenger amessengerinstance, in nsimsgwindow amsgwindow, in nsimsgdbviewcommandupdater acommandupdater); void sort(in nsmsgviewsorttypevalue sorttype, in nsmsgviewsortordervalue sortorder); void docommand(in nsmsgviewcommandtypevalue command); void docommandwithfolder(in nsmsgviewcommandtypevalue command, in nsimsgfolder destfolder); void getcommandstatu...
...smsgviewsorttype. sortorder an nsmsgviewsortordervalue designating the sort order used for the folder. defined in the interface: nsmsgviewsortorder. viewflags other flags to be used. defined in the interface: nsmsgviewflagstype. return values acount upon return, the count variable may contain the number of messages loaded. close() close the current list of messages. void close();
init()
initializes the database view for use. void
init(in nsimessenger amessengerinstance, in nsimsgwindow amsgwindow, in nsimsgdbviewcommandupdater acommandupdater); parameters amessengerinstance amsgwindow acommandupdater sort() sorts the currently loaded messages. void sort(in nsmsgviewsorttypevalue sorttype, in nsmsgviewsortordervalue sortorder); ...
nsIPluginHost
ut string apluginname); native code only! nsiplugintag getplugintagforinstance(in nsiplugininstance ainstance); native code only! void getplugintags([optional] out unsigned long aplugincount, [retval, array, size_is(aplugincount)] out nsiplugintag aresults); void handlebadplugin(in prlibraryptr alibrary, in nsiplugininstance instance); native code only! void
init(); native code only! void instantiatedummyjavaplugin(in nsiplugininstanceowner aowner); native code only! void instantiateembeddedplugin(in string amimetype, in nsiuri aurl, in nsiplugininstanceowner aowner); native code only! void instantiateembededplugin(in string amimetype, in nsiuri aurl, in nsiplugininstanceowner aowner); obsolete since gecko 1.8 void in...
...n tag object. getplugintags() void getplugintags( out unsigned long aplugincount, optional [retval, array, size_is(aplugincount)] out nsiplugintag aresults ); parameters aplugincount optional aresults native code only!handlebadplugin void handlebadplugin( in prlibraryptr alibrary, in nsiplugininstance instance ); parameters alibrary instance native code only!
init void
init(); parameters none. native code only!instantiatedummyjavaplugin instantiate a "dummy" java plugin if a java plugin that supports npruntime is installed. this plugin is used for exposing window.java and window.packages. if the java plugin supports npruntime and instantiation was successful, aowners instance will be non-null, if not, it will be null. void instantiatedummyjavaplug...
nsIRequest
inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) for example nsichannel typically passes itself as the nsirequest argument to the nsistreamlistener on each onstartrequest, ondataavaliable, and onstoprequest invocation. method overview void cancel(in nsresult astatus); boolean ispending(); void resume(); void suspend(); attributes attribute type description loadflags nsloadflags the load flags of this request. bits 0-15 are reserved. ...
...tatus should be a failure code. void cancel( in nsresult astatus ); parameters astatus the reason for canceling this request. ispending() indicates whether the request is pending. ispending is true when there is an outstanding asynchronous event that will make the request no longer be pending. requests do not necessarily start out pending; in some cases, requests have to be explicitly
initiated (for example nsichannel implementations are only pending once asyncopen returns successfully). requests can become pending multiple times during their lifetime. note: suspended requests are still considered pending. boolean ispending(); parameters none. return value true if the request has yet to reach completion. resume() resumes the current request. this may have the effect of re...
nsISessionStore
ng getclosedtabdata(in nsidomwindow awindow); unsigned long getclosedwindowcount(); astring getclosedwindowdata(); astring gettabstate(in nsidomnode atab); astring gettabvalue(in nsidomnode atab, in astring akey); astring getwindowstate(in nsidomwindow awindow); astring getwindowvalue(in nsidomwindow awindow, in astring akey); void
init(in nsidomwindow awindow); void persisttabattribute(in astring aname); void restorelastsession(); void setbrowserstate(in astring astate); void settabstate(in nsidomnode atab, in astring astate); void settabvalue(in nsidomnode atab, in astring akey, in astring astringvalue); void setwindowstate(in nsidomwindow awindow, in astring astate, in b...
...ieved. akey the key whose corresponding value is to be retrieved. return value the string value that was previously assigned to akey using nsisessionstore.setwindowvalue(), or an empty string if no value is set for that key. if the previously saved value was originally a complex data (ie a javascript object) it can then be deserialized using json.parse cf. nsisessionstore.setwindowvalue().
init()
initializes the session store service. note: this function is intended for use only by the browser; extensions shouldn't call it. void
init( in nsidomwindow awindow ); parameters awindow the window for which to
initialize the service. persisttabattribute() sets the name of a tab attribute to be saved and restored for all xul tabs. note: at present, there's no way to pick and choo...
nsISocketTransportService
obsolete since gecko 1.8 met...
...ort of the peer for this socket. aproxyinfo specifies the transport-layer proxy type to use. set to null if no proxy should be used. for more details on communicating information about proxies like socks (which are transparent to upper protocols), see nsiproxiedprotocolhandler , nsiprotocolproxyservice or proxies in necko. return value an nsisockettransport containing the sockettransport.
init() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void
init(); parameters none. native code only! notifywhencanattachsocket if the number of sockets reaches the limit, then consumers can be notified when the number of sockets becomes less than the limit. the notification is asynchronous, delivered via the given nsirunnable instance on the socket transport thread. ...
nsISound
5 <audio> tag instead. note that nsisound instances may play the sounds using another thread; however, this is not controlled by the caller. implemented by: @mozilla.org/sound;1. to use this interface, use: var sound = components.classes["@mozilla.org/sound;1"] .createinstance(components.interfaces.nsisound); method overview void beep(); void
init(); void play(in nsiurl aurl); void playeventsound(in unsigned long aeventid); void playsystemsound(in astring soundalias); constants sound event constants constant value description event_new_mail_received 0 the system receives email. event_alert_dialog_open 1 ...
...select dialog (one that contains a list box) is opened. event_menu_execute 5 a menu item is executed. event_menu_popup 6 a popup menu is shown. event_editor_max_len 7 more characters than the maximum allowed are typed into a text field. methods beep() plays a beep sound. void beep(); parameters none.
init() not strictly necessary, but avoids a delay before the first sound. other methods will call
init if they need to. void
init(); parameters none. play() plays a sound specified by url. void play( in nsiurl aurl ); parameters aurl the url of the sound file to play. playeventsound() plays the system sound for the specified event. if the user's system is configured to not play sys...
nsITransferable
ew void adddataflavor( in string adataflavor ); nsisupportsarray flavorstransferablecanexport( ); nsisupportsarray flavorstransferablecanimport( ); void getanytransferdata( out string aflavor, out nsisupports adata, out unsigned long adatalen ); void gettransferdata( in string aflavor, out nsisupports adata, out unsigned long adatalen ); void
init(in nsiloadcontext acontext); boolean islargedataset( ); void removedataflavor( in string adataflavor ); void settransferdata( in string aflavor, in nsisupports adata, in unsigned long adatalen ); attributes attribute type description converter nsiformatconverter an nsiformatconverter instance which implements the code needed to con...
...ferdata() returns the transfer data for a given flavor. void gettransferdata( in string aflavor, out nsisupports adata, out unsigned long adatalen ); parameters aflavor the flavor of data to retrieve. adata on return, this is the data itself, which is an instance of a class based upon nsisupportsprimitives. adatalen on return, this 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 ...
nsIURL
he url denotes a path to a directory and not a file, for example http://host/foo/bar/, then the directory attribute accesses the complete /foo/bar/ portion, and the filename is the empty string. if the trailing slash is omitted, then the directory is /foo/ and the file is bar (that is this is a syntactic, not a semantic breakdown of the path). and hence don't rely on this for something to be a def
initely be a file. but you can get just the leading directory portion for sure. some characters may be escaped. filebasename autf8string file basename portion of a filename in a url. some characters may be escaped. fileextension autf8string file extension portion of a filename in a url. if a file extension does not exist, the empty string is returned. some characters may ...
...racters may be escaped. filename autf8string file name portion of a url. if the url denotes a path to a directory and not a file, for example http://host/foo/bar/, then the directory attribute accesses the complete /foo/bar/ portion, and the filename is the empty string. note that this is purely based on searching for the last trailing slash. and hence don't rely on this to be a def
inite file. some characters may be escaped. filepath autf8string path including the directory and file portions of a url. for example, the filepath of "http://host/foo/bar.html#baz" is "/foo/bar.html". some characters may be escaped. param autf8string parameters specified after the ; in the url. some characters may be escaped. obsolete since gecko 9.0 note:...
nsIWebProgressListener
the state_transferring flag or once with the state_redirecting flag, and then finally once with the state_stop flag. note: for document requests, a second state_stop is generated (see the description of state_is_window for more details). constant value description state_start 0x00000001 this flag indicates the start of a request. this flag is set when a request is
initiated. the request is complete when onstatechange() is called for the same request with the state_stop flag set. state_redirecting 0x00000002 this flag indicates that a request is being redirected. the request passed to onstatechange() is the request that is being redirected. when a redirect occurs, a new request is generated automatically to process the new request. expect a corres...
...ryinterface(ci.nsiinterfacerequestor) .getinterface(ci.nsidomwindowutils) .outerwindowid; sendasyncmessage("myaddonmessage", { name: "onlocationchange", outerwindowid: outerwindowid, uri: auri.spec, charset: auri.charset, flag: aflag, }); }, // for def
initions of the remaining functions see related documentation onprogresschange: function(awebprogress, arequest, curself, maxself, curtot, maxtot) {}, onstatuschange: function(awebprogress, arequest, astatus, amessage) {}, onsecuritychange: function(awebprogress, arequest, astate) {} } let filter = cc["@mozilla.org/appshell/component/browser-status-filter;1"] .createinstan...
nsIWindowsRegKey
a); attributes attribute type description childcount unsigned long this attribute returns the number of child keys. read only. key hkey this attribute exposes the native hkey and is available to provide c++ consumers with the flexibility of making other windows registry api calls that are not exposed via this interface. it is possible to
initialize this object by setting an hkey on it. in that case, it is the responsibility of the consumer setting the hkey to ensure that it is a valid hkey. warning: setting the key does not close() the old key. native code only! valuecount unsigned long this attribute returns the number of values under this key. read only. constants root key constants the values for these keys...
...ee if any of its values have changed. the key must have been opened with mode including access_notify. if recurse is true, then this key and any of its descendant keys are watched. otherwise, only this key is watched. void startwatching( in boolean recurse ); parameters recurse indicates whether or not to also watch child keys. stopwatching() this method stops any watching of the key
initiated by a call to startwatching(). this method does nothing if the key is not being watched. void stopwatching(); parameters none. writebinaryvalue() this method writes the binary contents of the named value. the value will be created if it does not already exist. javascript callers should take care with the value passed to this method since it will be truncated from a js string (unicode) to a i...
nsIWorkerMessageEvent
dom/interfaces/threads/nsidomworkers.idlscriptable this interface represents an event in a web worker thread's event queue. ...
...pearg, in boolean acanbubblearg, in boolean acancelablearg, in domstring adataarg, in domstring aoriginarg, in nsisupports asourcearg); attributes attribute type description data domstring the event's data. read only. origin domstring the event's origin. read only. source nsisupports the event's source. read only. methods
initmessageevent()
initializes the message event. void
initmessageevent( in domstring atypearg, in boolean acanbubblearg, in boolean acancelablearg, in domstring adataarg, in domstring aoriginarg, in nsisupports asourcearg ); parameters atypearg the event type. acanbubblearg whether or not the event can bubble. acancelablearg whether or not the event can be canceled. adataarg ...
nsIXPCScriptable
tr cx, in jsobjectptr obj, in pruint32 enum_op, in jsvalptr statep, out jsid idp ); parameters wrapper cx the pointer to the jscontext newenumerate is being called from. obj the pointer to the jsobject being enumerated. enum_op indicates what statep and idp represent, as well as indicates how the function should behave. this will always be one of three values: jsenumerate_
init a new, opaque iterator state should be allocated and stored in statep. you can use private_to_jsval() to tag the pointer to be stored. if idp is non-null, and provided the number of enumerable properties is known, the number of properties that will be enumerated should be returned as an integer jsval in idp. if idp is non-null and the number of enumerable properties cannot be computed in advanc...
... allocated opaque iterator state is passed in via statep. return the next jsid in the iteration using idp. the opaque iterator state pointed at by statep is destroyed and *statep is set to jsval_null if there are no properties left to enumerate. jsenumerate_destroy this function should destroy the opaque iterator state previously allocated in statep by this function when enum_op was jsenumerate_
init. statep an in/out pointer to a jsval whose meaning depends on the value of enum_op. idp an in/out pointer to a jsid whose meaning depends on the value of enum_op. return value this should (although does not need to) return pr_true to indicate success or must return pr_false to indicate failure. newresolve() this method is called when the want_newresolve flag is set. when this method is...
nsIXmlRpcClient
warning: this interface was removed from firefox 3 and is no longer available. extensions/xml-rpc/idl/nsixmlrpcclient.idlscriptable please add a summary to this article. ...
...was unreachable or not yet contacted. constants constant type description int unsigned long nsisupportsprint32 boolean unsigned long nsisupportsprbool string unsigned long nsisupportscstring double unsigned long nsisupportsdouble datetime unsigned long nsisupportsprtime array readonly unsigned long nsisupportsarray struct readonly unsigned long nsisupportsdictionary methods
init() set server url. call this before using this object void getdata ( in string serverurl ) ; parameters serverurl url of server side object on which methods should be called setauthentication() set authentication info if needed. both parameters must be specified for authentication to be enabled void setauthentication ( in string username, in string password ) ; parameters...
nsIXmlRpcFault
discouraged since it could be removed at any time. try to avoid using it. extensions/xml-rpc/idl/nsixmlrpcclient.idlscriptable an xml-rpc exception. xml-rpc server fault codes are returned wrapped in this; access it using nsixpconnect.getpendingexception->data. ...
...tpendingexception->data. inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void
init(in print32 faultcode, in string faultsring); string tostring(); attributes attribute type description faultcode print32 read only. faultstring string read only. ...
nsIZipReaderCache
nsizipreader getinnerzip( in nsifile zipfile, in autf8string zipentry ); parameters zipfile the zip file. zipentry the zip entry. return value the nsizipreader for the given zip file. getzip() returns a (possibly shared) cached nsizipr...
... is not in the cache, a new nsizipreader is opened (see nsizipreader.open()). otherwise the previously created nsizipreader is returned. note: if nsizipreader.close has been called on the shared nsizipreader, this method will return the closed nsizipreader nsizipreader getzip( in nsifile zipfile ); parameters zipfile the zip file. return value the nsizipreader for the given zip file.
init()
initializes a new zip reader cache. void
init( in unsigned long cachesize ); parameters cachesize the number of released entries to maintain before beginning to throw some out. the number of outstanding entries can be much greater than this number, this is the count for those otherwise unused entries. see also nsizipreader ...
XPCOM Interface Reference by grouping
ion and probably will end in tears, but since i'm the first person to apparently take a swing at this, i get first dibs.) the primary sections consist of: browser this section contains elements associated with the view pane or the content of the "browser window" proper. it is wrapped by system, but displayed for convenience. data this section contains data wrappers and core object def
initions. security this section contains apis for secure channel communications system this section contains application level interfaces including calls to external support elements (such as device calls). this is the root element and may contain some functions defined in other groups. user this section contains elements specific to a given user's data storage. browser autocom...
...ompletesearch console nsiconsolelistener nsiconsolemessage nsiconsoleservice document nsidocshell dom device nsidomgeogeolocation nsidomgeoposition nsidomgeopositionaddress nsidomgeopositioncallback nsidomgeopositioncoords nsidomgeopositionerror nsidomgeopositionerrorcallback nsidomgeopositionoptions nsidomglobalproperty
initializer element nsidomchromewindow nsidomclientrect nsidomelement nsidomhtmlaudioelement nsidomhtmlformelement nsidomhtmlmediaelement nsidomhtmlsourceelement nsidomhtmltimeranges nsidomjswindow nsidomnode nsidomnshtmldocument nsidomstorageitem nsidomstoragemanager nsidomwindow nsidomwindow2 nsidomwindowinternal nsidomwindo...
NS_StringContainerFinish
mary the ns_stringcontainerfinish function releases any memory allocated by a nsstringcontainer instance. this is a low-level api. ...
...i. ...
XPCOM string functions
datathe ns_cstringappenddata function appends data to the existing value of a nsacstring instance. this is a low-level api.ns_cstringclonedatathe ns_cstringclonedata function returns a null-terminated, heap allocated copy of the string's internal buffer.ns_cstringcontainerfinishthe ns_cstringcontainerfinish function releases any memory allocated by a nscstringcontainer instance.ns_cstringcontainer
initthe ns_cstringcontainer
init function
initializes a nscstringcontainer instance for use as a nsacstring.ns_cstringcontainer
init2the ns_cstringcontainer
init2 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 functi...
...appenddata function appends data to the existing value of a nsastring instance. this is a low-level api.ns_stringclonedatathe ns_stringclonedata function returns a null-terminated, heap allocated copy of the string's internal buffer.ns_stringcontainerfinishthe ns_stringcontainerfinish function releases any memory allocated by a nsstringcontainer instance. this is a low-level api.ns_stringcontainer
initthe ns_stringcontainer
init 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_stringgetd...
XPCOM reference
odule in the mozilla codebase that's compiled with the mozilla_internal_api flag set, some of these apis -- the string functions and classes in particular -- are not the ones you should be using. see the xpcom internal string guide for documentation of the internal string api used within the mozilla codebase. core xpcom functionsxpcom provides a number of global functions which are used to
initialize and shut down the xpcom library, as well as to allocate memory, get access to services, and to instantiate interfaces.foldersthe folder classes all implement the nsimsgfolder interface. there are currently three folder classes - nslocalmailfolder, nsimapmailfolder, and nsnewsfolder. they all inherit from nsmsgdbfolder, which implements a lot of the core functionality. rss feeds are implemen...
...implemented. it is only used to store constants. for example to sort by date you would pass a function the value:nsmsgviewtypethe nsmsgviewtype interface contains constants used for views in thunderbird. this interface isn't ever implemented. it is only used to store constants. ...
Setting HTTP request headers
http is one of the core technologies behind the web. in addition to the actual content, some important information is passed with http headers for both http requests and responses. you can add your own http headers to any request the application makes, whether the request is
initiated by your code explicitly opening an http channel, because of xmlhttprequest activity, an <img> element in content, or even from css. http channels when you deal with http requests and responses, typically you are doing this with an nsihttpchannel. the nsihttpchannel interface has a number of properties and methods, but the method that is of interest to us is setrequestheader. this method allows us to set an http request header. below is some sample code where we set an http header. // adds "x-hello: world"...
... own http header, you must put a x- in front of the name. (in our example, our made up http header is x-hello and not hello because we correctly added the x- in front of our name.) no longer the case: http://tools.ietf.org/html/rfc6648 notifications the question that may be coming to your mind right now is, how do you get the nsihttpchannel when an http request is made. in the case your code
initiates the request, you probably already have one. trapping other requests is done with notifications, which are a lot like events or signals found in other languages and frameworks. in particular, to get the nsihttpchannel just before the http request is made we need to observe the "http-on-modify-request" topic. (and yes, "http-on-modify-request" is a string.) note: there are many topics, besid...
Performance
you have a version of the command line tool that is at least as recent as what mozilla uses. as of april 10, 2006, mozilla uses sqlite 3.3.4, but the latest precompiled version of the command line tools is not available for all platforms. this will lead to errors that say "database is encrypted" because the tool is not able to recognize the file format. you may want to check the sqlite_version def
inition in db/sqlite3/src/sqlite3.h for the current version if you are having problems. caching sqlite has a cache of database pages in memory. it keeps pages associated with the current transaction so it can roll them back, and it also keeps recently used ones so it can run faster. in the past, it flushed the cache at the end of a transaction (by default). in order to keep the cache active between tr...
...saction. that is not needed now. you can control the size of the memory cache using the cache_size pragma. this value controls the number of pages of the file that can be kept in memory at once. the page size can be set using the page_size pragma before any operations have been done on the file. you can see an example of setting the maximum cache size to be a percentage of memory in nsnavhistory::
initdb in toolkit/components/places/src/nsnavhistory.cpp. sharding the cache between connections by default, storage enables the sqlite shared-cache mode which makes multiple connections to the same database share the same cache. the cache is threadsafe. all you need to do is use services.storage.opendatabase(file). some features (virtual tables, full text indexes) are not compatible with shared cache...
XPCOM Thread Synchronization
icle covers the api of mozilla synchronization only. for a higher-level introduction to thread synchronization, see introduction_to_nspr. quick reference: difference between nsautolock api and new api old construction note: this is deprecated code that is shown only to compare with approved code. prlock* mlock; prmonitor* mmonitor; prcondvar* mcvar; fooconstructor() { } nsresult
init() { mlock = nsautolock::newlock("foo lock"); // check for null mmonitor = nsautomonitor::newmonitor("foo monitor"); // check for null mcvar = pr_newcondvar(mrawlock); // check for null // ... } new construction using namespace mozilla; mutex mlock; monitor mmonitor; condvar mcvar; fooconstructor() : mlock("foo lock"), m...
... mmonitor = nsautomonitor::newmonitor("foo monitor"); // check for null mcvar = pr_newcondvar(mrawlock); // check for null // ... } new construction using namespace mozilla; mutex mlock; monitor mmonitor; condvar mcvar; fooconstructor() : mlock("foo lock"), mmonitor("foo monitor"), mcvar(mlock, "foo condvar") { } nsresult
init() { // ... } old usage note: this is deprecated code that is shown only to compare with approved code. concurrentmethod() { nsautolock al(mlock); nsautomonitor am(mmonitor); if (needexpensivecomputation()) { nsautounlock au(mlock); } am.wait(); pr_notifycondvar(mcvar); } new usage using namespace mozilla; concurrentmethod(...
Frequently Asked Questions
an't dereference a null nscomptr with operator->()" ns_precondition "you can't dereference a null nscomptr with operator*()" other issues printf("%x\n", mynscomptr); can cause the program to crash on sigill (illegal instruction), and not on the line with the printf, which can make it tricky to figure out. for debugging purposes you can write printf("%x\n", mynscomptr.get()); how do i... ...
...the nscomptr will still exercize logic in its destructor to attempt to release the value it has at that time. ...
Getting Started Guide
te by incrementing it when they acquire a reference to the interface, and decrementing it before they let go. to facilitate this, all interfaces inherit from an abstract base class that provides the member functions addref, and release. a rule of xpcom is that any function that creates or returns an interface pointer will have already addrefed it. the caller can then hold onto the reference indef
initely, calling release when it no longer needs it. when the last pointer to an interface is released, the interface (and consequently, typically the underlying object) will delete itself. as long as there is an outstanding addref against the interface, it continues to exist. if you forget to call release, the object will leak, i.e., the storage for that object will never be reclaimed. leaks are bad ...
... mfooptr;| /* this assignment automatically |release|s the old value in |mfooptr|, if any, and |addref|s the new one, in the appropriate sequence to avoid the ownership bug mentioned earlier. */ mfooptr = afooptr; additionally, the class using raw xpcom interface pointers will need a destructor to release mfooptr; and a constructor to ensure that mfooptr is
initially set to null (or some other reasonable value). nscomptr helps you write code that is leak-proof, exception safe, and significantly less verbose than you would with raw xpcom interface pointers. with nscomptr, you may never have to call addref, release, or queryinterface by hand. you still have to understand xpcom. you still have to know which functions return interface pointers that have al...
XPIDL Syntax
nclude that file in the same sense that the c preprocessor includes a file. note that includes within comments or raw code fragments are not processed by xpidl. unlike the c preprocessor, when a file is included multiple times, it acts as if the subsequent includes did not happen; this prevents the need for include guards. xpidl syntax (abnf) the root production here is idl_file. ...
...file in the same sense that the c preprocessor includes a file. note that includes within comments or raw code fragments are not processed by xpidl. unlike the c preprocessor, when a file is included multiple times, it acts as if the subsequent includes did not happen; this prevents the need for include guards. xpidl syntax (abnf) the root production here is idl_file. ...
Xray vision
for example: the detail property of a customevent fired by content could be a javascript object or date as well as a string o...
...properties of dom objects. for example: the detail property of a customevent fired by content could be a javascript object or date as well as a string or a primitive the return value of evalinsandbox() and any properties attached to the sandbox object may be pure javascript objects also, the webidl specifications are starting to use javascript types such as date and promise: since webidl def
inition is the basis of dom xrays, not having xrays for these javascript types starts to seem arbitrary. so, in gecko 31 and 32 we've added xray support for most javascript built-in objects. like dom objects, most javascript built-in objects have an underlying c++ state that is separate from their javascript representation, so the xray implementation can go straight to the c++ state and guarantee th...
Spam filtering
warning: the content of this article may be out of date. it was imported from mozilla.org and last updated in 2003. seth spitzer the mozilla implement is based on paul graham's a plan for spam. training data is global across all mail accounts within a profile. training data is stored in a binary format, in a file named "training.dat".
initially, the training.dat file is empty (there was discussion of shipping with a default file). on spam detection, the user can choose to move spam to a special "junk" folder. the user can configure junk mail can be automatically purged from the "junk" folder. to analyze a message for spam, we need the entire message, not just the headers. spam detection happens after filters are run. white listing happens after filt...
... after filters, but before spam detection. the purge code is implemented as a search of the "junk" folder, looking for "old" message that have the proper junk status. when does purging happens? elaborate on the mime changes that were made for spam. currently, spam filtering is does not work for news, but it would be possible to add support for this. (there is a bug on it.). ...
Constants - Plugins
error codes code value description nperr_no_error 0 no errors occurred. nperr_generic_error 1 error with no specific error code occurred. nperr_invalid_instance_error 2 invalid instance passed to the plug-in. nperr_invalid_functable_error 3 function table invalid. nperr_module_load_failed_error 4 loading of plug-in failed. nperr_out_of_memory_error 5 memory allocation failed. nperr_invalid_plugin_error 6 plug-in missing or invalid. ...
... value description npres_done 0 (most common): completed normally; all data was sent to the instance. npres_network_err 1 stream failed due to problems with network, disk i/o, lack of memory, or other problems. npres_user_break 2 user canceled stream directly by clicking the stop button or indirectly by some action such as deleting the instance or
initiating higher-priority network operations. plug-in version constants constant value description np_version_major 0 major version number; changes with major code release number. np_version_minor 22 minor version number; changes with point release number. version feature constants npvers constant: version feature information va...
Plug-in Side Plug-in API - Plugins
n that a stream is about to be closed or destroyed. np_getentrypoints undocumented. np_getmimedescription registers the mime types supported by the plug-in (unix, mac os). npp_getvalue allows the browser to query the plug-in for information. np_getvalue allows the browser to query the plug-in for information. npp_handleevent delivers a platform-specific window event to the instance. np_
initialize provides global
initialization for a plug-in. npp_new creates a new instance of a plug-in. npp_newstream notifies a plug-in instance of a new data stream. npp_print requests a platform-specific print operation for an embedded or full-screen plug-in. npp_setvalue sets information about the plug-in. npp_setwindow tells the plug-in when a window is created, moved, sized, or destroye...
...ion for a plug-in. npp_new creates a new instance of a plug-in. npp_newstream notifies a plug-in instance of a new data stream. npp_print requests a platform-specific print operation for an embedded or full-screen plug-in. npp_setvalue sets information about the plug-in. npp_setwindow tells the plug-in when a window is created, moved, sized, or destroyed. np_shutdown provides global de
initialization for a plug-in. npp_streamasfile provides a local file name for the data from a stream. npp_urlnotify notifies the instance of the completion of a url request. npp_write delivers data to a plug-in instance. npp_writeready determines maximum number of bytes that the plug-in can consume. « previousnext » ...
Streams - Plugins
-in instance; the stream parameter specifies the stream to be deleted. the reason parameter specifies why the stream was destroyed. it can have one of these values: npres_done (most common): normal completion; all data was sent to the instance. npres_user_break: the user canceled the stream directly by clicking the stop button or indirectly by some action, such as by deleting the instance or
initiating higher-priority network operations. npres_network_err: the stream failed because of problems with the network, disk i/o error, lack of memory, or some other problem. finding out how much data the plug-in can accept after a call to npp_newstream and before writing data to the plug-in, the browser calls npp_writeready to determine the maximum number of bytes that the plug-in can consume. ...
...reams that are seekable are from data that is in memory or on the disk, or from http servers that support byte-range requests. for streams that are not in np_seek mode: the plug-in can call npn_requestread as long as the stream is inherently seekable; npn_requestread automatically changes the mode to np_seek. for streams that are not inherently seekable: the stream must be put in np_seek mode
initially, because the browser must cache all the stream data on disk in order to access it randomly. for streams that are not inherently seekable and not
initially in mode np_seek: npn_requestread returns the error code nperr_stream_not_seekable. the npn_requestread method has the following syntax: nperror npn_requestread(npstream *stream, npbyterange *rangelist); the stream parameter is the str...
DOM Inspector internals - Firefox Developer Tools
-based primary ui. this is the two-pane inspector that appears when ctrl+shift+i (or cmd+shift+i) is pressed from one of the applications for which dom inspector has explicit support (i.e., menuitems placed via overlay). besides the dom inspector's primary ui, there are a couple other top-level inspectors which differ slightly (the object inspector and dom inspector sidebar used in seamonkey).
initially, we will begin by focusing on inspector.xul and its entry point, and then expand our focus later to explain how these other inspectors differ. dom inspector from a high-level perspective the dom inspector primary ui consists of some toolbars and a panelset. the panelset contains two panels. one panel reacts to changes to the inspected document, and the other panel reacts to changes to the ...
...pup overlay (resources/content/viewers/dom/popupoverlay.xul). the same is true for the find menuitems and the "select element by click" menuitem in the edit menu, since no other viewers besides the dom nodes viewer support these features. the other edit menu items are also used in several viewers' context menus. for that reason, only those menuitems' ids are referenced here, and the complete def
initions are imported from editingoverlay.xul. viewers which include one or more of these menuitems in their context menus follow the same practice. the tooltip used for the inspect menus—the one used to show a document's title (if any) and its uri for a given menuitem—is also defined here. commandoverlay.xul the popupoverlay.xul-provided menuitems that delegate to external command elements ...
Debugger.Memory - Firefox Developer Tools
oolean value indicating whether this debugger.memory instance is capturing the javascript execution stack when each object is allocated. this accessor property has both a getter and setter: assigning to it enables or disables the allocation site tracking. reading the accessor produces true if the debugger is capturing stacks for object allocations, and false otherwise. allocation site tracking is
initially disabled in a new debugger. assignment is fallible: if the debugger cannot track allocation sites, it throws an error instance. you can retrieve the allocation site for a given object with the debugger.object.prototype.allocationsite accessor property. allocationsamplingprobability a number between 0 and 1 that indicates the probability with which each new allocation should be ente...
... debuggee code. unlike debugger‘s hooks, debugger.memory’s handlers’ return values are not significant, and are ignored. the handler functions receive the debugger.memory’s owning debugger instance as their this value. the owning debugger’s uncaughtexceptionhandler is still fired for errors thrown in debugger.memory hooks. on a new debugger.memory instance, each of these properties is
initially undefined. any value assigned to a debugging handler must be either a function or undefined; otherwise a typeerror is thrown. handler functions run in the same thread in which the event occurred. they run in the compartment to which they belong, not in a debuggee compartment. ongarbagecollection(statistics) a garbage collection cycle spanning one or more debuggees has just been comple...
Debugger.Source - Firefox Developer Tools
ugger.source for javascript for a debugger.source instance representing a piece of javascript source code, its properties provide the source code itself as a string, and describe where it came from. each debugger.script instance refers to the debugger.source instance holding the source code from which it was produced. if a single piece of source code contains both top-level code and function def
initions, perhaps with nested functions, then the debugger.script instances for those all refer to the same debugger.source instance. each script indicates the substring of the overall source to which it corresponds. a debugger.source instance may represent only a portion of a larger source document. for example, an html document can contain javascript in multiple <script> elements and event handler ...
...tten out in the markup text as an attribute value). source belongs to a dom element if it was assigned to one of the element’s event handler idl attributes as a string. (note that one may assign both strings and functions to dom elements’ event handler idl attributes. ...
Debugger.Object - Firefox Developer Tools
e == operator to recognize when two debugger.object instances refer to the same debuggee object, and place its own properties on a debugger.object instance to store metadata about particular debuggee objects. javascript code in different compartments can have different views of the same object. for example, in firefox, code in privileged compartments sees content dom element objects without redef
initions or extensions made to that object's properties by content code. (in firefox terminology, privileged code sees the element through an "xray wrapper".) to ensure that debugger code sees each object just as the debuggee would, each debugger.object instance presents its referent as it would be seen from a particular compartment. this "viewing compartment" is chosen to match the way the debugger c...
...h debugger.object instance presents its referent as viewed from a particular compartment. given a debugger.object instanced and an objecto, the call d.makedebuggeevalue(o) returns a debugger.object instance that presentso as it would be seen by code ind's compartment. decompile([pretty]) if the referent is a function that is debuggee code, return the javascript source code for a function def
inition equivalent to the referent function in its effect and result, as a string. ifpretty is present and true, produce indented code with line breaks. if the referent is not a function that is debuggee code, return undefined. call(this,argument, ...) if the referent is callable, call it with the giventhis value andargument values, and return a completion value describing how the call completed...
CSS Grid Inspector: Examine grid layouts - Firefox Developer Tools
ns a checkbox for each grid present on the page, along with various options. allows overlay views to be toggled on and off. grid display settings: display line numbers: turn the line numbers shown for each grid overlay on and off (on by default). display area names: turn area names on and off, in the case of grids with named grid areas (on by default, where relevant). extend lines inf
initely: by default, grid lines/tracks are only shown inside the element with display: grid set on it; when toggling this option on, the grid lines extend to the edge of the viewport along each axis. mini grid view: a smaller view of the currently overlaid grid. note: your grid preferences such as overlay color and display settings choices are persisted across page loads for each separate pag...
... the parent grid is unselected, then its lines are translucent. display line numbers by default, the line numbers are displayed on the grid overlay. unchecking the "display line numbers" box turns them off. display area names in a grid with named areas, the area names are shown on the grid overlay by default. unchecking the "display area names" box turns them off. extend lines inf
initely by default, the grid lines/tracks are only shown inside the element with display: grid set on it. when you check the "extend lines inf
initely" option, the grid lines extend to the edge of the viewport along each axis. mini grid view shows a small version of the currently overlaid grid, which is in proportion to the real thing. hovering over the different areas of the mini grid cause...
Responsive Design Mode - Firefox Developer Tools
firefox menu (or tools menu if you display the menu bar or are on macos). from the developer tools toolbox: press the responsive design mode button in the toolbox's toolbar: from the keyboard: press ctrl + shift + m (or cmd + opt + m on macos). controlling responsive design mode with responsive design mode enabled, the content area for web pages is set to the screen size for a mobile device.
initially, it's set to 320 x 480 pixels. note: the device you select when in responsive design mode and the orientation (portrait or landscape) is saved between sessions. information for the selected device is centered over the display. from left to right, the display includes: name of the selected device - a drop-down list that includes whatever devices you have selected from the device sett...
...s 20 kb/s 500 regular 2g 250 kb/s 50 kb/s 300 good 2g 450 kb/s 150 kb/s 150 regular 3g 750 kb/s 250 kb/s 100 good 3g 1.5 mb/s 750 kb/s 40 regular 4g/lte 4 mb/s 3 mb/s 20 dsl 2 mb/s 1 mb/s 5 wi-fi 30 mb/s 15 mb/s 2 to select a network, click the list box that's
initially labeled "no throttling": ...
Web Console remoting - Firefox Developer Tools
eventactor": { "actor": "conn0.netevent14", "starteddatetime": "2012-09-17t19:50:03.699z", "url": "http://localhost/~mihai/mozilla/test2.css", "method": "get" "isxhr": false, "private": false } } this packet is used to inform the web console of a new network event. for each request a new networkeventactor instance is created. the isxhr flag indicates if the request was
initiated via an xmlhttprequest instance, that is: the nsihttpchannel's notification is of an nsixmlhttprequest interface. the private flag tells if the network request comes from a private window/tab (added in firefox 24). the networkeventactor the new network event actor stores further request and response information. the networkeventupdate packet the web console ui needs to be kept up-to-date...
... firefox 19: bug 787981 - added longstringactor usage in several places. firefox 20: bug 792062 - removed locationchanged packet and updated the tabnavigated packet for tab actors. firefox 23: bug 783499 - removed the webconsoleobjectactor. now the web console uses the javascript debugger api and the objectactor. firefox 23: added the bindobjectactor and frameactor options to the e...
AbortSignal.onabort - Web APIs
ignal (available in the signal property). ...
...r or not it the signal has been aborted using the onabort property, and send an appropriate log to the console. var controller = new abortcontroller(); var signal = controller.signal; signal.onabort = function() { console.log('request aborted'); }; specifications specification status comment domthe def
inition of 'onabort' in that specification. living standard
initial def
inition ...
AbortSignal - Web APIs
he onabort property. methods the abortsignal interface inherits methods from its parent interface, eventtarget. examples in the following snippet, we aim to download a video using the fetch api. we first create a controller using the abortcontroller() constructor, then grab a reference to its associated abortsignal object using the abortcontroller.signal property. when the fetch request is
initiated, we pass in the abortsignal as an option inside the request's options object (see {signal}, below). this associates the signal and controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener. var controller = new abortcontroller(); var signal = controller.signal; var downloadbtn = document.queryselector('.downlo...
...ction(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with an aborterror. current version of firefox rejects the promise with a domexception you can find a full working example on github — see abort-api (see it running live also). specifications specification status comment domthe def
inition of 'abortsignal' in that specification. living standard
initial def
inition ...
AddressErrors.city - Web APIs
...
...mstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the city value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe def
inition of 'addresserrors.city' in that specification. candidate recommendation
initial def
inition. ...
AddressErrors.dependentLocality - Web APIs
...
...eadable explanation of the validation error and offers suggestions for correcting it. if the dependentlocality value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe def
inition of 'addresserrors.dependentlocality' in that specification. candidate recommendation
initial def
inition. ...
AddressErrors.languageCode - Web APIs
...
...or as detailed as actually verifying that the specified string matches a value from a database. if the languagecode value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe def
inition of 'addresserrors.languagecode' in that specification. candidate recommendation
initial def
inition. ...
AddressErrors.phone - Web APIs
...
...tring offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the phone value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe def
inition of 'addresserrors.phone' in that specification. candidate recommendation
initial def
inition. ...
AddressErrors.postalCode - Web APIs
...
...ring a human-readable explanation of the validation error and offers suggestions for correcting it. if the postalcode value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe def
inition of 'addresserrors.postalcode' in that specification. candidate recommendation
initial def
inition. ...
AddressErrors.recipient - Web APIs
...
...fering a human-readable explanation of the validation error and offers suggestions for correcting it. if the recipient value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe def
inition of 'addresserrors.recipient' in that specification. candidate recommendation
initial def
inition. ...
AddressErrors.region - Web APIs
...
...ing offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the region value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe def
inition of 'addresserrors.region' in that specification. candidate recommendation
initial def
inition. ...
AddressErrors.sortingCode - Web APIs
...
...ng a human-readable explanation of the validation error and offers suggestions for correcting it. if the sortingcode value was validated successfully, this property is not included in the addresserrors object. specifications specification status comment payment request apithe def
inition of 'addresserrors.sortingcode' in that specification. candidate recommendation
initial def
inition. ...
AddressErrors - Web APIs
...
...ate now</button> result the final product is below. note: if you have content blocking features enabled in your browser, the example may not work inline below. in that case, you can view the example on its own page. specifications specification status comment payment request apithe def
inition of 'addresserrors' in that specification. candidate recommendation
initial def
inition. ...
AesGcmParams - Web APIs
r into subtlecrypto.encrypt(), subtlecrypto.decrypt(), subtlecrypto.wrapkey(), or subtlecrypto.unwrapkey(), when using the aes-gcm algorithm. for details of how to supply appropriate values for this parameter, see the specification for aes-gcm: nist sp800-38d, in particular section 5.2.1.1 on input data. properties name a domstring. this should be set to aes-gcm. iv a buffersource — the
initialization vector. this must be unique for every encryption operation carried out with a given key. put another way: never reuse an iv with the same key. the aes-gcm specification recommends that the iv should be 96 bits long, and typically contains bits from a random number generator. section 8.2 of the specification outlines methods for constructing ivs. note that the iv does not have to be secr...
... recommendation ...
AnalyserNode.getByteFrequencyData() - Web APIs
createanalyser(); var dataarray = new uint8array(analyser.frequencybincount); // uint8array should be the same length as the frequencybincount void analyser.getbytefrequencydata(dataarray); // fill the uint8array with data returned from getbytefrequencydata() parameters array the uint8array that the frequency domain data will be copied to. for any sample which is silent, the value is -inf
inity. if the array has fewer elements than the analysernode.frequencybincount, excess elements are dropped. if it has more elements than needed, excess elements are ignored. return value none. example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect frequency data repeatedly and draw a "winamp bargraph sty...
... working draft ...
AnalyserNode.getFloatFrequencyData() - Web APIs
alyser(); var dataarray = new float32array(analyser.frequencybincount); // float32array should be the same length as the frequencybincount void analyser.getfloatfrequencydata(dataarray); // fill the float32array with data returned from getfloatfrequencydata() parameters array the float32array that the frequency domain data will be copied to. for any sample which is silent, the value is -inf
inity. if the array has fewer elements than the analysernode.frequencybincount, excess elements are dropped. if it has more elements than needed, excess elements are ignored. return value none. example const audioctx = new audiocontext(); const analyser = audioctx.createanalyser(); // float32array should be the same length as the frequencybincount const mydataarray = new float32array(analyser.fr...
... working draft ...
Animation.finish() - Web APIs
e playback time to the length of the animation sequence, and if the animation is playing in reverse (having had its reverse() method called), it sets the playback time to 0. syntax animation.finish(); parameters none. return value none. exceptions invalidstate the player's playback rate is 0 or the animation's playback rate is greater than 0 and the end time of the animation is inf
inity. examples the following example shows how to use the finish() method and catch an invalidstate error. interfaceelement.addeventlistener("mousedown", function() { try { player.finish(); } catch(e if e instanceof invalidstate) { console.log("finish() called on paused or finished animation."); } catch(e); logmyerrors(e); //pass exception object to error handler } }); the f...
... working draft ...
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. 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 specifi...
... working draft editor's draft. ...
Animation.onremove - Web APIs
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.onremove; animation.onremove = removehandler; value a function to be called to handle the remove event, or null if no remove event handler is set. ...
...e 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 def
inition of 'animation.onremove' 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. ...
...ould 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 def
inition of 'persist()' in that specification. working draft ...
Animation.playbackRate - Web APIs
syntax var currentplaybackrate = animation.playbackrate; animation.playbackrate = newrate; value takes a number that can be 0, negative, or positive. ...
... working draft ...
Animation.startTime - Web APIs
the animation.starttime property of the animation interface is a double-precision floating-point value which indicates the scheduled time when an animation's playback should begin. an animation’s start time is the time value of its documenttimeline when its target keyframeeffect is scheduled to begin playback. an animation’s start time is
initially unresolved (meaning that it's null because it has no value). syntax var animationstartedwhen = animation.starttime; animation.starttime = newstarttime; value a floating-point number representing the current time in milliseconds, or null if no time is set. you can read this value to determine what the start time is currently set at, and you can change this value to make the animation start at a different time. examples in the running ...
... working draft editor's draft. ...
AnimationEvent.pseudoElement - Web APIs
...
...starting with '::', containing the name of the pseudo-element the animation runs on. if the animation doesn't run on a pseudo-element but on the element, an empty string: ''. syntax name = animationevent.pseudoelement specifications specification status comment css animationsthe def
inition of 'animationevent.pseudoelement' in that specification. working draft
initial def
inition. ...
AnimationPlaybackEvent.AnimationPlaybackEvent() - Web APIs
the animationplaybackevent() constructor of the web animations api returns a new animationplaybackevent object instance. syntax var animationplaybackevent = new animationplaybackevent(type, event
initdict); parameters type a domstring representing the name of the event. event
initdict optional an optional event
init dictionary object containing the following fields: bubbles optional defaults to false, of type boolean, indicating if the event bubbles or not. cancelable optional defaults to false, of type boolean, indicating if the event can be canceled or not. ...
...es optional defaults to false, of type boolean, indicating if the event bubbles or not. cancelable optional defaults to false, of type boolean, indicating if the event can be canceled or not. detail optional defaults to null, of type any — an event-dependent value associated with the event. specifications specification status comment web animationsthe def
inition of 'animationplaybackevent()' in that specification. working draft editor's draft. ...
ArrayBufferView - Web APIs
...
...t8clampedarray, int16array, uint16array, int32array, uint32array, float32array, float64array or dataview. this is a helper type to simplify the specification; it isn't an interface, and there are no objects implementing it. specifications specification status comment web idlthe def
inition of 'arraybufferview' in that specification. candidate recommendation
initial def
inition. ...
AudioBufferSourceNode.loopEnd - Web APIs
when the audio is played to the end, it loops, but you can control how long the loops last by altering loopstart and loopend. for example, if you set their values to 20 and 25, respectively, then begin playback, the sound will play normally until it reaches the 25 second mark. then the current play position will loop back to the 20 second mark and continue playing until the 25 second mark, ad inf
initum (or at least until stop() is called). for a full working example, see this code running live, or view the source. function getdata() { source = audioctx.createbuffersource(); request = new xmlhttprequest(); request.open('get', 'viper.ogg', true); request.responsetype = 'arraybuffer'; request.onload = function() { var audiodata = request.response; audioctx.decodeaudiod...
...r}); } request.send(); } ... loopstartcontrol.oninput = function() { source.loopstart = loopstartcontrol.value; loopstartvalue.innerhtml = loopstartcontrol.value; } loopendcontrol.oninput = function() { source.loopend = loopendcontrol.value; loopendvalue.innerhtml = loopendcontrol.value; } specifications specification status comment web audio apithe def
inition of 'loopend' in that specification. working draft ...
AudioContext.getOutputTimestamp() - 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewc...
...t timestamps function outputtimestamps() { let ts = audioctx.getoutputtimestamp() console.log('context time: ' + ts.contexttime + ' | performance time: ' + ts.performancetime); raf = requestanimationframe(outputtimestamps); } specifications specification status comment web audio apithe def
inition of 'getoutputtimestamp()' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung int...
AudioContext - Web APIs
an audio-processing graph built from audio modules linked together, each represented by an audionode. an audio context controls both the creation of the nodes it contains and the execution of the audio processing, or decoding. you need to create an audiocontext before you do anything else, as everything happens inside a context. it's recommended to create one audiocontext and reuse it instead of
initializing a new one each time, and it's ok to use a single audiocontext for several different audio source and pipeline concurrently. <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 ...
... working draft ...
AudioListener.forwardX - Web APIs
vector defining the forward direction the listener is pointing in. note: the parameter is a-rate when used with a pannernode whose panningmodel is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.forwardx.value = 0; value an audioparam. its default value is 0, and it can range between positive and negative inf
inity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy
initially, and then update the position of one or both of these as the application is used. you might be moving a character ...
... working draft ...
AudioListener.forwardY - Web APIs
vector defining the forward direction the listener is pointing in. note: the parameter is a-rate when used with a pannernode whose panningmodel is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.forwardy.value = 0; value an audioparam. its default value is 0, and it can range between positive and negative inf
inity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy
initially, and then update the position of one or both of these as the application is used. you might be moving a character ...
... working draft ...
AudioListener.forwardZ - Web APIs
vector defining the forward direction the listener is pointing in. note: the parameter is a-rate when used with a pannernode whose panningmodel is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.forwardz.value = 0; value an audioparam. its default value is -1, and it can range between positive and negative inf
inity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy
initially, and then update the position of one or both of these as the application is used. you might be moving a character ...
... working draft ...
AudioListener.positionX - Web APIs
m representing the x position of the listener in 3d cartesian space. note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.positionx.value = 1; value an audioparam. its default value is 0, and it can range between positive and negative inf
inity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy
initially, and then update the position of one or both of these as the application is used. you might be moving a character ...
... working draft ...
AudioListener.positionY - Web APIs
m representing the y position of the listener in 3d cartesian space. note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.positiony.value = 1; value an audioparam. its default value is 0, and it can range between positive and negative inf
inity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy
initially, and then update the position of one or both of these as the application is used. you might be moving a character ...
... working draft ...
AudioListener.positionZ - Web APIs
m representing the z position of the listener in 3d cartesian space. note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.positionz.value = 1; value an audioparam. its default value is 0, and it can range between positive and negative inf
inity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy
initially, and then update the position of one or both of these as the application is used. you might be moving a character ...
... working draft ...
AudioListener.setPosition() - Web APIs
syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.setposition(1,1,1); returns void. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy
initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., w...
... working draft ...
AudioListener.upX - Web APIs
he direction vector defining the up direction the listener is pointing in. note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.upx.value = 0; value an audioparam. its default value is 0, and it can range between positive and negative inf
inity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy
initially, and then update the position of one or both of these as the application is used. you might be moving a character ...
... working draft ...
AudioListener.upY - Web APIs
he direction vector defining the up direction the listener is pointing in. note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.upy.value = 0; value an audioparam. its default value is 1, and it can range between positive and negative inf
inity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy
initially, and then update the position of one or both of these as the application is used. you might be moving a character ...
... working draft ...
AudioListener.upZ - Web APIs
he direction vector defining the up direction the listener is pointing in. note: the parameter is a-rate when used with a pannernode whose pannernode is set to equalpower, or k-rate otherwise. syntax var audioctx = new audiocontext(); var mylistener = audioctx.listener; mylistener.upz.value = 0; value an audioparam. its default value is 0, and it can range between positive and negative inf
inity. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy
initially, and then update the position of one or both of these as the application is used. you might be moving a character ...
... working draft ...
AudioListener - Web APIs
example setposition(x, y, z) can be achieved by setting positionx.value, positiony.value, and positionz.value respectively. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy
initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., w...
... working draft ...
AudioNode.channelCount - Web APIs
it is used as a maximum value if the channelcountmode value is clamped-max. it is used as the exact value if the channelcountmode value is explicit. ...
...an integer. example var audiocontext = window.audiocontext || window.webkitaudiocontext; var audioctx = new audiocontext(); var oscillator = audioctx.createoscillator(); var gainnode = audioctx.creategain(); oscillator.connect(gainnode); gainnode.connect(audioctx.destination); oscillator.channelcount; specifications specification status comment web audio apithe def
inition of 'channelcount' in that specification. working draft ...
AudioNode.channelInterpretation - Web APIs
. the surround channels are passed unchanged. the subwoofer (lfe) channel is lost. output.l = input.l + 0.7071 * input.c output.r = input.r + 0.7071 * input.c output.sl = input.sl output.sr = input.sr other, non-standard layouts non-standard channel layouts are handled as if channelinterpretation is set to discrete. the specification explicitly allows the future def
inition of new speaker layouts. this fallback is therefore not future proof as the behavior of the browsers for a specific number of channels may change in the future. discrete any (x) any (y) where x<y up-mix discrete channels. fill each output channel with its input counterpart, that is the input channel with the same index. channels with no corresponding input channels are lef...
... working draft ...
AudioNode.connect() - Web APIs
nd to an existing input or output. invalidaccesserror the destination node is not part of the same audio context as the source node. notsupportederror the specified connection would create a cycle (in which the audio loops back through the same nodes repeatedly) and there are no delaynodes in the cycle to prevent the resulting waveform from getting stuck constructing the same audio frame indef
initely. examples connecting to an audio input the most obvious use of the connect() method is to direct the audio output from one node into the audio input of another node for further processing. for example, you might send the audio from a mediaelementaudiosourcenode—that is, the audio from an html5 media element such as <audio>—through a band pass filter implemented using a biquadfilternode...
...any timeline changes scheduled for the parameter. therefore, it is possible to choose the range in which an audioparam will change by setting the value of the audioparam to the central frequency, and to use a gainnode between the audio source and the audioparam to adjust the range of the audioparam changes. specifications specification status comment web audio apithe def
inition of 'connect() to an audionode' in that specification. working draft web audio apithe def
inition of 'connect() to an audioparam' in that specification. working draft ...
AudioNode - Web APIs
erty with a value of 0. audionode.numberofoutputs read only returns the number of outputs coming out of the node. destination nodes — like audiodestinationnode — have a value of 0 for this attribute. audionode.channelcount represents an integer used to determine how many channels are used when up-mixing and down-mixing connections to any inputs to the node. its usage and precise def
inition depend on the value of audionode.channelcountmode. audionode.channelcountmode represents an enumerated value describing the way channels must be matched between the node's inputs and outputs. audionode.channelinterpretation represents an enumerated value describing the meaning of the channels. this interpretation will define how audio up-mixing and down-mixing will happen. the possible...
... working draft ...
AudioNodeOptions - Web APIs
or gainnode.gainnode. syntax var audionodeoptions = { "channelcount" : 2, "channelcountmode" : "max", "channelinterpretation" : "discrete" } properties channelcount optional represents an integer used to determine how many channels are used when up-mixing and down-mixing connections to any inputs to the node. (see audionode.channelcount for more information.) its usage and precise def
inition depend on the value of audionodeoptions.channelcountmode. channelcountmode optional represents an enumerated value describing the way channels must be matched between the node's inputs and outputs. (see audionode.channelcountmode for more information including default values.) channelinterpretation optional represents an enumerated value describing the meaning of the channels. this interpr...
...linterpretation optional represents an enumerated value describing the meaning of the channels. this interpretation will define how audio up-mixing and down-mixing will happen. the possible values are "speakers" or "discrete". (see audionode.channelcountmode for more information including default values.) specifications specification status comment web audio apithe def
inition of 'audionodeoptions' in that specification. working draft
initial def
inition. ...
AudioParam.value - Web APIs
setting value has the same effect as calling audioparam.setvalueattime with the time returned by the audiocontext's currenttime property.. syntax var curvalue = audioparam.value; audioparam.value = newvalue; value a floating-point number indicating the parameter's value as of the current time. this value will be between the values specified by the minvalue and maxvalue properties. ...
...ly reflect the state of the parameter over time. example this example instantly changes the volume of a gainnode to 40%. const audioctx = new audiocontext(); const gainnode = audioctx.creategain(); gainnode.gain.value = 0.4; //which is identical to: gainnode.gain.setvalueattime(0.4, audioctx.currenttime); specifications specification status comment web audio apithe def
inition of 'value' in that specification. working draft ...
AudioTrackList.getTrackById() - Web APIs
recommendation ...
...ks using htmlmediaelement.audiotracks, then calls gettrackbyid() on it, specifying the character's name. the resulting track's audio is then disabled by setting its enabled flag to false. specifications specification status comment html living standardthe def
inition of 'audiotracklist.gettrackbyid()' in that specification. living standard html5the def
inition of 'audiotracklist.gettrackbyid()' in that specification. recommendation ...
AudioTrackList.onchange - Web APIs
recommendation ...
...a user interface control using the track's id (perhaps the app uses the track id as the control element's id) and the track's enabled flag to determine which state the control should be in now. specifications specification status comment html living standardthe def
inition of 'audiotracklist.onchange' in that specification. living standard html5the def
inition of 'audiotracklist.onchange' in that specification. recommendation ...
AudioWorkletProcessor.parameterDescriptors (static getter) - Web APIs
. automationrate optional either "a-rate", or "k-rate" string which represents an automation rate of this audioparam. defaults to "a-rate". minvalue optional a float which represents minimum value of the audioparam. defaults to -3.4028235e38. maxvalue optional a float which represents maximum value of the audioparam. defaults to 3.4028235e38. defaultvalue optional a float which represents
initial value of the audioparam. defaults to 0. examples to demonstrate creation and usage of custom audioparams, we'll expand the example from audioworkletnode page. there we've created a simple node which outputs white noise. here, additionally, we'll create a custom gain parameter, so we can directly change volume of the output (although you could use gainnode to achieve this as well). first, w...
... working draft ...
AudioWorkletProcessor - Web APIs
in turn, an audioworkletnode based on it runs on the main thread. constructor the audioworkletprocessor and classes that derive from it cannot be instantiated directly from a user-supplied code. instead, they are created only internally by the creation of an associated audioworkletnodes. the constructor of the deriving class is getting called with an options object, so you can perform a custom
initialization procedures — see constructor page for details. audioworkletprocessor() creates a new instance of an audioworkletprocessor object. properties port read only returns a messageport used for bidirectional communication between the processor and the audioworkletnode which it belongs to. the other end is available under the port property of the node. methods the audioworkletpr...
...e name of the processor, then connect the node to an audio graph. const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('white-noise-processor.js') const whitenoisenode = new audioworkletnode(audiocontext, 'white-noise-processor') whitenoisenode.connect(audiocontext.destination) specifications specification status comment web audio apithe def
inition of 'audioworkletprocessor' in that specification. working draft ...
BaseAudioContext.audioWorklet - Web APIs
...
...asses which implement custom audio processing. syntax baseaudiocontextinstance.audioworklet; value an audioworklet instance. examples for a complete example demonstrating user-defined audio processing, see the audioworkletnode page. specifications specification status comment web audio apithe def
inition of 'audioworklet' in that specification. working draft
initial def
inition. ...
BaseAudioContext.createConvolver() - Web APIs
syntax baseaudiocontext.createconvolver(); returns a convolvernode. example the following example shows basic usage of an audiocontext to create a convolver node. the basic premise is that you create an audiobuffer containing a sound sample to be used as an ambience to shape the convolution (called the impulse response,) and apply that to the convolver. ...
... working draft ...
BaseAudioContext.createIIRFilter() - Web APIs
syntax var iirfilter = audiocontext.createiirfilter(feedforward, feedback); parameters feedforward an array of floating-point values specifying the feedforward (numerator) coefficients for the transfer function of the iir filter. the maximum length of this array is 20, and at least one value must be nonzero. feedback an array of floating-point values specifying the feedback (denominator) coefficients for the transfer function of the iir filter. ...
... working draft ...
BaseAudioContext.createPanner() - Web APIs
e position and orientation of the person listening to the audio. syntax baseaudioctx.createpanner(); returns a pannernode. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy
initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., w...
... working draft ...
BaseAudioContext.createPeriodicWave() - Web APIs
the first value is the dc offset, which is the value at which the oscillator starts. 0 is good here, because we want to start the curve at the middle of the [-1.0; 1.0] range. the second and subsequent values are sine and cosine components. you can think of it as the result of a fourier transform, where you get frequency domain valu...
...urier transform should be given in ascending order (i.e. (a+bi)ei,(c+di)e2i,(f+gi)e3i\left(a+bi\right)e^{i} , \left(c+di\right)e^{2i} , \left(f+gi\right)e^{3i} etc.) and can be positive or negative. a simple way of manually obtaining such coefficients (though not the best) is to use a graphing calculator. specifications specification status comment web audio apithe def
inition of 'createperiodicwave' in that specification. working draft ...
BaseAudioContext.currentTime - Web APIs
...
...ctx.currenttime; // 49.8 // 50.6 // 51.7 // ... in firefox, you can also enabled privacy.resistfingerprinting, the precision will be 100ms or the value of privacy.resistfingerprinting.reducetimerprecision.microseconds, whichever is larger. specifications specification status comment web audio apithe def
inition of 'currenttime' in that specification. working draft
initial def
inition. ...
BaseAudioContext - Web APIs
you wouldn't use baseaudiocontext directly — you'd use its features via one of these two inheriting interfaces. a baseaudiocontext can be a target of events, therefore it implements the eventtarget interface. ...
... working draft ...
BasicCardRequest.supportedNetworks - Web APIs
rks : [value [, ... value]] value an array containing one or more domstrings, which describe the card networks the retailer supports. legal values are defined in the w3c's document card network identifiers approved for use with payment request api, and are currently: amex cartebancaire diners discover jcb mastercard mir unionpay visa example the following example shows a sample def
inition of the first parameter of the paymentrequest() constructor, the data property of which contains supportednetworks and supportedtypes properties. var supportedinstruments = [{ supportedmethods: 'basic-card', data: { supportednetworks: ['visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'], supportedtypes: ['credit', 'debit'] } }]; ...
...ta: { supportednetworks: ['visa', 'mastercard', 'amex', 'jcb', 'diners', 'discover', 'mir', 'unionpay'], supportedtypes: ['credit', 'debit'] } }]; var details = { ... }; var options = { ... }; var request = new paymentrequest(supportedinstruments, details, options); specifications specification status comment basic card paymentthe def
inition of 'supportednetworks' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchro...
CSSStyleValue - Web APIs
...
...s the first value as a cssstylevalue object. cssstylevalue.parseall() sets all occurences of a specific css property to the specified valueand returns an array of cssstylevalue objects, each containing one of the supplied values. specifications specification status comment css typed om level 1the def
inition of 'cssstylevalue' in that specification. working draft
initial def
inition. ...
CSSUnitValue.unit - Web APIs
...
...value constructors, then queries the cssunitvalue.unit. let pos = new csspositionvalue( new cssunitvalue( 5, "px" ), new cssunitvalue( 10, "em" )); console.log( pos.x.unit ); // "px" console.log( pos.y.unit ); // "em" specifications specification status comment css typed om level 1the def
inition of 'cssunitvalue.unit' in that specification. working draft
initial def
inition. ...
CSSUnitValue.value - Web APIs
...
...tvalue constructors, then queries the cssunitvalue.value. let pos = new csspositionvalue( new cssunitvalue( 5, "px" ), new cssunitvalue( 10, "px" )); console.log( pos.x.value ); // 5 console.log( pos.y.value ); // 10 specifications specification status comment css typed om level 1the def
inition of 'cssunitvalue.value' in that specification. working draft
initial def
inition. ...
CSSValue - Web APIs
ods on this instance of the cssvalue interface. ...
...css_value_list the value is a cssvalue list and an instance of the cssvaluelist interface can be obtained by using binding-specific casting methods on this instance of the cssvalue interface. specifications specification status comment document object model (dom) level 2 style specificationthe def
inition of 'cssvalue' in that specification. obsolete
initial def
inition ...
Using the CSS Typed Object Model - Web APIs
s values. this article provides an introduction to all of its main features. computedstylemap() with the css typed om api, we can access all the css properties and values — including custom properties — that are impacting an element. let's see how this works by creating our first example, which explores computedstylemap(). we start with some html: a paragraph with a link, as well as a def
inition list to which we will add all the css property / value pairs. <p> <a href="https://example.com">link</a> </p> <dl id="regurgitation"></dl> we add javascript to grab our unstyled link and return back a def
inition list of all the default css property values impacting the link using computedstylemap(). // get the element const myelement = document.queryselector('a'); // get the <dl> we'll ...
... and csskeywordvalue the power of the css typed om is that values are separate from units; parsing and concatenating string values may become be a thing of the past. every css property in a style map has a value. if the value is a keyword, the object 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 measurement 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 — cssunitval...
CSS Typed Object Model API - Web APIs
...
...transform list values. they "contain" one or more csstransformcomponents, which represent individual transform function values. cssunparsedvalue represents property values that reference custom properties. it consists of a list of string fragments and variable references. specifications specification status comment css typed om level 1 working draft
initial def
inition. ...
CanvasRenderingContext2D.createLinearGradient() - Web APIs
nt(x0, y0, x1, y1); the createlineargradient() method is specified by four parameters defining the start and end points of the gradient line. parameters x0 the x-axis coordinate of the start point. y0 the y-axis coordinate of the start point. x1 the x-axis coordinate of the end point. y1 the y-axis coordinate of the end point. return value canvasgradient a linear canvasgradient
initialized with the specified line. examples filling a rectangle with a linear gradient this example
initializes a linear gradient using the createlineargradient() method. three color stops between the gradient's start and end points are then created. finally, the gradient is assigned to the canvas context, and is rendered to a filled rectangle. html <canvas id="canvas"></canvas> javascript ...
... living standard ...
CanvasRenderingContext2D.drawFocusIfNeeded() - Web APIs
r'; ctx.textbaseline = 'middle'; ctx.fillstyle = active ? ...
...tcontent, x + width / 2, y + height / 2); // define clickable area ctx.beginpath(); ctx.rect(x, y, width, height); // draw focus ring, if appropriate ctx.drawfocusifneeded(el); } result specifications specification status comment html living standardthe def
inition of 'canvasrenderingcontext2d.drawfocusifneeded' in that specification. living standard
initial def
inition ...
CanvasRenderingContext2D.globalAlpha - Web APIs
anvas 2d api specifies the alpha (transparency) value that is applied to shapes and images before they are drawn onto the canvas. see also the chapter applying styles and color in the canvas tutorial. syntax ctx.globalalpha = value; options value a number between 0.0 (fully transparent) and 1.0 (fully opaque), inclusive. the default value is 1.0. values outside that range, including inf
inity and nan, will not be set, and globalalpha will retain its previous value. examples drawing translucent shapes this example uses the globalalpha property to draw two semi-transparent rectangles. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.globalalpha = 0.5; ctx.fillstyle = 'blue'; ctx.fillrect(...
... living standard ...
CanvasRenderingContext2D.putImageData() - Web APIs
al vertical position (y coordinate) of the top-left corner from which the image data will be extracted. defaults to 0. dirtywidth optional width of the rectangle to be painted. defaults to the width of the image data. dirtyheight optional height of the rectangle to be painted. defaults to the height of the image data. errors thrown notsupportederror thrown if any of the arguments is inf
inite. invalidstateerror thrown if the imagedata object's data has been detached. examples understanding putimagedata to understand what this algorithm does under the hood, here is an implementation on top of canvasrenderingcontext2d.fillrect(). html <canvas id="canvas"></canvas> javascript var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); function putimage...
... living standard ...
CanvasRenderingContext2D.setTransform() - Web APIs
a (m11) horizontal scaling. a value of 1 results in no scaling. b (m12) vertical skewing. c (m21) horizontal skewing. d (m22) vertical scaling. a value of 1 results in no scaling. e (dx) horizontal translation (moving). f (dy) vertical translation (moving). the newer type consists of a single parameter, matrix, representing a 2d transformation matrix to set (technically, a dommatrix
init object; any object will do as long as it contains the above components as properties). examples skewing a shape this example skews a rectangle both vertically (.2) and horizontally (.8). scaling and translation remain unchanged. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.settransform(1, .2, .8, ...
... living standard ...
CanvasRenderingContext2D.shadowBlur - Web APIs
hadowoffsetx, or shadowoffsety properties must be non-zero, as well. syntax ctx.shadowblur = level; level a non-negative float specifying the level of shadow blur, where 0 represents no blur and larger numbers represent increasingly more blur. this value doesn't correspond to a number of pixels, and is not affected by the current transformation matrix. the default value is 0. negative, inf
inity, and nan values are ignored. examples adding a shadow to a shape this example adds a blurred shadow to a rectangle. the shadowcolor property sets its color, and shadowblur sets its level of bluriness. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // shadow ctx.shadowcolor = 'red'; ctx.shadowblur = 15...
...ts its level of bluriness. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // shadow ctx.shadowcolor = 'red'; ctx.shadowblur = 15; // rectangle ctx.fillstyle = 'blue'; ctx.fillrect(20, 20, 150, 100); result specifications specification status comment html living standardthe def
inition of 'canvasrenderingcontext2d.shadowblur' in that specification. living standard ...
CanvasRenderingContext2D.shadowOffsetX - Web APIs
nly drawn if the shadowcolor property is set to a non-transparent value. one of the shadowblur, shadowoffsetx, or shadowoffsety properties must be non-zero, as well. syntax ctx.shadowoffsetx = offset; offset a float specifying the distance that shadows will be offset horizontally. positive values are to the right, and negative to the left. the default value is 0 (no horizontal offset). inf
inity and nan values are ignored. examples moving a shadow horizontally this example adds a blurred shadow to a rectangle. the shadowcolor property sets its color, shadowoffsetx sets its offset 25 units to the right, and shadowblur gives it a blur level of 10. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ...
...0. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // shadow ctx.shadowcolor = 'red'; ctx.shadowoffsetx = 25; ctx.shadowblur = 10; // rectangle ctx.fillstyle = 'blue'; ctx.fillrect(20, 20, 150, 100); result specifications specification status comment html living standardthe def
inition of 'canvasrenderingcontext2d.shadowoffsetx' in that specification. living standard ...
CanvasRenderingContext2D.shadowOffsetY - Web APIs
te: shadows are only drawn if the shadowcolor property is set to a non-transparent value. one of the shadowblur, shadowoffsetx, or shadowoffsety properties must be non-zero, as well. syntax ctx.shadowoffsety = offset; offset a float specifying the distance that shadows will be offset vertically. positive values are down, and negative are up. the default value is 0 (no vertical offset). inf
inity and nan values are ignored. examples moving a shadow vertically this example adds a blurred shadow to a rectangle. the shadowcolor property sets its color, shadowoffsety sets its offset 25 units towards the bottom, and shadowblur gives it a blur level of 10. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'...
...10. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // shadow ctx.shadowcolor = 'red'; ctx.shadowoffsety = 25; ctx.shadowblur = 10; // rectangle ctx.fillstyle = 'blue'; ctx.fillrect(20, 20, 150, 80); result specifications specification status comment html living standardthe def
inition of 'canvasrenderingcontext2d.shadowoffsety' in that specification. living standard ...
Manipulating video using canvas - Web APIs
c1 is used to display the current frame of the original video, while c2 is used to display the video after performing the chroma-keying effect; c2 is preloaded with the still image that will be used to replace the green background in the video. the javascript code is imported from a script named processor.js. the javascript code the javascript code in processor.js consists of three methods.
initializing the chroma-key player the doload() method is called when the xhtml document
initially loads. this method's job is to prepare the variables needed by the chroma-key processing code, and to set up an event listener so we can detect when the user starts playing the video. var processor; processor.doload = function doload() { this.video = document.getelementbyid('video'); this...
...on when the user presses the play button on the video. in response to the user beginning playback, this code fetches the width and height of the video, halving each (we will be halving the size of the video when we perform the chroma-keying effect), then calls the timercallback() method to start watching the video and computing the visual effect. the timer callback the timer callback is called
initially when the video starts playing (when the "play" event occurs), then takes responsibility for establishing itself to be called periodically in order to launch the keying effect for each frame. processor.timercallback = function timercallback() { if (this.video.paused || this.video.ended) { return; } this.computeframe(); let self = this; settimeout(function() { ...
Drawing shapes with canvas - Web APIs
: screenshotlive sample moving the pen one very useful function, which doesn't actually draw anything but becomes part of the path list described above, is the moveto() function. you can probably best think of this as lifting a pen or pencil from one spot on a piece of paper and placing it on the next. moveto(x, y) moves the pen to the coordinates specified by x and y. when the canvas is
initialized or beginpath() is called, you typically will want to use the moveto() function to place the starting point somewhere else. we could also use moveto() to draw unconnected paths. take a look at the smiley face below. to try this for yourself, you can use the code snippet below. just paste it into the draw() function we saw earlier. <html> <body onload="draw();"> <canvas id="canvas" wi...
...this might allow you to pass around path data and re-use them in both, svg and canvas. the path will move to point (m10 10) and then move horizontally 80 points to the right (h 80), then 80 points down (v 80), then 80 points to the left (h -80), and then back to the start (z). you can see this example on the path2d constructor page. var p = new path2d('m10 10 h 80 v ...
CharacterData - Web APIs
he specified amount of characters, starting at the specified offset, with the specified domstring; when this method returns, data contains the modified domstring. characterdata.substringdata() returns a domstring containing the part of characterdata.data of the specified length and starting at the specified offset. specifications specification status comment domthe def
inition of 'characterdata' in that specification. living standard added implemention of the childnode and nondocumenttypechildnode interface. document object model (dom) level 3 core specificationthe def
inition of 'characterdata' in that specification. obsolete no change from document object model (dom) level 2 core specification. document object model (dom) level 2 core ...
...a' in that specification. living standard added implemention of the childnode and nondocumenttypechildnode interface. document object model (dom) level 3 core specificationthe def
inition of 'characterdata' in that specification. obsolete no change from document object model (dom) level 2 core specification. document object model (dom) level 2 core specificationthe def
inition of 'characterdata' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'characterdata' in that specification. obsolete
initial def
inition. ...
ChildNode - Web APIs
the children list of this childnode's parent, just after this childnode. domstring objects are inserted as equivalent text nodes. childnode.replacewith() replaces this childnode in the children list of its parent with a set of node or domstring objects. domstring objects are inserted as equivalent text nodes. ...
...domthe def
inition 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 def
inition of 'elementtraversal' in that specification. obsolete added the
initial def
inition of its properties to the elementtraversal pure interface and use it on element. polyfill external on github: childnode.js ...
Clients.matchAll() - Web APIs
ed order, correct as per spec. ...
...function(clientlist) { for (var i = 0 ; i < clientlist.length ; i++) { if (clientlist[i].url === 'index.html') { clients.openwindow(clientlist[i]); // or do something else involving the matching client } } }); specifications specification status comment service workersthe def
inition of 'clients: matchall' in that specification. working draft
initial def
inition ...
Clients.openWindow() - Web APIs
...
...ue) : false); // otherwise, open a new tab to the applicable url and focus it. if (!hadwindowtofocus) clients.openwindow(e.notification.data.url).then(windowclient => windowclient ? windowclient.focus() : null); })); }); specifications specification status comment service workersthe def
inition of 'clients: openwindow' in that specification. working draft
initial def
inition. ...
ClipboardEvent() - Web APIs
...
...ning the data concerned by the clipboard event. datatype : a domstring containing the mime-type of the data contained in the data argument. data : a domstring containing the data concerned by the clipboard event. specifications specification status comment clipboard api and eventsthe def
inition of 'clipboardevent()' in that specification. working draft
initial def
inition. ...
ClipboardEvent.clipboardData - Web APIs
...
...the data to be pasted from the paste event handler, typically with a getdata(format) call. see the cut, copy, and paste events documentation for more information. syntax data = clipboardevent.clipboarddata specifications specification status comment clipboard api and eventsthe def
inition of 'clipboardevent.clipboarddata' in that specification. working draft
initial def
inition. ...
CloseEvent() - Web APIs
the closeevent() constructor creates a new closeevent. syntax var event = new closeevent(typearg, closeevent
init); values typearg is a domstring representing the name of the event. closeevent
init optional is a closeevent
init dictionary, having the following fields: "wasclean", optional and defaulting to false, of type long, indicates if the connection has been closed cleanly or not. "code", optional and defaulting to 0, of type unsigned short, that is the connection close code sent by the server. "reason", optional and defaulting to '', of type domstring, that is a human-readable reason why the server closed the connection. the closeevent
init dictionary also accepts fields from the event
init dictionary. specifications specification status comme...
...type unsigned short, that is the connection close code sent by the server. "reason", optional and defaulting to '', of type domstring, that is a human-readable reason why the server closed the connection. the closeevent
init dictionary also accepts fields from the event
init dictionary. specifications specification status comment html living standardthe def
inition of 'closeevent()' in that specification. living standard
initial def
inition. ...
CloseEvent - Web APIs
closed. this is delivered to the listener indicated by the websocket object's onclose attribute. constructor closeevent() creates a new closeevent. properties this interface also inherits properties from its parent, event. closeevent.code read only returns an unsigned short containing the close code sent by the server. the following values are permitted status codes. the following def
initions are sourced from the iana website [ref]. note that the 1xxx codes are only websocket-internal and not for the same meaning by the transported data (like when the application-layer protocol is invalid). the only permitted codes to be specified in firefox are 1000 and 3000 to 4999 [source, bug]. status code name description 0–999 reserved and not used...
...se by applications. closeevent.reason read only returns a domstring indicating the reason the server closed the connection. this is specific to the particular server and sub-protocol. closeevent.wasclean read only returns a boolean that indicates whether or not the connection was cleanly closed. methods this interface also inherits methods from its parent, event. closeevent.
initcloseevent()
initializes the value of a closeevent created. if the event has already being dispatched, this method does nothing. do not use this method anymore, use the closeevent() constructor instead. specifications specification status comment html living standardthe def
inition of 'closeevent' in that specification. living standard
initial def
inition. ...
CompositionEvent.CompositionEvent() - Web APIs
the compositionevent() constructor creates a new compositionevent object instance. syntax const myevent = new compositionevent(typearg [, compositionevent
init]) values typearg is a domstring representing the name of the event. compositionevent
init optional a compositionevent
init dictionary object, which can contain the following members: data
initializes the data attribute of the compositionevent object to the characters generated by the ime composition. note: the compositionevent
init dictionary inherits from the uievent
init dictionary, so can also accept members defined on there. ...
... data
initializes the data attribute of the compositionevent object to the characters generated by the ime composition. note: the compositionevent
init dictionary inherits from the uievent
init dictionary, so can also accept members defined on there. specifications specification status comment document object model (dom) level 3 events specificationthe def
inition of 'compositionevent()' in that specification. obsolete
initial def
inition. ...
DOMImplementation.createDocumentType() - Web APIs
stem identifiers. example var dt = document.implementation.createdocumenttype('svg:svg', '-//w3c//dtd svg 1.1//en', 'http://www.w3.org/graphics/svg/1.1/dtd/svg11.dtd'); var d = document.implementation.createdocument('http://www.w3.org/2000/svg', 'svg:svg', dt); alert(d.doctype.publicid); // -//w3c//dtd svg 1.1//en specifications specification status comment domthe def
inition of 'domimplementation.createdocumenttype' in that specification. living standard no change from document object model (dom) level 3 core specification document object model (dom) level 3 core specificationthe def
inition of 'domimplementation.createdocumenttype' in that specification. obsolete no change from document object model (dom) level 2 core specification do...
...fication. living standard no change from document object model (dom) level 3 core specification document object model (dom) level 3 core specificationthe def
inition of 'domimplementation.createdocumenttype' in that specification. obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe def
inition of 'domimplementation.createdocumenttype' in that specification. obsolete
initial def
inition. ...
DOMImplementation.hasFeature() - Web APIs
is method to always return true, where the functionality was accurate and in use. syntax const flag = document.implementation.hasfeature(feature, version); parameters feature a domstring representing the feature name. version a domstring representing the version of the specification defining the feature. specifications specification status comment domthe def
inition of 'domimplementation.hasfeature' in that specification. living standard modified to always return true except for svg features. document object model (dom) level 3 core specificationthe def
inition of 'domimplementation.hasfeature' in that specification. obsolete no change from document object model (dom) level 2 core specification document object model (dom) leve...
...feature' in that specification. living standard modified to always return true except for svg features. document object model (dom) level 3 core specificationthe def
inition of 'domimplementation.hasfeature' in that specification. obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe def
inition of 'domimplementation.hasfeature' in that specification. obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe def
inition of 'domimplementation.hasfeature' in that specification. obsolete
initial def
inition. ...
DOMImplementation - Web APIs
reates and returns an html document. domimplementation.hasfeature() returns a boolean indicating if a given feature is supported or not. this function is unreliable and kept for compatibility purpose alone: except for svg-related queries, it always returns true. old browsers are very inconsistent in their behavior. specifications specification status comment domthe def
inition of 'domimplementation' in that specification. living standard removed the getfeature() method. added the createhtmldocument() method. modified the return type of createdocument() from document to xmldocument. document object model (dom) level 3 core specificationthe def
inition of 'domimplementation' in that specification. obsolete added the getfeature() method (nev...
... added the createhtmldocument() method. modified the return type of createdocument() from document to xmldocument. document object model (dom) level 3 core specificationthe def
inition of 'domimplementation' in that specification. obsolete added the getfeature() method (never implemented by any user agent). document object model (dom) level 2 core specificationthe def
inition of 'domimplementation' in that specification. obsolete added the createdocument() and createdocumenttype() methods. document object model (dom) level 1 specificationthe def
inition of 'domimplementation' in that specification. obsolete
initial def
inition. ...
DOMMatrixReadOnly.flipX() - Web APIs
ngle, inverting it across the x-axis. the red triangle is left in place. ...
...cument.getelementbyid('flipped'); const matrix = new dommatrixreadonly(); const flippedmatrix = matrix.flipx(); flipped.setattribute('transform', flippedmatrix.tostring()); screenshotlive sample specifications specification status comment geometry interfaces module level 1the def
inition of 'dommatrixreadonly.flipx()' in that specification. candidate recommendation
initial def
inition ...
DOMPoint.fromPoint() - Web APIs
the static dompoint method frompoint() creates and returns a new mutable dompoint object given a source point. the source point is specified as a dompoint
init-compatible object, which includes both dompoint and dompointreadonly. you can also create a new dompoint object using the new dompoint() constructor. although this interface is based on dompointreadonly, it is not read-only; the properties within may be changed at will. syntax var point = dompoint.frompoint(sourcepoint); properties sourcepoint a dompoint
init-compliant object, which includes both dompoint and dompointreadonly, from which to take the values of the new point's properties. return value a new dompoint object whose coordinate and perspective values are identical to those in the source point. the point's properties...
...int); creating a 2d point this sample creates a 2d point, specifying an inline object that includes the values to use for x and y. the z and w properties are allowed to keep their default values (0 and 1 respectively). var center = dompoint.frompoint({x: 75, y: -50, z: -55, w: 0.25}); specifications specification status comment geometry interfaces module level 1the def
inition of 'frompoint()' in that specification. candidate recommendation
initial def
inition ...
DOMPoint.DOMPoint() - Web APIs
syntax point = new dompoint(x, y, z, w); parameters x optional the x coordinate for the new dompoint. y optional the y coordinate for the new dompoint. z optional the z coordinate for the new dompoint. ...
...rrent window, then creates a second point based on the first, which is then offset by 100 pixels both vertically and horizontally. var windtopleft = new dompoint(window.screenx, window.screeny); var newtopleft = dompoint.frompoint(windtopleft); newtopleft.x += 100; newtopleft.y += 100; specifications specification status comment geometry interfaces module level 1the def
inition of 'dompoint()' in that specification. candidate recommendation
initial def
inition ...
DOMPoint - Web APIs
he origin, a positive y component is downward from the origin, and a positive z component extends outward from the screen (in other words, toward the user). constructor dompoint() creates and returns a new dompoint object given the values of zero or more of its coordinate components and optionally the w perspective value. you can also use an existing dompoint or dompointreadonly or a dompoint
init dictionary to create a new point by calling the dompoint.frompoint() static method. methods dompoint inherits methods from its parent, dompointreadonly. static methods dompoint.frompoint() creates a new mutable dompoint object given an existing point (or a dompoint
init dictionary) which provides the values for its properties. properties dompoint inherits properties from its parent,...
... candidate recommendation ...
DOMPointReadOnly - Web APIs
25); /* 3d with perspective */ const point = new dompointreadonly(100, 100, 100, 1.0); the other option is to use the static dompointreadonly.frompoint() method: const point = dompointreadonly.frompoint({x: 100, y: 100, z: 50; w: 1.0}); constructor dompointreadonly() creates a new dompointreadonly object given the values of its coordinates and perspective. to create a point using adompoint
init object, you can instead use dompointreadonly.frompoint(). properties dompointreadonly.x read only the point's horizontal coordinate, x. dompointreadonly.y read only the point's vertical coordinate, y. dompointreadonly.z read only the point's depth coordinate, z. dompointreadonly.w read only the point's perspective value, w. static methods dompointreadonly.frompoint() a stati...
...e point's horizontal coordinate, x. dompointreadonly.y read only the point's vertical coordinate, y. dompointreadonly.z read only the point's depth coordinate, z. dompointreadonly.w read only the point's perspective value, w. static methods dompointreadonly.frompoint() a static method that creates a new dompointreadonly object given the coordinates provided in the specified dompoint
init object. methods matrixtransform() applies a matrix transform specified as a dommatrix
init object to the dompointreadonly object. tojson() returns a json representation of the dompointreadonly object. specifications specification status comment geometry interfaces module level 1the def
inition of 'dompoint' in that specification. candidate recommendation...
DOMRect - Web APIs
...
...h if width is negative.) methods domrect inherits methods from its parent, domrectreadonly. static methods domrectreadonly.fromrect() creates a new domrect object with a given location and dimensions. specifications specification status comment geometry interfaces module level 1the def
inition of 'domrect' in that specification. candidate recommendation
initial def
inition. ...
DOMStringList - Web APIs
type returned by some apis which contains a list of domstring (strings). ...
... properties domstringlist.length read only returns the length of the list. ...
DOMTokenList.add() - Web APIs
's node.textcontent. ...
...an> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; classes.add("d"); span.textcontent = classes; the output looks like this: you can add multiple tokens as well: span.classlist.add("d", "e", "f"); specifications specification status comment domthe def
inition of 'add()' in that specification. living standard
initial def
inition ...
DOMTokenList.forEach() - 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandro...
...t.prototype.foreach) { domtokenlist.prototype.foreach = function (callback, thisarg) { thisarg = thisarg || window; for (var i = 0; i < this.length; i++) { callback.call(thisarg, this[i], i, this); } }; } specifications specification status comment domthe def
inition of 'foreach() (as iterable<node>)' in that specification. living standard
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung int...
DOMTokenList.keys() - Web APIs
ng each one to the <span>'s node.textcontent. ...
...</span> now the javascript: var span = document.queryselector("span"); var classes = span.classlist; var iterator = classes.keys(); for(var value of iterator) { span.textcontent += value + ' ++ '; } the output looks like this: specifications specification status comment domthe def
inition of 'keys() (as iterable<node>)' in that specification. living standard
initial def
inition ...
DOMTokenList.length - Web APIs
ite the length of the list to the <span>'s node.textcontent. ...
...st, the html: <span class="a b c"></span> now the javascript: let span = document.queryselector("span"); let classes = span.classlist; let length = classes.length; span.textcontent = `classlist length = ${length}`; the output looks like this: specifications specification status comment domthe def
inition of 'length' in that specification. living standard
initial def
inition ...
DOMTokenList.replace() - Web APIs
class. the following code will only work with ie10-11. ...
...earlier versions of ie, refer to the polyfill at element.classlist#polyfill domtokenlist.prototype.replace = function (a, b) { if (this.contains(a)) { this.add(b); this.remove(a); return true; } return false; } specifications specification status comment domthe def
inition of 'replace()' in that specification. living standard
initial def
inition ...
DOMTokenList.values() - Web APIs
each one to the <span>'s node.textcontent. ...
...an> now the javascript: var span = document.queryselector("span"); var classes = span.classlist; var iterator = classes.values(); for(var value of iterator) { span.textcontent += value + ' ++ '; } the output looks like this: specifications specification status comment domthe def
inition of 'values() (as iterable<node>)' in that specification. living standard
initial def
inition ...
DOMUserData - Web APIs
ype (e.g., node.setuserdata() and node.getuserdata()). ...
...data is not persisted nor serialized and will not be present after the application has restarted or after a crash. if you are interested in persisting data you might rather need to use nsisessionstore. specifications specification status comment document object model (dom) level 3 core specificationthe def
inition of 'domuserdata' in that specification. obsolete
initial specification ...
DataTransfer.clearData() - Web APIs
le 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. ...
...mentbyid(_data); // append drag source element to event's target element event.target.appendchild(element); // change css styles and displayed text element.style.csstext = 'border: 1px solid black;display: block; color: red'; element.innerhtml = "i'm in the drop zone!"; } }) specifications specification status comment html living standardthe def
inition of 'datatransfer.cleardata()' in that specification. living standard html 5.1the def
inition of 'datatransfer.cleardata()' in that specification. recommendation
initial def
inition ...
DataTransfer.dropEffect - Web APIs
's cursor may indicate which type of operation will occur. when the datatransfer object is created, dropeffect is set to a string value. on getting, it returns its current value. on setting, if the new value is one of the values listed below, then the property's current value will be set to the new value and other values will be ignored. for the dragenter and dragover events, dropeffect will be
initialized based on what action the user is requesting. how this is determined is platform specific, but typically the user can press modifier keys such as the alt key to adjust the desired action. within event handlers for dragenter and dragover events, dropeffect should be modified if a different action is desired than the action that the user is requesting. for the drop and dragend events, drope...
...ppendchild(document.getelementbyid(data)); } function dragover_handler(ev) { console.log("dragover: dropeffect = " + ev.datatransfer.dropeffect + " ; effectallowed = " + ev.datatransfer.effectallowed); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } specifications specification status comment html living standardthe def
inition of 'dropeffect' in that specification. living standard html 5.1the def
inition of 'dropeffect' in that specification. recommendation
initial def
inition ...
DataTransfer.effectAllowed - Web APIs
the item may not be dropped. copy a copy of the source item may be made at the new location. copylink a copy or link operation is permitted. copymove a copy or move operation is permitted. link a link may be established to the source at the new location. linkmove a link or move operation is permitted. move an item may be moved to a new location. all all operations are permitted. un
initialized the default value when the effect has not been set, equivalent to all. assigning any other value to effectallowed has no effect and the old value is retained. internet explorer will change the value to be lowercased; thus, linkmove will become linkmove, and so on. example this example shows the use of the effectallowed and dropeffect properties. <!doctype html> <html lang=en> <title...
...d="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html living standardthe def
inition of 'effectallowed' in that specification. living standard html 5.1the def
inition of 'effectallowed' in that specification. recommendation
initial def
inition ...
DataTransferItem - Web APIs
lesystementry representing the selected file's entry in its file system. this will generally be either a filesystemfileentry or filesystemdirectoryentry object. example all of this interface's methods and properties have their own reference page, and each reference page has an example of its usage. ...
...is will generally be either a filesystemfileentry or filesystemdirectoryentry object. example all of this interface's methods and properties have their own reference page, and each reference page has an example of its usage. specifications specification status comment html living standardthe def
inition of 'datatransferitem' in that specification. living standard
initial def
inition. html 5.1the def
inition of 'datatransferitem' in that specification. recommendation w3c snapshot of whatwg file and directory entries apithe def
inition of 'datatransferitem.webkitgetasentry()' in that specification. draft def
inition of webkitgetasentry() as part of the file and directory entries api. ...
DelayNode() - Web APIs
nput data, and its propagation to the output. syntax var delaynode = new delaynode(context); var delaynode = new delaynode(context, options); parameters inherits parameters from the audionodeoptions dictionary. context a reference to an audiocontext or offlineaudiocontext. options optional an object specifying the delay node options. can contain the following members: delaytime: the
initial delay time for the node, in seconds. the default is 0. maxdelaytime: the maximum delay time for the node, in seconds. defaults to 1. return value a new delaynode object instance. example const audioctx = new audiocontext(); const delaynode = new delaynode(audioctx, { delaytime: 0.5, maxdelaytime: 2, }); specifications specification status comment web au...
... for the node, in seconds. the default is 0. maxdelaytime: the maximum delay time for the node, in seconds. defaults to 1. return value a new delaynode object instance. example const audioctx = new audiocontext(); const delaynode = new delaynode(audioctx, { delaytime: 0.5, maxdelaytime: 2, }); specifications specification status comment web audio apithe def
inition of 'delaynode()' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for...
Using light sensors - Web APIs
ually be used in the wild. ...
...beneficial to the user to change the ui to a darker color in a darker environment. ...
DisplayMediaStreamConstraints.audio - Web APIs
n the constraints object is included in the mediastream returned by getdisplaymedia(). ...
... if no audio source is available, or the user agent doesn't support audio tracks with getdisplaymedia(), the returned mediastream has no audio track, but no error occurs. the audio track is always considered optional. example specifications specification status comment unknownthe def
inition of 'displaymediastreamconstraints.audio' in that specification. unknown
initial def
inition ...
DisplayMediaStreamConstraints.video - Web APIs
es which do not directly correspond to display areas. ...
...s for windows to allow capture of window contents that are hidden by other windows in front of them, or buffers containing larger documents that need to be scrolled through to see the entire contents in their windows. example specifications specification status comment unknownthe def
inition of 'displaymediastreamconstraints.video' in that specification. unknown
initial def
inition ...
DisplayMediaStreamConstraints - Web APIs
uded in a mediastreamtrack within the stream provided by getdisplaymedia(). ...
...onally, a mediatrackconstraints object may be given, providing options specifying processing to be performed on the video data before adding it to the stream. a value of false is not permitted, and results in a typeerror being thrown. specifications specification status comment unknownthe def
inition of 'displaymediastreamconstraints' in that specification. unknown
initial def
inition ...
Document: copy event - Web APIs
the copy event fires when the user
initiates a copy action through the browser's user interface. bubbles yes cancelable yes interface clipboardevent event handler property oncopy the original target for this event is the element that was the intended target of the copy action. you can listen for this event on the document interface to handle it in the capture or bubbling phases. for full details on this event please see the page on the element: copy event. ...
...dler property oncopy the original target for this event is the element that was the intended target of the copy action. ...
Document.createEvent() - Web APIs
many methods used with createevent, such as
initcustomevent, are deprecated. use event constructors instead. creates an event of the type specified. the returned object should be first
initialized and can then be passed to eventtarget.dispatchevent. syntax var event = document.createevent(type); event is the created event object. type is a string that represents the type of event to be created. possible event types include "uievents", "mouseevents", "mutationevents", and "htmlevents". see notes section for details. example // create the event. var event = document.createevent('event'); // define that the event name is 'build'. event.
initevent('build', true, true); // listen for the event. elem.addeventlistener('build', function (e) { // e.target matches elem }, false...
...ko supports some non-standard event object aliases, which are listed below. event module standard event object gecko also supports text event module textevent textevents keyboard event module keyboardevent keyevents basic events module event events specifications specification status comment domthe def
inition of 'document.createevent' in that specification. living standard ...
Document.createNSResolver() - Web APIs
syntax nsresolver = document.creatensresolver(node); parameters node is the node to be used as a context for namespace resolution. return value nsresolver is an xpathnsresolver object. notes adapts any dom node to resolve namespaces so that an xpath expression can be easily evaluated relative to the context of the node where it appeared within the document. this adapter works like the dom level 3 method lookupnamespaceuri on nodes in resolving the namespaceuri from a given prefix using the current information available in the node's hierarchy at the time lookupnamespaceuri is called. ...
... mapping the prefix to the namespace. read more on how to create a user defined namespace resolver if you wish to take the latter approach. creatensresolver was introduced in dom level 3. see also document.evaluate introduction to using xpath in javascript specifications specification status comment document object model (dom) level 3 xpath specificationthe def
inition of 'document.creatensresolver' in that specification. recommendation ...
Document: cut event - Web APIs
the cut event is fired when the user has
initiated a "cut" action through the browser's user interface. bubbles yes cancelable yes interface clipboardevent event handler property oncut the original target for this event is the element that was the intended target of the cut action. you can listen for this event on the document interface to handle it in the capture or bubbling phases. for full details on this event please see the page on the element: cut event. ...
...t handler property oncut the original target for this event is the element that was the intended target of the cut action. you can listen for this event on the document interface to handle it in the capture or bubbling phases. for full details on this event please see the page on the element: cut event. examples document.addeventlistener('cut', (event) => { console.log('cut action
initiated') }); specifications specification status clipboard api and events working draft ...
Document.forms - 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://githu...
...['login'] loginform.elements.email.placeholder = 'test@example.com'; loginform.elements.password.placeholder = 'password'; </script> </body> </html> specifications specification status comment html living standardthe def
inition of 'document.forms' in that specification. living standard document object model (dom) level 2 html specificationthe def
inition of 'document.forms' in that specification. obsolete
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for an...
Document.getElementById() - Web APIs
th the name "id" are not of type id unless so defined in the document's dtd. the id attribute is defined to be of id type in the common cases of xhtml, xul, and other. implementations that do not know whether attributes are of type id or not are expected to return null. specification specification status comment document object model (dom) level 1 specificationthe def
inition of 'getelementbyid' in that specification. obsolete
initial def
inition for the interface document object model (dom) level 2 core specificationthe def
inition of 'getelementbyid' in that specification. obsolete supersede dom 1 document object model (dom) level 3 core specificationthe def
inition of 'getelementbyid' in that specification. obsolete supersede dom...
...' in that specification. obsolete
initial def
inition for the interface document object model (dom) level 2 core specificationthe def
inition of 'getelementbyid' in that specification. obsolete supersede dom 1 document object model (dom) level 3 core specificationthe def
inition of 'getelementbyid' in that specification. obsolete supersede dom 2 domthe def
inition of 'getelementbyid' in that specification. living standard intend to supersede dom 3 ...
Document.lastModified - Web APIs
(see: bug 4363 – document.lastmodified returns date in utc time, but should return it in local time) if you want to know whether an external page has changed, please read this paragraph about the xmlhttprequest() api. sp...
...ring in utc; gecko and internet explorer return a time in the local timezone. (see: bug 4363 – document.lastmodified returns date in utc time, but should return it in local time) if you want to know whether an external page has changed, please read this paragraph about the xmlhttprequest() api. specifications specification status comment html living standardthe def
inition of 'document.lastmodified' in that specification. living standard ...
Document.links - Web APIs
ent.links value an htmlcollection. ...
...atetextnode(links[i].href); var linebreak = document.createelement("br"); document.body.appendchild(linkhref); document.body.appendchild(linebreak); } specifications specification status comment html living standardthe def
inition of 'document.links' in that specification. living standard document object model (dom) level 2 html specificationthe def
inition of 'document.links' in that specification. obsolete
initial def
inition ...
Document.onfullscreenerror - Web APIs
...
..., causing the fullscreenerror to be sent to the document. document.onfullscreenerror = function ( event ) { displaywarning("unable to switch into full-screen mode."); }; //.... document.documentelement.requestfullscreen(); specifications specification status comment fullscreen apithe def
inition of 'onfullscreenerror' in that specification. living standard
initial def
inition. ...
Document: paste event - Web APIs
the paste event is fired when the user has
initiated a "paste" action through the browser's user interface. bubbles yes cancelable yes interface clipboardevent event handler property onpaste the original target for this event is the element that was the intended target of the paste action. you can listen for this event on the document interface to handle it in the capture or bubbling phases. for full details on this event please see the page on the element: paste event. ...
...property onpaste the original target for this event is the element that was the intended target of the paste action. ...
Document.title - Web APIs
n an html document). example <!doctype html> <html> <head> <title>hello world!</title> </head> <body> <script> alert(document.title); // displays "hello world!" document.title = "goodbye world!"; alert(document.title); // displays "goodbye world!" </script> </body> </html> notes this property applies to html, svg, xul, and other documents in gecko. for html documents the
initial value of document.title is the text content of the <title> element. for xul it's the value of the title attribute of the <xul:window> or other top-level xul element. in xul, accessing document.title before the document is fully loaded has undefined behavior: document.title may return an empty string and setting document.title may have no effect. specifications specification stat...
... the <title> element. for xul it's the value of the title attribute of the <xul:window> or other top-level xul element. in xul, accessing document.title before the document is fully loaded has undefined behavior: document.title may return an empty string and setting document.title may have no effect. specifications specification status comment html living standardthe def
inition of 'document.title' in that specification. living standard ...
DocumentFragment.querySelector() - Web APIs
browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the data, ple...
...t div document.queryselector('#foo:bar') // does not match anything document.queryselector('#foo\\:bar') // match the second div </script> specifications specification status comment selectors api level 2the def
inition of 'documentfragment.queryselector' in that specification. obsolete no change from selectors api level 1 selectors api level 1the def
inition of 'documentfragment.queryselector' in that specification. obsolete
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webv...
DocumentFragment.querySelectorAll() - Web APIs
the documentfragment.queryselectorall() method returns a nodelist of elements within the documentfragment (using depth-first pre-order traversal of the document's nodes) that matches the specified group of selectors. if the selectors specified in parameter are invalid a domexception with a syntax_err value is raised. note: the def
inition of this api was moved to the parentnode interface. syntax elementlist = documentfragment.queryselectorall(selectors); parameters selectors is a domstring containing one or more css selectors separated by commas. examples this example returns a list of all div elements within the documentfragment with a class of either "note" or "alert": var matches = documentfrag.queryselectorall("div.note, div.alert"); specifications specification ...
...); parameters selectors is a domstring containing one or more css selectors separated by commas. examples this example returns a list of all div elements within the documentfragment with a class of either "note" or "alert": var matches = documentfrag.queryselectorall("div.note, div.alert"); specifications specification status comment selectors api level 1the def
inition of 'documentfragment.queryselectorall' in that specification. obsolete
initial def
inition. ...
Examples of web and XML development using the DOM - Web APIs
of web and xml development using the dom. wherever possible, the examples use common apis, tricks, and patterns in javascript for manipulating the document object. ...
... 0; i < arrimages.length; i++) { strhtml += "<li>image" + (i+1) + ": height=" + arrimages[i].height + ", width=" + arrimages[i].width + ", style.height=" + arrimages[i].style.height + ", style.width=" + arrimages[i].style.width + "<\/li>"; } strhtml += "<\/ul>"; objoutput.innerhtml = strhtml; } </script> </head> <body onload="
init();"> <p>image 1: no height, width, or style <img id="image1" src="https://udn.realityripple.com/samples/d2/8ba7141ed1.gif"> </p> <p>image 2: height="50", width="500", but no style <img id="image2" src="https://udn.realityripple.com/samples/d2/8ba7141ed1.gif" height="50" width="500"> </p> <p>image 3: no height, width, but style="height: 50px; width: 500px;" <img id="image3" ...
EXT_color_buffer_half_float - Web APIs
...
...ernalformat parameter now accepts ext.rgba16f_ext and ext.rgba16f_ext. examples var ext = gl.getextension('ext_color_buffer_half_float'); gl.renderbufferstorage(gl.renderbuffer, ext.rbga16f_ext, 256, 256); specifications specification status comment ext_color_buffer_half_floatthe def
inition of 'ext_color_buffer_half_float' in that specification. recommendation
initial def
inition. ...
EffectTiming.endDelay - Web APIs
the enddelay property of the effecttiming dictionary (part of the web animations api) indicates the number of milliseconds to delay after the active period of an animation sequence. the animation's end time—the time at which an iteration is considered to have finished—is the time at which the animation finishes an iteration (its
initial delay, animationeffecttimingreadonly.delay, plus its duration,duration, plus its end delay. this is useful for sequencing animations based on the end time of another animation; note, however, that many of the sequence effectst that will benefit most from this property have not been defined in the specification yet. for now, its main purpose is to represent the value of the svg min attribute. element.animate(), keyframeeffectreadonly(), and key...
... working draft editor's draft. ...
Element.attachShadow() - Web APIs
t have a shadow dom for security reasons (for example <a>), and more besides. the following is a list of elements you can attach a shadow root to: any autonomous custom element with a valid name <article> <aside> <blockquote> <body> <div> <footer> <h1> <h2> <h3> <h4> <h5> <h6> <header> <main> <nav> <p> <section> <span> syntax var shadowroot = element.attachshadow(shadowroot
init); parameters shadowroot
init a shadowroot
init dictionary, which can contain the following fields: mode a string specifying the encapsulation mode for the shadow dom tree. this can be one of: open: elements of the shadow root are accessible from javascript outside the root, for example using element.shadowroot: element.shadowroot; // returns a shadowroot obj c...
... living standard ...
Element.classList - Web APIs
; skippropchange = 1, target.classlist = restokenlist, target.classname = strval; skippropchange = 0, restokenlist.length = tokens.length - sub; } } function polyfillclasslist(ele){ if (!ele || !("innerhtml" in ele)) throw typeerror("illegal invocation"); ele.detachevent( "onpropertychange", whenpropchanges ); // prevent duplicate handler inf
inite loop allowtokenlistconstruction = 1; try{ function protoobj(){} protoobj.prototype = new domtokenlist(); } finally { allowtokenlistconstruction = 0 } var protoobjproto = protoobj.prototype, restokenlist = new protoobj(); a: for(var toks=ele.classname.trim().split(wsre), ci=0, clen=toks.length, sub=0; ci !== clen; ++ci){ for (var inneri=0; inner...
...ollection and boost performance. in all polyfilled browsers (ie6-9), an additional element[" uclp"] property is added to element to ensure standards compliant prototyping, and a domtokenlist[" ucl"] property is added to each element["classlist"] object to ensure that the domtokenlist is bounded to its own element. specifications specification status comment domthe def
inition of 'element.classlist' in that specification. living standard
initial def
inition dom4the def
inition of 'element.classlist' in that specification. obsolete ...
Element: click event - Web APIs
ile safari mobile 7.0+ (and likely earlier versions too) suffers from a bug where click events aren't fired on elements that aren't typically interactive (e.g. <div>) and which also don't have event listeners directly attached to the elements themselves (i.e. event delegation is being used). see this live example for a demonstration. see also safari's docs on making elements clickable and the def
inition of "clickable element". known workarounds for this bug: set cursor: pointer; on the element or any of its ancestors. add a dummy onclick="void(0)" attribute to the element or any of its ancestors up to but not including <body>. use a typically interactive element (e.g., <a>) instead of one that isn't typically interactive (e.g., <div>). stop using click event delegation. safari mobile...
...n.addeventlistener('click', event => { button.innerhtml = `click count: ${event.detail}`; }); result try making rapid, repeated clicks on the button to increase the click count. if you take a break between clicks, the count will reset. specifications specification status ui events working draft document object model (dom) level 3 events specificationthe def
inition of 'click' in that specification. obsolete document object model (dom) level 2 events specificationthe def
inition of 'click' in that specification. obsolete ...
Element.computedStyleMap() - Web APIs
the element interface returns a stylepropertymapreadonly interface which provides a read-only representation of a css declaration block that is an alternative to cssstyledeclaration. syntax var stylepropertymapreadonly = element.computedstylemap() parameters none. return value a stylepropertymapreadonly interface. examples we start with some simple html: a paragraph with a link, and a def
inition list to which we will add all the css property / value pairs. <p> <a href="https://example.com">link</a> </p> <dl id="regurgitation"></dl> we add a little bit of css a { --colour: red; color: var(--colour); } we add javascript to grab our link and return back a def
inition list of all the css property values using computedstylemap(). // get the element const myelement = document.que...
... computedstylemap(), you'll see a list of all the css properties and values. in other browsers you'll just see a link. did you realize how many default css properties a link had? update the 'a' to the 'p', and you'll notice a difference in the margin-top and margin-bottom default computed values. specifications specification status comment css typed om level 1the def
inition of 'computedstylemap()' in that specification. working draft
initial def
inition. ...
Element.getElementsByClassName() - Web APIs
mlcollection by passing the htmlcollection as the method's this value. ...
...<div> elements that have a class of test: var testelements = document.getelementsbyclassname('test'); var testdivs = array.prototype.filter.call(testelements, function(testelement) { return testelement.nodename === 'div'; }); specifications specification status comment domthe def
inition of 'element.getelementsbyclassname()' in that specification. living standard
initial def
inition ...
Element.hasAttribute() - Web APIs
obsolete no change from document object model (dom) level 2 core specification document obj...
...ibutens - - removeattribute (dom 1) removeattributens removeattributenode - specifications specification status comment domthe def
inition of 'element.hasattribute()' in that specification. living standard from document object model (dom) level 3 core specification, moved from node to element document object model (dom) level 3 core specificationthe def
inition of 'element.hasattribute()' in that specification. obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe def
inition of 'element.hasattribute()' in that specification. obsolete
initial def
inition. ...
Element.hasAttributes() - Web APIs
alue true or false. examples let foo = document.getelementbyid('foo'); if (foo.hasattributes()) { // do something with 'foo.attributes' } polyfill ;(function(prototype) { prototype.hasattributes = prototype.hasattributes || function() { return (this.attributes.length > 0); } })(element.prototype); specifications specification status comment domthe def
inition of 'element.hasattributes()' in that specification. living standard moved from the node interface to the more specialized element interface. document object model (dom) level 3 core specificationthe def
inition of 'hasattributes()' in that specification. obsolete no change from document object model (dom) level 2 core specification document object model (dom) level...
...s()' in that specification. living standard moved from the node interface to the more specialized element interface. document object model (dom) level 3 core specificationthe def
inition of 'hasattributes()' in that specification. obsolete no change from document object model (dom) level 2 core specification document object model (dom) level 2 core specificationthe def
inition of 'hasattributes()' in that specification. obsolete
initial def
inition, on the node interface. ...
Element.id - Web APIs
s to use an element's id as a selector when styling the document with css. note: identifiers are case-sensitive, but you should avoid creating ids that differ only in the capitalization. syntax var idstr = element.id; // get the id element.id = idstr; // set the id idstr is the identifier of the element. ...
... idstr = element.id; // get the id element.id = idstr; // set the id idstr is the identifier of the element. specifications specification status comment domthe def
inition of 'id' in that specification. living standard no change from document object model (dom) level 2 html specification. document object model (dom) level 2 html specificationthe def
inition of 'id' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'id' in that specification. obsolete
initial def
inition. ...
Element.innerHTML - Web APIs
ing. exceptions syntaxerror an attempt was made to set the value of innerhtml using a string which is not properly-formed html. nomodificationallowederror an attempt was made to insert the html into a node whose parent is a document. usage notes the innerhtml property can be used to examine the current html source of the page, including any changes that have been made since the page was
initially loaded. reading the html contents of an element reading innerhtml causes the user agent to serialize the html or xml fragment comprised of the element's descendants. the resulting string is returned. let contents = myelement.innerhtml; this lets you look at the html markup of the element's content nodes. note: the returned html or xml fragment is generated based on the current contents...
...1px solid black; padding: 2px 4px; overflow-y: scroll; overflow-x: auto; } .log { margin-top: 8px; font-family: monospace; } result the resulting content looks like this. you can see output into the log by moving the mouse in and out of the box, clicking in it, and so forth. specification specification status comment dom parsing and serializationthe def
inition of 'element.innerhtml' in that specification. working draft
initial def
inition ...
Element.localName - Web APIs
xhtml elements in xml doms). ...
...e property returns in the case of the internal dom storage, which is lower case for both html elements in html doms and xhtml elements in xml doms. the tagname property continues to return in the upper case for html elements in html doms. specifications specification status comment domthe def
inition of 'element.localname' in that specification. living standard
initial def
inition ...
Element.querySelector() - Web APIs
hes this group of selectors is returned. return value the first descendant element of baseelement which matches the specified group of selectors. the entire hierarchy of elements is considered when matching, including those outside the set of elements including baseelement and its descendants; in other words, selectors is first applied to the whole document, not the baseelement, to generate an
initial list of potential elements. the resulting elements are then examined to see if they are descendants of baseelement. the first match of those remaining elements is returned by the queryselector() method. if no matches are found, the returned value is null. exceptions syntaxerror the specified selectors are invalid. examples let's consider a few examples. find a specific element with s...
...s: notice how the "div span" selector still successfully matches the <span> element, even though the baseelement's child nodes do not include the div element (it is still part of the specified selector). more examples see document.queryselector() for additional examples of the proper format for the selectors. specifications specification status comment domthe def
inition of 'queryselector()' in that specification. living standard selectors api level 2the def
inition of 'queryselectorall()' in that specification. obsolete selectors api level 1the def
inition of 'queryselectorall()' in that specification. obsolete ...
Element.setCapture() - Web APIs
xample in this example, the current mouse coordinates are drawn while you mouse around after clicking and holding down on an element. ...
... specification based on internet explorer's implementation. ...
Element.shadowRoot - Web APIs
ect instance, or null if the associated shadow root was attached with its mode set to closed. (see element.attachshadow() for further details). examples the following snippets are taken from our life-cycle-callbacks example (see it live also), which creates an element that displays a square of a size and color specified in the element's attributes. inside the <custom-square> element's class def
inition we include some life cycle callbacks that make a call to an external function, updatestyle(), which actually applies the size and color to the element. you'll see that we are passing it this (the custom element itself) as a parameter. connectedcallback() { console.log('custom square element added to page.'); updatestyle(this); } attributechangedcallback(name, oldvalue, newvalue) { cons...
... living standard ...
Encrypted Media Extensions API - Web APIs
cdm). ...
...akeystatusmap is a read-only map of media key statuses by key ids. mediakeysystemaccess provides access to a key system for decryption and/or a content protection provider. mediakeysystemconfiguration provides configuration information about the media key system. specifications specification status comment encrypted media extensions recommendation
initial def
inition ...
Event.cancelable - Web APIs
led, so we do so. event.preventdefault(); } else { // the event cannot be canceled, so it is not safe // to call preventdefault() on it. console.warn(`the following event couldn't be canceled:`); console.dir(event); } } document.addeventlistener('wheel', preventscrollwheel); notes whether an event can be canceled or not is something that's determined when that event is
initialized. to cancel an event, call the preventdefault() method on the event. this keeps the implementation from executing the default action that is associated with the event. specifications specification status comment domthe def
inition of 'event.cancelable' in that specification. living standard document object model (dom) level 2 events specificatio...
... to cancel an event, call the preventdefault() method on the event. this keeps the implementation from executing the default action that is associated with the event. specifications specification status comment domthe def
inition of 'event.cancelable' in that specification. living standard document object model (dom) level 2 events specificationthe def
inition of 'event.cancelable' in that specification. obsolete
initial def
inition. ...
Event.composed - Web APIs
osed-composed-path example (see it live), we define two trivial custom elements, <open-shadow> and <closed-shadow>, both of which take the contents of their text attribute and insert them into the element's shadow dom as the text content of a <p> element. the only difference between the two is that their shadow roots are attached with their modes set to open and closed respectively. ...
... living standard ...
Event.composedPath() - Web APIs
osed-composed-path example (see it live), we define two trivial custom elements, <open-shadow> and <closed-shadow>, both of which take the contents of their text attribute and insert them into the element's shadow dom as the text content of a <p> element. the only difference between the two is that their shadow roots are attached with their modes set to open and closed respectively. ...
... living standard ...
EventSource.close() - Web APIs
none. return value void. ...
...selector('button'); var evtsource = new eventsource('sse.php'); button.onclick = function() { console.log('connection closed'); evtsource.close(); } note: you can find a full example on github — see simple sse demo using php. specifications specification status comment html living standardthe def
inition of 'close()' in that specification. living standard
initial def
inition ...
EventSource.readyState - Web APIs
te; value a number representing the state of the connection. ...
...le values are: 0 — connecting 1 — open 2 — closed examples var evtsource = new eventsource('sse.php'); console.log(evtsource.readystate); note: you can find a full example on github — see simple sse demo using php. specifications specification status comment html living standardthe def
inition of 'readystate' in that specification. living standard
initial def
inition ...
EventTarget - Web APIs
return; } } }; eventtarget.prototype.dispatchevent = function(event) { if (!(event.type in this.listeners)) { return true; } var stack = this.listeners[event.type].slice(); for (var i = 0, l = stack.length; i < l; i++) { stack[i].call(this, event); } return !event.defaultprevented; }; specifications specification status comment domthe def
inition of 'eventtarget' in that specification. living standard no change. document object model (dom) level 3 events specificationthe def
inition of 'eventtarget' in that specification. obsolete a few parameters are now optional (listener), or accepts the null value (usecapture). document object model (dom) level 2 events specificationthe def
inition of 'eventtarget' in th...
...ification. living standard no change. document object model (dom) level 3 events specificationthe def
inition of 'eventtarget' in that specification. obsolete a few parameters are now optional (listener), or accepts the null value (usecapture). document object model (dom) level 2 events specificationthe def
inition of 'eventtarget' in that specification. obsolete
initial def
inition. ...
ExtendableEvent.waitUntil() - Web APIs
all of the core caches it depends on are successfully populated. the activate events in service workers use waituntil() to buffer functional events such as fetch and push until the promise passed to waituntil() settles. this gives the service worker time to update database schemas and delete outdated caches, so other events can rely on a completely upgraded state. the waituntil() method must be
initially called within the event callback, but after that it can be called multiple times, until all the promises passed to it settle. note: the behaviour described in the above paragraph was fixed in firefox 43 (see bug 1180274). syntax extendableevent.waituntil(promise); parameters a promise. return value undefined. example using waituntil() within a service worker's install event: adde...
...ng waituntil() within a service worker's install event: addeventlistener('install', event => { const precache = async () => { const cache = await caches.open('static-v1'); return cache.addall([ '/', '/about/', '/static/styles.css' ]); }; event.waituntil(precache()); }); specifications specification status comment service workersthe def
inition of 'waituntil()' in that specification. working draft
initial def
inition ...
ExtendableMessageEvent() - Web APIs
the extendablemessageevent() constructor creates a new extendablemessageevent object instance. syntax var extendablemessageevent = new extendablemessageevent(type,
init); parameters type a domstring that defines the type of the message event being created.
init optional an
initialisation object, which should contain the following parameters: data: the event's data — this can be any data type. origin: a domstring that defines the origin of the corresponding service worker's environment settings object. lasteventid: a domstring that defines the last event id of the event source. ...
...any data type. origin: a domstring that defines the origin of the corresponding service worker's environment settings object. lasteventid: a domstring that defines the last event id of the event source. source: the client, serviceworker or messageport that sent the message. ports: an array containing the messageport objects connected to the channel sending the message. examples var
init = { data : 'hello message', source : messageportreference, ports : messageportlistreference } var myeme = new extendablemessageevent('message',
init); specifications specification status comment service workersthe def
inition of 'extendablemessageevent()' in that specification. working draft
initial def
inition. ...
FederatedCredential - Web APIs
api provides information about credentials from a federated identity provider. a federated identity provider is an entity that a website trusts to correctly authenticate a user, and that provides an api for that purpose. openid connect is an example of a federated identity provider framework. in browsers that support it, an instance of this interface may be passed in the credential member of the
init object for global fetch. constructor federatedcredential() creates a new federatedcredential object. properties inherits properties from its ancestor, credential. federatedcredential.provider read only returns a usvstring containing a credential's federated identity provider. federatedcredential.protocol read only returns a domstring containing a credential's federated identity pr...
...tocol. event handlers none. methods none. examples var cred = new federatedcredential({ id: id, name: name, provider: 'https://account.google.com', iconurl: iconurl }); // store it navigator.credentials.store(cred) .then(function() { // do something else. }); specifications specification status comment credential management level 1 working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung inte...
FetchEvent.respondWith() - Web APIs
for security reasons, there are a few global rules: you can only return response objects of type "opaque" if the fetchevent.request object's mode is "no-cors". this prevents the leaking of private data. ...
...achedresponse; // if we didn't find a match in the cache, use the network. return fetch(event.request); }()); }); note: caches.match() is a convenience method. equivalent functionality is to call cache.match() on each cache (in the order returned by caches.keys()) until a response is returned. specifications specification status comment service workersthe def
inition of 'respondwith()' in that specification. working draft
initial def
inition. ...
FetchEvent.resultingClientId - Web APIs
...
..., resultingclientid will be an empty string. syntax var myresultingclientid = fetchevent.resultingclientid; value a domstring. example self.addeventlistener('fetch', function(event) { console.log(event.resultingclientid); }); specifications specification status comment service workersthe def
inition of 'resultingclientid' in that specification. working draft
initial def
inition. ...
File.lastModified - Web APIs
...
...853500 // 1519129858900 // 1519129864400 // ... in firefox, you can also enabled privacy.resistfingerprinting, the precision will be 100ms or the value of privacy.resistfingerprinting.reducetimerprecision.microseconds, whichever is larger. specifications specification status comment file apithe def
inition of 'lastmodified' in that specification. working draft
initial def
inition. ...
File.webkitRelativePath - Web APIs
this api has no official w3c or whatwg specification. 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. desktopmobilechromeedgefire...
...t files = event.target.files; for (let i=0; i<files.length; i++) { let item = document.createelement("li"); item.innerhtml = files[i].webkitrelativepath; output.appendchild(item); }; }, false); result specifications specification status comment file and directory entries apithe def
inition of 'webkitrelativepath' in that specification. draft
initial specification. this api has no official w3c or whatwg specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfir...
FileList - Web APIs
living standard 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 requ...
... var file = files[i]; alert(file.name); i++; } } // set the input element onchange to call pullfiles document.queryselector("#myfiles").onchange=pullfiles; //a.t </script> </html> specifications specification status comment file apithe def
inition of 'filelist' in that specification. working draft html living standardthe def
inition of 'selected files' in that specification. living standard 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefo...
FileSystemFileEntry - Web APIs
nting its contents by calling file(). example the following code creates an empty file called "log.txt" (if it doesn't exist) and fills it with the text "meow". inside the success callback, event handlers are set up to handle the error error and writeend events. the text data is written to the file by creating a blob, appending text to it, and passing the blob to filewriter.write(). function on
initfs(fs) { fs.root.getfile('log.txt', {create: true}, function(fileentry) { // create a filewriter object for our filesystemfileentry (log.txt). fileentry.createwriter(function(filewriter) { filewriter.onwriteend = function(e) { console.log('write completed.'); }; filewriter.onerror = function(e) { console.log('write failed: ' + e.tostring()); }; ...
...write completed.'); }; filewriter.onerror = function(e) { console.log('write failed: ' + e.tostring()); }; // create a new blob and write it to log.txt. var bb = new blobbuilder(); bb.append('meow'); filewriter.write(bb.getblob('text/plain')); }, errorhandler); }, errorhandler); } window.requestfilesystem(window.temporary, 1024*1024, on
initfs, errorhandler); specifications specification status comment file and directory entries apithe def
inition of 'filesystemfileentry' in that specification. draft draft of proposed api 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/m...
Introduction to the File and Directory Entries API - Web APIs
leap for web apps, which can now cache and process large amounts of data. about this document this introduction discusses essential concepts and terminology in the file and directory entries api. it gives you the big picture and orients you to key concepts. it also describes restrictions that raise security errors if you ignore them. to learn more about terminology used in this api, see the def
initions section. for the reference documentation on the file and directory entries api, see the reference landing page and its subpages. the specification is still being defined and is subject to change. overview the file and directory entries api includes both asynchronous and synchronous versions of the interfaces. the asynchronous api can be used in cases where you don't want an outstanding o...
...pp from file:// you cannot run your app locally from file://. if you do so, the browser throws errors or your app fails silently. this restriction also applies to many of the file apis, including blobbuilder and filereader. for testing purposes, you can bypass the restriction on chrome by starting the browser with the --allow-file-access-from-files flag. use this flag only for this purpose. def
initions this section defines and explains terms used in the file and directory entries api. blob stands for binary large object. a blob is a set of binary data that is stored as a single object. it is a general-purpose way to reference binary data in web applications. a blob can be an image or an audio file. blob blob—with a capital b—is a data structure that is immutable, which means that...
FontFace.display - Web APIs
be swaped for the downloaded font. failure period if the font face still is not loaded, the fallback font will be shown and no swap will occur. syntax var display = fontface.display fontface.display = display value a cssomstring with one of the following values. 'auto': use the font display strategy provided by the user agent. 'block': gives the font face a short block period and an inf
inite swap period. the spec recommends 3 seconds for the block period, though this may vary from browser to browser. 'fallback': gives the font face a short block period and a short swap period. the spec recommends 100 ms or less for the block period and 3 seconds for the swap period, though these values may vary from browser to browser. 'optional': gives the font face a short block period and no sw...
...ock period and a short swap period. the spec recommends 100 ms or less for the block period and 3 seconds for the swap period, though these values may vary from browser to browser. 'optional': gives the font face a short block period and no swap period. the spec recommends 100 ms or less, though this may vary from browser to browser. 'swap': gives the font face a 0 second block period and an inf
inite swap period. specifications specification status comment css font loading module level 3the def
inition of 'display' in that specification. working draft
initial def
inition. css fonts module level 4the def
inition of 'font-display' in that specification. working draft defines the values for the display property. (they are the same as for font-display...
FormData.append() - Web APIs
ause the resultant data structure is more conducive to looping. ...
... the sent value is different than string or blob it will be automatically converted to string: formdata.append('name', true); formdata.append('name', 74); formdata.append('name', 'john'); formdata.getall('name'); // ["true", "74", "john"] specifications specification status comment xmlhttprequestthe def
inition of 'append()' in that specification. living standard
initial def
inition ...
FormData.entries() - Web APIs
terator. ...
...ormdata.append('key1', 'value1'); formdata.append('key2', 'value2'); // display the key/value pairs for(var pair of formdata.entries()) { console.log(pair[0]+ ', '+ pair[1]); } the result is: key1, value1 key2, value2 specifications specification status comment xmlhttprequestthe def
inition of 'entries() (as iterator<>)' in that specification. living standard
initial def
inition ...
FormData.keys() - Web APIs
tax formdata.keys(); return value returns an iterator. ...
...est formdata object var formdata = new formdata(); formdata.append('key1', 'value1'); formdata.append('key2', 'value2'); // display the keys for (var key of formdata.keys()) { console.log(key); } the result is: key1 key2 specifications specification status comment xmlhttprequestthe def
inition of 'keys() (as iterator<>)' in that specification. living standard
initial def
inition ...
FormData.values() - Web APIs
values(); return value returns an iterator. ...
...bject var formdata = new formdata(); formdata.append('key1', 'value1'); formdata.append('key2', 'value2'); // display the values for (var value of formdata.values()) { console.log(value); } the result is: value1 value2 specifications specification status comment xmlhttprequestthe def
inition of 'values() (as iterator<>)' in that specification. living standard
initial def
inition ...
Gamepad.id - Web APIs
ell as display useful feedback to the user. ...
...tribute domstring id; example window.addeventlistener("gamepadconnected", function() { var gp = navigator.getgamepads()[0]; gamepadinfo.innerhtml = "gamepad connected at index " + gp.index + ": " + gp.id + "."; }); value a string. specifications specification status comment gamepadthe def
inition of 'gamepad.id' in that specification. working draft
initial def
inition ...
Gamepad.index - Web APIs
reconnected will retain the same index. ...
...e long index; example window.addeventlistener("gamepadconnected", function() { var gp = navigator.getgamepads()[0]; gamepadinfo.innerhtml = "gamepad connected at index " + gp.index + ": " + gp.id + "."; }); value a number. specifications specification status comment gamepadthe def
inition of 'gamepad.index' in that specification. working draft
initial def
inition ...
GamepadHapticActuator.type - Web APIs
nterface returns an enum representing the type of the haptic hardware. ...
... myactuatortype = gamepadhapticactuatorinstance.type; value an enum of type gamepadhapticactuatortype; currently available types are: vibration — vibration hardware, which creates a rumbling effect. examples tbc specifications specification status comment gamepad extensionsthe def
inition of 'gamepadhapticactuatortype' in that specification. editor's draft
initial def
inition ...
Geolocation.getCurrentPosition() - Web APIs
etcurrentposition(success[, error[, [options]]) parameters success a callback function that takes a geolocationposition object as its sole input parameter. error optional an optional callback function that takes a geolocationpositionerror object as its sole input parameter. options optional an optional positionoptions object. options includes: maximumage: integer (milliseconds) | inf
inity - maximum cached position age. timeout: integer (milliseconds) - amount of time before the error callback is invoked, if 0 it will never invoke. enablehighaccuracy: false | true examples var options = { enablehighaccuracy: true, timeout: 5000, maximumage: 0 }; function success(pos) { var crd = pos.coords; console.log('your current position is:'); console.log(`latitude : ...
... ...
GeolocationCoordinates.accuracy - Web APIs
coordinates.longitude properties expressed in meters. ...
...cationcoordinatesinstance.accuracy value a positive double representing the accuracy, with a 95% confidence level, of the geolocationcoordinates.latitude and geolocationcoordinates.longitude properties expressed in meters. specifications specification status comment geolocation apithe def
inition of 'coordinates.accuracy' in that specification. recommendation
initial def
inition ...
GeolocationCoordinates.latitude - Web APIs
...
...y is a double representing the latitude of the position in decimal degrees. syntax let lat = geolocationcoordinatesinstance.latitude value a double representing the latitude of the position in decimal degrees. specifications specification status comment geolocation apithe def
inition of 'geolocationcoordinates.latitude' in that specification. recommendation
initial specification. ...
GeolocationPosition.coords - Web APIs
...
...object concerned, regrouped inside the returned value. it also contains accuracy information about these values. syntax let coord = geolocationpositioninstance.coords value a geolocationcoordinates object instance. specifications specification status comment geolocation apithe def
inition of 'geolocationposition.coords' in that specification. recommendation
initial specification. ...
Using the Geolocation API - Web APIs
vailable through the navigator.geolocation object. if the object exists, geolocation services are available. you can test for the presence of geolocation thusly: if('geolocation' in navigator) { /* geolocation is available */ } else { /* geolocation is not available */ } getting the current position to obtain the user's current location, you can call the getcurrentposition() method. this
initiates an asynchronous request to detect the user's position, and queries the positioning hardware to get up-to-date information. when the position is determined, the defined callback function is executed. you can optionally provide a second callback function to be executed if an error occurs. a third, optional, parameter is an options object where you can set the maximum age of the position return...
...put parameters as getcurrentposition(). the callback function is called multiple times, allowing the browser to either update your location as you move, or provide a more accurate location as different techniques are used to geolocate you. the error callback function, which is optional just as it is for getcurrentposition(), can be called repeatedly. note: you can use watchposition() without an
initial getcurrentposition() call. const watchid = navigator.geolocation.watchposition((position) => { dosomething(position.coords.latitude, position.coords.longitude); }); the watchposition() method returns an id number that can be used to uniquely identify the requested position watcher; you use this value in tandem with the clearwatch() method to stop watching the user's location. navigator.g...
GlobalEventHandlers.onerror - Web APIs
javascript runtime error (including syntax errors and exceptions thrown within handlers) occurs, an error event using interface errorevent is fired at window and window.onerror() is invoked (as well as handlers attached by window.addeventlistener (not only capturing)). when a resource (such as an <img> or <script>) fails to load, an error event using interface event is fired at the element that
initiated the load, and the onerror() handler on the element is invoked. these error events do not bubble up to window, but (at least in firefox) can be handled with a window.addeventlistener configured with usecapture set to true. installing a global error event handler is useful for automated collection of error reports. syntax for historical reasons, different arguments are passed to window.one...
... living standard ...
HTMLAnchorElement.rel - Web APIs
ween the resource represented by the <a> element and the current document. ...
...ength = anchors.length; for (var i = 0; i < length; i++) { alert("rel: " + anchors[i].rel); } specifications specification status comment html living standardthe def
inition of 'rel' in that specification. living standard no change from document object model (dom) level 2 html specification document object model (dom) level 2 html specificationthe def
inition of 'rel' in that specification. obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe def
inition of 'rel' in that specification. obsolete
initial def
inition. ...
HTMLBaseElement - Web APIs
tive urls in the document. htmlbaseelement.target is a domstring that reflects the target html attribute, containing a default target browsing context or frame for elements that do not have a target reference specified. methods no specific method; inherits attributes from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmlbaseelement' in that specification. living standard html 5.1the def
inition of 'htmlbaseelement' in that specification. recommendation no change from html5 html5the def
inition of 'htmlbaseelement' in that specification. recommendation no change from document object model (dom) level 2 html specification. document object model (dom) level 2 ...
...in that specification. living standard html 5.1the def
inition of 'htmlbaseelement' in that specification. recommendation no change from html5 html5the def
inition of 'htmlbaseelement' in that specification. recommendation no change from document object model (dom) level 2 html specification. document object model (dom) level 2 html specificationthe def
inition of 'htmlbaseelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmlbaseelement' in that specification. obsolete
initial def
inition. ...
HTMLCanvasElement.getContext() - Web APIs
t="300"></canvas> you can get a 2d context of the canvas with the following code: var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); console.log(ctx); // canvasrenderingcontext2d { ... } now you have the 2d rendering context for a canvas and you can draw within it. ...
...ontext('2d'); console.log(ctx); // canvasrenderingcontext2d { ... } now you have the 2d rendering context for a canvas and you can draw within it. specifications specification status comment html living standardthe def
inition of 'htmlcanvaselement.getcontext' in that specification. living standard no change since the latest snapshot, html5 html 5.1the def
inition of 'htmlcanvaselement.getcontext' in that specification. recommendation html5the def
inition of 'htmlcanvaselement.getcontext' in that specification. recommendation snapshot of the html living standard containing the
initial def
inition. ...
HTMLCanvasElement.height - Web APIs
. ...
...as> you can get the height of the canvas with the following code: var canvas = document.getelementbyid('canvas'); console.log(canvas.height); // 300 specifications specification status comment html living standardthe def
inition of 'htmlcanvaselement.height' in that specification. living standard no change since the latest snapshot, html5 html 5.1the def
inition of 'htmlcanvaselement.height' in that specification. recommendation html5the def
inition of 'htmlcanvaselement.height' in that specification. recommendation snapshot of the html living standard containing the
initial def
inition. ...
HTMLCanvasElement.toBlob() - Web APIs
console.log('successfully wrote file'); }, function() { console.log('failure writing file') } ); }; r.readasarraybuffer(b); } } canvas.toblob(blobcallback('passthisstring'), 'image/vnd.microsoft.icon', '-moz-parse-options:format=bmp;bpp=32'); specifications specification status comment html living standardthe def
inition of 'htmlcanvaselement.toblob' in that specification. living standard no change since the latest snapshot, html5 html 5.1the def
inition of 'htmlcanvaselement.toblob' in that specification. recommendation no change html5the def
inition of 'htmlcanvaselement.toblob' in that specification. recommendation snapshot of the html living standard containing the
initial...
...of 'htmlcanvaselement.toblob' in that specification. living standard no change since the latest snapshot, html5 html 5.1the def
inition of 'htmlcanvaselement.toblob' in that specification. recommendation no change html5the def
inition of 'htmlcanvaselement.toblob' in that specification. recommendation snapshot of the html living standard containing the
initial def
inition. ...
HTMLCanvasElement.toDataURL() - Web APIs
0, 0); ograyimg = new image(); ograyimg.src = ocanvas.todataurl(); ograyimg.onmouseover = showcolorimg; ocolorimg.onmouseout = showgrayimg; octx.clearrect(0, 0, nwidth, nheight); ocolorimg.style.display = "none"; ocolorimg.parentnode.insertbefore(ograyimg, ocolorimg); } } specifications specification status comment html living standardthe def
inition of 'htmlcanvaselement.todataurl' in that specification. living standard no change since the latest snapshot, html5 html 5.1the def
inition of 'htmlcanvaselement.todataurl' in that specification. recommendation html5the def
inition of 'htmlcanvaselement.todataurl' in that specification. recommendation snapshot of the html living standard containing the
initial...
...of 'htmlcanvaselement.todataurl' in that specification. living standard no change since the latest snapshot, html5 html 5.1the def
inition of 'htmlcanvaselement.todataurl' in that specification. recommendation html5the def
inition of 'htmlcanvaselement.todataurl' in that specification. recommendation snapshot of the html living standard containing the
initial def
inition. ...
HTMLCanvasElement.width - Web APIs
nvas. ...
...anvas> you can get the width of the canvas with the following code: var canvas = document.getelementbyid('canvas'); console.log(canvas.width); // 300 specifications specification status comment html living standardthe def
inition of 'htmlcanvaselement.width' in that specification. living standard no change since the latest snapshot, html5 html 5.1the def
inition of 'htmlcanvaselement.width' in that specification. recommendation html5the def
inition of 'htmlcanvaselement.width' in that specification. recommendation snapshot of the html living standard containing the
initial def
inition. ...
HTMLCanvasElement - Web APIs
flecting the moz-opaque html attribute of the <canvas> element. it lets the canvas know whether or not translucency will be a factor. if the canvas knows there's no translucency, painting performance can be optimized. this is only supported in mozilla-based browsers; use the standardized canvas.getcontext('2d', { alpha: false }) instead. htmlcanvaselement.mozprintcallback is a function that is
initially null. web content can set this to a javascript function that will be called when the canvas is to be redrawn while the page is being printed. when called, the callback is passed a "printstate" object that implements the mozcanvasprintstate interface. the callback can get the context to draw to from the printstate object and must then call done() on it when finished. the purpose of mozprintca...
.... webglcontextlost fired if the user agent detects that the drawing buffer associated with a webglrenderingcontext or webgl2renderingcontext object has been lost. webglcontextrestored fired if the user agent restores the drawing buffer for a webglrenderingcontext or webgl2renderingcontext object. specifications specification status comment html living standardthe def
inition of 'htmlcanvaselement' in that specification. living standard primary def
inition of htmlcanvaselement. media capture from dom elementsthe def
inition of 'htmlcanvaselement' in that specification. working draft adds the method capturestream(). ...
HTMLDivElement - Web APIs
divelement.align is a domstring representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. the possible values are "left", "right", "justify", and "center". methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmldivelement' in that specification. living standard html5the def
inition of 'htmldivelement' in that specification. recommendation no change from document object model (dom) level 2 html specification. document object model (dom) level 2 html specificationthe def
inition of 'htmldivelement' in that specification. obsolete no change from document objec...
... 'htmldivelement' in that specification. recommendation no change from document object model (dom) level 2 html specification. document object model (dom) level 2 html specificationthe def
inition of 'htmldivelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmldivelement' in that specification. obsolete
initial def
inition. ...
accessKeyLabel - Web APIs
...
...on () { var p = document.createelement('p'); p.textcontent = 'clicked!'; node.parentnode.appendchild(p); }; html <button accesskey="h" title="caption" id="btn1">hover me</button> result specifications specification status comment html living standardthe def
inition of 'htmlelement.accesskeylabel' in that specification. living standard no change from
initial def
inition. html 5.1 recommendation removed. pull w3c/html#144, issue w3c/html#99, wicg discussion. html5the def
inition of 'htmlelement.accesskeylabel' in that specification. recommendation snapshot of html living standard,
initial def
inition. ...
HTMLElement.dir - Web APIs
for left-to-right, rtl, for right-to-left, and auto for specifying that the direction of the element must be determined based on the contents of the element. ...
...("para1"); parg.dir = "rtl"; // change the text direction on a paragraph identified as "para1" specifications specification status comment html living standardthe def
inition of 'dir' in that specification. living standard no change from document object model (dom) level 2 html specification. document object model (dom) level 2 html specificationthe def
inition of 'dir' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'dir' in that specification. obsolete
initial def
inition. ...
HTMLElement.isContentEditable - Web APIs
recommendation snapsho...
...yid('mytext1').iscontenteditable; document.getelementbyid('infotext2').innerhtml += document.getelementbyid('mytext2').iscontenteditable; result specifications specification status comment html living standardthe def
inition of 'htmlelement.contenteditable' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the def
inition of 'htmlelement.contenteditable' in that specification. recommendation snapshot of html living standard, no change from html5 html5the def
inition of 'htmlelement.contenteditable' in that specification. recommendation snapshot of html living standard,
initial def
inition. ...
HTMLElement.title - Web APIs
sually displayed in a 'tooltip' popup when the mouse is over the node. ...
... link.href = 'https://en.wikipedia.org/wiki/grape'; link.title = 'wikipedia page on grapes'; specifications specification status comment html living standardthe def
inition of 'title' in that specification. living standard no change from document object model (dom) level 2 html specification. document object model (dom) level 2 html specificationthe def
inition of 'title' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'title' in that specification. obsolete
initial def
inition. ...
HTMLFormElement.reportValidity() - Web APIs
ble invalid events are fired for each invalid child and validation problems are reported to the user. ...
...ormelement.reportvalidity() return value boolean example document.forms['myform'].addeventlistener('submit', function() { document.forms['myform'].reportvalidity(); }, false); specifications specification status comment html living standardthe def
inition of 'htmlformelement.reportvalidity()' in that specification. living standard html 5.1the def
inition of 'htmlformelement.reportvalidity()' in that specification. recommendation
initial def
inition ...
HTMLFormElement - Web APIs
false. reportvalidity() returns true if the element's child controls satisfy their validation constraints. when false is returned, cancelable invalid events are fired for each invalid child and validation problems are reported to the user. requestsubmit() requests that the form be submitted using the specified submit button and its corresponding configuration. reset() resets the form to its
initial state. submit() submits the form to the server. deprecated methods htmlformelement.requestautocomplete() triggers a native browser interface to assist the user in completing the fields which have an autofill field name value that is not off or on. the form will receive an event once the user has finished with the interface, the event will either be autocomplete when the fields have b...
... name="vehicle" value="car">i have a car</label></p> </fieldset> <p><button>submit</button></p> </form> </body> </html> submitting forms and uploading files using xmlhttprequest if you want to know how to serialize and submit a form using the xmlhttprequest api, please read this paragraph. specifications specification status comment html living standardthe def
inition of 'htmlformelement' in that specification. living standard the following method has been added: requestautocomplete(). html5the def
inition of 'htmlformelement' in that specification. recommendation the elements properties returns an htmlformcontrolscollection instead of a raw htmlcollection. this is mainly a technical change. the following method has been added: checkvali...
HTMLFrameSetElement - Web APIs
esenting the code to be called when the resize event is raised. windoweventhandlers.onstorage is an eventhandler representing the code to be called when the storage event is raised. windoweventhandlers.onunload is an eventhandler representing the code to be called when the unload event is raised. specifications specification status comment html living standardthe def
inition of 'htmlframesetelement' in that specification. living standard from the html5 snapshot, the windoweventhandlers interface now have a onlanguagechange property. html5the def
inition of 'htmlframesetelement' in that specification. recommendation snapshot of a previous html living standard frames are now obsolete. implements windoweventhandlers. document object m...
...cation. living standard from the html5 snapshot, the windoweventhandlers interface now have a onlanguagechange property. html5the def
inition of 'htmlframesetelement' in that specification. recommendation snapshot of a previous html living standard frames are now obsolete. implements windoweventhandlers. document object model (dom) level 2 html specificationthe def
inition of 'htmlbodyelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmlbodyelement' in that specification. obsolete
initial def
inition. ...
HTMLHRElement - Web APIs
shade is a boolean that sets the rule to have no shading. htmlhrelement.size is a domstring representing the height of the rule. htmlhrelement.width is a domstring representing the width of the rule on the page. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmlhrelement' in that specification. living standard the color property has been added, as an obsolete property, to increase compatibility with the existing web. html5the def
inition of 'htmlhrelement' in that specification. recommendation following properties are now obsolete: align, noshade, size, and width. document object model (dom) level 2 html specifica...
...lhrelement' in that specification. living standard the color property has been added, as an obsolete property, to increase compatibility with the existing web. html5the def
inition of 'htmlhrelement' in that specification. recommendation following properties are now obsolete: align, noshade, size, and width. document object model (dom) level 2 html specificationthe def
inition of 'htmlhrelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmlhrelement' in that specification. obsolete
initial def
inition. ...
HTMLHyperlinkElementUtils.hash - Web APIs
ty contains an empty string, "". ...
...xamples <a id="myanchor" href="/docs/htmlhyperlinkelementutils.href#examples">examples</a> <script> var anchor = document.getelementbyid("myanchor"); console.log(anchor.hash); // returns '#examples' </script> specifications specification status comment html living standardthe def
inition of 'htmlhyperlinkelementutils.hash' in that specification. living standard
initial def
inition ...
HTMLIFrameElement - Web APIs
s, and safari/ios. htmliframeelement.srcdoc is a domstring that represents the content to display in the frame. htmliframeelement.width is a domstring that reflects the width html attribute, indicating the width of the frame. methods inherits properties from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmliframeelement' in that specification. living standard the following property has been added: allowfullscreen. html5the def
inition of 'htmliframeelement' in that specification. recommendation the following properties are now obsolete: scrolling, marginwidth, marginheight, longdesc, frameborder, and align. the following properties have been added: srcdoc, sandbox...
...rty has been added: allowfullscreen. html5the def
inition of 'htmliframeelement' in that specification. recommendation the following properties are now obsolete: scrolling, marginwidth, marginheight, longdesc, frameborder, and align. the following properties have been added: srcdoc, sandbox, and contentwindow. document object model (dom) level 2 html specificationthe def
inition of 'htmliframeelement' in that specification. obsolete the contentdocument property has been added. document object model (dom) level 1 specificationthe def
inition of 'htmliframeelement' in that specification. obsolete
initial def
inition. ...
HTMLImageElement.border - Web APIs
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-da...
..."border: 2px;"> you can further provide additional information to change the color and other features of the border: <img src="image.png" style="border: dashed 2px #333388;"> specifications specification status comment html living standardthe def
inition of 'htmlimageelement.border' in that specification. living standard html 4.01 specificationthe def
inition of 'htmlimageelement.border' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androi...
HTMLInputElement: search event - Web APIs
current ua implementations of <input type="search"> have an additional control to clear the field. using this control also fires the search event. in that case the value of the <input> element will be the empty string. ...
... current ua implementations of <input type="search"> have an additional control to clear the field. using this control also fires the search event. in that case the value of the <input> element will be the empty string. ...
HTMLInputElement.webkitdirectory - Web APIs
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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefox...
... let files = event.target.files; for (let i=0; i<files.length; i++) { let item = document.createelement("li"); item.innerhtml = files[i].webkitrelativepath; output.appendchild(item); }; }, false); result specifications specification status comment file and directory entries apithe def
inition of 'webkitdirectory' in that specification. draft
initial specification. 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfir...
HTMLInputElement - Web APIs
on the htmlelement interface and also applies to contenteditable elements, but we've listed it here because it is most commonly used with form input elements. also available via the oninput event handler property. invalid fired when an element does not satisfy its constraints during constraint validation. also available via the oninvalid event handler property. search fired when a search is
initiated on an <input> of type="search". also available via the onsearch event handler property. specifications specification status comment html living standardthe def
inition of 'htmlinputelement' in that specification. living standard html5the def
inition of 'htmlinputelement' in that specification. recommendation technically, the tabindex and ac...
...abels, list, max, min, multiple, pattern, placeholder, required, selectiondirection, selectionend, selectionstart, step, validationmessage, validity, valueasdate, valueasnumber, width, and willvalidate. the following methods have been added: checkvalidity(), setcustomvalidity(), setselectionrange(), stepup(), and stepdown(). document object model (dom) level 2 html specificationthe def
inition of 'htmlinputelement' in that specification. obsolete the size property is now an unsigned long. the type property must be entirely given in lowercase characters. document object model (dom) level 1 specificationthe def
inition of 'htmlinputelement' in that specification. obsolete
initial def
inition. ...
HTMLIsIndexElement - Web APIs
read only is a htmlformelement representing the <form> element it belongs 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 def
inition of 'htmlisindexelement' in that specification. recommendation removed. <isindex> must now implement htmlunknownelement. document object model (dom) level 2 html specificationthe def
inition of 'htmlisindexelement' in that specification. obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe def...
...ion of 'htmlisindexelement' in that specification. recommendation removed. <isindex> must now implement htmlunknownelement. document object model (dom) level 2 html specificationthe def
inition of 'htmlisindexelement' in that specification. obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe def
inition of 'htmlisindexelement' in that specification. obsolete
initial def
inition. ...
HTMLLIElement - Web APIs
al position of the list element inside a given <ol>. it reflects the value attribute of the html <li> element, and can be smaller than 0. if the <li> element is not a child of an <ol> element, the property has no meaning. methods no specific method; inherits properties from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmllielement' in that specification. living standard html5the def
inition of 'htmllielement' in that specification. recommendation the following property is now obsolete: type. document object model (dom) level 2 html specificationthe def
inition of 'htmllielement' in that specification. obsolete no change from document object model (dom) level 1 specif...
... html5the def
inition of 'htmllielement' in that specification. recommendation the following property is now obsolete: type. document object model (dom) level 2 html specificationthe def
inition of 'htmllielement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmllielement' in that specification. obsolete
initial def
inition. ...
HTMLLabelElement.form - Web APIs
lement.control.form. ...
...lue an htmlformelement which represents the form with which the label's control is associated. if control is null (meaning the label isn't associated with a control), or if the control isn't part of a form, this property returns null. specifications specification status comment html living standardthe def
inition of 'form' in that specification. living standard
initial def
inition ...
HTMLLabelElement.htmlFor - Web APIs
rol element. ...
...belelement.htmlfor = newid value a domstring which contains the id string of the element which is associated with the control. if this property has a value, the htmllabelelement.control property must refer to the same control. specifications specification status comment html living standardthe def
inition of 'htmlfor' in that specification. living standard
initial def
inition ...
HTMLLabelElement - Web APIs
trol isn't associated with a form. in other words, this is just a shortcut for htmllabelelement.control.form. htmllabelelement.htmlfor is a string containing the id of the labeled control. this reflects the for attribute. methods no specific methods; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmllabelelement' in that specification. living standard html5the def
inition of 'htmllabelelement' in that specification. recommendation the property accesskey is now defined on htmlelement. the following property has been added: control. document object model (dom) level 2 html specificationthe def
inition of 'htmllabelelement' in that specification. ...
...on. recommendation the property accesskey is now defined on htmlelement. the following property has been added: control. document object model (dom) level 2 html specificationthe def
inition of 'htmllabelelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmllabelelement' in that specification. obsolete
initial def
inition. ...
HTMLLegendElement - Web APIs
s null. htmllegendelement.accesskey is a domstring representing a single-character access key to give access to the element. htmllegendelement.align is a domstring representing the alignment relative to the form set methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmllegendelement' in that specification. living standard html 5.1the def
inition of 'htmllegendelement' in that specification. recommendation html5the def
inition of 'htmllegendelement' in that specification. recommendation the property accesskey is now defined on htmlelement. the following property is now obsolete: align. document object m...
...tion. living standard html 5.1the def
inition of 'htmllegendelement' in that specification. recommendation html5the def
inition of 'htmllegendelement' in that specification. recommendation the property accesskey is now defined on htmlelement. the following property is now obsolete: align. document object model (dom) level 2 html specificationthe def
inition of 'htmllegendelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmllegendelement' in that specification. obsolete
initial def
inition. ...
HTMLLinkElement.rel - Web APIs
esheet, and the href attribute is set to the url of an external style sheet to format the page. ...
...ame('link'); var length = links.length; for (var i = 0; i < length; i++) { alert(links[i]); } specifications specification status comment html living standardthe def
inition of 'rel' in that specification. living standard no change from document object model (dom) level 2 html specification document object model (dom) level 2 html specificationthe def
inition of 'rel' in that specification. obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe def
inition of 'rel' in that specification. obsolete
initial def
inition. ...
HTMLLinkElement - Web APIs
me to which the resource applies. methods no specific method; inherits methods from its parent, htmlelement, and linkstyle. specifications specification status comment preload candidate recommendation defines <link rel="preload">, and the as property. note that currently firefox only supports preloading of cacheable resources. html living standardthe def
inition of 'htmllinkelement' in that specification. living standard adds the following properties: crossorigin, referrerpolicy, and as. html 5.1the def
inition of 'htmllinkelement' in that specification. recommendation html5the def
inition of 'htmllinkelement' in that specification. recommendation the following properties are now obsolete: charset, rev, and shape. ...
...as. html 5.1the def
inition of 'htmllinkelement' in that specification. recommendation html5the def
inition of 'htmllinkelement' in that specification. recommendation the following properties are now obsolete: charset, rev, and shape. the following properties have been added: rellist, and sizes. document object model (dom) level 2 html specificationthe def
inition of 'htmllinkelement' in that specification. obsolete added a second inheritence, the linkstyle interface. document object model (dom) level 1 specificationthe def
inition of 'htmllinkelement' in that specification. obsolete
initial def
inition. ...
HTMLMediaElement.readyState - Web APIs
tate property indicates the readiness state of the media. syntax var readystate = audioorvideo.readystate; value an unsigned short. possible values are: constant value description have_nothing 0 no information is available about the media resource. have_metadata 1 enough of the media resource has been retrieved that the metadata attributes are
initialized. seeking will no longer raise an exception. have_current_data 2 data is available for the current playback position, but not enough to actually play more than one frame. have_future_data 3 data for the current playback position as well as for at least a little bit of time into the future is available (in other words, at least two frames of video, for example).
...osition has been loaded. if it has, the audio will play. <audio id="example" preload="auto"> <source src="sound.ogg" type="audio/ogg" /> </audio> var obj = document.getelementbyid('example'); obj.addeventlistener('loadeddata', function() { if(obj.readystate >= 2) { obj.play(); } }); specifications specification status comment html living standardthe def
inition of 'htmlmediaelement.readystate' in that specification. living standard html5the def
inition of 'htmlmediaelement.readystate' in that specification. recommendation ...
HTMLMediaElement.seekable - Web APIs
recommendation specifies a new algorithm for returning the seekab...
...h the object and output an array for (let count = 0; count < timerangesobject.length; count ++) { timeranges.push([timerangesobject.start(count), timerangesobject.end(count)]); } specifications specification status comment html living standardthe def
inition of 'htmlmediaelement' in that specification. living standard no change from html5 html5the def
inition of 'htmlmediaelement' in that specification. recommendation
initial def
inition. media source extensionsthe def
inition of 'htmlmediaelement extensions, like for seekable' in that specification. recommendation specifies a new algorithm for returning the seekable time range of a media element whose source is a mediasource object. ...
HTMLMenuElement - Web APIs
recommendation snapshot of the html living ...
...ropertiesthis interface has no properties, but inherits properties from: htmlelementmethodsthis interface has no methods, but inherits methods from: htmlelement specifications specification status comment html living standardthe def
inition of 'htmlmenuelement' in that specification. living standard no change from latest snapshot, unknown html 5.2the def
inition of 'htmlmenuelement' in that specification. recommendation snapshot of the html living standard. removed the context type. html 5.1the def
inition of 'htmlmenuelement' in that specification. recommendation snapshot of the html living standard.
initial def
inition. ...
HTMLMetaElement - Web APIs
name domstring gets or sets the name of a meta-data property to define for a document. scheme domstring gets or sets the name of a scheme used to interpret the value of a meta-data property. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmlmetaelement' in that specification. living standard html5the def
inition of 'htmlmetaelement' in that specification. recommendation the following property is now obsolete: scheme. document object model (dom) level 2 html specificationthe def
inition of 'htmlmetaelement' in that specification. obsolete no change from document object model (dom) level ...
...tml5the def
inition of 'htmlmetaelement' in that specification. recommendation the following property is now obsolete: scheme. document object model (dom) level 2 html specificationthe def
inition of 'htmlmetaelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmlmetaelement' in that specification. obsolete
initial def
inition. ...
HTMLModElement - Web APIs
nt, htmlelement. htmlmodelement.cite is a domstring reflecting the cite html attribute, containing a uri of a resource explaining the change. htmlmodelement.datetime is a domstring reflecting the datetime html attribute, containing a date-and-time string representing a timestamp for the change. specifications specification status comment html living standardthe def
inition of 'htmlanchorelement' in that specification. living standard no change from html5. html5the def
inition of 'htmlanchorelement' in that specification. recommendation no change from document object model (dom) level 2 html specification. document object model (dom) level 2 html specificationthe def
inition of 'htmlmodelement' in that specification. obsolete no ...
...tmlanchorelement' in that specification. recommendation no change from document object model (dom) level 2 html specification. document object model (dom) level 2 html specificationthe def
inition of 'htmlmodelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmlmodelement' in that specification. obsolete
initial def
inition. ...
HTMLOListElement - Web APIs
ompact is a boolean indicating that spacing between list items should be reduced. this property reflects the compact attribute only, it doesn't consider the line-height css property used for that behavior in modern pages. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmlolistelement' in that specification. living standard html5the def
inition of 'htmlolistelement' in that specification. recommendation added the reversed property. document object model (dom) level 2 html specificationthe def
inition of 'htmlolistelement' in that specification. obsolete no change from document object model (dom) level 1 specification.
...d html5the def
inition of 'htmlolistelement' in that specification. recommendation added the reversed property. document object model (dom) level 2 html specificationthe def
inition of 'htmlolistelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmlolistelement' in that specification. obsolete
initial def
inition. ...
HTMLObjectElement - Web APIs
at always is true, because object objects are never candidates for constraint validation. htmlobjectelement.setcustomvalidity() sets a custom validity message for the element. if this message is not the empty string, then the element is suffering from a custom validity error, and does not validate. specifications specification status comment html living standardthe def
inition of 'htmlobjectelement' in that specification. living standard html5the def
inition of 'htmlobjectelement' in that specification. recommendation the w3c specification is a latest of a previous version of html living standard technically, the property tabindex is now defined on htmlelement. the following properties are now obsolete: align, archive, border, code, cod...
...owing properties are now obsolete: align, archive, border, code, codebase, codetype, declare, hspace, standby, and vspace. the following properties have been added: typemustmatch, contentwindow, willvalidate, validity, and validationmessage. the following methods have been added: checkvalidity() and setcustomvalidity(). document object model (dom) level 2 html specificationthe def
inition of 'htmlobjectelement' in that specification. obsolete the contentdocument property has been added. document object model (dom) level 1 specificationthe def
inition of 'htmlobjectelement' in that specification. obsolete
initial def
inition. ...
HTMLOptGroupElement - Web APIs
htmloptgroupelement.disabled is a boolean representing whether or not the whole list of children <option> is disabled (true) or not (false). htmloptgroupelement.label is a domstring representing the label for the group. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmloptgroupelement' in that specification. living standard html5the def
inition of 'htmloptgroupelement' in that specification. recommendation no change from document object model (dom) level 2 html specification. document object model (dom) level 2 html specificationthe def
inition of 'htmloptgroupelement' in that specification. obsolete no change from...
...roupelement' in that specification. recommendation no change from document object model (dom) level 2 html specification. document object model (dom) level 2 html specificationthe def
inition of 'htmloptgroupelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmloptgroupelement' in that specification. obsolete
initial def
inition. ...
HTMLElement.blur() - Web APIs
obsolete ...
...ck="blurinput()">click me to lose focus</button> javascript function focusinput() { document.getelementbyid('mytext').focus(); } function blurinput() { document.getelementbyid('mytext').blur(); } result specification specification status comment html living standardthe def
inition of 'blur' in that specification. living standard html 5.1the def
inition of 'blur' in that specification. recommendation html5the def
inition of 'blur' in that specification. recommendation document object model (dom) level 2 html specificationthe def
inition of 'blur' in that specification. obsolete ...
HTMLOrForeignElement.dataset - Web APIs
recommendation snapshot of html living standar...
....dateofbirth === undefined // 'somedataattr' in el.dataset === false el.dataset.somedataattr = 'mydata'; // result: 'somedataattr' in el.dataset === true specifications specification status comment html living standardthe def
inition of 'htmlelement.dataset' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the def
inition of 'htmlelement.dataset' in that specification. recommendation snapshot of html living standard, no change from html5 html5the def
inition of 'htmlelement.dataset' in that specification. recommendation snapshot of html living standard,
initial def
inition. ...
HTMLElement.focus() - Web APIs
obsolete document object model (dom) l...
...focus on the button without scrolling!</button> <div id="container" style="height: 1000px; width: 1000px;"> <button type="button" id="mybutton" style="margin-top: 500px;">click me!</button> </div> result specification specification status comment html living standardthe def
inition of 'focus' in that specification. living standard html 5.1the def
inition of 'focus' in that specification. recommendation html5the def
inition of 'focus' in that specification. recommendation document object model (dom) level 2 html specificationthe def
inition of 'focus' in that specification. obsolete document object model (dom) level 1 specificationthe def
inition of 'focus' in that specification. obsolete ...
HTMLOrForeignElement.tabIndex - Web APIs
quential, nor must they begin with any particular value. they may even be negative, though each browser trims very large values. ...
... is an integer example const b1 = document.getelementbyid('button1'); b1.tabindex = 1; specifications specification status comment html living standardthe def
inition of 'tabindex' in that specification. living standard no change from document object model (dom) level 2 html specification. document object model (dom) level 2 html specificationthe def
inition of 'tabindex' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'tabindex' in that specification. obsolete
initial def
inition. ...
HTMLParagraphElement - Web APIs
graphelement.align a domstring representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. the possible values are "left", "right", "justify", and "center". methods no specific methods, inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmlparagraphelement' in that specification. living standard html5the def
inition of 'htmlparagraphelement' in that specification. recommendation the following property is now obsolete: align. document object model (dom) level 2 html specificationthe def
inition of 'htmlparagraphelement' in that specification. obsolete no change from document object mode...
...ef
inition of 'htmlparagraphelement' in that specification. recommendation the following property is now obsolete: align. document object model (dom) level 2 html specificationthe def
inition of 'htmlparagraphelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmlparagraphelement' in that specification. obsolete
initial def
inition. ...
HTMLParamElement - Web APIs
has the "ref" value. it reflects the type attribute. htmlparamelement.valuetype is a domstring containing the type of the value. it reflects the valuetype attribute and has one of the values: "data", "ref", or "object". methods no specific methods, inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmlparamelement' in that specification. living standard html5the def
inition of 'htmlparamelement' in that specification. recommendation the following properties are now obsolete: type, and valuetype. document object model (dom) level 2 html specificationthe def
inition of 'htmlparamelement' in that specification. obsolete no change from document object...
... of 'htmlparamelement' in that specification. recommendation the following properties are now obsolete: type, and valuetype. document object model (dom) level 2 html specificationthe def
inition of 'htmlparamelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmlparamelement' in that specification. obsolete
initial def
inition. ...
HTMLPreElement - Web APIs
r-events: all;} properties inherits properties from its parent, htmlelement. htmlpreelement.width is a long value reflecting the obsolete width attribute, containing a fixed-size length for the <pre> element. methods no specific method; inherits properties from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmlpreelement' in that specification. living standard html5the def
inition of 'htmllielement' in that specification. recommendation the following property is now obsolete: width. document object model (dom) level 2 html specificationthe def
inition of 'htmlpreelement' in that specification. obsolete no change from document object model (dom) level 1 spe...
... html5the def
inition of 'htmllielement' in that specification. recommendation the following property is now obsolete: width. document object model (dom) level 2 html specificationthe def
inition of 'htmlpreelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmlpreelement' in that specification. obsolete
initial def
inition. ...
HTMLQuoteElement - Web APIs
5dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlquoteelement.cite is a domstring reflecting the cite html attribute, containing a url for the source of the quotation. methods no specific method; inherits properties from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmlquoteelement' in that specification. living standard html5the def
inition of 'htmlquoteelement' in that specification. recommendation no change from document object model (dom) level 2 html specification. document object model (dom) level 2 html specificationthe def
inition of 'htmlquoteelement' in that specification. obsolete no change from document...
...mlquoteelement' in that specification. recommendation no change from document object model (dom) level 2 html specification. document object model (dom) level 2 html specificationthe def
inition of 'htmlquoteelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmlquoteelement' in that specification. obsolete
initial def
inition. ...
HTMLScriptElement - Web APIs
derror; if (onloadfunction) { newscript.onload = onloadfunction; } document.head.appendchild(newscript); newscript.src = url; } sample usage: affixscripttohead("myscript1.js"); affixscripttohead("myscript2.js", function () { alert("the script \"myscript2.js\" has been correctly loaded."); }); specifications specification status comment html living standardthe def
inition of 'htmlscriptelement' in that specification. living standard html 5.1the def
inition of 'htmlscriptelement' in that specification. recommendation html5the def
inition of 'htmlscriptelement' in that specification. recommendation the following properties are now obsolete: htmlfor,. document object model (dom) level 2 html specificationthe def
inition ...
...ef
inition of 'htmlscriptelement' in that specification. recommendation the following properties are now obsolete: htmlfor,. document object model (dom) level 2 html specificationthe def
inition of 'htmlscriptelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmlscriptelement' in that specification. obsolete
initial def
inition. ...
HTMLSelectElement.item() - Web APIs
item is a htmloptionelement. ...
...id="o2">opt 2</option> </select> </form> javascript // returns the htmloptionelement representing #o2 elem1 = document.forms[0]['myformcontrol'][1]; specifications specification status comment html living standardthe def
inition of 'htmlselectelement.item()' in that specification. living standard no change since the latest snapshot, html5. html5the def
inition of 'htmlselectelement.item()' in that specification. recommendation
initial def
inition, snapshot of html living standard ...
HTMLSelectElement.namedItem() - Web APIs
eturn value item is a htmloptionelement. ...
...opt 2</option> </select> </form> javascript elem1 = document.forms[0]['myformcontrol']['o1']; // returns the htmloptionelement representing #o1 specifications specification status comment html living standardthe def
inition of 'htmlselectelement.nameditem()' in that specification. living standard no change since the latest snapshot, html5. html5the def
inition of 'htmlselectelement.nameditem()' in that specification. recommendation
initial def
inition, snapshot of html living standard ...
HTMLSpanElement - Web APIs
alignment-baseline="middle">htmlspanelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface has no properties, but inherits properties from: htmlelement. methods this interface has no methods, but inherits methods from: htmlelement. ...
...; pointer-events: all;} properties this interface has no properties, but inherits properties from: htmlelement. methods this interface has no methods, but inherits methods from: htmlelement. specifications specification status comment html living standardthe def
inition of 'htmlspanelement' in that specification. living standard html 5.2the def
inition of 'htmlspanelement' in that specification. recommendation html 5.1the def
inition of 'htmlspanelement' in that specification. recommendation html5the def
inition of 'htmlspanelement' in that specification. recommendation
initial def
inition, as <span> was associated with an htmlelement before that. ...
HTMLTableCellElement - Web APIs
p", "middle", "bottom", or "baseline". use the css vertical-align property instead. htmltablecellelement.width a domstring specifying the number of pixels wide the cell should be drawn, if possible. this property reflects the also obsolete width attribute. use the css width property instead. specifications specification status comment html living standardthe def
inition of 'htmltablecellelement' in that specification. living standard no change from html5. html5the def
inition of 'htmltablecellelement' in that specification. recommendation the following properties have been obsoleted: align, axis, bgcolor, height, width, ch, choff, nowrap, and valign. the headers property is now read-only and contains a domsettabletokenlist rather than a...
...nt' in that specification. recommendation the following properties have been obsoleted: align, axis, bgcolor, height, width, ch, choff, nowrap, and valign. the headers property is now read-only and contains a domsettabletokenlist rather than a mere domstring. the colspan and rowspan properties are now unsigned long. document object model (dom) level 2 html specificationthe def
inition of 'htmltablecellelement' in that specification. obsolete the cellindex property is now read-only. document object model (dom) level 1 specificationthe def
inition of 'htmltablecellelement' in that specification. obsolete
initial def
inition. ...
HTMLTableColElement - Web APIs
be a positive integer. htmltablecolelement.valign is a domstring that indicates the vertical alignment of the cell data in the column. htmltablecolelement.width is a domstring representing the default column width. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmltablecolelement' in that specification. living standard no change from html5. html5the def
inition of 'htmltablecolelement' in that specification. recommendation the span property is now an unsigned long. document object model (dom) level 2 html specificationthe def
inition of 'htmltablecolelement' in that specification. obsolete no change from documen...
...l5the def
inition of 'htmltablecolelement' in that specification. recommendation the span property is now an unsigned long. document object model (dom) level 2 html specificationthe def
inition of 'htmltablecolelement' in that specification. obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe def
inition of 'htmltablecolelement' in that specification. obsolete
initial def
inition. ...
HTMLTableElement.caption - Web APIs
the htmltableelement.caption property represents the table caption. if no caption element is associated with the table, this property is null. syntax var string = tableelement.caption; example if (table.caption) { // do something with the caption } specifications specification status comment html living standardthe def
inition of 'htmltableelement.caption' in that specification. living standard no change from html5 html5the def
inition of 'htmltableelement.caption' in that specification. recommendation no change from document object model (dom) level 2 html specification document object model (dom) level 2 html specificationthe def
inition of 'htmltableelement.caption' in that specification. obsolete no change from document obje...
....caption' in that specification. recommendation no change from document object model (dom) level 2 html specification document object model (dom) level 2 html specificationthe def
inition of 'htmltableelement.caption' in that specification. obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe def
inition of 'htmltableelement.caption' in that specification. obsolete
initial def
inition. ...
HTMLTableElement.createCaption() - Web APIs
e: if no caption exists, createcaption() inserts a new caption directly into the table. the caption does not need to be added separately as would be the case if document.createelement() had been used to create the new <caption> element. syntax htmltableelement = table.createcaption(); return value htmltablecaptionelement example this example uses javascript to add a caption to a table that
initially lacks one. html <table> <tr><td>cell 1.1</td><td>cell 1.2</td><td>cell 1.3</td></tr> <tr><td>cell 2.1</td><td>cell 2.2</td><td>cell 2.3</td></tr> </table> javascript let table = document.queryselector('table'); let caption = table.createcaption(); caption.textcontent = 'this caption was created by javascript!'; result specifications specification status comment ...
... living standard ...
HTMLTableElement.tFoot - Web APIs
the htmltableelement.tfoot property represents the <tfoot> element of a <table>. its value will be null if there is no such element. syntax htmltablesectionelementobject = table.tfoot table.tfoot = htmltablesectionelementobject example if (table.tfoot == my_foot) { // ... } specifications specification status comment html living standardthe def
inition of 'htmltableelement.tfoot' in that specification. living standard no change from html5 html5the def
inition of 'htmltableelement.tfoot' in that specification. recommendation no change from document object model (dom) level 2 html specification document object model (dom) level 2 html specificationthe def
inition of 'htmltableelement.tfoot' in that specification. obsolete no chan...
...ment.tfoot' in that specification. recommendation no change from document object model (dom) level 2 html specification document object model (dom) level 2 html specificationthe def
inition of 'htmltableelement.tfoot' in that specification. obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe def
inition of 'htmltableelement.tfoot' in that specification. obsolete
initial def
inition. ...
HTMLTableElement.tHead - Web APIs
tmltableelement.thead represents the <thead> element of a <table> . its value will be null if there is no such element. syntax thead_element = table.thead; table.thead = thead_element; parameters thead_element is a htmltablesectionelement. example if (table.thead == my_head_el) { // ... } specifications specification status comment html living standardthe def
inition of 'htmltableelement.thead' in that specification. living standard no change from html5 html5the def
inition of 'htmltableelement.thead' in that specification. recommendation no change from document object model (dom) level 2 html specification document object model (dom) level 2 html specificationthe def
inition of 'htmltableelement.thead' in that specification. ...
...ment.thead' in that specification. recommendation no change from document object model (dom) level 2 html specification document object model (dom) level 2 html specificationthe def
inition of 'htmltableelement.thead' in that specification. obsolete no change from document object model (dom) level 1 specification document object model (dom) level 1 specificationthe def
inition of 'htmltableelement.thead' in that specification. obsolete
initial def
inition. ...
HTMLTableElement - Web APIs
xsizeerror is raised. htmltableelement.deleterow() removes the row corresponding to the index given in parameter. if the index value is -1 the last row is removed; if it smaller than -1 or greater than the amount of rows in the collection, a domexception with the value indexsizeerror is raised. specifications specification status comment html living standardthe def
inition of 'htmltableelement' in that specification. living standard added the sortable property and the stopsorting() method. html5the def
inition of 'htmltableelement' in that specification. recommendation added the createtbody() method. document object model (dom) level 2 html specificationthe def
inition of 'htmltableelement' in that specification. obsolete define...
...5the def
inition of 'htmltableelement' in that specification. recommendation added the createtbody() method. document object model (dom) level 2 html specificationthe def
inition of 'htmltableelement' in that specification. obsolete defined when caption, thead, tfoot, insertrow(), and deleterow() raise exceptions. document object model (dom) level 1 specificationthe def
inition of 'htmltableelement' in that specification. obsolete
initial def
inition. ...
HTMLTableRowElement - Web APIs
n position is not given or is -1, it appends the cell to 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 -1, it raises a domexception with the indexsizeerror value. returns a reference to a htmltablecellelement [en-us]. specifications specification status comment html living standardthe def
inition of 'htmltablerowelement' in that specification. living standard html5the def
inition of 'htmltablerowelement' in that specification. recommendation the parameter of insertcell is now optional and default to -1. document object model (dom) level 2 html specificationthe def
inition of 'htmltablerowelement' in that specification. obsolete the cells, rowindex, a...
...rameter of insertcell is now optional and default to -1. document object model (dom) level 2 html specificationthe def
inition of 'htmltablerowelement' in that specification. obsolete the cells, rowindex, and selectionrowindex properties are now read-only. the methods insertcell and deletecell can raise exceptions. document object model (dom) level 1 specificationthe def
inition of 'htmltablerowelement' in that specification. obsolete
initial def
inition. ...
HTMLTableSectionElement - Web APIs
given position in the section. if the given position is not given or is -1, it appends the row to the end of 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 -1, it raises a domexception with the indexsizeerror value. specifications specification status comment html living standardthe def
inition of 'htmltablesectionelement' in that specification. living standard html5the def
inition of 'htmltablesectionelement' in that specification. recommendation the parameter of insertcell is now optional. document object model (dom) level 2 html specificationthe def
inition of 'htmltablesectionelement' in that specification. obsolete the methods insertrow and de...
...he def
inition of 'htmltablesectionelement' in that specification. recommendation the parameter of insertcell is now optional. document object model (dom) level 2 html specificationthe def
inition of 'htmltablesectionelement' in that specification. obsolete the methods insertrow and deleterow can raise exceptions. document object model (dom) level 1 specificationthe def
inition of 'htmltablesectionelement' in that specification. obsolete
initial def
inition. ...
HTMLTimeElement.dateTime - Web APIs
...
...t.datetime; timeelt.datetime = datetimestring example // assumes there is <time id="t"> element in the html var t = document.getelementbyid("t"); t.datetime = "6w 5h 34m 5s"; specifications specification status comment html living standardthe def
inition of 'htmltimeelement' in that specification. living standard no change from html 5.1. html 5.1the def
inition of 'htmltimeelement' in that specification. recommendation no change from html5. html5the def
inition of 'htmltimeelement' in that specification. recommendation
initial def
inition. ...
HTMLTitleElement - Web APIs
</svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmltitleelement.text is a domstring representing the text of the document's title. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmltitleelement' in that specification. living standard html 5.1the def
inition of 'htmltitleelement' in that specification. recommendation no change from html5 html5the def
inition of 'htmltitleelement' in that specification. recommendation no change from document object model (dom) level 2 html specification. document object model (dom) level...
... that specification. living standard html 5.1the def
inition of 'htmltitleelement' in that specification. recommendation no change from html5 html5the def
inition of 'htmltitleelement' in that specification. recommendation no change from document object model (dom) level 2 html specification. document object model (dom) level 2 html specificationthe def
inition of 'htmltitleelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmltitleelement' in that specification. obsolete
initial def
inition. ...
HTMLTrackElement - Web APIs
ed the currently-presented cues. this event is always sent to the texttrack but is also sent to the htmltrackelement if one is associated with the track. you may also use the oncuechange event handler to establish a handler for this event. usage notes loading of the track's text resource the webvtt or ttml data describing the actual cues for the text track isn't loaded if the track's mode is
initially in the disabled state. if you need to be able to perform any processing on the track after the <track> is set up, you should instead ensure that the track's mode is either hidden (if you don't want it to start out being presented to the user) or showing (to
initially display the track). you can then change the mode as desired later. specifications specification status commen...
...ed to be able to perform any processing on the track after the <track> is set up, you should instead ensure that the track's mode is either hidden (if you don't want it to start out being presented to the user) or showing (to
initially display the track). you can then change the mode as desired later. specifications specification status comment html living standardthe def
inition of 'htmltrackelement' in that specification. living standard html5the def
inition of 'htmltrackelement' in that specification. recommendation
initial def
inition. ...
HTMLUListElement - Web APIs
ompact is a boolean indicating that spacing between list items should be reduced. this property reflects the compact attribute only, it doesn't consider the line-height css property used for that behavior in modern pages. methods no specific method; inherits methods from its parent, htmlelement. specifications specification status comment html living standardthe def
inition of 'htmlulistelement' in that specification. living standard html5the def
inition of 'htmlulistelement' in that specification. recommendation the compact and type properties have been obsoleted. document object model (dom) level 2 html specificationthe def
inition of 'htmlulistelement' in that specification. obsolete no change from document object model (dom...
... def
inition of 'htmlulistelement' in that specification. recommendation the compact and type properties have been obsoleted. document object model (dom) level 2 html specificationthe def
inition of 'htmlulistelement' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'htmlulistelement' in that specification. obsolete
initial def
inition. ...
In depth: Microtasks and the JavaScript runtime environment - Web APIs
window is actually a container within an <iframe>, it likely shares an event loop with the window that contains it. the windows happen to share the same process in a multi-process web browser implementation. the specifics may vary from browser to browser, depending on how they're implemented. tasks vs microtasks a task is any javascript scheduled to be run by the standard mechanisms such as
initially starting to execute a program, an event triggering a callback, and so forth. other than by using events, you can enqueue a task by using settimeout() or setinterval(). the difference between the task queue and the microtask queue is simple but very important: when executing tasks from the task queue, the runtime executes each task that is in the queue at the moment a new iteration of the...
... queue is empty—even if new ones are scheduled in the interim. in other words, microtasks can enqueue new microtasks and those new microtasks will execute before the next task begins to run, and before the end of the current event loop iteration. problems because your code runs in the same thread, using the same event loop, as the browser's user interface, if your code blocks or enters an inf
inite loop, the browser itself will stall. even sluggish performance, whether caused by a bug or because of complex work being done by your code, can cause the user to suffer a sluggish browser. when multiple programs and multiple code objects within those programs start to try to work at once, alongside a browser which also needs processor time—let alone time to render and draw the site and its ow...
Drag Operations - Web APIs
ing the effectallowed property within a dragstart event listener. event.datatransfer.effectallowed = "copy"; in this example, only a copy is allowed. you can combine the values in various ways: none no operation is permitted copy copy only move move only link link only copymove copy or move only copylink copy or link only linkmove link or move only all copy, move, or link un
initialized the default value is all. note that these values must be used exactly as listed above. for example, setting the effectallowed property to copymove allows a copy or move operation but prevents the user from performing a link operation. if you don't change the effectallowed property, then any operation is allowed, just like with the 'all' value. so you don't need to adjust this property u...
...ragover events can check the effectallowed property to see which operations are permitted. a related property, dropeffect, should be set within one of these events to specify which single operation should be performed. valid values for dropeffect are none, copy, move, or link. the combination values are not used for this property. with the dragenter and dragover event, the dropeffect property is
initialized to the effect that the user is requesting. the user can modify the desired effect by pressing modifier keys. although the exact keys used vary by platform, typically the shift and control keys would be used to switch between copying, moving, and linking. the mouse pointer will change to indicate which operation is desired. for instance, for a copy, the cursor might appear with a plus sign ...
Headers - Web APIs
you can add to this using methods like append() (see examples.) in all methods of this interface, header names are matched by case-insensitive byte sequence. ...
... living standard ...
History.scrollRestoration - 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.c...
... not restored, user will need to scroll manually.'); } prevent automatic page location restoration if (history.scrollrestoration) { history.scrollrestoration = 'manual'; } specifications specification status comment html living standardthe def
inition of 'scroll restoration mode' in that specification. living standard no change from html5. html5the def
inition of 'history.scrollrestoration' in that specification. recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web...
History.state - Web APIs
...
...ate}`); // now push something on the stack history.pushstate({name: 'example'}, "pushstate example", 'page3.html'); // now state has a value. console.log(`history.state after pushstate: ${history.state}`); specificationse specification status comment html living standardthe def
inition of 'history.state' in that specification. living standard html5the def
inition of 'history.state' in that specification. recommendation
initial def
inition. ...
IDBCursor.advance() - Web APIs
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 ...
...ue.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); cursor.advance(2); } else { console.log('every other entry displayed.'); } }; }; specifications specification status comment indexed database api 2.0the def
inition of 'advance()' in that specification. recommendation indexed database api draftthe def
inition of 'advance()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox fo...
IDBCursor.continue() - Web APIs
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 re...
...cursor.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status comment indexed database api 2.0the def
inition of 'continue()' in that specification. recommendation indexed database api draftthe def
inition of 'continue()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for ...
IDBCursor.delete() - Web APIs
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 requ...
...lue.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); } cursor.continue(); } else { console.log('entries displayed.'); } }; }; specifications specification status comment indexed database api 2.0the def
inition of 'delete()' in that specification. recommendation indexed database api draftthe def
inition of 'delete()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for a...
IDBCursor.direction - Web APIs
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 req...
...; list.appendchild(listitem); console.log(cursor.direction); cursor.continue(); } else { console.log('entries displayed backwards.'); } }; }; specifications specification status comment indexed database api 2.0the def
inition of 'direction' in that specification. recommendation indexed database api draftthe def
inition of 'direction' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for ...
IDBCursor.key - Web APIs
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. de...
...le + ', ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.key); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status comment indexed database api 2.0the def
inition of 'key' in that specification. recommendation indexed database api draftthe def
inition of 'key' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for andr...
IDBCursor.primaryKey - Web APIs
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 pul...
...rsor.value.year; list.appendchild(listitem); console.log(cursor.primarykey); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status comment indexed database api 2.0the def
inition of 'primarykey' in that specification. recommendation indexed database api draftthe def
inition of 'primarykey' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox f...
IDBCursor.request - 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for a...
....value.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.request); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment indexed database api draftthe def
inition of 'request' in that specification. recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung in...
IDBCursor.source - Web APIs
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 reques...
..., ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.source); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status comment indexed database api 2.0the def
inition of 'source' in that specification. recommendation indexed database api draftthe def
inition of 'source' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for a...
IDBCursor.update() - Web APIs
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 re...
... cursor.value.albumtitle + '</strong>, ' + cursor.value.year; list.appendchild(listitem); cursor.continue(); } else { console.log('entries displayed.'); } }; }; specifications specification status comment indexed database api 2.0the def
inition of 'update()' in that specification. recommendation indexed database api draftthe def
inition of 'update()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for...
IDBCursorWithValue.value - Web APIs
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 re...
...', ' + cursor.value.year; list.appendchild(listitem); console.log(cursor.value); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status comment indexed database api 2.0the def
inition of 'source' in that specification. recommendation indexed database api draftthe def
inition of 'idbdatabase' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox f...
IDBCursorWithValue - Web APIs
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 ...
...or.value.albumtitle + ', ' + cursor.value.year; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specifications specification status comment indexed database api 2.0the def
inition of 'idbcursorwithvalue' in that specification. recommendation indexed database api draftthe def
inition of 'idbcursorwithvalue' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfir...
IDBDatabase.createObjectStore() - Web APIs
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 ...
....createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", { unique: false }); note.innerhtml += "<li>object store created.</li>"; }; specification specification status comment indexed database api 2.0the def
inition of 'createobjectstore()' in that specification. recommendation indexed database api draftthe def
inition of 'createobjectstore()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidf...
IDBDatabase.name - Web APIs
r to-do notifications app (view example live). // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being // opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // this line will log the name of the database, which should be "todolist" console.log(db.name); }; specifications specification status comment indexed database api 2.0the def
inition of 'name' in that specification. recommendatio...
... the database in the db variable. this is used a lot below db = dbopenrequest.result; // this line will log the name of the database, which should be "todolist" console.log(db.name); }; specifications specification status comment indexed database api 2.0the def
inition of 'name' in that specification. recommendation indexed database api draftthe def
inition of 'name' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for and...
IDBDatabase.objectStoreNames - Web APIs
res currently in the connected database. example // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // this line will log the version of the connected database, which should be // an object that looks like { ['my-store-name'] } console.log(db.objectstorenames); }; specifications specification status comment indexed database api ...
...li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // this line will log the version of the connected database, which should be // an object that looks like { ['my-store-name'] } console.log(db.objectstorenames); }; specifications specification status comment indexed database api 2.0the def
inition of 'objectstorenames' in that specification. recommendation indexed database api draftthe def
inition of 'objectstorenames' in that specification. 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 se...
IDBDatabase.onabort - Web APIs
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 reque...
... objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", { unique: false }); note.innerhtml += '<li>object store created.</li>'; }; specifications specification status comment indexed database api 2.0the def
inition of 'onabort' in that specification. recommendation indexed database api draftthe def
inition of 'onabort' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for a...
IDBDatabase.onerror - Web APIs
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 reque...
... objectstore.createindex("year", "year", { unique: false }); objectstore.createindex("notified", "notified", { unique: false }); note.innerhtml += '<li>object store created.</li>'; }; specifications specification status comment indexed database api 2.0the def
inition of 'onerror' in that specification. recommendation indexed database api draftthe def
inition of 'onerror' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for a...
IDBDatabase.onversionchange - Web APIs
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...
...ld refresh this browser window, or close it down and use the other open version of this application, wherever it exists.</li>'; }; }; specifications specification status comment indexed database api 2.0the def
inition of 'onversionchange' in that specification. recommendation indexed database api draftthe def
inition of 'onversionchange' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfiref...
IDBDatabase.transaction() - Web APIs
of store names. example in this example we open a database connection, then use transaction() to open a transaction on the database. for a complete example, see our to-do notifications app (view example live.) var db; // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = dbopenrequest.result; // run the displaydata() function to populate the task list with // all the to-do list data already in the idb displaydata(); }; // open a read/write db transaction, ready for adding the data var transaction = db.transaction(["todolist"], "readwrite...
...ed.</li>'; }; transaction.onerror = function(event) { note.innerhtml += '<li>transaction not opened due to error. duplicate items not allowed.</li>'; }; // you would then go on to do something to this database // via an object store var objectstore = transaction.objectstore("todolist"); // etc. specification specification status comment indexed database api 2.0the def
inition of 'transaction()' in that specification. recommendation indexed database api draftthe def
inition of 'transaction()' in that specification. 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 ...
IDBDatabase.version - Web APIs
he version of the connected database. example // let us open our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database // being opened successfully, or not dbopenrequest.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot below db = dbopenrequest.result; // this line will log the version of the connected database, which should be "4" console.log(db.version); }; specifications specification status comment indexed database api 2.0the def
inition of 'version' in that specification. r...
...e in the db variable. this is used a lot below db = dbopenrequest.result; // this line will log the version of the connected database, which should be "4" console.log(db.version); }; specifications specification status comment indexed database api 2.0the def
inition of 'version' in that specification. recommendation indexed database api draftthe def
inition of 'version' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for a...
IDBDatabase - Web APIs
this is used a lot later on db = dbopenrequest.result; // run the displaydata() function to populate the task // list with all the to-do list data already in the idb displaydata(); }; // this event handles the event whereby a new version of // the database needs to be created either one has not // bee...
...ied", { unique: false }); note.innerhtml += '<li>object store created.</li>'; }; this next line opens up a transaction on the database, then opens an object store that we can then manipulate the data inside of. var objectstore = db.transaction('todolist', 'readwrite').objectstore('todolist'); specifications specification status comment indexed database api 2.0the def
inition of 'idbdatabase' in that specification. recommendation
initial version indexed database api draftthe def
inition of 'idbdatabase' in that specification. 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 an...
IDBFactory.deleteDatabase() - 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-co...
...eleting database."); }; dbdeleterequest.onsuccess = function(event) { console.log("database deleted successfully"); console.log(event.result); // should be undefined }; specifications specification status comment indexed database api draftthe def
inition of 'deletedatabase()' in that specification. recommendation indexed database api 2.0the def
inition of 'deletedatabase()' in that specification. recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchro...
IDBIndex.count() - Web APIs
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...
... + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment indexed database api 2.0the def
inition of 'count()' in that specification. recommendation indexed database api draftthe def
inition of 'count()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for an...
IDBIndex.getKey() - Web APIs
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 reque...
... + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment indexed database api 2.0the def
inition of 'getkey()' in that specification. recommendation indexed database api draftthe def
inition of 'getkey()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for a...
IDBIndex.keyPath - Web APIs
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 reque...
... + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment indexed database api 2.0the def
inition of 'keypath' in that specification. recommendation indexed database api draftthe def
inition of 'keypath' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for a...
IDBIndex.multiEntry - Web APIs
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...
... + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment indexed database api 2.0the def
inition of 'multientry' in that specification. recommendation indexed database api draftthe def
inition of 'multientry' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox fo...
IDBIndex.name - Web APIs
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...
... + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment indexed database api 2.0the def
inition of 'name' in that specification. recommendation indexed database api draftthe def
inition of 'name' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for andr...
IDBIndex.objectStore - Web APIs
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 pu...
... + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment indexed database api 2.0the def
inition of 'objectstore' in that specification. recommendation indexed database api draftthe def
inition of 'objectstore' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox f...
IDBIndex.openCursor() - Web APIs
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 pu...
... + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment indexed database api 2.0the def
inition of 'opencursor()' in that specification. recommendation indexed database api draftthe def
inition of 'opencursor()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox f...
IDBIndex.openKeyCursor() - Web APIs
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 u...
...'<td>' + cursor.primarykey + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('all last names displayed.'); } }; }; specification specification status comment indexed database api 2.0the def
inition of 'openkeycursor()' in that specification. recommendation indexed database api draftthe def
inition of 'openkeycursor()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefo...
IDBIndex.unique - Web APIs
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...
... + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment indexed database api 2.0the def
inition of 'unique' in that specification. recommendation indexed database api draftthe def
inition of 'unique' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for an...
IDBIndex - Web APIs
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 requ...
... + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment indexed database api 2.0the def
inition of 'idbindex' in that specification. recommendation indexed database api draftthe def
inition of 'idbindex' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for a...
IDBKeyRange.bound() - Web APIs
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 requ...
...ing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment indexed database api 2.0the def
inition of 'bound()' in that specification. recommendation indexed database api draftthe def
inition of 'bound()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for ...
IDBKeyRange.includes() - Web APIs
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...
... } if (r.upper !== undefined) { c = indexeddb.cmp(key, r.upper); if (r.upperopen && c >= 0) return false; if (!r.upperopen && c > 0) return false; } return true; }; specification specification status comment indexed database api draftthe def
inition of 'includes()' in that specification. recommendation indexed database api draftthe def
inition of 'includes()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox fo...
IDBKeyRange.lower - Web APIs
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. ...
...ing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment indexed database api 2.0the def
inition of 'lower' in that specification. recommendation indexed database api draftthe def
inition of 'lower' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for and...
IDBKeyRange.lowerBound() - Web APIs
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 ...
...</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment indexed database api 2.0the def
inition of 'lowerbound()' in that specification. recommendation indexed database api draftthe def
inition of 'lowerbound()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox ...
IDBKeyRange.lowerOpen - Web APIs
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 r...
...ng + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment indexed database api 2.0the def
inition of 'loweropen' in that specification. recommendation indexed database api draftthe def
inition of 'loweropen' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for...
IDBKeyRange.only() - Web APIs
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...
....fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment indexed database api 2.0the def
inition of 'only' in that specification. recommendation indexed database api draftthe def
inition of 'only' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for andr...
IDBKeyRange.upper - Web APIs
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. ...
...ing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment indexed database api 2.0the def
inition of 'upper' in that specification. recommendation indexed database api draftthe def
inition of 'upper' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for and...
IDBKeyRange.upperBound() - Web APIs
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 ...
...trong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment indexed database api 2.0the def
inition of 'upperbound()' in that specification. recommendation indexed database api draftthe def
inition of 'upperbound()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox ...
IDBKeyRange.upperOpen - Web APIs
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 r...
...+ '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment indexed database api 2.0the def
inition of 'upperopen' in that specification. recommendation indexed database api draftthe def
inition of 'upperopen' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for...
IDBKeyRange - Web APIs
recommendation adds includes(). 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/bro...
... listitem.innerhtml = '<strong>' + cursor.value.fthing + '</strong>, ' + cursor.value.frating; list.appendchild(listitem); cursor.continue(); } else { console.log('entries all displayed.'); } }; } specifications specification status comment indexed database api 2.0the def
inition of 'idbkeyrange' in that specification. recommendation
initial def
inition. indexed database api draftthe def
inition of 'idbkeyrange' in that specification. recommendation adds includes(). 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. desktopmobilechromeedge...
IDBObjectStore.getKey() - Web APIs
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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for an...
...ay.getdate() - 1); let request = store.getkey(idbkeyrange(yesterday, today)); request.onsuccess = (event) => { let when = event.target.result; alert("the 1st activity in last 24 hours was occurred at " + when); }; }; specifications specification status comment indexed database api draftthe def
inition of 'getkey()' in that specification. recommendation
initial def
inition 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung inte...
IDBObjectStore.index() - Web APIs
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 reque...
... + '<td>' + cursor.value.age + '</td>'; tableentry.appendchild(tablerow); cursor.continue(); } else { console.log('entries all displayed.'); } }; }; specification specification status comment indexed database api 2.0the def
inition of 'index()' in that specification. recommendation indexed database api draftthe def
inition of 'index()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for a...
IDBObjectStore.openCursor() - Web APIs
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 ...
...rsor.value contains the current record being iterated through // this is where you'd do something with the result cursor.continue(); } else { // no more results } }; specification specification status comment indexed database api 2.0the def
inition of 'opencursor()' in that specification. recommendation indexed database api draftthe def
inition of 'opencursor()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox ...
IDBObjectStore.put() - Web APIs
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...
...tetitlerequest.transaction); // when this new request succeeds, run the displaydata() function again to update the display updatetitlerequest.onsuccess = () => { displaydata(); }; }; specification specification status comment indexed database api 2.0the def
inition of 'put()' in that specification. recommendation indexed database api draftthe def
inition of 'put()' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for andr...
IDBOpenDBRequest.onblocked - Web APIs
idbopendbrequest.onblocked = function(event) { ... }; example var db; // let us open our database var request = indexeddb.open("todolist", 4); // these two event handlers act on the database being opened // successfully, or not request.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; request.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. // this is used a lot below db = request.result; // run the displaydata() function to populate the task list with // all the to-do list data already in the idb displaydata(); }; // this event handles the event whereby a new version of the // database needs to be created. either one has not been created /...
...oading database.</li>'; }; // create an objectstore for this database var objectstore = db.createobjectstore("todolist", { keypath: "tasktitle" }); ... }; request.onblocked = function() { console.log("your database version can't be upgraded because the app is open somewhere else."); } specifications specification status comment indexed database api 2.0the def
inition of 'onblocked' in that specification. recommendation indexed database api draftthe def
inition of 'onblocked' in that specification. 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 ...
IDBRequest.error - Web APIs
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. ...
...equest.onerror = function() { // if an error occurs with the request, log what it is console.log("there has been an error with retrieving your data: " + objectstoretitlerequest.error); }; specifications specification status comment indexed database api 2.0the def
inition of 'error' in that specification. recommendation indexed database api draftthe def
inition of 'error' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for and...
IDBRequest.onerror - Web APIs
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 reque...
...onsole.log("there has been an error with retrieving your data: " + objectstoretitlerequest.error); // todo what about event parameter into onerror()? what will be inside of this event? }; specifications specification status comment indexed database api 2.0the def
inition of 'onerror' in that specification. recommendation indexed database api draftthe def
inition of 'onerror' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for a...
IDBRequest.onsuccess - Web APIs
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 r...
...e.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status comment indexed database api 2.0the def
inition of 'onsuccess' in that specification. recommendation indexed database api draftthe def
inition of 'onsuccess' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for...
IDBRequest.readyState - Web APIs
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...
...eadystate); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status comment indexed database api 2.0the def
inition of 'readystate' in that specification. recommendation indexed database api draftthe def
inition of 'readystate' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox fo...
IDBRequest.result - Web APIs
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...
...tore.put(data); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status comment indexed database api 2.0the def
inition of 'result' in that specification. recommendation indexed database api draftthe def
inition of 'result' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for an...
IDBRequest.source - Web APIs
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...
...itlerequest.source); // when this new request succeeds, run the displaydata() // function again to update the display updatetitlerequest.onsuccess = function() { displaydata(); }; }; specifications specification status comment indexed database api 2.0the def
inition of 'source' in that specification. recommendation indexed database api draftthe def
inition of 'source' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for an...
IDBTransaction.commit() - 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid web...
...ed successfully in the db - for that you need transaction.onsuccess) note.innerhtml += '<li>request successful.</li>'; }; // force the changes to be committed to the database asap transaction.commit(); specification specification status comment indexed database api draftthe def
inition of 'idbtransaction.commit()' in that specification. recommendation unitial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetcommi...
IDBVersionChangeEvent - Web APIs
ind...
...oading database.</li>'; }; dbopenrequest.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; // store the result of opening the database in the db variable. this is used a lot later on, for opening transactions and suchlike. db = dbopenrequest.result; }; specifications specification status comment indexed database api 2.0the def
inition of 'idbversionchangeevent' in that specification. recommendation
initial def
inition. indexed database api draftthe def
inition of 'idbversionchangeevent' in that specification. recommendation ...
ImageCapture.takePhoto() - 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for...
...photo().then(function(blob) { console.log('took photo:', blob); img.classlist.remove('hidden'); img.src = url.createobjecturl(blob); }).catch(function(error) { console.log('takephoto() error: ', error); }); } specifications specification status comment mediastream image capturethe def
inition of 'takephoto()' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung int...
ImageData() - Web APIs
izeerror thrown if array is specified, but its length is not a multiple of (4 * width) or (4 * width * height). examples creating a blank imagedata object this example creates an imagedata object that is 200 pixels wide and 100 pixels tall, containing a total of 20,000 pixels. let imagedata = new imagedata(200, 100); // imagedata { width: 200, height: 100, data: uint8clampedarray[80000] }
initializing imagedata with an array this example instantiates an imagedata object with pixel colors defined by an array. html <canvas id="canvas"></canvas> javascript the array (arr) has a length of 40000: it consists of 10,000 pixels, each of which is defined by 4 values. the imagedata constructor specifies a width of 200 for the new object, so its height defaults to 10,000 divided by 200, whic...
...so its height defaults to 10,000 divided by 200, which is 50. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const arr = new uint8clampedarray(40000); // iterate through every pixel for (let i = 0; i < arr.length; i += 4) { arr[i + 0] = 0; // r value arr[i + 1] = 190; // g value arr[i + 2] = 0; // b value arr[i + 3] = 255; // a value } //
initialize a new imagedata object let imagedata = new imagedata(arr, 200); // draw image data to the canvas ctx.putimagedata(imagedata, 20, 20); result specification specification status comment html living standardthe def
inition of 'imagedata()' in that specification. living standard
initial def
inition. ...
InputEvent.dataTransfer - 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome fo...
...itable = document.queryselector('p[contenteditable]'); var result = document.queryselector('.result') var datatransferobj; editable.addeventlistener('input', (e) => { result.textcontent = e.datatransfer.getdata('text/html'); }); specifications specification status comment input events level 2the def
inition of 'datatransfer' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung int...
IntersectionObserver.thresholds - Web APIs
ver has a field named threshold, this property is called thresholds. confusing? yes. ...
...you accidentally use thresholds as the name of the field in your options, the thresholds array will wind up being simply [0.0], which is likely not what you expect. debugging chaos may ensue. examples <<<...>>> specifications specification status comment intersection observerthe def
inition of 'intersectionobserver.thresholds' in that specification. working draft
initial def
inition ...
Navigator.permissions - Web APIs
...
...ermissions object. examples navigator.permissions.query({name:'geolocation'}).then(function(result) { if (result.state === 'granted') { showmap(); } else if (result.state === 'prompt') { showbuttontoenablemap(); } // don't do anything if the permission was denied. }); specification specification status comment permissions working draft
initial def
inition. ...
NavigatorConcurrentHardware - Web APIs
...
... may be available to the user agent. this value is always at least 1, and will be 1 if the actual number of logical processors can't be determined. methods the navigatorconcurrenthardware mixin has no methods. specifications specification status comment html living standardthe def
inition of 'navigatorconcurrenthardware' in that specification. living standard
initial def
inition. ...
Network Information API - Web APIs
the entire api consists of the addition of the networkinformation interface and a single property to the navigator interface: navigator.connection. note: this feature is available in web workers. examples detect connection changes this example watches for changes to the user's connection. ...
...rmation provides information about the connection a device is using to communicate with the network and provides a means for scripts to be notified if the connection type changes. the networkinformation interfaces cannot be instantiated. it is instead accessed through the navigator interface. specifications specification status comment network information apithe def
inition of 'network information api' in that specification. draft
initial specification ...
Node.appendChild() - Web APIs
let ablock = document.createelement('block').appendchild( document.createelement('b') ); sets ablock to <b></b> only, which is probably not what you want. example // create a new paragraph element, and append it to the end of the document body let p = document.createelement("p"); document.body.appendchild(p); specifications specification status comment domthe def
inition of 'node.appendchild()' in that specification. living standard no change from document object model (dom) level 3 core specification. document object model (dom) level 3 core specificationthe def
inition of 'node.appendchild()' in that specification. obsolete no change from document object model (dom) level 2 core specification. document object model (dom) level 2 ...
...)' in that specification. living standard no change from document object model (dom) level 3 core specification. document object model (dom) level 3 core specificationthe def
inition of 'node.appendchild()' in that specification. obsolete no change from document object model (dom) level 2 core specification. document object model (dom) level 2 core specificationthe def
inition of 'node.appendchild()' in that specification. obsolete no change from document object model (dom) level 1 specification. document object model (dom) level 1 specificationthe def
inition of 'node.appendchild()' in that specification. obsolete
initial def
inition. ...
Node.insertBefore() - Web APIs
ement, thefirstchild) when the element does not have a first child, then firstchild is null. the element is still appended to the parent, after the last child. since the parent element did not have a first child, it did not have a last child, either. consequently, the newly inserted element is the only element. specifications specification status comment domthe def
inition of 'node.insertbefore' in that specification. living standard fixes errors in the insertion algorithm dom4the def
inition of 'node.insertbefore' in that specification. obsolete describes the algorithm in more detail document object model (dom) level 3 core specificationthe def
inition of 'node.insertbefore' in that specification. obsolete no notable changes ...
... fixes errors in the insertion algorithm dom4the def
inition of 'node.insertbefore' in that specification. obsolete describes the algorithm in more detail document object model (dom) level 3 core specificationthe def
inition of 'node.insertbefore' in that specification. obsolete no notable changes document object model (dom) level 2 core specificationthe def
inition of 'node.insertbefore' in that specification. obsolete no notable changes document object model (dom) level 1 specificationthe def
inition of 'node.insertbefore' in that specification. obsolete introduced ...
Node.nodeType - Web APIs
.firstchild.nodetype === node.text_node; // true comments this example checks if the first node inside the document element is a comment, and displays a message if not. ...
...ild; if (node.nodetype !== node.comment_node) { console.warn("you should comment your code!"); } specifications specification status comment domthe def
inition of 'node.nodetype' in that specification. living standard deprecated attribute_node, entity_reference_node and notation_node types. document object model (dom) level 3 core specificationthe def
inition of 'node.nodetype' in that specification. obsolete no changes. document object model (dom) level 2 core specificationthe def
inition of 'node.nodetype' in that specification. obsolete no changes. document object model (dom) level 1 specificationthe def
inition of 'node.nodetype' in that specification. obsolete
initial def
inition. ...
NodeFilter.acceptNode() - Web APIs
...
...ode; while ((node = iterator.nextnode())) { alert(node.data); } specifications specification status comment domthe def
inition of 'nodefilter.acceptnode()' in that specification. living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe def
inition of 'nodefilter.acceptnode()' in that specification. obsolete
initial def
inition. ...
NodeIterator.detach() - Web APIs
...
...} }, false ); nodeiterator.detach(); // detaches the iterator nodeiterator.nextnode(); // throws an invalid_state_err exception specifications specification status comment domthe def
inition of 'nodeiterator.detach' in that specification. living standard transformed in a no-op document object model (dom) level 2 traversal and range specificationthe def
inition of 'nodeiterator.detach' in that specification. obsolete
initial def
inition. ...
NodeIterator.nextNode() - Web APIs
...
...not used any more ); currentnode = nodeiterator.nextnode(); // returns the next node specifications specification status comment domthe def
inition of 'nodeiterator.nextnode' in that specification. living standard as detach() is now a no-op method, this method cannot throw anymore. document object model (dom) level 2 traversal and range specificationthe def
inition of 'nodeiterator.nextnode' in that specification. obsolete
initial def
inition. ...
NodeIterator.previousNode() - Web APIs
...
...erator.previousnode(); // same result, since we backtracked to the previous node specifications specification status comment domthe def
inition of 'nodeiterator.previousnode' in that specification. living standard as detach() is now a no-op method, this method cannot throw anymore. document object model (dom) level 2 traversal and range specificationthe def
inition of 'nodeiterator.previousnode' in that specification. obsolete
initial def
inition. ...
NodeIterator.whatToShow - Web APIs
...
...defilter.show_comment) { // nodeiterator will show comments } specifications specification status comment domthe def
inition of 'nodeiterator.whattoshow' in that specification. living standard no change from document object model (dom) level 2 traversal and range specification. document object model (dom) level 2 traversal and range specificationthe def
inition of 'nodeiterator.whattoshow' in that specification. obsolete
initial def
inition. ...
NodeIterator - Web APIs
doesn't do anything. previously it was telling the engine that the nodeiterator was no more used, but this is now useless. nodeiterator.previousnode() returns the previous node in the document, or null if there are none. nodeiterator.nextnode() returns the next node in the document, or null if there are none. specifications specification status comment domthe def
inition of 'nodeiterator' in that specification. living standard added the referencenode and pointerbeforereferencenode properties. removed the expandentityreferences property. the method detach() has been changed to be a no-op. the methods previousnode() and nextnode() don't raise an exception any more. document object model (dom) level 2 traversal and range specificationthe d...
...n of 'nodeiterator' in that specification. living standard added the referencenode and pointerbeforereferencenode properties. removed the expandentityreferences property. the method detach() has been changed to be a no-op. the methods previousnode() and nextnode() don't raise an exception any more. document object model (dom) level 2 traversal and range specificationthe def
inition of 'nodeiterator' in that specification. obsolete
initial def
inition. ...
NodeList - Web APIs
r methods (foreach()) as well as entries(), values(), and keys(). ...
...e.foreach for iteration: const list = document.queryselectorall('input[type=checkbox]'); array.prototype.foreach.call(list, function (checkbox) { checkbox.checked = true; }); specifications specification status comment domthe def
inition of 'nodelist' in that specification. living standard document object model (dom) level 3 core specificationthe def
inition of 'nodelist' in that specification. obsolete document object model (dom) level 2 core specificationthe def
inition of 'nodelist' in that specification. obsolete document object model (dom) level 1 specificationthe def
inition of 'nodelist' in that specification. obsolete
initial def
inition. ...
NonDocumentTypeChildNode.nextElementSibling - Web APIs
rable: true, enumerable: true, get: function () { var el = this; while (el = el.nextsibling) { if (el.nodetype === 1) { return el; } } return null; }, set: undefined }); }); })([element.prototype, characterdata.prototype]); specifications specification status comment domthe def
inition of 'childnodenextelementsibling' in that specification. living standard split the elementtraversal interface in childnode, parentnode, and nondocumenttypechildnode. this method is now defined on the former. the element and characterdata interfaces implemented the new interface. element traversal specificationthe def
inition of 'elementtraversal.nextelementsibling' in that spe...
...in that specification. living standard split the elementtraversal interface in childnode, parentnode, and nondocumenttypechildnode. this method is now defined on the former. the element and characterdata interfaces implemented the new interface. element traversal specificationthe def
inition of 'elementtraversal.nextelementsibling' in that specification. obsolete added its
initial def
inition to the elementtraversal pure interface and use it on element. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androi...
NonDocumentTypeChildNode.previousElementSibling - Web APIs
ble: true, enumerable: true, get: function () { let el = this; while (el = el.previoussibling) { if (el.nodetype === 1) { return el; } } return null; }, set: undefined }); }); })([element.prototype, characterdata.prototype]); specifications specification status comment domthe def
inition of 'nondocumenttypechildnode.previouselementsibling' in that specification. living standard splitted the elementtraversal interface in childnode, parentnode, and nondocumenttypechildnode. this method is now defined on the former. the element and characterdata interfaces implemented the new interface. element traversal specificationthe def
inition of 'elementtraversal.previous...
... specification. living standard splitted the elementtraversal interface in childnode, parentnode, and nondocumenttypechildnode. this method is now defined on the former. the element and characterdata interfaces implemented the new interface. element traversal specificationthe def
inition of 'elementtraversal.previouselementsibling' in that specification. obsolete added its
initial def
inition to the elementtraversal pure interface and use it on element. ...
NonDocumentTypeChildNode - Web APIs
if there is no element in the list prior to this node. nondocumenttypechildnode.nextelementsibling read only returns the element immediately following this node in its parent's children list, or null if there is no element in the list following this node. methods there are neither inherited nor specific methods. ...
...comment domthe def
inition of 'nondocumenttypechildnode' in that specification. living standard splitted the elementtraversal interface in parentnode, childnode, and nondocumenttypechildnode. the previouselementsibling and nextelementsibling are now defined on the latter. the characterdata and element implemented the new interfaces. element traversal specificationthe def
inition of 'elementtraversal' in that specification. obsolete added the
initial def
inition of its properties to the elementtraversal pure interface and use it on element. ...
Notification.Notification() - Web APIs
...
...fication by using the notification() constructor. function spawnnotification(thebody,theicon,thetitle) { var options = { body: thebody, icon: theicon } var n = new notification(thetitle,options); } specifications specification status comment notifications apithe def
inition of 'notification() constructor' in that specification. living standard
initial def
inition. ...
OES_vertex_array_object.createVertexArrayOES() - Web APIs
the oes_vertex_array_object.createvertexarrayoes() method of the webgl api creates and
initializes a webglvertexarrayobject object that represents a vertex array object (vao) pointing to vertex array data and which provides names for different sets of vertex data. syntax webglvertexarrayobjectoes ext.createvertexarrayoes(); parameters none. return value a webglvertexarrayobject representing a vertex array object (vao) which points to vertex array data. examples var ext = gl.getextension('oes_vertex_array_object'); var vao = ext.createvertexarrayoes(); ext.bindvertexarrayoes(vao); // ... // calls to bindbuffer or vertexattribpointer // which will be "recorded" in the vao // ... ...
...ing a vertex array object (vao) which points to vertex array data. examples var ext = gl.getextension('oes_vertex_array_object'); var vao = ext.createvertexarrayoes(); ext.bindvertexarrayoes(vao); // ... // calls to bindbuffer or vertexattribpointer // which will be "recorded" in the vao // ... specifications specification status comment oes_vertex_array_objectthe def
inition of 'oes_vertex_array_object' in that specification. recommendation
initial def
inition. ...
OrientationSensor - Web APIs
...
... if (results.every(result => result.state === "granted")) { sensor.start(); ... } else { console.log("no permissions to use absoluteorientationsensor."); } }); specifications specification status comment orientation sensorthe def
inition of 'orientationsensor' in that specification. candidate recommendation
initial def
inition. ...
OscillatorNode.OscillatorNode() - Web APIs
a specified object. if the default values of the properties are acceptable, you can optionally use the audiocontext.createoscillator() factory method instead. syntax var oscillatornode = new oscillatornode(context, options) parameters inherits parameters from the audionodeoptions dictionary. context a reference to an audiocontext. options optional an object whose properties specify the
initial values for the oscillator node's properties. any properties omitted from the object will take on the default value as documented. type the shape of the wave produced by the node. valid values are 'sine', 'square', 'sawtooth', 'triangle' and 'custom'. the default is 'sine'. detune a detuning value (in cents) which will offset the frequency by the given amount. its default is 0. freq...
...ue (in cents) which will offset the frequency by the given amount. its default is 0. frequency the frequency (in hertz) of the periodic waveform. its default is 440. periodicwave an arbitrary period waveform described by a periodicwave object. return value a new oscillatornode object instance. specifications specification status comment web audio apithe def
inition of 'oscillatornode()' in that specification. working draft
initial def
inition. ...
OscillatorNode.setPeriodicWave() - Web APIs
riodic wave. var real = new float32array(2); var imag = new float32array(2); var ac = new audiocontext(); var osc = ac.createoscillator(); real[0] = 0; imag[0] = 0; real[1] = 1; imag[1] = 0; var wave = ac.createperiodicwave(real, imag); osc.setperiodicwave(wave); osc.connect(ac.destination); osc.start(); osc.stop(2); this works because a sound that contains only a fundamental tone is by def
inition a sine wave. here, we create a periodicwave with two values. the first value is the dc offset, which is the value at which the oscillator starts. 0 is good here, because we want to start the curve at the middle of the [-1.0; 1.0] range. the second and subsequent values are sine and cosine components. you can think of it as the result of a fourier transform, where you get frequency domain v...
...s from time domain value. here, with createperiodicwave(), you specify the frequencies, and the browser performs a an inverse fourier transform to get a time domain buffer for the frequency of the oscillator. here, we only set one component at full volume (1.0) on the fundamental tone, so we get a sine wave. specifications specification status comment web audio apithe def
inition of 'setperiodicwave' in that specification. working draft ...
OscillatorNode - Web APIs
de interface represents a periodic waveform, such as a sine wave. it is an audioscheduledsourcenode audio-processing module that causes a specified frequency of a given wave to be created—in effect, a constant tone. an oscillatornode is created using the baseaudiocontext.createoscillator() method. it always has exactly one output and no inputs. its basic property defaults (see audionode for def
initions) are: number of inputs 0 number of outputs 1 channel count mode max channel count 2 (not used in the default count mode) channel interpretation speakers constructor oscillatornode() creates a new instance of an oscillatornode object, optionally providing an object specifying default values for the node's properties. if t...
... working draft ...
OverconstrainedError.OverconstrainedError() - Web APIs
...
...fiable constraints are applied. syntax var overconstrainederror = new overconstrainederror() parameters constraint the constraint that was not satified. message text for the error's message property. specifications specification status comment media capture and streamsthe def
inition of 'overconstrainederror' in that specification. candidate recommendation
initial def
inition. ...
PaintWorklet.devicePixelRatio - Web APIs
...
...y property of the paintworklet interface returns the current device's ratio of physical pixels to logical pixels. syntax var devicepixelratio = paintworklet.devicepixelratio; value a double-precision integer. specifications specification status comment css painting api level 1the def
inition of 'paintworklet.devicepixelratio' in that specification. working draft
initial def
inition. ...
PaintWorklet.devicePixelRatio - Web APIs
...
...y property of the paintworklet interface returns the current device's ratio of physical pixels to logical pixels. syntax var devicepixelratio = paintworklet.devicepixelratio; value a double-precision integer. specifications specification status comment css painting api level 1the def
inition of 'paintworklet.devicepixelratio' in that specification. working draft
initial def
inition. ...
PaintWorklet.devicePixelRatio - Web APIs
...
...y property of the paintworklet interface returns the current device's ratio of physical pixels to logical pixels. syntax var devicepixelratio = paintworklet.devicepixelratio; value a double-precision integer. specifications specification status comment css painting api level 1the def
inition of 'paintworklet.devicepixelratio' in that specification. working draft
initial def
inition. ...
PannerNode.distanceModel - Web APIs
iocontext(); var panner = audioctx.createpanner(); panner.distancemodel = 'inverse'; value a enum — see distancemodeltype. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy
initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., w...
... working draft ...
PannerNode.maxDistance - Web APIs
ve values are not allowed. exceptions rangeerror the property has been given a value that is outside the accepted range. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy
initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., w...
... working draft ...
PannerNode.panningModel - Web APIs
w audiocontext(); var panner = audioctx.createpanner(); panner.panningmodel = 'hrtf'; value a enum — see panningmodeltype. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy
initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., w...
... working draft ...
PannerNode.refDistance - Web APIs
reates a graph for the test tone with a given refdistance // and schedules it to move away from the listener along the z (depth-wise) axis // at the given start time, resulting in a decrease in volume (decay) const scheduletesttone = (refdistance, starttime) => { const osc = new oscillatornode(context); const panner = new pannernode(context); panner.refdistance = refdistance; // set the
initial z position, then schedule the ramp panner.positionz.setvalueattime(0, starttime); panner.positionz.linearramptovalueattime(z_distance, starttime + note_length); osc.connect(panner) .connect(context.destination); osc.start(starttime); osc.stop(starttime + note_length); }; // this tone should decay immediately and fairly quickly scheduletesttone(1, context.currenttime); // this...
... working draft ...
PannerNode.setOrientation() - Web APIs
syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.setorientation(1,0,0); returns void. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy
initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., w...
... working draft ...
PannerNode.setPosition() - Web APIs
syntax var audioctx = new audiocontext(); var panner = audioctx.createpanner(); panner.setposition(0,0,0); returns void. example in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy
initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., w...
... working draft ...
PannerNode - Web APIs
ted downstream. this feature was not clearly specified and had a number of issues, so it was removed from the specification. examples in the following example, you can see an example of how the createpanner() method, audiolistener and pannernode would be used to control audio spatialisation. generally you will define the position in 3d space that your audio listener and panner (source) occupy
initially, and then update the position of one or both of these as the application is used. you might be moving a character around inside a game world for example, and wanting delivery of audio to change realistically as your character moves closer to or further away from a music player such as a stereo. in the example you can see this being controlled by the functions moveright(), moveleft(), etc., w...
... working draft ...
ParentNode.lastElementChild - Web APIs
as this interface contained two distinct set of properties, one aimed at node that have children, one at those that are children, they have been moved into two separate pure interfaces, parentnode and childnode. in this case, lastelementchild moved to parentnode. this is a fairly technical change that shouldn't affect compatibility. ...
... living standard splitted the elementtraversal interface in childnode and parentnode. this method is now defined on the latter. the document and documentfragment implemented the new interfaces. ...
ParentNode - Web APIs
that matches the specified group of selectors. parentnode.queryselectorall() returns a nodelist representing a list of elements with the current element as root that matches the specified group of selectors. parentnode.replacechildren() replaces the existing children of a node with a specified new set of children. specification specification status comment domthe def
inition of 'parentnode' in that specification. living standard split the elementtraversal interface into childnode and parentnode. the parentnode.firstelementchild, parentnode.lastelementchild, and parentnode.childelementcount properties are now defined on the latter. added the parentnode.children property, and the parentnode.queryselector(), parentnode.queryselectorall(), parentnode.append(), a...
...nttraversal interface into childnode and parentnode. the parentnode.firstelementchild, parentnode.lastelementchild, and parentnode.childelementcount properties are now defined on the latter. added the parentnode.children property, and the parentnode.queryselector(), parentnode.queryselectorall(), parentnode.append(), and parentnode.prepend() methods. element traversal specificationthe def
inition of 'elementtraversal' in that specification. obsolete added the
initial def
inition of its properties to the elementtraversal pure interface and used it on element. ...
PasswordCredential.iconURL - Web APIs
...
...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. syntax url =passwordcredential.iconurl value a usvstring containing a url. specifications specification status comment credential management level 1the def
inition of 'iconurl' in that specification. working draft
initial def
inition. ...
PasswordCredential - Web APIs
note: this interface is restricted to top-level 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. ...
...ch 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 specification status comment credential management level 1 working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung int...
Path2D() - Web APIs
...
... the left (h -80), and then back to the start (z). <canvas id="canvas"></canvas> const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); let p = new path2d('m10 10 h 80 v 80 h -80 z'); ctx.fill(p); specification specification status comment html living standardthe def
inition of 'path2d()' in that specification. living standard
initial def
inition. ...
PaymentAddress.city - Web APIs
...
...tring containing the city or town portion of the address. syntax var paymentcity = paymentaddress.city; value a domstring indicating the city or town portion of the address described by the paymentaddress object. specifications specification status comment payment request apithe def
inition of 'paymentaddress.city' in that specification. candidate recommendation
initial def
inition. ...
PaymentAddress.country - Web APIs
...
...ining a shippingaddresserrors field. that field contains an addresserrors-compliant object whose country property is a string indicating the validation error that occurred and, if possible, suggests how to fix it. specifications specification status comment payment request apithe def
inition of 'paymentaddress.country' in that specification. candidate recommendation
initial def
inition. ...
PaymentAddress.organization - Web APIs
...
...e address described by the paymentaddress object. this should be the name of the organization that is to receive the shipment for shipping addresses, or which is repsonsible for payment for payment addresses. specifications specification status comment payment request apithe def
inition of 'paymentaddress.organization' in that specification. candidate recommendation
initial def
inition. ...
PaymentAddress.sortingCode - Web APIs
...
...rface returns a string containing a postal sorting code such as is used in france. syntax var sortingcode = paymentaddress.sortingcode; value a domstring containing the sorting code portion of the address. specifications specification status comment payment request apithe def
inition of 'paymentaddress.sortingcode' in that specification. candidate recommendation
initial def
inition. ...
PaymentCurrencyAmount - Web APIs
...
...cy system identifier within that system which was used to provide the value. this has been removed; instead of allowing sites to choose the standard to use, iso 4217 is always used for the currency identifier now. specifications specification status comment payment request apithe def
inition of 'paymentcurrencyamount' in that specification. candidate recommendation
initial def
inition. ...
PaymentDetailsUpdate.shippingAddressErrors - Web APIs
...
...lidation error occurred for that property. in that case, the property in shippingaddresserrors is a string describing the validation error, ideally including suggestions about fixing the error. specifications specification status comment payment request apithe def
inition of 'paymentdetailsupdate.shippingaddresserrors' in that specification. candidate recommendation
initial def
inition. ...
PaymentMethodChangeEvent - Web APIs
a new paymentmethodchangeevent object providing details about a paymentmethodchange event. syntax paymentmethodchangeevent = new paymentmethodchangeevent(type, options); parameters type a domstring which must contain the string paymentmethodchange, the name of the only type of event which uses the paymentmethodchangeevent interface. options optional an optional paymentmethodchangeevent
init dictionary which may contain zero or more of the following properties: methodname optional a domstring containing the payment method identifier for the payment handler being used. this is an empty string by default. methoddetails optional an object providing payment method-specific information describing the changes made to the payment, or null if there is no additional information ava...
... payment method given in the methodname property. the type of the methoddetails property depends on the payment method. for example, if methodname is basic-card, indicating that the basic card payment method is being used for validation, the methoddetails field must be a basiccardchangedetails object. specifications specification status comment payment request apithe def
inition of 'paymentmethodchangeevent()' in that specification. candidate recommendation
initial def
inition. ...
PaymentMethodChangeEvent - Web APIs
the paymentmethodchangeevent interface of the payment request api describes the paymentmethodchange event which is fired by some payment handlers when the user switches payment instruments (e.g., a user selects a "store" card to make a purchase while using apple pay). constructor paymentmethodchangeevent() creates and returns a new paymentmethodchangeevent object, optionally
initialized with values taken from a given paymentmethodchangeevent
init dictionary. properties in addition to the properties below, this interface includes properties inherited from paymentrequestupdateevent. methoddetails read only secure context an object containing payment method-specific data useful when handling a payment method change. if no such information is available, this value is null. ...
...identifies a particular payment method. this identifier is usually a url used during the payment process, but may be a standardized non-url string as well, such as basic-card. the default value is the empty string, "". methods this interface includes methods inherited from paymentrequestupdateevent. specifications specification status comment payment request apithe def
inition of 'paymentmethodchangeevent' in that specification. candidate recommendation
initial def
inition. ...
PaymentRequest.abort() - 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchr...
...then(() => { print('payment timed out after 20 minutes.'); }).catch(() => { print('unable to abort, because the user is currently in the process ' + 'of paying.'); }); }, 20 * 60 * 1000); /* 20 minutes */ specifications specification status comment payment request apithe def
inition of 'abort()' in that specification. candidate recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung int...
PaymentRequest.canMakePayment() - Web APIs
too often, the browser may reject the returned promise with a domexception. parameters none examples in the following example, is excerpted from a demo that asynchronously builds a paymentrequest object for both apple pay and credit cards. it wraps the call to canmakepayment() in feature detection, and calls an appropriate callback depending on the resolution of the promise. ...
...se... let's see if we can use basic card const supportsbasiccard = await new paymentrequest( [{ supportedmethods: "basic-card" }], details ).canmakepayment(); if (supportsbasiccard) { // show basic card support return; } // otherwise, make payments using html form element } specifications specification status comment payment request apithe def
inition of 'canmakepayment()' in that specification. candidate recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid w...
PaymentRequest.prototype.id - Web APIs
if none is provided, the browser automatically sets the id value to a uuid. example this example shows how to give a paymentrequest instance a custom id. ...
...but under the requestid attribute. const response = await request.show(); console.log(response.requestid === request.id); // and in serialized form too const json = response.tojson(); console.log(json.requestid,response.requestid, request.id); syntax var id = paymentrequest.id value a domstring. specifications specification status comment payment request apithe def
inition of 'id' in that specification. candidate recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome f...
PaymentRequest.onshippingaddresschange - Web APIs
e shippingaddresschange event is triggered by a user-agent controlled interaction. if the address stored by the user agent changes at any time during a payment process, the event is triggered. to make sure an updated address is included when sending payment information to the server, you should add event listeners for a paymentrequest object after instantiation, but before the call to show(). //
initialization of paymentrequest arguments are excerpted for clarity. var payment = new paymentrequest(supportedinstruments, details, options); request.addeventlistener('shippingaddresschange', function(evt) { evt.updatewith(new promise(function(resolve) { updatedetails(details, request.shippingaddress, resolve); })); }); payment.show().then(function(paymentresponse) { // processing of pay...
...function(resolve) { updatedetails(details, request.shippingaddress, resolve); })); }); payment.show().then(function(paymentresponse) { // processing of paymentresponse exerpted for the same of clarity. }).catch(function(err) { console.error("uh oh, something bad happened", err.message); }); specifications specification status comment payment request apithe def
inition of 'onshippingaddresschange' in that specification. candidate recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafarian...
PaymentRequestEvent - Web APIs
a objects containing payment method identifers for the payment methods that the web site accepts and any associated payment method specific data. modifiersread only returns an array of objects containing changes to payment details. paymentrequestidread only returns the id of the paymentrequest object. paymentrequestoriginread only returns the origin where the paymentrequest object was
initialized. toporiginread only returns the top-level origin where the paymentrequest object was
initialized. totalread only returns the total amount being requested for payment. methods openwindow() opens the specified url in a new window, if and only if the given url is on the same origin as the calling page. it returns a promise that resolves with a reference to a windowclient. ...
... specified url in a new window, if and only if the given url is on the same origin as the calling page. it returns a promise that resolves with a reference to a windowclient. respondwith() prevents the default event handling and allows you to provide a promise for a paymentresponse object yourself. specifications specification status comment payment handler apithe def
inition of 'paymentrequestevent' in that specification. working draft
initial def
inition. ...
PaymentResponse.details - 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung int...
...t method string method: paymentresponse.methodname, // payment details as you requested details: paymentresponse.details, // shipping address information address: todict(paymentresponse.shippingaddress) }; // send information to the server }); specifications specification status comment payment request api candidate recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetdetail...
PaymentResponse - Web APIs
...
...ion while filling out a payment request form. allows the developer to revalidate any requested user data (e.g., the phone number or the email address) if it changes. also available via the onpayerdetailchange property. specifications specification status comment payment request apithe def
inition of 'paymentresponse' in that specification. candidate recommendation
initial def
inition. ...
Payment Request API - Web APIs
rs, and can tell the user if a card has expired (or is about to expire). the browser can automatically suggest which card to use based on past usage patterns or restrictions from the merchant (e.g, "we only accept visa or mastercard"), or allow the user to say which is their default/favorite card. to request a payment, a web page creates a paymentrequest object in response to a user action that
initiates a payment, such as clicking a "purchase" button. the paymentrequest allows the web page to exchange information with the user agent while the user provides input to complete the transaction. you can find a complete guide in using the payment request api. note: the api is available inside cross-origin <iframe> elements only if they have had the allowpaymentrequest attribute set on them. ...
.... basiccardrequest defines an object structure for containing payment request details such as card type. basiccardresponse defines an object structure for payment response details such as the number/expiry date of the card used to make the payment, and the billing address. specifications specification status comment payment request api candidate recommendation
initial def
inition. basic card payment working draft defines basiccardrequest and basiccardresponse, among other things needed for handling credit card payment payment method identifiers candidate recommendation defines payment method identifiers and how they are validated, and, where applicable, minted and formally registered with the w3c. ...
PerformanceTiming.domInteractive - Web APIs
...
...usly or with custom web fonts. check if you are in one of these cases before using this property as a proxy for the user experience of a web site's speed of loading. syntax time = performancetiming.dominteractive; specifications specification status comment navigation timingthe def
inition of 'performancetiming.dominteractive' in that specification. recommendation
initial def
inition. ...
PerformanceTiming.fetchStart - Web APIs
...
...the moment, in miliseconds since the unix epoch, the browser is ready to fetch the document using an http request. this moment is before the check to any application cache. syntax time = performance.timing.fetchstart; specifications specification status comment navigation timingthe def
inition of 'performancetiming.fetchstart' in that specification. recommendation
initial def
inition. ...
PerformanceTiming.loadEventEnd - Web APIs
...
...unix epoch, when the load event handler terminated, that is when the load event is completed. if this event has not yet been sent, or is not yet completed, it returns 0. syntax time = performancetiming.loadeventend; specifications specification status comment navigation timingthe def
inition of 'performancetiming.loadeventend' in that specification. recommendation
initial def
inition. ...
PerformanceTiming.loadEventStart - Web APIs
...
...presenting the moment, in miliseconds since the unix epoch, when the load event was sent for the current document. if this event has not yet been sent, it returns 0. syntax time = performancetiming.loadeventstart; specifications specification status comment navigation timingthe def
inition of 'performancetiming.loadeventstart' in that specification. recommendation
initial def
inition. ...
PerformanceTiming.navigationStart - Web APIs
...
...ad terminates on the previous document in the same browsing context. if there is no previous document, this value will be the same as performancetiming.fetchstart. syntax time = performancetiming.navigationstart; specifications specification status comment navigation timingthe def
inition of 'performancetiming.navigationstart' in that specification. recommendation
initial def
inition. ...
PerformanceTiming.redirectEnd - Web APIs
...
..., that is when the last byte of the http response has been received. if there is no redirect, or if one of the redirect is not of the same origin, the value returned is 0. syntax time = performancetiming.redirectend; specifications specification status comment navigation timingthe def
inition of 'performancetiming.redirectend' in that specification. recommendation
initial def
inition. ...
PerformanceTiming.redirectStart - Web APIs
...
...iliseconds since the unix epoch, the first http redirect starts. if there is no redirect, or if one of the redirect is not of the same origin, the value returned is 0. syntax time = performancetiming.redirectstart; specifications specification status comment navigation timingthe def
inition of 'performancetiming.redirectstart' in that specification. recommendation
initial def
inition. ...
PerformanceTiming.secureConnectionStart - Web APIs
...
...enting the moment, in miliseconds since the unix epoch, where the secure connection handshake starts. if no such connection is requested, it returns 0. syntax time = performancetiming.secureconnectionstart; specifications specification status comment navigation timingthe def
inition of 'performancetiming.secureconnectionstart' in that specification. recommendation
initial def
inition. ...
PeriodicWave - Web APIs
the first value is the dc offset, which is the value at which the oscillator starts. 0 is good here, because we want to start the curve at the middle of the [-1.0; 1.0] range. the second and subsequent values are sine and cosine components. you can think of it as the result of a fourier transform, where you get frequency domain valu...
...urier transform should be given in ascending order (i.e. (a+bi)ei,(c+di)e2i,(f+gi)e3i\left(a+bi\right)e^{i} , \left(c+di\right)e^{2i} , \left(f+gi\right)e^{3i} etc.) and can be positive or negative. a simple way of manually obtaining such coefficients (though not the best) is to use a graphing calculator. specifications specification status comment web audio apithe def
inition of 'periodicwave' in that specification. working draft ...
PhotoCapabilities - 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchro...
...input.step = photocapabilities.imagewidth.step; return imagecapture.getphotosettings(); }) .then(photosettings => { input.value = photosettings.imagewidth; }) .catch(error => console.log('argh!', error.name || error)); specifications specification status comment mediastream image capturethe def
inition of 'photocapabilities' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung int...
PointerEvent.pointerType - Web APIs
working draft redefines mouseevent from long to double. this means that a pointereven...
...); break; case 'pen': process_pointer_pen(event); break; case 'touch': process_pointer_touch(event); break; default: console.log(`pointertype ${event.pointertype} is not suported`); } }, false); specifications specification status comment pointer eventsthe def
inition of 'pointertype' in that specification. obsolete
initial def
inition. pointer events – level 2the def
inition of 'pointertype' in that specification. recommendation non-stable version. css object model (cssom) view modulethe def
inition of 'mouseevent' in that specification. working draft redefines mouseevent from long to double. this means that a pointerevent whose pointertype is mouse will be a double. ...
PointerEvent - Web APIs
baleventhandlers.onpointerout a global event handler for the pointerout event. globaleventhandlers.onpointerleave a global event handler for the pointerleave event. example examples of each property, event type, and global event handler are included in their respective reference pages. specifications specification status comment pointer events – level 3the def
inition of 'pointerevent' in that specification. editor's draft added the getcoalescedevents() and getpredictedevents() methods and pointerrawupdate event. pointer events – level 2the def
inition of 'pointerevent' in that specification. recommendation added the twist and tangentialpressure properties. pointer eventsthe def
inition of 'pointerevent' in that specification. ...
...event' in that specification. editor's draft added the getcoalescedevents() and getpredictedevents() methods and pointerrawupdate event. pointer events – level 2the def
inition of 'pointerevent' in that specification. recommendation added the twist and tangentialpressure properties. pointer eventsthe def
inition of 'pointerevent' in that specification. obsolete
initial def
inition. ...
Multi-touch interaction - Web APIs
ementbyid(name); el.onpointerdown = pointerdown_handler; el.onpointermove = pointermove_handler; // use same handler for pointer{up,cancel,out,leave} events since // the semantics for these events - in this app - are the same. el.onpointerup = pointerup_handler; el.onpointercancel = pointerup_handler; el.onpointerout = pointerup_handler; el.onpointerleave = pointerup_handler; } function
init() { set_handlers("target1"); set_handlers("target2"); set_handlers("target3"); } pointer down the pointerdown event is fired when a pointer (mouse, pen/stylus or touch point on a touchscreen) makes contact with the contact surface. the event's state must be cached, in case this down event is part of a multi-touch interaction. in this application, when a pointer is placed down on an element...
...ove_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 pointer handling, the touch-action property is applied to the <body> element. ...
Pinch zoom gestures - Web APIs
e event state. // global vars to cache event state var evcache = new array(); var prevdiff = -1; register event handlers event handlers are registered for the following pointer events: pointerdown, pointermove and pointerup. the handler for pointerup is used for the pointercancel, pointerout and pointerleave events since these four events have the same semantics in this application. function
init() { // install event handlers for the pointer target var el=document.getelementbyid("target"); el.onpointerdown = pointerdown_handler; el.onpointermove = pointermove_handler; // use same handler for pointer{up,cancel,out,leave} events since // the semantics for these events - in this app - are the same. el.onpointerup = pointerup_handler; el.onpointercancel = pointerup_handler; el.onpoi...
...ss 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 touch behavior from overriding this application's pointer handling, the touch-action property is applied to the <body> element. ...
PositionOptions.enableHighAccuracy - Web APIs
ponse times or increased power consumption (with a gps chip on a mobile device for example). ...
... on the other hand, if false (the default value), the device can take the liberty to save resources by responding more quickly and/or using less power. syntax positionoptions.enablehighaccuracy = booleanvalue specifications specification status comment geolocation apithe def
inition of 'positionoptions.enablehighaccuracy' in that specification. recommendation
initial def
inition ...
ProgressEvent - Web APIs
f the content itself, not headers and other overhead. progressevent.total read only is an unsigned long long representing the total amount of work that the underlying process is in the progress of performing. when downloading a resource using http, this only represent the content itself, not headers and other overhead. methods also inherits methods from its parent event. progressevent.
initprogressevent()
initializes a progressevent created using the deprecated document.createevent("progressevent") method. examples the following example adds a progressevent to a new xmlhttprequest and uses it to display the status of the request. var progressbar = document.getelementbyid("p"), client = new xmlhttprequest() client.open("get", "magical-unicorns") client.onprogress = functi...
... living standard ...
PromiseRejectionEvent() - Web APIs
...
..., and the phone number of an emergency contact who should be notified. let myrejectionevent = new promiserejectionevent("unhandledrejection", { promise : mypromise, reason : "my house is on fire" }); specifications specification status comment html living standardthe def
inition of 'the promiserejectionevent interface' in that specification. living standard
initial def
inition. ...
PromiseRejectionEvent - Web APIs
...
...ion handler to deal with the rejection. examples this simple example catches unhandled promise rejections and logs them for debugging purposes. window.onunhandledrejection = function(e) { console.log(e.reason); } specifications specification status comment html living standardthe def
inition of 'promiserejectionevent' in that specification. living standard
initial def
inition. ...
Proximity Events - Web APIs
se if the object is far. ...
...y', function(event) { if (event.near) { // let's power off the screen navigator.mozpower.screenenabled = false; } else { // otherwise, let's power on the screen navigator.mozpower.screenenabled = true; } }); specifications specification status comment proximity sensorthe def
inition of 'proximity events' in that specification. working draft
initial specification ...
PublicKeyCredential.id - Web APIs
...
...(function (err) { console.error(err); }); specifications specification status comment web authentication: an api for accessing public key credentials level 1the def
inition of 'id' in that specification. recommendation specified in the context of publickeycredential. overrides the getter defined in credential. credential management level 1the def
inition of 'id' in that specification. working draft
initial def
inition. ...
PushEvent.PushEvent() - Web APIs
the pushevent() constructor creates a new pushevent object. note that the this constructor is exposed only to a service worker context. syntax var mypushevent = new pushevent(type, event
initdict); parameters type a domstring defining the type of pushevent. this can be push or pushsubscriptionchange. event
initdict optional an options object containing any
initialization data you want to populate the pushevent object with. the options are: data: the data you want the pushevent to contain, if any. ...
... pushsubscriptionchange. event
initdict optional an options object containing any
initialization data you want to populate the pushevent object with. the options are: data: the data you want the pushevent to contain, if any. when the constructor is invoked, the pushevent.data property of the resulting object will be set to a new pushmessagedata object containing bytes extracted from the event
initdict data member. example var data
init = { data : 'some sample text' } var mypushevent = new pushevent('push', data
init); mypushevent.data.text(); // should return 'some sample text' 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...
PushEvent.data - 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androi...
...age, tag: 'simple-push-demo-notification', icon: icon }); notification.addeventlistener('click', function() { if (clients.openwindow) { clients.openwindow('https://example.blog.com/2015/03/04/something-new.html'); } }); }); specifications specification status comment push apithe def
inition of 'data' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung int...
PushEvent - 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for a...
... tag: 'simple-push-demo-notification', icon: icon }); notification.addeventlistener('click', function() { if (clients.openwindow) { clients.openwindow('https://example.blog.com/2015/03/04/something-new.html'); } }); }); specifications specification status comment push apithe def
inition of 'pushevent' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung int...
PushSubscription - Web APIs
registered. ...
... reg.pushmanager.getsubscription().then(function(subscription) { subscription.unsubscribe().then(function(successful) { // you've successfully unsubscribed }).catch(function(e) { // unsubscription failed }) }) }); specifications specification status comment push apithe def
inition of 'pushsubscription' in that specification. working draft
initial def
inition ...
RTCConfiguration.certificates - Web APIs
...
...ent 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 --->>> examples specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcconfiguration.certificates' in that specification. candidate recommendation
initial def
inition. ...
RTCDTMFToneChangeEvent.RTCDTMFToneChangeEvent() - Web APIs
the rtcdtmftonechangeevent() constructor creates a new rtcdtmftonechangeevent. syntax var event = new rtcdtmftonechangeevent(type, options); parameters type a domstring containing the name of the event. this is always "tonechange". options a dictionary of type rtcdtmftonechangeevent
init, which may contain one or more of the following fields: tone a domstring containing a single dtmf tone character which has just begun to play, or an empty string ("") to indicate that the previous tone has stopped playing. see tone characters for details on what characters are permitted. return value a newly-created rtcdtmftonechangeevent, configured as specified in the provided options. tone characters the digits 0-9 these characters represent the digit keys on a telephon...
... telephone keypad. the comma (",") this character instructs the dialing process to pause for two seconds before sending the next character in the buffer. all other characters are unrecognized and will cause insertdtmf() to throw an invalidcharactererror exception. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcdtmftonechangeevent()' in that specification. candidate recommendation
initial def
inition. ...
RTCDTMFToneChangeEvent - Web APIs
rtcdtmftonechangeevent.tone read only a domstring specifying the tone which has begun playing, or an empty string ("") if the previous tone has finished playing. constructors rtcdtmftonechangeevent() returns a new rtcdtmftonechangeevent. it takes two parameters, the first being a domstring representing the type of the event (always "tonechange"); the second a dictionary containing the
initial state of the properties of the event. methods supports the methods defined in event. there are no additional methods. examples this snippet is derived loosely from the full, working example you'll find in when a tone finishes playing in using dtmf with webrtc. it appends each tone to a display box as it's played, and, once all tones have been sent, re-enabled a previously-disabled "send" ...
... previously-disabled "send" button, allowing the next dmtf string to be entered. dtmfsender.addeventlistener("change", function(event) { if (event.tone !== "") { dialstringbox.innertext += event.tone; } else { senddtmfbutton.disabled = false; } }, false); specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcdtmftonechangeevent' in that specification. candidate recommendation
initial def
inition. ...
RTCDataChannel.maxPacketLifeTime - Web APIs
...
...til it either succeeds or gives up. if not set when rtcpeerconnection.createdatachannel() was called to create the data channel, this value is null. example // tbd specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcdatachannel.maxpacketlifetime' in that specification. candidate recommendation
initial specification. ...
RTCDataChannel.negotiated - Web APIs
...
... implemented to transmit a shutdown signal to the remote peer prior to terminating the connection. if (datachannel.negotiated) { shutdownremotechannel(datachannel.id); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcdatachannel.negotiated' in that specification. candidate recommendation
initial specification. ...
RTCDataChannel.send() - Web APIs
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. ...
...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 communication between browsersthe def
inition of 'rtcdatachannel.send()' in that specification. candidate recommendation
initial specification. ...
RTCDataChannelEvent() - Web APIs
the rtcdatachannelevent() constructor creates a new rtcdatachannelevent. you will rarely if ever construct an rtcdatachannelevent by hand; these events are normally created and sent by the webrtc layer itself. syntax var event = new rtcdatachannelevent(type, rtcdatachannelevent
init); parameters type a domstring which specifies the name of the event. there is only one type of rtcdatachannelevent, so this will always be "datachannel". rtcdatachannelevent
init a rtcdatachannelevent
init dictionary, which has following fields: "channel" of type rtcdatachannel, representing the data channel being concerned by the event. "bubbles", optional, inherited from event
init. indicates if the event must bubble or not. default is false. "cancelable", optional, inherited from event
init. i...
... or not. default is false. value a new rtcdatachannelevent configured as specified. example in this example, a new datachannel event is created. dc is a data channel which already exists. var event = new rtcdatachannelevent("datachannel", {"channel": dc}); specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcdatachannelevent' in that specification. candidate recommendation
initial specification. ...
RTCError - Web APIs
the rtcerror interface describes an error which has occurred while handling webrtc operations. it's based upon the standard domexception interface that describes general dom errors. constructor rtcerror() creates and returns a new rtcerror object
initialized with the properties of the provided rtcerror
init dictionary and, optionally, a string to use as the value of the error's message property. properties in addition to the properties defined by the parent interface, domexception, rtcerror includes the following properties: errordetail read only a domstring specifying the webrtc-specific error code identifying the type of error that occurred. receivedalert read only an unsigned long integer value indicating the fatal dtls error which was received from the network. only valid ...
...e called. the above example uses addeventlistener() to add the handler for error events. you can also use the rtcdatachannel object's onerror event handler property, like this: datachannel.onerror = (event) => { let error = event.error; /* and so forth */ }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcerror' in that specification. candidate recommendation
initial def
inition. ...
RTCIceCandidate.protocol - Web APIs
...
...of tcptype to see if it's a simultaneous-open (s-o) candidate. if (candidate.protocol == "tcp") { if (candidate.tcptype == "so") { adjustforsimultaneousopen(candidate); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcicecandidate.protocol' in that specification. candidate recommendation
initial def
inition. ...
RTCIceCandidate.sdpMLineIndex - Web APIs
if you instead call rtcicecandidate() with a string parameter containing the candidate m-line text, the value of sdpmlineindex is extracted from the m-line. ...
...which media source is associated with the candidate, or null if no such association is available. note: attempting to add a candidate (using addicecandidate()) that has a value of null for either sdpmid or sdpmlineindex will throw a typeerror exception. example ... specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcicecandidate.sdpmlineindex' in that specification. candidate recommendation
initial def
inition. ...
RTCIceCandidate.sdpMid - Web APIs
tion tag of the media component with which the candidate is associated. this id uniquely identifies a given stream for the component with which the candidate is associated. this property can be configured by specifying the value of the sdpmid property when constructing the new candidate object using rtcicecandidate(). if you call the constructor with an m-line string instead of an rtcicecandidate
init object, the value of sdpmid is extracted from the specified candidate m-line string. syntax var sdpmid = rtcicecandidate.sdpmid; value a domstring which uniquely identifies the source media component from which the candidate draws data, or null if no such association exists for the candidate. note: attempting to add a candidate (using addicecandidate()) that has a value of null for either s...
...ent from which the candidate draws data, or null if no such association exists for the candidate. note: attempting to add a candidate (using addicecandidate()) that has a value of null for either sdpmid or sdpmlineindex will throw a typeerror exception. example ... specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcicecandidate.sdpmid' in that specification. candidate recommendation
initial def
inition. ...
RTCIceCandidate. toJSON() - Web APIs
the rtcicecandidate method tojson() converts the rtcicecandidate on which it's called into json in the form of an rtcicecandidate
init object. syntax json = rtcicecandidate.tojson(); return value an object conforming to the rtcicecandidate
init dictionary, whose members' values are set to the corresponding values in the rtcicecandidate object. you can then get a stringified version of the object by calling stringify() on the returned object. see the example below. example this simple example obtains a json string representing an rtcicecandidate found in the variable candidate. ...
...stringified version of the object by calling stringify() on the returned object. see the example below. example this simple example obtains a json string representing an rtcicecandidate found in the variable candidate. var jsonstring = candidate.tojson().stringify(); specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcicecandidate.tojson()' in that specification. candidate recommendation
initial def
inition. ...
RTCIceCandidate.type - Web APIs
...
...didates (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 def
inition of 'rtcicecandidate.type' in that specification. candidate recommendation
initial def
inition. ...
RTCPeerConnection.setConfiguration() - Web APIs
hen call setconfiguration() to add ice servers before ice negotiation could begin. renegotiation of the connection is needed, and a different set of ice servers needs to be used for some reason. perhaps the user has moved into a new region, so using new regional ice servers is necessary, for example. in this situation, one might call setconfiguration() to switch to new regional ice servers, then
initiate an ice restart. you cannot change the identity information for a connection once it's already been set. syntax rtcpeerconnection.setconfiguration(configuration); parameters configuration an rtcconfiguration object which provides the options to be set. the changes are not additive; instead, the new values completely replace the existing ones. exceptions invalidaccesserror one ...
...nfiguration(). ice negotiation is restarted by calling createoffer(), specifying true as the value of the icerestart option. from there, we handle the process as usual, by setting the local description to the returned offer and then sending that offer to the other peer. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'setconfiguration()' in that specification. candidate recommendation
initial def
inition. ...
RTCPeerConnectionIceErrorEvent - Web APIs
the rtcpeerconnectioniceerrorevent interface—based upon the event interface—provides details pertaining to an ice error announced by sending an icecandidateerror event to the rtcpeerconnection object. constructor rtcpeerconnectioniceerrorevent() creates and returns a new rtcpeerconnectioniceerrorevent object, with its type and other properties
initialized as specified in the parameters. you will not normally create an object of this type yourself. properties the rtcpeerconnectioniceerrorevent interface includes the properties found on the event interface, as well as the following properties: address read only a domstring providing the local ip address used to communicate with the stun or turn server being used to negotiate the connection, or null if the local ip address has n...
...ished (that is, if address is null). url read only a domstring indicating the url of the stun or turn server with which the error occurred. methods rtcpeerconnectioniceerrorevent has no methods other than any provided by the parent interface, event. examples tbd specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcpeerconnectioniceerrorevent' in that specification. candidate recommendation
initial def
inition. ...
RTCPeerConnection: idpvalidationerror event - Web APIs
...
...vent is no longer used; it was removed from the specification long ago. instead, you should watch for the rtcpeerconnection.peeridentity promise to be rejected with an operationerror. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'idpvalidationerror' in that specification. candidate recommendation
initial def
inition. ...
RTCRemoteOutboundRtpStreamStats - Web APIs
...
...estamp 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 statistics apithe def
inition of 'rtcremoteoutboundrtpstreamstats' in that specification. candidate recommendation
initial def
inition. ...
RTCRtcpParameters - Web APIs
the rtcrtcpparameters dictionary provides parameters of an rtcp connection. it's used as the value of the rtcp property of the parameters of an rtcrtpsender or rtcrtpreceiver. properties cname the canonical name (cname) being used by rtcp. this is used, for example, in sdes (sdp security descriptions) messages, described in rfc 4568. this property cannot be changed once
initialized. reducedsize a boolean value indicating whether or not reduced size rtcp is configured. if this value is true, reduced size rtcp (described in rfc 5506) is in effect. if false, compund rtcp is in use, as found in rfc 3550. this property cannot be changed once
initialized. examples this example obtains the canonical name (cname) being used for rtcp on an rtcrtpsender or rtcrtpreceiver. function getrtpcnam...
... cannot be changed once
initialized. examples this example obtains the canonical name (cname) being used for rtcp on an rtcrtpsender or rtcrtpreceiver. function getrtpcname(rtpobject) { let parameters = rtpobject.getparameters(); return parameters.rtcp.cname; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcrtcpparameters' in that specification. candidate recommendation
initial def
inition. ...
RTCRtpReceiver.getStats() - Web APIs
...
...ext to display the number of packets lost. receiver.getstats().then(function(stats) { document.getelementbyid("lostpackets").innertext = stats.packetslost; }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcrtpreceiver.getstats()' in that specification. candidate recommendation
initial specification. ...
RTCRtpReceiver.getSynchronizationSources() - Web APIs
...
...estamp, source, and audiolevel. the synchronization source objects add a voiceactivityflag property, which indicates if the last rtp packet received contained voice activity. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'getsynchronizationsources()' in that specification. candidate recommendation
initial def
inition. ...
RTCRtpSender.getParameters() - Web APIs
...
...ing inadvertently overwriting parameters with older parameters. function getsendertransactionid(sender) { let parameters = sender.getparameters(); return parameters.transactionid; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'getparameters()' in that specification. candidate recommendation
initial def
inition. ...
RTCRtpSender.getStats() - Web APIs
...
...t round trip time for requests on the sender. sender.getstats().then(function(stats) { document.getelementbyid("currentrtt").innertext = stats.roundtriptime; }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcrtpsender.getstats()' in that specification. candidate recommendation
initial specification. ...
RTCRtpStreamStats.trackId - Web APIs
...
...ckstats object that provides statistics for the track for which statistics are being collected by this rtcstatsreport. note: this value is not the same as the value of mediastramtrack.id. specifications specification status comment identifiers for webrtc's statistics apithe def
inition of 'rtcrtpstreamstats.trackid' in that specification. candidate recommendation
initial def
inition. ...
RTCRtpSynchronizationSource.voiceActivityFlag - Web APIs
...
...false if voice activity is not present. this property is omitted entirely if voice activity detection is not enabled on the source, or if the rfc 6464 extension header isn't present. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'voiceactivityflag' in that specification. candidate recommendation
initial def
inition. ...
RTCSessionDescription.type - Web APIs
the property rtcsessiondescription.type is a read-only value of type rtcsdptype which describes the description's type. syntax var value = sessiondescription.type; sessiondescription.type = value; value the possible values are defined by an enum of type rtcsdptype. the allowed values are those of an enum of type rtcsdptype: "offer", the description is the
initial proposal in an offer/answer exchange. "answer", the description is the def
initive choice in an offer/answer exchange. "pranswer", the description is a provisional answer and may be changed when the def
initive choice will be given. "rollback", the description rolls back to offer/answer state to the last stable state. example // the remote description has been set previously on pc, a rtcpeerconnection alert(pc.remoted...
...y be changed when the def
initive choice will be given. "rollback", the description rolls back to offer/answer state to the last stable state. example // the remote description has been set previously on pc, a rtcpeerconnection alert(pc.remotedescription.type); specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcsessiondescription.type' in that specification. candidate recommendation
initial specification. ...
RTCSessionDescriptionCallback - Web APIs
he deprecated callback-based version of createoffer() or createanswer() when using them to create offers or answers. because this function type is part of the legacy webrtc api, you should avoid using it (and the callback-based forms of createoffer() and createanswer() that make use of it). syntax rtcsessiondescriptioncallback(description); parameters description an rtcsessiondescription
init (or rtcsessiondescription) object describing the session being offered or being accepted. this object contains the type and sdp properties which are part of rtcsessiondescription. return value the callback doesn't need to return anything, so the return value is undefined. example var pc = new rtcpeerconnection(); var descriptioncallback = function(offer) { pc.setlocaldescription(offer); } ...
...ndescription. return value the callback doesn't need to return anything, so the return value is undefined. example var pc = new rtcpeerconnection(); var descriptioncallback = function(offer) { pc.setlocaldescription(offer); } pc.createoffer(descriptioncallback); specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcsessiondescriptioncallback' in that specification. candidate recommendation
initial def
inition. ...
RTCStatsIceCandidatePairState - Web APIs
but failed. a failure can occur either because no response was received or because the response indicated that an unrecoverable error occurred. frozen no check has been performed yet for this candidate pair, and performing the check is blocked until another check is successful. once that check has succeeded, this pair will unfreeze and move into the waiting state. in-progress a check has been
initiated for this pair, but the check's transaction is still in progress. succeeded a check for this pair has been completed successfully. waiting this pair has not yet been checked, but the check can be performed as soon as this pair is the highest priority pair remaining in the waiting state. specifications specification status comment identifiers for webrtc's sta...
...r, but the check's transaction is still in progress. succeeded a check for this pair has been completed successfully. waiting this pair has not yet been checked, but the check can be performed as soon as this pair is the highest priority pair remaining in the waiting state. specifications specification status comment identifiers for webrtc's statistics apithe def
inition of 'rtcstatsicecandidatepairstate' in that specification. candidate recommendation
initial specification. ...
RTCStatsType - Web APIs
...
...ncluded are the media level metrics that go along with the track. transport an object that contains statistics related to a transport for an rtcpeerconnection. the object is of type rtctransportstats. specifications specification status comment identifiers for webrtc's statistics apithe def
inition of 'rtcstatstype' in that specification. candidate recommendation
initial def
inition. ...
RTCTrackEvent() - Web APIs
new rtctrackevent object, configured to describe the track which has been added to the rtcpeerconnection. in general, you won't need to use this constructor, as rtctrackevent objects are created by webrtc and delivered to your rtcpeerconnector's ontrack event handler as appropriate. syntax trackevent = new rtctrackevent(eventinfo); parameters eventinfo an object based on the rtctrackevent
init dictionary, providing information about the track which has been added to the rtcpeerconnection. this object has the following properties: receiver the rtcrtpreceiver which is being used to receive the track's media. streams optional an array of mediastream objects representing each of the streams that comprise the event's corresponding track. track the mediastreamtrack the event is associa...
...comprise the event's corresponding track. track the mediastreamtrack the event is associated with. transceiver the rtcrtptransceiver associated with the event. return value a new rtctrackevent describing a track which has been added to the rtcpeerconnection. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtctrackevent()' in that specification. candidate recommendation
initial specification. ...
RTCTrackEvent.receiver - Web APIs
...
...m for use by the track associated with the rtctrackevent. note: the transceiver includes its own receiver property, which will always be the same rtcrtpreceiver as this one. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtctrackevent.receiver' in that specification. candidate recommendation
initial specification. ...
RTCTrackEvent.streams - Web APIs
...
...e track being added to the rtcpeerconnection. syntax var streams = trackevent.streams; value an array of mediastream objects, one for each stream that make up the new track. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtctrackevent.streams' in that specification. candidate recommendation
initial specification. ...
RTCTrackEvent.track - Web APIs
...
...that has been added to the rtcpeerconnection. syntax var track = trackevent.track; value a mediastreamtrack indicating the track which has been added to the rtcpeerconnection. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtctrackevent.track' in that specification. candidate recommendation
initial specification. ...
RTCTrackEvent - Web APIs
en a new mediastreamtrack is added to an rtcrtpreceiver which is part of the rtcpeerconnection. the target is the rtcpeerconnection object to which the track is being added. this event is sent by the webrtc layer to the web site or application, so you will not typically need to instantiate an rtctrackevent yourself. constructor rtctrackevent() creates and returns a new rtctrackevent object,
initialized with properties taken from the specified rtctrackevent
init dictionary. you will probably not need to create new track events yourself, since they're typically created by the webrtc infrastructure and sent to the connection's ontrack event handler. properties since rtctrackevent is based on event, its properties are also available. receiver read only the rtcrtpreceiver used by the t...
...e <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 specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtctrackevent' in that specification. candidate recommendation
initial specification. ...
Range.commonAncestorContainer - Web APIs
...
... = el.parentnode; } el.classlist.remove('highlight'); settimeout(() => { el.classlist.add('highlight'); }, 0); } result specifications specification status comment domthe def
inition of 'range.commonancestorcontainer' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.commonancestorcontainer' in that specification. obsolete
initial specification. ...
Range.extractContents() - Web APIs
...
...tnode === list2) { const documentfragment = range.extractcontents(); list1.appendchild(documentfragment); } } }); result specifications specification status comment domthe def
inition of 'range.extractcontents()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.extractcontents()' in that specification. obsolete
initial specification. ...
Range.insertNode() - Web APIs
); parameters newnode the node to insert at the start of the range. ...
...ild(document.createtextnode("new node inserted here")); range.selectnode(document.getelementsbytagname("div").item(0)); range.insertnode(newnode); specifications specification status comment domthe def
inition of 'range.insertnode()' in that specification. living standard no change document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.insertnode()' in that specification. obsolete
initial def
inition ...
Range.selectNodeContents() - Web APIs
...
...; deselectbutton.addeventlistener('click', e => { const selection = window.getselection(); selection.removeallranges(); }); result specifications specification status comment domthe def
inition of 'range.selectnodecontents()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.selectnodecontents()' in that specification. obsolete
initial specification. ...
Range - Web APIs
a list of domrect objects that aggregates the results of element.getclientrects() for all the elements in the range. range.intersectsnode() returns a boolean indicating whether the given node intersects the range. range.ispointinrange() returns a boolean indicating whether the given point is in the range. specifications specification status comment domthe def
inition of 'range' in that specification. living standard do not use rangeexception anymore, use domexception instead. made the second parameter of collapse() optional. added the methods ispointinrange(), comparepoint(), and intersectsnode(). added the constructor range(). dom parsing and serializationthe def
inition of 'extensions to range' in that specification. working ...
...ption instead. made the second parameter of collapse() optional. added the methods ispointinrange(), comparepoint(), and intersectsnode(). added the constructor range(). dom parsing and serializationthe def
inition of 'extensions to range' in that specification. working draft added the method createcontextualfragment(). css object model (cssom) view modulethe def
inition of 'extensions to range' in that specification. working draft added the methods getclientrects() and getboundingclientrect(). document object model (dom) level 2 traversal and range specificationthe def
inition of 'range' in that specification. obsolete
initial specification. ...
ReadableByteStreamController.byobRequest - Web APIs
...
...r interface returns the current byob pull request, or undefined if there are no pending requests. syntax var request = readablebytestreamcontroller.byobrequest; value a readablestreambyobrequest object instance, or undefined. examples tbd. specifications specification status comment streamsthe def
inition of 'byobrequest' in that specification. living standard
initial def
inition. ...
ReadableByteStreamController.desiredSize - Web APIs
...
...r interface returns the desired size required to fill the stream's internal queue. syntax var desiredsize = readablebytestreamcontroller.desiredsize; value an integer. note that this can be negative if the queue is over-full. examples tbd. specifications specification status comment streamsthe def
inition of 'desiredsize' in that specification. living standard
initial def
inition. ...
ReadableStream.getReader() - Web APIs
...
...ntent = 'received ' + charsreceived + ' characters so far. current chunk = ' + chunk; list2.appendchild(listitem); result += chunk; // read some more, and call this function again return reader.read().then(processtext); }); } specifications specification status comment streamsthe def
inition of 'getreader()' in that specification. living standard
initial def
inition. ...
ReadableStream.tee() - Web APIs
...
...lement('li'); listitem.textcontent = 'read ' + charsreceived + ' characters so far. current chunk = ' + chunk; list.appendchild(listitem); // read some more, and call this function again return reader.read().then(processtext); }); } specifications specification status comment streamsthe def
inition of 'tee()' in that specification. living standard
initial def
inition. ...
ReadableStreamBYOBReader.cancel() - Web APIs
...
...eadable reason for the cancellation. return value a promise, which fulfills with the value given in the reason parameter. exceptions typeerror the source object is not a readablestreambyobreader, or the stream has no owner. examples tbd. specifications specification status comment streamsthe def
inition of 'cancel()' in that specification. living standard
initial def
inition. ...
ReadableStreamBYOBRequest.respond() - Web APIs
...
...en); parameters byteswritten xxx return value void. exceptions typeerror the source object is not a readablestreambyobrequest, or there is no associated controller, or the associated internal array buffer is detached. examples tbd. specifications specification status comment streamsthe def
inition of 'respond()' in that specification. living standard
initial def
inition. ...
ReadableStreamBYOBRequest.respondWithNewView() - Web APIs
...
... view xxx return value void. exceptions typeerror the source object is not a readablestreambyobrequest, or there is no associated controller, or the associated internal array buffer is non-existant or detached. examples tbd. specifications specification status comment streamsthe def
inition of 'respondwithnewview()' in that specification. living standard
initial def
inition. ...
ReadableStreamBYOBRequest.view - Web APIs
...
...of the readablestreambyobrequest interface returns the current view. syntax var view = readablestreambyobrequestinstance.view; value a typed array representing the destination region to which the controller can write generated data. examples tbd. specifications specification status comment streamsthe def
inition of 'view' in that specification. living standard
initial def
inition. ...
ReadableStreamDefaultReader.ReadableStreamDefaultReader() - Web APIs
...
...' + charsreceived + ' characters so far. current chunk = ' + chunk; list2.appendchild(listitem); result += chunk; // read some more, and call this function again return reader.read().then(processtext); }); } specifications specification status comment streamsthe def
inition of 'readablestreamdefaultreader()' in that specification. living standard
initial def
inition. ...
ReadableStreamDefaultReader.cancel() - Web APIs
...
...tcontent = 'received ' + charsreceived + ' characters so far. current chunk = ' + chunk; list2.appendchild(listitem); result += chunk; // read some more, and call this function again return reader.read().then(processtext); }); } specifications specification status comment streamsthe def
inition of 'cancel()' in that specification. living standard
initial def
inition. ...
RelativeOrientationSensor - Web APIs
...
...f (results.every(result => result.state === "granted")) { sensor.start(); ... } else { console.log("no permissions to use relativeorientationsensor."); } }); specifications specification status comment orientation sensorthe def
inition of 'relativeorientationsensor' in that specification. candidate recommendation
initial def
inition. ...
ReportingObserver - Web APIs
...
... getusermedia() method twice. after the first time we call reportingobserver.takerecords(), which returns the first generated report and empties the queue. because of this, when the button is pressed only the second report is listed. specifications specification status comment reporting apithe def
inition of 'reportingobserver' in that specification. editor's draft
initial def
inition. ...
Request.clone() - Web APIs
n. ...
...sing the request.request() constructor (for an image file in the same directory as the script), then clone the request. var myrequest = new request('flowers.jpg'); var newrequest = myrequest.clone(); // a copy of the request is now stored in newrequest specifications specification status comment fetchthe def
inition of 'clone' in that specification. living standard
initial def
inition ...
Request.destination - Web APIs
et". ...
... the request() constructor (for an image file in the same directory as the script), then save the request's destination: var myrequest = new request('flowers.jpg'); var mydestination = myrequest.destination; // returns the empty string by default specifications specification status comment fetchthe def
inition of 'destination' in that specification. living standard
initial def
inition ...
Request.headers - Web APIs
mple in the following snippet, we create a new request using the request.request() constructor (for an image file in the same directory as the script), then save the request headers in a variable: var myrequest = new request('flowers.jpg'); var myheaders = myrequest.headers; // headers {} to add a header to the headers object we use headers.append; we then create a new request along with a 2nd
init parameter, passing headers in as an
init option: var myheaders = new headers(); myheaders.append('content-type', 'image/jpeg'); var my
init = { method: 'get', headers: myheaders, mode: 'cors', cache: 'default' }; var myrequest = new request('flowers.jpg', my
init); mycontenttype = myrequest.headers.get('content-type'); // returns 'image/jpeg' specifications specification s...
...nit option: var myheaders = new headers(); myheaders.append('content-type', 'image/jpeg'); var my
init = { method: 'get', headers: myheaders, mode: 'cors', cache: 'default' }; var myrequest = new request('flowers.jpg', my
init); mycontenttype = myrequest.headers.get('content-type'); // returns 'image/jpeg' specifications specification status comment fetchthe def
inition of 'headers' in that specification. living standard
initial def
inition ...
Request.integrity - Web APIs
he property returns ''. ...
...e a new request using the request.request() constructor (for an image file in the same directory as the script), then save the request integrity value in a variable: var myrequest = new request('flowers.jpg'); var myintegrity = myrequest.integrity; specifications specification status comment fetchthe def
inition of 'integrity' in that specification. living standard
initial def
inition ...
Request.method - Web APIs
e method of the request. ...
...reate a new request using the request.request() constructor (for an image file in the same directory as the script), then save the method of the request in a variable: var myrequest = new request('flowers.jpg'); var mymethod = myrequest.method; // get specifications specification status comment fetchthe def
inition of 'method' in that specification. living standard
initial def
inition ...
Request.redirect - Web APIs
s the default value of follow. ...
...we create a new request using the request.request() constructor (for an image file in the same directory as the script), then save the request redirect value in a variable: var myrequest = new request('flowers.jpg'); var mycred = myrequest.redirect; specifications specification status comment fetchthe def
inition of 'redirect' in that specification. living standard
initial def
inition ...
Request - Web APIs
od; const credentials = request.credentials; you could then fetch this request by passing the request object in as a parameter to a windoworworkerglobalscope.fetch() call, for example: fetch(request) .then(response => response.blob()) .then(blob => { image.src = url.createobjecturl(blob); }); in the following snippet, we create a new request using the request() constructor with some
initial data and body content for an api request which need a body payload: const request = new request('https://example.com', {method: 'post', body: '{"foo": "bar"}'}); const url = request.url; const method = request.method; const credentials = request.credentials; const bodyused = request.bodyused; note: the body type can only be a blob, buffersource, formdata, urlsearchparams, usvstring or rea...
...esponse: fetch(request) .then(response => { if (response.status === 200) { return response.json(); } else { throw new error('something went wrong on api server!'); } }) .then(response => { console.debug(response); // ... }).catch(error => { console.error(error); }); specifications specification status comment fetchthe def
inition of 'request' in that specification. living standard
initial def
inition ...
ResizeObserver.disconnect() - Web APIs
...
...ce unobserves all observed element or svgelement targets. syntax resizeobserver.disconnect(); parameters none. return value void. exceptions none. examples btn.addeventlistener('click', () => { resizeobserver.disconnect(); }) specifications specification status comment resize observerthe def
inition of 'disconnect()' in that specification. editor's draft
initial def
inition. ...
Resource Timing API - Web APIs
, <svg>, image, or script. the interface's properties create a resource loading timeline with high-resolution timestamps for network events such as redirect start and end times, dns lookup start and end times, request start, response start and end times, etc. the interface also includes other properties that provide data about the size of the fetched resource as well as the type of resource that
initiated the fetch. this document provides an overview of the resource timing interfaces. for more details about the interfaces including examples see each interface's reference page, using the resource timing api, and the references in the see also section. for a graphical representation of the resource timing processing model see the resource timing phases figure. the performanceresourcetiming in...
...rty 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" 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...
Response.redirected - Web APIs
direct"; } else { elem.innerhtml = ""; } return response.blob(); }).then(function(imageblob) { let imgobjecturl = url.createobjecturl(imageblob); document.getelementbyid("img-element-id").src = imgobjecturl; }); disallowing redirects because using redirected to manually filter out redirects can allow forgery of redirects, you should instead set the redirect mode to "error" in the
init parameter when calling fetch(), like this: fetch("awesome-picture.jpg", { redirect: "error" }).then(function(response) { return response.blob(); }).then(function(imageblob) { let imgobjecturl = url.createobjecturl(imageblob); document.getelementbyid("img-element-id").src = imgobjecturl; }); specifications specification status comment fetchthe def
inition of 'redire...
..."awesome-picture.jpg", { redirect: "error" }).then(function(response) { return response.blob(); }).then(function(imageblob) { let imgobjecturl = url.createobjecturl(imageblob); document.getelementbyid("img-element-id").src = imgobjecturl; }); specifications specification status comment fetchthe def
inition of 'redirected' in that specification. living standard
initial def
inition ...
Response.status - Web APIs
sole. ...
...t = new request('flowers.jpg'); fetch(myrequest).then(function(response) { console.log(response.status); // returns 200 response.blob().then(function(myblob) { var objecturl = url.createobjecturl(myblob); myimage.src = objecturl; }); }); specifications specification status comment fetchthe def
inition of 'status' in that specification. living standard
initial def
inition ...
SVGAnimationElement: beginEvent event - Web APIs
cancelable no interface timeevent event handler property onbegin examples animated circle <svg xmlns="http://www.w3.org/2000/svg" width="300px" height="100px"> <title>svg smil animate with path</title> <circle cx="0" cy="50" r="50" fill="blue" stroke="black" stroke-width="1"> <animatemotion path="m 0 0 h 300 z" dur="5s" repeatcount="indef
inite" /> </circle> </svg> <hr> <ul> </ul> ul { height: 100px; border: 1px solid #ddd; overflow-y: scroll; padding: 10px 30px; } let svgelem = document.queryselector('svg'); let animateelem = document.queryselector('animatemotion'); let list = document.queryselector('ul'); animateelem.addeventlistener('beginevent', () => { let listitem = document.createelement('li'); listitem.text...
...etail; } listitem.textcontent = msg; list.appendchild(listitem); }) event handler property equivalent note that you can also create an event listener for the begin event using the onbegin event handler property: animateelem.onbegin = () => { console.log('beginevent fired'); } specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'beginevent' in that specification. candidate recommendation
initial def
inition ...
SVGAnimationElement: endEvent event - Web APIs
cancelable no interface timeevent event handler property onend examples animated circle <svg xmlns="http://www.w3.org/2000/svg" width="300px" height="100px"> <title>svg smil animate with path</title> <circle cx="0" cy="50" r="50" fill="blue" stroke="black" stroke-width="1"> <animatemotion path="m 0 0 h 300 z" dur="5s" repeatcount="indef
inite" /> </circle> </svg> <hr> <button>stop animation</button> <ul> </ul> ul { height: 100px; border: 1px solid #ddd; overflow-y: scroll; padding: 10px 30px; } let svgelem = document.queryselector('svg'); let animateelem = document.queryselector('animatemotion'); let list = document.queryselector('ul'); let btn = document.queryselector('button'); animateelem.addeventlistener('beginev...
... () => { btn.disabled = true; animateelem.setattribute('repeatcount', '1'); }) event handler property equivalent note that you can also create an event listener for the end event using the onend event handler property: animateelem.onend = () => { console.log('endevent fired'); } specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'endevent' in that specification. candidate recommendation
initial def
inition ...
SVGAnimationElement: repeatEvent event - Web APIs
cancelable no interface timeevent event handler property onrepeat examples animated circle <svg xmlns="http://www.w3.org/2000/svg" width="300px" height="100px"> <title>svg smil animate with path</title> <circle cx="0" cy="50" r="50" fill="blue" stroke="black" stroke-width="1"> <animatemotion path="m 0 0 h 300 z" dur="5s" repeatcount="indef
inite" /> </circle> </svg> <hr> <ul> </ul> ul { height: 100px; border: 1px solid #ddd; overflow-y: scroll; padding: 10px 30px; } let svgelem = document.queryselector('svg'); let animateelem = document.queryselector('animatemotion'); let list = document.queryselector('ul'); animateelem.addeventlistener('beginevent', () => { let listitem = document.createelement('li'); listitem.textc...
...l; } listitem.textcontent = msg; list.appendchild(listitem); }) event handler property equivalent note that you can also create an event listener for the repeat event using the onrepeat event handler property: animateelem.onrepeat = () => { console.log('repeatevent fired'); } specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'repeatevent' in that specification. candidate recommendation
initial def
inition ...
cx - Web APIs
inate of the circleʼs center. ...
...0" fill="gold" id="circle"/> </svg> javascript const circle = document.getelementbyid('circle'); console.log(circle.cx); specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgcircleelement.cx' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgcircleelement.cx' in that specification. recommendation
initial def
inition ...
cy - Web APIs
inate of the circleʼs center. ...
...0" fill="gold" id="circle"/> </svg> javascript const circle = document.getelementbyid('circle'); console.log(circle.cy); specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgcircleelement.cy' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgcircleelement.cy' in that specification. recommendation
initial def
inition ...
r - Web APIs
senting the radius of the circle. ...
..."50" fill="gold" id="circle"/> </svg> javascript const circle = document.getelementbyid('circle'); console.log(circle.r); specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svgcircleelement.r' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgcircleelement.r' in that specification. recommendation
initial def
inition ...
SVGCircleElement - Web APIs
> 0.5 ? 10 : -10; // clamp the circle radius to a minimum of 10 and a maximum of 250, // so it won't disappear or get bigger than the viewport var newvalue = math.min(math.max(circle.r.baseval.value + change, 10), 250); circle.setattribute("r", newvalue); } click on the circle. ...
...ons specification status comment scalable vector graphics (svg) 2the def
inition of 'svgcircleelement' in that specification. candidate recommendation replaced the inheritance from svgelement, svgtests, svglangspace, svgexternalresourcesrequired, svgstylable, and svgtransformable by svggeometryelement scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'svgcircleelement' in that specification. recommendation
initial def
inition 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome...
SVGElement: error event - Web APIs
on. this basically implements the standard error dom event. ...
...bbles yes cancelable no interface svgevent event handler property onerror examples svgelem.addeventlistener('error', () => { console.log('svg not loaded properly.'); }) specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'error' in that specification. candidate recommendation
initial def
inition ...
SVGElement: resize event - Web APIs
taken place. this basically implements the standard resize dom event. ...
... no cancelable no interface svgevent event handler property onresize examples svgelem.addeventlistener('resize', () => { console.log('svg resized.'); }) specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'event changes in svg2' in that specification. candidate recommendation
initial def
inition ...
SVGElement: scroll event - Web APIs
nd/or y axes. this basically implements the standard scroll dom event. ...
... no cancelable no interface svgevent event handler property onscroll examples svgelem.addeventlistener('scroll', () => { console.log('svg scrolled.'); }) specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'event changes in svg2' in that specification. candidate recommendation
initial def
inition ...
SVGElement: unload event - Web APIs
the dom implementation removes an svg document from a window or frame. ...
... bubbles no cancelable no interface svgevent event handler property onunload examples svgelem.addeventlistener('unload', () => { console.log('svg unloaded.'); }) specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'unload' in that specification. candidate recommendation
initial def
inition ...
SVGFEDropShadowElement - Web APIs
nt of the stddeviationy attribute of the given element. ...
...ce also inherits methods of its parent, svgelement, and also implements methods of svgfilterprimitivestandardattributes. svgfedropshadowelement.setstddeviation() sets the values for the stddeviation attribute. specifications specification status comment filter effects module level 1the def
inition of 'svgfedropshadowelement' in that specification. working draft
initial def
inition ...
SVGGeometryElement.isPointInFill() - Web APIs
yelement.ispointinfill() method determines whether a given point is within the fill shape of an element. normal hit testing rules apply; the value of the pointer-events property on the element determines whether a point is considered to be within the fill. the point argument is interpreted as a point in the local coordiante system of the element. syntax boolean someelement.ispointinfill(dompoint
init point); parameters point a dompoint
init interpreted as a point in the local coordiante system of the element. return value a boolean indicating whether the given point is within the fill or not. example svg <svg viewbox="0 0 100 100" width="150" height="150" xmlns="http://www.w3.org/2000/svg"> <circle id="circle" cx="50" cy="50" r="45" fill="white" stroke="black" stroke-wi...
...ill="seagreen"/> </svg> javascript var circle = document.getelementbyid('circle'); // point not in circle console.log('point at 10,10:', circle.ispointinfill(new dompoint(10, 10))); // point in circle console.log('point at 40,30:', circle.ispointinfill(new dompoint(40, 30))); result specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svggeometryelement.ispointinfill()' in that specification. candidate recommendation
initial def
inition ...
SVGGeometryElement.isPointInStroke() - Web APIs
.ispointinstroke() method determines whether a given point is within the stroke shape of an element. normal hit testing rules apply; the value of the pointer-events property on the element determines whether a point is considered to be within the stroke. the point argument is interpreted as a point in the local coordiante system of the element. syntax boolean someelement.ispointinstroke(dompoint
init point); parameters point a dompoint
init interpreted as a point in the local coordinate system of the element. return value a boolean indicating whether the given point is within the stroke or not. example svg <svg viewbox="0 0 100 100" width="150" height="150" xmlns="http://www.w3.org/2000/svg"> <circle id="circle" cx="50" cy="50" r="45" fill="white" stroke="black" stroke-...
...int at 10,10:', circle.ispointinstroke(new dompoint(10, 10))); // point in circle but not stroke console.log('point at 40,30:', circle.ispointinstroke(new dompoint(40, 30))); // point in circle stroke console.log('point at 83,17:', circle.ispointinstroke(new dompoint(83, 17))); result specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svggeometryelement.ispointinstroke()' in that specification. candidate recommendation
initial def
inition ...
SVGGraphicsElement: copy event - Web APIs
bubbles yes cancelable yes interface clipboardevent event handler property oncopy the event's default action is to copy the selection (if any) to the clipboard. a handler for this event can modify the clipboard contents by calling setdata(format, data) on the event's clipboardevent.clipboarddata property, and cancelling the event's default action using event.preventdefault(). however, the handler cannot read the clipboard data. it's possible to construct and dispatch a synthetic copy event, but this will not affect the system clipboard. ...
...: border-box; border: 1px solid black; } javascript document.getelementsbytagname("text")[0].addeventlistener("copy", evt => { evt.clipboarddata.setdata('text/plain', document.getselection().tostring().touppercase()); evt.preventdefault(); }); result specifications specification status comment scalable vector graphics (svg) 2 candidate recommendation def
inition that the clipboard events apply to svg elements. clipboard api and events working draft
initial def
inition ...
SVGGraphicsElement: paste event - Web APIs
bubbles yes cancelable yes interface clipboardevent event handler property onpaste if the cursor is in an editable context (for example, in a <textarea> or an element with contenteditable attribute set to true) then the default action is to insert the contents of the clipboard into the document at the cursor position. a handler for this event can access the clipboard contents by calling getdata() on the event's clipboarddata property. ...
... border-box; border: 1px solid black; } javascript document.getelementbyid("element-to-paste-text").addeventlistener("paste", evt => { evt.target.textcontent = evt.clipboarddata.getdata("text/plain").touppercase(); evt.preventdefault(); }); result specifications specification status comment scalable vector graphics (svg) 2 candidate recommendation def
inition that the clipboard events apply to svg elements. clipboard api and events working draft
initial def
inition ...
SVGGraphicsElement - Web APIs
rent element's coordinate system to its svg viewport's coordinate system. ...
...element.getscreenctm() returns a dommatrix representing the matrix that transforms the current element's coordinate system to the coordinate system of the svg viewport for the svg document fragment. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'svggraphicselement' in that specification. candidate recommendation
initial def
inition ...
SVGLengthList - Web APIs
nes a list of svglength objects. an svglengthlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...s in the list. methods name & arguments return description clear() void clears all existing current items from the list, with the result being an empty 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.
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.
SVGNumberList - Web APIs
a list of svgnumber objects. an svgnumberlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. note: starting in gecko 5.0,the svgnumberlist dom interface is now indexable and can be accessed like arrays. ...
...the list. methods name & arguments return description clear() void clears all existing current items from the list, with the result being an empty 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.
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. ...
SVGPathSegList - Web APIs
svg path segment list interface this interface defines a list of svgpathseg objects. ...
... methods clear() void clears all existing current items from the list, with the result being an empty list. exceptions: a domexception with 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 val...
SVGPointList - Web APIs
ce the svgpointlist defines a list of svgpoint objects. an svgpointlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
... clear() void clears all existing current items from the list, with the result being an empty 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.
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 inserte...
SVGStringList - Web APIs
svg string list interface the svgstringlist defines a list of domstring objects. an svgstringlist object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...rfaces. methods name & arguments return description clear() void clears all existing current items from the list, with the result being an empty 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.
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...
Screen.unlockOrientation() - Web APIs
couldn't be unlocked. ...
...tation || screen.mozunlockorientation || screen.msunlockorientation || (screen.orientation && screen.orientation.unlock); if (unlockorientation()) { // orientation was unlocked } else { // orientation unlock failed } specifications specification status comment screen orientation apithe def
inition of 'lockorientation()' in that specification. working draft
initial def
inition (not present in the draft anymore) ...
Sensor.onerror - Web APIs
...
... interfaces of the sensor interface. syntax sensorinstance.onerror = function sensorinstance.addeventlistener('error', function() { ... }) because sensor is a base class, onerror may only be used on one of its derived classes. specifications specification status comment generic sensor apithe def
inition of 'onerror' in that specification. candidate recommendation
initial def
inition. ...
Sensor.timestamp - Web APIs
...
...returns the time stamp of the latest sensor reading. syntax var timestamp = sensorinstance.timestamp because sensor is a base class, timestamp may only be read from one of its derived classes. value a domhighrestimestamp. specifications specification status comment generic sensor apithe def
inition of 'timestamp' in that specification. candidate recommendation
initial def
inition. ...
ServiceWorker.state - Web APIs
the state read-only property of the serviceworker interface returns a string representing the current state of the service worker. it can be one of the following values: installing, installed, activating, activated, or redundant. syntax someurl = serviceworker.state value a serviceworkerstate def
inition (see the spec.) examples this code snippet is from the service worker registration-events sample (live demo). the code listens for any change in the serviceworker.state and returns its value. var serviceworker; if (registration.installing) { serviceworker = registration.installing; document.queryselector('#kind').textcontent = 'installing'; } else if (registration.waiting) { serviceworker = registration.waiting; document.queryselector('#kind').textcontent = 'waiting'; } else if...
...tcontent = 'waiting'; } else if (registration.active) { serviceworker = registration.active; document.queryselector('#kind').textcontent = 'active'; } if (serviceworker) { logstate(serviceworker.state); serviceworker.addeventlistener('statechange', function(e) { logstate(e.target.state); }); } specifications specification status comment service workersthe def
inition of 'state' in that specification. working draft
initial def
inition ...
ServiceWorker - Web APIs
...
...(function (error) { // something went wrong during registration. the service-worker.js file // might be unavailable or contain a syntax error. }); } else { // the current browser doesn't support service workers. } specifications specification status comment service workersthe def
inition of 'serviceworker' in that specification. working draft
initial def
inition. ...
ServiceWorkerContainer.controller - Web APIs
control. ...
... controlled by: ${navigator.serviceworker.controller}`); } else { console.log('this page is not currently controlled by a service worker.'); } } else { console.log('service workers are not supported.'); } specifications specification status comment service workersthe def
inition of 'serviceworkerregistration.controller' in that specification. working draft
initial def
inition ...
ServiceWorkerContainer.oncontrollerchange - Web APIs
...
... occurs — when the document's associated serviceworkerregistration acquires a new active worker. syntax serviceworkercontainer.oncontrollerchange = function(controllerchangeevent) { ... } example // tbd specifications specification status comment service workersthe def
inition of 'serviceworkercontainer: oncontrollerchange' in that specification. working draft
initial def
inition. ...
ServiceWorkerContainer.startMessages() - Web APIs
...
...sw.js') .then(function() { console.log('service worker registered'); }); } // ... navigator.serviceworker.addeventlistener('message', (e) => { // ... }); navigator.serviceworker.startmessages(); specifications specification status comment service workersthe def
inition of 'serviceworkercontainer: startmessages()' in that specification. working draft
initial def
inition. ...
ServiceWorkerContainer - Web APIs
worker object if its state is activated (the same object returned by serviceworkerregistration.active). this property returns null during a force-refresh request (shift + refresh) or if there is no active worker. serviceworkercontainer.ready read only provides a way of delaying code execution until a service worker is active. it returns a promise that will never reject, and which waits indef
initely until the serviceworkerregistration associated with the current page has an serviceworkerregistration.active worker. once that condition is met, it resolves with the serviceworkerregistration. events controllerchange occurs when the document's associated serviceworkerregistration acquires a new active worker. also available via the serviceworkercontainer.oncontrollerchange property. er...
...hen, register a handler to detect when a new or // updated service worker takes control. navigator.serviceworker.oncontrollerchange = function() { console.log('this page is now controlled by:', navigator.serviceworker.controller); }; } else { console.log('service workers are not supported.'); } specifications specification status comment service workersthe def
inition of 'serviceworkercontainer' in that specification. working draft
initial def
inition. ...
ServiceWorkerGlobalScope.clients - Web APIs
...
...y property of the serviceworkerglobalscope interface returns the clients object associated with the service worker. syntax swclients = self.clients value the clients object associated with the specific worker. specifications specification status comment service workersthe def
inition of 'serviceworkerregistration.clients' in that specification. working draft
initial def
inition. ...
ServiceWorkerGlobalScope.onactivate - Web APIs
ate event handler to upgrade a cache. ...
..., function(event) { var cachewhitelist = ['v2']; event.waituntil( caches.foreach(function(cache, cachename) { if (cachewhitelist.indexof(cachename) == -1) { return caches.delete(cachename); } }) ); }); specifications specification status comment service workersthe def
inition of 'event handlers' in that specification. working draft
initial def
inition ...
ServiceWorkerGlobalScope.registration - Web APIs
...
...turns a reference to the serviceworkerregistration object, which represents the service worker's registration. syntax serviceworkerregistration = self.registration value a serviceworkerregistration object. specifications specification status comment service workersthe def
inition of 'serviceworkerglobalscope.registration' in that specification. working draft
initial def
inition. ...
ServiceWorkerGlobalScope - Web APIs
ce successfully registered, a service worker can and will be terminated when idle to conserve memory and processor power. an active service worker is automatically restarted to respond to events, such as serviceworkerglobalscope.onfetch or serviceworkerglobalscope.onmessage. additionally, synchronous requests are not allowed from within a service worker — only asynchronous requests, like those
initiated via the fetch() method, can be used. this interface inherits from the workerglobalscope interface, and its parent eventtarget, and therefore implements properties from windowtimers, windowbase64, and windoweventhandlers. <div id="interfacediagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 12.142857142857142%; vertical-align: middle; overflow: hidden...
...out to fetch from network...'); return fetch(event.request).then(function(response) { console.log('response from network is:', response); return response; }, function(error) { console.error('fetching failed:', error); throw error; }); }) ); }); specifications specification status comment service workersthe def
inition of 'serviceworkerglobalscope' in that specification. working draft
initial def
inition ...
ServiceWorkerRegistration.getNotifications() - Web APIs
t of notification objects. ...
...'user_alerts' }; navigator.serviceworker.ready.then(function(registration) { registration.getnotifications(options).then(function(notifications) { // do something with your notifications }) }); specifications specification status comment notifications apithe def
inition of 'serviceworkerregistration.getnotifications()' in that specification. living standard
initial def
inition ...
ServiceWorkerRegistration.onupdatefound - Web APIs
...
...any time the serviceworkerregistration.installing property acquires a new service worker. note: this feature is available in web workers. syntax serviceworkerregistration.onupdatefound = function() { ... }; specifications specification status comment service workersthe def
inition of 'serviceworkerregistration.onupdatefound' in that specification. working draft
initial def
inition. ...
ServiceWorkerRegistration.showNotification() - Web APIs
...
...uld use the serviceworkerglobalscope.onnotificationclick event handler. you can also retrieve details of the notifications that have been fired from the current service worker using serviceworkerregistration.getnotifications(). specifications specification status comment notifications apithe def
inition of 'shownotification()' in that specification. living standard
initial def
inition. ...
ShadowRoot - Web APIs
sitionfrompoint() returns a caretposition object containing the dom node containing the caret, and caret's character offset within that node. examples the following snippets are taken from our life-cycle-callbacks example (see it live also), which creates an element that displays a square of a size and color specified in the element's attributes. inside the <custom-square> element's class def
inition we include some life cycle callbacks that make a call to an external function, updatestyle(), which actually applies the size and color to the element. you'll see that we are passing it this (the custom element itself) as a parameter. connectedcallback() { console.log('custom square element added to page.'); updatestyle(this); } attributechangedcallback(name, oldvalue, newvalue) { cons...
... living standard ...
SourceBuffer.appendWindowEnd - Web APIs
the appendwindowend property of the sourcebuffer interface controls the timestamp for the end of the append window, a timestamp range that can be used to filter what media data is appended to the sourcebuffer. coded media frames with timestamps wthin this range will be appended, whereas those outside the range will be filtered out. the default value of appendwindowend is positive inf
inity. syntax var myappendwindowend = sourcebuffer.appendwindowend; sourcebuffer.appendwindowend = 120.0; value a double, indicating the end time of the append window, in seconds. 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 less than or ...
...made to set the value to less than or equal to sourcebuffer.appendwindowstart, or nan. invalidstateerror this sourcebuffer object is being updated (i.e. its sourcebuffer.updating property is currently true), or this sourcebuffer has been removed from the mediasource. example tbd specifications specification status comment media source extensionsthe def
inition of 'appendwindowend' in that specification. recommendation
initial def
inition. ...
SourceBuffer.remove() - Web APIs
...
... 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 def
inition of 'remove()' in that specification. recommendation
initial def
inition. ...
SourceBuffer.timestampOffset - Web APIs
syntax var myoffset = sourcebuffer.timestampoffset; sourcebuffer.timestampoffset = 2.5; value a double, with the offset amount expressed in seconds. exceptions the following exceptions may be thrown when setting a new value for this property. ...
... one or more of the sourcebuffer objects in mediasource.sourcebuffers are being updated (i.e. their sourcebuffer.updating property is currently true), a media segment inside the sourcebuffer is currently being parsed, or this sourcebuffer has been removed from the mediasource. example tbd specifications specification status comment media source extensionsthe def
inition of 'timestampoffset' in that specification. recommendation
initial def
inition. ...
SpeechRecognitionResult.length - Web APIs
the length read-only property of the speechrecognitionresult interface returns the length of the "array" — the number of speechrecognitionalternative objects contained in the result (also referred to as "n-best alternatives".) the number of alternatives contained in the result depends on what the speechrecognition.maxalternatives property was set to when the speech recognition was first
initiated. syntax var mylength = speechrecognitionresultinstance.length; returns a number. examples this code is excerpted from our speech color changer example. recognition.onresult = function(event) { // the speechrecognitionevent results property returns a speechrecognitionresultlist object // the speechrecognitionresultlist object contains speechrecognitionresult objects. // it has a gett...
...ognitionalternative at position 0. // we then return the transcript property of the speechrecognitionalternative object var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color + '.'; bg.style.backgroundcolor = color; console.log(event.results[0].length); } specifications specification status comment web speech apithe def
inition of 'length' in that specification. draft ...
StaticRange - Web APIs
properties the properties below are inherited from its parent interface, abstractrange. staticrange.collapsed read only returns a boolean value which is true if the range's start and end positions are the same, resulting in a range of length 0. staticrange.endcontainer read only returns the dom node which contains the ending ...
...not change to try to keep the same content within it as the document changes. if any changes are made to the dom, the actual data contained within the range specified by a staticrange may change. this lets the user agent avoid a lot of work that is unnecessary if the web app or site doesn't need a live-updating range. specifications specification status comment domthe def
inition of 'staticrange' in that specification. living standard static rangethe def
inition of 'staticrange' in that specification. editor's draft
initial def
inition. ...
StorageManager.estimate() - Web APIs
...
... </output>% of your available storage. </label> javascript content navigator.storage.estimate().then(function(estimate) { document.getelementbyid("percent").value = (estimate.usage / estimate.quota * 100).tofixed(2); }); result specifications specification status comment storagethe def
inition of 'estimate()' in that specification. living standard
initial def
inition. ...
StorageManager.persist() - 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for an...
...avigator.storage.persist().then(function(persistent) { if (persistent) console.log("storage will not be cleared except by explicit user action"); else console.log("storage may be cleared by the ua under storage pressure."); }); specifications specification status comment storagethe def
inition of 'persist' in that specification. living standard
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung inte...
StylePropertyMap.delete() - Web APIs
...
...ration with the given property. syntax stylepropertymap.delete(property) parameters property an identifier indicating the stylistic feature (e.g. font, width, background color) to remove. return value undefined example // tbd specifications specification status comment css typed om level 1the def
inition of 'delete()' in that specification. working draft
initial def
inition. ...
StylePropertyMapReadOnly.entries() - Web APIs
...
...operties in the prototype chain as well). syntax stylepropertymapreadonly.entries() parameters none. return value an array of the given stylepropertymapreadonly object's own enumerable property [key, value] pairs. example // tbd specifications specification status comment css typed om level 1the def
inition of 'entries()' in that specification. working draft
initial def
inition. ...
StylePropertyMapReadOnly.has() - Web APIs
...
...e indicates whether the specified property is in the stylepropertymapreadonly object. syntax var boolean = stylepropertymapreadonly.has(property) parameters property the name of a property. return value a boolean. example // tbd specifications specification status comment css typed om level 1the def
inition of 'has()' in that specification. working draft
initial def
inition. ...
SubmitEvent.submitter - Web APIs
property found on the submitevent interface specifies the submit button or other element that was invoked to cause the form to be submitted. syntax let submitter = submitevent.submitter; value an element, indicating the element that sent the submit event to the form. while this is often an <input> element whose type or a <button> whose type is submit, it could be some other element which has
initiated a submission process. if the submission was not triggered by a button of some kind, the value of submitter is null. examples in this example, a shopping cart may have an assortment of different submit buttons depending on factors such as the user's settings, the shop's settings, and any minimum or maximum shopping card totals established by the payment processors. each of the submit eleme...
...elected. please try again.", "ok"); } }); the handler id is obtained by using the submit event's submitter property to get the submit button, from which we then get the id. with that in hand, we can call a processorder() function to handle the order, passing along the form and the handler id. specifications specification status comment html living standardthe def
inition of 'submitevent.submitter' in that specification. living standard ...
TreeWalker.whatToShow - Web APIs
...
...>= nodefilter.show_comment) { // treewalker will show comments } specifications specification status comment domthe def
inition of 'treewalker.whattoshow' in that specification. living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe def
inition of 'treewalker.whattoshow' in that specification. obsolete
initial def
inition. ...
UIEvent() - Web APIs
the uievent() constructor creates a new uievent. syntax event = new uievent(typearg [, uievent
init]) values typearg is a domstring representing the name of the event. uievent
init optional is a uievent
init dictionary, having the following fields: detail: optional and defaulting to 0, of type long, that is a event-dependant value associated with the event. uievent.detail lists the semantic for standard events. view: optional and defaulting to null, of type windowproxy, that is the window associated with the event . sourcecapabilities: an instance of the inputdevicecapabilities interface which provides information about the physical device responsible for generating a touch event. the uievent
init dictionary also accepts fields from the event
init dictionary. spe...
...hich provides information about the physical device responsible for generating a touch event. the uievent
init dictionary also accepts fields from the event
init dictionary. specifications specification status comment inputdevicecapabilities draft added sourcecapabilities property. document object model (dom) level 3 events specificationthe def
inition of 'uievent()' in that specification. obsolete
initial def
inition. ...
URL - Web APIs
d) a ':' and the port of the url. hostname a usvstring containing the domain of the url. href a stringifier that returns a usvstring containing the whole url. origin read only returns a usvstring containing the origin of the url, that is its scheme, its domain and its port. password a usvstring containing the password specified before the domain name. pathname a usvstring containing an
initial '/' followed by the path of the url. port a usvstring containing the port number of the url. protocol a usvstring containing the protocol scheme of the url, including the final ':'. search a usvstring indicating the url's parameter string; if any parameters are provided, this string includes all of them, beginning with the leading ? character. searchparams read only a urlsearchparams ...
...indow.location.href); console.log(parsedurl.searchparams.get("id")); // "123" the tostring() method of url just returns the value of the href property, so the constructor can be used to normalize and encode a url directly. const response = await fetch(new url('http://www.example.com/démonstration.html')); specifications specification status comment file apithe def
inition of 'url' in that specification. working draft added the static methods url.createobjecturl() and url.revokeobjecturl(). urlthe def
inition of 'api' in that specification. living standard
initial def
inition (implements urlutils). ...
URLSearchParams.sort() - Web APIs
ort(); parameters none. return value undefined. ...
... create a test urlsearchparams object var searchparams = new urlsearchparams("c=4&a=2&b=3&a=1"); // sort the key/value pairs searchparams.sort(); // display the sorted query string console.log(searchparams.tostring()); the result is: a=2&a=1&b=3&c=4 specifications specification status comment urlthe def
inition of 'sort()' in that specification. living standard
initial def
inition ...
USBAlternateInterface - Web APIs
...
...interface field of the interface descriptor defining this interface. usbalternateinterface.endpointsread only returns an array containing instances of the usbendpoint interface describing each of the endpoints that are part of this interface. specifications specification status comment webusbthe def
inition of 'usbalternateinterface' in that specification. draft
initial def
inition. ...
USBConfiguration - Web APIs
...
...ided in the iconfiguration field of the configuration descriptor defining this configuration. usbconfiguration.interfacesread only returns an array containing instances of the usbinterface describing each interface supported by this configuration. specifications specification status comment webusbthe def
inition of 'usbconfiguration' in that specification. draft
initial def
inition. ...
USBDevice.configuration - Web APIs
...
...operty to select a configuration before claiming an interface. async function connectdevice(usbdevice) { await usbdevice.open(); if (usbdevice.configuration === null) await usbdevice.selectconfiguration(1); await usbdevice.claiminterface(0); } specifications specification status comment webusbthe def
inition of 'configuration' in that specification. draft
initial def
inition. ...
USBDevice.isochronousTransferOut() - Web APIs
...
...ce-specific endpoint (buffer). data a typedarray containing the data to send to the device. packetlengths an array of lengths for the packets being transfered. return value a promise that resolves with a usbisochronousouttransferresult. specifications specification status comment webusbthe def
inition of 'isochronoustransferout()' in that specification. draft
initial def
inition. ...
USBDevice.opened - Web APIs
...
... to // it be in a uint8array. let payload = new uint8array([r, g, b]); await usbdevice.controltransferout({ requesttype: 'vendor', recipient: 'device', request: 1, value: 0, index: 0, }, payload); } } specifications specification status comment webusbthe def
inition of 'opened' in that specification. draft
initial def
inition. ...
USBDevice.releaseInterface() - Web APIs
...
...s when a cliamed interface is released from exclusive access. syntax var promise = usbdevice.releaseinterface(interfacenumber) parameters interfacenumber the device-specific index of the currently-claimed interface. return value a promise. specifications specification status comment webusbthe def
inition of 'releaseinterface()' in that specification. draft
initial def
inition. ...
USBDevice.selectConfiguration() - Web APIs
...
...romise that resolves when the specified configuration is selected. syntax var promise = usbdevice.selectconfiguration(configurationvalue) parameters configurationvalue the number of a device-specific configuration. return value a promise. specifications specification status comment webusbthe def
inition of 'selectconfiguration' in that specification. draft
initial def
inition. ...
USBDevice.transferIn() - Web APIs
...
...of a device-specific endpoint (buffer). length the maximum number of bytes that will be read back from the device. the actual data is in the usbintransferresult in the resolved promise. return value a promise that resolves with a usbtransferinresult. specifications specification status comment webusbthe def
inition of 'transferin()' in that specification. draft
initial def
inition. ...
USBIsochronousOutTransferResult - Web APIs
...
...object with the provided packet field. properties usbisochronousouttransferresult.packetsread only returns an array of usbisochronousouttransferpacket objects containing the result of each request to send a packet to the device. specifications specification status comment webusbthe def
inition of 'usbisochronousouttransferresult' in that specification. draft
initial def
inition. ...
USBOutTransferResult - Web APIs
...
...- the transfer was successful. "stall" - the device indicated an error by generating a stall condition on the endpoint. a stall on a bulk or interrupt endpoint must be cleared by calling clearhalt() before transferout() can be called again. specifications specification status comment webusbthe def
inition of 'usbouttransferresult' in that specification. draft
initial def
inition. ...
VTTCue() - Web APIs
this is the time, given in seconds and fractions of a second, denoting the beginning of the range of the media data to which this cue applies. for example, if a cue is to be visible from 50 seconds to a one minute, five and a half seconds in the media's playback, starttime will be 50.0. endtime this is a double representing the ending time for this text track cue. ...
...dicated by starttime and endtime. return value a new vttcue object representing a cue which will be presented during the time span given. example // create a cue that is shown from 2 to 3 seconds and uses the given text. var cue = new vttcue(2, 3, 'cool text to be displayed'); specifications specification status comment webvtt: the web video text tracks formatthe def
inition of 'vttcue()' in that specification. candidate recommendation ...
WEBGL_color_buffer_float - Web APIs
...
...he internalformat parameter now accepts ext.rgba32f_ext and ext.rgb32f_ext ( ). examples var ext = gl.getextension('webgl_color_buffer_float'); gl.renderbufferstorage(gl.renderbuffer, ext.rbga32f_ext, 256, 256); specifications specification status comment webgl_color_buffer_floatthe def
inition of 'webgl_color_buffer_float' in that specification. recommendation
initial def
inition. ...
WEBGL_depth_texture - Web APIs
...
...s://www.khronos.org/bugzilla/show_bug.cgi?id=674. examples var ext = gl.getextension('webgl_depth_texture'); gl.teximage2d(gl.texture_2d, 0, gl.depth_component, 512, 512, 0, gl.depth_component, gl.unsigned_short, null); specifications specification status comment webgl_depth_texturethe def
inition of 'webgl_depth_texture' in that specification. recommendation
initial def
inition. ...
WebGL2RenderingContext.createVertexArray() - Web APIs
the webgl2renderingcontext.createvertexarray() method of the webgl 2 api creates and
initializes a webglvertexarrayobject object that represents a vertex array object (vao) pointing to vertex array data and which provides names for different sets of vertex data. syntax webglvertexarrayobject gl.createvertexarray(); parameters none. return value a webglvertexarrayobject representing a vertex array object (vao) which points to vertex array data. examples var vao = gl.createvertexarray(); gl.bindvertexarray(vao); // ... // calls to bindbuffer or vertexattribpointer // which will be "recorded" in the vao // ... ...
...ray(); parameters none. return value a webglvertexarrayobject representing a vertex array object (vao) which points to vertex array data. examples var vao = gl.createvertexarray(); gl.bindvertexarray(vao); // ... // calls to bindbuffer or vertexattribpointer // which will be "recorded" in the vao // ... specifications specification status comment webgl 2.0the def
inition of 'createvertexarray' in that specification. editor's draft
initial def
inition. opengl es 3.0the def
inition of 'glgenvertexarrays' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.renderbufferStorageMultisample() - Web APIs
syntax void gl.renderbufferstoragemultisample(target, samples, internalformat, width, height); parameters target a glenum specifying the target renderbuffer object. possible values: gl.renderbuffer: buffer data storage for single images in a renderable internal format. samples a glsizei specifying the number of samples to be used for the renderbuffer storage. internalformat a glenum specifying the internal format of the renderbuffer. ...
...epth24_stencil8 gl.depth32f_stencil8 gl.stencil_index8 width a glsizei specifying the width of the renderbuffer in pixels. height a glsizei specifying the height of the renderbuffer in pixels. return value none. examples gl.renderbufferstoragemultisample(gl.renderbuffer, 4, gl.rbga4, 256, 256); specifications specification status comment webgl 2.0the def
inition of 'glrenderbufferstoragemultisample' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glrenderbufferstoragemultisample' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLActiveInfo.name - Web APIs
...
...eturned by calling the getactiveattrib() or getactiveuniform() methods. examples var activeattrib = gl.getactiveattrib(program, index); activeattrib.name; var activeuniform = gl.getactiveuniform(program, index); activeuniform.name; specifications specification status comment webgl 1.0the def
inition of 'webglactiveinfo.name' in that specification. recommendation
initial def
inition. ...
WebGLActiveInfo.size - Web APIs
...
...eturned by calling the getactiveattrib() or getactiveuniform() methods. examples var activeattrib = gl.getactiveattrib(program, index); activeattrib.size; var activeuniform = gl.getactiveuniform(program, index); activeuniform.size; specifications specification status comment webgl 1.0the def
inition of 'webglactiveinfo.size' in that specification. recommendation
initial def
inition. ...
WebGLActiveInfo.type - Web APIs
...
...eturned by calling the getactiveattrib() or getactiveuniform() methods. examples var activeattrib = gl.getactiveattrib(program, index); activeattrib.type; var activeuniform = gl.getactiveuniform(program, index); activeuniform.type; specifications specification status comment webgl 1.0the def
inition of 'webglactiveinfo.type' in that specification. recommendation
initial def
inition. ...
WebGLRenderingContext.bindBuffer() - Web APIs
gl'); var buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); getting current bindings to check the current buffer bindings, query the array_buffer_binding and element_array_buffer_binding constants. gl.getparameter(gl.array_buffer_binding); gl.getparameter(gl.element_array_buffer_binding); specifications specification status comment webgl 1.0the def
inition of 'bindbuffer' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glbindbuffer' in that specification. standard man page of the (similar) opengl es 2 api. webgl 2.0the def
inition of 'bindbuffer' in that specification. editor's draft updated def
inition for webgl 2. adds new target buffers: gl.co...
... page of the (similar) opengl es 2 api. webgl 2.0the def
inition of 'bindbuffer' in that specification. editor's draft updated def
inition for webgl 2. adds new target buffers: gl.copy_read_buffer, gl.copy_write_buffer, gl.transform_feedback_buffer, gl.uniform_buffer, gl.pixel_pack_buffer, gl.pixel_unpack_buffer opengl es 3.0the def
inition of 'glbindbuffer' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.bindFramebuffer() - Web APIs
ment.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var framebuffer = gl.createframebuffer(); gl.bindframebuffer(gl.framebuffer, framebuffer); getting current bindings to check the current frame buffer binding, query the framebuffer_binding constant. gl.getparameter(gl.framebuffer_binding); specifications specification status comment webgl 1.0the def
inition of 'bindframebuffer' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glbindframebuffer' in that specification. standard man page of the opengl api. webgl 2.0the def
inition of 'bindframebuffer' in that specification. editor's draft updated def
inition for webgl 2. adds: gl.draw_framebuffer and gl.read_fra...
...fication. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glbindframebuffer' in that specification. standard man page of the opengl api. webgl 2.0the def
inition of 'bindframebuffer' in that specification. editor's draft updated def
inition for webgl 2. adds: gl.draw_framebuffer and gl.read_framebuffer opengl es 3.0the def
inition of 'glbindframebuffer' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.bindRenderbuffer() - Web APIs
standard man page of the opengl api. ...
...fer = gl.createrenderbuffer(); gl.bindrenderbuffer(gl.renderbuffer, renderbuffer); getting current bindings to check the current renderbuffer binding, query the renderbuffer_binding constant. gl.getparameter(gl.renderbuffer_binding); specifications specification status comment webgl 1.0the def
inition of 'bindrenderbuffer' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glbindrenderbuffer' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.bindTexture() - Web APIs
mentbyid('canvas'); var gl = canvas.getcontext('webgl'); var texture = gl.createtexture(); gl.bindtexture(gl.texture_2d, texture); getting current bindings to check the current texture binding, query the gl.texture_binding_2d or gl.texture_binding_cube_map constants. gl.getparameter(gl.texture_binding_2d); specifications specification status comment webgl 1.0the def
inition of 'bindtexture' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glbindtexture' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the def
inition of 'bindtexture' in that specification. editor's draft updated def
inition for webgl 2. adds: gl.texture_3d and gl.texture_2...
...ation. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glbindtexture' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the def
inition of 'bindtexture' in that specification. editor's draft updated def
inition for webgl 2. adds: gl.texture_3d and gl.texture_2d_array opengl es 3.0the def
inition of 'glbindtexture' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGLRenderingContext.canvas - Web APIs
...
...); gl.canvas; // htmlcanvaselement offscreen canvas example using the experimental offscreencanvas object. var offscreen = new offscreencanvas(256, 256); var gl = offscreen.getcontext('webgl'); gl.canvas; // offscreencanvas specifications specification status comment webgl 1.0the def
inition of 'webglrenderingcontext.canvas' in that specification. recommendation
initial def
inition. ...
WebGLRenderingContext.checkFramebufferStatus() - Web APIs
points where the value of framebuffer_attachment_object_type is not none, the framebuffer is considered incomplete. examples var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var framebuffer = gl.createframebuffer(); // ... gl.checkframebufferstatus(gl.framebuffer); specifications specification status comment webgl 1.0the def
inition of 'checkframebufferstatus' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glcheckframebufferstatus' in that specification. standard man page of the opengl api. webgl 2.0the def
inition of 'checkframebufferstatus' in that specification. editor's draft updated def
inition for webgl 2. opengl es 3.0th...
...f 'checkframebufferstatus' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glcheckframebufferstatus' in that specification. standard man page of the opengl api. webgl 2.0the def
inition of 'checkframebufferstatus' in that specification. editor's draft updated def
inition for webgl 2. opengl es 3.0the def
inition of 'glcheckframebufferstatus' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.compressedTexImage[23]D() - Web APIs
standard man page of the (similar) opengl es 3.0 api. ...
...compressedteximage2d(gl.texture_2d, 0, ext.compressed_rgba_s3tc_dxt5_ext, 512, 512, 0, texturedata); gl.texparameteri(gl.texture_2d, gl.texture_mag_filter, gl.linear); gl.texparameteri(gl.texture_2d, gl.texture_min_filter, gl.linear); specifications specification status comment webgl 1.0the def
inition of 'compressedteximage2d' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glcompressedteximage2d' in that specification. standard man page of the (similar) opengl es 2.0 api. opengl es 3.0the def
inition of 'glcompressedteximage2d' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGLRenderingContext.createProgram() - Web APIs
syntax webglprogram gl.createprogram(); parameters none. return value a webglprogram object that is a combination of two compiled webglshaders consisting of a vertex shader and a fragment shader (both written in glsl). these are then linked into a usable program.. ...
...ram, fragmentshader); gl.linkprogram(program); if ( !gl.getprogramparameter( program, gl.link_status) ) { var info = gl.getprograminfolog(program); throw 'could not compile webgl program. \n\n' + info; } see webglshader for information on creating the vertexshader and fragmentshader in the above example. specifications specification status comment webgl 1.0the def
inition of 'createprogram' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glcreateprogram' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.getBufferParameter() - Web APIs
ad, gl.dynamic_read, gl.stream_read, gl.static_copy, gl.dynamic_copy, gl.stream_copy. return value depends on the requested information (as specified with pname). either a glint or a glenum. examples gl.getbufferparameter(gl.array_buffer, gl.buffer_size); specifications specification status comment webgl 1.0the def
inition of 'getbufferparameter' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glgetbufferparameteriv' in that specification. standard man page of the (similar) opengl es 2 api. webgl 2.0the def
inition of 'getbufferparameter' in that specification. editor's draft updated def
inition for webgl. opengl es 3.
... standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.getFramebufferAttachmentParameter() - Web APIs
r is thrown if target is not gl.framebuffer, gl.draw_framebuffer, gl.read_framebuffer or if attachment is not one of the accepted attachment points. examples gl.getframebufferattachmentparameter(gl.framebuffer, gl.color_attachment0, gl.framebuffer_attachment_object_type); specifications specification status comment webgl 1.0the def
inition of 'getframebufferattachmentparameter' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glgetframebufferattachmentparameteriv' in that specification. standard man page of the (similar) opengl api. webgl 2.0the def
inition of 'getframebufferattachmentparameter' in that specification. editor's draft updated def...
...ion of 'getframebufferattachmentparameter' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glgetframebufferattachmentparameteriv' in that specification. standard man page of the (similar) opengl api. webgl 2.0the def
inition of 'getframebufferattachmentparameter' in that specification. editor's draft updated def
inition for webgl 2. opengl es 3.0the def
inition of 'glgetframebufferattachmentparameteriv' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.getRenderbufferParameter() - Web APIs
uffer_samples: returns a glint indicating the number of samples of the image of the currently bound renderbuffer. return value depends on the requested information (as specified with pname). either a glint or a glenum. examples gl.getrenderbufferparameter(gl.renderbuffer, gl.renderbuffer_width); specifications specification status comment webgl 1.0the def
inition of 'getrenderbufferparameter' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glgetrenderbufferparameteriv' in that specification. standard man page of the (similar) opengl api. webgl 2.0the def
inition of 'getrenderbufferparameter' in that specification. editor's draft updated def
inition for webgl 2. ...
... standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.getShaderInfoLog() - Web APIs
gcontext.getshaderinfolog returns the information log for the specified webglshader object. it contains warnings, debugging and compile information. syntax gl.getshaderinfolog(shader); parameters shader a webglshader to query. return value a domstring that contains diagnostic messages, warning messages, and other information about the last compile operation. when a webglshader object is
initially created, its information log will be a string of length 0. examples checking compilation messages /* load shader source code. */ gl.shadersource(shader, shadercode); /* compile shader source code. */ gl.compileshader(shader); var message = gl.getshaderinfolog(shader); if (message.length > 0) { /* message may be an error or a warning */ throw message; } specifications sp...
...gth 0. examples checking compilation messages /* load shader source code. */ gl.shadersource(shader, shadercode); /* compile shader source code. */ gl.compileshader(shader); var message = gl.getshaderinfolog(shader); if (message.length > 0) { /* message may be an error or a warning */ throw message; } specifications specification status comment webgl 1.0the def
inition of 'getshaderinfolog' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glgetshaderinfolog' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.getVertexAttrib() - Web APIs
tension: ext.vertex_attrib_array_divisor_angle: returns a glint describing the frequency divisor used for instanced rendering. return value returns the requested vertex attribute information (as specified with pname). ...
...escribing the frequency divisor used for instanced rendering. return value returns the requested vertex attribute information (as specified with pname). examples gl.getvertexattrib(0, gl.vertex_attrib_array_buffer_binding); specifications specification status comment webgl 1.0the def
inition of 'getvertexattrib' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glgetvertexattrib' in that specification. standard man page of the opengl es 2 api. webgl 2.0the def
inition of 'getvertexattrib' in that specification. editor's draft updated def
inition for webgl 2. opengl es 3.0the def
inition of 'glgetvertexattrib' in that specification. standard man page of the...
WebGLRenderingContext.isEnabled() - Web APIs
indicating if the capability cap is enabled (true), or not (false). ...
... examples gl.isenabled(gl.stencil_test); // false to activate or deactivate a specific capability, use the webglrenderingcontext.enable() and webglrenderingcontext.disable() methods: gl.enable(gl.stencil_test); gl.disable(gl.stencil_test); specifications specification status comment webgl 1.0the def
inition of 'isenabled' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glisenabled' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the def
inition of 'isenabled' in that specification. editor's draft updated def
inition for webgl 2. opengl es 3.0the def
inition of 'glisenabled' in that specification. standard man page of the (simi...
WebGLRenderingContext.makeXRCompatible() - Web APIs
of gameplay. ...
...rst case, we make sure we're aware that the state can be recovered, while in the latter we actually reload the scene to ensure we have the correct resources for the current screen or headset configuration. specifications specification status comment webxr device apithe def
inition of 'webglrenderingcontext.makexrcompatible()' in that specification. working draft
initial def
inition ...
WebGLRenderingContext.texImage2D() - Web APIs
set (webgl 2 only) a glintptr byte offset into the webglbuffer's data store. used to upload data to the currently bound webgltexture from the webglbuffer bound to the pixel_unpack_buffer target. return value none. ...
...ta store. used to upload data to the currently bound webgltexture from the webglbuffer bound to the pixel_unpack_buffer target. return value none. examples gl.teximage2d(gl.texture_2d, 0, gl.rgba, gl.rgba, gl.unsigned_byte, image); specifications specification status comment webgl 1.0the def
inition of 'teximage2d' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glteximage2d' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the def
inition of 'teximage2d' in that specification. editor's draft updated def
inition for webgl. opengl es 3.0the def
inition of 'glteximage2d' in that specification. standard man page of the (sim...
WebGLRenderingContext.texSubImage2D() - Web APIs
set (webgl 2 only) a glintptr byte offset into the webglbuffer's data store. used to upload data to the currently bound webgltexture from the webglbuffer bound to the pixel_unpack_buffer target. return value none. ...
...store. used to upload data to the currently bound webgltexture from the webglbuffer bound to the pixel_unpack_buffer target. return value none. examples gl.texsubimage2d(gl.texture_2d, 0, 0, 0, gl.rgba, gl.unsigned_byte, image); specifications specification status comment webgl 1.0the def
inition of 'texsubimage2d' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'gltexsubimage2d' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the def
inition of 'texsubimage2d' in that specification. editor's draft updated def
inition for webgl. opengl es 3.0the def
inition of 'gltexsubimage2d' in that specification. standard man page of...
WebGLRenderingContext.validateProgram() - Web APIs
standard man page of the opengl api. ...
...l.linkprogram(program); gl.validateprogram(program); if ( !gl.getprogramparameter( program, gl.link_status) ) { var info = gl.getprograminfolog(program); throw 'could not compile webgl program. \n\n' + info; } gl.useprogram(program); specifications specification status comment webgl 1.0the def
inition of 'validateprogram' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glvalidateprogram' in that specification. standard man page of the opengl api. ...
WebGLVertexArrayObject - Web APIs
...
...n allows you to use vertex array objects in a webgl 1 context. examples var vao = gl.createvertexarray(); gl.bindvertexarray(vao); // ... // calls to bindbuffer or vertexattribpointer // which will be "recorded" in the vao // ... specifications specification status comment webgl 2.0the def
inition of 'webglvertexarrayobject' in that specification. editor's draft
initial def
inition. ...
Boilerplate 1 - Web APIs
boilerplate code for setting up webgl rendering context by now you are quite used to seeing the same pieces of html, css, and javascript repeated again and again. so we are going to hide them from now on. this would allow us to focus on the interesting pieces of code that are most relevant for learning webgl. ...
...y, the html has a <p> element that contains some descriptive text about the page and may also hold error messages; a <canvas> element; and optionally a <button>. the css contains rules for body, canvas, and button. any additional non-trivial css and html will be displayed on the pages of specific examples. in following examples, we will use a javascript helper function, getrenderingcontext(), to
initialize the webgl rendering context. by now, you should be able to understand what the function does. basically, it gets the webgl rendering context from the canvas element,
initializes the drawing buffer, clears it black, and returns the
initialized context. in case of error, it displays an error message and returns null. finally, all javascript code will run within an immediate function, which i...
Hello GLSL - Web APIs
rtexshader); gl.detachshader(program, fragmentshader); gl.deleteshader(vertexshader); gl.deleteshader(fragmentshader); if (!gl.getprogramparameter(program, gl.link_status)) { var linkerrlog = gl.getprograminfolog(program); cleanup(); document.queryselector("p").innerhtml = "shader program did not link successfully. ...
...; if (!gl.getprogramparameter(program, gl.link_status)) { var linkerrlog = gl.getprograminfolog(program); cleanup(); document.queryselector("p").innerhtml = "shader program did not link successfully. ...
Hello vertex attributes - Web APIs
rtexshader); gl.detachshader(program, fragmentshader); gl.deleteshader(vertexshader); gl.deleteshader(fragmentshader); if (!gl.getprogramparameter(program, gl.link_status)) { var linkerrlog = gl.getprograminfolog(program); cleanup(); document.queryselector("p").innerhtml = "shader program did not link successfully. ...
... (evt) { var clickxrelativtocanvas = evt.pagex - evt.target.offsetleft; var clickxinwebglcoords = 2.0 * (clickxrelativtocanvas- gl.drawingbufferwidth/2) / gl.drawingbufferwidth; gl.bufferdata(gl.array_buffer, new float32array([clickxinwebglcoords]), gl.static_draw); gl.drawarrays(gl.points, 0, 1); }, false); } var buffer; function
initializeattributes() { gl.enablevertexattribarray(0); buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, new float32array([0.0]), gl.static_draw); gl.vertexattribpointer(0, 1, gl.float, false, 0, 0); } window.addeventlistener("beforeunload", cleanup, true); function cleanup() { gl.useprogram(null); if (buffer) gl.deletebuffer(buffer)...
Textures from code - Web APIs
ertexshader); gl.detachshader(program, fragmentshader); gl.deleteshader(vertexshader); gl.deleteshader(fragmentshader); if (!gl.getprogramparameter(program, gl.link_status)) { var linkerrlog = gl.getprograminfolog(program); cleanup(); document.queryselector("p").innerhtml = "shader program did not link successfully. ...
...er); if (!gl.getprogramparameter(program, gl.link_status)) { var linkerrlog = gl.getprograminfolog(program); cleanup(); document.queryselector("p").innerhtml = "shader program did not link successfully. ...
WebGL by example - Web APIs
topic and level of difficulty, covering the webgl rendering context, shader programming, textures, geometry, user interaction, and more. examples by topic the examples are sorted in order of increasing difficulty. but rather than just presenting them in a single long list, they are additionally divided into topics. sometimes we revisit a topic several times, such as when needing to discuss it
initially at a basic level, and later at intermediate and advanced levels. instead of trying to juggle shaders, geometry, and working with gpu memory, already in the first program, the examples here explore webgl in an incremental way. we believe that it leads to a more effective learning experience and ultimately a deeper understanding of the underlying concepts. explanations about the examples are...
...ow to draw simple rectangles and squares with scissoring operations. canvas size and webgl the example explores the effect of setting (or not setting) the canvas size to its element size in css pixels, as it appears in the browser window. boilerplate 1 the example describes repeated pieces of code that will be hidden from now on, as well as defining a javascript utility function to make webgl
initialization easier. scissor animation some animation fun with scissoring and clearing operations. raining rectangles a simple game that demonstrates clearing with solid colors, scissoring, animation, and user interaction. shader programming basics hello glsl a very basic shader program that draws a solid color square. hello vertex attributes combining shader programming and user inter...
Getting started with WebGL - Web APIs
s a canvas that our sample will draw into. <body> <canvas id="glcanvas" width="640" height="480"></canvas> </body> preparing the webgl context the main() function in our javascript code, is called when our script is loaded. its purpose is to set up the webgl context and start rendering content. // // start here // function main() { const canvas = document.queryselector("#glcanvas"); //
initialize the gl context const gl = canvas.getcontext("webgl"); // only continue if webgl is available and working if (gl === null) { alert("unable to
initialize webgl. your browser or machine may not support it."); return; } // set clear color to black, fully opaque gl.clearcolor(0.0, 0.0, 0.0, 1.0); // clear the color buffer with specified clear color gl.clear(gl.color_buf...
...n; the first thing we do here is obtain a reference to the canvas, assigning it to a variable named canvas. once we have the canvas, we try to get a webglrenderingcontext for it by calling getcontext() and passing it the string "webgl". if the browser does not support webgl, getcontext() will return null in which case we display a message to the user and exit. if the context is successfully
initialized, the variable gl is our reference to it. in this case, we set the clear color to black, and clear the context to that color (redrawing the canvas with the background color). at this point, you have enough code that the webgl context should successfully
initialize, and you should wind up with a big black, empty box, ready and waiting to receive content. view the complete code | open thi...
WebGL model view projection - Web APIs
y mentioned and shown in the functions above, the w component divides the x, y, and z components. when the w component is a non-zero real number then homogeneous coordinate easily translates back into a normal point in cartesian space. now what happens if the w component is zero? in javascript the value returned would be as follows. homogeneoustocartesian([10, 4, 5, 0]); this evaluates to: [inf
inity, inf
inity, inf
inity]. this homogeneous coordinate represents some point at inf
inity. 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 strippe...
...ff into the distance. the viewable area is a four-sided pyramid with its peak at the lens, its four sides corresponding to the extents of its peripheral vision range, and its base at the farthest distance it can see, like this: if we simply used this to determine the polygons to be rendered each frame, our renderer would need to render every polygon within this pyramid, all the way off into inf
inity, including also polygons that are very close to the lens—likely too close to be useful (and certainly including things that are so close that a real human wouldn't be able to focus on them in the same setting). so the first step in reducing the number of polygons we need to compute and render, we turn this pyramid into the viewing frustum. the two planes we'll use to chop away vertices in ord...
Taking still photos with WebRTC - Web APIs
d="canvas"> </canvas> <div class="output"> <img id="photo" alt="the screen capture will appear in this box."> </div> that's all of the relevant html. the rest is just some page layout fluff and a bit of text offering a link back to this page. the javascript code now let's take a look at the javascript code. we'll break it up into a few bite-sized pieces to make it easier to explain.
initialization we start by wrapping the whole script in an anonymous function to avoid global variables, then setting up various variables we'll be using. (function() { var width = 320; // we will scale the photo width to this var height = 0; // this will be computed based on the input stream var streaming = false; var video = null; var canvas = null; var photo = null; var sta...
... reference to the <img> element after the page is done loading. startbutton this will be a reference to the <button> element that's used to trigger capture. we'll get that after the page is done loading. the startup() function the startup() function is run when the page has finished loading, courtesy of window.addeventlistener(). this function's job is to request access to the user's webcam,
initialize the output <img> to a default state, and to establish the event listeners needed to receive each frame of video from the camera and react when the button is clicked to capture an image. getting element references first, we grab references to the major elements we need to be able to access. function startup() { video = document.getelementbyid('video'); canvas = document.geteleme...
Using DTMF with WebRTC - Web APIs
nts = { audio: true, video: false }; let offeroptions = { offertoreceiveaudio: 1, offertoreceivevideo: 0 }; let dialbutton = null; let logelement = null; these are, in order: dialstring the dtmf string the caller will send when the "dial" button is clicked. callerpc and receiverpc the rtcpeerconnection objects representing the caller and the receiver, respectively. these will be
initialized when the call starts up, in our connectanddial() function, as shown in starting the connection process below. dtmfsender the rtcdtmfsender object for the connection. this will be obtained while setting up the connection, in the gotstream() function shown in adding the audio to the connection. hasaddtrack because some browsers have not yet implemented rtcpeerconnection.addtrack(), there...
...ue. offeroptions an rtcofferoptions object providing options to specify when calling rtcpeerconnection.createoffer(). in this case, we state that we want to receive audio but not video. dialbutton and logelement these variables will be used to store references to the dial button and the <div> into which logging information will be written. they'll get set up when the page is first loaded. see
initialization below.
initialization when the page loads, we do some basic setup: we fetch references to the dial button and the log output box elements, and we use addeventlistener() to add an event listener to the dial button so that clicking it calls the connectanddial() function to begin the connection process. window.addeventlistener("load", function() { logelement = document.queryselector(...
WebSocket.onerror - Web APIs
vent handler using addeventlistener(). ...
...ler; value a function or eventhandler which is executed whenever an error event occurs on the websocket connection. example websocket.onerror = function(event) { console.error("websocket error observed:", event); }; specifications specification status comment html living standardthe def
inition of 'websocket: onerror' in that specification. living standard
initial def
inition ...
Writing a WebSocket server in C# - Web APIs
er, int offset, int size) writes bytes from buffer, offset and size determine length of message. read(byte[] buffer, int offset, int size) reads bytes to buffer. offset and size determine the length of the message. let us extend our example. tcpclient client = server.accepttcpclient(); console.writeline("a client connected."); networkstream stream = client.getstream(); //enter to an inf
inite cycle to be able to handle every change in stream while (true) { while (!stream.dataavailable); byte[] bytes = new byte[client.available]; stream.read(bytes, 0, bytes.length); } handshaking when a client connects to a server, it sends a get request to upgrade the connection to a websocket from a simple http request. this is known as handshaking. this sample code can detect a get...
....1"; int port = 80; var server = new tcplistener(ipaddress.parse(ip), port); server.start(); console.writeline("server has started on {0}:{1}, waiting for a connection...", ip, port); tcpclient client = server.accepttcpclient(); console.writeline("a client connected."); networkstream stream = client.getstream(); // enter to an inf
inite cycle to be able to handle every change in stream while (true) { while (!stream.dataavailable); while (client.available < 3); // match against "get" byte[] bytes = new byte[client.available]; stream.read(bytes, 0, client.available); string s = encoding.utf8.getstring(bytes); if (regex.ismatch(s, "^get", regexoption...
Web Video Text Tracks Format (WebVTT) - Web APIs
a:link. ...
...h-last-child: e.g., p:nth-last-child(2). nth-child(n): e.g., p:nth-child(2). where p and a are the tags which are used in html for paragraph and link, respectively and they can be replaced by identifiers which are used for cues in webvtt file. specifications specification status comment webvtt: the web video text tracks format candidate recommendation
initial def
inition ...
Controlling multiple parameters with ConstantSourceNode - Web APIs
middle; } .right span { vertical-align: middle; } .right input { vertical-align: baseline; } .left { width: 50%; position: absolute; left: 0; display: table-cell; vertical-align: middle; } .left span, .left input { vertical-align: middle; } javascript now let's take a look at the javascript code, a piece at a time. setting up let's start by looking at the global variable
initialization. let context = null; let playbutton = null; let volumecontrol = null; let oscnode1 = null; let oscnode2 = null; let oscnode3 = null; let constantnode = null; let gainnode1 = null; let gainnode2 = null; let gainnode3 = null; let playing = false; these variables are: context the audiocontext in which all the audio nodes live. playbutton and volumecontrol references to the play ...
...be linked together to have the same, adjustable, value using the constantsourcenode. constantnode the constantsourcenode used to control the values of gainnode2 and gainnode3 together. playing a boolean that we'll use to keep track of whether or not we're currently playing the tones. now let's look at the setup() function, which is our handler for the window's load event; it handles all the
initialization tasks that require the dom to be in place. function setup() { context = new (window.audiocontext || window.webkitaudiocontext)(); playbutton = document.queryselector("#playbutton"); volumecontrol = document.queryselector("#volumecontrol"); playbutton.addeventlistener("click", toggleplay, false); volumecontrol.addeventlistener("input", changevolume, false); gainnode1 = co...
Example and tutorial: Simple synth keyboard - Web APIs
let audiocontext = new (window.audiocontext || window.webkitaudiocontext)(); let osclist = []; let mastergainnode = null; audiocontext is set to reference the global audiocontext object (or webkitaudiocontext if necessary). osclist is set up to be ready to contain a list of all currently-playing oscillators. it starts off empty, since there are none playing ye...
...o the keyboard. once the keyboard has been constructed, we scroll the note "b" in octave 5 into view; this has the effect of ensuring that middle-c is visible along with its surrounding keys. then a new custom waveform is built using audiocontext.createperiodicwave(). this waveform will be used any time the user selects "custom" from the waveform picker control. finally, the oscillator list is
initialized to ensure that it's ready to receive information identifiying which oscillators are associated with which keys. creating a key the createkey() function is called once for each key that we want to present in the virtual keyboard. it creates the elements that comprise the key and its label, adds some data attributes to the element for later use, and assigns event handlers for the events w...
Using IIR filters - Web APIs
this article looks at how to implement one, and use it in a simple example. demo our simple example for this guide provides a play/pause button that starts and pauses audio play, and a toggle that turns an iir filter on and off, altering the tone of the sound. ...
... effects. browser support iir filters are supported well across modern browsers, although they have been implemented more recently than some of the more longstanding web audio api features, like biquad filters. the iirfilternode the web audio api now comes with an iirfilternode interface. but what is this and how does it differ from the biquadfilternode we have already? an iir filter is a inf
inite impulse response filter. it's one of two primary types of filters used in audio and digital signal processing. the other type is fir — f
inite impulse response filter. there's a really good overview to iif filters and fir filters here. a biquad filter is actually a specific type of inf
inite impulse response filter. it's a commonly-used type and we already have it as a node in the web audio api...
Functions and classes available to Web Workers - Web APIs
to set of features that are typically provided. 38 (38) (yes) (yes) (yes) crypto the crypto interface represents basic cryptography features available in the current context. it allows access to a cryptographically strong random number generator and to cryptographic primitives. ? no support ? ? customevent the customevent interface represents events
initialized by an application for any purpose. 48 (48) (yes) (yes) (yes) domrequest and domcursor respectively, these objects represents an ongoing operation (with listeners for reacting to the operation completely successfully, or failing, for example), and an ongoing operation over a list of results. 41 (41) ? ? ? fetch the fetch spec provides an up-to...
...y an application for any purpose. 48 (48) (yes) (yes) (yes) domrequest and domcursor respectively, these objects represents an ongoing operation (with listeners for reacting to the operation completely successfully, or failing, for example), and an ongoing operation over a list of results. 41 (41) ? ? ? fetch the fetch spec provides an up-to-date def
inition of, and api for, fetching resources (e.g. across the network.) 39 (39) (mostly in 34 (34) behind pref, although a few features are later.) no support 42 41 behind pref 10.1 filereader this api allows asynchronous read of blob and file objects. 46 (46) no support (yes) no support filereadersync this api allows synchronous read of bl...
WheelEvent.deltaX - Web APIs
...
... the wheelevent.deltamode unit. syntax var dx = event.deltax; example var syntheticevent = new wheelevent("syntheticwheel", {"deltax": 4, "deltamode": 0}); console.log(syntheticevent.deltax); specifications specification status comment document object model (dom) level 3 events specificationthe def
inition of 'wheelevent.deltax' in that specification. obsolete
initial def
inition. ...
WheelEvent.deltaY - Web APIs
...
... the wheelevent.deltamode unit. syntax var dy = event.deltay; example var syntheticevent = new wheelevent("syntheticwheel", {"deltay": 4, "deltamode": 0}); console.log(syntheticevent.deltay); specifications specification status comment document object model (dom) level 3 events specificationthe def
inition of 'wheelevent.deltay' in that specification. obsolete
initial def
inition. ...
WheelEvent.deltaZ - Web APIs
...
... the wheelevent.deltamode unit. syntax var dz = event.deltaz; example var syntheticevent = new wheelevent("syntheticwheel", {"deltaz": 4, "deltamode": 0}); console.log(syntheticevent.deltaz); specifications specification status comment document object model (dom) level 3 events specificationthe def
inition of 'wheelevent.deltaz' in that specification. obsolete
initial def
inition. ...
Window: animationcancel event - Web APIs
nt. ...
....addeventlistener('animationcancel', () => { console.log('animation canceled'); }); the same, but using the onanimationcancel property instead of addeventlistener(): window.onanimationcancel = () => { console.log('animation canceled'); }; see a live example of this event. specifications specification status comment css animations working draft
initial def
inition ...
Window: copy event - Web APIs
the copy event fires when the user
initiates a copy action through the browser's user interface. bubbles yes cancelable yes interface clipboardevent event handler property oncopy the original target for this event is the element that was the intended target of the copy action. you can listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on the element: copy event. ...
... handler property oncopy the original target for this event is the element that was the intended target of the copy action. you can listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on the element: copy event. examples window.addeventlistener('copy', (event) => { console.log('copy action
initiated') }); specifications specification status clipboard api and events working draft ...
Window: cut event - Web APIs
the cut event is fired when the user has
initiated a "cut" action through the browser's user interface. bubbles yes cancelable yes interface clipboardevent event handler property oncut the original target for this event is the element that was the intended target of the cut action. you can listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on the element: cut event. ...
...event handler property oncut the original target for this event is the element that was the intended target of the cut action. you can listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on the element: cut event. examples window.addeventlistener('cut', (event) => { console.log('cut action
initiated') }); specifications specification status clipboard api and events working draft ...
Window.devicePixelRatio - Web APIs
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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webview...
...m; text-align: justify; text-justify: auto; } .pixel-ratio { position: relative; margin: auto; height: 1.2em; text-align: right; bottom: 0; right: 1em; font-weight: bold; } result specifications specification status comment css object model (cssom) view modulethe def
inition of 'window.devicepixelratio' in that specification. working draft
initial def
inition 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung inter...
Window: load event - Web APIs
living standard this links to the section in the steps that are carried out at the end of loading a document. 'load' events are fired at many elements too. and note there are many places in the specification that refer to things that can "delays the loa...
...xtcontent = log.textcontent + `readystate: ${document.readystate}\n`; }); document.addeventlistener('domcontentloaded', (event) => { log.textcontent = log.textcontent + `domcontentloaded\n`; }); result specifications specification status comment ui eventsthe def
inition of 'load' in that specification. working draft html living standardthe def
inition of 'load event' in that specification. living standard this links to the section in the steps that are carried out at the end of loading a document. 'load' events are fired at many elements too. and note there are many places in the specification that refer to things that can "delays the load event". ...
Window.matchMedia() - Web APIs
lass="mq-value"></span> a simple <span> to receive the output. ...
...alue { font: 18px arial, sans-serif; font-weight: bold; color: #88f; padding: 0.4em; border: 1px solid #dde; } result see testing media queries programmatically for additional code examples. specifications specification status comment css object model (cssom) view modulethe def
inition of 'window.matchmedia()' in that specification. working draft
initial def
inition ...
Window: paste event - Web APIs
the paste event is fired when the user has
initiated a "paste" action through the browser's user interface. bubbles yes cancelable yes interface clipboardevent event handler property onpaste the original target for this event is the element that was the intended target of the paste action. you can listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on the element: paste event. ...
...ler property onpaste the original target for this event is the element that was the intended target of the paste action. you can listen for this event on the window interface to handle it in the capture or bubbling phases. for full details on this event please see the page on the element: paste event. examples window.addeventlistener('paste', (event) => { console.log('paste action
initiated') }); specifications specification status clipboard api and events working draft ...
Window.requestAnimationFrame() - Web APIs
refresh callback request. example in this example, an element is animated for 2 seconds (2000 milliseconds). the element moves at a speed of 0.1px/ms to the right, so its relative position (in css pixels) can be calculated in function of the time elapsed since the start of the animation (in milliseconds) with 0.1 * elapsed. the element's final position is 200px (0.1 * 2000) to the right of its
initial position. const element = document.getelementbyid('some-element-you-want-to-animate'); let start; function step(timestamp) { if (start === undefined) start = timestamp; const elapsed = timestamp - start; // `math.min()` is used here to make sure that the element stops at exactly 200px. element.style.transform = 'translatex(' + math.min(0.1 * elapsed, 200) + 'px)'; if (elapsed...
...min(0.1 * elapsed, 200) + 'px)'; if (elapsed < 2000) { // stop the animation after 2 seconds window.requestanimationframe(step); } } window.requestanimationframe(step); notes edge versions below 17 and internet explorer do not reliably fire requestanimationframe before the paint cycle. specification specification status comment html living standardthe def
inition of 'requestanimationframe' in that specification. living standard no change, supersedes the previous one. timing control for script-based animationsthe def
inition of 'requestanimationframe' in that specification. obsolete
initial def
inition ...
Window.screen - Web APIs
...
... screen on which the current window is being rendered. syntax let screenobj = window.screen; example if (screen.pixeldepth < 8) { // use low-color version of page } else { // use regular, colorful page } specifications specification status comment css object model (cssom) view modulethe def
inition of 'window.screen' in that specification. working draft
initial def
inition. ...
Window.scrollTo() - Web APIs
...
... is effectively the same as this method. for relative scrolling, see window.scrollby(), window.scrollbylines(), and window.scrollbypages(). for scrolling elements, see element.scrolltop and element.scrollleft. specifications specification status comment css object model (cssom) view modulethe def
inition of 'window.scroll()' in that specification. working draft
initial def
inition. ...
Window.self - Web APIs
...
...lent: var w1 = window; var w2 = self; var w3 = window.window; var w4 = window.self; // w1, w2, w3, w4 all strictly equal, but only w2 will function in workers specifications specification status comment html living standardthe def
inition of 'window.self' in that specification. living standard no difference from the latest snapshot html 5.1 html 5.1the def
inition of 'window.self' in that specification. recommendation no difference from the html5 html5the def
inition of 'window.self' in that specification. recommendation first snapshot containing the def
inition of window.self. ...
Window - Web APIs
ndicating whether the current context is secure (true) or not (false). windoworworkerglobalscope.origin read only returns the global object's origin, serialized as a string. (this does not yet appear to be implemented in any browser.) deprecated properties window.content and window._content read only returns a reference to the content element in the current window. since firefox 57 (
initially nightly-only), both versions are only available from chrome (privileged) code, and not available to the web anymore. window.defaultstatus gets/sets the status bar text for the given window. window.dialogarguments read only gets the arguments passed to the window (if it's a dialog box) at the time window.showmodaldialog() was called. this is an nsiarray. window.directories synony...
... normally. also available via the onanimationend property. animationiteration fired when an animation iteration has completed. also available via the onanimationiteration property. animationstart fired when an animation starts. also available via the onanimationstart property. clipboard events clipboardchange fired when the system clipboard content changes. copy fired when the user
initiates a copy action through the browser's user interface. also available via the oncopy property. cut fired when the user
initiates a cut action through the browser's user interface. also available via the oncut property. paste fired when the user
initiates a paste action through the browser's user interface. also available via the onpaste property. connection events offline fired whe...
WindowOrWorkerGlobalScope.clearTimeout() - Web APIs
living standard ...
...tes passing an invalid id to cleartimeout() silently does nothing; no exception is thrown. specifications specification status comment html living standardthe def
inition of 'windoworworkerglobalscope.cleartimeout()' in that specification. living standard method moved to the windoworworkerglobalscope mixin in the latest spec. html living standardthe def
inition of 'cleartimeout()' in that specification. living standard ...
WindowOrWorkerGlobalScope.isSecureContext - Web APIs
...
...ope interface returns a boolean indicating whether the current context is secure (true) or not (false). syntax var isitsecure = self.issecurecontext; // or just issecurecontext value a boolean. specifications specification status comment secure contextsthe def
inition of 'windoworworkerglobalscope.issecurecontext' in that specification. candidate recommendation
initial def
inition. ...
WindowOrWorkerGlobalScope.queueMicrotask() - Web APIs
engines. it creates a microtask by using a promise that resolves immediately. ...
...if (typeof window.queuemicrotask !== "function") { window.queuemicrotask = function (callback) { promise.resolve() .then(callback) .catch(e => settimeout(() => { throw e; })); // report exceptions }; } specifications specification status comment html living standardthe def
inition of 'self.queuemicrotask()' in that specification. living standard
initial def
inition ...
WorkerNavigator - Web APIs
properties the workernavigator interface implements properties from the navigatorid, navigatorlanguage, navigatoronline, navigatordatastore, and navigatorconcurrenthardware interfaces. workernavigator.connectionread only provides a networkinformation object containing information about the network connection of a device. ...
...ecko', on any browser. this property is kept only for compatibility purposes. navigatorid.useragentread only returns the user agent string for the current browser. methods the workernavigator interface implements methods from the navigatorid, navigatorlanguage and navigatoronline interfaces. specifications specification status comment html living standardthe def
inition of 'workernavigator' in that specification. living standard ...
XMLDocument - Web APIs
...
... properties from: document xmldocument.async used with xmldocument.load() to indicate an asynchronous request. methods also inherits methods from: document xmldocument.load() loads an xml document. specifications specification status comment domthe def
inition of 'xmldocument' in that specification. living standard no changes. dom4the def
inition of 'xmldocument' in that specification. obsolete
initial def
inition. ...
Sending and Receiving Binary Data - Web APIs
var req = new xmlhttprequest(); req.open("post", url, true); // set headers and mime-type appropriately req.setrequestheader("content-length", 741); req.sendasbinary(abody); line 4 sets the content-length header to 741, indicating that the data is 741 bytes long. obviously you need to change this value based on the actual size of the data being sent. line 5 uses the sendasbinary() method to
initiate the request. note: this non-standard sendasbinary method is considered deprecated as of gecko 31 (firefox 31 / thunderbird 31 / seamonkey 2.28) and will be removed soon. the standard send(blob data) method can be used instead as explained above. you can also send binary content by passing an instance of the nsifileinputstream to send(). in that case, you don't have to set the content-length...
...ry content by passing an instance of the nsifileinputstream to send(). in that case, you don't have to set the content-length header yourself, as the information is fetched from the stream automatically: // make a stream from a file. ...
Synchronous and asynchronous requests - Web APIs
cate that the request should be handled asynchronously. line 3 creates an event handler function object and assigns it to the request's onload attribute. this handler looks at the request's readystate to see if the transaction is complete in line 4; if it is, and the http status is 200, the handler dumps the received content. if an error occurred, an error message is displayed. line 15 actually
initiates the request. the callback routine is called whenever the state of the request changes. example: writing a function to read an external file in some cases, you must read many external files. this is a standard function which uses the xmlhttprequest object asynchronously in order to switch the content of the read file to a specified listener. function xhrsuccess() { this.callback.apply(...
...ent, 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 the request. example: using a timeout you can use a timeout to prevent your code from hanging while waiting for a read to finish. this is done by setting the value of the timeout property on the xmlhttprequest object, as shown in the code below: function loadfile(url, timeout, callback) { var args = array.prototype.slice.call(arguments, 3); var xhr = new xmlhttprequest(); xhr.
XMLHttpRequest.open() - Web APIs
note: calling this method for an already active request (one for which open() has already been called) is the equivalent of calling abort(). syntax xmlhttprequest.open(method, url[, async[, user[, password]]]) parameters method the http request method to use, such as "get", "post", "put", "delete", etc. ignored for non-http(s) urls. url a domstring representing the url to send the request to. async optional an optional boolean parameter, defaulting to true, indicating whether or not to perform the operation asynchronously. if this value is false, the send() method does not return until the response is received. ...
... on the main thread entirely. synchronous requests are permitted in workers. user optional the optional user name to use for authentication purposes; by default, this is the null value. password optional the optional password to use for authentication purposes; by default, this is the null value. specifications specification status comment xmlhttprequestthe def
inition of 'open()' in that specification. living standard whatwg living standard ...
XMLHttpRequest.readyState - Web APIs
3 loading downloading; responsetext holds partial data. 4 done the operation is complete. unsent the xmlhttprequest client has been created, but the open() method hasn't been called yet. opened open() method has been invoked. during this state, the request headers can be set using the setrequestheader() method and the send() method can be called which will
initiate the fetch. headers_received send() has been called and the response headers have been received. loading response's body is being received. if responsetype is "text" or empty string, responsetext will have the partial text response as it loads. done the fetch operation is complete. this could mean that either the data transfer has been completed successfully or failed. the state names...
...responsetype is "text" or empty string, responsetext will have the partial text response as it loads. done the fetch operation is complete. this could mean that either the data transfer has been completed successfully or failed. the state names are different in versions of internet explorer earlier than 11. instead of unsent, opened, headers_received, loading and done, the names readystate_un
initialized (0), readystate_loading (1), readystate_loaded (2), readystate_interactive (3) and readystate_complete (4) are used. example var xhr = new xmlhttprequest(); console.log('unsent', xhr.readystate); // readystate will be 0 xhr.open('get', '/api', true); console.log('opened', xhr.readystate); // readystate will be 1 xhr.onprogress = function () { console.log('loading', xhr.readystate)...
XMLHttpRequest.send() - Web APIs
e body parameter is ignored and the request body is set to null. if no accept header has been set using the setrequestheader(), an accept header with the type "*/*" (any type) is sent. syntax xmlhttprequest.send(body) parameters body optional a body of data to be sent in the xhr request. this can be: a document, in which case it is serialized before being sent. an xmlhttprequestbody
init, which per the fetch spec can be a blob, buffersource, formdata, urlsearchparams, or usvstring object. null if no value is specified for the body, a default value of null is used. the best way to send binary content (e.g. in file uploads) is by using an arraybufferview or blob in conjunction with the send() method. return value undefined. exceptions exception description ...
...d"); xhr.onreadystatechange = function() { // call a function when the state changes. if (this.readystate === xmlhttprequest.done && this.status === 200) { // request finished. do processing here. } } xhr.send("foo=bar&lorem=ipsum"); // xhr.send(new int8array()); // xhr.send(document); specifications specification status comment xmlhttprequestthe def
inition of 'send()' in that specification. living standard whatwg living standard ...
XRFrame.getViewerPose() - Web APIs
...
...n the xrframe passed into the callback. viewerpose = xrframe.getviewerpose(xrreferencespace); if (viewerpose) { /* render the pose's views */ } to see a complete example, take a look at movement, orientation, and motion. specifications specification status comment webxr device apithe def
inition of 'xrframe.getviewerpose()' in that specification. working draft
initial def
inition. ...
XRFrame.session - Web APIs
...
...ty returns the xrsession object that generated the frame. syntax var xrsession = xrframe.session; value a xrsession object representing the webxr session for which this xrframe describes the object positions and orientations. specifications specification status comment webxr device apithe def
inition of 'xrframe.session' in that specification. working draft
initial def
inition. ...
XRFrameRequestCallback - Web APIs
...
...ack) parameters domhighrestimestamp a timestamp corresponding to the returned xrframe. xrframe an xrframe representing a snapshot of the state of all of the tracked objects for the xrsession. return value none. specifications specification status comment webxr device apithe def
inition of 'xrframerequestcallback' in that specification. working draft
initial def
inition. ...
XRInputSource.gripSpace - Web APIs
...
...enting the position and orientation that are described by gripspace. if a valid pose is returned, a method mydrawmeshusingtransform() is called to draw the controller's mesh transformed using the grip pose's transform matrix. specifications specification status comment webxr device apithe def
inition of 'xrinputsource.gripspace' in that specification. working draft
initial def
inition. ...
XRInputSourceArray.length - Web APIs
...
... each describing a button and what should happen when it's clicked. the first takes the user to an amazon.com search for vr controllers, and the second calls a quitgame() function to start shutting the game program down. specifications specification status comment webxr device apithe def
inition of 'xrinputsourcearray.length' in that specification. working draft
initial def
inition. ...
XRInputSourceEvent() - Web APIs
the xrinputsourceevent() constructor creates and returns a new xrinputsourceevent object describing an event (state change) which has occurred on a webxr user input device represented by an xrinputsource. syntax newinputsourceevent = new xrinputsourceevent(type, event
initdict); parameters type a domstring indicating which of the input source events the new object will represent. permitted values are listed under event types below. event
initdict an object based on the xrinputsourceevent
init dictionary which contains the values to assign to the new event's properties. return value a new xrinputsourceevent object representing the event described by the given type and event
initdict. event types select sent to an xrsession when the sending input source has fully completed a ...
...t/whatever) objects in the scene. xrsession.addeventlistener("select", event => { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (targetraypose) { let hit = myhittest(targetraypose.transform); if (hit) { /* handle the hit */ } } }); specifications specification status comment webxr device apithe def
inition of 'xrinputsourceevent' in that specification. working draft
initial def
inition. ...
XRInputSourceEvent - Web APIs
device such as a hand controller, gaze tracking system, or motion tracking system. more specifically, they represent a change in the state of an xrinputsource. to learn more about handling inputs in a webxr project, see the article inputs and input sources. constructor xrinputsourceevent() creates and returns a new xrinputsourceevent object whose properties match those provided in the event
initdict dictionary provided. properties frame read only an xrframe object providing the needed information about the event frame during which the event occurred. this frame may have been rendered in the past rather than being a current frame. because this is an event frame, not an animation frame, you cannot call the xrframe method getviewerpose() on it; instead, use getpose(). inputsource re...
...t/whatever) objects in the scene. xrsession.addeventlistener("select", event => { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (targetraypose) { let hit = myhittest(targetraypose.transform); if (hit) { /* handle the hit */ } } }); specifications specification status comment webxr device apithe def
inition of 'xrinputsourceevent' in that specification. working draft
initial def
inition. ...
XRInputSourcesChangeEvent.session - Web APIs
...
... which the input source list change event applies. syntax let inputssession = xrinputsourceschangeevent.session; value an xrsession indicating the webxr session to which the input source list change applies. specifications specification status comment webxr device apithe def
inition of 'xrinputsourceschangeevent.session' in that specification. working draft
initial def
inition. ...
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
...
...formed in this reference space. you can see code similar to this in use in our broader webxr tutorial article called movement, orientation, and motion. in particular, check out the section called starting the webxr session. specifications specification status comment webxr device apithe def
inition of 'getoffsetreferencespace()' in that specification. working draft
initial def
inition. ...
XRReferenceSpace - Web APIs
...
...ing straight up relative to the previous world orientation. geometry the native origin of any xrreferencespace is always configured so that +x is considered to be to the right, +y is upward, and +z is "backward" or toward the user. specifications specification status comment webxr device apithe def
inition of 'xrreferencespace' in that specification. working draft
initial def
inition. ...
XRReferenceSpaceEvent() - Web APIs
the xrreferencespaceevent() constructor is used to create a new xrreferencespaceevent object, which represents an event regarding the state of a webxr reference space object, xrreferencespace. currently, only the reset event is defined using this type. syntax let refspaceevent = new xrreferencespaceevent(type, event
initdict); parameters type a domstring indicating the event type which has occurred. currently, this is always reset. event
initdict an object based on the xrreferencespaceevent
init dictionary, containing data used to
initialize the new event object. the properties of this object are: referencespace the xrreferencespace from which the event originated. transform an xrrigidtransform which maps the old coordinate system (from before the changes indicated by this e...
...ncespaceevent
init dictionary, containing data used to
initialize the new event object. the properties of this object are: referencespace the xrreferencespace from which the event originated. transform an xrrigidtransform which maps the old coordinate system (from before the changes indicated by this event) to the new coordiante system. return value a new xrreferencespaceevent object,
initialized as defined by the input parameters. specifications specification status comment webxr device apithe def
inition of 'xrreferencespaceevent()' in that specification. working draft
initial def
inition. ...
XRReferenceSpaceEvent.referenceSpace - Web APIs
...
...encespace specifies the reference space which is the originator of the event. syntax let refspace = xrreferencespaceevent.referencespace; value an xrreferencespace indicating the source of the event. examples specifications specification status comment webxr device apithe def
inition of 'xrreferencespaceevent.referencespace' in that specification. working draft
initial def
inition. ...
XRReferenceSpaceEvent - Web APIs
the webxr device api interface xrreferencespaceevent represents an event sent to an xrreferencespace. currently, the only event that uses this type is the reset event. constructor xrreferencespaceevent() returns a new xrreferencespaceevent with the specified type and configured using the values in the given xrreferencespaceevent
init dictionary. properties in addition to inheriting the properties available on the parent interface, event, xrreferencespaceevent objects include the following properties: referencespace read only an xrreferencespace indicating the reference space that generated the event. transform read only an xrrigidtransform object indicating the position and orientation of the specified referencespace's native origin after the event, defined relative to the c...
...s native origin is changed due to a discontinuity, recalibration, or device reset. this is an opportunity for your app to update any stored transforms, position/orientation information, or the like—or to dump any cached values based on the reference's space's origin so you can recompute them as needed. specifications specification status comment webxr device apithe def
inition of 'xrreferencespaceevent' in that specification. working draft
initial def
inition. ...
XRRenderState.inlineVerticalFieldOfView - Web APIs
...
...eld of view in radians used when computing projection matrices for "inline" xrsession objects. this option must be null for immersive sessions. syntax var adouble = xrrenderstate.inlineverticalfieldofview; value a number. specifications specification status comment unknownthe def
inition of 'xrrenderstate.inlineverticalfieldofview' in that specification. unknown
initial def
inition. ...
XRRenderState.baseLayer - Web APIs
...
... is the canvas into which webgl is going to draw. that context is passed into new xrwebgllayer() to create an xrwebgllayer which uses the contents of the webgl context gl as the source of the world's image during presentation. specifications specification status comment webxr device apithe def
inition of 'xrrenderstate.baselayer' in that specification. working draft
initial def
inition. ...
XRRigidTransform.inverse - Web APIs
...
...the viewer's position and orientation. the inverse's matrix is multiplied by the object's matrix to get the model view matrix, which is then passed into the shader program by setting a uniform to contain that information. specifications specification status comment webxr device apithe def
inition of 'xrrigidtransform.inverse' in that specification. working draft
initial def
inition. ...
XRRigidTransform.matrix - Web APIs
...
...pecified to position and orient it. let transform = new xrrigidtransform( {x: 0, y: 0.5, z: 0.5}, {x: 0, y: -0.5, z: -0.5, w: 1}); drawglobject("magic-lamp", transform.matrix); specifications specification status comment webxr device apithe def
inition of 'xrrigidtransform.matrix' in that specification. working draft
initial def
inition. ...
XRRigidTransform.position - Web APIs
value a read-only dompointreadonly indicating the 3d position component of the transform matrix. the units are meters. note: the w component of the point is always 1.0. ...
...gets passed into the refspacecreated() function. for immersive spaces, the specified space is simply saved for future use. however, for inline sesions, we know we're in a space not automatically adjusted for floor level, so we request an offset reference space to shift the viewer's height to 1.5 meters above the presumed floor level of 0 meters. that new reference space is used instead of the one
initially received. finally, an animation frame request is submitted. specifications specification status comment webxr device apithe def
inition of 'xrrigidtransform.position' in that specification. working draft
initial def
inition. ...
XRSession.end() - Web APIs
...
...ps related to shutting down the session have completed. you can use the promise to do things like update ui elements to reflect the shut down connection, trigger application shut down, or whatever else you might need to do. example specifications specification status comment webxr device apithe def
inition of 'xrsession.end' in that specification. working draft
initial def
inition. ...
XRSession.inputSources - Web APIs
...
... be advised when the contents of the session's connected devices list changes. you can then either get the value of inputsources to examine the list, or you can refer to a reference to the list that you've previously saved. specifications specification status comment webxr device apithe def
inition of 'xrsession.inputsources' in that specification. working draft
initial def
inition. ...
XRSession.onend - Web APIs
...
...ed after the xr session ends and all related hardware-specific routines are completed. syntax xrsession.onend = function(event) { ... }; example xrsession.onend = function(event) { console.log("the xr session has ended") } specifications specification status comment webxr device apithe def
inition of 'xrsession.onend' in that specification. working draft
initial def
inition. ...
XRSession.requestAnimationFrame() - Web APIs
...
...rsessionended) // do necessary session setup here. // begin the session’s animation loop. xrsession.requestanimationframe(onxranimationframe) }) } function onxrsessionended() { xrsession = null } specifications specification status comment webxr device apithe def
inition of 'xrsession.requestanimationframe' in that specification. working draft
initial def
inition. ...
XRSession.updateRenderState() - Web APIs
the specified object may have any combination of the following fields. ...
...d to associate the new xrwebgllayer. function onxrsessionstarted(xrsession) { let glcanvas = document.createelement("canvas"); let gl = glcanvas.getcontext("webgl", { xrcompatible: true }); loadwebglresources(); xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl) }); } specifications specification status comment webxr device apithe def
inition of 'xrsession.updaterenderstate()' in that specification. working draft
initial def
inition. ...
XRSessionEvent - Web APIs
the webxr device api's xrsessionevent interface describes an event which indicates the change of the state of an xrsession. these events occur, for example, when the session ends or the visibility of its context changes. constructor xrsessionevent() creates and returns a new xrsessionevent object configured using the specified xrsessionevent
init object's values as available. properties in addition to properties inherited from its parent interface, event, xrsessionevent provides the folllowing: session read only the xrsession to which the event refers. methods while xrsessionevent defines no methods, it inherits methods from its parent interface, event. session event types the following events are represented using the xrsessionevent interface, and are permitted values for it...
...gure a worker that handles rendering the scene. xrsession.addeventlistener("visibilitystate", e => { switch(e.session.visibilitystate) { case "visible": case "visible-blurred": mysessionvisible(true); break; case "hidden": mysessionvisible(false); break; } }); specifications specification status comment webxr device apithe def
inition of 'xrsessionevent' in that specification. working draft
initial def
inition. ...
XRSystem - Web APIs
...
... instead call end() to end the current session. when the returned promise resolves, we set xrsession to null to record the fact that we no longer have an ongoing session. that way, if the user clicks the button again, a new session will start. specifications specification status comment webxr device apithe def
inition of 'xr' in that specification. working draft
initial def
inition. ...
XRView - Web APIs
...
... getviewerpose(), as appropriate for yoru needs. the xrpose returned will then be used to actuall render the scene for the current frame. you can find a more extensive and complete example in our article movement, orientation, and motion. specifications specification status comment webxr device apithe def
inition of 'xrview' in that specification. working draft
initial def
inition. ...
XRViewerPose.views - Web APIs
...
...he framebuffer for renderijng to the corresponding eye on the output device. this code is derived from drawing a frame in movement, orientation, and motion: a webxr example. you can see more context and see much more on that page. specifications specification status comment webxr device apithe def
inition of 'xrviewerpose.views' in that specification. working draft
initial def
inition. ...
XRViewerPose - Web APIs
...
...y in the framebuffer for renderijng to the corresponding eye on the output device. this code is derived from drawing a frame in movement, orientation, and motion: a webxr example. you can see more context and see much more on that page. specifications specification status comment webxr device apithe def
inition of 'xrviewerpose' in that specification. working draft
initial def
inition. ...
XRViewport.x - Web APIs
...
...is given by the width and height properties. syntax x = xrviewport.x; value the offset from the left edge of the rendering surface to the left edge of the viewport, in pixels. examples see the main xrviewport page for examples. specifications specification status comment webxr device apithe def
inition of 'xrviewport.x' in that specification. working draft
initial def
inition. ...
ARIA: figure role - Accessibility
e on the aria-label on the element with the figure role or on the <figure> element. keyboard interactions no role specific keyboard interactions. required javascript features no role specific javascript requirements. if you don't have control over the html semantics, you can improve the accessibility of html by adding these roles and properties with javascript. ...
... recommendation screen reader support tbd ...
ARIA: Main role - Accessibility
working draft screen reader support tbd ...
... roles present on a page, allowing non-screen reader users to also quickly identify and navigate to large sections of the document. landmarks browser extension specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'aria navigtion role' in that specification. recommendation wai-aria authoring practicesthe def
inition of 'navigation landmark role' in that specification. working draft screen reader support tbd ...
WAI-ARIA Roles - Accessibility
r browse modes to use the document mode to read the content contained within this element.aria: feed rolea 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 inf
initely 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. a figure is generally considered to be one or more images, code snippets, or other content that puts across information in a different way to a regular flow of text.aria: form rolethe form landmark role can be use...
...ning 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. ...
Accessibility documentation index - Accessibility
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 inf
initely 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 used to identify a figure inside page content where appropriate semantics do not already exist. a figure is generally considered to be one or more images, code snippets, or other content that puts across informati...
..., 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 readers or magnifiers. 79 widgets accessibility this page was auto-generated because a user created a sub-page to this page. 80 overview accessibility, javascript, landing, needsu...
-moz-force-broken-image-icon - CSS: Cascading Style Sheets
n to be shown even when a broken image has an alt attribute. syntax values <integer> a value of 1 means that the broken image icon is shown even if the image has an alt attribute. when the value 0 is used the image will act as usual and only display the alt attribute. note: even if the value is set to 1 the alt attribute will still be displayed, alongside the broken image icon. ...
...hown even when a broken image has an alt attribute. syntax values <integer> a value of 1 means that the broken image icon is shown even if the image has an alt attribute. when the value 0 is used the image will act as usual and only display the alt attribute. note: even if the value is set to 1 the alt attribute will still be displayed, alongside the broken image icon. ...
-moz-image-region - CSS: Cascading Style Sheets
e an image from the list-style-image property, this property specifies a region of the image that is used in place of the whole image. this allows elements to use different pieces of the same image to improve performance. /* keyword value */ -moz-image-region: auto; /* <shape> value */ -moz-image-region: rect(0, 8px, 4px, 4px); /* global values */ -moz-image-region: inherit; -moz-image-region:
initial; -moz-image-region: unset; the syntax is similar to the clip property. all four values are relative to the upper left corner of the image. note: for a system that works on any background, see -moz-image-rect(). syntax values auto automatically defines the region of the image to use. <shape> a shape defining the part of the image to use. the rect() function defines a rectangle to us...
... of the image. note: for a system that works on any background, see -moz-image-rect(). syntax values auto automatically defines the region of the image to use. <shape> a shape defining the part of the image to use. the rect() function defines a rectangle to use as shape. its parameters define the top, right, bottom, and left offsets of the edges of the image, in this order. formal def
inition
initial valueautoapplies toxul <image> elements and :-moz-tree-image, :-moz-tree-twisty, and :-moz-tree-checkbox pseudo-elements. note: -moz-image-region only works with <image> elements where the icon is specified using list-style-image. it will not work with xul <image src="url" />.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax <shape> | autowhere <shape> = rec...
-moz-outline-radius-bottomleft - CSS: Cascading Style Sheets
ons of the border box. the calc() function may be used as well. values <length> the radius of the circle defining the curvature of the bottom and left edges of the element, specified as a css <length>. <percentage> the radius of the circle defining the rounding of the bottom-left corner of the element, specified as the percentages of the bottom and left sides of the border box. ...
...e border box. the calc() function may be used as well. values <length> the radius of the circle defining the curvature of the bottom and left edges of the element, specified as a css <length>. <percentage> the radius of the circle defining the rounding of the bottom-left corner of the element, specified as the percentages of the bottom and left sides of the border box. ...
-moz-outline-radius-bottomright - CSS: Cascading Style Sheets
of the border box. the calc() function may be used as well. values <length> the radius of the circle defining the curvature of the bottom and right edges of the element, specified as a css <length>. <percentage> the radius of the circle defining the rounding of the bottom-right corner of the element, specified as the percentages of the bottom and right sides of the border box. ...
...order box. the calc() function may be used as well. values <length> the radius of the circle defining the curvature of the bottom and right edges of the element, specified as a css <length>. <percentage> the radius of the circle defining the rounding of the bottom-right corner of the element, specified as the percentages of the bottom and right sides of the border box. ...
-moz-outline-radius-topright - CSS: Cascading Style Sheets
imensions of the border box. the calc() function may be used as well. values <length> the radius of the circle defining the curvature of the top and right edges of the element, specified as a css <length>. <percentage> the radius of the circle defining the rounding of the top-right corner of the element, specified as the percentages of the top and right sides of the border box. ...
... of the border box. the calc() function may be used as well. values <length> the radius of the circle defining the curvature of the top and right edges of the element, specified as a css <length>. <percentage> the radius of the circle defining the rounding of the top-right corner of the element, specified as the percentages of the top and right sides of the border box. ...
-moz-user-focus - CSS: Cascading Style Sheets
the -moz-user-focus css property is used to indicate whether an element can have the focus. /* keyword values */ -moz-user-focus: normal; -moz-user-focus: ignore; /* global values */ -moz-user-focus: inherit; -moz-user-focus:
initial; -moz-user-focus: unset; by setting its value to ignore, you can disable focusing the element, which means that the user will not be able to activate the element. the element will be skipped in the tab sequence.
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete note: this property doesn't work for xul <xul:textbox> elements, because the textbox itself never takes focus. instead, xbl creates an anonymous html <input> element inside the textbox, and that element is what receives focus. you can stop th...
...ing keyboard focus by setting its tab index to -1, and from taking mouse focus by preventing the default action of mousedown events. syntax values ignore the element does not accept the keyboard focus and will be skipped in the tab order. normal the element can accept the keyboard focus. select-after ? select-before ? select-menu ? select-same ? select-all ? none ? formal def
inition
initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax ignore | normal | select-after | select-before | select-menu | select-same | select-all | none examples html <input class="ignored" value="the user cannot focus on this element."> css .ignored { -moz-user-focus: ignore; } specifications not part of any standard. a simil...
-moz-user-input - CSS: Cascading Style Sheets
in mozilla applications, -moz-user-input determines if an element will accept user input. /* keyword values */ -moz-user-input: none; -moz-user-input: enabled; -moz-user-input: disabled; /* global values */ -moz-user-input: inherit; -moz-user-input:
initial; -moz-user-input: unset; for elements that normally take user input, such as a <textarea>, the
initial value of -moz-user-input is enabled. note: -moz-user-input was one of the proposals leading to the proposed css 3 user-input property, which has not yet reached candidate recommendation (call for implementations). a similar property, user-focus, was proposed in early drafts of a predecessor of the css3 ui specification, but was rejected by the working group. syntax values none the element does not respond to user input, an...
...cepts user input. for textboxes, this is the default behavior. please note that this value is no longer supported in firefox 60 onwards (bug 1405087). disabled the element does not accept user input. however, this is not the same as setting disabled to true, in that the element is drawn normally. please note that this value is no longer supported in firefox 60 onwards (bug 1405087). formal def
inition
initial valueautoapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | none | enabled | disabled examples disabling user input for an element input.example { /* the user will be able to select the text, but not change it. */ -moz-user-input: disabled; } specifications not part of any standard. ...
-webkit-mask-attachment - CSS: Cascading Style Sheets
image's position is fixed within the viewport, or scrolls along with its containing block. ...
... -webkit-mask-attachment: inherit; -webkit-mask-attachment:
initial; -webkit-mask-attachment: unset; syntax values scroll if scroll is specified, the mask image scrolls within the viewport along with the block that contains the mask image. fixed if fixed is specified, the mask image does not scroll with its containing element, instead remaining stationary within the viewport. formal def
inition
initial valuescrollapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <attachment>#where <attachment> = scroll | fixed | local examples fixing a mask image to the viewport body { -webkit-mask-image: url('images/mask.png'); -webkit-mask-attachment: fixed; } specifications not part of any standard. ...
-webkit-mask-box-image - CSS: Cascading Style Sheets
<gradient> a -webkit-gradient function to be used as a mask image. none used to specify that a border box is to have no mask image. ...
...does not divide evenly into the border box. stretch the mask image is stretched to contain the border box exactly. round the mask image is stretched somewhat and repeated such that there is no partial mask image at the end of the border box. space the mask image is repeated as many times as possible without stretching. there is no partial mask image at the end of the border box. formal def
inition value not found in db! formal syntax syntax not found in db! examples setting an image .exampleone { -webkit-mask-box-image: url('mask.png'); } offsetting and filling an image .exampletwo { -webkit-mask-box-image: url('logo.png') 100 100 0 0 round round; } specifications not part of any standard. ...
-webkit-print-color-adjust - CSS: Cascading Style Sheets
the -webkit-print-color-adjust property is a non-standard css extension that can be used to force printing of background colors and images in browsers based on the webkit engine. /* keyword values */ -webkit-print-color-adjust: economy; -webkit-print-color-adjust: exact; /* global values */ -webkit-print-color-adjust: inherit; -webkit-print-color-adjust:
initial; -webkit-print-color-adjust: unset; syntax the -webkit-print-color-adjust property is specified as one of the keyword values listed below. values economy normal behavior. background colors and images are only printed if the user explicitly allows it in their browser's print settings dialog. exact background colors and images of the element to which this rule is applied are always printed, user's print settings a...
...bkit-print-color-adjust property is specified as one of the keyword values listed below. values economy normal behavior. background colors and images are only printed if the user explicitly allows it in their browser's print settings dialog. exact background colors and images of the element to which this rule is applied are always printed, user's print settings are overridden. formal def
inition value not found in db! formal syntax syntax not found in db! examples forcing white-on-black printing article { -webkit-print-color-adjust: exact; background: #222; color: #eee; } specifications not part of any standard, though there is a proposal in the csswg wiki to standardize it. ...
-webkit-tap-highlight-color - CSS: Cascading Style Sheets
tandard css property that sets the color of the highlight that appears over a link while it's being tapped. the highlighting indicates to the user that their tap is being successfully recognized, and indicates which element they're tapping on. -webkit-tap-highlight-color: red; -webkit-tap-highlight-color: transparent; /* for removing the highlight */ syntax values a <color value>. ...
...ss property that sets the color of the highlight that appears over a link while it's being tapped. the highlighting indicates to the user that their tap is being successfully recognized, and indicates which element they're tapping on. -webkit-tap-highlight-color: red; -webkit-tap-highlight-color: transparent; /* for removing the highlight */ syntax values a <color value>. ...
-webkit-touch-callout - CSS: Cascading Style Sheets
the -webkit-touch-callout css property controls the display of the default callout shown when you touch and hold a touch target. when a target is touched and held on ios, safari displays a callout information about the link. this property allows disabling that behavior. ...
...ri displays a callout information about the link. this property allows disabling that behavior. /* keyword values */ -webkit-touch-callout: default; -webkit-touch-callout: none; /* global values */ -webkit-touch-callout:
initial; -webkit-touch-callout: inherit; -webkit-touch-callout: unset; syntax values default the default callout is displayed. none the callout is disabled. formal def
inition
initial valuedefaultapplies toall elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax default | none examples turn off touch callout .example { -webkit-touch-callout: none; } specifications not part of any standard. apple has a description in the safari css reference. ...
::backdrop - CSS: Cascading Style Sheets
...
... dark grey-blue letterbox effect above and below where the backdrop is visible. normally that area is black, but its appearance has been altered by the css above. you can see this example in action or view or remix the code on glitch. specifications specification status comment fullscreen apithe def
inition of '::backdrop' in that specification. living standard
initial def
inition. ...
::grammar-error - CSS: Cascading Style Sheets
...
...owsers should highlight any flagged grammatical errors with the styles shown. html <p>my friends is coming to the party tonight.</p> css ::grammar-error { text-decoration: underline red; color: red; } result specifications specification status comment css pseudo-elements level 4the def
inition of '::grammar-error' in that specification. working draft
initial def
inition. ...
::spelling-error - CSS: Cascading Style Sheets
...
... flagged spelling errors with the styles shown. html <p contenteditable spellcheck="true">my friends are coegdfgfddffbgning to the party tonight.</p> css ::spelling-error { text-decoration: wavy red; } result specifications specification status comment css pseudo-elements level 4the def
inition of '::spelling-error' in that specification. working draft
initial def
inition. ...
:defined - CSS: Cascading Style Sheets
living standard browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the ...
... living standard browser compatibility the compatibility table on this page is generated from structured data. ...
:disabled - CSS: Cascading Style Sheets
reco...
...rall('#billing input[type="text"]'); // toggle the billing text fields for (var i = 0; i < billingitems.length; i++) { billingitems[i].disabled = !billingitems[i].disabled; } } result specifications specification status comment html living standardthe def
inition of ':disabled' in that specification. living standard no change. html5the def
inition of ':disabled' in that specification. recommendation defines the semantics of html and forms. selectors level 4the def
inition of ':disabled' in that specification. working draft no change. selectors level 3the def
inition of ':disabled' in that specification. recommendation defines the pseudo-class, but not the associated semantics. ...
:empty - CSS: Cascading Style Sheets
his is commonly used for buttons that rely solely on an icon to convey purpose. ...
...er a11y | go make things mdn understanding wcag, guideline 2.4 explanations understanding success criterion 2.4.4 | w3c understanding wcag 2.0 specifications specification status comment selectors level 4the def
inition of 'the :empty pseudo-class' in that specification. working draft changed to act like :-moz-only-whitespace. selectors level 3the def
inition of 'the :empty pseudo-class' in that specification. recommendation
initial def
inition ...
:enabled - CSS: Cascading Style Sheets
recomme...
...ype="text" id="secondfield" value="ipsum" disabled="disabled"><br> <input type="button" value="submit"> </form> css input:enabled { color: #2b2; } input:disabled { color: #aaa; } result specifications specification status comment html living standardthe def
inition of ':enabled' in that specification. living standard no change. html5the def
inition of ':enabled' in that specification. recommendation defines the semantics for html and forms. selectors level 4the def
inition of ':enabled' in that specification. working draft no change. selectors level 3the def
inition of ':enabled' in that specification. recommendation defines the pseudo-class, but not the associated semantics. ...
:first-child - CSS: Cascading Style Sheets
...
... <li>item 3.3</li> </ul> </li> </ul> css ul li { color: blue; } ul li:first-child { color: red; font-weight: bold; } result specifications specification status comment selectors level 4the def
inition of ':first-child' in that specification. working draft matching elements are not required to have a parent. selectors level 3the def
inition of ':first-child' in that specification. recommendation no change. css level 2 (revision 1)the def
inition of ':first-child' in that specification. recommendation
initial def
inition. ...
:focus-visible - CSS: Cascading Style Sheets
...
...ator is appearing and disappearing if a person is using mixed forms of input. for users with cognitive concerns, or who are less technologically literate, this lack of consistent behavior for interactive elements may be confusing. specifications specification status comment selectors level 4the def
inition of ':focus-visible' in that specification. working draft
initial def
inition. ...
:focus - CSS: Cascading Style Sheets
site some focus! tips for designing useful and usable focus indicators :focus { outline: none; } never just remove the focus outline (visible focus indicator) without replacing it with a focus outline that will pass wcag 2.1 sc 1.4.11 non-text contrast. quick tip: never remove css outlines specifications specification status comment html living standardthe def
inition of ':focus' in that specification. living standard defines html-specific semantics. selectors level 4the def
inition of ':focus' in that specification. working draft no change. selectors level 3the def
inition of ':focus' in that specification. recommendation no change. css level 2 (revision 1)the def
inition of ':focus' in that specification. recom...
...s' in that specification. living standard defines html-specific semantics. selectors level 4the def
inition of ':focus' in that specification. working draft no change. selectors level 3the def
inition of ':focus' in that specification. recommendation no change. css level 2 (revision 1)the def
inition of ':focus' in that specification. recommendation
initial def
inition. ...
:has() - CSS: Cascading Style Sheets
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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androi...
... only <a> elements that directly contain an <img> child: a:has(> img) matching <h1> elements that are followed by a <p> the following selector matches <h1> elements only if they have a <p> element directly following them: h1:has(+ p) specifications specification status comment selectors level 4the def
inition of ':has()' in that specification. working draft
initial def
inition 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung inter...
:hover - CSS: Cascading Style Sheets
ss to build an image gallery with full-size images that show only when the mouse moves over a thumbnail. see this demo for a possible cue. note: for an analogous effect, but based on the :checked pseudo-class (applied to hidden radioboxes), see this demo, taken from the :checked reference page. ...
...this demo for a possible cue. note: for an analogous effect, but based on the :checked pseudo-class (applied to hidden radioboxes), see this demo, taken from the :checked reference page. specifications specification comment feedback html living standardthe def
inition of ':hover' in that specification. whatwg html github issues selectors level 4the def
inition of ':hover' in that specification. allows :hover to be applied to any pseudo-element. css working group drafts github issues selectors level 3the def
inition of ':hover' in that specification. css level 2 (revision 1)the def
inition of ':hover' in that specification.
initial def
inition. ...
:indeterminate - CSS: Cascading Style Sheets
working draft no change. ...
...rue; } progress bar html <progress> css progress { margin: 4px; } progress:indeterminate { opacity: 0.5; background-color: lightgray; box-shadow: 0 0 2px 1px red; } result specifications specification status comment html living standardthe def
inition of ':indeterminate' in that specification. living standard no change. html5the def
inition of ':indeterminate' in that specification. recommendation defines the semantics of html and constraint validation. selectors level 4the def
inition of ':indeterminate' in that specification. working draft no change. ...
:lang() - CSS: Cascading Style Sheets
...
...1c' '\201d' '\2018' '\2019'; } :lang(fr) > q { quotes: '« ' ' »'; } :lang(de) > q { quotes: '»' '«' '\2039' '\203a'; } result specifications specification status comment selectors level 4the def
inition of ':lang()' in that specification. working draft adds wildcard language matching and comma-separated list of languages. selectors level 3the def
inition of ':lang()' in that specification. recommendation no significant change. css level 2 (revision 1)the def
inition of ':lang()' in that specification. recommendation
initial def
inition. ...
:nth-child() - CSS: Cascading Style Sheets
...
...1), .second span:nth-child(2n+1), .third span:nth-of-type(2n+1) { background-color: lime; } result specifications specification status comment selectors level 4the def
inition of ':nth-child' in that specification. working draft adds of <selector> syntax and specifies that matching elements are not required to have a parent. selectors level 3the def
inition of ':nth-child' in that specification. recommendation
initial def
inition. ...
:scope - CSS: Cascading Style Sheets
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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for andro...
... <div id="element-1.1"></div> <div id="element-1.2"></div> </div> <div id="element-2"> <div id="element-2.1"></div> </div> </div> <p> selected elements ids : <span id="results"></span> </p> result specifications specification status comment selectors level 4the def
inition of ':scope' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung inte...
:where() - CSS: Cascading Style Sheets
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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for an...
...lector> = '.' <ident-token><attribute-selector> = '[' <wq-name> ']' | '[' <wq-name> <attr-matcher> [ <string-token> | <ident-token> ] <attr-modifier>? ']'where <attr-matcher> = [ '~' | | | '^' | '$' | '*' ]? '='<attr-modifier> = i | s specifications specification status comment selectors level 4the def
inition of ':where()' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung int...
@charset - CSS: Cascading Style Sheets
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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for and...
... "utf-8"; /* invalid, more than one space */ @charset "utf-8"; /* invalid, there is a character (a space) before the at-rule */ @charset utf-8; /* invalid, without ' or ", the charset is not a css <string> */ specifications specification status comment css level 2 (revision 1)the def
inition of '@charset' in that specification. recommendation
initial def
inition 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung inter...
font-family - CSS: Cascading Style Sheets
the font-family css descriptor allows authors to specify the font family for the font specified in an @font-face rule. syntax /* <string> values */ font-family: "font family"; font-family: 'another font family'; /* <custom-ident> value */ font-family: examplefont; values <family-name> specifies the name of the font family. formal def
inition related at-rule@font-face
initial valuen/a (required)computed valueas specified formal syntax <family-name>where <family-name> = <string> | <custom-ident>+ examples setting the font family name @font-face { font-family: examplefont; src: url('examplefont.ttf'); } specifications specification status comment css fonts module level 3the def
inition of 'font-family' in that specification. candidate recommend...
...ted valueas specified formal syntax <family-name>where <family-name> = <string> | <custom-ident>+ examples setting the font family name @font-face { font-family: examplefont; src: url('examplefont.ttf'); } specifications specification status comment css fonts module level 3the def
inition of 'font-family' in that specification. candidate recommendation
initial def
inition ...
@keyframes - CSS: Cascading Style Sheets
containing the styles for that keyframe. you can list the keyframe percentages in any order; they will be handled in the order they should occur. valid keyframe lists if a keyframe rule doesn't specify the start or end states of the animation (that is, 0%/from and 100%/to), browsers will use the element's existing styles for the start/end states. this can be used to animate an element from its
initial state and back. properties that can't be animated in keyframe rules are ignored, but supported properties will still be animated. resolving duplicates if multiple keyframe sets exist for a given name, the last one encountered by the parser is used. @keyframes rules don't cascade, so animations never derive keyframes from more than one rule set. if a given animation time offset is duplicate...
... working draft ...
color-gamut - CSS: Cascading Style Sheets
...
...dation bt.2020 color space or more. the rec2020 gamut is larger than and includes the p3 gamut. examples html <p>this is a test.</p> css @media (color-gamut: srgb) { p { background: #f4ae8a; } } result specifications specification status comment media queries level 4the def
inition of 'color-gamut' in that specification. candidate recommendation
initial def
inition. ...
color - CSS: Cascading Style Sheets
the value must be nonnegative. ...
...* any color device with at least 8 bits per color component */ @media (min-color: 8) { p { color: #24ba13; } } result specifications specification status comment media queries level 4the def
inition of 'color' in that specification. candidate recommendation the value can now be negative, in which case it computes to false. media queriesthe def
inition of 'color' in that specification. recommendation
initial def
inition. the value must be nonnegative. ...
height - CSS: Cascading Style Sheets
the value must be nonnegative. ...
...ckground: yellow; } } /* maximum height */ @media (max-height: 40rem) { div { border: 2px solid blue; } } result specifications specification status comment media queries level 4the def
inition of 'height' in that specification. candidate recommendation the value can now be negative, in which case it computes to false. media queriesthe def
inition of 'height' in that specification. recommendation
initial def
inition. the value must be nonnegative. ...
monochrome - CSS: Cascading Style Sheets
the value must be nonnegative. ...
...any non-monochrome device */ @media (monochrome: 0) { p.no-mono { display: block; color: #ee3636; } } result specifications specification status comment media queries level 4the def
inition of 'monochrome' in that specification. candidate recommendation the value can now be negative, in which case it computes to false. media queriesthe def
inition of 'monochrome' in that specification. recommendation
initial def
inition. the value must be nonnegative. ...
overflow-block - CSS: Cascading Style Sheets
syntax the overflow-block feature is specified as a keyword value chosen from the list below. none content that overflows the block axis is not displayed. scroll content that overflows the block axis can be seen by scrolling to it. optional-paged content that overflows the block axis can be seen by scrolling to it, but page breaks can be manually triggered (such as via break-inside, etc.) to cause the following content to display on the following page. ...
...rci imperdiet sollicitudin. nunc id facilisis dui. proin elementum et massa et feugiat. integer rutrum ullamcorper eleifend. proin sit amet tincidunt risus. sed nec augue congue eros accumsan tincidunt sed eget ex.</p> css @media (overflow-block: scroll) { p { color: red; } } result specifications specification status comment media queries level 4the def
inition of 'overflow-block' in that specification. candidate recommendation
initial def
inition. ...
overflow-inline - CSS: Cascading Style Sheets
syntax the overflow-inline feature is specified as a keyword value chosen from the list below. none content that overflows the inline axis is not displayed. scroll content that overflows the inline axis can be seen by scrolling to it. examples html <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. nullam ac turpis eleifend, fringilla velit ac, aliquam tellus. ...
...c id facilisis dui. proin elementum et massa et feugiat. integer rutrum ullamcorper eleifend. proin sit amet tincidunt risus. sed nec augue congue eros accumsan tincidunt sed eget ex.</p> css p { white-space: nowrap; } @media (overflow-inline: scroll) { p { color: red; } } result specifications specification status comment media queries level 4the def
inition of 'overflow-inline' in that specification. candidate recommendation
initial def
inition. ...
width - CSS: Cascading Style Sheets
the value must be nonnegative. ...
... background: yellow; } } /* maximum width */ @media (max-width: 50rem) { div { border: 2px solid blue; } } result specifications specification status comment media queries level 4the def
inition of 'width' in that specification. candidate recommendation the value can now be negative, in which case it computes to false. media queriesthe def
inition of 'width' in that specification. recommendation
initial def
inition. the value must be nonnegative. ...
@supports - CSS: Cascading Style Sheets
browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check ou...
...y) { … /* css applied when the :is(…) selector and the `of` argument of :nth-child(…) are both supported */ } } specifications specification status comment css conditional rules module level 4the def
inition of '@supports' in that specification. editor's draft adds the selector() function. css conditional rules module level 3the def
inition of '@supports' in that specification. candidate recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewch...
Box alignment in grid layout - CSS: Cascading Style Sheets
id area it is placed into. the properties align-items and justify-items are applied to the grid container and set the align-self and justify-self properties as a group. this means that you can set alignment for all of your grid items at once, then override any items that need a different alignment by applying the align-self or justify-self property to the rules for the individual grid items. the
initial value for align-self and justify-self is stretch so the item will stretch over the entire grid area. the exception to this rule is where the item has an intrinsic aspect ratio, for example an image. in this case the item will be aligned to start in both dimensions in order that the image is not distorted. content alignment justify-content align-content place-content these properties de...
...-content place-content these properties deal with aligning the tracks of the grid when there is extra space to distribute. this scenario will occur if the tracks that you have defined total less than the total width of the grid container. gap and legacy grid-gap properties row-gap column-gap gap grid-row-gap grid-column-gap grid-gap the grid specification originally contained the def
inition for the properties grid-row-gap, grid-column-gap and grid-gap. these have since been moved into the box alignment specification and renamed to row-gap, column-gap, and gap. this allows them to be used for other layout methods where a gap between items makes sense. the updated properties have not yet been implemented in all browsers. therefore, to use the gap properties in grid layout, you sho...
CSS Box Alignment - CSS: Cascading Style Sheets
ods css traditionally had very limited alignment capabilities. we were able to align text using text-align, center blocks using auto margins, and in table or inline-block layouts using the vertical-align property. alignment of text is now covered by the inline layout and css text modules, and for the first time in box alignment we have full horizontal and vertical alignment capabilities. if you
initially learned flexbox then you may consider these properties to be part of the flexbox specification, and some of the properties are indeed listed in level 1 of flexbox. however the specification notes that the box alignment specification should be referred to as it may add additional capabilities over what is currently in flexbox. basic examples the following examples demonstrate how some of th...
...ify-items and align-items. distributed alignment the distributed alignment keywords are used with the align-content and justify-content properties. these keywords define what happens to any additional space after alignment subjects have been displayed. the values are as follows: stretch space-between space-around space-evenly for example, in flex layout items are aligned with flex-start
initially. working in a horizontal top to bottom writing mode such as english, with flex-direction as row the items start on the far left and any available space after displaying the items is placed after the items. if you set justify-content: space-between on the flex container, the available space is now shared out and placed between the items. there needs to be space available in the dimensio...
Spanning and Balancing Columns - CSS: Cascading Style Sheets
rticle> element, yet still spans the content as expected. when a spanner is introduced, it breaks the flow of columns and columns restart after the spanner, effectively creating a new set of column boxes. the content does not jump over a spanning element. limitations of column-span in the current level 1 specification there are only two allowable values for column-span. the value none is the
initial value and means the item does not span, remaining within a column. the value all means the item spans all of the columns. you cannot cause an item to span two out of three columns for example. things to watch out for if the spanning element is inside another element which has margins, padding and a border or a background color, it is possible to end up with the top of the box appearing above...
...e spanner. use spanning carefully and test at various breakpoints to make sure you get the intended effect. column filling and balancing a balanced set of columns is where all columns have approximately the same amount of content. filling and balancing comes into play when the amount of content does not match the amount of space provided, such as when a height is declared on the container. the
initial value of multicol for column-fill is balance. the value of balance means all columns are as balanced as is possible. in fragmented contexts such as paged media, only the last fragment is balanced. this means that on the last page the final set of column boxes will be balanced. there is a second value for balancing, balance-all, which attempts to balance all columns in fragmented contexts and ...
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
ay: flex to a container, the child items all become flex items arranged in a row. they will all stretch to be as tall as the tallest item, as that item is defining the height of the items on the cross axis. if your flex container has a height set, then the items will stretch to that height, regardless of how much content is in the item. the reason the items become the same height is that the
initial value of align-items, the property that controls alignment on the cross axis, is set to stretch. we can use other values to control how the items align: align-items: flex-start align-items: flex-end align-items: center align-items: stretch align-items: baseline in the live example below, the value of align-items is stretch. try the other values and see how all of the items align agai...
... on the main axis now that we have seen how alignment works on the cross axis, we can take a look at the main axis. here we only have one property available to us — justify-content. this is because we are only dealing with items as a group on the main axis. with justify-content we control what happens with available space, should there be more space than is needed to display the items. in our
initial example with display: flex on the container, the items display as a row and all line up at the start of the container. this is due to the
initial value of justify-content being flex-start. any available space is placed at the end of the items. the justify-content property accepts the same values as align-content. justify-content: flex-start justify-content: flex-end justify-content: ce...
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
created by comparing the total width of all the items with the container width. you could equally try out each example with flex-direction: column. the main axis would then be the column, and you would then need to compare the height of the items and that of the container they are in to work out the positive and negative free space. the flex-basis property the flex-basis property specifies the
initial size of the flex item before any space distribution happens. the
initial value for this property is auto. if flex-basis is set to auto then to work out the
initial size of the item the browser first checks if the main size of the item has an absolute size set. this would be the case if you had given your item a width of 200 pixels. in that case 200px would be the flex-basis for this item. if ...
...ve example i have three items in a flex container; i’ve given each a width of 200 pixels, and the container is 500 pixels wide. with flex-shrink set to 0 the items are not allowed to shrink and so they overflow the box. change the flex-shrink value to 1 and you will see each item shrink by the same amount, in order that all of the items now fit in the box. they have become smaller than their
initial width in order to do so. combining flex-shrink and flex-basis you could say that flex-shrink works in pretty much the same way as flex-grow. however there are two reasons why it isn’t quite the same. while it is usually subtle, defined in the specification is one reason why flex-shrink isn’t quite the same for negative space as flex-grow is for positive space: “note: the flex shrink...
Typical use cases of Flexbox - CSS: Cascading Style Sheets
ed evenly. split navigation another way to align items on the main axis is to use auto margins. this enables the design pattern of a navigation bar where one group of items are aligned left and another group aligned right. here we are using the auto margins technique described in using auto margins for main axis alignment. the items are aligned 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 th...
... .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 you might want to constrain the media object in your design. to prevent the image growing too large, add a max-width to the image. as that side of the media object is using the
initial values of flexbox it can shrink but not grow, and uses a flex-basis of auto. any width or max-width applied to the image will become the flex-basis. .image img { max-width: 100px; } you could also allow both sides to grow and shrink in proportion. if you set both sides to flex: 1, they will grow and shrink from a flex-basis of 0, so you will end up with two equal-sized columns. you could ...
Flow Layout and Overflow - CSS: Cascading Style Sheets
flow? giving an element a fixed height and width, then adding significant content to the box, creates a basic overflow example: the content goes into the box. once it fills the box, it continues to overflow in a visible way, displaying content outside the box, potentially displaying under subsequent content. the property that controls how overflow behaves is the overflow property which has an
initial value of visible. this is why we can see the overflow content. controlling overflow there are other values that control how overflow content behaves. to hide overflowing content use a value of hidden. this may cause some of your content to not be visible. using a value of scroll contains the content in its box and add scrollbars to enable viewing it. scrollbars will be added even if the c...
...esent time and adjust for your writing mode. indicating overflow in the level 3 overflow specification we have some properties which can help improve the way content looks in an overflow situation. inline-axis overflow the text-overflow property deals with text overflowing in the inline direction. it takes one of two values clip, in which case content is clipped when it overflows, this is the
initial value and therefore the default behaviour. we also have ellipsis which renders an ellipsis, which may be replaced with a better character for the language or writing mode in use. block-axis overflow there is also a proposal for a block-overflow property, although at the time of writing the name is still up for discussion. this proposal would enable the adding of an ellipsis when text overf...
Introduction to formatting contexts - CSS: Cascading Style Sheets
ent in a particular way. a block formatting context (bfc) will lay child elements out according to block layout rules, a flex formatting context will lay its children out as flex items, etc. each formatting context has specific rules about how layout behaves when in that context. block formatting contexts the outermost element in a document that uses block layout rules establishes the first, or
initial block formatting context. this means that every element inside the <html> element's block is laid out according to normal flow following the rules for block and inline layout. elements participating in a bfc use the rules outlined by the css box model, which defines how an element's margins, borders, and padding interact with other blocks in the same context. creating a new block formatting c...
...ntent alongside it, the border of the <div> now runs through the float. as explained in the guide to in-flow and out of flow elements, the float has been taken out of flow so the background and border of the div only contain the content and not the float. creating a new bfc would contain the float. a typical way to do this in the past has been to set overflow: auto or set other values than the
initial value of overflow: visible. setting overflow: auto created a new bfc containing the float. our <div> now becomes a mini-layout inside our layout. any child element will be contained inside it. the problem with using overflow to create a new bfc is that the overflow property is meant for telling the browser how you wish to deal with overflowing content. there are some occasions in which you...
Browser compatibility and Scroll Snap - CSS: Cascading Style Sheets
in firefox 68 the new version of the specification will be shipped and these old properties removed. in this article, we consider questions that might arise related to compatibility across browsers and versions of browsers when adding support for scroll-snap to your web site or app. what should i do if i used the old firefox implementation? if you have only used the old firefox implementation of the specification, with the properties that are detailed in scroll snap points, you should update your code to use the new specification. this will ensure your scroll snapping works in all browsers which implement the specification, including firefox. ...
...pe property has become a longhand, so the old shorthand syntax like scroll-snap-type:mandatory will stop working can i use the old implementation as a fallback? if you have already used the old implementation as a fallback, or feel you want to support users of old firefox (or -webkit prefixed safari), then you can continue to use the old specification as outlined in the example below. in this
initial example we have used the old specification alongside the current specification in order to make scroll snapping work in all browsers which support some form of scroll snapping. the example adds the scroll-snap-points-y and scroll-snap-destination properties, which are deprecated, to make scroll snapping work in firefox. we also added the scroll-snap-type property twice, once with the y axis v...
CSS selectors - CSS: Cascading Style Sheets
see the pseudo-class and pseudo-element specification tables for details on those. ...
...evel 3 recommendation added the ~ general sibling combinator and tree-structural pseudo-classes. made pseudo-elements use a :: double-colon prefix. additional attribute selectors css level 2 (revision 1) recommendation added the > child and + adjacent sibling combinators. added the universal and attribute selectors. css level 1 recommendation
initial def
inition. see the pseudo-class and pseudo-element specification tables for details on those. ...
Basic Shapes - CSS: Cascading Style Sheets
ide: circle(50%). the floated element has 20 pixels of padding, border and margin applied, and the shapes inspector highlights these reference boxes. when using a basic shape the reference box used by default is the margin-box. you can see in the screenshot that the shape is being defined with reference to that part of the box model. you can add the various box values after your basic shape def
inition. therefore the default behaviour is as if you have defined. .shape { shape-outside: circle(50%) margin-box; } you can therefore change this in order that your shape uses the different parts of the box model, for example to use the border. .shape { shape-outside: circle(50%) border-box; } what is worth noting is that the margin-box will clip the shape, therefore shapes created in refe...
... to the margin box. we will see this in the following examples of basic shapes. for an excellent description of references boxes as they apply to css shapes see understanding reference boxes for css shapes. inset() the inset() type defines a rectangle, which may not seem very useful as simply floating an item will give you a rectangular shape around it. however the inset() types enables the def
inition of offsets, thus pulling the content in over the shape. therefore inset() takes four values for the top, right, bottom and left values plus a final value for border-radius. the below css creates a rectangular shape inset from the reference box of the floated element 20 pixels from the top and bottom and 10 pixels from the left and right, with a border-radius value of 10 pixels. .shape { fl...
Layout and the containing block - CSS: Cascading Style Sheets
rest ancestor element that has the following: a transform or perspective value other than none a will-change value of transform or perspective a filter value other than none or a will-change value of filter (only works on firefox). a contain value of paint (e.g. contain: paint;) note: the containing block in which the root element (<html>) resides is a rectangle called the
initial containing block. it has the dimensions of the viewport (for continuous media) or the page area (for paged media). calculating percentage values from the containing block as noted above, when certain properties are given a percentage value, the computed value depends on the element's containing block. the properties that work this way are box model properties and offset properties: the h...
...thus, the paragraph's dimensions change based on the size of the browser window. <body> <section> <p>this is a paragraph!</p> </section> </body> body { background: beige; } section { width: 400px; height: 480px; margin: 30px; padding: 15px; background: lightgray; } p { position: fixed; width: 50%; /* == (50vw - (widt...
Specificity - CSS: Cascading Style Sheets
or: green; } h1 { color: purple; } ... with the following html ... <html> <body id="parent"> <h1>here is a title!</h1> </body> </html> ... will also render as: this is because the h1 selector targets the element specifically, but the green selector is only inherited from its parent. specifications specification status comment selectors level 4the def
inition of 'calculating a selector's specificity' in that specification. working draft add the specificity adjustment selector :where(). selectors level 3the def
inition of 'calculating a selector's specificity' in that specification. recommendation add pseudo-elements. css level 2 (revision 1)the def
inition of 'calculating a selector's specificity' in that specification. ...
... working draft add the specificity adjustment selector :where(). selectors level 3the def
inition of 'calculating a selector's specificity' in that specification. recommendation add pseudo-elements. css level 2 (revision 1)the def
inition of 'calculating a selector's specificity' in that specification. recommendation add pseudo-classes. css level 1the def
inition of 'cascading order' in that specification. recommendation
initial def
inition. ...
Syntax - CSS: Cascading Style Sheets
ons apply to every single element of a page in order to appropriately lay it out, and to style it. both properties and values are case-insensitive by default in css. the pair is separated by a colon, ':' (u+003a colon), and white spaces before, between, and after properties and values, but not necessarily inside, are ignored. there are more than 100 different properties in css and a nearly inf
inite number of different values. not all pairs of properties and values are allowed and each property defines what are the valid values. when a value is not valid for a given property, the declaration is deemed invalid and is wholly ignored by the css engine. css declaration blocks declarations are grouped in blocks, that is in a structure delimited by an opening brace, '{' (u+007b left curly brack...
...ignored. the last declaration of a block doesn't need to be terminated by a semi-colon, though it is often considered good style to do it as it prevents forgetting to add it when extending the block with another declaration. a css declaration block is visualized in the diagram below. note: the content of a css declaration block, that is a list of semi-colon-separated declarations, without the
initial and closing braces, can be put inside an html style attribute. css rulesets if style sheets could only apply a declaration to each element of a web page, they would be pretty useless. the real goal is to apply different declarations to different parts of the document. css allows this by associating conditions with declarations blocks. each (valid) declaration block is preceded by one or mor...
Cubic Bezier Generator - CSS: Cascading Style Sheets
drawbeziercurve(x1, y1, x2, y2); } const radius = 4; // place needed to draw the rulers const rulers = 30.5; const margin = 10.5; const basic_scale_size = 5; // size of 0.1 tick on the rulers var scaling; //limitation: scaling is computed once: if canvas.height/canvas.width change it won't be recalculated var dragsm = 0; // drag state machine: 0 = nodrag, others = object being dragged function
initcanvas() { // get the canvas element using the dom var canvas = document.getelementbyid('bezier'); // make sure we don't execute when canvas isn't supported if (canvas.getcontext) { // use getcontext to use the canvas for drawing var ctx = canvas.getcontext('2d'); scaling = math.min(canvas.height - rulers - margin, canvas.width - rulers - margin); ...
...this is not really yet a useful tool, but will be! ...
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
herefore, consider nearly all values as valid. unfortunately, these valid values can be used, via the var() functional notation, in a context where they might not make sense. properties and custom variables can lead to invalid css statements, leading to the new concept of valid at computed time. what happens with invalid variables? when the browser encounters an invalid var() substitution, the
initial or inherited value of the property is used. consider the code snippet below. html <p>this paragraph is
initial black.</p> css :root { --text-color: 16px; } p { color: blue; } p { color: var(--text-color); } as expected, the browser substitutes the value of --text-color in place of var(--text-color), but 16px is not a valid property value for color. after substitution, the property does...
... browser substitutes the value of --text-color in place of var(--text-color), but 16px is not a valid property value for color. after substitution, the property doesn’t make any sense. the browser handles this situation in two steps: check if the property color is inheritable. yes, but <p> doesn't have any parent with color property. so move on to the next step. set the value to its default
initial value, i.e., black. result the paragraph color will not be blue because invalid substitution is replaced by the
initial value, not by the fallback. if you had written color: 16px without any variable substitutes, then it was a syntax error. the previous declaration will then be used. note: while a syntax error in a css property / value pair will lead to the line being ignored, using a c...
<alpha-value> - CSS: Cascading Style Sheets
recommendation introduces <alpha-value> along with rgba() and hsla() functional notations. ...
... recommendation introduces <alpha-value> along with rgba() and hsla() functional notations. ...
attr() - CSS: Cascading Style Sheets
candidate recommendation added two optional parameters; can be ...
... specifications specification status comment css values and units module level 4the def
inition of 'attr()' in that specification. editor's draft changed it to work like var(). property values involving attr() are valid at parse time, and the validation of the attribute value is deferred to computed value time. css values and units module level 3the def
inition of 'attr()' in that specification. candidate recommendation added two optional parameters; can be used on all properties; may return values other than <string>. these changes are experimental and may be dropped during the cr phase if browser support is too small. css level 2 (revision 1)the def
inition of 'attr()' in that specification. recommendation lim...
background-blend-mode - CSS: Cascading Style Sheets
blending modes should be defined in the same order as the background-image property. if the blending modes' and background images' list lengths are not equal, it will be repeated and/or truncated until lengths match. syntax /* one value */ background-blend-mode: normal; /* two values, one per background */ background-blend-mode: darken, luminosity; /* global values */ background-blend-mode:
initial; background-blend-mode: inherit; background-blend-mode: unset; values <blend-mode> the blending mode to be applied. there can be several values, separated by commas. formal def
inition
initial valuenormalapplies toall elements. in svg, it applies to container elements, graphics elements, and graphics referencing elements.. it also applies to ::first-letter and ::first-line.inheritednoc...
...tr.png'); background-blend-mode: screen; } document.getelementbyid("select").onchange = function(event) { document.getelementbyid("div").style.backgroundblendmode = document.getelementbyid("select").selectedoptions[0].innerhtml; } console.log(document.getelementbyid('div')); specifications specification status comment compositing and blending level 1the def
inition of 'background-blend-mode' in that specification. candidate recommendation
initial def
inition ...
border-image-source - CSS: Cascading Style Sheets
request. the border-image-slice property is used to divide the source image into regions, which are then dynamically applied to the final border image. syntax /* keyword value */ border-image-source: none; /* <image> values */ border-image-source: url(image.jpg); border-image-source: linear-gradient(to top, red, yellow); /* global values */ border-image-source: inherit; border-image-source:
initial; border-image-source: unset; values none no border image is used. the appearance defined by border-style is displayed instead. <image> image reference to use for the border. formal def
inition
initial valuenoneapplies toall elements, except internal table elements when border-collapse is collapse. it also applies to ::first-letter.inheritednocomputed valuenone or the image with its u...
...ar-color-stop> = <color> && <color-stop-angle>?<angular-color-hint> = <angle-percentage>where <color-stop-length> = <length-percentage>{1,2}<color-stop-angle> = <angle-percentage>{1,2}<angle-percentage> = <angle> | <percentage> examples please see border-image for examples. specifications specification status comment css backgrounds and borders module level 3the def
inition of 'border-image-source' in that specification. candidate recommendation
initial def
inition ...
box-lines - CSS: Cascading Style Sheets
t module draft, and has been replaced by a newer standard. see flexbox for information about the current standard. the box-lines css property determines whether the box may have a single or multiple lines (rows for horizontally oriented boxes, columns for vertically oriented boxes). /* keyword values */ box-lines: single; box-lines: multiple; /* global values */ box-lines: inherit; box-lines:
initial; box-lines: unset; by default a horizontal box will lay out its children in a single row, and a vertical box will lay out its children in a single column. this behavior can be changed using the box-lines property. the default value is single, which means that all elements will be placed in a single row or column, and any elements that don't fit will simply be considered overflow. if a value...
...idered 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 lay out in a single row or column. multiple box elements layout in multiple rows or columns. formal def
inition
initial valuesingleapplies tobox elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax single | multiple examples simple usage example in the original version of the spec, box-lines allowed you to specify that you wanted your flex container's children to wrap onto multiple lines. this was only supported in webkit-based browsers, with a prefix. div { display...
box-orient - CSS: Cascading Style Sheets
box layout module draft, and has been replaced by a newer standard. see flexbox for information about the current standard. the box-orient css property sets whether an element lays out its contents horizontally or vertically. /* keyword values */ box-orient: horizontal; box-orient: vertical; box-orient: inline-axis; box-orient: block-axis; /* global values */ box-orient: inherit; box-orient:
initial; box-orient: unset; syntax the box-orient property is specified as one of the keyword values listed below. values horizontal the box lays out its contents horizontally. vertical the box lays out its contents vertically. inline-axis (html) the box displays its children along the inline axis. block-axis (html) the box displays its children along the block axis. the inline and blo...
...lock-axis (html) the box displays its children along the block axis. the inline and block axes are the writing-mode dependent keywords which, in english, map to horizontal and vertical respectively. description html dom elements lay out their contents along the inline-axis by default. this css property will only apply to html elements with a css display value of box or inline-box. formal def
inition
initial valueinline-axis (horizontal in xul)applies toelements with a css display value of box or inline-boxinheritednocomputed valueas specifiedanimation typediscrete formal syntax horizontal | vertical | inline-axis | block-axis | inherit examples setting horizontal box orientation here, he box-orient property will cause the two <p> sections in the example to display in the same line. ...
counter() - CSS: Cascading Style Sheets
erties 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-increment. 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 decimal formal syntax counter( <custom-ident>, <counter-style>? )where <cou...
...eading-zero compared to lower-alpha html <ol> <li></li> <li></li> <li></li> </ol> css ol { counter-reset: count; } li { counter-increment: count; } li::after { content: "[" counter(count, decimal-leading-zero) "] == [" counter(count, lower-alpha) "]"; } result specifications specification status comment css lists module level 3the def
inition of 'css counters' in that specification. working draft no change css level 2 (revision 1)the def
inition of 'css counters' in that specification. recommendation
initial def
inition ...
counters() - CSS: Cascading Style Sheets
rties 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-increment. 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 decimal <string> any number of text characters. non-latin characters must be...
... </li> </ol> </li> </ol> css ol { counter-reset: count; } li { counter-increment: count; } li::marker { content: counters(count, '.', upper-alpha) ') '; } li::before { content: counters(count, ".", decimal-leading-zero) " == " counters(count, ".", lower-alpha); } result specifications specification status comment css lists module level 3the def
inition of 'css counters' in that specification. working draft no change css level 2 (revision 1)the def
inition of 'css counters' in that specification. recommendation
initial def
inition ...
env() - CSS: Cascading Style Sheets
...
... the syntax of the fallback, like that of custom properties, allows commas. but, if the property value doesn't support commas, the value is not valid. note: user agent properties are not reset by the all property. specifications specification status comment css environment variables module level 1the def
inition of 'env()' in that specification. editor's draft
initial def
inition. ...
fit-content() - CSS: Cascading Style Sheets
candidate recommendation defines the function when used as a track size. ...
... #container > div { background-color: #8ca0ff; padding: 5px; } result specifications specification status comment css box sizing module level 3the def
inition of 'fit-content()' in that specification. working draft defines the function as laid out box size for width, height, min-width, min-height, max-width and max-height. css grid layoutthe def
inition of 'fit-content()' in that specification. candidate recommendation defines the function when used as a track size. ...
flex-flow - CSS: Cascading Style Sheets
low: <'flex-direction'> */ flex-flow: row; flex-flow: row-reverse; flex-flow: column; flex-flow: column-reverse; /* flex-flow: <'flex-wrap'> */ flex-flow: nowrap; flex-flow: wrap; flex-flow: wrap-reverse; /* flex-flow: <'flex-direction'> and <'flex-wrap'> */ flex-flow: row nowrap; flex-flow: column wrap; flex-flow: column-reverse wrap-reverse; /* global values */ flex-flow: inherit; flex-flow:
initial; flex-flow: unset; values see flex-direction and flex-wrap for details on the values. formal def
inition
initial valueas each of the properties of the shorthand:flex-direction: rowflex-wrap: nowrapapplies toflex containersinheritednocomputed valueas each of the properties of the shorthand:flex-direction: as specifiedflex-wrap: as specifiedanimation typediscrete formal syntax <'flex-direc...
...edanimation typediscrete formal syntax <'flex-direction'> | <'flex-wrap'> examples setting column-reverse and wrap element { /* main-axis is the block direction with reversed main-start and main-end. flex items are laid out in multiple lines */ flex-flow: column-reverse wrap; } specifications specification status comment css flexible box layout modulethe def
inition of 'flex-flow' in that specification. candidate recommendation
initial def
inition ...
font-smooth - CSS: Cascading Style Sheets
imilar property, but with different values: -moz-osx-font-smoothing. it only works on mac os x/macos. auto - allow the browser to select an optimization for font smoothing, typically grayscale. grayscale - render text with grayscale antialiasing, as opposed to the subpixel. switching from subpixel rendering to antialiasing for light text on dark backgrounds makes it look lighter. ...
...operty, but with different values: -moz-osx-font-smoothing. it only works on mac os x/macos. auto - allow the browser to select an optimization for font smoothing, typically grayscale. grayscale - render text with grayscale antialiasing, as opposed to the subpixel. switching from subpixel rendering to antialiasing for light text on dark backgrounds makes it look lighter. ...
font-variant-alternates - CSS: Cascading Style Sheets
this property allows those human-readable names (defined in @font-feature-values) in the stylesheet. syntax this property m...
...nclude ornaments that don't match unicode dingbat characters as ornamental variants of the bullet character (u+2022). be aware that some existing fonts don't follow this advice. annotation() this function enables annotations, like circled digits or inverted characters. the parameter is a font-specific name mapped to a number. it corresponds to the opentype value nalt, like nalt 2. formal def
inition
initial valuenormalapplies toall elements. it also applies to ::first-letter and ::first-line.inheritedyescomputed valueas specifiedanimation typediscrete formal syntax normal | [ stylistic( <feature-value-name> ) | historical-forms | styleset( <feature-value-name># ) | character-variant( <feature-value-name># ) | swash( <feature-value-name> ) | ornaments( <feature-value-name> ) | annotatio...
inherit - CSS: Cascading Style Sheets
which it is specified to take the computed value of the property from its parent element. it can be applied to any css property, including the css shorthand all. for inherited properties, this reinforces the default behavior, and is only needed to override another rule. for non-inherited properties, this specifies a behavior that typically makes relatively little sense and you may consider using
initial instead, or unset on the all property. inheritance is always from the parent element in the document tree, even when the parent element is not the containing block. examples exclude selected elements from a rule /* make second-level headers green */ h2 { color: green; } /* ...but leave those in the sidebar alone so they use their parent's color */ #sidebar h2 { color: inherit; } in this...
...one so they use their parent's color */ #sidebar h2 { color: inherit; } in this example the h2 elements inside the sidebar might be different colors. for example, if one of them were the child of a div matched by the rule ... div#current { color: blue; } ... it would be blue. specifications specification status comment css cascading and inheritance level 4the def
inition of 'inherit' in that specification. candidate recommendation no changes from level 3. css values and units module level 3the def
inition of 'inherit' in that specification. candidate recommendation no significant change from css level 2 (revision 1). css level 2 (revision 1)the def
inition of 'inherit' in that specification. recommendation
initial def
inition. ...
inset - CSS: Cascading Style Sheets
h> values */ inset: 10px; /* value applied to all edges */ inset: 4px 8px; /* top/bottom left/right */ inset: 5px 15px 10px; /* top left/right bottom */ inset: 2.4em 3em 3em 3em; /* top right bottom left */ /* <percentage>s of the width (left/right) or height (top/bottom) of the containing block */ inset: 10% 5% 5% 5%; /* keyword value */ inset: auto; /* global values */ inset: inherit; inset:
initial; inset: unset; syntax values the inset property takes the same values as the left property. formal def
inition
initial valueautoapplies topositioned elementsinheritednopercentageslogical-height of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'>{1,...
...="exampletext">example text</span> </div> css div { background-color: yellow; width: 150px; height: 120px; position: relative; } .exampletext { writing-mode: sideways-rl; position: absolute; inset: 20px 40px 30px 10px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the def
inition of 'inset' in that specification. editor's draft
initial def
inition ...
<integer> - CSS: Cascading Style Sheets
special characters are not allowed. \35 escaped unicode characters are not allowed, even if they are an integer (here: 5). \4e94 non-arabic numerals are not allowed, even when escaped (here: the japanese 5, 五). 3e4 scientific notation is not allowed. ...
...e94 non-arabic numerals are not allowed, even when escaped (here: the japanese 5, 五). 3e4 scientific notation is not allowed. specifications specification status comment css values and units module level 4the def
inition of '<integer>' in that specification. editor's draft no significant change. css values and units module level 3the def
inition of '<integer>' in that specification. candidate recommendation no significant change. css level 2 (revision 1)the def
inition of '<integer>' in that specification. recommendation explicit def
inition. css level 1the def
inition of '<integer>' in that specification. recommendation implicit def
inition. browser compatibility the compatibility table on thi...
isolation - CSS: Cascading Style Sheets
ctive 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. this property is especially helpful when used in conjunction with mix-blend-mode. syntax /* keyword values */ isolation: auto; isolation: isolate; /* global values */ isolation: inherit; isolation:
initial; isolation: unset; the isolation property is specified as one of the keyword values listed below. values auto a new stacking context is created only if one of the properties applied to the element requires it. isolate a new stacking context must be created. formal def
inition
initial valueautoapplies toall elements. in svg, it applies to container elements, graphics elements, and gr...
...div> </div> </div> css .a { background-color: rgb(0,255,0); } #b { width: 200px; height: 210px; } .c { width: 100px; height: 100px; border: 1px solid black; padding: 2px; mix-blend-mode: difference; } #d { isolation: auto; } #e { isolation: isolate; } result specifications specification status comment compositing and blending level 1the def
inition of 'isolation' in that specification. candidate recommendation
initial def
inition ...
line-height-step - CSS: Cascading Style Sheets
property sets the step unit for line box heights. when the property is set, line box heights are rounded up to the closest multiple of the unit. /* point values */ line-height-step: 18pt; syntax the line-height-step property is specified as any one of the following: a <length>. values <length> the specified <length> is used in the calculation of the line box height step. formal def
inition
initial value0applies toblock containersinheritedyescomputed valueabsolute <length>animation typediscrete formal syntax <length> examples setting step unit for line box height in the following example, the height of line box in each paragraph is rounded up to the step unit. the line box in <h1> does not fit into one step unit and thus occupies two, but it is still centered within the two...
...t and thus occupies two, but it is still centered within the two step unit. :root { font-size: 12pt; --my-grid: 18pt; line-height-step: var(--my-grid); } h1 { font-size: 20pt; margin-top: calc(2 * var(--my-grid)); } the result of these rules is shown below in the following screenshot: specifications specification status comment css rhythmic sizingthe def
inition of 'line-height-step' in that specification. working draft
initial def
inition. ...
linear-gradient() - CSS: Cascading Style Sheets
the location on the gradient line where the first color begins. the ending point is the point where the last color ends. each of these two points is defined by the intersection of the gradient line with a perpendicular line passing from the box corner which is in the same quadrant. the ending point can be simply understood as the symmetrical point of the starting point. these somewhat complex def
initions lead to an interesting effect sometimes called magic corners: the corners nearest to the starting and ending points have the same color as their respective starting or ending points. customizing gradients by adding more color-stop points on the gradient line, you can create a highly customized transition between multiple colors. a color-stop's position can be explicitly defined by using a <...
...lor stop value, creating a striped effect. body { width: 100vw; height: 100vh; } body { background: linear-gradient(to right, red 20%, orange 20% 40%, yellow 40% 60%, green 60% 80%, blue 80%); } more linear-gradient examples please see using css gradients for more examples. specifications specification status comment css images module level 4the def
inition of 'gradient color-stops' in that specification. working draft adds interpolation hints. css images module level 3the def
inition of 'linear-gradient()' in that specification. candidate recommendation
initial def
inition. ...
margin-trim - CSS: Cascading Style Sheets
adjoin the container’s edges. syntax none margins are not trimmed by the container. in-flow for in-flow boxes contained by this box, block-axis margins adjacent to the box's edges are truncated to zero. it also truncates any margins collapsed with such a margin. all trims the margins of in-flow boxes and floats whose margins coincide with the container's content edge. formal def
inition
initial valuenoneapplies toblock containers and multi-column containers. it also applies to ::first-letter and ::first-line.inheritednocomputed valueas specifiedanimation typediscrete formal syntax none | in-flow | all examples basic usage once support is implemented for this property, it will probably work like so: when you've got a container with some inline children and you want to p...
... editor's draft ...
mask-border-mode - CSS: Cascading Style Sheets
the mask-border-mode css property specifies the blending mode used in a mask border. syntax /* keyword values */ mask-border-mode: luminance; mask-border-mode: alpha; /* global values */ mask-border-mode: inherit; mask-border-mode:
initial; mask-border-mode: unset; values luminance the luminance values of the mask border image are used as the mask values. alpha the alpha values of the mask border image are used as the mask values. formal def
inition
initial valuealphaapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax luminance | alpha examples basic usage this property doesn't yet seem to have support anywhere. when browsers support it, ...
...crete formal syntax luminance | alpha examples basic usage this property doesn't yet seem to have support anywhere. when browsers support it, it will specify the type of blending mode used for the mask border — luminance or alpha: mask-border-mode: luminance; mask-border-mode: alpha; specifications specification status comment css masking module level 1the def
inition of 'mask-border-mode' in that specification. candidate recommendation
initial def
inition ...
max() - CSS: Cascading Style Sheets
ad. ...
...rem); } this ensures a minimum size of 1rem, 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 def
inition of 'max()' in that specification. editor's draft
initial def
inition ...
<number> - CSS: Cascading Style Sheets
umber without a leading zero 10e3 scientific notation -3.4e-2 complicated scientific notation invalid numbers 12. decimal points must be followed by at least one digit. +-12.2 only one leading +/- is allowed. 12.1.1 only one decimal point is allowed. ...
...mal points must be followed by at least one digit. +-12.2 only one leading +/- is allowed. 12.1.1 only one decimal point is allowed. specifications specification status comment css values and units module level 4the def
inition of '<number>' in that specification. editor's draft no significant change. css values and units module level 3the def
inition of '<number>' in that specification. candidate recommendation no significant change. css level 2 (revision 1)the def
inition of '<number>' in that specification. recommendation explicit def
inition. css level 1the def
inition of '<number>' in that specification. recommendation implicit def
inition. ...
<percentage> - CSS: Cascading Style Sheets
recommendation no change from cs...
...tyle="font-size:50%;">50% (9px)</span></p> <p><span style="font-size:200%;">200% (36px)</span></p> </div> the above html will output: specifications specification status comment css values and units module level 4the def
inition of '<percentage>' in that specification. editor's draft no significant change. css values and units module level 3the def
inition of '<percentage>' in that specification. candidate recommendation no significant change from css level 2 (revision 1). css level 2 (revision 1)the def
inition of '<percentage>' in that specification. recommendation no change from css level 1. css level 1the def
inition of '<percentage>' in that specification. recommendation
initial def
inition. ...
<position> - CSS: Cascading Style Sheets
polation is determined by a single timing function for both coordinates, the point will move in a straight line. examples valid positions center left center top right 8.5% bottom 12vmin right -6px 10% 20% 8rem 14px invalid positions left right bottom top 10px 15px 20px 15px specifications specification status comment css values and units module level 3the def
inition of '<position>' in that specification. candidate recommendation relists links to both def
initions: if css backgrounds and borders module level 3 is supported, its def
inition of <position> must also be used. css backgrounds and borders module level 3the def
inition of '<bg-position>' in that specification. candidate recommendation defines <position> explicitly and extends it...
...elists links to both def
initions: if css backgrounds and borders module level 3 is supported, its def
inition of <position> must also be used. css backgrounds and borders module level 3the def
inition of '<bg-position>' in that specification. candidate recommendation defines <position> explicitly and extends it to support offsets from any edge. css level 2 (revision 1)the def
inition of '<position>' in that specification. recommendation allows combination of a keyword with a <length> or <percentage> value. css level 1the def
inition of '<position>' in that specification. recommendation defines <position> anonymously as the value of background-position. ...
repeating-radial-gradient() - CSS: Cascading Style Sheets
the function's result is an object of the <gradient> data type, which is a special kind of <image>. the source for this interactive example is stored in a github repository. ...
...the bottom right corner). browsers supporting multi position color stops will display a red and green striped ellipse. browsers not supporting the syntax yet will see a gradient that goes from red to black and then from blue to green. note: please see using css gradients for more examples. specifications specification status comment css images module level 3the def
inition of 'repeating-radial-gradient()' in that specification. candidate recommendation
initial def
inition. ...
scroll-snap-type-x - CSS: Cascading Style Sheets
on the horizontal axis of the scroll container in case there is one. specifying any precise animations or physics used to enforce those snap points is not covered by this property but instead left up to the user agent. /* keyword values */ scroll-snap-type-x: none; scroll-snap-type-x: mandatory; scroll-snap-type-x: proximity; /* global values */ scroll-snap-type-x: inherit; scroll-snap-type-x:
initial; scroll-snap-type-x: unset; syntax values none when the visual viewport of this scroll container is scrolled horizontally, it must ignore snap points. mandatory the visual viewport of this scroll container will rest on a snap point if it isn't currently scrolled horizontally. that means it snaps on that point when the scroll action finished, if possible. if content is added, moved, de...
...d the scroll offset will be adjusted to maintain the resting on that snap point. proximity the visual viewport of this scroll container may come to rest on a snap point if it isn't currently scrolled horizontally considering the user agent's scroll parameters. if content is added, moved, deleted or resized the scroll offset may be adjusted to maintain the resting on that snap point. formal def
inition
initial valuenoneapplies toscroll containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | mandatory | proximity specifications not part of any standard. ...
scroll-snap-type-y - CSS: Cascading Style Sheets
d on the vertical axis of the scroll container in case there is one. specifying any precise animations or physics used to enforce those snap points is not covered by this property but instead left up to the user agent. /* keyword values */ scroll-snap-type-y: none; scroll-snap-type-y: mandatory; scroll-snap-type-y: proximity; /* global values */ scroll-snap-type-y: inherit; scroll-snap-type-y:
initial; scroll-snap-type-y: unset; syntax values none when the visual viewport of this scroll container is scrolled vertically, it must ignore snap points. mandatory the visual viewport of this scroll container will rest on a snap point if it isn't currently scrolled vertically. that means it snaps on that point when the scroll action finished, if possible. if content is added, moved, delete...
...zed the scroll offset will be adjusted to maintain the resting on that snap point. proximity the visual viewport of this scroll container may come to rest on a snap point if it isn't currently scrolled vertically considering the user agent's scroll parameters. if content is added, moved, deleted or resized the scroll offset may be adjusted to maintain the resting on that snap point. formal def
inition
initial valuenoneapplies toscroll containersinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | mandatory | proximity specifications not part of any standard. ...
Specified value - CSS: Cascading Style Sheets
ent's style sheet. the specified value for a given property is determined according to the following rules: if the document's style sheet explicitly specifies a value for the property, the given value will be used. if the document's style sheet doesn't specify a value but it is an inherited property, the value will be taken from the parent element. if none of the above pertain, the element's
initial value will be used. examples html <p>my specified color is given explicitly in the css.</p> <div>the specified values of all my properties default to their
initial values, because none of them are given in the css.</div> <div class="fun"> <p>the specified value of my font family is not given explicitly in the css, so it is inherited from my parent. however, the border i...
..."fun"> <p>the specified value of my font family is not given explicitly in the css, so it is inherited from my parent. however, the border is not an inheriting property.</p> </div> css .fun { border: 1px dotted pink; font-family: fantasy; } p { color: green; } result specifications specification status comment css level 2 (revision 2)the def
inition of 'cascaded value' in that specification. working draft css level 2 (revision 1)the def
inition of 'cascaded value' in that specification. recommendation
initial def
inition. ...
<string> - CSS: Cascading Style Sheets
recommendation implicit def...
...(these two strings will have identical output) */ "a really long \ awesome string" "a really long awesome string" specifications specification status comment css values and units module level 3the def
inition of '<string>' in that specification. candidate recommendation no significant change from css level 2 (revision 1). css level 2 (revision 1)the def
inition of '<string>' in that specification. recommendation explicit def
inition; allows 6-digit unicode escaped characters. css level 1the def
inition of '<string>' in that specification. recommendation implicit def
inition; allows 4-digit unicode escaped characters. ...
symbols() - CSS: Cascading Style Sheets
he value of a property such as list-style. unlike @counter-style, symbols() is anonymous (i.e., it can only be used once). although less powerful, it is shorter and easier to write than @counter-style. syntax symbols() = symbols( <symbols-type>? [ <string> | <image> ]+ ); <symbols-type> can be one of the following: cyclic: the system cycles through the given values in the order of their def
inition, and returns to the start when it reaches the end. numeric: the system interprets the given values as the successive units of a place-value numbering system. alphabetic: the system interprets the given values as the digits of an alphabetic numbering system, like a place-value numbering system but without 0. symbolic: the system cycles through the values, printing them an additional time at ...
... the second, etc.). fixed: the system cycles through the given values once, then falls back to arabic numerals. examples html <ol> <li>one</li> <li>two</li> <li>three</li> <li>four</li> <li>five</li> </ol> css ol { list-style: symbols(cyclic "*" "†" "‡"); } result specifications specification status comment css counter styles level 3the def
inition of 'symbols()' in that specification. candidate recommendation
initial defintion. ...
text-justify - CSS: Cascading Style Sheets
-spacing), which is most appropriate for languages that separate words using spaces, like english or korean. inter-character the text is justified by adding space between characters (effectively varying letter-spacing), which is most appropriate for languages like japanese. distribute exhibits the same behaviour as inter-character; this value is kept for backwards compatibility. formal def
inition
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>lorem ipsum dolor sit amet, consectetur adipiscing elit. nunc ornare maximus vehicula. duis nisi velit, dictum id mauris vitae, lobortis pretium ...
... working draft ...
matrix3d() - CSS: Cascading Style Sheets
the matrix below describes the following transformations: translates every x point by -50px translates every y point by -100px translates every z point by 0 scales down by 10% */ transform: matrix3d( 1,0,0,0, 0,1,0,0, 0,0,1,0, -50,-...
...,0,0, 0,1,0,0, 0,0,1,0, -50,-100,0,1.1 ); } 50% { transform: matrix3d( 1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,0.9 ); } to { transform: matrix3d( 1,0,0,0, 0,1,0,0, 0,0,1,0, 50,100,0,1.1 ) } } result specifications specification status comment css transforms level 2the def
inition of 'matrix3d()' in that specification. editor's draft
initial def
inition ...
transition-property - CSS: Cascading Style Sheets
property: none; transition-property: all; /* <custom-ident> values */ transition-property: test_05; transition-property: -specific; transition-property: sliding-vertically; /* multiple values */ transition-property: test1, animation4; transition-property: all, height, color; transition-property: all, -moz-specific, sliding; /* global values */ transition-property: inherit; transition-property:
initial; transition-property: unset; values none no properties will transition. all all properties that can transition will. <custom-ident> a string identifying the property to which a transition effect should be applied when its value changes. formal def
inition
initial valueallapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typed...
...ore and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | <single-transition-property>#where <single-transition-property> = all | <custom-ident> examples there are several examples of css transitions included in the main css transitions article. specifications specification status comment css transitionsthe def
inition of 'transition-property' in that specification. working draft
initial def
inition ...
user-modify - CSS: Cascading Style Sheets
the user-modify property has no effect in firefox. it was originally planned to determine whether or not the content of an element can be edited by a user. /* keyword values */ user-modify: read-only; user-modify: read-write; user-modify: write-only; /* global values */ user-modify: inherit; user-modify:
initial; user-modify: unset; this property has been replaced by the contenteditable attribute. syntax the -moz-user-modify property is specified as one of the keyword values from the list below. values read-only default value. contents are read-only. read-write the user is able to read and write contents. read-write-plaintext-only same as read-write, but rich text formatting will be lost. write-only the user is able to edit the content, but not to read it. formal def...
...bute. syntax the -moz-user-modify property is specified as one of the keyword values from the list below. values read-only default value. contents are read-only. read-write the user is able to read and write contents. read-write-plaintext-only same as read-write, but rich text formatting will be lost. write-only the user is able to edit the content, but not to read it. formal def
inition value not found in db! formal syntax syntax not found in db! examples html <div class="readwrite">the user is able to change this text.</div> css .readwrite { -moz-user-modify: read-write; -webkit-user-modify: read-write; } specifications not part of any standard. a similar property, user-focus, was proposed in early drafts of a predecessor of the css3 ui specification, but was...
Live streaming web audio and video - Developer guides
output live. often shortened to just streaming, live streaming is the process of transmitting media 'live' to computers and devices. this is a fairly complex and nascent subject with a lot of variables, so in this article, we'll introduce you to the subject and let you know how you can get started. the key consideration when streaming media to a browser is the fact that rather than playing a f
inite file we are relaying a file that is being created on the fly and has no pre-determined start or end. key differences between streamed and static media in this case, we are using static media to describe media that is represented by a file, whether it be an mp3 or webm file. this file sits on a server and can be delivered — like most other files — to the browser. this is often known as a pr...
...d on the fly and has no pre-determined start or end. key differences between streamed and static media in this case, we are using static media to describe media that is represented by a file, whether it be an mp3 or webm file. this file sits on a server and can be delivered — like most other files — to the browser. this is often known as a progressive download. live streamed media lacks a f
inite start and end time as rather than a static file, it is a stream of data that the server passes on down the line to the browser and is often adaptive (see below). usually, we require different formats and special server-side software to achieve this. adaptive streaming one of the main priorities for live streaming is to keep the player synchronized with the stream: adaptive streaming is a techn...
Audio and Video Delivery - Developer guides
t support audio tag --> <a href="audiofile.mp3">download audio</a> </audio> the code above will create an audio player that attempts to preload as much audio as possible for smooth playback. note: the preload attribute may be ignored by some mobile browsers. ...
...udio.setattribute('src','audiofile.mp3'); } else if (myaudio.canplaytype('audio/ogg')) { myaudio.setattribute('src','audiofile.ogg'); } myaudio.currenttime = 5; myaudio.play(); we set the source of the audio depending on the type of audio file the browser supports, then set the play-head 5 seconds in and attempt to play it. note: play will be ignored by most browsers unless issued by a user-
initiated event. it's also possible to feed an <audio> element a base64 encoded wav file, allowing to generate audio on the fly: <audio id="player" src="data:audio/x-wav;base64,uklgrvc..."></audio> speak.js employs this technique. try the demo. javascript video var myvideo = document.createelement('video'); if (myvideo.canplaytype('video/mp4')) { myvideo.setattribute('src','videofile.mp4'); }...
Challenge solutions - Developer guides
for underlining from the rule for <p> to the one for <strong>. the resulting file looks like this: p {color: blue; } strong {color: orange; text-decoration: underline;} later sections of this tutorial describe style rules and declarations in greater detail. selectors second paragraph blue challenge without changing your html file, add a single rule to your css file that keeps all the
initial letters the same color as they are now, but makes all the other text in the second paragraph blue. solution add a rule with an id selector of #second and a declaration color: blue;, as shown below: #second { color: blue; } a more specific selector, p#second also works. both paragraphs blue challenge now change the rule you have just added (without changing anything else), to make th...
...ors all have more specific selectors, so they override the blue of the paragraph. readable css commenting out a rule challenge comment out part of your stylesheet, without changing anything else, to make the very first letter of your document red. solution one way to do this is to put comment delimiters around the rule for .carrot: /* .carrot { color: orange; } */ text styles big
initial letters challenge without changing anything else, make all six
initial letters twice the size in the browser's default serif font. solution add the following style declaration to the strong rule: font: 200% serif; if you use separate declarations for font-size and font-family, then the font-style setting on the first paragraph is not overridden. color three-digit color codes c...
Media events - Developer guides
has loaded or changed, indicating a change in duration of the media. this is sent, for example, when the media has loaded enough that the duration is known. emptied the media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the load() method is called to reload it. encrypted the user agent has encountered
initialization data in the media data. ended sent when playback completes. error sent when an error occurs. the element's error attribute contains more information. see htmlmediaelement.error for details. loadeddata the first frame of the media has finished loading. loadedmetadata the media's metadata has finished loading; all attributes now contain as ...
...ction() { v.play(); }, true); v.currenttime = 10.0; this example fetches the first video element in the document and attaches an event listener to it, watching for the seeked event, which is sent whenever a seek operation completes. the listener simply calls the element's play() method, which starts playback. then, in line 3, the example sets the element's currenttime attribute to 10.0, which
initiates a seek operation to the 10-second mark in the media. this causes a seeking event to be sent when the operation begins, then a seeked event to be dispatched when the seek is completed. in other words, this example seeks to the 10-second mark in the media, then begins playback as soon as that's finished. ...
Making content editable - Developer guides
ef("capability.policy.allowclipboard.sites", "https://www.mozilla.org"); user_pref("capability.policy.allowclipboard.clipboard.cutcopy", "allaccess"); user_pref("capability.policy.allowclipboard.clipboard.paste", "allaccess"); example: a simple but complete rich text editor <!doctype html> <html> <head> <title>rich text editor</title> <script type="text/javascript"> var odoc, sdeftxt; function
initdoc() { odoc = document.getelementbyid("textbox"); sdeftxt = odoc.innerhtml; if (document.compform.switchmode.checked) { setdocmode(true); } } function formatdoc(scmd, svalue) { if (validatemode()) { document.execcommand(scmd, false, svalue); odoc.focus(); } } function validatemode() { if (!document.compform.switchmode.checked) { return true ; } alert("uncheck \"show html\"."); odo...
.../script> <style type="text/css"> .intlink { cursor: pointer; } img.intlink { border: 0; } #toolbar1 select { font-size:10px; } #textbox { width: 540px; height: 200px; border: 1px #000000 solid; padding: 12px; overflow: scroll; } #textbox #sourcetext { padding: 0; margin: 0; min-width: 498px; min-height: 200px; } #editmode label { cursor: pointer; } </style> </head> <body onload="
initdoc();"> <form name="compform" method="post" action="sample.php" onsubmit="if(validatemode()){this.mydoc.value=odoc.innerhtml;return true;}return false;"> <input type="hidden" name="mydoc"> <div id="toolbar1"> <select onchange="formatdoc('formatblock',this[this.selectedindex].value);this.selectedindex=0;"> <option selected>- formatting -</option> <option value="h1">title 1 <h1></option> <opt...
HTML attribute: crossorigin - HTML: Hypertext Markup Language
living standard ...
...be used when fetching a manifest that requires credentials, even if the file is from the same origin. <link rel="manifest" href="/app.webmanifest" crossorigin="use-credentials"> specifications specification status comment html living standardthe def
inition of 'cors settings attributes' in that specification. living standard html living standardthe def
inition of 'crossorigin' in that specification. living standard ...
HTML attribute: maxlength - HTML: Hypertext Markup Language
recommendation ...
...the maxlength attribute allows, should the length be longer than the maxlength allows, the read-only toolong property of a validitystate object will be true. examples <input type="password" maxlength="4"/> specifications specification status html living standardthe def
inition of 'maxlength attribute' in that specification. living standard html 5.1the def
inition of 'maxlength attribute' in that specification. recommendation ...
<area> - HTML: Hypertext Markup Language
rec...
...ck to go right"> </map> <img usemap="#primary" src="https://udn.realityripple.com/samples/6a/7e559101b3.png" alt="350 x 150 pic"> result specifications specification status comment referrer policythe def
inition of 'referrerpolicy attribute' in that specification. candidate recommendation added the referrerpolicy attribute. html living standardthe def
inition of '<area>' in that specification. living standard html5the def
inition of '<area>' in that specification. recommendation html 4.01 specificationthe def
inition of '<area>' in that specification. recommendation ...
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
duration read only a double-precision floating-point value which indicates the duration (total length) of the audio in seconds, on the media's timeline. if no media is present on the element, or the media is not valid, the returned value is nan. if the media has no known end (such as for live streams of unknown duration, web radio, media incoming from webrtc, and so forth), this value is +inf
inity. loop a boolean attribute: if specified, the audio player will automatically seek back to the start upon reaching the end of the audio. muted a boolean attribute that indicates whether the audio will be
initially silenced. its default value is false. preload this enumerated attribute is intended to provide a hint to the browser about what the author thinks will lead to the best user experi...
... tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts embedded content. implicit aria role no corresponding role permitted aria roles application dom interface htmlaudioelement specifications specification status comment html living standardthe def
inition of '<audio>' in that specification. living standard html5the def
inition of '<audio>' in that specification. recommendation ...
<bgsound>: The Background Sound element (obsolete) - HTML: Hypertext Markup Language
use <audio> instead. do not use this! in order to embed audio in a web page, you should be using the <audio> element. attributes balance this attribute defines a number between -10,000 and +10,000 that determines how the volume will be divided between the speakers. ...
...however, even this is no longer appropriate, and you should use <audio> instead, since it's more capable, more compatible, and doesn't require plug-ins. ...
<blink>: The Blinking Text element (obsolete) - HTML: Hypertext Markup Language
mlunknownelement interface. example <blink>why would somebody use this?</blink> result (toned down!) specification this element is non-standard and not part of any specification. if you don't believe us, see for yourself in the html spec. css polyfill if you really do need a polyfill, then you can use the following css polyfill. works in ie10+. ...
... result (toned down!) specification this element is non-standard and not part of any specification. if you don't believe us, see for yourself in the html spec. css polyfill if you really do need a polyfill, then you can use the following css polyfill. works in ie10+. ...
<body>: The Document Body element - HTML: Hypertext Markup Language
stead. vlink color of text for visited hypertext links. this method is non-conforming, use css color property in conjunction with the :visited pseudo-class instead. example <html> <head> <title>document title</title> </head> <body> <p>this is a paragraph</p> </body> </html> specifications specification status comment html living standardthe def
inition of '<body>' in that specification. living standard changed the list of non-conforming features. html5the def
inition of '<body>' in that specification. recommendation obsoleted the formerly deprecated attributes. defined the behavior of the non-conforming and never standardized topmargin, leftmargin, rightmargin and bottommargin. added the on* attributes. html 4.01...
...at specification. living standard changed the list of non-conforming features. html5the def
inition of '<body>' in that specification. recommendation obsoleted the formerly deprecated attributes. defined the behavior of the non-conforming and never standardized topmargin, leftmargin, rightmargin and bottommargin. added the on* attributes. html 4.01 specificationthe def
inition of '<body>' in that specification. recommendation deprecated the alink, background, bgcolor, link, text and vlink attributes. ...
<canvas>: The Graphics Canvas element - HTML: Hypertext Markup Language
sible website or app. the following guides can help to make it more accessible. ...
...t regions and accessability canvas accessibility use cases canvas element accessibility issues html5 canvas accessibility in firefox 13 – by steve faulkner best practices for interactive canvas elements specifications specification status comment html living standardthe def
inition of '<canvas>' in that specification. living standard html5the def
inition of '<canvas>' in that specification. recommendation
initial def
inition ...
<em>: The Emphasis element - HTML: Hypertext Markup Language
on example, since they both italicize text. what's the difference? which should you use? by default, the visual result is the same. however, the semantic meaning is different. the <em> element represents stress emphasis of its contents, while the <i> element represents text that is set off from the normal prose, such a foreign word, fictional character thoughts, or when the text refers to the def
inition of a word instead of representing its semantic meaning. (the title of a work, such as the name of a book or movie, should use <cite>.) this means the right one to use depends on the situation. neither is for purely decorational purposes, that's what css styling is for. an example for <em> could be: "just do it already!", or: "we had to do something about it". a person or software reading the...
...named queen mary. another example for <i> could be: "the word the is an article". example the <em> element is often used to indicate an implicit or explicit contrast. <p> in html 5, what was previously called <em>block-level</em> content is now called <em>flow</em> content. </p> result specifications specification status comment html living standardthe def
inition of '<em>' in that specification. living standard html5the def
inition of '<em>' in that specification. recommendation html 4.01 specificationthe def
inition of '<em>' in that specification. recommendation ...
<html>: The HTML Document / Root element - HTML: Hypertext Markup Language
e no corresponding role permitted aria roles no role permitted dom interface htmlhtmlelement attributes this element includes the global attributes. manifest specifies the uri of a resource manifest indicating resources that should be cached locally. see using the application cache for details. version specifies the version of the html document type def
inition that governs the current document. this attribute is not needed, because it is redundant with the version information in the document type declaration. xmlns specifies the xml namespace of the document. default value is "http://www.w3.org/1999/xhtml". this is required in documents parsed with xml parsers, and optional in text/html documents. example <!doctype html> <html lang="en"> <hea...
...ng a valid lang declaration on the <html> element also ensures that important metadata contained in the page's <head>, such as the page's <title>, are also announced properly. mdn understanding wcag, guideline 3.1 explanations understanding success criterion 3.1.1 | w3c understanding wcag 2.0 specifications specification status comment html living standardthe def
inition of '<html>' in that specification. living standard html5the def
inition of '<html>' in that specification. recommendation added support for the manifest attribute (deprecated later). obsoleted the version attribute html 4.01 specificationthe def
inition of '<html>' in that specification. recommendation deprecated the version attribute ...
<i>: The Idiomatic Text element - HTML: Hypertext Markup Language
in earlier versions of the html specification, the <i> element was merely a presentational element used to display text in italics, much like the <b> element was used to display text in bold letters. this is no longer true, as these tags now define semantics rather than typographic appearance. a browser will typically still display the contents of the <i> element in italic type, but is, by def
inition, no longer required to do so. to display text in italic type, authors should use the css font-style property. be sure the text in question is not actually more appropriately marked up with another element. use <em> to indicate stress emphasis. use <strong> to indicate importance, seriousness, or urgency. use <mark> to indicate relevance. use <cite> to mark up the name of a work...
...s a book, play, or song. use <dfn> to mark up the defining instance of a term. examples this example demonstrates using the <i> element to mark text that is in another language. <p>the latin phrase <i>veni, vidi, vici</i> is often mentioned in music, art, and literature.</p> result specifications specification status comment html living standardthe def
inition of '<i>' in that specification. living standard html5the def
inition of '<i>' in that specification. recommendation html 4.01 specificationthe def
inition of '<b>' in that specification. recommendation ...
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
ripts (but not create popup windows). allow-storage-access-by-user-activation : lets the resource request access to the parent's storage capabilities with the storage access api. allow-top-navigation: lets the resource navigate the top-level 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 conten...
...dia.org/wiki/avocado"></iframe> without this title, they have to navigate into the <iframe> to determine what its embedded content is. this context shift can be confusing and time-consuming, especially for pages with multiple <iframe>s and/or if embeds contain interactive content like video or audio. specifications specification status comment referrer policythe def
inition of 'referrerpolicy attribute' in that specification. candidate recommendation added the referrerpolicy attribute. html living standardthe def
inition of '<iframe>' in that specification. living standard html5the def
inition of '<iframe>' in that specification. recommendation html 4.01 specificationthe def
inition of '<iframe>' in that specification. ...
<input type="color"> - HTML: Hypertext Markup Language
agraph to the selected color.</p> javascript first, there's some setup. here we establish some variables, setting up a variable that contains the color we'll set the color well to when we first load up, and then setting up a load handler to do the main startup work once the page is fully loaded. ...
...torall("p").foreach(function(p) { p.style.color = event.target.value; }); } this sets the color of every <p> block so that its color attribute matches the current value of the color input, which is referred to using event.target. result the final result looks like this: specifications specification status comment html living standard living standard
initial def
inition html5 recommendation
initial def
inition ...
<input type="image"> - HTML: Hypertext Markup Language
recommendation ...
...wn at the largest size that will fit within the element's box without altering its aspect ratio. note the visible grey background of the element still visible in the area not covered by the image. specifications specification status comments html living standardthe def
inition of '<input type="image">' in that specification. living standard html5the def
inition of '<input type="image">' in that specification. recommendation ...
<input type="reset"> - HTML: Hypertext Markup Language
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. you should usually avoid including reset buttons in your forms. they're rarely useful, and are instead more likely to frustrate users who click them by mistake (often while trying to click the submit button). ...
...note: see the <input type="button"> page for more ideas about enabling and disabling buttons. validation buttons don't participate in constraint validation; they have no real value to be constrained. examples we've included simple examples above. there isn't really anything more to say about reset buttons. specifications specification status html living standardthe def
inition of '<input type="reset">' in that specification. living standard html5the def
inition of '<input type="reset">' in that specification. recommendation ...
<input type="search"> - HTML: Hypertext Markup Language
which, if present, tells the user agent to process the input as a live search. as the user edits the value of the field, the user agent sends search events to the htmlinputelement object representing the search box. this allows your code to update the search results in real time as the user edits the search. if incremental is not specified, the search event is only sent when the user explicitly
initiates a search (such as by pressing the enter or return key while editing the field). the search event is rate-limited so that it is not sent more more frequently than an implementation-defined interval. mozactionhint a mozilla extension, supported by firefox for android, which provides a hint as to what sort of action will be taken if the user presses the enter or return key while editing t...
...'✖'; padding-left: 5px; position: absolute; } input:valid ~ span:after { content: '✓'; padding-left: 5px; position: absolute; } this renders like so: examples you can see a good example of a search form used in context at our website-aria-roles example (see it live). specifications specification status comment html living standardthe def
inition of '<input type="search">' in that specification. living standard
initial def
inition html 5.1the def
inition of '<input type="search">' in that specification. recommendation
initial def
inition ...
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
lass on the keys in the output to be presented: <p>you can also create a new document by pressing <kbd><kbd class="key">ctrl</kbd>+<kbd class="key">n</kbd></kbd>.</p> result the result is just what we want! echoed input nesting a <kbd> element inside a <samp> element represents input that has been echoed back to the user by the system. <p>if a syntax error occurs, the tool will output the
initial command you typed for your review:</p> <blockquote> <samp><kbd>custom-git ad my-new-file.cpp</kbd></samp> </blockquote> representing onscreen input options nesting a <samp> element inside a <kbd> element represents input which is based on text presented by the system, such as the names of menus and menu items, or the names of buttons displayed on the screen. for example, you can explain...
...w file.</p> this does some interesting nesting. for the menu option description, the entire input is enclosed in a <kbd> element. then, inside that, both the menu and menu item names are contained within both <kbd> and <samp>, indicating an input which is selected from a screen widget. result specifications specification status comment html living standardthe def
inition of '<kbd>' in that specification. living standard html5the def
inition of '<kbd>' in that specification. recommendation expanded to include any user input, like voice input and individual keystrokes. html 4.01 specificationthe def
inition of '<kbd>' in that specification. recommendation ...
<marquee>: The Marquee element (Obsolete) - HTML: Hypertext Markup Language
recommendation make it obsolete in favor of css but define its expected behavior, for...
...ounce </marquee> </marquee> specifications specification status comment html living standardthe def
inition of '<marquee>' in that specification. living standard make it obsolete in favor of css but define its expected behavior, for backward compatibility. however, the development of the marquee features of css have since been abandoned. html5the def
inition of '<marquee>' in that specification. recommendation make it obsolete in favor of css but define its expected behavior, for backward compatibility. however, the development of the marquee features of css have since been abandoned. ...
<ol>: The Ordered List element - HTML: Hypertext Markup Language
recommendation deprecated compact and type. ...
.../li> <li>second item third subitem</li> </ul> </li> <!-- here's the closing </li> tag --> <li>third item</li> </ol> the above html will output: specifications specification status comment html living standardthe def
inition of '<ol>' in that specification. living standard no change since last w3c snapshot, html5. html5the def
inition of 'htmlolistelement' in that specification. recommendation added reversed and start attributed; un-deprecated type html 4.01 specificationthe def
inition of '<ol>' in that specification. recommendation deprecated compact and type. ...
<slot> - HTML: Hypertext Markup Language
living standard ...
...ot> </div> </details> <hr> </template> note: you can see this complete example in action at element-details (see it running live). in addition, you can find an explanation at using templates and slots. specifications specification status comments html living standardthe def
inition of '<slot>' in that specification. living standard domthe def
inition of 'slots' in that specification. living standard ...
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
ed inside a <picture> element. srcset a list of one or more strings separated by commas indicating a set of possible images represented by the source for the browser to use. each string is composed of: one url specifying an image. a width descriptor, which consists of a string containing a positive integer directly followed by "w", such as 300w. the default value, if missing, is the inf
inity. a pixel density descriptor, that is a positive floating number directly followed by "x". the default value, if missing, is 1x. each string in the list must have at least a width descriptor or a pixel density descriptor to be valid. among the list, there must be only one string containing the same tuple of width descriptor and pixel density descriptor. the browser chooses the most adequate...
... living standard ...
<tbody>: The Table Body element - HTML: Hypertext Markup Language
r-collapse: collapse; font: 16px "lucida grande", "helvetica", "arial", sans-serif; } first, the table's overall style attributes are set, configuring the thickness, style, and color of the table's exterior borders and using border-collapse to ensure that the border lines are shared among adjacent cells rather than each having its own borders with space in between. font is used to establish an
initial font for the table. th, td { border: 1px solid #bbb; padding: 2px 8px 0; text-align: left; } then the style is set for the majority of the cells in the table, including all data cells but also those styles shared between our <td> and <th> cells. the cells are given a light gray outline which is a single pixel thick, padding is adjusted, and all cells are left-aligned using text-align ...
... subtle style for header cells contained directly within a <tbody> (as opposed to those which reside in a <thead>). this is used for the headers indicating each table section's corresponding major. tbody > tr > th { background-color: #dde; border-bottom: 1.5px solid #bbb; font-weight: normal; } specifications specification status comment html living standardthe def
inition of 'tbody element' in that specification. living standard html5the def
inition of 'tbody element' in that specification. recommendation ...
<title>: The Document Title element - HTML: Hypertext Markup Language
a page's <head> block. page titles and seo the contents of a page title can have significant implications for search engine optimization (seo). in general, a longer, descriptive title performs better than short or generic titles. the content of the title is one of the components used by search engine algorithms to decide the order in which to list pages in search results. also, the title is the
initial "hook" by which you grab the attention of readers glancing at the search results page. a few guidelines and tips for composing good titles: avoid one- or two-word titles. use a descriptive phrase, or a term-def
inition pairing for glossary or reference-style pages. search engines typically display about the first 55–60 characters of a page title. text beyond that may be lost, so try not ...
...t significant page state changes (such as form validation problems). example <title>2 errors - your order - blue house chinese food - foodyum: online takeout today!</title> mdn understanding wcag, guideline 2.4 explanations understanding success criterion 2.4.2 | w3c understanding wcag 2.0 specifications specification status comment html living standardthe def
inition of '<title>' in that specification. living standard html5the def
inition of '<title>' in that specification. recommendation html 4.01 specificationthe def
inition of '<title>' in that specification. recommendation ...
accesskey - HTML: Hypertext Markup Language
of the functionality. if the system lacks a method of notifying the user about this feature, the user might accidentally activate accesskeys. because of these issues, it is generally advised not to use accesskeys for most general-purpose websites and web apps. webaim: keyboard accessibility - accesskey specifications specification status comment html 5.2the def
inition of 'accesskey' in that specification. recommendation more realistic behavior described for what is implemented in reality. html living standardthe def
inition of 'accesskey' in that specification. living standard no change from latest w3c html 5.1 spec. html 5.1the def
inition of 'accesskey' in that specification. recommendation no change from html5. ...
...sskey' in that specification. recommendation more realistic behavior described for what is implemented in reality. html living standardthe def
inition of 'accesskey' in that specification. living standard no change from latest w3c html 5.1 spec. html 5.1the def
inition of 'accesskey' in that specification. recommendation no change from html5. html5the def
inition of 'accesskey' in that specification. recommendation from html 4.01 specification, several characters can now be set as the accesskey. also, it can be set on any element. html 4.01 specificationthe def
inition of 'accesskey' in that specification. recommendation only supported on <a>, <area>, <button>, <input>, <label>, <legend> and <textarea> ...
class - HTML: Hypertext Markup Language
hat describe the semantic purpose of the element, rather than the presentation of the element. for example, attribute to describe an attribute rather than italics, although an element of this class may be presented by italics. semantic names remain logical even if the presentation of the page changes. specifications specification status comment html living standardthe def
inition of 'class' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the def
inition of 'class' in that specification. recommendation snapshot of html living standard, no change from html5 html5the def
inition of 'class' in that specification. recommendation snapshot of html living standard. from html 4.01 specification, class is ...
...e from latest snapshot, html 5.1 html 5.1the def
inition of 'class' in that specification. recommendation snapshot of html living standard, no change from html5 html5the def
inition of 'class' in that specification. recommendation snapshot of html living standard. from html 4.01 specification, class is now a true global attribute. html 4.01 specificationthe def
inition of 'class' in that specification. recommendation supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, <style>, and <title>. ...
contenteditable - HTML: Hypertext Markup Language
d from its parent element: so the element is editable if its parent is editable. note that although its allowed values include true and false, this attribute is an enumerated one and not a boolean one. you can set the color used to draw the text insertion caret with the css caret-color property. specifications specification status comment html living standardthe def
inition of 'contenteditable' in that specification. living standard no change from latest snapshot, html 5.2 html 5.2the def
inition of 'contenteditable' in that specification. recommendation snapshot of html living standard, no change from html 5.1 html 5.1the def
inition of 'contenteditable' in that specification. recommendation snapshot of html living standard, no ...
...ication. living standard no change from latest snapshot, html 5.2 html 5.2the def
inition of 'contenteditable' in that specification. recommendation snapshot of html living standard, no change from html 5.1 html 5.1the def
inition of 'contenteditable' in that specification. recommendation snapshot of html living standard, no change from html5 html5the def
inition of 'contenteditable' in that specification. recommendation snapshot of html living standard,
initial def
inition. ...
dir - HTML: Hypertext Markup Language
to assist with authoring content. chrome and safari provide a directionality option in the contextual menu of input fields while internet explorer and edge use the key combinations ctrl + left shift and ctrl + right shift. firefox uses ctrl/cmd + shift + x but does not update the dir attribute value. specifications specification status comment html living standardthe def
inition of 'dir' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the def
inition of 'dir' in that specification. recommendation snapshot of html living standard, no change from html5 html5the def
inition of 'dir' in that specification. recommendation snapshot of html living standard, from html 4.01 specification it added the aut...
...shot, html 5.1 html 5.1the def
inition of 'dir' in that specification. recommendation snapshot of html living standard, no change from html5 html5the def
inition of 'dir' in that specification. recommendation snapshot of html living standard, from html 4.01 specification it added the auto value, and is now a true global attribute. html 4.01 specificationthe def
inition of 'dir' in that specification. recommendation supported on all elements but <applet>, <base>, <basefont>, <bdo>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>. ...
id - HTML: Hypertext Markup Language
arated values, elements can only have one single id value. note: using characters except ascii letters, digits, '_', '-' and '.' may cause compatibility problems, as they weren't allowed in html 4. though this restriction has been lifted in html5, an id should start with a letter for compatibility. specifications specification status comment html living standardthe def
inition of 'id' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the def
inition of 'id' in that specification. recommendation snapshot of html living standard, no change from html5 html5the def
inition of 'id' in that specification. recommendation snapshot of html living standard, now accept '_', '-' and '.' if not at the beginn...
...tml 5.1 html 5.1the def
inition of 'id' in that specification. recommendation snapshot of html living standard, no change from html5 html5the def
inition of 'id' in that specification. recommendation snapshot of html living standard, now accept '_', '-' and '.' if not at the beginning of the id. it is also a true global attribute. html 4.01 specificationthe def
inition of 'id' in that specification. recommendation supported on all elements but <base>, <head>, <html>, <meta>, <script>, <style>, and <title>. ...
itemid - HTML: Hypertext Markup Language
unique, global identifier of an item. an itemid attribute can only be specified for an element that has both itemscope and itemtype attributes. also, itemid can only be specified on elements that possess an itemscope attribute whose corresponding itemtype refers to or defines a vocabulary that supports global identifiers. the exact meaning of an itemtype's global identifier is provided by the def
inition of that identifier within the specified vocabulary. the vocabulary defines whether several items with the same global identifier can coexist and, if so, how items with the same identifier are handled. note: the whatwg def
inition specifies that an itemid must be a url. however, the following example correctly illustrates that a urn may also be used. this inconsistency may reflect the incomplet...
... living standard ...
itemscope - HTML: Hypertext Markup Language
living standard ...
...es 250 cal itemprop fatcontent 12 g note: a handy tool for extracting microdata structures from html is google's structured data testing tool. try it on the html shown above. specifications specification status comment html microdatathe def
inition of 'itemscope' in that specification. working draft html living standardthe def
inition of 'itemscope' in that specification. living standard ...
itemtype - HTML: Hypertext Markup Language
living standard ...
...ization itemprop name executive objects note: a handy tool for extracting microdata structures from html is google's structured data testing tool. try it on the html shown above specifications specification status comment html microdatathe def
inition of 'itemtype' in that specification. working draft html living standardthe def
inition of 'itemprop' in that specification. living standard ...
lang - HTML: Hypertext Markup Language
is set, it may not be taken into account, as the xml:lang attribute has priority. for the css pseudo-class :lang, two invalid language names are different if their names are different. so while :lang(es) matches both lang="es-es" and lang="es-419", :lang(xyzzy) would not match lang="xyzzy-zorp!". specifications specification status comment html living standardthe def
inition of 'lang' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the def
inition of 'lang' in that specification. recommendation snapshot of html living standard, no change from html5 html5the def
inition of 'lang' in that specification. recommendation snapshot of html living standard, behavior with xml:lang and language determ...
... html 5.1the def
inition of 'lang' in that specification. recommendation snapshot of html living standard, no change from html5 html5the def
inition of 'lang' in that specification. recommendation snapshot of html living standard, behavior with xml:lang and language determination algorithm defined. it also is a true global attribute. html 4.01 specificationthe def
inition of 'lang' in that specification. recommendation supported on all elements but <applet>, <base>, <basefont>, <br>, <frame>, <frameset>, <iframe>, <param>, and <script>. ...
slot - HTML: Hypertext Markup Language
living standard ...
... an element with a slot attribute is assigned to the slot created by the <slot> element whose name attribute's value matches that slot attribute's value. for examples, see our using templates and slots guide. specifications specification status comment html living standardthe def
inition of 'slot attribute' in that specification. living standard domthe def
inition of 'slot attribute' in that specification. living standard ...
style - HTML: Hypertext Markup Language
examples and send us a pull request. usage note: this attribute must not be used to convey semantic information. even if all styling is removed, a page should remain semantically correct. typically it shouldn't be used to hide irrelevant information; this should be done using the hidden attribute. specifications specification status comment html living standardthe def
inition of 'style' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the def
inition of 'style' in that specification. recommendation snapshot of html living standard, no change from html5 html5the def
inition of 'style' in that specification. recommendation snapshot of html living standard. from html 4.01 specification, it is now...
... recommendation supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, <style>, and <title>. ...
tabindex - HTML: Hypertext Markup Language
ibed using interactive elements (<a>, <button>, <details>, <input>, <select>, <textarea>, etc.) instead. these elements have built-in roles and states that communicate status to the accessibility that would otherwise have to be managed by aria. using the tabindex attribute | the paciello group specifications specification status comment html living standardthe def
inition of 'tabindex' in that specification. living standard no change from latest snapshot, html 5.1. html 5.1the def
inition of 'tabindex' in that specification. recommendation snapshot of html living standard, no change from html5. html5the def
inition of 'tabindex' in that specification. recommendation snapshot of html living standard. from html 4.01 specification...
... html 5.1the def
inition of 'tabindex' in that specification. recommendation snapshot of html living standard, no change from html5. html5the def
inition of 'tabindex' in that specification. recommendation snapshot of html living standard. from html 4.01 specification, the attribute is now supported on all elements (global attributes). html 4.01 specificationthe def
inition of 'tabindex' in that specification. recommendation only supported on <a>, <area>, <button>, <input>, <object>, <select>, and <textarea>. ...
title - HTML: Hypertext Markup Language
owsing methods. 3.2.5.1. the title attribute | w3c html 5.2: 3. semantics, structure, and apis of html documents using the html title attribute – updated | the paciello group tooltips & toggletips - inclusive components the trials and tribulations of the title attribute - 24 accessibility specifications specification status comment html living standardthe def
inition of 'title' in that specification. living standard no change from latest snapshot, html 5.1 html 5.1the def
inition of 'title' in that specification. recommendation snapshot of html living standard, no change from html5 html5the def
inition of 'title' in that specification. recommendation snapshot of html living standard. from html 4.01 specification, it is now...
...ange from latest snapshot, html 5.1 html 5.1the def
inition of 'title' in that specification. recommendation snapshot of html living standard, no change from html5 html5the def
inition of 'title' in that specification. recommendation snapshot of html living standard. from html 4.01 specification, it is now a true global attribute. html 4.01 specificationthe def
inition of 'title' in that specification. recommendation supported on all elements but <base>, <basefont>, <head>, <html>, <meta>, <param>, <script>, and <title>. ...
Using the application cache - HTML: Hypertext Markup Language
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 manifest line), and cannot be appended to other lines. this means that you cannot specify fragment identifiers. section header section headers specify which section of the cache manifest is being manipulated. there are three possible section headers: section header description cache: switches to the explicit section of the cache manifest (this is the default ...
...ther a network failure or a server error of some kind, the browser loads the file example.html instead. cache states each application cache has a state, which indicates the current condition of the cache. caches that share the same manifest uri share the same cache state, which can be one of the following: uncached a special value that indicates that an application cache object is not fully
initialized. idle the application cache is not currently in the process of being updated. checking the manifest is being fetched and checked for updates. downloading resources are being downloaded to be added to the cache, due to a changed resource manifest. updateready there is a new version of the application cache available. there is a corresponding updateready event, which is fired instead...
Browser detection using the user agent - HTTP
rdingly. while user agent sniffing can sometimes detect these, not all devices are the same: some mobile devices have big screen sizes, some desktops have a small touchscreen, some people use smart tv's which are an entirely different ballgame altogether, and some people can dynamically change the width and height of their screen by flipping their tablet on its side! so, user agent sniffing is def
initely not the way to go. thankfully, there are much better alternatives. use navigator.maxtouchpoints to detect if the user's device has a touchscreen. then, default back to checking the user agent screen only if (!("maxtouchpoints" in navigator)) { /*code here*/}. using this information of whether the device has a touchscreen, do not change the entire layout of the website just for touch devices: y...
...een the media queries (max-width: 25em), not all and (min-width: 25em), and (max-width: 24.99em): (max-width: 25em) excludes (max-width: 25em), whereas not all and (min-width: 25em) includes (max-width: 25em). (max-width: 24.99em) is simply a poor man's version of not all and (min-width: 25em): do not use (max-width: 24.99em) because the layout might break on very high font sizes on very high def
inition devices in the future. always be very deliberate about choosing the right media query and choosing the right >=, <=, >, or < in any corresponding javascript because it is very easy to get these mixed up, resulting in the website looking wonking right at the screen size where the layout changes. thus, thoroughly test the website at the exact widths/heights where layout changes occur to ensure ...
Feature Policy - HTTP
defines the feature-policy header. directives are defined in the specs for the features they control. see individual directive pages for details. ...
...era encrypted media fullscreen geolocation gyroscope magnetometer microphone midi paymentrequest picture-in-picture usb vr / xr examples using feature policy see feature policy demos for example usage of many policies. specifications specification status comment feature policythe def
inition of 'feature-policy' in that specification. editor's draft
initial def
inition. defines the feature-policy header. directives are defined in the specs for the features they control. see individual directive pages for details. ...
Access-Control-Allow-Credentials - HTTP
value to false). ...
...sing xhr with credentials: var xhr = new xmlhttprequest(); xhr.open('get', 'http://example.com/', true); xhr.withcredentials = true; xhr.send(null); using fetch with credentials: fetch(url, { credentials: 'include' }) specifications specification status comment fetchthe def
inition of 'access-control-allow-credentials' in that specification. living standard
initial def
inition ...
Access-Control-Request-Headers - HTTP
...
...request-headers: <header-name>, <header-name>, ... directives <header-name> a comma-delimited list of http headers that are included in the request. examples access-control-request-headers: x-pingother, content-type specifications specification status comment fetchthe def
inition of 'access-control-request-headers' in that specification. living standard
initial def
inition. ...
CSP: base-uri - HTTP
subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and def
initely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url scheme and port number. you must include the single quotes. some browse...
...a csp violation. <meta http-equiv="content-security-policy" content="base-uri 'self'"> <base href="https://example.com/"> // error: refused to set the document's base uri to 'https://example.com/' // because it violates the following content security policy // directive: "base-uri 'self'" specifications specification status comment content security policy level 3the def
inition of 'base-uri' in that specification. working draft no changes. content security policy level 2the def
inition of 'base-uri' in that specification. recommendation
initial def
inition. ...
CSP: frame-ancestors - HTTP
g the iframe must also be https, per the w3c spec on matching source expressions. <scheme-source> a scheme such as http: or https:. the colon is required and scheme should not be quoted. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and def
initely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url scheme and port number. you must include the single quotes. some browse...
...low these content types can specify them using the data attribute. 'none' refers to the empty set; that is, no urls match. the single quotes are required. examples content-security-policy: frame-ancestors 'none'; content-security-policy: frame-ancestors 'self' https://www.example.org; specifications specification status comment content security policy level 3the def
inition of 'frame-ancestors' in that specification. working draft no changes. content security policy level 2the def
inition of 'frame-ancestors' in that specification. recommendation
initial def
inition. ...
CSP: frame-src - HTTP
tempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and def
initely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url scheme and port number. you must include the single quotes. some browse...
...ne scripts. csp 3.0 allows it in the case of script-src for external scripts. examples violation cases given this csp header: content-security-policy: frame-src https://example.com/ the following <iframe> is blocked and won't load: <iframe src="https://not-example.com/"></iframe> specifications specification status comment content security policy level 3the def
inition of 'frame-src' in that specification. working draft undeprecates frame-src. content security policy level 2the def
inition of 'frame-src' in that specification. recommendation deprecates frame-src. ...
CSP: img-src - HTTP
subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and def
initely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url scheme and port number. you must include the single quotes. some browse...
...le of the violating code to be included in the violation report. examples violation cases given this csp header: content-security-policy: img-src https://example.com/ the following <img> is blocked and won't load: <img src="https://not-example.com/foo.jpg" alt="example picture"> specifications specification status comment content security policy level 3the def
inition of 'img-src' in that specification. working draft no changes. content security policy level 2the def
inition of 'img-src' in that specification. recommendation
initial def
inition. ...
CSP: manifest-src - HTTP
tempts to load from any subdomain of example.com using the current protocol. <scheme-source> a schema such as 'http:' or 'https:'. the colon is required, single quotes shouldn't be used. you can also specify data schemas (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and def
initely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url scheme and port number. you must include the single quotes. some browse...
...p 3.0 allows it in the case of script-src for external scripts. examples violation cases given this csp header: content-security-policy: manifest-src https://example.com/ the following <link> is blocked and won't load: <link rel="manifest" href="https://not-example.com/manifest"> specifications specification status comment content security policy level 3the def
inition of 'manifest-src' in that specification. working draft
initial def
inition. ...
CSP: sandbox - HTTP
cess-by-user-activation lets the resource request access to the parent's storage capabilities with the storage access api. allow-top-navigation allows the page to navigate (load) content to the top-level browsing context. if this keyword is not used, this operation is not allowed. ...
...e top-level browsing context. if this keyword is not used, this operation is not allowed. allow-top-navigation-by-user-activation lets the resource navigate the top-level browsing context, but only if
initiated by a user gesture. examples content-security-policy: sandbox allow-scripts; specifications specification status comment content security policy level 3the def
inition of 'sandbox' in that specification. working draft no changes. content security policy level 2the def
inition of 'sandbox' in that specification. recommendation
initial def
inition. ...
CSP: script-src-attr - HTTP
subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and def
initely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url scheme and port number. you must include the single quotes. some browse...
...ple' requires a sample of the violating code to be included in the violation report. examples fallback to script-src if script-src-attr is absent, user agent falls back to the script-src directive, and if that is absent as well, to default-src. todo: add comprehensive examples. specifications specification status comment content security policy level 3the def
inition of 'script-src-attr' in that specification. working draft
initial def
inition. ...
CSP: script-src-elem - HTTP
subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and def
initely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url scheme and port number. you must include the single quotes. some browse...
...ple' requires a sample of the violating code to be included in the violation report. examples fallback to script-src if script-src-elem is absent, user agent falls back to the script-src directive, and if that is absent as well, to default-src. todo: add comprehensive examples. specifications specification status comment content security policy level 3the def
inition of 'script-src-elem' in that specification. working draft
initial def
inition. ...
CSP: script-src - HTTP
subdomain of example.com using the current protocol. <scheme-source> a scheme such as http: or https:. the colon is required. unlike other values below, single quotes shouldn't be used. you can also specify data schemes (not recommended). data: allows data: uris to be used as a content source. this is insecure; an attacker can also inject arbitrary data: uris. use this sparingly and def
initely not for scripts. mediastream: allows mediastream: uris to be used as a content source. blob: allows blob: uris to be used as a content source. filesystem: allows filesystem: uris to be used as a content source. 'self' refers to the origin from which the protected document is being served, including the same url scheme and port number. you must include the single quotes. some browse...
...agent sniffing. the policy: script-src 'unsafe-inline' https: 'nonce-abcdefg' 'strict-dynamic' will act like 'unsafe-inline' https: in browsers that support csp1, https: 'nonce-abcdefg' in browsers that support csp2, and 'nonce-abcdefg' 'strict-dynamic' in browsers that support csp3. specifications specification status comment content security policy level 3the def
inition of 'script-src' in that specification. working draft no changes. content security policy level 2the def
inition of 'script-src' in that specification. recommendation
initial def
inition. ...
Feature-Policy: payment - HTTP
...
...ted browsing contexts. 'none': the feature is disabled in top-level and nested browsing contexts. default policy the payment feature's default allowlist value is 'self'. specifications specification status comment payment request api candidate recommendation see section 16. feature policy integration. feature policy editor's draft
initial def
inition. ...
Feature-Policy: picture-in-picture - HTTP
...
...s) in the same origin. the feature is not allowed in cross-origin documents in nested browsing contexts. 'none': the feature is disabled in top-level and nested browsing contexts. default policy as of june 2019, the spec draft and google chrome set default allow list to *. specifications specification status comment feature policy editor's draft
initial def
inition. ...
Feature-Policy: unsized-media - HTTP
this restriction solves "layout instability" problem caused by providing default dimensions for images whose size is not specified in advance so that image doesn't change size after loading. ...
...ts. 'none': the feature is disabled in top-level and nested browsing contexts. default value the default value for unsized-media is '*', that is unsized media elements are allowed for all origins by default. the page will re-flow every time an image with unknown dimensions is loaded. specifications specification status comment feature policy editor's draft
initial def
inition. ...
Strict-Transport-Security - HTTP
ser 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 communicate with the non-encrypted version of the site before being redirected, if, for example, the visitor types http://www.foo.com/ or even just foo.com. this creates an opportunity for a man-in-the-middle attack. the redirect could be exploited to direct visitors to a malicious site instead of the secure version of the original site. the http strict transport security header informs the...
...s configuration as explained on https://hstspreload.org. it also suffixed with preload which is necessary for inclusion in most major web browsers' hsts preload lists, e.g. chromium, edge, & firefox. strict-transport-security: max-age=63072000; includesubdomains; preload specifications specification status comment http strict transport security (hsts) ietf rfc
initial def
inition ...
Want-Digest - HTTP
when released, the "resource digests for http" draft therefore will obsolete rfc 3230 and will update the standard to be consistent. ...
...when released, the "resource digests for http" draft therefore will obsolete rfc 3230 and will update the standard to be consistent. ...
An overview of HTTP - HTTP
a complete document is reconstructed from the different sub-documents fetched, for instance text, layout description, images, videos, scripts, and more. clients and servers communicate by exchanging individual messages (as opposed to a stream of data). ...
...er. although important to diagnose network problems, the underlying layers are mostly irrelevant to the description of http. client: the user-agent the user-agent is any tool that acts on the behalf of the user. this role is primarily performed by the web browser; other possibilities are programs used by engineers and web developers to debug their applications. the browser is always the entity
initiating the request. it is never the server (though some mechanisms have been added over the years to simulate server-
initiated messages). to present a web page, the browser sends an original request to fetch the html document that represents the page. it then parses this file, making additional requests corresponding to execution scripts, layout information (css) to display, and sub-resources con...
HTTP response status codes - HTTP
nd request. client error responses 400 bad request the server could not understand the request due to invalid syntax. 401 unauthorized although the http standard specifies "unauthorized", semantically this response means "unauthenticated". that is, the client must authenticate itself to get the requested response. 402 payment required this response code is reserved for future use. the
initial aim for creating this code was using it for digital payment systems, however this status code is used very rarely and no standard convention exists. 403 forbidden the client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. unlike 401, the client's identity is known to the server. 404 not found the server can ...
...osen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process. 507 insufficient storage (webdav) the method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request. 508 loop detected (webdav) the server detected an inf
inite loop while processing the request. 510 not extended further extensions to the request are required for the server to fulfil it. 511 network authentication required the 511 status code indicates that the client needs to authenticate to gain network access. ...
Equality comparisons and sameness - JavaScript
ero is either positively or negatively signed. this is useful in representing certain mathematical solutions, but as most situations don't care about the difference between +0 and -0, strict equality treats them as the same value. the second is that floating point includes the concept of a not-a-number value, nan, to represent the solution to certain ill-defined mathematical problems: negative inf
inity added to positive inf
inity, for example. strict equality treats nan as unequal to every other value -- including itself. (the only case in which (x !== x) is true is when x is nan.) loose equality using == loose equality compares two values for equality, after converting both values to a common type. after conversions (one or both sides may undergo conversions), the final equality comparison i...
...ngforce = obj.mass * -obj.velocity; if obj.velocity is 0 (or computes to 0), a -0 is introduced at that place and propogates out into stoppingforce. math.atan2 math.ceil math.pow math.round in some cases,it's possible for a -0 to be introduced into an expression as a return value of these methods even when no -0 exists as one of the parameters. for example, using math.pow to raise -inf
inity to the power of any negative, odd exponent evaluates to -0. refer to the documentation for the individual methods. math.floor math.max math.min math.sin math.sqrt math.tan it's possible to get a -0 return value out of these methods in some cases where a -0 exists as one of the parameters. e.g., math.min(-0, +0) evaluates to -0. refer to the documentation for the individual methods. ...
Groups and ranges - JavaScript
a negated or complemented character set. that is, it matches anything that is not enclosed in the brackets. you can specify a range of characters by using a hyphen, but if 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 ar...
... ...
Warning: expression closures are deprecated - JavaScript
execution won't be halted. what went wrong? the non-standard expression closure syntax (shorthand function syntax) is deprecated and shouldn't be used anymore. this syntax will be removed entirely in bug 1083458 and scripts using it will throw a syntaxerror then. examples deprecated syntax expression closures omit curly braces or return statements from function declarations or from method def
initions in objects. var x = function() 1; var obj = { count: function() 1 }; standard syntax to convert the non-standard expression closures syntax to standard ecmascript syntax, you can add curly braces and return statements. var x = function() { return 1; } var obj = { count: function() { return 1; } }; standard syntax using arrow functions alternatively, you can use arrow functions: ...
...turn statements. ...
TypeError: can't delete non-configurable array element - JavaScript
he length of an array, but one of the array's elements is non-configurable. when shortening an array, the elements beyond the new array length will be deleted, which failed in this situation. the configurable attribute controls whether the property can be deleted from the object and whether its attributes (other than writable) can be changed. usually, properties in an object created by an array
initializer are configurable. however, for example, when using object.defineproperty(), the property isn't configurable by default. examples non-configurable properties created by object.defineproperty the object.defineproperty() creates non-configurable properties by default if you haven't specified them as configurable. var arr = []; object.defineproperty(arr, 0, {value: 0}); object.defineproper...
...t.seal() function marks all existing elements as non-configurable. ...
The arguments object - JavaScript
code, the arguments object behaves the same whether or not a function is passed rest, default, or destructured parameters. that is, assigning new values to variables in the body of the function will not affect the arguments object. nor will assigning new variables to the arguments object affect the value of variables. note: you cannot write a "use strict"; directive in the body of a function def
inition that accepts rest, default, or destructured parameters. doing so will throw a syntax error. non-strict functions that are passed only simple parameters (that is, not rest, default, or restructured parameters) will sync the value of variables new values in the body of the function with the arguments object, and vice versa: function func(a) { arguments[0] = 99; // updating arguments[0] also...
... ...
Array() constructor - JavaScript
note that this special case only applies to javascript arrays created with the array constructor, not array literals created with the bracket syntax. ...
... ...
Array.prototype.every() - JavaScript
ay are bigger than 10. function isbigenough(element, index, array) { return element >= 10; } [12, 5, 8, 130, 44].every(isbigenough); // false [12, 54, 18, 130, 44].every(isbigenough); // true using arrow functions arrow functions provide a shorter syntax for the same test. [12, 5, 8, 130, 44].every(x => x >= 10); // false [12, 54, 18, 130, 44].every(x => x >= 10); // true affecting
initial array (modifying, appending, and deleting) the following examples tests the behaviour of the every method when the array is modified. // --------------- // modifying items // --------------- let arr = [1, 2, 3, 4]; arr.every( (elem, index, arr) => { arr[index+1] -= 1 console.log(`[${arr}][${index}] -> ${elem}`) return elem < 2 }) // loop runs for 3 iterations, but would // have run 2 ...
... ...
Array.prototype.indexOf() - JavaScript
work around this by utilizing the following code at the beginning of your scripts. this will allow you to use indexof() when there is still no native support. this algorithm matches the one specified in ecma-262, 5th edition, assuming typeerror and math.abs() have their original values. // this version tries to optimize by only checking for "in" when looking for undefined and // skipping the def
initely fruitless nan search. other parts are merely cosmetic conciseness. // whether it is actually faster remains to be seen. if (!array.prototype.indexof) array.prototype.indexof = (function(object, max, min) { "use strict" return function indexof(member, fromindex) { if (this === null || this === undefined) throw typeerror("array.prototype.indexof called on null or undefine...
... ...
Array.prototype.sort() - JavaScript
ng form: function compare(a, b) { if (a is less than b by some ordering criterion) { return -1; } if (a is greater than b by the ordering criterion) { return 1; } // a must be equal to b return 0; } to compare numbers instead of strings, the compare function can simply subtract b from a. the following function will sort the array in ascending order (if it doesn't contain inf
inity and nan): function comparenumbers(a, b) { return a - b; } the sort method can be conveniently used with function expressions: var numbers = [4, 2, 5, 1, 3]; numbers.sort(function(a, b) { return a - b; }); console.log(numbers); // [1, 2, 3, 4, 5] es2015 provides arrow function expressions with even shorter syntax. let numbers = [4, 2, 5, 1, 3]; numbers.sort((a, b) => a - b); console.l...
... ...
Array.prototype.toLocaleString() - JavaScript
...
...23, 12]; prices.tolocalestring('ja-jp', { style: 'currency', currency: 'jpy' }); // "¥7,¥500,¥8,123,¥12" for more examples, see also the intl, numberformat, and datetimeformat pages. specifications specification ecmascript (ecma-262)the def
inition of 'array.prototype.tolocalestring' in that specification. ecmascript internationalization api (ecma-402)the def
inition of 'array.prototype.tolocalestring' in that specification. ...
ArrayBuffer() constructor - JavaScript
r 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 new arraybuffer(length) parameters length the size, in bytes, of the array buffer to create. return value a new arraybuffer object of the specified size. its contents are
initialized to 0. exceptions a rangeerror is thrown if the length is larger than number.max_safe_integer (>= 2 ** 53) or negative. compatibility notes starting with ecmascript 2015, arraybuffer constructors require to be constructed with a new operator. calling an arraybuffer constructor as a function without new, will throw a typeerror from now on. var dv = arraybuffer(10); // typeerror: calling...
... ...
AsyncFunction - JavaScript
asyncfunction([arg1[, arg2[, ...argn]],] functionbody) parameters arg1, arg2, ... argn names to be used by the function as formal argument names. each must be a string that corresponds to a valid javascript identifier or a list of such strings separated with a comma; for example "x", "thevalue", or "a,b". functionbody a string containing the javascript statements comprising the function def
inition. description async function objects created with the asyncfunction constructor are parsed when the function is created. this is less efficient than declaring an async function with an async function expression and calling it within your code, because such functions are parsed with the rest of the code. all arguments passed to the function are treated as the names of the identifiers of the ...
... ...
Atomics.notify() - JavaScript
tifies up some agents that are sleeping in the wait queue. note: this operation works with a shared int32array only. it will return 0 on non-shared arraybuffer objects. syntax atomics.notify(typedarray, index, count) parameters typedarray a shared int32array. index the position in the typedarray to wake up on. count optional the number of sleeping agents to notify. defaults to +inf
inity. return value returns the number of woken up agents. returns 0, if a non-shared arraybuffer object is used. exceptions throws a typeerror, if typedarray is not a int32array. throws a rangeerror, if index is out of bounds in the typedarray. examples using notify given a shared int32array: const sab = new sharedarraybuffer(1024); const int32 = new int32array(sab); a reading thre...
... ...
Atomics.wait() - JavaScript
hich is either "ok", "not-equal", or "timed-out". note: this operation only works with a shared int32array and may not be allowed on the main thread. syntax atomics.wait(typedarray, index, value[, timeout]) parameters typedarray a shared int32array. index the position in the typedarray to wait on. value the expected value to test. timeout optional time to wait in milliseconds. inf
inity, if no time is provided. return value a string which is either "ok", "not-equal", or "timed-out". exceptions throws a typeerror, if typedarray is not a shared int32array. throws a rangeerror, if index is out of bounds in the typedarray. examples using wait() given a shared int32array: const sab = new sharedarraybuffer(1024); const int32 = new int32array(sab); a reading thread is s...
... ...
BigInt64Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation). ...
... ...
BigInt64Array - JavaScript
once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation). constructor bigint64array() creates a new bigint64array object. static properties bigint64array.bytes_per_element returns a number value of the element size. 8 in the case of a bigint64array. ...
... ...
BigUint64Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation). ...
... ...
BigUint64Array - JavaScript
once established, you can reference elements in the array using the object's methods, or by using standard array index syntax (that is, using bracket notation). constructor biguint64array() creates a new biguint64array object. static properties biguint64array.bytes_per_element returns a number value of the element size. 8 in the case of a biguint64array. ...
... ...
Date.prototype.toLocaleString() - JavaScript
...
...=== new date("2019-01-01t01:00:00z").tolocalestring("en-us"); // true in firefox and others // false in ie and edge note: see also this stackoverflow thread for more details and examples. specifications specification ecmascript (ecma-262)the def
inition of 'date.prototype.tolocalestring' in that specification. ecmascript internationalization api (ecma-402)the def
inition of 'date.prototype.tolocalestring' in that specification. ...
Float32Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). ...
... ...
Float32Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). constructor float32array() creates a new float32array object. static properties float32array.bytes_per_element returns a number value of the element size. ...
... ...
Float64Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). ...
... ...
Float64Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). constructor float64array() creates a new float64array object. static properties float64array.bytes_per_element returns a number value of the element size. ...
... ...
Function() constructor - JavaScript
([arg1 [, arg2 [, ...argn]] ,] functionbody) parameters arg1, arg2, ... argn names to be used by the function as formal argument names. each must be a string that corresponds to a valid javascript identifier, or a list of such strings separated with a comma. for example: "x", "thevalue"—or "x,thevalue". functionbody a string containing the javascript statements comprising the function def
inition. description function objects created with the function constructor are parsed when the function is created. this is less efficient than declaring a function with a function expression or function statement and calling it within your code because such functions are parsed with the rest of the code. all arguments passed to the function are treated as the names of the identifiers of the para...
... ...
Function.prototype.call() - JavaScript
ument list, while apply() accepts a single array of arguments. examples using call to chain constructors for an object you can use call to chain constructors for an object (similar to java). in the following example, the constructor for the product object is defined with two parameters: name and price. two other functions, food and toy, invoke product, passing this, name, and price. product
initializes the properties name and price, both specialized functions define the category. function product(name, price) { this.name = name; this.price = price; } function food(name, price) { product.call(this, name, price); this.category = 'food'; } function toy(name, price) { product.call(this, name, price); this.category = 'toy'; } const cheese = new food('feta', 5); const fun = new...
... ...
Generator - JavaScript
yield 2; yield 3; } const gen = generator(); // "generator { }" instance methods generator.prototype.next() returns a value yielded by the yield expression. generator.prototype.return() returns the given value and finishes the generator. generator.prototype.throw() throws an error to a generator (also finishes the generator, unless caught from within that generator). ...
...gen = generator(); // "generator { }" instance methods generator.prototype.next() returns a value yielded by the yield expression. generator.prototype.return() returns the given value and finishes the generator. generator.prototype.throw() throws an error to a generator (also finishes the generator, unless caught from within that generator). examples an inf
inite iterator function* inf
inite() { let index = 0; while (true) { yield index++; } } const generator = inf
inite(); // "generator { }" console.log(generator.next().value); // 0 console.log(generator.next().value); // 1 console.log(generator.next().value); // 2 // ... specifications specification ecmascript (ecma-262)the def
inition of 'generator objects' in that specification. ...
GeneratorFunction - JavaScript
atorfunction ([arg1[, arg2[, ...argn]],] functionbody) parameters arg1, arg2, ... argn names to be used by the function as formal argument names. each must be a string that corresponds to a valid javascript identifier or a list of such strings separated with a comma; for example "x", "thevalue", or "a,b". functionbody a string containing the javascript statements comprising the function def
inition. description generator function objects created with the generatorfunction constructor are parsed when the function is created. this is less efficient than declaring a generator function with a function* expression and calling it within your code, because such functions are parsed with the rest of the code. all arguments passed to the function are treated as the names of the identifiers of...
...the same effect as invoking it as a constructor. examples creating a generator function from a generatorfunction() constructor var generatorfunction = object.getprototypeof(function*(){}).constructor var g = new generatorfunction('a', 'yield a * 2'); var iterator = g(10); console.log(iterator.next().value); // 20 specifications specification ecmascript (ecma-262)the def
inition of 'generatorfunction' in that specification. ...
Int16Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). ...
... ...
Int16Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). constructor int16array() creates a new int16array object. static properties int16array.bytes_per_element returns a number value of the element size. 2 in the case of an int16array. ...
... ...
Int32Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). ...
... ...
Int32Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). constructor int32array() creates a new int32array object. static properties int32array.bytes_per_element returns a number value of the element size. 4 in the case of an int32array. ...
... ...
Int8Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). syntax new int8array(); // new in es2017 new int8array(length); new int8array(typedarray); new int8array(object); new int8array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros. ...
... ...
Int8Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). constructor int8array() creates a new int8array object. static properties int8array.bytes_per_element returns a number value of the element size. 1 in the case of an int8array. int8array.name returns the string value of the constructor name. in the case of the int8array type: "int8array". static methods int8array.from() creates a new int8array from an array-like or iterable object. ...
... ...
Intl.Collator.prototype.resolvedOptions() - JavaScript
the intl.collator.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and collation options computed during
initialization of this collator 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 collator.resolvedoptions() return value a new object with properties reflecting the locale and collation options computed during the
initialization of the given collator object. description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values were requested in the input bcp 47 ...
... ...
Intl.Collator - JavaScript
of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.collator.prototype.compare getter function that compares two strings according to the sort order of this intl.collator object. intl.collator.prototype.resolvedoptions() returns a new object with properties reflecting the locale and collation options computed during
initialization of the object. examples using collator the following example demonstrates the different potential results for a string occurring before, after, or at the same level as another: console.log(new intl.collator().compare('a', 'c')); // → a negative value console.log(new intl.collator().compare('c', 'a')); // → a positive value console.log(new intl.collator().compare('a', 'a')); // ...
... ...
Intl.DateTimeFormat.prototype.resolvedOptions() - JavaScript
the intl.datetimeformat.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and date and time formatting options computed during
initialization of this datetimeformat 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 datetimeformat.resolvedoptions() return value a new object with properties reflecting the locale and date and time formatting options computed during the
initialization of the given datetimeformat object. description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicod...
... ...
Intl.DateTimeFormat - JavaScript
a date according to the locale and formatting options of this datetimeformat object. intl.datetimeformat.prototype.formattoparts() returns an array of objects representing the date string in parts that can be used for custom locale-aware formatting. intl.datetimeformat.prototype.resolvedoptions() returns a new object with properties reflecting the locale and formatting options computed during
initialization of the object. intl.datetimeformat.prototype.formatrange() this method receives two dates and formats the date range in the most concise way based on the locale and options provided when instantiating datetimeformat. intl.datetimeformat.prototype.formatrangetoparts() this method receives two dates and returns an array of objects containing the locale-specific tokens representing eac...
... ...
Intl.DisplayNames - JavaScript
upported without having to fall back to the runtime's default locale. instance methods intl.displaynames.prototype.of() this method receives a code and returns a string based on the locale and options provided when instantiating intl.displaynames. intl.displaynames.prototype.resolvedoptions() returns a new object with properties reflecting the locale and formatting options computed during
initialization of the object. examples region code display names to create an intl.displaynames for a locale and get the display name for a region code. // get display names of region in english let regionnames = new intl.displaynames(['en'], {type: 'region'}); regionnames.of('419'); // "latin america" regionnames.of('bz'); // "belize" regionnames.of('us'); // "united states" regionnames.of('ba...
... ...
Intl.Locale.prototype.collation - JavaScript
) phonebk phonebook style ordering (such as in german) phonetic phonetic ordering (sorting based on pronunciation) pinyin pinyin ordering for latin and for cjk characters (used in chinese) reformed reformed ordering (such as in swedish) search special collation type for string search searchjl special collation type for korean
initial consonant search standard default ordering for each language stroke pinyin ordering for latin, stroke order for cjk characters (used in chinese) trad traditional style ordering (such as in spanish) unihan pinyin ordering for latin, unihan radical-stroke ordering for cjk characters (used in chinese) zhuyin pinyin ordering for lati...
... to the intl.locale object via the locale string, or a configuration object argument to the constructor. adding a collation type via the locale string in the unicode locale string spec, collation types are locale key "extension subtags". these subtags add additional data about the locale, and are added to locale identifiers by using the -u extension. thus, the collation type can be added to the
inital locale identifier string that is passed into the locale constructor. to add the collation type, first add the -u extension to the string. next, add the -co extension to indicate that you are adding a collation type. finally, add the collation to the string. let stringcoll = new intl.locale("en-latn-us-u-co-emoji"); console.log(stringcoll.collation); // prints "emoji" adding a collation type ...
Intl.NumberFormat.prototype.formatToParts() - JavaScript
"integer", value: "3" }, { type: "group", value: "." }, { type: "integer", value: "500" } ] possible types are the following: currency the currency string, such as the symbols "$" and "€" or the name "dollar", "euro" depending on how currencydisplay is specified. decimal the decimal separator string ("."). fraction the fraction number. group the group separator string (","). inf
inity the inf
inity string ("∞"). integer the integer number. literal any literal strings or whitespace in the formatted number. minussign the minus sign string ("-"). nan the nan string ("nan"). plussign the plus sign string ("+"). percentsign the percent sign string ("%"). examples comparing format and formattoparts numberformat outputs localized, opaque strings that cannot be m...
... ...
Intl.NumberFormat.prototype.resolvedOptions() - JavaScript
the intl.numberformat.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and number formatting options computed during
initialization of this numberformat 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 numberformat.resolvedoptions() return value a new object with properties reflecting the locale and number formatting options computed during the
initialization of the given numberformat object. description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if any unicode extension values wer...
... ...
Intl.NumberFormat - JavaScript
ts a number according to the locale and formatting options of this numberformat object. intl.numberformat.prototype.formattoparts() returns an array of objects representing the number string in parts that can be used for custom locale-aware formatting. intl.numberformat.prototype.resolvedoptions() returns a new object with properties reflecting the locale and collation options computed during
initialization of the object. examples basic usage in basic use without specifying a locale, a formatted string in the default locale and with default options is returned. var number = 3500; console.log(new intl.numberformat().format(number)); // → '3,500' if in us english locale using locales this example shows some of the variations in localized number formats. in order to get the format ...
... ...
Intl.PluralRules - JavaScript
reates a new intl.pluralrules object. static methods intl.pluralrules.supportedlocalesof() returns an array containing those of the provided locales that are supported without having to fall back to the runtime's default locale. instance methods intl.pluralrules.prototype.resolvedoptions() returns a new object with properties reflecting the locale and collation options computed during
initialization of the object. intl.pluralrules.prototype.select() returns a string indicating which plural rule to use for locale-aware formatting. examples using locales this example shows some of the variations in localized plural rules. in order to get the format of the language used in the user interface of your application, make sure to specify that language (and possibly some fallback lang...
... ...
Intl.RelativeTimeFormat.prototype.resolvedOptions() - JavaScript
the intl.relativetimeformat.prototype.resolvedoptions() method returns a new object with properties reflecting the locale and relative time formatting options computed during
initialization of this relativetimeformat 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 relativetimeformat.resolvedoptions() return value a new object with properties reflecting the locale and number formatting options computed during the
initialization of the given relativetimeformat object. description the resulting object has the following properties: locale the bcp 47 language tag for the locale actually used. if a...
... stage 4 ...
Intl.RelativeTimeFormat - JavaScript
and formatting options of the given intl.relativetimeformat object. intl.relativetimeformat.prototype.formattoparts() returns an array of objects representing the relative time format in parts that can be used for custom locale-aware formatting. intl.relativetimeformat.prototype.resolvedoptions() returns a new object with properties reflecting the locale and formatting options computed during
initialization of the object. examples basic format usage the following example shows how to use a relative time formatter for the english language. // create a relative time formatter in your locale // with default values explicitly passed in. const rtf = new intl.relativetimeformat("en", { localematcher: "best fit", // other values: "lookup" numeric: "always", // other values: "auto" ...
...tive time using the day unit. rtf.formattoparts(-1, "day"); // > [{ type: "literal", value: "yesterday"}] rtf.formattoparts(100, "day"); // > [{ type: "literal", value: "in " }, // > { type: "integer", value: "100", unit: "day" }, // > { type: "literal", value: " days" }] specifications specification status comment ecmascript internationalization api (ecma-402)the def
inition of 'relativetimeformat' in that specification. ...
JSON - JavaScript
on differences json is a syntax for serializing objects, arrays, numbers, strings, booleans, and null. it is based upon javascript syntax but is distinct from it: some javascript is not json. objects and arrays property names must be double-quoted strings; trailing commas are forbidden. numbers leading zeros are prohibited. a decimal point must be followed by at least one digit. nan and inf
inity are unsupported. any json text is a valid javascript expression... ...but only in javascript engines that have implemented the proposal to make all json text valid ecma-262. in engines that haven't implemented the proposal, u+2028 line separator and u+2029 paragraph separator are allowed in string literals and property keys in json; but their use in these features in javascript string literals...
... ...
Map.prototype[@@iterator]() - 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 mymap[symbol.iterator] return value the map iterator function, which is the entries() function by default. ...
... ...
Math.atan() - JavaScript
scription the math.atan() method returns a numeric value between -π2-\frac{\pi}{2} and π2\frac{\pi}{2} radians. because atan() is a static method of math, you always use it as math.atan(), rather than as a method of a math object you created (math is not a constructor). examples using math.atan() math.atan(1); // 0.7853981633974483 math.atan(0); // 0 math.atan(-0); // -0 math.atan(inf
inity); // 1.5707963267948966 math.atan(-inf
inity); // -1.5707963267948966 // the angle that the line [(0,0);(x,y)] forms with the x-axis in a cartesian coordinate system math.atan(y / x); note that you may want to avoid using ±inf
inity for stylistic reasons. in this case, math.atan2() with 0 as the second argument may be a better solution. specifications specification ...
... math.atan(-inf
inity); // -1.5707963267948966 // the angle that the line [(0,0);(x,y)] forms with the x-axis in a cartesian coordinate system math.atan(y / x); note that you may want to avoid using ±inf
inity for stylistic reasons. in this case, math.atan2() with 0 as the second argument may be a better solution. specifications specification ecmascript (ecma-262)the def
inition of 'math.atan' in that specification. ...
Math.max() - JavaScript
. syntax math.max([value1[, value2[, ...]]]) parameters value1, value2, ... numbers. return value the largest of the given numbers. if at least one of the arguments cannot be converted to a number, nan is returned. description because math is not a constructor, max() is a static method of math (you always use it as math.max(), rather than as a method of an instanced math object). -inf
inity is the
initial comparant because almost every other value is bigger, that's why when no arguments are given, -inf
inity is returned. if at least one of arguments cannot be converted to a number, the result is nan. examples using math.max() math.max(10, 20); // 20 math.max(-10, -20); // -10 math.max(-10, 20); // 20 getting the maximum element of an array array.reduce() can be used to f...
... ...
Math.min() - JavaScript
se clone https://github.com/mdn/interactive-examples and send us a pull request. syntax math.min([value1[, value2[, ...]]]) parameters value1, value2, ... zero or more numbers among which the lowest value will be selected and returned. return value the smallest of the given numbers. if any one or more of the parameters cannot be converted into a number, nan is returned. the result is inf
inity if no parameters are provided. description because min() is a static method of math, you always use it as math.min(), rather than as a method of a math object you created (math is not a constructor). if no arguments are given, the result is inf
inity. if at least one of arguments cannot be converted to a number, the result is nan. examples using math.min() this finds the min of x and y and...
... ...
Math.random() - JavaScript
math.random() does not provide cryptographically secure random numbers. do not use them for anything related to security. ...
... ...
Math.random() - JavaScript
math.random() does not provide cryptographically secure random numbers. do not use them for anything related to security. ...
... ...
Number.MAX_VALUE - JavaScript
ease clone https://github.com/mdn/interactive-examples and send us a pull request. property attributes of number.max_value writable no enumerable no configurable no description the max_value property has a value of approximately 1.79e+308, or 21024. values larger than max_value are represented as inf
inity. because max_value is a static property of number, you always use it as number.max_value, rather than as a property of a number object you created. examples using max_value the following code multiplies two numeric values. if the result is less than or equal to max_value, the func1 function is called; otherwise, the func2 function is called. if (num1 * num2 <= number.max_value) { func1()...
...an as a property of a number object you created. examples using max_value the following code multiplies two numeric values. if the result is less than or equal to max_value, the func1 function is called; otherwise, the func2 function is called. if (num1 * num2 <= number.max_value) { func1(); } else { func2(); } specifications specification ecmascript (ecma-262)the def
inition of 'number.max_value' in that specification. ...
Object.prototype.__defineGetter__() - JavaScript
while this feature is widely implemented, it is only described in the ecmascript specification because of legacy usage. this method should not be used since better alternatives exist. the __definegetter__ method binds an object's property to a function to be called when that property is looked up. syntax obj.__definegetter__(prop, func) parameters prop a string containing the name of the property to bind to the given function. func a function to be bound to a lookup of the specified property. return value undefined. ...
... ...
Object.prototype.__defineSetter__() - JavaScript
however, as it is widely implemented and used on the web, it is very unlikely that browsers will stop implementing it. the __definesetter__ method binds an object's property to a function to be called when an attempt is made to set that property. syntax obj.__definesetter__(prop, fun) parameters prop a string containing the name of the property to be bound to the given function. fun a function to be called when there is an attempt to set the specified property. this function takes the form function(val) { . . . ...
... ...
Object.assign() - JavaScript
() method only copies enumerable and own properties from a source object to a target object. it uses [[get]] on the source and [[set]] on the target, so it will invoke getters and setters. therefore it assigns properties, versus copying or defining new properties. this may make it unsuitable for merging new properties into a prototype if the merge sources contain getters. for copying property def
initions (including their enumerability) into prototypes, use object.getownpropertydescriptor() and object.defineproperty() instead. both string and symbol properties are copied. in case of an error, for example if a property is non-writable, a typeerror is raised, and the target object is changed if any properties are added before the error is raised. note: object.assign() does not throw on null ...
... ...
Object.create() - JavaScript
o = object.create({}, { p: { value: 42 } }); // by default properties are not writable, // enumerable or configurable: o.p = 24; o.p; // 42 o.q = 12; for (var prop in o) { console.log(prop); } /...
... ...
Object.defineProperties() - JavaScript
o the property. defaults to undefined. if a descriptor has neither of value, writable, get and set keys, it is treated as a data descriptor. if a descriptor has both value or writable and get or set keys, an exception is thrown. return value the object that was passed to the function. ...
... ...
Object.freeze() - JavaScript
t 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.getOwnPropertySymbols() - JavaScript
ned. return value an array of all symbol properties found directly upon the given object. description similar to object.getownpropertynames(), you can get all symbol properties of a given object as an array of symbols. note that object.getownpropertynames() itself does not contain the symbol properties of an object and only the string properties. as all objects have no own symbol properties
initially, object.getownpropertysymbols() returns an empty array unless you have set symbol properties on your object. examples using getownpropertysymbols var obj = {}; var a = symbol('a'); var b = symbol.for('b'); obj[a] = 'localsymbol'; obj[b] = 'globalsymbol'; var objectsymbols = object.getownpropertysymbols(obj); console.log(objectsymbols.length); // 2 console.log(objectsymbols); // ...
... ...
Object.isExtensible() - JavaScript
__ property can be modified. an object can be marked as non-extensible using object.preventextensions(), object.seal(), or object.freeze(). examples using object.isextensible // new objects are extensible. var empty = {}; object.isextensible(empty); // === true // ...but that can be changed. object.preventextensions(empty); object.isextensible(empty); // === false // sealed objects are by def
inition non-extensible. var sealed = object.seal({}); object.isextensible(sealed); // === false // frozen objects are also by def
inition non-extensible. var frozen = object.freeze({}); object.isextensible(frozen); // === false non-object coercion 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 a...
...is not an object (a primitive), then it will cause a typeerror. in es2015, a non-object argument will be treated as if it was a non-extensible ordinary object, simply return false. object.isextensible(1); // typeerror: 1 is not an object (es5 code) object.isextensible(1); // false (es2015 code) specifications specification ecmascript (ecma-262)the def
inition of 'object.isextensible' in that specification. ...
Object.isFrozen() - JavaScript
t make that property non-configurable // and it becomes frozen. object.defineproperty(accessor, 'food', { configurable: false }); object.isfrozen(accessor); // === true // but the easiest way for an object to be frozen // is if object.freeze has been called on it. var frozen = { 1: 81 }; object.isfrozen(frozen); // === false object.freeze(frozen); object.isfrozen(frozen); // === true // by def
inition, a frozen object is non-extensible. object.isextensible(frozen); // === false // also by def
inition, a frozen object is sealed. object.issealed(frozen); // === true non-object coercion 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 was a frozen ordinary object, simply return tr...
... ...
Object.isSealed() - JavaScript
hasprop); object.issealed(hasprop); // === false // but make them all non-configurable // and the object becomes sealed. object.defineproperty(hasprop, 'fee', { configurable: false }); object.issealed(hasprop); // === true // the easiest way to seal an object, of course, // is object.seal. var sealed = {}; object.seal(sealed); object.issealed(sealed); // === true // a sealed object is, by def
inition, non-extensible. object.isextensible(sealed); // === false // a sealed object might be frozen, // but it doesn't have to be. object.isfrozen(sealed); // === true // (all properties also non-writable) var s2 = object.seal({ p: 3 }); object.isfrozen(s2); // === false // ('p' is still writable) var s3 = object.seal({ get p() { return 0; } }); object.isfrozen(s3); // === true // (only configura...
... ...
Object.prototype.__proto__ - JavaScript
cation for compatibility with web browsers, so it will be supported into the future. it is deprecated in favor of object.getprototypeof/reflect.getprototypeof and object.setprototypeof/reflect.setprototypeof (though still, setting the [[prototype]] of an object is a slow operation that should be avoided if performance is a concern). the __proto__ property can also be used in an object literal def
inition to set the object [[prototype]] on creation, as an alternative to object.create(). see: object
initializer / literal syntax. description the __proto__ getter function exposes the value of the internal [[prototype]] of an object. for objects created using an object literal, this value is object.prototype. for objects created using array literals, this value is array.prototype. for functions, ...
... ...
Reflect.construct() - JavaScript
ist[, newtarget]) parameters target the target function to call. argumentslist an array-like object specifying the arguments with which target should be called. newtarget optional the constructor whose prototype should be used. see also the new.target operator. if newtarget is not present, its value defaults to target. return value a new instance of target (or newtarget, if present),
initialized by target as a constructor with the given argumentslist. exceptions a typeerror, if target or newtarget are not constructors. description reflect.construct() allows you to invoke a constructor with a variable number of arguments. (this would also be possible by using the spread syntax combined with the new operator.) let obj = new foo(...args) let obj = reflect.construct(foo, args) ...
...output: // oneclass // function otherclass { ... } let obj3 = object.create(otherclass.prototype); oneclass.apply(obj3, args) // output: // oneclass // undefined examples using reflect.construct() let d = reflect.construct(date, [1776, 6, 4]) d instanceof date // true d.getfullyear() // 1776 specifications specification ecmascript (ecma-262)the def
inition of 'reflect.construct' in that specification. ...
Reflect.defineProperty() - JavaScript
urns the object or throws a typeerror if the property has not been successfully defined. reflect.defineproperty, however, simply returns a boolean indicating whether or not the property was successfully defined. examples using reflect.defineproperty() let obj = {} reflect.defineproperty(obj, 'x', {value: 7}) // true obj.x // 7 checking if property def
inition has been successful with object.defineproperty, which returns an object if successful, or throws a typeerror otherwise, you would use a try...catch block to catch any error that occurred while defining a property. ] because reflect.defineproperty returns a boolean success status, you can just use an if...else block here: if (reflect.defineproperty(target, property, attributes)) { // succe...
... ...
Reflect.isExtensible() - JavaScript
ible (whether it can have new properties added to it). it is the same method as object.isextensible(). examples using reflect.isextensible() see also object.isextensible(). // new objects are extensible. let empty = {} reflect.isextensible(empty) // === true // ...but that can be changed. reflect.preventextensions(empty) reflect.isextensible(empty) // === false // sealed objects are by def
inition non-extensible. let sealed = object.seal({}) reflect.isextensible(sealed) // === false // frozen objects are also by def
inition non-extensible. let frozen = object.freeze({}) reflect.isextensible(frozen) // === false difference to object.isextensible() if the target argument to this method is not an object (a primitive), then it will cause a typeerror. with object.isextensible(), a non-o...
... ...
RegExp.prototype.exec() - JavaScript
le ((myarray = myre.exec(str)) !== null) { let msg = 'found ' + myarray[0] + '. '; msg += 'next match starts at ' + myre.lastindex; console.log(msg); } this script displays the following text: found abb. next match starts at 3 found ab. next match starts at 9 warning: do not place the regular expression literal (or regexp constructor) within the while condition! it will create an inf
inite loop if there is a match, due to the lastindex property being reset upon each iteration. also, be sure that the global flag ("g") is set, or it will also cause an inf
inite loop. using exec() with regexp literals you can also use exec() without creating a regexp object explicitly: let matches = /(hello \s+)/.exec('this is a hello world!'); console.log(matches[1]); this will log a message c...
...hat the global flag ("g") is set, or it will also cause an inf
inite loop. using exec() with regexp literals you can also use exec() without creating a regexp object explicitly: let matches = /(hello \s+)/.exec('this is a hello world!'); console.log(matches[1]); this will log a message containing 'hello world!'. specifications specification ecmascript (ecma-262)the def
inition of 'regexp.exec' in that specification. ...
Set.prototype[@@iterator]() - 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 myset[symbol.iterator] return value the set iterator function, which is the values() function by default. ...
... ...
SharedArrayBuffer() constructor - JavaScript
tive 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 new sharedarraybuffer([length]) parameters length the size, in bytes, of the array buffer to create. return value a new sharedarraybuffer object of the specified size. its contents are
initialized to 0. examples always use the new operator to create a sharedarraybuffer sharedarraybuffer constructors are required to be constructed with a new operator. calling a sharedarraybuffer constructor as a function without new will throw a typeerror. var sab = sharedarraybuffer(1024); // typeerror: calling a builtin sharedarraybuffer constructor // without new is forbidden var sab = new sh...
...r constructors are required to be constructed with a new operator. calling a sharedarraybuffer constructor as a function without new will throw a typeerror. var sab = sharedarraybuffer(1024); // typeerror: calling a builtin sharedarraybuffer constructor // without new is forbidden var sab = new sharedarraybuffer(1024); specifications specification ecmascript (ecma-262)the def
inition of 'sharedarraybuffer constructor' in that specification. ...
String.prototype.lastIndexOf() - JavaScript
https://github.com/mdn/interactive-examples and send us a pull request. syntax str.lastindexof(searchvalue[, fromindex]) parameters searchvalue a string representing the value to search for. if searchvalue is an empty string, then fromindex is returned. fromindex optional the index of the last character in the string to be considered as the beginning of a match. the default value is +inf
inity. if fromindex >= str.length, the whole string is searched. if fromindex < 0, the behavior will be the same as if it would be 0. return value the index of the last occurrence of searchvalue; -1 if not found. description characters in a string are indexed from left to right. the index of the first character is 0, and the index of the last character is str.length - 1. 'canal'.lastindexof('a'...
... ...
String.prototype.match() - JavaScript
using match() with no parameter const str = "nothing will come of nothing."; str.match(); // returns [""] a non-regexp object as the parameter when the regexp parameter is a string or a number, it is implicitly converted to a regexp by using new regexp(regexp). if it is a positive number with a positive sign, regexp() will ignore the positive sign. const str1 = "nan means not a number. inf
inity contains -inf
inity and +inf
inity in javascript.", str2 = "my grandfather is 65 years old and my grandmother is 63 years old.", str3 = "the contract was declared null and void."; str1.match("number"); // "number" is a string. returns ["number"] str1.match(nan); // the type of nan is the number. returns ["nan"] str1.match(inf
inity); // the type of inf
inity is the number. returns...
...ains -inf
inity and +inf
inity in javascript.", str2 = "my grandfather is 65 years old and my grandmother is 63 years old.", str3 = "the contract was declared null and void."; str1.match("number"); // "number" is a string. returns ["number"] str1.match(nan); // the type of nan is the number. returns ["nan"] str1.match(inf
inity); // the type of inf
inity is the number. returns ["inf
inity"] str1.match(+inf
inity); // returns ["inf
inity"] str1.match(-inf
inity); // returns ["-inf
inity"] str2.match(65); // returns ["65"] str2.match(+65); // a number with a positive sign. returns ["65"] str3.match(null); // returns ["null"] specifications specification ecmascript (ecma-262)the def
inition of 'string.prototype.match' in that specification. ...
String.prototype.normalize() - JavaScript
ications. in the example above the normalization is appropriate for search, because it enables a user to find the string by searching for "f". but it may not be appropriate for display, because the visual representation is different. as with canonical normalization, you can ask for decomposed or composed compatible forms by passing "nfkd" or "nfkc", respectively. ...
... ...
String.prototype.substring() - JavaScript
eb. // replaces olds with news in the string fulls function replacestring(olds, news, fulls) { for (let i = 0; i < fulls.length; ++i) { if (fulls.substring(i, i + olds.length) == olds) { fulls = fulls.substring(0, i) + news + fulls.substring(i + olds.length, fulls.length) } } return fulls } replacestring('world', 'web', 'brave new world') note that this can result in an inf
inite loop if olds is itself a substring of news — for example, if you attempted to replace 'world' with 'otherworld' here. a better method for replacing strings is as follows: function replacestring(olds, news, fulls) { return fulls.split(olds).join(news) } the code above serves as an example for substring operations. if you need to replace substrings, most of the time you will want to use st...
...erworld' here. a better method for replacing strings is as follows: function replacestring(olds, news, fulls) { return fulls.split(olds).join(news) } the code above serves as an example for substring operations. if you need to replace substrings, most of the time you will want to use string.prototype.replace(). specifications specification ecmascript (ecma-262)the def
inition of 'string.prototype.substring' in that specification. ...
Symbol() constructor - 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. ...
... ...
Symbol.for() - JavaScript
list. symbol.for() does also not necessarily create a new symbol on every call, but checks first if a symbol with the given key is already present in the registry. in that case, that symbol is returned. if no symbol with the given key is found, symbol.for() will create a new global symbol. global symbol registry the global symbol registry is a list with the following record structure and it is
initialized empty: a record in the global symbol registry field name value [[key]] a string key used to identify a symbol. [[symbol]] a symbol that is stored globally. examples using symbol.for symbol.for('foo'); // create a new global symbol symbol.for('foo'); // retrieve the already created symbol // same global symbol, but not locally symbol.for('bar'...
... ...
Symbol - JavaScript
ate symbols available across files and even across realms (each of which has its own global scope), use the methods symbol.for() and symbol.keyfor() to set and retrieve symbols from the global symbol registry. finding symbol properties on objects the method object.getownpropertysymbols() returns an array of symbols and lets you find symbol properties on a given object. note that every object is
initialized with no own symbol properties, so that this array will be empty unless you've set symbol properties on the object. constructor symbol() creates a new symbol object. it is incomplete as a constructor because it does not support the syntax "new symbol()". static properties symbol.asynciterator a method that returns the default asynciterator for an object. used by for await...of. ...
... ...
Uint16Array() constructor - JavaScript
h parameters specify the memory range that will be exposed by the typed array view. if both are omitted, all of buffer is viewed; if only length is omitted, the remainder of buffer is viewed. description the uint16array() typed array constructor creates an array of 16-bit unsigned integers in the platform byte order. if control over byte order is needed, use dataview instead. the contents are
initialized to 0. once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). starting with ecmascript 2015, uint16array constructors require to be constructed with a new operator. calling a uint16array constructor as a function without new, will throw a typeerror from now on. var dv = uint16array([1, 2...
... ...
Uint16Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). constructor uint16array() creates a new uint16array object. static properties uint16array.bytes_per_element returns a number value of the element size. 2 in the case of an uint16array. uint16array.name returns the string value of the constructor name. ...
... ...
Uint32Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). ...
... ...
Uint32Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). constructor uint32array() creates a new uint32array object. static properties uint32array.bytes_per_element returns a number value of the element size. 4 in the case of an uint32array. uint32array.name returns the string value of the constructor name. ...
... ...
Uint8Array() constructor - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). syntax new uint8array(); // new in es2017 new uint8array(length); new uint8array(typedarray); new uint8array(object); new uint8array(buffer [, byteoffset [, length]]); parameters length when called with a length argument, an internal array buffer is created in memory, of size length multiplied by bytes_per_element bytes, containing zeros. ...
... ...
Uint8Array - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). constructor uint8array() creates a new uint8array object. static properties uint8array.bytes_per_element returns a number value of the element size. 1 in the case of an uint8array. uint8array.name returns the string value of the constructor name. in the case of the uint8array type: "uint8array". static methods uint8array.from() creates a new uint8array from an array-like or iterable object. see also array.from(). ...
... ...
Uint8ClampedArray - JavaScript
once established, you can reference elements in the array using the object's methods, or using standard array index syntax (that is, using bracket notation). constructor uint8clampedarray() creates a new uint8clampedarray object. ...
... ...
WeakMap - JavaScript
onding value from the array of values. such an implementation would have two main inconveniences: the first one is an o(n) set and search (n being the number of keys in the map) since both operations must iterate through the list of keys to find a matching value. the second inconvenience is a memory leak because the arrays ensure that references to each key and each value are maintained indef
initely. these references prevent the keys from being garbage collected, even if there are no other references to the object. this would also prevent the corresponding values from being garbage collected. by contrast, native weakmaps hold "weak" references to key objects, which means that they do not prevent garbage collection in case there would be no other reference to the key object. this also av...
..., because there is no key for o2 on wm2 wm2.get(o3); // undefined, because that is the set value wm1.has(o2); // true wm2.has(o2); // false wm2.has(o3); // true (even if the value itself is 'undefined') wm3.set(o1, 37); wm3.get(o1); // 37 wm1.has(o1); // true wm1.delete(o1); wm1.has(o1); // false implementing a weakmap-like class with a .clear() method class clearableweakmap { constructor(
init) { this._wm = new weakmap(
init); } clear() { this._wm = new weakmap(); } delete(k) { return this._wm.delete(k); } get(k) { return this._wm.get(k); } has(k) { return this._wm.has(k); } set(k, v) { this._wm.set(k, v); return this; } } specifications specification ecmascript (ecma-262)the def
inition of 'weakmap' in that speci...
WeakSet - JavaScript
use case: detecting circular references functions that call themselves recursively need a way of guarding against circular data structures by tracking which objects have already been processed. ...
... ...
WebAssembly.CompileError() constructor - JavaScript
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. desktopmobile...
... // "somefile" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // returns the location where the code was run } specifications specification webassembly javascript interfacethe def
inition of 'webassembly constructors' in that specification. ecmascript (ecma-262)the def
inition of 'nativeerror constructor' in that 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for an...
WebAssembly.CompileError - JavaScript
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. desktopmobileserverchrome...
... // "somefile" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // returns the location where the code was run } specifications specification webassembly javascript interfacethe def
inition of 'webassembly constructors' in that specification. ecmascript (ecma-262)the def
inition of 'nativeerror' in that 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera f...
WebAssembly.Global() constructor - JavaScript
specifications specification ...
...(), 0); global.value = 42; asserteq("getting js-updated value from wasm", instance.exports.getglobal(), 42); instance.exports.incglobal(); asserteq("getting wasm-updated value from js", global.value, 43); }); note: you can see the example running live on github; see also the source code. specifications specification webassembly javascript interfacethe def
inition of 'webassembly.global() constructor' in that 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfiref...
WebAssembly.LinkError() constructor - JavaScript
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. desktopmobileserverchromeed...
...ilename); // "somefile" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // returns the location where the code was run } specifications specification webassembly javascript interfacethe def
inition of 'linkerror' in that specification. ecmascript (ecma-262)the def
inition of 'nativeerror constructors' in that 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for a...
WebAssembly.LinkError - JavaScript
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. desktopmobileserverchromeedgefirefoxinte...
...ilename); // "somefile" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // returns the location where the code was run } specifications specification webassembly javascript interfacethe def
inition of 'linkerror' in that specification. ecmascript (ecma-262)the def
inition of 'nativeerror' in that 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera f...
WebAssembly.Memory - JavaScript
ained in the memory. instance methods memory.prototype.grow() increases the size of the memory instance by a specified number of webassembly pages (each one is 64kb in size). examples creating a new memory object there are two ways to get a webassembly.memory object. the first way is to construct it from javascript. the following example creates a new webassembly memory instance with an
initial size of 10 pages (640kib), and a maximum size of 100 pages (6.4mib). its buffer property will return an arraybuffer. var memory = new webassembly.memory({
initial:10, maximum:100}); the second way to get a webassembly.memory object is to have it exported by a webassembly module. the following example (see memory.html on github, and view it live also) fetches and instantiates the loaded memor...
...tiatestreaming(fetch('memory.wasm'), { js: { mem: memory } }) .then(obj => { var i32 = new uint32array(memory.buffer); for (var i = 0; i < 10; i++) { i32[i] = i; } var sum = obj.instance.exports.accumulate(0, 10); console.log(sum); }); creating a shared memory by default, webassembly memories are unshared. you can create a shared memory by passing shared: true in the constructor's
initialization object: let memory = new webassembly.memory({
initial:10, maximum:100, shared: true}); this memory's buffer property will return a sharedarraybuffer. specifications specification webassembly javascript interfacethe def
inition of 'memory' in that specification. browser compatibility the compatibility table on this page is generated from structured data. ...
WebAssembly.RuntimeError() constructor - JavaScript
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...
... "somefile" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // returns the location where the code was run } specifications specification webassembly javascript interfacethe def
inition of 'webassembly.runtimeerror constructor' in that specification. ecmascript (ecma-262)the def
inition of 'nativeerror constructor' in that 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for an...
WebAssembly.RuntimeError - JavaScript
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. desktopmobileserverchrome...
... // "somefile" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // returns the location where the code was run } specifications specification webassembly javascript interfacethe def
inition of 'webassembly constructors' in that specification. ecmascript (ecma-262)the def
inition of 'nativeerror' in that 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobileserverchromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera f...
WebAssembly.Table.prototype.grow() - JavaScript
ize of the table instance by a specified number of elements. syntax table.grow(number); parameters number the number of elements you want to grow the table by. return value the previous length of the table. exceptions if the grow() operation fails for whatever reason, a rangeerror is thrown. ...
...s number the number of elements you want to grow the table by. return value the previous length of the table. exceptions if the grow() operation fails for whatever reason, a rangeerror is thrown. examples using grow the following example creates a new webassembly table instance with an
initial size of 2 and a maximum size of 10. var table = new webassembly.table({ element: "anyfunc",
initial: 2, maximum: 10 }); you can then grow the table by 1 with the following: console.log(table.length); // "2" console.log(table.grow(1)); // "2" console.log(table.length); // "3" specifications specification webassembly javascript interfacethe def
inition of 'grow()' in that specification. browser compatibility the compatibility table on this page is genera...
null - JavaScript
n the value null is written with a literal: null. null is not an identifier for a property of the global object, like undefined can be. instead, null expresses a lack of identification, indicating that a variable points to no object. in apis, null is often retrieved in a place where an object can be expected but no object is relevant. // foo does not exist. it is not defined and has never been
initialized: foo; //referenceerror: foo is not defined // foo is known to exist now but it has no type or value: var foo = null; foo; //null examples difference between null and undefined when checking for null or undefined, beware of the differences between equality (==) and identity (===) operators, as the former performs type-conversion. typeof null // "object" (not "null" for legacy...
...ype-conversion. typeof null // "object" (not "null" for legacy reasons) typeof undefined // "undefined" null === undefined // false null == undefined // true null === null // true null == null // true !null // true isnan(1 + null) // false isnan(1 + undefined) // true specifications specification ecmascript (ecma-262)the def
inition of 'null value' in that specification. ...
parseFloat() - JavaScript
haracter, ignoring the invalid character and characters following it. a second decimal point also stops parsing (characters up to that point will still be parsed). leading and trailing spaces in the argument are ignored. if the argument’s first character can’t be converted to a number (it’s not any of the above characters), parsefloat returns nan. parsefloat can also parse and return inf
inity. parsefloat converts bigint syntax to numbers, losing precision. this happens because the trailing n character is discarded. consider number(value) for stricter parsing, which converts to nan for arguments with invalid characters anywhere. parsefloat will parse non-string objects if they have a tostring or valueof method. the returned value is the same as if parsefloat had been called on the...
... ...
Standard built-in objects - JavaScript
ed by the user script or provided by the host application. the host objects available in browser contexts are documented in the api reference. for more information about the distinction between the dom and core javascript, see javascript technologies overview. standard objects by category value properties these global properties return a simple value. they have no properties or methods. ...
...ipt, see javascript technologies overview. standard objects by category value properties these global properties return a simple value. they have no properties or methods. inf
inity nan undefined globalthis function properties these global functions—functions which are called globally, rather than on an object—directly return their results to the caller. eval() uneval() isf
inite() isnan() parsefloat() parseint() encodeuri() encodeuricomponent() decodeuri() decodeuricomponent() deprecated escape() unescape() fundamental objects these are the fundamental, basic objects upon which all other objects are based. this includes general objects, booleans, functions, and symbols. object function boolean symbol error objects error objects a...
Lexical grammar - JavaScript
var o = { a: 'foo', b: 'bar', c: 42 }; // shorthand notation. new in es2015 var a = 'foo', b = 'bar', c = 42; var o = {a, b, c}; // instead of var o = { a: a, b: b, c: c }; array literals see also array for more information. [1954, 1974, 1990, 2014] string literals a string literal is zero or more unicode code points enclosed in single or double quotes. unico...
... ...
class expression - JavaScript
...
...ithin the scope of the class expression itself. const foo = class namedfoo { constructor() {} whoisthere() { return namedfoo.name; } } const bar = new foo(); bar.whoisthere(); // "namedfoo" namedfoo.name; // referenceerror: namedfoo is not defined foo.name; // "namedfoo" specifications specification ecmascript (ecma-262)the def
inition of 'class def
initions' in that specification. ...
delete operator - JavaScript
me name exists on the object's prototype chain, then, after deletion, the object will use the property from the prototype chain (in other words, delete only has an effect on own properties). any property declared with var cannot be deleted from the global scope or from a function's scope. as such, delete cannot delete any functions in the global scope (whether this is part from a function def
inition 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-conf...
... ...
Expressions and operators - JavaScript
word defines a class expression. function* the function* keyword defines a generator function expression. yield pause and resume a generator function. yield* delegate to another generator function or iterable object. async function the async function defines an async function expression. await pause and resume an async function and wait for the promise's resolution/rejection. [] array
initializer/literal syntax. {} object
initializer/literal syntax. /ab+c/i regular expression literal syntax. ( ) grouping operator. left-hand-side expressions left values are the destination of an assignment. property accessors member operators provide access to a property or method of an object (object.property and object["property"]). new the new operator creates an instance of a con...
... ...
return - JavaScript
code after return statement". starting with firefox 40, a warning is shown in the console if unreachable code is found after a return statement. to avoid this problem (to prevent asi), you could use parentheses: return ( a + b ); examples interrupt a function a function immediately stops at the point where return is called. function counter() { for (var count = 1; ; count++) { // inf
inite loop console.log(count + 'a'); // until 5 if (count === 5) { return; } console.log(count + 'b'); // until 4 } console.log(count + 'c'); // never appears } counter(); // output: // 1a // 1b // 2a // 2b // 3a // 3b // 4a // 4b // 5a returning a function see also the article about closures. function magic() { return function calc(x) { return x * 42; }; ...
... ...
switch - JavaScript
default: console.log('this animal will not.'); } multi-case : chained operations this is an example of a multiple-operation sequential case clause, where, depending on the provided integer, you can receive different output. this shows you that it will traverse in the order that you put the case clauses, and it does not have to be numerically sequential. in javascript, you can even mix in def
initions of strings into these case statements as well. var foo = 1; var output = 'output: '; switch (foo) { case 0: output += 'so '; case 1: output += 'what '; output += 'is '; case 2: output += 'your '; case 3: output += 'name'; case 4: output += '?'; console.log(output); break; case 5: output += '!'; console.log(output); break; default: ...
... ...
Statements and declarations - JavaScript
if the condition is false, another statement can be executed. switch evaluates an expression, matching the expression's value to a case clause, and executes statements associated with that case. throw throws a user-defined exception. try...catch marks a block of statements to try, and specifies a response, should an exception be thrown. declarations var declares a variable, optionally
initializing it to a value. let declares a block scope local variable, optionally
initializing it to a value. const declares a read-only named constant. functions and classes function declares a function with the specified parameters. function* generator functions enable writing iterators more easily. async function declares an async function with the specified parameters. return speci...
...ort used to import functions exported from an external module, another script. import.meta an object exposing context-specific metadata to a javascript module. label provides a statement with an identifier that you can refer to using a break or continue statement. with extends the scope chain for a statement. specifications specification ecmascript (ecma-262)the def
inition of 'ecmascript language: statements and declarations' in that specification. ...
JavaScript reference - JavaScript
this part of the javascript section on mdn serves as a repository of facts about the javascript language. read more about this reference. built-ins javascript standard built-in objects, along with their methods and properties. ...
... this part of the javascript section on mdn serves as a repository of facts about the javascript language. read more about this reference. built-ins javascript standard built-in objects, along with their methods and properties. ...
JavaScript typed arrays - JavaScript
argument. imagedata.data is a uint8clampedarray representing a one-dimensional array containing the data in the rgba order, with integer values between 0 and 255 inclusive. examples using views with buffers first of all, we will need to create a buffer, here with a fixed length of 16-bytes: let buffer = new arraybuffer(16); at this point, we have a chunk of memory whose bytes are all pre-
initialized to 0. there's not a lot we can do with it, though. we can confirm that it is indeed 16 bytes long, and that's about it: if (buffer.bytelength === 16) { console.log("yes, it's 16 bytes."); } else { console.log("oh no, it's the wrong size!"); } before we can really work with this buffer, we need to create a view. let's create a view that treats the data in the buffer as an array of 32...
...rray in order to benefit from the array prototype. this can be done using array.from(), or using the following code where array.from() is unsupported. let typedarray = new uint8array([1, 2, 3, 4]), normalarray = array.prototype.slice.call(typedarray); normalarray.length === 4; normalarray.constructor === array; specifications specification ecmascript (ecma-262)the def
inition of 'typedarray objects' in that specification. ...
JavaScript
es or other host environments. for information about api specifics to web pages, please see web apis and dom. the standard for javascript is ecmascript. as of 2012, all modern browsers fully support ecmascript 5.1. older browsers support at least ecmascript 3. on june 17, 2015, ecma international published the sixth major version of ecmascript, which is officially called ecmascript 2015, and was
initially referred to as ecmascript 6 or es6. since then, ecmascript standards are on yearly release cycles. this documentation refers to the latest draft version, which is currently ecmascript 2020. do not confuse javascript with the java programming language. both "java" and "javascript" are trademarks or registered trademarks of oracle in the u.s. and other countries. however, the two programming ...
...===, loose equality using ==, and the object.is() method. closures a closure is the combination of a function and the lexical environment within which that function was declared. advanced inheritance and the prototype chain explanation of the widely misunderstood and under-estimated prototype-based inheritance. strict mode strict mode defines that you can not use any variable before
initializing it. it is a restricted variant of ecmascript 5, for faster performance and easier debugging. javascript typed arrays javascript typed arrays provide a mechanism for accessing raw binary data. memory management memory life cycle and garbage collection in javascript. concurrency model and event loop javascript has a concurrency model based on an "event loop". reference browse the...
dir - Web app manifests
web app manifest working group drafts ...
...ted or set to auto, the browser will use the unicode bidirectional algorithm to make a best guess about the text's direction. example "dir": "rtl", "lang": "ar", "short_name": "!أنا من التطبيق" specification specification status comment feedback web app manifestthe def
inition of 'dir' in that specification. working draft
initial def
inition. web app manifest working group drafts ...
icons - Web app manifests
web app manifest working group drafts ...
...rt of the image outside the safe zone can safely be ignored and masked away by the user agent. any: the user agent is free to display the icon in any context (this is the default value). specification specification status comment feedback web app manifestthe def
inition of 'icons' in that specification. working draft
initial def
inition. web app manifest working group drafts ...
<mfrac> - MathML
future. use css text-align instead. ...
... <math> <mfrac bevelled="true"> <mfrac> <mi> a </mi> <mi> b </mi> </mfrac> <mfrac> <mi> c </mi> <mi> d </mi> </mfrac> </mfrac> </math> specifications specification status comment mathml 3.0the def
inition of 'mfrac' in that specification. recommendation current specification mathml 2.0the def
inition of 'mfrac' in that specification. recommendation
initial specification ...
<mlabeledtr> - MathML
. ...
...d><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> </mlabeledtr> <mtr> <mtd><mi>c</mi></mtd> <mtd><mi>d</mi></mtd> <mtd><mi>e</mi></mtd> </mtr> </mtable> </math> specifications specification status comment mathml 3.0the def
inition of 'mlabeledtr' in that specification. recommendation current specification mathml 2.0the def
inition of 'mlabeledtr' in that specification. recommendation
initial specification ...
<mo> - MathML
the following values are allowed: normal (default value) ; example bold ; example italic ; example bold-italic ; example double-struck ; example bold-fraktur ; example script ; example bold-script ; example fraktur ; example sans-serif ; example bold-sans-serif ; example sans-serif-italic ; example sans-serif-bold-italic ; example monospace ; example
initial ; مثال tailed ; مثال looped ; مثال stretched ; مثال maxsize if stretchy is true, this attribute specifies the maximum size of the operator. allowed values are: inf
inity an arbitrary length minsize if stretchy is true, this attribute specifies the minimum size of the operator. allowed values are: inf
inity an arbitrary length movablelimits spec...
... examples <math> <mrow> <mn>5</mn> <mo>+</mo> <mn>5</mn> </mrow> <mrow> <mo> [ </mo> <!-- default form value: prefix --> <mrow> <mn> 0 </mn> <mo> ; </mo> <!-- default form value: infix --> <mn> 1 </mn> </mrow> <mo> ) </mo> <!-- default form value: postfix --> </mrow> </math> specifications specification status comment mathml 3.0the def
inition of 'mo' in that specification. recommendation current specification mathml 2.0the def
inition of 'mo' in that specification. recommendation
initial specification ...
<mover> - MathML
tml color names. ...
...ath> <mover accent="true"> <mrow> <mi> x </mi> <mo> + </mo> <mi> y </mi> <mo> + </mo> <mi> z </mi> </mrow> <mo> ⏞ <!--top curly bracket--> </mo> </mover> </math> specifications specification status comment mathml 3.0the def
inition of 'mover' in that specification. recommendation current specification mathml 2.0the def
inition of 'mover' in that specification. recommendation
initial specification ...
<mphantom> - MathML
thbackground the background color. you can use #rgb, #rrggbb and html color names. ...
... rendering in your browser: x + y + z <math> <mrow> <mi> x </mi> <mo> + </mo> <mphantom> <mi> y </mi> <mo> + </mo> </mphantom> <mi> z </mi> </mrow> </math> specifications specification status comment mathml 3.0the def
inition of 'mphantom' in that specification. recommendation current specification mathml 2.0the def
inition of 'mphantom' in that specification. recommendation
initial specification ...
<mrow> - MathML
thcolor the text color. you can use #rgb, #rrggbb and html color names. ...
...> 1 </mn> <mo> + </mo> <mn> 1 </mn> </mrow> <mrow> <mo> ( </mo> <mrow> <mi> x </mi> <mo> , </mo> <mi> y </mi> </mrow> <mo> ) </mo> </mrow> </math> specifications specification status comment mathml 3.0the def
inition of 'mrow' in that specification. recommendation current specification mathml 2.0the def
inition of 'mrow' in that specification. recommendation
initial specification ...
<msubsup> - MathML
pression, as a length value. this attribute is deprecated and will be removed in the future. ...
...rendering: rendering in your browser: ∫ 0 1 <math displaystyle="true"> <msubsup> <mo> ∫<!--integral --> </mo> <mn> 0 </mn> <mn> 1 </mn> </msubsup> </math> specifications specification status comment mathml 3.0the def
inition of 'msubsup' in that specification. recommendation current specification mathml 2.0the def
inition of 'msubsup' in that specification. recommendation
initial specification ...
<mtext> - MathML
ed: normal (default value) ; example bold ; example italic ; example bold-italic ; example double-struck ; example bold-fraktur ; example script ; example bold-script ; example fraktur ; example sans-serif ; example bold-sans-serif ; example sans-serif-italic ; example sans-serif-bold-italic ; example monospace ; example normal (default) ; مثال
initial ; مثال tailed ; مثال looped ; مثال stretched ; مثال examples <math> <mtext> theorem of pythagoras </mtext> <mtext> /* comment here */ </mtext> </math> specifications specification status comment mathml 3.0the def
inition of 'mtext' in that specification. recommendation current specification mathml 2.0the def
init...
...retched ; مثال examples <math> <mtext> theorem of pythagoras </mtext> <mtext> /* comment here */ </mtext> </math> specifications specification status comment mathml 3.0the def
inition of 'mtext' in that specification. recommendation current specification mathml 2.0the def
inition of 'mtext' in that specification. recommendation
initial specification ...
<munder> - MathML
names. ...
...er accentunder="true"> <mrow> <mi> x </mi> <mo> + </mo> <mi> y </mi> <mo> + </mo> <mi> z </mi> </mrow> <mo> ⏟ <!--bottom curly bracket--> </mo> </munder> </math> specifications specification status comment mathml 3.0the def
inition of 'munder' in that specification. recommendation current specification mathml 2.0the def
inition of 'munder' in that specification. recommendation
initial specification ...
<semantics> - MathML
tribute is set to one of the following: "application/mathml-presentation+xml" "mathml-presentation" "svg1.1" "text/html" "image/svg+xml" "application/xml". note that "application/mathml+xml" is not mentioned here as it does not distinguish between content or presentation mathml. attributes the following attributes can be set on <annotation> and <annotation-xml>: def
initionurl the location of the annotation key symbol. encoding the encoding of the semantic information in the annotation (e.g. "mathml-content", "mathml-presentation", "application/openmath+xml", "image/png") cd the content dictionary that contains the annotation key symbol. name the name of the annotation key symbol. src the location of an external source for semantic information. example...
...</cn> </apply> <ci>y</ci> </apply> </annotation-xml> <!-- annotate an image --> <annotation encoding="image/png" src="some/path/formula.png"/> <!-- annotate tex --> <annotation encoding="application/x-tex"> x^{2} + y </annotation> </semantics> </math> specifications specification status comment mathml 3.0the def
inition of 'mixing markup languages for mathematical expressions' in that specification. recommendation current specification mathml 2.0the def
inition of 'combining presentation and content markup ' in that specification. recommendation
initial specification ...
Web audio codec guide - Web media technologies
ws (vista and later) 22 android 20 linux (depends on gstreamer) 26 macos 35 [2] chrome supports aac only in mp4 containers, and only supports aac's main profile. in addition, aac is not available in chromium builds. alac (apple lossless audio codec) the apple lossless audio codec (alac or apple lossless) is a lossless codec developed by apple. after
initially being a closed format, apple opened it up under an apache license. cross-platform and browser support for alac is not very strong, making it a less than ideal choice for general usage. however, if your target is primarily macos and ios users, it may be worth considering, as the operating systems have integrated support for alac. otherwise, flac is likely a better choice, if you must use a l...
...the audio is encoded using pulse code modulation (pcm) with either µ-law or a-law encoding. the primary benefit to µ-law encoding is that the byte 0x00 never appears in the encoded audio, which may be beneficial in certain applications or networking environments. µ-law is primaril...
Image file type and format guide - Web media technologies
or 256 colors, dithering is generally used. it is technically possible to tile multiple image blocks, each with its own color palette, to create truecolor images, but in practice this is rarely done. pixels are opaque, unless a specific color index is designated as transparent, in which case pixels colored that value are entirely transparent. gif supports simple animation, in which following an
initial full-size frame, a series of images reflecting the parts of the image that change with each frame are provided. gif has been extremely popular for decades, due to its simplicity and compatibility. its animation support caused a resurgence in its popularity in the social media era, when animated gifs began to be widely used for short "videos", memes, and other simple animation sequences. anot...
...mmands that create shapes, lines, apply colors, filters, and so forth. svg files are ideal for diagrams, icons, and other images which can be accurately drawn at any size. as such, svg is popular for user interface elements in modern web design. svg files are text files containing source code that, when interpreted, draws the desired image. for instance, this example defines an drawing area with
initial size 100 by 100 units, containing a line drawn diagonally through the box: <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <line x1="0" y1="80" x2="100" y2="20" stroke="black" /> </svg> svg can be used in web content in two ways: you can directly write the <svg> element within the html, containing svg elements to draw the image. you can display an svg image anywhere you ...
Critical rendering path - Web Performance
nd avoid jank. understanding crp web performance includes the server requests and responses, loading, scripting, rendering, layout, and the painting of the pixels to the screen. a request for a web page or app starts with an html request. the server returns the html - response headers and data. the browser then begins parsing the html, converting the received bytes to the dom tree. the browser
initiates requests every time it finds links to external resources, be they stylesheets, scripts, or embedded image references. some requests are blocking, which means the parsing of the rest of the html is halted until the imported asset is handled. the browser continues to parse the html making requests and building the dom, until it gets to the end, at which point it constructs the css object model...
...nor any of its descendants, are in the render tree. layout once the render tree is built, layout becomes possible. layout is dependent on the size of screen. the layout step determines where and how the elements are positioned on the page, determining the width and height of each element, and where they are in relation to each other. what is the width of an element? block level elements, by def
inition, have a default width of 100% of the width of their parent. an element with a width of 50%, will be half of the width of its parent. unless otherwise defined, the body has a width of 100%, meaning it will be 100% of the width of the viewport. this width of the device impacts layout. the viewport meta tag defines the width of the layout viewport, impacting the layout. without it, the browser u...
Performance fundamentals - Web Performance
es webgl). somewhere "in between" html/css and canvas is svg, which offers some benefits of both. html and css greatly increase productivity, sometimes at the expense of framerate or pixel-level control over rendering. text and images reflow automatically, ui elements automatically receive the system theme, and the system provides "built-in" support for some use cases developers may not think of
initially, like different-resolution displays or right-to-left languages. the canvas element offers a pixel buffer directly for developers to draw on. this gives developers pixel-level control over rendering and precise control of framerate, but now the developers need to deal with multiple resolutions and orientations, right-to-left languages, and so forth. developers draw to canvases using either a...
...ell to improving web applications on firefox. application performance this section is intended for developers asking the question: "how can i make my app fast"? startup performance application startup is punctuated by three user-perceived events, generally speaking: the first is the application first paint — the point at which sufficient application resources have been loaded to paint an
initial frame the second is when the application becomes interactive — for example, users are able to tap a button and the application responds the final event is full load — for example when all the user's albums have been listed in a music player the key to fast startup is to keep two things in mind: upp is all that matters, and there's a "critical path" to each user-perceived event above. t...
Recommended Web Performance Timings: How long is too long? - Web Performance
ill lose potential visitors, and those visitors will take a long time to come back if they ever do. in optimizing for performance, do set an ambitious first load goal, such as 5 seconds over the mobile 3g network and 1.5 seconds on an office t1 line, with even more ambitious page load goals for subsequent page loads, leveraging service workers and caching. there are different suggested times for
initially loading the page versus loading additional assets, responding to user interaction, and ensuring smooth animations: idling goal browsers are single threaded (though background threads are supported for web workers). this means that user interaction, painting, and script execution are all on the same thread. if the thread is busy doing complex javascript execution, the main thread will not b...
... seconds feels immediate. the acknowledgment of user interaction should often feel immediate, such as a hover or button press, but that doesn't mean the completed response should be instantaneous. while a slower than 100ms reaction may create a disconnect between the user interaction and the response, a 100 to 200ms transition for a response may help the user notice the response their interaction
initiated, such as a menu opening. if a response takes longer than 100ms to complete, provide some form of feedback to inform the user the interaction has occurred. ...
Graphic design for responsive sites - Progressive web apps (PWAs)
in question start to look pixellated and ugly because they have been zoomed in. high res and low res image copies one option here is to create a hi res and a low res set of images, then use resolution media queries to serve the hi res images only to hi res devices. programmatic images you should also try to use programmatic/vector graphics as much as possible, as they theoretically scale inf
initely so will still look crisp at high resolutions. you could use css3 properties for generating effects like drop shadows, gradients and rounded corners, and you could also consider using svg for other ui elements, instead of raster graphics formats. the downsides here are that css3 properties and svg don't work on old browsers such as ie6-8 (although polyfills are available, and you could build in...
...ider using svg for other ui elements, instead of raster graphics formats. the downsides here are that css3 properties and svg don't work on old browsers such as ie6-8 (although polyfills are available, and you could build in fallbacks), and svg isn't suitable for high detail images, such as photographs. using fonts for icons another technique to consider is using web fonts for icons. text is inf
initely scalable on the web, and you can also use css text properties to style your web font icons, such as text-shadow and color. making your own font file can be a bit fiddly, but there are a number of good icon font services available such as font awesome. interactive images if your images need to feature some level of interactivity, such as links, other clickable areas, or animation, there are ...
The building blocks of responsive design - Progressive web apps (PWAs)
set, was put forward by apple and takes a slightly different approach, instead providing a new srcset attribute for <img> inside which image references are placed along with "hints" that the browser can use to work out which image is most suitable to display given its viewport size, resolution, etc. these are not intended to be mutually exclusive. this all sounds good. but those solutions are def
initely not ready for production yet — both are in a very early stage of standardization, and have no support across browsers. currently we have to rely on various polyfills and other solutions, none of which are perfect for all situations, so you need to decide which one is right for your particular situation. some available solutions are as follows: hisrc a jquery plugin that allows you to cre...
...ing, but has a number of limitations. svg and other vector graphics for some image requirements (not photographs, but icons and user interface elements are a good fit), a good solution is to use vector graphics. because vector images are calculated based on mathematical algorithms rather than containing separate data on every pixel in the image, they tend to be smaller in file size, and are inf
initely scalable when zoomed or viewed on high resolution devices (at least, in theory). some ideas follow, which also help to keep the number of http requests down — another key factor in mobile app performance: you should try to use css3 features to programmatically generate graphical effects where possible, rather than relying on image files. these include rounded corners, gradients, and drop ...
SVG Presentation Attributes - SVG: Scalable Vector Graphics
start|middle|end|inherit; animatable: yes text-decoration sets the appearance of decorative lines on text. value: none|underline|overline|line-through|blink|inherit; animatable: yes text-rendering hints about what tradeoffs to make as the browser renders text. value: auto|optimizespeed|optimizelegibility|geometricprecision|inherit; animatable: yes transform defines a list of transform def
initions that are applied to an element and the element's children. value: <transform-list>; animatable: yes unicode-bidi - value:; animatable: - vector-effect specifies the vector effect to use when drawing an object. value: default|non-scaling-stroke|inherit|<uri>; animatable: yes visibility lets you control the visibility of graphical elements. value: visible|hidden|collapse|inherit; anim...
...ector-effect specifies the vector effect to use when drawing an object. value: default|non-scaling-stroke|inherit|<uri>; animatable: yes visibility lets you control the visibility of graphical elements. value: visible|hidden|collapse|inherit; animatable: yes word-spacing specifies spacing behavior between words. value: <length>|inherit; animatable: yes writing-mode specifies whether the
initial inline-progression-direction for a <text> element shall be left-to-right, right-to-left, or top-to-bottom. value: lr-tb|rl-tb|tb-rl|lr|rl|tb|inherit; animatable: yes ...
amplitude - SVG: Scalable Vector Graphics
e amplitude of the gamma function of a component transfer element when its type attribute is gamma. ...
...efunca>, <fefuncb>, <fefuncg>, and <fefuncr> usage notes value <number> default value 1 animatable yes specifications specification status comment filter effects module level 1the def
inition of 'amplitude' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'amplitude' in that specification. recommendation
initial def
inition ...
attributeType - SVG: Scalable Vector Graphics
tribute and its associated values are defined. four elements are using this attribute: <animate>, <animatecolor>, <animatetransform>, and <set> html, body, svg { height: 100%; } <svg viewbox="0 0 250 250" xmlns="http://www.w3.org/2000/svg"> <rect x="50" y="50" width="100" height="100"> <animate attributetype="xml" attributename="y" from="0" to="50" dur="5s" repeatcount="indef
inite"/> </rect> </svg> usage notes value css | xml | auto default value auto animatable no css this value specifies that the value of attributename is the name of a css property defined as animatable. xml this value specifies that the value of attributename is the name of an xml attribute defined as animatable in the default xml namespace for the...
...specifies that the implementation should match the attributename to an attribute for the target element. user agents first search through the list of css properties for a matching property name, and if none is found, search the default xml namespace for the element. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'attributetype' in that specification. recommendation
initial def
inition ...
baseline-shift - SVG: Scalable Vector Graphics
positive value) or lowers (negative value) the dominant-baseline of the parent text content element by the specified length. a percentage value raises (positive value) or lowers (negative value) the dominant-baseline of the parent text content element by the specified percentage of the line-height. specifications specification status comment css inline layoutthe def
inition of 'alignment-baseline' in that specification. working draft removed the baseline value, as it is a redundant keyword within the vertical-align property. scalable vector graphics (svg) 2the def
inition of 'alignment-baseline' in that specification. candidate recommendation refers to the def
inition in css inline layout and notes that vertical-align should be preferred. ...
...draft removed the baseline value, as it is a redundant keyword within the vertical-align property. scalable vector graphics (svg) 2the def
inition of 'alignment-baseline' in that specification. candidate recommendation refers to the def
inition in css inline layout and notes that vertical-align should be preferred. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'alignment-baseline' in that specification. recommendation
initial def
inition 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchro...
clip-path - SVG: Scalable Vector Graphics
...
... compatibility unknown specifications specification status comment css masking module level 1the def
inition of 'clip-path' in that specification. candidate recommendation extends its application to html elements. the clip-path property replaces the deprecated clip property. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'clip-path' in that specification. recommendation
initial def
inition (applies to svg elements only). ...
color-interpolation-filters - SVG: Scalable Vector Graphics
the color-interpolation-filters attribute specifies the color space for imaging operations performed via filter effects. notes: this property just has an affect on filter operations. therefore, it has no effect on filter primitives like <feoffset>, <feimage>, <fetile> or <feflood>. color-interpolation-filters has a different
initial value than color-interpolation. color-interpolation-filters has an
initial value of linearrgb, whereas color-interpolation has an
initial value of srgb. thus, in the default case, filter effects operations occur in the linearrgb color space, whereas all other color interpolations occur by default in the srgb color space. it has no affect on filter functions, which operate in the srgb color space. note: as a presentation attribute, color-interpolation can be ...
...n't require that color interpolation occur in a particular color space. srgb indicates that color interpolation should occur in the srgb color space. linearrgb indicates that color interpolation should occur in the linearized rgb color space as described in the srgb specification. specifications specification status comment filter effects module level 1the def
inition of 'color-interpolation' in that specification. working draft no significant change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'color-interpolation-filters' in that specification. recommendation
initial def
inition browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to th...
color - SVG: Scalable Vector Graphics
if you'd like to contribut...
...="25" cx="70" cy="70" stroke="currentcolor" fill="none" stroke-width="5" /> </g> </svg> specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'color' in that specification. candidate recommendation removed the restriction to which elements it applies. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'color' in that specification. recommendation
initial def
inition 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androi...
contentStyleType - SVG: Scalable Vector Graphics
upported in user agents. ...
... they might not use the style attribute, instead it could be easily declared which style language is used in the <style>'s type attribute. the use of contentstyletype is therefore deprecated. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'contentscripttype' in that specification. recommendation
initial def
inition ...
fill - SVG: Scalable Vector Graphics
tribute fill can be used as a css property. tspan for <tspan>, fill is a presentation attribute that defines the color of the text. value <paint> default value black animatable yes note: as a presentation attribute fill can be used as a css property. specifications specification status comment svg animations level 2the def
inition of 'transform' in that specification. editor's draft def
inition for animations scalable vector graphics (svg) 2the def
inition of 'fill' in that specification. candidate recommendation def
inition for shapes and texts. adds context-fill and context-stroke. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'fill' in that specification. recom...
...form' in that specification. editor's draft def
inition for animations scalable vector graphics (svg) 2the def
inition of 'fill' in that specification. candidate recommendation def
inition for shapes and texts. adds context-fill and context-stroke. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'fill' in that specification. recommendation
initial def
inition for animations scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'fill' in that specification. recommendation
initial def
inition for shapes and texts 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-dat...
font-family - SVG: Scalable Vector Graphics
neric-family> ]#where <family-name> = <string> | <custom-ident>+<generic-family> = serif | sans-serif | cursive | fantasy | monospace default value depends on user agent animatable yes for a description of the values, please refer to the css font-family property. ...
... yes for a description of the values, please refer to the css font-family property. specifications specification status comment css fonts module level 4the def
inition of 'generic font families' in that specification. working draft adds new generic font families, specifically: system-ui, emoji, math, and fangsong. css fonts module level 3the def
inition of 'font-family' in that specification. candidate recommendation no significant change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'font-family' in that specification. recommendation
initial def
inition browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, pleas...
font-style - SVG: Scalable Vector Graphics
style</text> <text x="150" y="20" font-style="italic">italic font style</text> </svg> usage notes value normal | italic | oblique default value normal animatable yes for a description of the values, please refer to the css font-style property. ...
...lue normal | italic | oblique default value normal animatable yes for a description of the values, please refer to the css font-style property. specifications specification status comment css fonts module level 4the def
inition of 'font-style' in that specification. working draft no change css fonts module level 3the def
inition of 'font-style' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'font-style' in that specification. recommendation
initial def
inition 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 ht...
font-weight - SVG: Scalable Vector Graphics
xt> <text x="100" y="20" font-weight="bold">bold text</text> </svg> usage notes value normal | bold | bolder | lighter | <number> default value normal animatable yes for a description of the values, please refer to the css font-weight property. ...
...e normal animatable yes for a description of the values, please refer to the css font-weight property. specifications specification status comment css fonts module level 4the def
inition of 'font-weight' in that specification. working draft defines font-weight to accept any numbers between 1 and 1000. css fonts module level 3the def
inition of 'font-weight' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'font-weight' in that specification. recommendation
initial def
inition 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 ...
hanging - SVG: Scalable Vector Graphics
t in the font coordinate system. ...
...attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the alignment coordinate for the glyphs. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'hanging' in that specification. recommendation
initial def
inition ...
horiz-origin-x - SVG: Scalable Vector Graphics
e font. ...
... value <number> default value 0 animatable no <number> this value indicates the x-coordinate of the origin of a glyph for horizontally oriented text. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'horiz-origin-x' in that specification. recommendation
initial def
inition ...
horiz-origin-y - SVG: Scalable Vector Graphics
e font. ...
... value <number> default value 0 animatable no <number> this value indicates the x-coordinate of the origin of a glyph for horizontally oriented text. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'horiz-origin-y' in that specification. recommendation
initial def
inition ...
ideographic - SVG: Scalable Vector Graphics
t in the font coordinate system. ...
...ibute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the alignment coordinate for the glyphs. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'ideographic' in that specification. recommendation
initial def
inition ...
lengthAdjust - SVG: Scalable Vector Graphics
only. </text> <text x="0" y="110" textlength="100" lengthadjust="spacingandglyphs"> shrunk using spacing and glyphs. ...
... usage notes value spacing | spacingandglyphs default value spacing animatable yes specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'lengthadjust' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'lengthadjust' in that specification. recommendation
initial def
inition ...
mathematical - SVG: Scalable Vector Graphics
t in the font coordinate system. ...
...bute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the alignment coordinate for the glyphs. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'mathematical' in that specification. recommendation
initial def
inition ...
origin - SVG: Scalable Vector Graphics
the origin attribute specifies the origin of motion for an animation. it has no effect in svg. ...
...lement is using this attribute: <animatemotion> context notes value default default value default animatable no specifications specification status comment svg animations level 2the def
inition of 'origin' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'origin' in that specification. recommendation
initial def
inition (referring to smil animation specification) ...
pointsAtZ - SVG: Scalable Vector Graphics
the pointsatz attribute represents the y location in the coordinate system established by attribute primitiveunits on the <filter> element of the point at which the light source is pointing, assuming that, in the
initial local coordinate system, the positive z-axis comes out towards the person viewing the content and assuming that one unit along the z-axis equals one unit in x and y. only one element is using this attribute: <fespotlight> html, body, svg { height: 100%; } <svg viewbox="0 0 420 200" xmlns="http://www.w3.org/2000/svg"> <filter id="lighting1" x="0" y="0" width="100%" height="100%"> <fediffuselighting in="sourcegraphic"> <fespotlight x="100" y="100" z="50" pointsatz="0" /> </fediffuselighting> </filter> <filter id="lighting2" x="0" y="0" width="100%" ...
...y="0" width="200" height="200" style="filter: url(#lighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting2); transform: translatex(220px);" /> </svg> usage notes default value 0 value <number> animatable yes specifications specification status comment filter effects module level 1the def
inition of 'pointsatz' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'pointsatz' in that specification. recommendation
initial def
inition ...
slope - SVG: Scalable Vector Graphics
the vertical stroke angle of a font. ...
...g this attribute: <font-face> usage notes value <number> default value 0 animatable no <number> this value indicates the vertical stroke angle of the font. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'slope' in that specification. recommendation
initial def
inition ...
stemh - SVG: Scalable Vector Graphics
he units-per-em must also be used. ...
...his attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the horizontal stem width of the font. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'stemh' in that specification. recommendation
initial def
inition ...
stemv - SVG: Scalable Vector Graphics
the units-per-em must also be used. ...
... this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the vertical stem width of the font. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'stemv' in that specification. recommendation
initial def
inition ...
transform-origin - SVG: Scalable Vector Graphics
left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?where <length-percentage> = <length> | <percentage> default value 50%, 50% animatable yes the transform-origin property may be specified using one, two, or three values, where each value represents an offset. offsets that are not explicitly defined are reset to their corresponding
initial values. if two or more values are defined and either no value is a keyword, or the only used keyword is center, then the first value represents the horizontal offset and the second represents the vertical offset. one-value syntax: the value must be a <length>, a <percentage>, or one of the keywords left, center, right, top, and bottom. two-value syntax: one value must be ...
...ft, center, and right. the other value must be a <length>, a <percentage>, or one of the keywords top, center, and bottom. three-value syntax: the first two values are the same as for the two-value syntax. the third value must be a <length>. it always represents the z offset. specifications specification status comment css transforms level 1the def
inition of 'transform-origin' in that specification. working draft scalable vector graphics (svg) 2the def
inition of 'transform-origin' in that specification. candidate recommendation ...
unicode - SVG: Scalable Vector Graphics
ph> reference. ...
... context notes value <string> default value none animatable no <string> this value specifies one or more unicode characters corresponding to a glyph. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'unicode' in that specification. recommendation
initial def
inition ...
v-ideographic - SVG: Scalable Vector Graphics
pecific vert-origin-x attribute. ...
...ute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the alignment coordinate for the glyphs. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'v-ideographic' in that specification. recommendation
initial def
inition ...
v-mathematical - SVG: Scalable Vector Graphics
pecific vert-origin-x attribute. ...
...te: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the alignment coordinate for the glyphs. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'v-mathematical' in that specification. recommendation
initial def
inition ...
version - SVG: Scalable Vector Graphics
ices are currently 1.0 and 1.1. ...
...100 100" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" width="80" height="80"/> </svg> usage notes value <number> default value none animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'version' in that specification. recommendation
initial def
inition ...
vert-adv-y - SVG: Scalable Vector Graphics
ifies the vertical advance for a glyph in vertical orientation. ...
... default value <font>ʼs vert-adv-y value animatable no <number> this value indicates the vertical advance of the glyph in vertical direction specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'vert-adv-y for <glyph> and <missing-glyph>' in that specification. recommendation
initial def
inition for <glyph> and <missing-glyph> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'vert-adv-y for <font>' in that specification. recommendation
initial def
inition for <font> ...
viewTarget - SVG: Scalable Vector Graphics
associated with the view. ...
... <view> usage notes value <xml-name> default value none animatable no <xml-name> this value specifies the name of the object associated with the view. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'viewtarget' in that specification. recommendation
initial def
inition ...
x-height - SVG: Scalable Vector Graphics
e font within the font coordinate system. ...
...ng this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the height of lowercase glyphs. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'x-height' in that specification. recommendation
initial def
inition ...
<altGlyphItem> - SVG: Scalable Vector Graphics
lement. ...
...ne or more <glyphref> elements example attributes global attributes core attributes specific attributes none dom interface this element implements the svgaltglyphitemelement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<altglyphitem>' in that specification. recommendation
initial def
inition ...
<animate> - SVG: Scalable Vector Graphics
the svg <animate> element provides a way to animate an attribute of an element over time. ...
... safer web animation for motion sensitivity · an a list apart article an introduction to the reduced motion media query | css-tricks responsive design for motion | webkit mdn understanding wcag, guideline 2.2 explanations understanding success criterion 2.2.2 | w3c understanding wcag 2.0 specifications specification status comment svg animations level 2the def
inition of '<animate>' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<animate>' in that specification. recommendation
initial def
inition ...
<animateColor> - SVG: Scalable Vector Graphics
tion addition attributes externalresourcesrequired specific attributes by from to dom interface this element implements the svganimatecolorelement interface. ...
...xample svg <svg width="120" height="120" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="60" r="50"> <animatecolor attributename="fill" attributetype="xml" from="black" to="red" dur="6s" repeatcount="indef
inite"/> </circle> </svg> result specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<animatecolor>' in that specification. recommendation
initial def
inition ...
<animateMotion> - SVG: Scalable Vector Graphics
<mpath> element inside the <animatemotion> element instead of the path attribute. html,body,svg { height:100%; margin: 0; padding: 0; display:block; } <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <path fill="none" stroke="lightgrey" d="m20,50 c20,-50 180,150 180,50 c180-50 20,150 20,50 z" /> <circle r="5" fill="red"> <animatemotion dur="10s" repeatcount="indef
inite" path="m20,50 c20,-50 180,150 180,50 c180-50 20,150 20,50 z" /> </circle> </svg> usage context categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements<mpath> attributes keypoints this attribute indicate, in the range [0,1], how far is the object along the path for each keytimes associated values. value type: <number>*...
...ttributes most notably: onbegin, onend, onrepeat global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes this element implements the svganimatemotionelement interface. specifications specification status comment svg animations level 2the def
inition of '<animatemotion>' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<animatemotion>' in that specification. recommendation
initial def
inition ...
<animateTransform> - SVG: Scalable Vector Graphics
ox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <polygon points="60,30 90,90 30,90"> <animatetransform attributename="transform" attributetype="xml" type="rotate" from="0 60 70" to="360 60 70" dur="10s" repeatcount="indef
inite"/> </polygon> </svg> live sample attributes global attributes conditional processing attributes » core attributes » animation event attributes » xlink attributes » animation attribute target attributes » animation timing attributes » animation value attributes » animation addition attributes » externalresourcesrequired specific attributes by from to type dom...
... » animation attribute target attributes » animation timing attributes » animation value attributes » animation addition attributes » externalresourcesrequired specific attributes by from to type dom interface this element implements the svganimatetransformelement interface. specifications specification status comment svg animations level 2the def
inition of '<animatetransform>' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<animatetransform>' in that specification. recommendation
initial def
inition ...
<clipPath> - SVG: Scalable Vector Graphics
0,0,1,90,30 q90,60,50,90 q10,60,10,30 z" /> <!-- only the portion of the red heart inside the clip circle is visible. --> <use clip-path="url(#myclip)" xlink:href="#heart" fill="red" /> </svg> /* with a touch of css for browsers who * * implemented the r geometry property. */ @keyframes openyourheart {from {r: 0} to {r: 60px}} #myclip circle { animation: openyourheart 15s inf
inite; } a clipping path is conceptually equivalent to a custom viewport for the referencing element. thus, it affects the rendering of an element, but not the element's inherent geometry. the bounding box of a clipped element (meaning, an element which references a <clippath> element via a clip-path property, or a child of the referencing element) must remain the same as if it were not clipped. ...
...ashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility usage notes categoriesnonepermitted contentany number of the following elements, in any order:animation elementsdescriptive elementsshape elements<text>, <use> specifications specification status comment css masking module level 1the def
inition of '<clippath>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<clippath>' in that specification. recommendation
initial def
inition ...
<cursor> - SVG: Scalable Vector Graphics
m-independent custom cursor is to create a png image and define a cursor element that references the png image and identifies the exact position within the image which is the pointer position (i.e., the hot spot). the png format is recommended because it supports the ability to define a transparency mask via an alpha channel. if a different image format is used, this format should support the def
inition of a transparency mask (two options: provide an explicit alpha channel or use a particular pixel color to indicate transparency). if the transparency mask can be determined, the mask defines the shape of the cursor; otherwise, the cursor is an opaque rectangle. typically, the other pixel information (e.g., the r, g and b channels) defines the colors for those parts of the cursor which are not ...
...ements, in any order:descriptive elements attributes global attributes conditional processing attributes core attributes xlink attributes externalresourcesrequired specific attributes x y xlink:href dom interface this element implements the svgcursorelement interface. specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<cursor>' in that specification. candidate recommendation replaced xlink:href by href attribute. scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<cursor>' in that specification. recommendation
initial def
inition ...
<feSpecularLighting> - SVG: Scalable Vector Graphics
the alpha channel as a bump map. the resulting image is an rgba image based on the light color. the lighting calculation follows the standard specular component of the phong lighting model. the resulting image depends on the light color, light position and surface geometry of the input bump map. the result of the lighting calculation is added. the filter primitive assumes that the viewer is at inf
inity in the z direction. this filter primitive produces an image which contains the specular reflection part of the lighting calculation. such a map is intended to be combined with a texture using the add term of the arithmetic <fecomposite> method. multiple light sources can be simulated by adding several of these light maps before applying it to the texture image. usage context categoriesfilter ...
...lor="#bbbbbb"> <fepointlight x="50" y="75" z="200"/> </fespecularlighting> <fecomposite in="sourcegraphic" in2="specout" operator="arithmetic" k1="0" k2="1" k3="1" k4="0"/> </filter> <circle cx="110" cy="110" r="100" style="filter:url(#filter)"/> </svg> result specifications specification status comment filter effects module level 1the def
inition of '<fespecularlighting>' in that specification. working draft removed limitation of specularexponent attribute. scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<fespecularlighting>' in that specification. recommendation
initial def
inition ...
<font-face-format> - SVG: Scalable Vector Graphics
t referenced by its parent <font-face-uri>. ...
...lementpermitted contentempty attributes global attributes core attributes specific attributes string dom interface this element implements the svgfontfaceformatelement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<font-face-format>' in that specification. recommendation
initial def
inition ...
<font-face-name> - SVG: Scalable Vector Graphics
installed copy of this font, identified by its name. ...
...oriesnonepermitted contentempty attributes global attributes core attributes » specific attributes name dom interface this element implements the svgfontfacenameelement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<font-face-name>' in that specification. recommendation
initial def
inition ...
<font-face-uri> - SVG: Scalable Vector Graphics
the <font-face-uri> svg element points to a remote def
inition of the current font. usage context categoriesfont elementpermitted contentany number of the following elements, in any order:<font-face-format> attributes global attributes core attributes xlink attributes specific attributes xlink:href dom interface this element implements the svgfontfaceurielement interface. ...
...ermitted contentany number of the following elements, in any order:<font-face-format> attributes global attributes core attributes xlink attributes specific attributes xlink:href dom interface this element implements the svgfontfaceurielement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<font-face-uri>' in that specification. recommendation
initial def
inition ...
<hkern> - SVG: Scalable Vector Graphics
glyphs. this process is known as kerning. ...
...iesfont elementpermitted contentempty attributes global attributes core attributes specific attributes u1 g1 u2 g2 k dom interface this element implements the svghkernelement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<hkern>' in that specification. recommendation
initial def
inition ...
<pattern> - SVG: Scalable Vector Graphics
lue type: <url>; default value: none; animatable: yes patterncontentunits this attribute defines the coordinate system for the contents of the <pattern>. value type: userspaceonuse|objectboundingbox; default value: userspaceonuse; animatable: yes note: this attribute has no effect if a viewbox attribute is specified on the <pattern> element. patterntransform this attribute contains the def
inition of an optional additional transformation from the pattern coordinate system onto the target coordinate system. value type: <transform-list>; default value: none; animatable: yes patternunits this attribute defines the coordinate system for attributes x, y, width , and height. value type: userspaceonuse|objectboundingbox; default value: objectboundingbox; animatable: yes preserveaspectrati...
...any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<pattern>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<pattern>' in that specification. recommendation
initial def
inition ...
<vkern> - SVG: Scalable Vector Graphics
fonts. this process is known as kerning. ...
...iesfont elementpermitted contentempty attributes global attributes core attributes specific attributes u1 g1 u2 g2 k dom interface this element implements the svgvkernelement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<vkern>' in that specification. recommendation
initial def
inition ...
Gradients in SVG - SVG: Scalable Vector Graphics
trokes. there are two types of gradients: linear and radial. you must give the gradient an id attribute; otherwise it can't be referenced by other elements inside the file. gradients are defined in a defs section as opposed to on a shape itself to promote reusability. linear gradient linear gradients change along a straight line. to insert one, you create a <lineargradient> node inside the def
initions section of your svg file. basic example <svg width="120" height="240" version="1.1" xmlns="http://www.w3.org/2000/svg"> <defs> <lineargradient id="gradient1"> <stop class="stop1" offset="0%"/> <stop class="stop2" offset="50%"/> <stop class="stop3" offset="100%"/> </lineargradient> <lineargradient id="gradient2" x1="0" x2="0" y1="0" y2="1"> ...
...k="http://www.w3.org/1999/xlink" xlink:href="#gradient1"/> i've included the xlink namespace here directly on the node, although usually you would define it at the top of your document. more on that when we talk about images. radial gradient radial gradients are similar to linear ones but draw a gradient that radiates out from a point. to create one you add a <radialgradient> element to the def
initions section of your document. basic example <?xml version="1.0" standalone="no"?> <svg width="120" height="240" version="1.1" xmlns="http://www.w3.org/2000/svg"> <defs> <radialgradient id="radialgradient1"> <stop offset="0%" stop-color="red"/> <stop offset="100%" stop-color="blue"/> </radialgradient> <radialgradient id="radialgradient2" cx="0.25" cy="0.25" r=...
Paths - SVG: Scalable Vector Graphics
e different commands that can be used to create smooth curves. two of those curves are bézier curves, and the third is an "arc" or part of a circle. you might have already gained practical experience with bézier curves using path tools in inkscape, illustrator or photoshop. for a complete description of the math behind bézier curves, go to a reference like the one on wikipedia. there are an inf
inite number of bézier curves, but only two simple ones are available in <path> elements: a cubic one, called with c, and a quadratic one, called with q. bézier curves the cubic curve, c, is the slightly more complex curve. cubic béziers take in two control points for each point. therefore, to create a cubic bézier, three sets of coordinates need to be specified. c x1 y1, x2 y2, x y (or) c d...
...or ellipses in drawings. for instance, a pie chart would require a different arc for each piece. if transitioning to svg from <canvas>, arcs can be the hardest thing to learn, but are also much more powerful. complete circles and ellipses are the only shapes that svg arcs have trouble drawing. because the start and end points for any path going around a circle are the same point, there are an inf
inite number of circles that could be chosen, and the actual path is undefined. it's possible to approximate them by making the start and end points of the path slightly askew, and then connecting them with another path segment. for example, it's possible to make a circle with an arc for each semi-circle. at that point, it's often easier to use a real <circle> or <ellipse> node instead. this interacti...
SVG fonts - SVG: Scalable Vector Graphics
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 indef
initely 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 declaration (the one from the specification), and explain the details. <font id="font1" horiz-adv-...
...issing-glyph> <glyph unicode="!" horiz-adv-x="300"><!-- outline of exclam. pt. glyph --></glyph> <glyph unicode="@"><!-- outline of @ glyph --></glyph> <!-- more glyphs --> </font> we start with the <font> element. this bears an id attribute, to enable it to be referenced via a uri (see below). the horiz-adv-x attribute determines how wide a character is on average compared to the path def
initions of the single glyphs. the value 1000 sets a reasonable value to work with. there are several accompanying attributes that help further define the basic glyph-box layout. the <font-face> element is the svg equivalent of the css @font-face declaration. it defines basic properties of the final font such as weight, style, etc. in the example above the first and most important to be defined is fo...
Same-origin policy - Web security
you may see this referenced as the "scheme/host/port tuple", or just "tuple". ...
... urlutils.href write-only. some browsers allow access to more properties than the above. cross-origin data storage access access to data stored in the browser such as web storage and indexeddb are separated by origin. each origin gets its own separate storage, and javascript in one origin cannot read from or write to the storage belonging to another origin. cookies use a separate def
inition of origins. a page can set a cookie for its own domain or any parent domain, as long as the parent domain is not a public suffix. firefox and chrome use the public suffix list to determine if a domain is a public suffix. internet explorer uses its own internal method to determine if a domain is a public suffix. the browser will make a cookie available to the given domain including any sub-doma...
XML introduction - XML: Extensible Markup Language
ding : used encoding in this document. comments <!-- comment --> "correct" xml (valid and well-formed) Сorrect design rules for an xml document to be correct, the following conditions must be fulfilled: document must be well-formed. document must conform to all xml syntax rules. document must conform to semantic rules, which are usually set in an xml schema or a dtd (document type def
inition). example <?xml version="1.0" encoding="utf-8"?> <message> <warning> hello world <!--missing </warning> --> </message> now let's look at a corrected version of that same document: <?xml version="1.0" encoding="utf-8"?> <message> <warning> hello world </warning> </message> a document that contains an undefined tag is invalid. for example, if we never def...
...for example, to create a new &warning; entity, you can do this: <?xml version="1.0" encoding="utf-8"?> <!doctype body [ <!entity warning "warning: something bad happened... please refresh and try again."> ]> <body> <message> &warning; </message> </body> you can also use numeric character references to specify special characters; for example, © is the "©" symbol. displaying xml ...
XPath snippets - XPath
ml nodes. the first argument is a dom node or document object, while the second is a string defining an xpath expression. example: defining a custom node-specific evaluatexpath() utility function // evaluate an xpath expression aexpression against a given dom node // or document object (anode), returning the results as an array // thanks wanderingstan at morethanwarm dot mail dot com for the //
initial work. function evaluatexpath(anode, aexpr) { var xpe = new xpathevaluator(); var nsresolver = xpe.creatensresolver(anode.ownerdocument == null ? anode.documentelement : anode.ownerdocument.documentelement); var result = xpe.evaluate(aexpr, anode, nsresolver, 0, null); var found = []; var res; while (res = result.iteratenext()) found.push(res); return found; } this funct...
... a dom tree (as described in parsing and serializing xml), the first argument to evaluatexpath() should be req.responsexml. ...
<xsl:decimal-format> - XSLT: Extensible Stylesheet Language Transformations
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:decimal-format> element defines the characters and symbols that are to be used in converting numbers into strings using theformat-number( ) function. ...
...aracter nan=string percent=character per-mille=charater zero-digit=character digit=character pattern-separator=character /> required attributes none. optional attributes name specifies a name for this format. decimal-separator specifies the decimal point character. the default is (.). grouping-separator specifies the thousands separator character. the default is (,). inf
inity specifies the string used to represent inf
inity. the default is the string "inf
inity". minus-sign specifies the minus sign character. the default is the hyphen (-). nan specifies the string used when the value is not a number. the default is the string "nan". percent specifies the percentage sign character. the default is (%). per-mille specifies the per thousand character. ...
Basic Example - XSLT: Extensible Stylesheet Language Transformations
/xsl:copy> </xsl:template> </xsl:stylesheet> the example loads using synchronous xmlhttprequest both the .xsl (xslstylesheet) and the .xml (xmldoc) files into memory. the .xsl file is then imported (xsltprocessor.importstylesheet(xslstylesheet)) and the transformation run (xsltprocessor.transformtofragment(xmldoc, document)). ...
...ldoc) files into memory. the .xsl file is then imported (xsltprocessor.importstylesheet(xslstylesheet)) and the transformation run (xsltprocessor.transformtofragment(xmldoc, document)). this allows fetching of data after the page has been loaded, without
initiating a fresh page load. ...
Compiling an Existing C Module to WebAssembly - WebAssembly
every c project. many projects rely on autoconf/automake to generate system-specific code before compilation. emscripten provides emconfigure and emmake to wrap these commands and inject the appropriate parameters. you can find more in the emscripten documentation. now you only need some html and javascript to load your new module: <script src="./a.out.js"></script> <script> module.onruntime
initialized = async _ => { const api = { version: module.cwrap('version', 'number', []), }; console.log(api.version()); }; </script> and you will see the correct version number in the output: note: libwebp returns the current version a.b.c as a hexadecimal number 0xabc. for example, v0.6.1 is encoded as 0x000601 = 1537. get an image from javascript into wasm getting the enc...
... onto canvas const ctx = canvas.getcontext('2d'); ctx.drawimage(img, 0, 0); return ctx.getimagedata(0, 0, img.width, img.height); } now it's "only" a matter of copying the data from javascript into wasm. for that, you need to expose two additional functions — one that allocates memory for the image inside wasm and one that frees it up again: #include <stdlib.h> // required for malloc def
inition emscripten_keepalive uint8_t* create_buffer(int width, int height) { return malloc(width * height * 4 * sizeof(uint8_t)); } emscripten_keepalive void destroy_buffer(uint8_t* p) { free(p); } the create_buffer() function allocates a buffer for the rgba image — hence 4 bytes per pixel. the pointer returned by malloc() is the address of the first memory cell of that buffer. when the point...
2015 MDN Fellowship Program - Archive of obsolete content
um, code, or likely both; and (2) receive coaching, training and best practices for effectively communicating and educating with technical information. we expect this to be between 5-10 hours of your time per week. specific projects (we encourage you to target one of these in your application): testthewebforward brief project description mozilla participates in an important w3c open testing
initiative, testthewebforward.com. to support our efforts, the fellow will review various technical specifications to identify gaps between the documentation and current situation and refine existing tests to adapt to this cross-browser test harness. activities and deliverables identify gaps between existing documentation and current development environments. the work would entail refining existing ...
Contributor's Guide - Archive of obsolete content
data members are properties that allow each instance to have their own state, whereas member functions are properties that allow instances to have behavior. inheritance allows classes to inherit state and behavior from an existing classes, known as the base class. ...
Guides - Archive of obsolete content
this article highlights the main features of that design. testing the add-on sdk learn how to run the add-on sdk test suites. sdk infrastructure module structure of the sdk the sdk, and add-ons built using it, are of composed from reusable javascript modules. this explains what these modules are, how to load modules, and how the sdk's module tree is structured. sdk api lifecycle def
inition of the lifecycle for the sdk's apis, including the stability ratings for apis. program id the program id is a unique identifier for your add-on. this guide explains how it's created, what it's used for and how to define your own. firefox compatibility working out which firefox releases a given sdk release is compatible with, and dealing with compatibility problems. sdk idioms ...
page-worker - Archive of obsolete content
") 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 un
initialized 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 on the page worker. the boolean key script controls if scripts from the page are allowed to run. script defaults to true...
passwords - Archive of obsolete content
or_joe() { require("sdk/passwords").search({ username: "joe", url: "https://www.google.com", oncomplete: function oncomplete(credentials) { credentials.foreach(function(credential) { console.log(credential.username); console.log(credential.password); }); } }); } to retrieve only credentials associated with your add-on, use the url property,
initialized from self.uri: function show_my_addon_passwords() { require("sdk/passwords").search({ url: require("sdk/self").uri, oncomplete: function oncomplete(credentials) { credentials.foreach(function(credential) { console.log(credential.username); console.log(credential.password); }); } }); } parameters options : object required options: ...
simple-storage - Archive of obsolete content
read about how to opt into private browsing mode and how to use the sdk to avoid storing user data associated with private windows, refer to the documentation for the private-browsing module. globals properties storage a persistent object private to your add-on. properties with array, boolean, number, object, null, and string values will be persisted. quotausage a number in the range [0, inf
inity) that indicates the percentage of quota occupied by storage. a value in the range [0, 1] indicates that the storage is within quota. a value greater than 1 indicates that the storage exceeds quota. events overquota the module emits this event when your add-on's storage goes over its quota. ...
url - Archive of obsolete content
ttps://developer.mozilla.org/add-ons?example=true&visible=yes#top"); console.log(url.path); // /add-ons?example=true&visible=yes#top hostname the domain of the url, as a string. mirrors window.location.hostname. for example: var url = require("sdk/url").url("https://developer.mozilla.org/add-ons?example=true&visible=yes#top"); console.log(url.hostname); // developer.mozilla.org pathname an
initial '/' followed by the path of the url, as a string. compare with path. mirrors window.location.pathname. for example: var url = require("sdk/url").url("https://developer.mozilla.org/add-ons?example=true&visible=yes#top"); console.log(url.pathname); // /add-ons hash a '#' followed by the fragment identifier of the url, as a string. mirrors window.location.hash. for example: var url = require...
content/loader - Archive of obsolete content
provides one of the building blocks for those modules that use content scripts to interact with web content, such as panel and page-mod. usage the module exports a constructor for the loader object, which inherits on(), once(), and removelistener() functions that enable its users to listen to events. loader adds code to
initialize and validate a set of properties for managing content scripts: contenturl contentscript contentscriptfile contentscriptwhen contentscriptoptions allow when certain of these properties are set, the loader emits a propertychange event, enabling its users to take the appropriate action. the loader is used by modules that use content scripts but don't themselves load content, such as page-mod. modules that load their own content, such as panel and page-...
content/symbiont - Archive of obsolete content
't, then a new hidden frame will be created to host the content. this trait is composed from the loader and worker traits. it inherits functions to load and configure content scripts from the loader, and functions to exchange messages between content scripts and the main add-on code from the worker. var { symbiont } = require('sdk/content/content'); var thing = symbiont.resolve({ constructor: '_
init' }).compose({ constructor: function thing(options) { // `getmyframe` returns the host application frame in which // the page is loaded. this._frame = getmyframe(); this._
init(options) } }); see the panel module for a real-world example of usage of this module. globals constructors symbiont(options) creates a content symbiont. parameters options : object optional option...
content/worker - Archive of obsolete content
vent listener is passed a single argument which is an error object. detach this event is emitted when the document associated with this worker is unloaded or the worker's destroy() method is called. ...
core/promise - Archive of obsolete content
braries. for example grouping promises to observe single resolution of all of them is as simple as this: var group = promised(array); var abc = group(aasync, basync, casync).then(function(items) { return items[0] + items[1] + items[2]; }); all the all function is provided to consume an array of promises and return a promise that will be accepted upon the acceptance of all the promises in the
initial array. this can be used to perform an action that requires values from several promises, like getting user information and server status, for example: const { all } = require('sdk/core/promise'); all([getuser, getserverstatus]).then(function (result) { return result[0] + result[1] }); if one of the promises in the array is rejected, the rejection handler handles the first failed promise an...
event/target - Archive of obsolete content
ons 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 emitted. worker.on('message', function (data) { console.log('data received: ' + data) }); parameters type : string the type of ...
lang/type - Archive of obsolete content
/type'); isflat({}); // true isflat(new type()); // false function type () {} parameters value : mixed the variable to check. returns boolean : boolean indicating if value is a direct descendant of object.prototype or null. isempty(value) returns true if value is an object with no properties and false otherwise. let { isempty } = require('sdk/lang/type'); isempty({}); // true isempty({
init: false }); // false parameters value : object the variable to check. returns boolean : boolean indicating if value is an object with no properties. isjson(value) returns true if value is a string, number, boolean, null, array of json-serializable values, or an object whose property values are themselves json-serializable. returns false otherwise. let { isjson } = require('sdk/lang/type');...
ui/frame - Archive of obsolete content
window whose document matches that uri. if you know the target uri, you should use it, as this is more secure: it prevents another window from intercepting messages that were intended for someone else. from frame to add-on to send a message from a frame script to the add-on, use window.parent.postmessage(). this takes two arguments, the message itself and a target origin. ...
ui/id - Archive of obsolete content
experimental create ui component ids. globals functions identify(object) makes and/or gets a unique id for the input. making an id const { identify } = require('sdk/ui/id'); const thingy = class({
initialize: function(details) { let id = identify(this); } }); getting an id const { identify } = require('sdk/ui/id'); const { thingy } = require('./thingy'); let thing = thingy(/* ... */); let thingid = identify(thing); defining id generator const { identify } = require('sdk/ui/id'); const thingy = class(/* ... */); identify.define(thingy, thing => thing.guid); parameters object : object object to create an id for. returns string : returns a uuid by default (or domain specific id based on a provided def
inition). ...
package.json - Archive of obsolete content
and description, have direct analogues in the install manifest format, and entries from package.json are written into the install manifest when the add-on is built using jpm xpi. others, such as lib, permissions, and preferences, represent instructions to the jpm tool itself to generate and include particular code and data structures in your add-on. creating a manifest the package.json file is
initially generated in your add-on's root directory the first time you run jpm
init. it looks like this (assuming the add-on's directory is "my-addon"): { "name": "my-addon", "title": "my-addon", "id": "jid1-1fergv45e4f4f@jetpack", "description": "a basic add-on", "author": "", "license": "mpl-2.0", "version": "0.1" } if you are using the new jpm tool, you can easily access manifest da...
Creating annotations - Archive of obsolete content
ctor page-mod uses jquery to examine and manipulate the dom. its main job is to maintain a matched element: this is the page element that is the current candidate for an annotation. the matched element is highlighted and has a click handler bound to it which sends a message to the main add-on code. the selector page mod can be switched on and off using a message from the main add-on code. ...
Storing annotations - Archive of obsolete content
r 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. first, import the simple-storage module with a declaration like: var simplestorage = require('sdk/simple-storage'); in the module scope,
initialize an array which will contain the stored annotations: if (!simplestorage.storage.annotations) simplestorage.storage.annotations = []; now we'll add a function to the module scope which deals with a new annotation. the annotation is composed of the text the user entered and the "annotation anchor", which consists of the url, element id and element content: function handlenewannotation(ann...
Display a Popup - Archive of obsolete content
in this tutorial we'll create an add-on that adds an action button to the toolbar that displays a panel when clicked. the panel just contains a <textarea> element: when the user presses the return key, the contents of the <textarea> is sent to the main add-on code. the main add-on code logs the message to the console. ...
Logging - Archive of obsolete content
ole object with most of the same methods as the dom console, including methods to log error, warning, or informational messages. you don't have to require() anything to get access to the console. it is automatically made available to you. the console.log() method prints an informational message: console.log("hello world"); try it out: create a new directory, and navigate to it execute jpm
init, accepting all the defaults open "index.js" and add the line above execute jpm run firefox will start, and the following line will appear in the command window you used to execute jpm run: info: hello world! console in content scripts you can use the console in content scripts as well as in your main add-on code. the following add-on logs the html content of every tab the user loads, by c...
Modifying Web Pages Based on URL - Archive of obsolete content
age-mod api var pagemod = require("sdk/page-mod"); // create a page-mod // it will run a script whenever a ".org" url is loaded // the script replaces the page contents with a message pagemod.pagemod({ include: "*.org", contentscript: 'document.body.innerhtml = ' + ' "<h1>page matches ruleset</h1>";' }); do as follows: create a new directory and navigate to it. run jpm
init, accepting all the defaults open the file index.js and add the code above run jpm run open ietf.org in the browser window that opens. below is what you should see. specifying the match pattern match pattern uses match-pattern syntax. you can pass a single match-pattern string, or an array. keeping the content script in a separate file in the example above, we've supplied content script...
Unit Testing - Archive of obsolete content
g and decoding using the btoa() and atob() functions. unfortunately these functions are attached to the window object: since this object is not available in your main add-on code, atob() and btoa() aren't available either. so we'll create a base64 module to expose these functions from the platform (see creating reusable modules). to begin with, create a new directory, navigate to it, and run jpm
init. now create a new file called "base64.js", and give it the following contents: const { atob, btoa } = require("resource://gre/modules/services.jsm"); exports.atob = a => atob(a); exports.btoa = b => btoa(b); this code exports two functions, which just call the platform's btoa() and atob() functions. to show the module in use, edit the "index.js" file as follows: var base64 = require("./base6...
Localization - Archive of obsolete content
then it retrieves and returns the localization appropriate for the count you supplied. placeholders the l10n module supports placeholders, allowing you to insert a string which should not be localized into one which is. the following "en-us" and "fr" ".properties" files includ...
Bootstrapped extensions - Archive of obsolete content
la.dtd"> must add xmlns attribute to html tag for example: <html xmlns="http://www.w3.org/1999/xhtml"> if you have multiple dtd files read on here: using multiple dtds the bare minimum needed is: file: install.rdf file: chrome.manifest file: bootstrap.js folder: locale folder: valid_locale_here file: anything.dtd the chrome.manifest file must include a def
inition for content for example: content name_of_your_addon ./ the chrome.manifest file must also include a line pointing to the locale, just like in the above property section, if you had a folder named en-us in locale, the chrome.manifest file should contain: locale name_of_your_addon en-us locale/ here is an example add-on that opens an html page and a xul page on install: github :: l10n-xhtml-xu...
Bookmarks - Archive of obsolete content
worked set of api for working with history and bookmarks. the documentation for the new api is available at places. the places bookmarks service, provided by the nsinavbookmarksservice interface, provides methods for creating, deleting, and manipulating bookmarks and bookmark folders. this article offers examples for how to perform common bookmark management tasks using the bookmarks service. ...
Running applications - Archive of obsolete content
ure that all your target platforms support this method! this method has the same effect as if you double-clicked the file, so for executable files—it will just run the file without any parameters. for more information on nsifile/nsilocalfile, see file i/o. var file = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile); file.
initwithpath("c:\\myapp.exe"); file.launch(); references nsiprocess nsilocalfile if you need to launch an executable bundled in your xpi, see code snippets:file i/o#getting your extension's folder. launching an executable process from a web page ...
Delayed Execution - Archive of obsolete content
nd setinterval() are unavailable, or insufficient, tasks can be scheduled with delays using nsitimer instances. note: if an nsitimer is garbage collected, it will be deactivated and its callbacks will not fire. a reference to the timer objects must be explicitly kept alive until that point. some example usages include: const timer = components.constructor("@mozilla.org/timer;1", "nsitimer", "
initwithcallback"); function delay(timeout, func) { let timer = new timer(function () { // remove the reference so that it can be reaped. delete delay.timers[idx]; func(); }, timeout, ci.nsitimer.type_one_shot); // store a reference to the timer so that it's not reaped before it fires. let idx = delay.timers.push(timer) - 1; return idx; } delay.timers = [...
Windows - Archive of obsolete content
alse); window.addeventlistener("mousemove", mousemove, false); xul titlebar element xul applications can take advantage of the titlebar element to achieve a similar result without extra javascript code. re-using and focusing named windows while specifying the name parameter to window.open or window.opendialog will prevent multiple windows of that name from opening, each call will actually re-
initialize the window and thus lose whatever state the user has put it in. additionally, if the window is in the background, it may not be brought to the front. this code will check for a window of the provided name. if it finds one, it focuses it. if it doesn't, it opens one. var wenum = components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getservice(components.interf...
Communication between HTML and your extension - Archive of obsolete content
n google but everything that i found was far too complicated for what i wanted to achieve. eventually i put the creation of the custom event into the statechanged function that was handling the receipt of the ajax request. after the html component was update with the result of the ajax request, i created and dispatched the event like this: var event = document.createevent("events"); event.
initevent("my-custom-event", true, true); document.body.dispatchevent(event); in the code of the extension that catches the loading of a new page i added this code: var doc = aevent.originaltarget; // doc is document that triggered "onload" event // do something with the loaded page. // doc.location is a location object (see below for a link). // you can use it to make your code execut...
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
e final note: i've only tried these techniques inside firefox, but they'll probably work more or less unchanged on other gecko-based platforms like thunderbird or seamonkey. if someone can confirm this and/or provide guidelines for what's different, i'll update the article to incorporate this information. bambi meets mozilla none of this is for the faint of heart. in 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, ...
Inline options - Archive of obsolete content
</setting> note in order for the oninputchanged to execute, the setting must have a pref attribute, otherwise the oninputchanged will not trigger. some discussion on the subject at stackoverflow: how to use addeventlistener on inputchanged of inline options display notifications if you want to use the settings ui for anything more than storing preferences, then you will probably need to
initialize them when they first appear. you can't do this until your options xul has been loaded into the add-on manager window, so you should listen for the addon-options-displayed notification to
initialize your settings. for example: var observer = { observe: function(asubject, atopic, adata) { if (atopic == "addon-options-displayed" && adata == "my_addon@my_domain") { var doc = asubje...
Adding sidebars - Archive of obsolete content
ers, but don't rely on them. the xul page for the sidebar can hold any content you want and it's no different from other xul windows or overlays. one minor difference is that the xul sidebar should be defined using the « xul reference « root element instead of window or dialog. the load event is fired every time the sidebar is opened, and unload every time it's closed, so you can use those for
initialization and clean up . another, more important difference to take into account is that users can resize the sidebar to their liking, and in most cases, the sidebar is going to be fairly narrow. you should design the content of your sidebar carefully, so that it is usable and appealing regardless of width. there are ways to limit the size boundaries of your sidebar with css or even disable resi...
Setting Up a Development Environment - Archive of obsolete content
retty much all tools mentioned so far, but it's mostly focused on web development. the chromebug extension helps in making firebug more useful for extension development, but it may still not be powerful enough to replace all 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 def
initely worth a try. leak monitor memory leaks have always been a big criticism drawn against firefox. mozilla has proven with time that they take memory usage seriously, improving performance on several critical areas and removing all kinds of memory leaks. however, extensions are also capable of causing memory leaks. if you want your extension to be included in the mozilla add-ons site, you bette...
The Essentials of an Extension - Archive of obsolete content
uhandler or some other generic name, it's likely going to conflict with an existing object. what we do here is define a single global object: xulschoolchrome. now we know that all of our objects are inside this object, which is unlikely to be duplicated or overwritten by other extensions. you can read more about the typeof operator. if you're unfamiliar with javascript or this particular syntax,
initializing an object as {} is the equivalent of
initializing it to new object(). /** * controls the browser overlay for the hello world extension. */ xulschoolchrome.browseroverlay = { finally, browseroverlay is our object. naming and referencing objects in such a long and verbose manner can feel uncomfortable at first, but it's worth the cost. we use javadoc style comments on all namespa...
Signing an XPI - Archive of obsolete content
ectory (\windows\system32\) so ensure the new paths are first in the path search list. c:\> set path=c:\apps\nss-3.11.4\bin\;c:\apps\nss-3.11.4\lib\;c:\apps\nspr-4.6\lib\;%path% an easier way is to copy everything from your new directories c:\apps\nss-3.11.4\ and c:\apps\nspr-4.6\ including sub directories to the same directory - fx c:\apps\codesigning\ - and then run every command from that.
initialize the certificate database decide which folder to create the certificate database in. use this command to create it (note the trailing dot is required). c:\projects\codesigning\> certutil -n -d . the dot will cause the database to be created in the current directory. you will be prompted for the nss certificate database password - don't forget it! c:\projects\codesigning\> certutil -n -...
Updating addons broken by private browsing changes - Archive of obsolete content
-browsing private-browsing-cancel-vote private-browsing-change-granted private-browsing-transition-complete then your addon will require updating to correctly support the new per-window private browser feature in firefox 20 (and will require updating to work correctly in releases of firefox since the ones listed). idls nsitransferable: see using the clipboard for information about the new
init method. imgicache: this must no longer be obtained as a service. see the imgicache article for more information. moziasyncfavicons/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...
Adding preferences to an extension - Archive of obsolete content
each function in the class. startup() the stockwatcher.startup() function is called when our extension is first loaded. its job is to start up the observer to watch for changes to our preferences, instantiate an object to use to manage our preferences, and install an interval routine to update the stock information periodically. ...
Underscores in class and ID Names - Archive of obsolete content
r 4.x in this regard. recommendation because support is so inconsistent between current browsers as well as older releases, authors are strongly advised to avoid using underscores in class and id names. a common substitute is the hyphen character (-), as in: p.urgent-note {color: maroon;} many authors choose instead to use camel case names such as this: p.urgentnote {color: maroon;} if the
initial-cap approach is used, however, remember that class and id names are also supposed to be case-sensitive. see the tech note "case sensitivity in class and id names" for more details. original document information author(s): eric a. meyer, netscape communications last updated date: published 05 mar 2001 copyright information: copyright © 2001-2003 netscape. all rights reserved. note: thi...
DOMSubtreeModified - Archive of obsolete content
example the following code will display the time of last dom change on the title bar of the page. this event has been deprecated in favor of the mutation observer api this event can cause inf
inite loops if you decide to change the dom inside the event handler, hence it has been disabled in a number of browsers (see domattrmodified and domsubtreemodified events are no longer fired when style attribute is changed via cssom for example). document.body.addeventlistener('domsubtreemodified', function () { document.title = 'dom changed at ' + new date(); }, false); ...
chargingtimechange - Archive of obsolete content
s the event callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method. property type description batterymanager.chargingtime double (float) the remaining time in seconds until the system's battery is fully charged. returns 0 if the battery is fully charged. returns positive inf
inity, if the battery is discharging or if the implementation is unable to report the remaining charging time. read only. example navigator.getbattery().then(function(battery) { console.log("battery charging time: " + battery.chargingtime + " seconds"); battery.addeventlistener('chargingtimechange', function() { console.log("battery charging time: " + battery.chargingtime + " seconds...
dischargingtimechange - Archive of obsolete content
vent callback doesn't receive any event objects, but properties can be read from the batterymanager object received from the navigator.getbattery method. property type description batterymanager.dischargingtime double (float) the remaining time in seconds until the system's battery is completely discharged and the system is about to be suspended. returns positive inf
inity if the battery is charging, if the implementation is unable to report the remaining discharging time, or if there is no battery attached to the system. read only. example navigator.getbattery().then(function(battery) { console.log("battery discharging time: " + battery.dischargingtime + " seconds"); battery.addeventlistener('dischargingtimechange', function() { console.log("bat...
Getting the page URL in NPAPI plugin - Archive of obsolete content
sometimes, you want to restrict an npapi plugin to be loadable only from a certain url or domain or scheme. or whenever you make network requests yourself, you almost always need to enforce same-origin policy. there's unfortunately no trivial way to do that, but you can still do it, by asking the browser for the page url during plugin
initialization. then you can just refuse to do anything, if you don't like the url, or you can compare it with the other url you want to contact. so, how do we get at that page url, i.e. the url of the html which embeds the plugin, i.e. which caused the plugin to load? there are at least 3 solutions (quoting newsgroup posts): via window location from robert platt: // get the dom window object. npn_getvalue( m_pnpinstance, npnvwindownpobject, &swindowobj )...
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
in compliance with * the license. you may obtain a copy of the license at * http://www.mozilla.org/mpl/ * * software distributed under the license is distributed on an "as is" basis, * without warranty of any kind, either express or implied. see the license * for the specific language governing rights and limitations under the * license. * * the original code is netscape code. * * the
initial developer of the original code is * netscape corporation. * portions created by the
initial developer are copyright (c) 2003 * the
initial developer. all rights reserved. * * contributor(s): marcio galli <mgalli@mgalli.com> * * ***** end license block ***** */ //// /// calldevedge represents the inner-browsing function here // function calldevedge(loaddata,ele) { var x = new xmlrem...
List of Former Mozilla-Based Applications - Archive of obsolete content
ed tool (need reference for that) miro (formerly democracy player) video switched from xulrunner to webkit in version 3.0.2 moblin browser browser when moblin became meego it switched from a custom gecko-based browser to chrome nautilus file manager hasn't used mozilla code since version 2.0 raptr client gaming client was a xulrunner app
initially but now uses adobe air rift technologies software installation over internet no longer using mozilla technology -- need confirmation and details second life virtual world desktop client switched from embedded mozilla browser to a plugin architecture with a qtwebkit plugin applications that are no longer being developed name description add...
Creating a Web based tone generator - Archive of obsolete content
ffer of audio samples. <!doctype html> <html> <head> <title>javascript audio write example</title> </head> <body> <input type="text" size="4" id="freq" value="440"><label for="hz">hz</label> <button onclick="start()">play</button> <button onclick="stop()">stop</button> <script type="text/javascript"> function audiodatadestination(samplerate, readfn) { //
initialize the audio output. var audio = new audio(); audio.mozsetup(1, samplerate); var currentwriteposition = 0; var prebuffersize = samplerate / 2; // buffer 500ms var tail = null; // the function called with regular interval to populate // the audio output buffer. setinterval(function() { var written; // check if...
No Proxy For configuration - Archive of obsolete content
abstract this document provides a comprehensive discussion of the manual proxy feature "no proxy for:", including configuration issues, testing and bugs. audience mozilla users, mozilla developers, mozilla testers. overview as browsers rapidly grew in popularity in the mid-90's, many network administrators added proxy servers.
initially, proxy servers were used for access control and performance. many networks had limited access to the public network via proxy servers. because the public network was small in scope and connections were slow, a caching proxy could often improve the overall performance. this feature was originally designed as a "blacklist" of sites or domains that was within the intranet, and should not be accessed via the proxy server. due to various limitations, t...
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
e packaged the control into a cab file and wish for it to be installed automatically. the following <embed> attributes have <param> tag equivalents: <param name="type" ...> is equivalent to typespecifies the mime type of the plug-in. the control uses this value to determine which plug-in it should create to handle the content. <param name="src" ...> is equivalent to srcspecifies an url for the
initial stream of data to feed the plug-in. if you havent't specified a "type" param, the control will attempt to use the mime type of this stream to create the correct plug-in. <param name="pluginspage" ...> is equivalent to pluginspagespecifies a url where the plug-in may be installed from. the default plug-in will redirect you to this page when you do not have the correct plug-in installed. you m...
Bookmark Keywords - Archive of obsolete content
practically every web surfer has bookmarks, of course, and power surfers usually have hundreds stuffed into folders within folders. in addition to being handy pointers to useful resources, bookmarks in mozilla can be used to make the address bar itself a power tool. searches, lookups, package tracking, and even word def
initions can all be retrieved from user-customized bookmarks. the key to this ability, if you'll pardon the pun, is the ability to add a keyword to any mozilla bookmark. under ordinary circumstances, this might be used to reduce typing of a common url: http://www.cnn.com/ could be given the keyword cnn. once that's done, all it takes to go to the cnn home page would be to type <tt>cnn</tt> into the address bar. mozilla will automatically expand the keyword to the corresp...
Creating a Firefox sidebar extension - Archive of obsolete content
the broadcaster serves two purposes. the first is it indirectly provides the arguments for the togglesidebar function. the second is it provides attributes to the menuitem, some of which are changed automatically when togglesidebar is called. see code_snippets/sidebar for more information. if the sidebar is not going to have a command-key, one can remove t...
Adding the structure - Archive of obsolete content
eries of panels, each one defined by a statusbarpanel xul element. each status bar panel displays a different kind of status information. graphical panels (like the one we are creating here that displays an icon) are given the statusbarpanel-iconic class so they can be styled accordingly by the css stylesheet that defines these elements' appearance. the status attribute is not part of the xul def
inition for the statusbarpanel element, but is used by our extension to store the current tinderbox state. we'll update the value of that attribute each time we retrieve tinderbox's status from the server, and we'll define css rules that change the appearance of the icon depending on the value of that attribute. all xul elements can be given custom attributes in addition to the ones the xul rendering ...
Making it into a dynamic overlay and packaging it up for distribution - Archive of obsolete content
for the mozilla codebase."> </rdf:description> <rdf:seq about="urn:mozilla:overlays"> <rdf:li resource="chrome://navigator/content/navigator.xul"/> </rdf:seq> <rdf:seq about="chrome://navigator/content/navigator.xul"> <rdf:li>chrome://tinderstatus/content/tinderstatusoverlay.xul</rdf:li> </rdf:seq> </rdf:rdf> install.js, on the other hand, goes into the tinderstatus-installer directory:
initinstall( "mozilla tinderstatus extension", "/mozdev/tinderstatus", "0.1"); var installdir = getfolder("chrome","tinderstatus"); setpackagefolder(installdir); adddirectory("tinderstatus"); registerchrome( content | delayed_chrome, getfolder(installdir, "content")); var result = performinstall(); if ( result != success ) cancelinstall(result); once all the files are...
Dehydra Frequently Asked Questions - Archive of obsolete content
images of those graphs reminded me of the multiheaded hydra monster. thus de-hydra can be thought of as a decapitating tool for slaying cfgs. currently dehydra does not provide the cfg functionality, this functionality is now provided by treehydra. what is the status of gcc 4.5 support? development version of dehydra should work with gcc 4.5 on any c++ codebase. if you encounter bugs or crashes, report them. where does one report dehydra bugs? use this link to file bugs. for crashes reports attach a minimized input file. ...
Dehydra Function Reference - Archive of obsolete content
ee the dehydra object reference for details on the available object properties. process_type(type) dehydra calls this for each class, struct, enum, union, and typedef declaration. process_type is called after process_function is called for all the member functions. type is a type object representing the type that was declared. process_function(decl, body) dehydra calls this for each function def
inition (declarations without bodies are not included), including both top-level functions, class member functions, and inline class member functions. decl is a variable type object representing the function being processed body is an array of {loc:, statements:array of variable types} representing an outline of the function stripped down to variables, function calls and assignments. process_decl(de...
Dehydra Object Reference - Archive of obsolete content
flag the variable is being declared (local variables only). .assign array of variable objects this variable is the lhs of an assignment. the value is an array of values that were assigned. .isfcall boolean flag the variable is being used as a function call. .arguments array of variable objects arguments used to make a function call. .parameters array of variable objects a function def
inition's parameter names and types .memberof aggregate type object indicates the aggregate type(class/struct) in the type system that this variable is a member of. .fieldof variable object provides the object being dereferenced, in the ast system. applicable when accessing member variables or nonstatic member functions of aggregate types, e.g. the "foo" variable would be a .fieldof membervar/fn...
Download Manager preferences - Archive of obsolete content
. this folder is enabled when browser.download.folderlist equals 2. browser.download.folderlist indicates the default folder to download a file to. 0 indicates the desktop; 1 indicates the systems default downloads location; 2 indicates a custom (see: browser.download.dir) folder. in firefox 3 and earlier, the default is 0 (except on windows vista, where it's toggled to 1 on
initial launch). in firefox 3.5 and seamonkey, the default is 1 on all platforms. for thunderbird, the default is 0. see also nsidownloadmanager nsidownload nsidownloadmanagerui ...
Drag and Drop JavaScript Wrapper - Archive of obsolete content
to each element that can either start a drag action or can accept dropped objects. you can reuse the same observer for multiple elements. for an element that can start a drag, ondragstart is all that is necessary to implement. for an element that can be dropped on, the observer will need to implement at least the getsupportedflavours, ondragover and ondrop functions. some elements may be able to
initiate a drag and accept a drop. in this case, the ondragstart function will be necessary as well. the getsupportedflavours function should return a list of flavours that the element being dragged over can accept for dropping. a file system directory view might accept files and perhaps text, but wouldn't accept html text. below, we'll define a getsupportedflavours function. we'll allow only one flav...
Embedding FAQ - Archive of obsolete content
how to customize document retrieval one method is to implement your own protocol method. you can find more information on adding new protocols here how to embedding mozilla inside of java there hasn't been any good code examples found. ...
Layout System Overview - Archive of obsolete content
ments that are positioned. there is, of course, some complexity involved with managing these two models simultaneously... so far the general flow of layout looks like this: obtain a document's content model utilize the style system to resolve the style of each element in the content model construct the frames that correspond to the content model, according to the resolved style data. perform the
initial layout, or
initial reflow, on the newly constructed frame. this is pretty straight-forward, but is complicated somewhat by the notion of incrementalism. one of the goals of the layout system's design is to create parts of the presentation as they become available, rather than waiting for the entire document to be read, parsed, and then presented. this is a major benefit for large documents be...
Firefox Sync - Archive of obsolete content
sync client. mozilla server instance an instance of the server deployed and maintained by mozilla. if you use sync in your browser, this is what it talks to by default. specifications there are numerous specifications concerning sync. these include: an http api for client-server interaction storage formats used by the the clients cryptographic model for encrypting client data the def
initive source for these specifications is http://docs.services.mozilla.com/. running a server it is possible to run your own sync server instance. full instructions are available at http://docs.services.mozilla.com/howtos/run-sync.html. getting involved and status for information on the current development status of sync including how to get involved, see https://wiki.mozilla.org/services/sync. relat...
GRE - Archive of obsolete content
this library provides a layer of indirection between embedding code and xpcom. to use the xpcom glue, you must follow these steps: compile your code with xpcom_glue defined. link with xpcomglue.lib (not xpcomglue_s.lib!). don't link against the nspr libs. find a compatible gre (see above). dynamically link to that gre using the xpcomgluestartup() function. see environment variables below.
initialize xpcom and do your work; when finished, shut down xpcom. unlink xpcom with xpcomglueshutdown(). dependent libraries and environment variables the xulrunner gre is designed so that the embedder does not need to set any environment variables such as path or ld_library_path before calling xpcomgluestartup(), because it dynamically loads the correct dependent libraries. unfortunately, the mo...
Introducing the Audio API extension - Archive of obsolete content
al of (currentsampleoffset + 2 * 44100 / 2). it's also possible to auto-detect the minimal duration of the pre-buffer, such that the sound is played without interruptions, and lag between writing and playback is minimal. to do this start writing the data in small portions and wait for the value returned by mozcurrentsampleoffset() to be greater than 0. var prebuffersize = samplerate * 0.020; //
initial buffer is 20 ms var autolatency = true, started = new date().valueof(); ... // auto latency detection if (autolatency) { prebuffersize = math.floor(samplerate * (new date().valueof() - started) / 1000); if (audio.mozcurrentsampleoffset()) { // play position moved? autolatency = false; } processing an audio stream since the mozaudioavailable event and the mozwriteaudio() method both ...
Simple Storage - Archive of obsolete content
l. we'll limit the number of notes to 20. old notes // will be forgotten. :( jetpack.menu.context.page.beforeshow = function (menu) { menu.reset(); if (jetpack.selection.text) menu.add({ label: "note", command: function () { notes.unshift(jetpack.selection.text); if (notes.length > 20) notes.pop(); updatejetpackmenu(); } }); }; //
initialize the jetpack menu with the current notes. updatejetpackmenu(); see also settings jep 11 ...
Modularization techniques - Archive of obsolete content
f dynamically finding, loading and binding interfaces, all classes and interfaces are assigned unique ids. the ids are unique 128 bit numbers that are based on uuids. for those who like gory details, their structure is this: struct nsid { pruint32 m0; pruint16 m1, m2; pruint8 m3[8]; }; frequently you see them represented as strings, like this: {221ffe10-ae3c-11d1-b66c-00805f8a2676} to
initialize an id struct you declare them like this: id = {0x221ffe10, 0xae3c, 0x11d1, {0xb6, 0x6c, 0x00, 0x80, 0x5f, 0x8a, 0x26, 0x76}}; why the b66c couplet gets broken up and grouped with the last set of bytes 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...
How to Write and Land Nanojit Patches - Archive of obsolete content
ly commit changes) tinderbox: http://tinderbox.mozilla.org/showbuilds.cgi?tree=nanojit commit log: http://hg.mozilla.org/projects/nanojit-central/shortlog/ irc channel: irc.mozilla.org #nanojit procedure the first thing to understand is that there are now three copies of nanojit in public mozilla.com repositories: one in nanojit-central, one in tracemonkey, one in tamarin-redux. we land patches
initially in nanojit-central, and those landings are followed up with semi-automated landings on tracemonkey and tamarin-redux. these follow-up landings on tracemonkey and tamarin-redux will overwrite any changes made to nanojit in tracemonkey and tamarin-redux! so, do not land nanojit changes directly to the tracemonkey and tamarin-redux repositories! the following files in tracemonkey are from nan...
Plug-n-Hack Phase1 - Archive of obsolete content
event with the type configuresectool and a properties object which specifies the url of the tool manifest. for example: var manifest = {"detail":{"url":"http://localhost:8080/manifest"}}; var evt = new customevent('configuresectool', manifest); it is suggested that browsers wishing to support pnh restrict handling of customevents such that they’re ignored where the event happens outside of user
initiated actions. the configuration document should then listen for a number of other events: configuresectoolstarted - this notifies the document that the browser is processing the configuration; if this event is not received within a reasonable amount of time after the configuresectool event has been fired, you might want to warn the user that pnh does not seem to be supported by this brows...
Standalone XPCOM - Archive of obsolete content
o (unix) is the sample component implementation that the sample application will try to instantiate. this should have been installed in your bin/components directory to run the test, cd to your bin/ directory setenv ld_library_path . ./nstestsample warning: mozilla_five_home not set. nsnativecomponentloader: autoregistering begins. nsnativecomponentloader: autoregistering succeeded
inital print:
initial value set value to: xpcom defies gravity final print : xpcom defies gravity test passed. test failed: what went wrong? the most common case of why the sample would have failed if you didn't run it from the bin directory. here are some error messsages and possible ways of fixing them. ./nstestsample: error in loading shared libraries: libxpcom.so: cannot open shared ob...
Static Analysis for Windows Code under Linux - Archive of obsolete content
ehydra requires patching gcc such that it can load plugins as shared libraries: # prepare a directory mkdir $home/dehydra cd $home/dehydra #obtain gcc 4.3 sources wget ftp://mirrors.kernel.org/gnu/gcc/gcc...-4.3.0.tar.bz2 tar jxvf gcc-4.3.0.tar.bz2 # get the patches which enable plugins cd gcc-4.3.0/ # create an hg repository. this makes it easy to apply patches, they can be applied manually hg
init . hg clone http://hg.mozilla.org/users/tglek_mo...-moz-plugin-mq .hg/patches # apply gty.diff and plugin.diff # if you have mq setup, do hg qpush -a (for file in `cat .hg/patches/series`; do cat .hg/patches/$file; done) |patch -p1 cd .. now, the gcc source with plugin supports is ready, we should now build a cross compiler from this source. and the instructions are exactly the same with the one...
Table Layout Strategy - Archive of obsolete content
(chapter 11) and css2.1 (chapter 17).in css2 a distinction between fixed and auto layout of tables has been introduced. the auto-layout mechanism is implemented in basictablelayoutstrategy.cpp the fixed-layout in fixedtablelayoutstrategy.cpp. all these files are in the layout/html/table/src subdirectory. the code the layout strategies are invoked from nstableframe::reflow. the overload of the
initialize and balancecolumnwidths routines depends on the table style and is decided at runtime. on the first reflow nstableframe::balancecolumnwidths is called. inside this routine the corresponding table layout strategy is created and
initialized (basictablelayoutstrategy::
initialize). later the column widths are balanced by basictablelayoutstrategy::balancecolumnwidths or the fixed layout counter ...
Abc Assembler Tests - Archive of obsolete content
th * the license. you may obtain a copy of the license at * http://www.mozilla.org/mpl/ * * software distributed under the license is distributed on an "as is" basis, * without warranty of any kind, either express or implied. see the license * for the specific language governing rights and limitations under the * license. * * the original code is [open source virtual machine.]. * * the
initial developer of the original code is * adobe system incorporated. * portions created by the
initial developer are copyright (c) 2009 * the
initial developer. all rights reserved. * * contributor(s): * adobe as3 team * * alternatively, the contents of this file may be used under the terms of * either the gnu general public license version 2 or later (the "gpl"), or * the gnu lesser gen...
Tamarin Acceptance Test Template - Archive of obsolete content
th * the license. you may obtain a copy of the license at * http://www.mozilla.org/mpl/ * * software distributed under the license is distributed on an "as is" basis, * without warranty of any kind, either express or implied. see the license * for the specific language governing rights and limitations under the * license. * * the original code is [open source virtual machine.]. * * the
initial developer of the original code is * adobe system incorporated. * portions created by the
initial developer are copyright (c) 2005-2010 * the
initial developer. all rights reserved. * * contributor(s): * adobe as3 team * * alternatively, the contents of this file may be used under the terms of * either the gnu general public license version 2 or later (the "gpl"), or * the gnu lesse...
The life of an HTML HTTP request - Archive of obsolete content
to the rules specified in the user agent stylesheet (ua.css) and the document specific style sheets. each content node corresponds to one or more nsiframe, except content with displaytype "none". if there are several frames created from a content node, then the first of these are called the "primary" node, and the following frames can be found by using the getnextinflow() method of nsiframe. the
initial reflow is done by the nshtmlcontentsink::startlayout(), startlayout() calls presshell::
initialreflow(). startlayout is called quite early in the parsing process, for html it's called in nshtmlcontentsink::openbody() (among other places). todo: how are nsiframes reflowed after a change when they already exist? (8) each nsiframe knows how how to draw itself on the screen. when the presshell [n...
Tuning Pageload - Archive of obsolete content
t explains which preferences to tweak to affect your pageload time. you use the url about:config or the file prefs.js in your profile to change these. to best understand what the following preferences affect, there are a few things you should know. the data flows in gecko as follows: network -> necko -> parser -> content sink -> content model -> rendering model -> layout -> painting. nglayout.
initialpaint.delay this is a preference that specifies a delay, in milliseconds, after the data from the server has started coming in. during this delay, the page that's coming in is not painted, unless it ends up fully loaded before the delay expires. the idea here is twofold.this reduces ugly visual jitter as the new page comes in by not starting painting till after we have a bunch of the data.thi...
URIs and URLs - Archive of obsolete content
ko just by implementing nsiprotocolhandler and nsichannel. it also might be necessary to implement a new urlparser for a new protocol but that might not be necessary because necko already provides uri implementations that can deal with a number of schemes, by implementing the generic urlparser defined in rfc 2396. nsiuri and nsiurl in a strict sense necko does only know urls, uris by the above def
inition are much too generic to be properly represented inside a library. there are however two interfaces which loosely relate to the distinction between uri and url as per the above def
inition: nsiuri and nsiurl. nsiuri represents access to a very simple, very generic form of an url. simply speaking it's scheme and non-scheme, separated by a colon, like "about". nsiurl inherits from nsiuri and repre...
Using gdb on wimpy computers - Archive of obsolete content
ting program: /home/blizzard/src/mozilla/mozilla/dist/bin/./mozilla-bin breakpoint 1, main (argc=1, argv=0xbffff894) at nsapprunner.cpp:811 811 installunixsignalhandlers(argv[0]); (gdb) set auto-solib-add 0 (gdb) c continuing. nsnativecomponentloader: autoregistering begins. [...] it's easy to define a function for gdb to do this for you automatically. you can add this function to the .gdb
init file in your home directory: def prun tbreak main run set auto-solib-add 0 end how do i load shared libraries? if you have turned off automatic shared library loading, you will have to load them when you need them. gdb has a command to load libraries while the program is running. this is the sharedlibrary command. it can be shortened to shar when used in gdb. the argument...
Venkman Internals - Archive of obsolete content
you can still set breakpoints, but they will be future breakpoints, which will be "real" breakpoints when/if the file is loaded (note that this may never happen!). note also that this is just my knowledge of venkman, which is quite limited. you would be better off asking silver (james ross). gijskruitbosch 05:41, 7 march 2007 (pst) venkman-debugger.js sets hooks in to the jsdidebuggerservice.
initdebugger(). scriptmanager in
initdebugger() the previous loaded scripts are passed to an onscriptcreated() method which binds them to a scriptmanager. there is one scriptmanager per url (web page). this method is set into jsdiscripthook.onscriptcreated venkman-views.js views are the panels shown within the venkman window. for example, the "open windows" view shows the browser's windows. ve...
Venkman Introduction - Archive of obsolete content
ive session view. for more information about the latest improvements and versions, see the venkman development page. there are two ways to start the debugger: from firefox, you can start it by selecting javascript debugger from the tools menu (tools->web development menu in mozilla 1.x and netscape). you can also start the browser with the -venkman command line option, which launches venkman
initially instead of an application front end. (note that venkman displays usage data when it starts up: "recorded local startup x, global yyy." this data comes from a counter built in to the application. for more information about this counter and the data, see item 2.2 in the venkman faq.) when you first start venkman, the basic views are arranged as in the screenshot above—though you can cus...
DOM Interfaces - Archive of obsolete content
the nsidomdocumentxbl interface the nsidomdocumentxbl interface contains methods for manipulating xbl bindings. the interface is implemented by all dom documents. idl def
inition interface nsidomdocumentxbl { nodelist getanonymousnodes(in element elt); element getanonymouselementbyattribute(in element elt, in domstring attrname, in domstring attrvalue); element getbindingparent(in node node); void loadbindingdocument(in domstring documenturl); }; methods getanonymousnodes the getanonymousnodes method retrieves the anonymous children of the specified element. parameters elt - the element to retrieve anonymous children for. return value nodelist - the return value of getanonymo...
XBL 1.0 Reference - Archive of obsolete content
te the xbl usage rather than to be a practically useful application. for this reason it contains many comments and some blocks could be avoided in a more compact solution yet used here for demonstration purposes. ...
XML in Mozilla - Archive of obsolete content
xul mozilla's xul reference roadmap next big tasks would include support for xpointer xpointer() scheme (bug 32832), xinclude (bug 201754), xml catalogs (bug 98413), xforms (bug 97806; work being done on implementing this as an extension), validating parser (bug 196355) and xml schemas. to fully implement xlink, we need something called a link manager. see some
initial design documents. testing and qa we have a lot of testcases linked to from the browser standards compliance qa page. most of the core xml test documents on the mercurial repository are located in content/xml/tests. we also have a couple online: the books demo and the irs table of contents demo. both of them demonstrate xml, associating stylesheets with xml, displaying xml with css, namespaces ...
Mac stub installer - Archive of obsolete content
how do i add an installer package to the mac installer? adding a package involves a few steps: add a section named for your <component> to the packages-mac manifest that describes which files from dist belong to which ...
Unix stub installer - Archive of obsolete content
engine from the unix stub installer? build your entire mozilla tree (which should build the installer in the src2 directory as well). go to mozilla/xpinstall/packager/unix. on the shell prompt type "perl deliver.pl". now you will find an installer *and* the xpcom.xpi and other debug xpis delivered to mozilla/installer/raw. debug using "gdb mozilla-installer-bin" and set a breakpoint at xpi_
init(). you can step into the xpinstall engine through the xpistub once the xpistub dll is loaded. how do i add an installer package to the unix installer? adding a package involves a few steps: add a section named for your <component> to the packages-unix manifest that describes which files from dist belong to which module. for example, see the xpcom section that lists all the shared libraries...
Install Wizards (aka: Stub Installers) - Archive of obsolete content
more about the three platform-specific versions of the stub installer follow the links below: unix stub installer mac stub installer windows stub installer what do we mean by xpistub? the xpinstall engine is not called directly by the stub installer. the stub installer calls some glue code: xpistub which resides at: < http://lxr.mozilla.org/seamonkey/sou...pinstall/stub/> this "glue" code
initialized xpcom and registers the xpinstall engine and requisite components to prepare for use by the stub installer. the stub installer hands off one-by-one a series of xpis to install. what do we mean by libxpnet? cross-platform functionality for making file transfers across a network is provide by the library libxpnet. complete details about this library is available at libxpnet: architecture ...
Install script template - Archive of obsolete content
ondary installation var errblock2 = 0; // global variable containing our secondary install location var secondaryfolder; //special error values used by the cycore developers (www.cycore.com) who helped make this install script var exceptionoccurederror = -4711; var winregisnullerror = -4712; var invalidrootkeyerror = -4713; var registrykeynotwritableerror = -4714; //
initinstall block //the installation is
initialized here -- if we fail here, cancel the installation //
initinstall is quite an overloaded method, but i have invoked it here with three strings // which are globally defined err =
initinstall(software_name, plid, version); if (err != 0) { // call
initinstall again in case illegal characters in plid err =
initinstall(software_name, software_name, ...
File.windowsShortcut - Archive of obsolete content
file.windowsshortcut in this example, the windowsshortcut method is used to add a shortcut in the program directory ("program" is a keyword for the directory in which the program itself is installed, for example, c:\program files\netscape\netscape 6\" on windows) to windows software (misc.exe) that is installed in the "windows" directory. ...
Windows Install - Archive of obsolete content
rogram, listlongfilepaths[i]); sshortfilepath = file.windowsgetshortname(flongfilepath); if(sshortfilepath) { fren8dot3ini.writestring("rename", sshortfilepath, flongfilepath); binicreated = true; } } if(binicreated) updatewinreg4ren8dot3() ; } return(0); } // main var srdest; var err; var fprogram; srdest = 449; err =
initinstall(prettyname, regname, "6.0.0.2000110801"); logcomment("
initinstall: " + err); fprogram = getfolder("program"); logcomment("fprogram: " + fprogram); if(verifydiskspace(fprogram, srdest)) { setpackagefolder(fprogram); err = adddirectory("", "6.0.0.2000110801", "bin", // dir name in jar to extract fprogram, // where to put this file // (returned from getfolder) ...
toString - Archive of obsolete content
summary converts an installversion
init object to a string. method of installversion object syntax string version = installversion.tostring (
initobj ); parameters the tostring method has the following parameter:
initobj
initobj is an installversion object whose
init method has been called. returns the major, minor, revision, and build numbers represented as a single string. the
init() function can input the version number as a single string or as a series of parameters representing the version numbers of the installation. to get the version number out of an installversion object in order to compare it with other versions, you can call tostring() and get back the version as a string in the format "maj.min.rev.bld." example var vi = new installversion(); vi.in...
InstallVersion Object - Archive of obsolete content
w packaging scheme with an install.rdf manifest. in particular plugin developers should see how to package a plugin as an extension. installversion you use installversion objects to contain version information for software. overview this object and its methods are used both when triggering a download, to see whether a particular version needs to be installed, and when installing the software. the
init() method associates a particular version with an installversion object, the tostring() method converts versions in various formats to a string, and the compareto() method compares these string and indicates the relationship between the two versions. each of the version parameters is also available as a separate property of the installversion object. ...
cancelInstall - Archive of obsolete content
be returned to the triggering page. for most purposes, it's recommended that one of the standard return codes be used. but a script can, in fact, return any valid integer. for a list of possible values, and any custom errorcode created by install writer, see return codes. example use the following code to abort or to finalize an installation, based on a variable you set earlier in your code:
initinstall("royal airways tripplanner","/royalairways/ tripplanner","1.0.0.0"); ... err = getlasterror(); if (!err) performinstall(); else cancelinstall(err); ...
getLastError - Archive of obsolete content
getlasterror returns the most recent nonzero error code. method of install object syntax int getlasterror (); parameters none. returns the most recent nonzero error code. for a list of possible values, see return codes. description use getlasterror method to obtain the most recent nonzero error code since
initinstall or reseterror were called. this method allows you to defer checking for error codes each time you call addfile or adddirectory until the last addfile or adddirectory call. the getlasterror method does not return errors from methods that return objects, such as getfolder. example the following example calls getlasterror after a series of addfile calls: addfile("npplug", ...); addfile("/ms/shared/ctl3d.dll", ...); addfile("/nethelp/royalplug/royalhelp.html",...); err = get...
getWinProfile - Archive of obsolete content
t for working with a windows .ini file. method of install object syntax winprofile getwinprofile ( object folder, string file); parameters the getwinprofile method has the following parameters: folder an object representing a directory. you create this object by passing a string representing the directory to the getfolder method. file a relative pathname to an
initialization file in the directory specified by the folder parameter, such as "royal/royal.ini". returns a winprofile object. description the getwinprofile method creates an object for manipulating the contents of a windows .ini file. once you have this object, you can call its methods to retrieve strings from the file or to add strings to the file. for information on the returned object, see winpr...
performInstall - Archive of obsolete content
ient version registry. method of install syntax int performinstall(); parameters none. returns an integer error code. for a list of possible values, see return codes. in some situations the method may return other errors. in a few cases you may get a registry error. example use the following code to abort or to finalize an installation, based on a variable you set earlier in your code:
initinstall("royal airways tripplanner", "/royalairways/tripplanner", "1.0.0.0"); ... err = getlasterror(); if (!err) performinstall(); else cancelinstall(err); ...
setPackageFolder - Archive of obsolete content
tfolder or getcomponentfolder method. returns none. description the setpackagefolder method to set the default package folder that is saved with the root node. when the package folder is set, it is used as the default for forms of addfile and other methods that have an optional localdirspec parameter. you should only call this method once, and you should always call it immediately after you call
initinstall. if you call setpackagefolder multiple times, the last folder set is the folder that is saved in the client version registry and used as the default for other installations. ...
Methods - Archive of obsolete content
irectory in which a component is installed. getfolder returns an object representing a directory, for use with the addfile method. getlasterror returns the most recent non-zero error code. getwinprofile constructs an object for working with a windows .ini file. getwinregistry constructs an object for working with the windows registry.
initinstall
initializes installation for the given software and version. loadresources returns an object whose properties are localized strings loaded from the specified property file. logcomment add a comment line to the install log. patch applies a set of differences between two versions. performinstall finalizes the installation of the ...
Install Object - Archive of obsolete content
in installation scripts. in all cases, the install object is implicit--like the window object in regular web page scripts--and needn't be prefixed to the object methods. the following two lines, for example, are equivalent: f = getfolder("program"); f = install.getfolder("program"); an installation script is composed of calls to the install object, and generally takes the following form:
initialize the installation call
initinstall with the name of the installation and the necessary registry and version information. add the files to the installation add files to the installation by calling getfolder to get file objects and passing those object refs to addfile as many times as necessary. perform installation check that the files have been added suc...
Installer Script - Archive of obsolete content
ailable = parseint(spaceavailable / 1024); 9. // do the verification 10. if(spaceavailable < spacerequired) 11. { 12. logcomment("insufficient disk space: " + dirpath); 13. logcomment(" required : " + spacerequired + " k"); 14. logcomment(" available: " + spaceavailable + " k"); 15. return(false); 16. } 17. return(true); 18. } 19. var srdest = 17311; 20. var err =
initinstall("netscape seamonkey", "browser", "6.0.0.2000110807"); 21. logcomment("
initinstall: " + err); 22. var communicatorfolder = getfolder("program"); 23. logcomment("communicatorfolder: " + communicatorfolder); 24. if (verifydiskspace(communicatorfolder, srdest)) 25. { 26. err = adddirectory("program", 27. "6.0.0.2000110807", 28. "bin", ...
XPJS Components Proposal - Archive of obsolete content
t the js code import other .js files where libraries of code might be stored. this is akin to 'static' libraries. accessing other components/services via xpcom/xpconnect is more akin to 'dynamic' libraries. when a xpjs component module is first installed - or at autoregistration time - the xpjsmanager will load the .js file into a fresh js environment, let its top level script run to do whatever
initialization it wants to do, and then it will call the module's nsregisterself function (passing the filespec of the .js file). at this point the module will use the (new) methods on the components object to register itself with the component manager as a factory module for one or more classid or progid. this registration function that the js code calls (e.g. components.registercomponentspec) will ...
decimalplaces - Archive of obsolete content
« xul reference home decimalplaces type: integer the number of decimal places to display. the default is 0, which doesn't show any decimal places. the value inf
inity may be used if you want no limit on the number of decimal places. note that decimal numbers are stored as floats. ...
smoothscroll - Archive of obsolete content
« xul reference home smoothscroll type: boolean true
initially enables smooth scrolling for the corresponding arrowscrollbox, false disables it. currently, smooth scrolling supports horizontal arrowscrollboxes only. ...
Attribute (XUL) - Archive of obsolete content
rtafter 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 next noautofocus noautohide no
initialfocus nomatch norestorefocus object observes onbeforeaccept onbookmarkgroup onchange onclick onclosetab oncommand oncommandupdate ondialogaccept ondialogcancel ondialogclosure ondialogextra1 ondialogextra2 ondialoghelp onerror onerrorcommand onextra1 onextra2 oninput onload onnewtab onpageadvanced onpagehide onpagerewound onpageshow onpaneload onpopuphidden onpop...
XUL Events - Archive of obsolete content
this event is sent to a popup after it has been opened, much like the onload event is sent to a window when it is opened. attribute: onpopupshown syncfrompreference this event is sent when the element is being changed because a preference changed, or when an element is
initialized from a preference. this event will only be sent to elements connected to a preference and in a prefwindow. this is not a real event instead it is just a function call and must use the attribute syntax. the script may return a value to set the element to a specific value rather than the value of the preference. this event is usually used to adjust the preference value so that it is more su...
Index - Archive of obsolete content
ry! 205 negate xul attributes, xul reference no summary! 206 newlines xul attributes, xul reference no summary! 207 next xul attributes, xul reference no summary! 208 noautofocus xul attributes, xul reference no summary! 209 noautohide xul attributes, xul reference no summary! 210 no
initialfocus xul, xul attribute, xul reference no summary! 211 nomatch xul attributes, xul reference no summary! 212 norestorefocus no summary! 213 notification.type xul attributes, xul reference no summary! 214 object xul attributes, xul reference no summary! 215 observes xul attributes, xul ...
MenuItems - Archive of obsolete content
n one of the radios in each group. this becomes the default value for the menu. if you do not set one, none of the items in that group will be checked by default. as with checkbox type menuitems, you can also set the autocheck attribute on a radio menuitem to disable the automatic adjustment of the checked state. this needs to be set on each radio menuitem. disabling a menuitem to have an item
initially disabled, set the disabled attribute to true as in the following example: <menuitem label="undo" accesskey="u" disabled="true"/> when disabled, the item will appear greyed out and the action associated with the item cannot be carried out. the command event will not fire when an item is disabled. to disable a menuitem that doesn't apply, set the disabled property to true. to renable the it...
Menus - Archive of obsolete content
between each window without having to duplicate code. this technique may be used for individual menus or for an entire menu bar. for example, to have a tools menu that is shared between all windows, just create a menu in the overlay, and include it in each window with a single line: <menu id="menu-tools"/> the overlay should have a menu with the same id 'menu-tools' containing the complete def
inition of the menu. if you wish to have slight differences between each window, one possibility is to show or hide menu items in a load event listener. for example, to have an item
initially hidden in a window: function
initmenus() { var item = document.getelementbyid("menu-file-open"); item.hidden = true; } the hidden property is set to true to hide the menu with the id 'menu-fileopen'. this...
OpenClose - Archive of obsolete content
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 un
initialization that would be done during these events, this could be done during an unload event. testing menu open state to check if a menu is open, check the state of the menu's open property. if the open property is set to true, then the menu is open, otherwise the menu is closed. var open = somemenu.open; opening a popup for opening menupopups that use the menu tag, the button tag and the to...
Panels - Archive of obsolete content
in the main window is focused, that element is unfocused, and a blur event is fired at it. although no element within the popup panel is focused by default, the user may focus the first element within the panel by pressing the tab key. if you want to set the focus to an element by default when a panel is opened, adjust the focus within a popupshown event handler. for instance, to have the textbox
initially focused in the example above: <panel id="search-panel" onpopupshown="document.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 fo...
RDF Modifications - Archive of obsolete content
f regenerating the content for a result, the builder just looks for attribute values that involve the ?name variable. those attributes are just recomputed, substituting the new value for ?name instead. this process is repeated for each result that would be affected. when a template involves multiple queries, the same process is used for each query as with one query. as when generating the results
initially, only the highest matching query needs to be applied. the only extra complication to deal with in the multiple query case is when a particular result's member resource already matches a query, yet the new rdf triple would cause an earlier query to match. since the earlier query takes precedence, the builder handles this by removing the old content first and then adding the new content. ...
Sorting Results - Archive of obsolete content
descending, the tree rows will be sorted in the reverse order. for natural sorting, the rows will be sorted according to the natural order. only one column applies a sort at a time. if the tree is sorted by name, and the user clicks on the date column header, the sort will change to the date column. there are two additional attributes used for sorting, which you may set on a column to specify the
initial sort. these attributes are modified when the user changes the sort. the sortdirection attribute may be used to specify the
initial sort direction for a column. only one column should have this attribute set, as a tree may only be sorted by one column at a time. the value should be either 'ascending', 'descending' or 'natural'. this last value is the default if the attribute is not specified. t...
Template Logging - Archive of obsolete content
ging 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 will output details to the error console for each result. the error console can be fo...
Using Recursive Templates - Archive of obsolete content
urces="people.xml" ref="*" querytype="xml"> <template> <query expr="*"/> <action> <vbox uri="?" class="indent"> <label value="?name"/> </vbox> </action> </template> </groupbox> in this simplified example, the xpath expression just gets the list of child elements of the reference node. for the outermost iteration, a vbox is created with a child label. since the
initial reference node is the root of the xml source document, the results are two elements, one for each group element. however, a further step is done to retrieve an additional level of nodes. as each group has children itself, each result (in this case, each group) becomes the reference point for a futher iteration. the same query is executed again but using the groups generated from the previous e...
Code Samples - Archive of obsolete content
r file that your operating system knows how to open. note: on operating systems that use backslash characters, double each backslash character. on operating systems that use forward-slash characters, specify the file in the normal way. const path = "c:\\windows\\charmap.exe" var file = components .classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile) file.
initwithpath(path) file.launch() open a web page if your button is in firefox or seamonkey, use code like this to open a web page. change the first line to specify the page that you want to open: const url = "http://www.mozilla.org/" document .getelementbyid("content") .webnavigation .loaduri(url, 0, null, null, null) if your button is in thunderbird or sunbird, use code like this to open a w...
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
playname, description and author attributes. 2. create a working directory somewhere on your computer. use any name that you like for this directory. 3. in your working directory, create a plain text file named: install.js copy the following content, and paste it into the new file: const title = "custom toolbar button" const name = "custombutton" const version = "1.0" r =
initinstall(title, name, version) || adddirectory(null, "content", getfolder("chrome"), name) || registerchrome(content + delayed_chrome, getfolder("chrome", name), "") if (r) cancelinstall(r) else performinstall(), alert("now restart seamonkey") customize the title, name and (optionally) version def
initions, changing the text between double-quote characters on those three lines. the name must...
Adding Event Handlers to XBL-defined Elements - Archive of obsolete content
eration is similar but does not clear the text afterwards. pasting is the opposite where the value of the textbox is assigned from the value in the clipboard field. if we were creating a real implementation of these clipboard keyboard shortcuts, we would probably use the real clipboard interface and handle the current selection as well. in the next section, we'll see how to extend existing xbl def
initions. « previousnext » ...
Adding Methods to XBL-defined Elements - Archive of obsolete content
the stack has only one child, the children element itself. the length of the anonymous array of the outer box is two, the first element 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 t...
Adding Properties to XBL-defined Elements - Archive of obsolete content
ng id="randomizer"> <implementation> <field name="number"/> </implementation> </binding> a number field has been defined in the binding, which stores the random number. the two extra buttons set and get the value of this field. the syntax is very similar to getting and setting the properties of html elements. in this example, no content has been placed inside either the xul box or its def
inition in xbl, which is perfectly valid. this example isn't quite correct because the field is not assigned a default value. to do this, add the default value as the content of the field tag. for example: <field name="number"> 25 </field> this will assign the value 25 as the default value of the number field. actually, you can instead place a script inside the field tag that evaluates to the defau...
Adding Style Sheets - Archive of obsolete content
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 findfile.css in the same directory as the xul file. (it would normally be put into a separate skin). in this file, we'll add the style declarations, as shown below: #find-text { min-width: 15...
Anonymous Content - Archive of obsolete content
ng is attached to an element. if you place child elements inside the xul, they will override the elements provided by the binding. for example, take this xul fragment, assuming it is bound to the scrollbar xbl earlier: <scrollbar/> <scrollbar> <button label="overridden"/> </scrollbar> the first scroll bar, because it has no content of its own, will have its content generated from a binding def
inition declared in an xbl file. the second scroll bar has its own content so it will use that instead of the xbl content, resulting in something that isn't much of a scroll bar at all. note that the built-in elements such as scroll bars get their xbl from the files in the bindings directory in the toolkit package. this only applies to the elements defined within the content tag. properties, methods a...
Document Object Model - Archive of obsolete content
any other element that has an id. we'll need to get the text in the input field for example. our find files example it doesn't make sense to have the progress bar and the dummy tree data displayed when the find files dialog is first displayed. these were added so that we could see them. let's take them out now and have them displayed when the find button is pressed. first, we need to make them
initially invisible. the hidden attribute is used to control whether an element is visible or not. we'll change the progress meter so that its
initially hidden. also, we'll add an id attribute so that we can refer to it in a script to show and hide it. while we're at it, let's also hide the splitter and results tree as we only need to show them after a search is performed. <tree id="results" hidden=...
Element Positioning - Archive of obsolete content
t size is still calculated the same as for inflexible elements. the following example demonstrates this: example 2 : source view <window orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <hbox> <button label="yes" flex="1"/> <button label="no"/> <button label="i really don't know one way or the other"/> </hbox> </window> the window will
initially appear like in the image earlier. the first two buttons will be sized at a suitable default width and the third button will be larger because it has a longer label. the first button is made flexible and all three elements have been placed inside a box. the width of the box will be set to the
initial total width of all three buttons (around 430 pixels in the image). if you increase the width...
Features of a Window - Archive of obsolete content
ful when specifying a width and height that the window is not too small or too big. you should also consider that a user might be using a different theme or locale. note that you must specify both the width and the height. if you only specify one, the other will be set to 0. to have the window set its size automatically, leave both the width and height out. the width and height only specify the
initial size of the window. the user may still resize the window to another size, assuming that the window is resizable. other window features the flags below can be passed as part of the third argument to the window.open function. your operating system may not support all of them. you can also use any of the pre-existing flags, which you should find in a javascript reference. you may disable a feat...
Grids - Archive of obsolete content
ts, a textbox and a button. you could add additional nested boxes or even another grid inside a single cell. if you resize the window of the last example, you will see that the textboxes resize, but no other elements do. this is because of the flex attributes added to the textboxes and the second column. the first column does not need to be flexible as the labels do not need to change size. the
initial width of a column is determined by the largest element in the column. similarly, the height of a row is determined by the size of the elements in a row. you can use the minwidth and maxwidth and related attributes to further define the size. column based organization you can also place the elements inside the column elements instead of the rows. if you do this, the rows are just declared to ...
Modifying a XUL Interface - Archive of obsolete content
next example, we reverse the state of the checked property whenever the button is pressed. note that while the label and value properties are strings, the checked property is a boolean property which will be set either true or false. note: if you're creating the checkbox dynamically and it's not yet added to the dom, you must use setattribute("checked", "false") instead, because the xbl isn't
initiated yet.) example 6 : source view <button label="change" oncommand="this.nextsibling.checked = !this.nextsibling.checked;"/> <checkbox label="check for messages"/> radio buttons may be selected as well using properties, however since only one in a group may be selected at a time, the others must all be unchecked when one is checked. you don't have to do this manually of course. the radiogroup's...
Modifying the Default Skin - Archive of obsolete content
can be done by creating an entirely new skin. firefox has a theme manager for changing the default skin. (although the underlying code for mozilla calls them skins and the user interface calls them themes, they're both referring to the same thing). a skin is described using css, allowing you to define the colors, borders and images used to draw elements. the file classic.jar contains the skin def
initions. the global directory within this archive contains the main style def
initions for how to display the various xul elements. by changing these files, you can change the look of the xul applications. customize with userchrome.css if you place a file called 'userchrome.css' in a directory called 'chrome' inside your user profile directory, you can override settings without changing the archives...
More Tree Features - Archive of obsolete content
there are two other things you need to do to make sure the hierarchy works properly. first, you need to mark the treeitem element that has children as a container. you do this by adding the container attribute to it as follows: <treeitem container="true" /> this allows the user to click on the row that corresponds to the treeitem to expand and collapse the inner rows. you can have the child rows
initially displayed by adding the open attribute. when the user expands and collapses the parent, the view's toggleopenstate function will be called to toggle the item between open and closed. for a content tree view, this will set the open attribute to reflect the current state. the second change is that you must put the primary attribute on the first column. this causes a small triangle or plus sign...
Open and Save Dialogs - Archive of obsolete content
folder, it can be read from or written to. the file picker interface nsifilepicker is responsible for displaying a dialog in one of the three modes. you can set a number a features of the dialog by using the interface. when the dialog is closed, you can use the interface functions to get the file that was selected. creating a file picker to begin, you need to create a file picker component and
initialize it. var nsifilepicker = components.interfaces.nsifilepicker; var fp = components.classes["@mozilla.org/filepicker;1"].createinstance(nsifilepicker); fp.
init(window, "select a file", nsifilepicker.modeopen); first, a new file picker object is created and stored in the variable 'fp'. the '
init' function is used to
initialize the file picker. this function takes three arguments, the window ...
RDF Datasources - Archive of obsolete content
okmarks rdf:history animals.rdf" ref="nc:bookmarksroot"> this example reads the resources from the bookmarks, history and the animals.rdf file. they are combined into a single composite datasource and can be used as if they were one. the special datasource rdf:null corresponds to nothing. you can use this datasource if you want to dynamically set the datasource using a script, but don't want one
initially or don't know its exact url. custom rdf datasources you can use any of the above internal datasources if you wish. there are several others for mail, address books and searching and so on. however, you might want to use your own rdf datasource stored in an rdf file. the file can be either a local file or a remote file. just put the url of the rdf file in the datasources attribute. using rdf ...
Scroll Bars - Archive of obsolete content
e 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. the example given in the syntax above will create a scroll bar that can range from a value of 0 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 increment. increasing the value of this attribute will cause the scroll bar to move farther with each click. ...
Splitters - Archive of obsolete content
e a vertical box, it will allow resizing vertically. the syntax of a splitter is as follows: <splitter id="identifier" state="open" collapse="before" resizebefore="closest" resizeafter="closest"> the attributes are as follows: id the unique identifier of the splitter. state indicates the state of the splitter. set this to open, the default, to have the split panel
initially open, or set it to collapsed to have one of the panels shrunk down (collapsed) and the other occupying all of the space. collapse this indicates which side of the panel should collapse when the splitter notch (or grippy) is clicked or set into a collapsed state. set this to before for the element before the splitter, or after for the element after the splitter. if you set this to none, ...
XBL Inheritance - Archive of obsolete content
inheritance sometimes you may want to create an xbl widget that is similar to an existing one. for example, let's say you want to create an xbl button with a popup. one way to create this is to duplicate the existing xbl code for buttons. however, it would be better to simply extend the existing button code. any binding can be extended with another. the child binding can add properties, methods and event handlers. the child binding will have all the features it defines in addition to the features from the binding it inherits from (and any that binding inherits from and so on up the tree). ...
XUL Structure - Archive of obsolete content
ply a separate package that applies a skin or locale to your content part, thus providing support for a new theme or language without having to change the original package. other packages there is a special package called toolkit (or global). we saw the global directory earlier for skins. the file toolkit.jar contains the corresponding content part for it. it contains some global dialogs and def
initions. it also defines the default appearance and functionality of the various common xul widgets such as textboxes and buttons. the files located in the global part of a skin package contain the default look for all of the xul interface elements. the toolkit package is used by all xul applications. adding a package mozilla places the packages that are included with the installation in the chrome...
Using multiple DTDs - Archive of obsolete content
but there are situations where you want to use multiple dtds, for example to localize common widgets used in all your xul files, additionally to the ones specific to the file. single dtd to make strings in your xul file localizable, you normally add a dtd declaration at the beginning of the file like this: <!doctype window system "chrome://myextension/locale/mainwindow.dtd"> where "window" is the local name of the document (root) element. ...
XUL FAQ - Archive of obsolete content
if you want to access elements inside <prefpane>, you should put script in the <prefpane> or write script into "onpaneload" of the <prefpane>.) note, that prefwindow only works in chrome xul. ...
XULBrowserWindow - Archive of obsolete content
the xulbrowserwindow object provides methods and properties that let the browser update the user interface of the enclosing xul window. in order to do so it implements the following interfaces: nsisupports nsixulbrowserwindow nsiwebprogresslistener nsiwebprogresslistener2 nsisupportsweakreference note: this page is not complete at this time. see the linked interfaces for the def
inition of the implemented methods. you may also wish to refer to the implementation of xulbrowserwindow in browser/base/content/browser.js. method overview boolean hidechromeforlocation(in string alocation); attributes attribute type description incontentwhitelist string[] an array of url strings for which chrome is automatically hidden. defaults to abo...
The Implementation of the Application Object Model - Archive of obsolete content
ntent node would know how to instantiate a content node of a completely different type is if it had additional information stored for every child content node that it contained. it would have to consult the registry of data sources in order to instantiate each of its children. if all content nodes are of the same type this problem can be solved in a cleaner fashion. a single content node could be
initialized with its uri by its parent node, it could store its uri in a member variable, and it could use that as a basis for resolving the pluggable data source from which it would obtain its information. statement #2 all content nodes that reside in the aom and that implement the content tree interfaces must be the same class of object. so now we're on the right track, but there are still some f...
arrowscrollbox - Archive of obsolete content
nchor tag (an <a> link) will have no effect. the element will, however, still respond to mouse events. to enable the element, leave this attribute out 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. smoothscroll type: boolean true
initially enables smooth scrolling for the corresponding arrowscrollbox, false disables it. currently, smooth scrolling supports horizontal arrowscrollboxes only. 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. properties inher...
preference - Archive of obsolete content
the undo transaction list (gecko 1.9). type getelementvalue(in domelement element); retrieves the value that should be written to preferences based on the current state of the supplied element. this function calls onsynctopreference. boolean iselementeditable(in domelement element) returns true, if the given element is "editable" (see below). void setelementvalue(in domelement element);
initializes the supplied element from the value stored in the preference. this function calls onsyncfrompreference. void updateelements(); update all elements that observe this preference. inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattribu...
scale - Archive of obsolete content
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. min type: integer the minimum value the control's value may take. the default value is 0. type: integer the maximum value that the scale or number box may be set to. the default value is 100 for scales and inf
inity for number boxes. movetoclick type: boolean if true, clicking the slide area of the scale moves the thumb directly to that position. if false, clicking the slide area moves the thumb only one increment in that direction. if not specified, the default value is used, which varies for each platform. pageincrement type: integer the amount by which the value of the curpos or valu...
tabbox - Archive of obsolete content
d. if the shift key is also held down, the previous tab will be displayed. if this attribute is set to false, these keys do not navigate between tabs. properties accessibletype type: integer a value indicating the type of accessibility object for the element. eventnode type: eventtarget indicates the node where keyboard navigation events listener is set up. the
initial value for this property is determined by the value of the eventnode attribute. handlectrlpageupdown type: boolean gets and sets the value of the handlectrlpageupdown attribute. handlectrltab type: boolean gets and sets the value of the handlectrltab attibute. selectedindex type: integer returns the index of the currently selected item. you may select an it...
Components - Archive of obsolete content
e once you understand how xulrunner registers and saves the components. place after a new component has been written it must be placed in the app/components/ directory (not xulrunner/components/). put both .dll/.js file and the .xpt(s) in there. unlike extensions, it must be directly in that directory, not a subdirectory. then you need to make sure that it gets registered. registration most
initial problems with components are due to registration. for new components or interface changes of existing ones to be noticed at all, you need to change the buildid in application.ini to trigger a re-registration of the components. alternatively, you can delete compreg.dat and xpti.dat in the user profile directory - that of your xulrunner app, not that of firefox/mozilla. it's named after your ven...
Dialogs in XULRunner - Archive of obsolete content
xul emulation filepicker, if you want to. the xul filepickers are xpcom components and must be instantiated before using, like this: function dofileopen() { /* see: http://developer.mozilla.org/en/docs/xul_tutorial:open_and_save_dialogs */ var nsifilepicker = components.interfaces.nsifilepicker; var fp = components.classes["@mozilla.org/filepicker;1"].createinstance(nsifilepicker); fp.
init(window, "open file", nsifilepicker.modeopen); fp.appendfilters(nsifilepicker.filtertext | nsifilepicker.filterall); var res = fp.show(); if (res == nsifilepicker.returnok) { var thefile = fp.file; alert(thefile.leafname); // --- do something with the file here --- } } xul does not currently support any other common dialogs. that could change in future releases. firefox and ...
XULRunner tips - Archive of obsolete content
nabling password manager these preferences seem to be the default in firefox, however, they are missing in xulrunner. without these settings password manager will not store login details. pref("signon.remembersignons", true); pref("signon.expiremasterpassword", false); pref("signon.signonfilename", "signons.txt"); you also need to get an instance of the login manager service, which internally
initializes the system: components.classes["@mozilla.org/login-manager;1"].getservice(components.interfaces.nsiloginmanager); using firefox to run xulrunner applications firefox 3 and up contain the xulrunner runtime. it has an -app command-line switch to run a specified xul application instead of starting the browser. on windows: firefox.exe -app path\to\application.ini on linux: firefox...
application/http-index-format specification - Archive of obsolete content
ml. 200 defines the field names for the 201 file index code. a valid 200 line consists of one or more white space separated tokens that describe the name or purpose of the associated column of data. tokens may not contain spaces. any illegal characters must be escaped via the url escaping syntax defined by rfc 1738. note that multiple 200 lines override previous 200 lines. 201 data whose def
inition stems from a prior 200 line. a valid 201 line consists of one or more white space separated tokens that represent data described by a previous 200 line. tokens may be quoted or unquoted. unquoted tokens may not contain white space. quoted tokens are terminated by the next quote but may not contain carrage returns or new lines. any illegal characters must be escaped via the url escaping syntax ...
xbDesignMode.js - Archive of obsolete content
license. you may obtain a copy of the license at * http://www.mozilla.org/mpl/ * * software distributed under the license is distributed on an "as is" basis, * without warranty of any kind, either express or implied. see the license * for the specific language governing rights and limitations under the * license. * * the original code is netscape cross browser design mode code. * * the
initial developer of the original code is * netscape communications corporation. * portions created by the
initial developer are copyright (c) 2003 * the
initial developer. all rights reserved. * * contributor(s): doron rosenberg <doron@netscape.com> (original author) * * * * ***** end license block ***** */ /* xbdesignmode a javascript wrapper for browsers that support designmode ...
Archived Mozilla and build documentation - Archive of obsolete content
de ("cvsblame"). bookmark keywords practically every web surfer has bookmarks, of course, and power surfers usually have hundreds stuffed into folders within folders. in addition to being handy pointers to useful resources, bookmarks in mozilla can be used to make the address bar itself a power tool. searches, lookups, package tracking, and even word def
initions can all be retrieved from user-customized bookmarks. building transformiix standalone calicalendarview an object implementing calicalendarview is generally intended to serve as a way of manipulating a set of dom nodes corresonding to a visual representation of calievent and calitodo objects. because of this close association between...
2006-10-06 - Archive of obsolete content
summary: mozilla.dev.accessibility - oct 6, 2006 announcements legal precedent set for web accessibility us federal court rules that retailers may be sued if its website is inaccsessible. read more... discussions w3c sets road map for web app accessibility the w3c introduced its wai-aria (web accessibility
initiative for accessible rich internet applications) roadmap--a set of guidelines for developers to make accessible web content. this set of documents tackles some of the difficulties that ajax has been causing with regards to accessibility. read more... other links of interest: roadmap for accessible rich internet applications (wai-aria roadmap) roles for accessible rich internet applications (wai-aria roles) states and properties module for accessible rich internet appli...
2006-11-24 - Archive of obsolete content
to discuss the use of it in bug 361026 rich results for searches a proposal for a search tool that gives users a quicker path to specific information they are looking for. trunk builds + winxp update = broken? a user questions if there is something broken in a nightly build since the user keeps getting this error from the trunk: "firefox.exe - application error: the application failed to
initialize properly." removal of false positives in firefox 2 phishing a user inquires how to remove false positives from the firefox phising filters. meetings none this week. authors sara minchella (sara) dave manley (senemanley) back to summary list ...
2006-09-29 - Archive of obsolete content
ml inline elements using wordpress. it was determined that the generated elements from wordpress do not follow the wc3 guidelines in appendix c of xhtml 1.0. although the w3 validation accepted the generated xhtml as valid, a bug identified within the html working group ignored the invalid elements. details can be located at layout confusion refactoring the nshtmlreflowstate(computeblockboxdata,
initconstraints) and nsimageframe::getdesiredsize which uses ns_inrinsicsize, into the following method: /** * compute the size that a frame will occupy. called while * constructing the nshtmlreflowstate to be used to reflow the frame, * in order to fill its mcomputedwidth and mcomputedheight member * variables. * * the |height| member of the return value may be * ns_unconstrain...
NPAPI plugin developer guide - Archive of obsolete content
d receiving streams working with urls getting version and ui information displaying messages on the status line making plug-ins scriptable building plug-ins building, platforms, and compilers building carbonized plug-ins for mac os x type libraries installing plug-ins native installers xpi plug-ins installations plug-in installation and the windows registry
initialization and destruction
initialization instance creation instance destruction shutdown
initialize and shutdown example drawing and event handling the npwindow structure drawing plug-ins printing the plug-in setting the window getting information windowed plug-ins mac os windows unix event handling for windowed plug-ins windowless plug-ins ...
NPEvent - Archive of obsolete content
nds of the instance. if your plug-in wants to set the cursor when the mouse is within the instance, set the cursor and return true. if you don't want a special cursor, return false and the browser will use the standard arrow cursor. xwindows description the npevent object represents an event passed by npp_handleevent() to a windowless plug-in. the npevent structure is defined as xevent, the def
inition of the event type used by the xwindows platform. for information about the xevent structure and xwindows events, see the xwindows documentation. as the xevents sent to the plug-in are synthesized and there is not a native window corresponding to the plug-in rectangle, some of the members of the xevent structures are not set to their normal xserver values. e.g. key events don't have a position.
NPN_CreateObject - Archive of obsolete content
object of. returns the newly-allocated npobject. description if the given npclass provides an allocate function it is used to allocate the storage for the object and the npp argument passed to npn_createobject() is passed along to that function. if no allocate function is provided, malloc() is called to allocate enough memory to hold an npobject. the newly created npobject's reference count is
initialized to 1 before it is returned. ...
NPN_DestroyStream - Archive of obsolete content
plugin api reference « plug-in side plug-in api summary closes and deletes a stream. syntax #include <npapi.h> nperror npn_destroystream(npp instance, npstream* stream, nperror reason); parameters the function has the following parameters: instance pointer to current plug-in instance. stream pointer to current stream,
initiated by either the browser or the plug-in. reason reason the stream was stopped so the application can give the user appropriate feedback. values: npres_done (most common): stream completed normally; all data was sent by the plug-in to the browser. npres_user_break: plug-in is terminating the stream due to a user request. npres_network_err: stream failed due to network probl...
NPN_PluginThreadAsyncCall - Archive of obsolete content
syntax #include <npapi.h> void npn_pluginthreadasynccall(npp plugin, void (*func)(void *), void *userdata); parameters the function has the following parameters: plugin pointer to the current plug-in instance. func pointer to the function to call on the correct thread. ...
NPN_SetValue - Archive of obsolete content
r. to specify a transparent mode, the value parameter should be set to true. nppvjavascriptpushcallerbool sets whether you are pushing or popping the appropriate jscontext off the stack (see the two-way scriptability article on the mozilla plugins project page for more details). nppvpluginkeeplibraryinmemory specifies that the plugin does not want to be unloaded from memory after the page which
initiated it has gone. normally, when the browser navigates away from the page containing the plugin, all plugin instances get an npp_destroy call, and if there are no more instances of the plugin active, the plugin calls its np_shutdown method and the plugin dll gets unloaded from memory. if this is not desired, the plugin can instruct the browser not to unload the dll and not to call np_shutdown whe...
NPP - Archive of obsolete content
ide plug-in api summary represents a single instance of a plug-in. you specify one of these to any npapi function that needs to know which plug-in to work with. syntax typedef struct _npp { void* pdata; /* plug-in private data */ void* ndata; /* mozilla private data */ } npp_t; typedef npp_t* npp; fields the data structure has the following fields: pdata a value, whose def
inition is up to the plug-in, that the plug-in can use to store a pointer to an internal data structure associated with the instance; this field isn't modified by the browser. ndata a private value, owned by the browser, which is used to store data associated with the instance; this value should not be modified by the plug-in. description gecko creates an npp structure for each plug-in ...
NPP_Destroy - Archive of obsolete content
ug-in instance is deleted, typically because the user has left the page containing the instance, closed the window, or quit the browser. you should delete any private instance-specific information stored in the plug-in's instance->pdata at this time. if this function is deleting the last instance of a plug-in, np_shutdown is subsequently called. use np_shutdown to delete any data allocated in np_
initialize and intended to be shared by all instances of a plug-in. use the optional save parameter if you want to save and reuse some state or other information. upon the user's return to the page, this information is passed to the new plug-in instance when it is created with npp_new. avoid trying to save critical data with this function. ownership of the buf field of the npsaveddata structure pass...
NPP_DestroyStream - Archive of obsolete content
on has the following parameters: instance pointer to current plug-in instance. stream pointer to current stream. reason reason the stream was destroyed. values: npres_done (most common): completed normally; all data was sent to the instance. npres_user_break: user canceled stream directly by clicking the stop button or indirectly by some action such as deleting the instance or
initiating higher-priority network operations. npres_network_err: stream failed due to problems with network, disk i/o, lack of memory, or other problems. returns if successful, the plug-in should return nperr_no_error. if unsuccessful, the plug-in should return an error code. for possible values, see error codes. description the browser calls the npp_destroystream function when a data ...
NPP_New - Archive of obsolete content
asses ownership of the npsaveddata object back to the plug-in. the plug-in is responsible for freeing the memory for the npsaveddata and the buffer it contains. returns if successful, the function returns nperr_no_error. if unsuccessful, the function returns an error code. for possible values, see error codes. description npp_new creates a new instance of a plug-in. it is called after np_
initialize and is passed the mime type, embedded or full-screen display mode, and, for embedded plug-ins, information about html embed arguments. a new instance pointer (npp instance) is created by the plug-in, which is valid until the instance is destroyed with npp_destroy. if instance data was saved from a previous instance of the plug-in by the npp_destroy function, it is returned in the saved pa...
NPP_NewStream - Archive of obsolete content
m data to a file in the local cache. np_asfile: file download. like np_asfileonly except that data is delivered to the plug-in as it is saved to the file (as in mode np_normal). np_seek: stream data randomly accessible by the plug-in as needed, through calls to npn_requestread. implementation note: some plugins, notably silverlight, do not set this outparam, and rely on the outparam being
initialized to a default np_normal value. returns if successful, the function should return nperr_no_error. if unsuccessful, the function should return one of the nperror error codes. this will cause the browser to destroy the stream without calling npp_destroystream. description npp_newstream notifies the plug-in when a new stream is created. the npstream* pointer is valid until the strea...
NPP_URLNotify - Archive of obsolete content
eters: instance pointer to the current plug-in instance. url url of the npn_geturlnotify() or npn_posturlnotify() request that has completed. reason reason code for completion of request. values: npres_done (most common): completed normally. npres_user_break: user canceled stream directly by clicking the stop button or indirectly by some action such as deleting the instance or
initiating higher-priority network operations. npres_network_err: stream failed due to problems with network, disk i/o, lack of memory, or other problems. notifydata plug-in-private value for associating a previous npn_geturlnotify() or npn_posturlnotify() request with a subsequent npp_urlnotify() call. description the browser calls npp_urlnotify() after the completion of a npn_geturlnot...
NPRegion - Archive of obsolete content
lug-in api summary represents a platform-defined region of a page. syntax windows: typedef hrgn npregion; mac os x: typedef rgnhandle npregion; note: this may need to be updated for the cocoa event model. xwindows: typedef region npregion; description npregion defines the region of the plug-in window to be updated, painted, invalidated, or clipped to. for information about the region type def
inition used by your platform, see your platform documentation. see also npn_forceredraw() npn_invalidaterect() npn_invalidateregion() npwindow nprect ...
NPStream - Archive of obsolete content
e_headers. this field is used only for http and is null for other types of streams. the plug-in should copy this data before making use of it. the headers include the http status line and all headers, verbatim as received from the server. lines are terminated by newline characters ("\n"), and the headers are terminated by a newline followed by null ("\n\0"). description the browser allocates and
initializes the npstream object and passes it to the plug-in in as a parameter to npp_newstream or npn_newstream. the browser cannot delete the object until after it calls npp_destroystream or the plug-in calls npn_destroystream. streams produced by the browser: the browser creates the npstream object and passes it to the plug-in
initially as a parameter to npp_newstream. all api calls that operate on...
0.90 - Archive of obsolete content
rss 0.90 rss 0.90 is the earliest known version of rss released to the public, and was replaced by netscape's rss 0.91 (revision 1). it was created by netscape to be a metadata format providing a summary of a website. (and not only a syndication format, as it is today.) rss 0.90 is an rdf-based format. when rss 0.90 was created, the rss
initialization stood for rich site summary and not really simple syndication. (see rss - what is in a name for more info on rss's naming history.) note: rss 0.90 has been deprecated. producers of rssshould not be creating rss 0.90 feeds, andshould instead use a newer non-deprecated rss format. (see the rss versions list for a list of non-deprecated rss formats.) consumers of rssshould still be able to accept rss 0.90 feeds though. examples rss 0.90...
Encryption and Decryption - Archive of obsolete content
mmetric key, which can then be used to encrypt additional data. this is the approach used by the ssl protocol. as it happens, the reverse of the scheme shown in figure 2 also works: data encrypted with your private key can be decrypted only with your public key. this would not be a desirable way to encrypt sensitive data, however, because it means that anyone with your public key, which is by def
inition published, could decrypt the data. nevertheless, private-key encryption is useful, because it means you can use your private key to sign data with your digital signature-an important requirement for electronic commerce and other commercial applications of cryptography. client software such as firefox can then use your public key to confirm that the message was signed with your private key and ...
Processing XML with E4X - Archive of obsolete content
warning: e4x is obselete. it's been disabled by default for chrome in firefox 17, and completely removed in firefox 21. 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 def
inition 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. 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 i...
ActiveXObject - Archive of obsolete content
installed: excel.application excel.chart scripting.filesystemobject wscript.shell word.document important: activex objects may present security issues. to use the activexobject, you may need to adjust security settings in internet explorer for the relevant security zone. for example, for the local intranet zone, you typically need to change a custom setting to "
initialize and script activex controls not marked as safe for scripting." to identify members of an automation object that you can use in your code, you may need to use a com object browser, such as the ole/com object viewer, if no reference documentation is available for the automation object. to create an automation object, assign the new activexobject to an object variable: var excelapp = new a...
Debug - Archive of obsolete content
ebug.mstraceasynccallbackcompleted indicates that the callback stack associated with a previously specified asynchronous operation has completed. debug.mstraceasynccallbackstarting associates the callback stack with a previously specified asynchronous operation. debug.mstraceasyncoperationcompleted indicates that an asynchronous operation has completed. debug.mstraceasyncoperationstarting
initiates a trace for an asynchronous operation. debug.msupdateasynccallbackrelation updates the relationship status between a synchronous work item and the associated asynchronous operation. debug.write sends strings to the script debugger. debug.writeln sends strings to the script debugger, followed by a newline character. examples print the value of a variable this example uses the write ...
Error.stackTraceLimit - Archive of obsolete content
the error.stacktracelimit property gets or sets the stack trace limit, which is equivalent to the number of error frames to display. the default limit is 10. syntax error.stacktracelimit remarks you can set the stacktracelimit property to any positive value between 0 and inf
inity. if the stacktracelimit property is set to 0 at the time an error is thrown, no stack trace is shown. if the property is set to a negative value or a non-numeric value, the value is converted to 0. if the stacktracelimit is set to inf
inity, the entire stack is shown. otherwise, touint32 is used to convert the value. example the following example shows how to set and then get the stack trace limit. try { var err = new error("my error"); error.stacktracelimit = 7; throw err; } catch(e) { docum...
New in JavaScript 1.1 - Archive of obsolete content
javascript versions netscape navigator 3.0 also introduced javascript language versions. <script language="javascript"> <!-- javascript for navigator 2.0. --> <script language="javascript1.1"> <!-- javascript for navigator 3.0. --> new features in javascript 1.1 new objects array boolean function number new properties number.max_value number.min_value nan number.negative_inf
inity number.positive_inf
inity new methods array.prototype.join() array.prototype.reverse() array.prototype.sort() array.prototype.split() new operators typeof void other new features <noscript> liveconnect. communication between java and javascript. changed functionality in javascript 1.1 "object deletion". you can remove an object by setting its object reference to null. c...
New in JavaScript 1.8.1 - Archive of obsolete content
o javascript; the main change in this release is the addition of the tracemonkey just-in-time compiler, which improves performance. new features in javascript 1.8.1 object.getprototypeof() support for native json string.prototype.trim() string.prototype.trimleft() string.prototype.trimright() changed functionality in javascript 1.8.1 implicit setting of properties in object and array
initializers no longer execute setters in javascript. this makes the behavior of setting the values of properties more predictable. ...
New in JavaScript 1.8.5 - Archive of obsolete content
old proxy api offers support for creating object and function proxies that enable meta-programming in javascript. changed functionality in javascript 1.8.5 iso 8601 support in date: the date object's parse() method now supports simple iso 8601 format date strings. global objects made read only: the nan, inf
inity, 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(). ...
New in JavaScript - Archive of obsolete content
016/es2017/es2018/...) release schedule in mozilla-based engines and products. javascript versions deprecated ( ). the explicit versioning and opt-in of language features was mozilla-specific and are in process of being removed. firefox 4 was the last version which referred to a javascript version (1.8.5). with new ecma standards, javascript language features are now often mentioned with their
initial def
inition in ecma-262 editions such as ecmascript 2015. javascript was released as version 1.0 in march 1996 in netscape navigator 2.0 and internet explorer 2.0. javascript 1.1 version shipped in netscape navigator 3.0. released on august 19, 1996. javascript 1.2 version shipped in netscape navigator 4.0-4.05. released on june 11, 1997. javascript 1.3 version shipped in netscape navi...
MSX Emulator (jsMSX) - Archive of obsolete content
and megaram. in its present form, it should be able to run any program or game developed for msx 1.0. since javascript currently is mostly an interpreted language in web browsers, it is at least an order of magnitude slower than other languages such as c and java. therefore, jsmsx requires a very fast computer to emulate msx at the normal 50-60 interrupts per second inside a web browser. why? the
initial motivation was to find some interesting project to develop while exploring the possibilities of the <canvas> tag and javascript language in the most recent web browsers like firefox 2. as you may have realized, many challenges on performance are faced when developing in javascript. they present an interesting testbed for pushing the current javascript implementations to their limits and for co...
background-size - Archive of obsolete content
ng increasingly popular. konqueror is listed below the table, which seems inconsistent. znerd 04 august 2009 chrome, iron, icab4, omniweb etc. are based on webkit, like netscape 6-8, seamonkey, camino, flock, fennec, blackbird etc. are based on gecko. both layout engines are mentioned in the table. people should refer to the webkit and gecko version to get the info they need. agreed; we should def
initely encourage people to look stuff up by engine rather than browser. these tables should be revised over time to list gecko, webkit, internet explorer, and opera, with perhaps a tooltip on each that provides 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 lay...
Implementation Status - Archive of obsolete content
mustunderstand module unsupported 300757; 4. processing model (events) section title status notes bugs 4 processing model (events) partial the xforms-recalculate, xforms-revalidate, and xforms-refresh events are not as separated as they should be. ...
XForms Repeat Element - Archive of obsolete content
he contents of the repeat element will be displayed in the form. that node will serve as the context node for any relative xpath expressions in that set of repeated markup. 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. node set binding special startindex - optional 1-based
initial value of the repeat index. the default value is 1. number - isn't supported type restrictions the repeat element can be bound to a nodeset. representations the repeat element doesn't have a visual representation. however, it can influence the layout of generated controls depending on its appearance attribute. default layout each generated control set is placed vertically. compact ...
XForms Submit Element - Archive of obsolete content
the result of which is all or part of an instance document being sent to a target destination, which could be local or remote (see the spec). upon receiving a domactivate event, this form control dispatches a xforms-submit event to the submission element (see the spec) specified in its submission attibute. 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 submission - required reference to element submission. ...
XForms Switch Module - Archive of obsolete content
n't have a visual representation. case element this element (see the spec) encloses markup to be conditionally rendered. the content elements (e.g. form controls, groups, switches, repeats and host language elements) within a non-selected case are not rendered. correspondingly, content elements in a case that becomes selected are visible. attributes special selected - determines the
initial selected state of the case. if multiple cases within a switch are marked as selected="true", the first selected case will appear and all others will not be visible. if no case is
initially selected, the first case inside the switch becomes selected and visible. representations the case element doesn't have a visual representation. toggle element the element (see the spec) selects one ...
XForms Trigger Element - Archive of obsolete content
actions are described by the xforms action module (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 type restrictions the trigger element can be bound to a node containing data of any type. actually, the trigger element doesn't interact with the data in the bound node. however, relevant model item property on the bound node has an effect on a trigger. if the bound node is irrelevant, then the trigger will be hidden. ...
Mozilla XForms User Interface - Archive of obsolete content
ppearance = 'full'. image - if the instance node contains an image, then an output element can be used in combination with the mediatype element to display the image. upload provides a means for the user to select a file (see the spec). range allows the user to choose a value from within a specific range of values. it is represented by a slider widget (see the spec). trigger allows the user to
initiate actions (see the spec). it can have the following representations: button - default representation. link/clickable text - used when appearance = 'minimal'. submit invokes the submission of the selected instance data to its target destination, which could be local or remote (see the spec). it can have the following representations: button - default representation. link/clickable tex...
Window: devicelight event - Archive of obsolete content
m value in the range the sensor detects (if available, 0 otherwise). max read only double (float) the maximum value in the range the sensor detects (if available, 0 otherwise). examples window.addeventlistener('devicelight', function(event) { console.log(event.value); }); specifications specification status comment ambient light sensorthe def
inition of 'ambient light events' in that specification. candidate recommendation removed from specification ...
Archived open Web documentation - Archive of obsolete content
ped vars and block-scoped lets. along with hoisting and dynamic behavior, scope in javascript is sometimes surprising. server-side javascript here's a radical idea: use one language to write entire web apps -- the same language which billions of web pages already use, every day. sharp variables in javascript a sharp variable is a syntax in object
initializers that allows serialization of objects that have cyclic references or multiple references to the same object. standards-compliant authoring tools creating cross-browser code upfront will save you lots of time quality testing your web content. the following authoring tools adhere to the w3 standards. if you're using older versions of tools that rely on old bro...
The Business Benefits of Web Standards - Archive of obsolete content
eb development activity need or indeed - should take place until the content has been produced. conversely once the content is to hand the development/publishing process should be lighteningly fast. which is as it should be. if we have produced content we want to publish it now. not in 6 weeks time. furthermore by strictly marking the production process, time, budgets, and resources for both the
initial development and the ongoing publishing of emerging content can be measured and controlled. this is a very powerful management tool. this is the power of web standards. it supplies a far better development framework, for content providers, for web developers, and for css stylists alike. it is simply not possible for everybody not to gain and share in the huge benefits of standards. customers, ...
Archive of obsolete content
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 def
initions, 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. xul parser in python v.00001 ...
Game distribution - Game development
ipedia. native desktop to broaden your audience you can hit the desktop ecosystem with your html5 games too — just remember all the popular aaa games that take most of the market share, and think carefully about whether this suits your strategy. to do the desktop thing properly you should support all three operating systems: windows, mac os and linux. the biggest desktop store for games is def
initely steam — indie developers can get on steam via the steam direct program. remember that you have to deal with the cross-platform issues yourself by uploading separate versions for different platforms. after you've covered steam, there's plenty of buzz around
initiatives like humble bundle where the most popular indie games get presented to a broader audience. it's more like an excellent promo...
Game monetization - Game development
subscriptions there's also an option to get a passive, monthly revenue via a subscription deal. instead of getting a one-time payment you can get a small amount of money per game, per month — it can be something around 20-50 usd per month, per game. it's normally up to you if you want to get all the money in a lump sum or get it per month. remember that it can be cancelled, so it's not an indef
initely working solution. ad revenue you can implement advertisements in your game on your own and try to find the traffic to earn a bit, but you can also do a revenue share deal with a publisher. they will take care of driving the traffic and will split the earnings — usually in a 70/30 or 50/50 deal, collected per month. remember that many new, low quality publishers will want to get your game ...
GLSL Shaders - Game development
this will set an rgba color to recreate the current light blue one — the first three float values (ranging from 0.0 to 1.0) represent the red, green, and blue channels while the fourth one is the alpha transparency (ranging from 0.0 — fully transparent — to 1.0 — fully opaque). ...
3D games on the Web - Game development
ch are a separate story on their own. shaders use glsl, a special opengl shading language, with syntax similar to c, that is executed directly by the graphics pipeline. they can be split into vertex shaders and fragment shaders (or pixel shaders) — the former transforms shape positions to real 3d drawing coordinates, while the latter computes rendering colors and other attributes. you should def
initely check out glsl shaders article to learn more about them. collision detection it's hard to imagine a game without collision detection — we always need to work out when something is hitting something else. we have information available for you to learn from: 2d collision detection 3d collision detection webxr the concept of virtual reality is not new, but it's storming onto the web th...
Unconventional controls - Game development
returning to the microphone. if the frequency of the bounced sound is shifted from the original one, then we can detect that the movement of that object occured. that way we can detect a hand movement by using only a built-in microphone! this can be accomplished using a small library created by daniel rapp — it can be as simple as calculating the difference between two frequencies: doppler.
init(function(bandwidth) { var diff = bandwidth.left - bandwidth.right; }); the diff would be the difference between the
initial position of the hand and the final one. this approach won't give us the full flexibility of using a gamepad, or even leap motion, but it's def
initely an interesting, unconventional alternative. you can use it to scroll a page hands-free, or play theremin, but it should...
Implementing game control mechanisms - Game development
e, javascript files and in-game states, so we know what's happening where. the game's folders look like this: as you can see there are folders for images, javascript files, fonts and sound effects. the src folder contains the javascript files split as a separate states — boot.js, preloader.js, mainmenu.js and game.js — these are loaded into the index file in this exact order. the first one
initializes phaser, the second preloads all the assets, the third one controls the main menu welcoming the player, and the fourth controls the actual gameplay. every state has its own default methods: preload(), create(), and update(). the first one is needed for preloading required assets, create() is executed once the state had started, and update() is executed on every frame. for example, you can...
Crisp pixel art look with image-rendering - Game development
the concept retro pixel art aesthetics are getting popular, especially in indie games or game jam entries. but since today's screens render content at high resolutions, there is a problem with making sure the pixel art does not look blurry. developers have been manually scaling up graphics so they are shown with blocks that represent pixels. two downsides to this method are larger file sizes and compression artifacts. ...
Efficient animation for web games - Game development
ionframe causes the browser to redraw and call your function before that frame gets to the screen. the downside of using this vs. settimeout is that your animations must be time-based instead of frame-based, i.e. you must keep track of time and set your animation properties based on elapsed time. requestanimationframe includes a domhighrestimestamp in its callback function prototype, which you def
initely should use (as opposed to using the date object), as this will be the time the frame began rendering, and ought to make your animations look more fluid. you may have a callback that ends up looking something like this: var starttime = -1; var animationlength = 2000; // animation length in milliseconds function doanimation(timestamp) { // calculate animation progress var progress = 0; ...
Square tilemaps implementation: Static maps - Game development
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1 ], gettile: function(col, row) { return this.tiles[row * map.cols + col] } }; rendering the map we can render the map by iterating over its columns and rows. this snippets assumes the following def
initions: context: a 2d canvas context. tileatlas: an image object containing the tile atlas. map: the tilemap object discussed above. for (var c = 0; c < map.cols; c++) { for (var r = 0; r < map.rows; r++) { var tile = map.gettile(c, r); if (tile !== 0) { // 0 => empty tile context.drawimage( tileatlas, // image (tile - 1) * map.tsize, // source x 0, // ...
asm.js - Game development
e `while`, `if`, numbers, top-level named functions, and other simple constructs. it does not allow objects, strings, closures, and basically anything that requires heap allocation. asm.js code resembles c in many ways, but it's still completely valid javascript that will run in all current engines. it pushes js engines to optimize this kind of code, and gives compilers like emscripten a clear def
inition of what kind of code to generate. we will show what asm.js code looks like and explain how it helps and how you can use it. this subset of javascript is already highly optimized in many javascript engines using fancy just-in-time (jit) compiling techniques. however, by defining an explicit standard we can work on optimizing this kind of code even more and getting as much performance as we can...
Game over - Game development
off all four walls, let's only allow three now — left, top and right. hitting the bottom wall will end the game. we'll edit the second if block so it's an if else block that will trigger our "game over" state upon the ball colliding with the bottom edge of the canvas. for now we'll keep it simple, showing an alert message and restarting the game by reloading the page. ...
Track the score and win - Game development
ur javascript, after the rest of your variables: var score = 0; you also need a drawscore() function, to create and update the score display. add the following after the collisiondetection() function: function drawscore() { ctx.font = "16px arial"; ctx.fillstyle = "#0095dd"; ctx.filltext("score: "+score, 8, 20); } drawing text on a canvas is similar to drawing a shape. the font def
inition looks exactly like the one in css — you can set the size and font type in the font() method. then use fillstyle() to set the color of the font and filltext() to set the actual text that will be placed on the canvas, and where it will be placed. the first parameter is the text itself — the code above shows the current number of points — and the last two parameters are the coordinates wher...
Animations and tweens - Game development
s (scale takes a scale value, 1 being 100% of size, 0 being 0% of size, etc.), the time of the tween in milliseconds and the type of easing to use for the tween. we will also add the optional oncomplete event handler, which defines a function to be executed when the tween finishes. the last thing do to is to start the tween right away using start(). that's the expanded version of the tween def
inition, but we can also use the shorthand syntax: game.add.tween(brick.scale).to({x:2,y:2}, 500, phaser.easing.elastic.out, true, 100); this tween will double the brick's scale in half a second using elastic easing, will start automatically, and have a delay of 100 miliseconds. compare your code you can check the finished code for this lesson in the live demo below, and play with it to understan...
Load the assets and print them on screen - Game development
eting this lesson at gamedev-phaser-content-kit/demos/lesson03.html. our game will feature a ball rolling around the screen, bouncing off a paddle, and destroying bricks to earn points — familiar, huh? in this article we'll look at how to add sprites into our gameworld. having a ball let's start by creating a javascript variable to represent our ball. add the following line between the game
initialization code (our var game... block) and the preload() function: var ball; note: for the sake of this tutorial, we will use global variables. the purpose of the tutorial is to teach phaser-specific approaches to game development rather than dwelling on subjective best approaches. loading the ball sprite loading images and printing them on our canvas is a lot easier using phaser than usin...
Move the ball - Game development
of the gamedev phaser tutorial. you can find the source code as it should look after completing this lesson at gamedev-phaser-content-kit/demos/lesson04.html. we have our blue ball printed on screen, but it's doing nothing — it would be cool to make it move somehow. this article covers how to do just that. updating the ball's position on each frame remember the update() function and its def
inition? the code inside it is executed on every frame, so it's a perfect place to put the code that will update the ball's position on screen. add the following new lines of the code inside update(), as shown: function update() { ball.x += 1; ball.y += 1; } the code above adds 1 to the x and y properties representing the the ball coordinates on the canvas, on each frame. reload index.html ...
Physics - Game development
g a typical simple setup. adding physics phaser is bundled with three different physics engines — arcade physics, p2 and ninja physics — with a fourth option, box2d, being available as a commercial plugin. for simple games like ours, we can use the arcade physics engine. we don't need any heavy geometry calculations — after all it's just a ball bouncing off walls and bricks. first, let's
initialize the arcade physics engine in our game. add the physics.startsystem() method at the beginning of the create function (make it the first line inside the function), as shown below: game.physics.startsystem(phaser.physics.arcade); next, we need to enable our ball for the physics system — phaser object physics is not enabled by default. add the following line at the bottom of the create() f...
Player paddle and controls - Game development
oad the paddle image by adding the following new load.image() call: function preload() { // ... game.load.image('ball', 'img/ball.png'); game.load.image('paddle', 'img/paddle.png'); } adding the paddle graphic just so we don't forget, at this point you should grab the paddle graphic from github, and save it in your /img folder. rendering the paddle, with physics next up, we will
init our paddle by adding the following add.sprite() call inside the create() function — add it right at the bottom: paddle = game.add.sprite(game.world.width*0.5, game.world.height-5, 'paddle'); we can use the world.width and world.height values to position the paddle exactly where we want it: game.world.width*0.5 will be right in the middle of the screen. in our case the world is the same as th...
Scaling - Game development
o lines of code in the preload() function are responsible for aligning the canvas element horizontally and vertically, so it is always centered on screen regardless of size. adding a custom canvas background colour we can also add a custom background color to our canvas, so it won't stay black. the stage object has a backgroundcolor property for this purpose, which we can set using css color def
inition syntax. add the following line below the other three you added earlier: game.stage.backgroundcolor = '#eee'; 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 now we've set up the scaling for our game, let's continue to the third lesson and work out how to load the assets and print th...
Plug-in Development Overview - Gecko Plugin API Reference
unction should return a string containing the type, extension list, and type description separated by colons. each mime types should be separated by semicolons. for example: image/xbm:xbm:x bitmap or for 2 mime types: image/xbm:xbm:x bitmap;image/png:png:portable network graphics. this information will then appear in the navigator.mimetypes dom object. npp_getvalue is called after the plug-in is
initialized to get the scripting interface while np_getvalue is called during
initialization to retrieve the plug-in's name and description, which will appear in the navigator.plugins dom object which is used to populate about:plugins. caution: gecko caches the values returned by these functions and will only call it if the plug-in's timestamp has changed. see bug 125469. mac os x mac os x plug-i...
What is accessibility? - Learn web development
llectual 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 def
initions 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 vi...
Debugging CSS - Learn web development
padding and borders. devtools can really help you to understand how the size of an element is being calculated. the layout view shows you a diagram of the box model on the selected element, along with a description of the properties and values that change how the element is laid out. this includes a description of properties that you may not have explicitly used on the element, but which do have
initial values set. in this panel, one of the detailed properties is the box-sizing property, which controls what box model the element uses. compare the two boxes with classes box1 and box2. they both have the same width applied (400px), however box1 is visually wider. you can see in the layout panel that it is using content-box. this is the value that takes the size you give the element and then a...
Introduction to CSS layout - Learn web development
example. the html markup below gives us a containing element, with a class of wrapper, inside which are three <div> elements. by default these would display as block elements, below one another, in our english language document. however, if we add display: flex to the parent, the three items now arrange themselves into columns. this is due to them becoming flex items and being affected by some
initial values that flexbox sets on the flex container. they are displayed in a row, because the
initial value of flex-direction set on their parent is row. they all appear to stretch to the height of the tallest item, because the
initial value of the align-items property set on their parent is stretch. this means that the items stretch to the height of the flex container, which in this case is define...
Normal Flow - Learn web development
inline-block; which mixes characteristics from both.) that explains individual elements, but what about how elements interact with one another? the normal layout flow (mentioned in the layout introduction article) is the system by which elements are placed inside the browser's viewport. by default, block-level elements are laid out in the block flow direction, based on the parent's writing mode (
initial: horizontal-tb) — each one will appear on a new line below the last one, and they will be separated by any margin that is set on them. in english therefore, or any other horizontal, top to bottom writing mode, block-level elements are laid out vertically. inline elements behave differently — they don't appear on new lines; instead, they sit on the same line as one another and any adjacent...
How CSS is structured - Learn web development
thand properties. mdn's css reference is a good resource for more information about any shorthand property. try using the declarations (above) in your own css exercise to become more familiar with how 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 ...
Learn to style HTML using CSS - Learn web development
odule. it is recommended that you work through getting started with the web before proceeding with this topic. however, doing so isn't absolutely necessary as much of what is covered in the css basics article is also covered in our css first steps module, albeit in a lot more detail. modules this topic contains the following modules, in a suggested order for working through them. you should def
initely start with the first one. css first steps css (cascading style sheets) is used to style and lay out web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features. this module provides a gentle beginning to your path towards css mastery with the basics of how it works, what the syntax l...
How do you make sure your website works properly? - Learn web development
215.20: icmp_seq=3 ttl=44 time=147.857 ms ^c --- mozilla.org ping statistics --- 4 packets transmitted, 4 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 147.857/148.468/148.741/0.362 ms just keep in mind a handy keyboard shortcut: ctrl+c. ctrl+c sends an “interrupt” signal to the runtime and tells it to stop. if you don't stop the runtime, ping will ping the server indef
initely. a simple checklist check for 404s make sure all webpages are behaving as you expect check your website in several browsers to make sure it renders consistently next steps congratulations, your website is up and running for anyone to visit. that's a huge achievement. now, you can start digging deeper into various subjects. since people can come to your website from all over the wor...
How does the Internet work? - Learn web development
rk of networks so far so good. but what about connecting hundreds, thousands, billions of computers? of course a single router can't scale that far, but, if you read carefully, we said that a router is a computer like any other, so what keeps us from connecting two routers together? nothing, so let's do that. by connecting computers to routers, then routers to routers, we are able to scale inf
initely. such a network comes very close to what we call the internet, but we're missing something. we built that network for our own purposes. there are other networks out there: your friends, your neighbors, anyone can have their own network of computers. but it's not really possible to set cables up between your house and the rest of the world, so how can you handle this? well, there are already...
What is the difference between webpage, website, web server, and search engine? - Learn web development
outset, since you'll hear these expressions all the time as you read on. it's easy to confuse these terms sometimes since they refer to related but different functionalities. in fact, you'll sometimes see these terms misused in news reports and elsewhere, so getting them mixed up is understandable! we'll cover these terms and technologies in more detail as we explore further, but these quick def
initions will be a great start for you: web page a document which can be displayed in a web browser such as firefox, google chrome, opera, microsoft internet explorer or edge, or apple's safari. these are also often called just "pages." website a collection of web pages which are grouped together and usually connected together in various ways. often called a "web site" or simply a "site." web s...
What is accessibility? - Learn web development
rovide an attribute explicitly specifying your content's language, so that screen readers read your text properly. make sure that a user can navigate to all widgets on a page solely with the keyboard, without getting trapped. (at least let them tab in and out.) and that's just the beginning. accessibility champions since 1999, the w3c has operated a working group called the web accessibility
initiative (wai) promoting accessibility through guidelines, support material, and international resources. more details please refer to: wikipedia article about accessibility wai (w3c's web accessibility
initiative) next steps accessibility can impact both a website's design and technical structure. from a design point of view, we suggest learning about designing for all types of users. ...
What software do I need to build a website? - Learn web development
tise. (if you're going that route, microsoft has some tools for developers including a ready-to-use virtual machine at modern.ie.) by all means run some tests on a real device, especially on real mobile devices. mobile device simulation is a new, evolving technology and less reliable than desktop simulation. mobile devices cost money, of course, so we suggest taking a look at the open device lab
initiative. you can also share devices if you want to test on many platforms without spending too much. next steps some of this software is free, but not all of it. find out how much it costs to do something on the web. if you'd like to learn more about text editors, read our article about how to choose and install a text editor. if you're wondering how to publish your website on the web, look a...
Basic native form controls - Learn web development
widget is associated with, used if it is not nested within that form. the value of the attribute 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 s...
Example 3 - Learn web development
th : 100%; max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; } .select .option { padding: .2em .3em; } .select .highlight { background: #000; color: #ffffff; } javascript content // ------- // // helpers // // ------- // nodelist.prototype.foreach = function (callback) { array.prototype.foreach.call(this, callback); } // -------------------- // // function def
initions // // -------------------- // 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.clas...
Example 4 - Learn web development
th : 100%; max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; } .select .option { padding: .2em .3em; } .select .highlight { background: #000; color: #ffffff; } javascript content // ------- // // helpers // // ------- // nodelist.prototype.foreach = function (callback) { array.prototype.foreach.call(this, callback); } // -------------------- // // function def
initions // // -------------------- // 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.clas...
Example 5 - Learn web development
th : 100%; max-height: 10em; /* 100px */ overflow-y: auto; overflow-x: hidden; } .select .option { padding: .2em .3em; } .select .highlight { background: #000; color: #ffffff; } javascript content // ------- // // helpers // // ------- // nodelist.prototype.foreach = function (callback) { array.prototype.foreach.call(this, callback); } // -------------------- // // function def
initions // // -------------------- // 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.clas...
How to structure a web form - Learn web development
put is "name required edit text". note: you might get slightly different results, depending on your screenreader. this was tested in voiceover (and nvda behaves similarly). we'd love to 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 def
initely 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> eleme...
Sending forms through JavaScript - Learn web development
t data:</label> <input id="thetext" name="mytext" value="some text data" type="text"> </p> <p> <label for="thefile">file data:</label> <input id="thefile" name="myfile" type="file"> </p> <button>send me!</button> </form> as you see, the html is a standard <form>. there's nothing magical going on. the "magic" is in the javascript: // because we want to access dom nodes, // we
initialize our script at page load. window.addeventlistener( 'load', function () { // these variables are used to store the form data const text = document.getelementbyid( "thetext" ); const file = { dom : document.getelementbyid( "thefile" ), binary : null }; // use the filereader api to access file content const reader = new filereader(); // because filereader...
Test your skills: HTML5 controls - Learn web development
te the finished example: download the starting point for this task to work in your own editor or in an online editor. html5 controls 2 next, we want you to implement a slider control to allow the user to choose a maximum number of people to invite to their party. implement a basic slider control to go along with the provided label. give it a minimum value of 1, maximum value of 30, and
initial value of 10. create a corresponding output element to put the current value of the slider into. give it a class of invite-output, and semantically associate it with the input. if you do this correctly, the javascript included on the page will automatically update the output value when the slider is moved. try updating the live code below to recreate the finished example: download the st...
UI pseudo-classes - Learn web development
live on github at radios-checked-default.html (also see the source code.) for the :indeterminate example, we've got no default selected radio button — this is important — if there was, then there would be no indeterminate state to style. ...
JavaScript basics - Learn web development
orage, which allows us to store data in the browser and retrieve it later. we use localstorage's setitem() function to create and store a data item called 'name', setting its value to the myname variable which contains the user's entry for the name. finally, we set the textcontent of the heading to a string, plus the user's newly stored name. add the if ... else block (below). we could call this
initialization code, as it structures the app when it first loads. if(!localstorage.getitem('name')) { setusername(); } else { let storedname = localstorage.getitem('name'); myheading.textcontent = 'mozilla is cool, ' + storedname; } this first line of this block uses the negation operator (logical not, represented by the !) to check whether the name data exists. if not, the setusername() fu...
HTML Cheatsheet - Learn web development
inline elements block elements an unordered list <ul> <li>i'm an item</li> <li>i'm another item</li> </ul> i'm an item i'm another item an ordered list <ol> <li>i'm the first item</li> <li>i'm the second item</li> </ol> i'm the first item i'm the second item a def
inition list <dl> <dt>a term</dt> <dd>def
inition of a term</dd> <dt>another term</dt> <dd>def
inition of another term</dd> </dl> a term def
inition of a term another term def
inition of another term a horizontal rule <hr> text heading <h1> this is heading 1 </h1> <h...
Use JavaScript within a webpage - Learn web development
yboard or hear content read out. you can hardly ever predict just how long it will take for users or browsers to complete an process (especially asynchronous actions such as loading resources). keep animations subtle and brief with no flashing. flashing is annoying and can cause seizures. additionally, if an animation lasts more than a couple seconds, give the user a way to cancel it. let users
initiate interactions. that means, don't update content, redirect, or refresh automatically. don't use carousels or display popups without warning. have a plan b for users without javascript. people may have javascript turned off to improve speed and security, and users often face network issues that prevent loading scripts. moreover, third-party scripts (ads, tracking scripts, browser extensions) mi...
Test your skills: Advanced HTML text - Learn web development
e: you can try out solutions in the interactive editors below, however it may be helpful to download the code and use an online tool such as codepen, jsfiddle, or glitch to work on the tasks. if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. advanced html text 1 in this task we want you to turn the provided animals and their def
initions into a description list. 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. advanced html text 2 in this task we want you to add some semantics to the provided html as follows: turn the second paragraph into a block-level quote, and semantically indicate that the quote is ta...
HTML table basics - Learn web development
e, which is pretty useful. allowing cells to span multiple rows and columns sometimes we want cells to span multiple rows or columns. take the following simple example, which shows the names of common animals. in some cases, we want to show the names of the males and females next to the animal name. sometimes we don't, and in such cases we just want the animal name to span the whole table. ...
Structuring the web with HTML - Learn web development
ions and other visual effects.) javascript, and how to use it to add dynamic functionality to web pages (for example find your location and plot it on a map, make ui elements appear/disappear when you toggle a button, save users' data locally on their computers, and much much more.) modules this topic contains the following modules, in a suggested order for working through them. you should def
initely start with the first one. introduction to html this module sets the stage, getting you used to important concepts and syntax, looking at applying html to text, how to create hyperlinks, and how to use html to structure a webpage. multimedia and embedding this module explores how to use html to include multimedia in your web pages, including the different ways that images can be included,...
Making asynchronous programming easier with async and await - Learn web development
le (see also the source code). but how does it work? you'll note that we've wrapped the code inside a function, and we've included the async keyword before the function keyword. this is necessary — you have to create an async function to define a block of code in which you'll run your async code; as we said earlier, await only works inside of async functions. inside the myfetch() function def
inition you can see that the code closely resembles the previous promise version, but there are some differences. instead of needing to chain a .then() block on to the end of each promise-based method, you just need to add an await keyword before the method call, and then assign the result to a variable. the await keyword causes the javascript runtime to pause your code on this line, allowing other co...
Choosing the right approach - Learn web development
implementation notes.requires a vendor prefix or different name for use.requires a vendor prefix or different name for use. further information cooperative asynchronous javascript: timeouts and intervals, in particular requestanimationframe() requestanimationframe() reference promises promises are a javascript feature that allows you to run asynchronous operations and wait until it is def
initely complete before running another operation based on its result. promises are the backbone of modern asynchronous javascript. useful for... single delayed operation repeating operation multiple sequential operations multiple simultaneous operations no no yes see promise.all(), below code example the following code fetches an image from the server and...
Introducing asynchronous JavaScript - Learn web development
ises promises are the new style of async code that you'll see used in modern web apis. a good example is the fetch() api, which is basically like a modern, more efficient version of xmlhttprequest. let's look at a quick example, from our fetching data from the server article: fetch('products.json').then(function(response) { return response.json(); }).then(function(json) { products = json;
initialize(); }).catch(function(err) { console.log('fetch problem: ' + err.message); }); note: you can find the finished version on github (see the source here, and also see it running live). here we see fetch() taking a single parameter — the url of a resource you want to fetch from the network — and returning a promise. the promise is an object representing the completion or failure of the...
Asynchronous JavaScript - Learn web development
we have put together a course that includes all the essential information you need to work towards your goal. get started prerequisites asynchronous javascript is a fairly advanced topic, and you are advised to work through javascript first steps and javascript building blocks modules before attempting this. if you are not familiar with the concept of asynchronous programming, you should def
initely start with the general asynchronous programming concepts article in this module. if you are, then you can probably skip to the introducing asynchronous javascript module. note: if you are working on a computer/tablet/other device where you don't have the ability to create your own files, you can try out (most of) the code examples in an online coding program such as jsbin or glitch. guides...
Functions — reusable blocks of code - Learn web development
nction subfunction2() { console.log(myvalue); } function subfunction3() { console.log(myvalue); } just make sure that the values being used inside the function are properly in scope. the example above would throw an error referenceerror: myvalue is not defined, because although the myvalue variable is defined in the same scope as the function calls, it is not defined inside the function def
initions — the actual code that is run when the functions are called. to make this work, you'd have to pass the value into the function as a parameter, like this: function mybigfunction() { let myvalue = 1; subfunction1(myvalue); subfunction2(myvalue); subfunction3(myvalue); } function subfunction1(value) { console.log(value); } function subfunction2(value) { console.log(value); } f...
Function return values - Learn web development
eld and a paragraph. there's also a <script> element, in which we have stored a reference to both html elements in two variables. this little page will allow you to enter a number into the text box, and display different numbers related to it in the paragraph below. let's add some useful functions to this <script> element. ...
Test your skills: Loops - Learn web development
this aim of this skill test is to assess whether you've understood our looping code article. note: you can try out solutions for the tasks below by downloading the code, putting it in an online tool such as codepen, jsfiddle, or glitch, then working on the tasks. we didn't provide live editable versions of these tasks because of the risk of creating inf
inite loops and crashing the assessment page! if you get stuck, then ask us for help — see the assessment or further help section at the bottom of this page. dom manipulation: considered useful some of the questions below require you to write some dom manipulation code to complete them — such as creating new html elements, setting their text contents to equal specific string values, and nesting them inside existing elements on the p...
Introduction to web APIs - Learn web development
s request permission to be enabled from the user once calls to them are made in your code. as an example, the notifications api asks for permission using a pop-up dialogue box: the web audio and htmlmediaelement apis are subject to a security mechanism called autoplay policy — this basically means that you can't automatically play audio when a page loads — you've got to allow your users to
initiate audio play through a control like a button. this is done because autoplaying audio is usually really annoying and we really shouldn't be subjecting our users to it. note: depending on how strict the browser is, such security mechanisms might even stop the example from working locally, i.e. if you load the local example file in your browser instead of running it from a web server. at the tim...
Handling text — strings in JavaScript - Learn web development
similarly to numbers at first glance, but when you dig deeper you'll start to see some notable differences. let's start by entering some basic lines into the browser developer console to familiarize ourselves. creating a string to start with, enter the following lines: let string = 'the revolution will not be televised.'; string; just like we did with numbers, we are declaring a variable,
initializing it with a string value, and then returning the value. the only difference here is that when writing a string, you need to surround the value with quotes. if you don't do this, or miss one of the quotes, you'll get an error. try entering the following lines: let badstring = this is a test; let badstring = 'this is a test; let badstring = this is a test'; these lines don't work because...
Test your skills: Math - Learn web development
in numbers. call the variables something sensible. add the first two variables together and store the result in another variable. subtract the fourth variable from the third and store the result in another variable. multiply the results from the last two steps together, storing the result in a variable called finalresult. the product should be 48. if it isn't, you'll have to adjust some of the
initial input values. finally, write a calculation that checks whether finalresult is an even number. store the result in a variable called evenoddresult. download the starting point for this task to work in your own editor or in an online editor. math 2 in the second task you are already provided with two calculations, with the results stored in the variables result and result2. but these re...
Test your skills: variables - Learn web development
e the assessment or further help section at the bottom of this page. note: in the examples below, if there is an error in your code it will be outputted into the results panel on the page, to help you try to figure out the answer (or into the browser's javascript console, in the case of the downloadable version). variables 1 in this task we want you to: declare a variable called myname.
initialize myname with a suitable value, on a separate line (you can use your actual name, or something else). declare a variable called myage and
initialize it with a value, on the same line. 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. variables 2 in this task you need to add ...
What is JavaScript? - Learn web development
javascript from a high level, answering questions such as "what is it?" and "what can you do with it?", and making sure you are comfortable with javascript's purpose. prerequisites: basic computer literacy, a basic understanding of html and css. objective: to gain familiarity with what javascript is, what it can do, and how it fits into a web site. a high-level def
inition javascript is a scripting or programming language that allows you to implement complex features on web pages — every time a web page does more than just sit there and display static information for you to look at — displaying timely content updates, interactive maps, animated 2d/3d graphics, scrolling video jukeboxes, etc. — you can bet that javascript is probably involved. it is the th...
JavaScript object basics - Learn web development
a local copy of our oojs.html file. this contains very little — a <script> element for us to write our source code into. we'll use this as a basis for exploring basic object syntax. while working with this example you should have your developer tools javascript console open and ready to type in some commands. as with many things in javascript, creating an object often begins with defining and
initializing a variable. try entering the following line below the javascript code that's already in your file, then saving and refreshing: const person = {}; now open your browser's javascript console, enter person into it, and press enter/return. you should get a result similar to one of the below lines: [object object] object { } { } congratulations, you've just created your first object. job ...
Multimedia: Images - Learn web development
or can see the page as they download and therefore, their impact on perceived performance is far lower than many expect. however, images are mostly used for content, so it's important that a visitor can see them as soon as possible for a good experience. loading strategy one of the biggest improvements to most websites is lazy-loading images beneath-the-fold, rather than downloading them all on
initial page load regardless of whether a visitor scrolls to see them or not. many javascript libraries can implement this for you, such as lazysizes, and browser vendors are working on a native lazyload attribute that is currently in the experimental phase. beyond loading a subset of images, next you should look into the format of the images themselves: are you loading the most optimal file forma...
What is web performance? - Learn web development
holds that website's files, establishes a connection to it, and requests the files. see populating the page: how the browser works for a detailed overview. source order. your html index file's source order can significantly affect performance. the download of additional assets linked to from the index file is generally sequential, based on source order, but this can be manipulated and should def
initely be optimized, realizing that some resources block additional downloads until their content is parsed and executed. the critical path. this is the process that the browser uses to construct the web document once the files have been downloaded from the server. the browser follows a well-defined set of steps, and optimizing the critical rendering path to prioritize the display of content that re...
Web performance - Learn web development
d through this module, you'll probably be excited to go deeper into web performance — you can find a lot of further teachings in our main mdn web performance section, including overviews of performance apis, testing and analysis tools, and performance bottleneck gotchas. guides this topic contains the following guides. the following is a suggested order for working through them; you should def
initely start with the first one. the "why" of web performance this article discusses why web performance is important for accessibility, user experience and your business goals. what is web performance? you know web performance is important, but what is constitutes web performance? this article introduces the components of performance, from web page loading and rendering, including how your con...
Website security - Learn web development
service attacks, or displaying modified (and often damaging) information on their homepages. in other high-profile cases, millions of passwords, email addresses, and credit card details have been leaked into the public domain, exposing website users to both personal embarrassment and financial risk. the purpose of website security is to prevent these (or any) sorts of attacks. the more formal def
inition of website security is the act/practice of protecting websites from unauthorized access, use, modification, destruction, or disruption. effective website security requires design effort across the whole of the website: in your web application, the configuration of the web server, your policies for creating and renewing passwords, and the client-side code. while all that sounds very ominous, t...
Routing in Ember - Learn web development
tured. it also tells ember how to interact with your route, such as when loading arbitrary data, handling errors while loading that data, or interpreting dynamic segments of the url. since our data is static, we won't get to any of those fancy features, but we'll still make sure that the route provides the minimally required data to view a page. creating the "index" route did not add a route def
inition line to router.js, because like with url navigation and javascript module loading, "index" is a special word that indicates the default route to render, load, etc. to adjust our old way of rendering the todolist app, we'll first need to replace the todolist component invocation from the application template with an {{outlet}} call, which means "any sub-route will be rendered in place here". ...
Introduction to client-side frameworks - Learn web development
cript frameworks power much of the impressive software on the modern web – including many of the websites you likely use every day. mdn web docs, which you are currently reading this on, uses the react/reactdom framework to power its front end. what frameworks are out there? there are many frameworks out there, but currently the "big four" are considered to be the following. ember ember was
initially released in december 2011 as a continuation of work that started in the sproutcore project. it is an older framework that has less users than more modern alternatives such as react and vue, but it still enjoys a fair amount of popularity due to its stability, community support, and some clever coding principles. start learning ember angular angular is an open-source web application frame...
Creating our first Vue component - Learn web development
our todoitem component is still not very useful because we can only really include this once on a page (ids need to be unique), and we have no way to set the label text. nothing about this is dynamic. what we need is some component state. this can be achieved by adding props to our component. you can think of props as being similar to inputs in a function. the value of a prop gives components an
initial state that affects their display. registering props in vue, there are two ways to register props: the first way is to just list props out as an array of strings. each entry in the array corresponds to the name of a prop. the second way is to define props as an object, with each key corresponding to the prop name. listing props as an object allows you to specify default values, mark props...
Adding a new todo form: Vue events, methods, and models - Learn web development
.log() we added inside our onsubmit() method. binding data to inputs with v-model next up, we need a way to get the value from the form's <input> so we can add the new to-do item to our todoitems data list. the first thing we need is a data property in our form to track the value of the to-do. add a data() method to our todoform component object that returns a label field. we can set the
initial value of the label to an empty string. your component object should now look something like this: export default { methods: { onsubmit() { console.log("form submitted"); } }, data() { return { label: "" }; } }; we now need some way to attach the value of the new-todo-input <input> field to the label field. vue has a special directive for this: v-...
Focus management with Vue refs - Learn web development
sing lifecycle methods. this can be useful for things like data fetching, where you may need to get your data before your component renders, or after a property changes. the list of lifecycle methods are below, in the order that they fire. beforecreate() — runs before the instance of your component is created. data and events are not yet available. created() — runs after your component is
initialized but before the component is added to the vdom. this is often where data fetching occurs. beforemount() — runs after your template is compiled, but before your component is rendered to the actual dom. mounted() — runs after your component is mounted to the dom. can access refs here. beforeupdate() — runs whenever data in your component changes, but before the changes are rendered t...
Vue resources - Learn web development
ngle setup() function is used on the component. only what you return from this function is available in your <template>s. you are required to be explicit about "reactive" properties when using this api. vue handles this for you using the options api. this makes the new api typically considered a more advanced use case. there are also a handful of other changes, including a change in how apps are
initialized in vue. to read more about the changes involved with vue 3, refer to this article by vue school which goes over most of the major changes in vue 3. previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our...
Styling Vue components with CSS - Learn web development
ss="btn btn__primary btn__lg"> add </button> </form> </template> let's also add the stack-large class to the <ul> tag in our app.vue file. this will help improve the spacing of our to-do items a bit. update it as follows: <ul aria-labelledby="list-summary" class="stack-large"> adding scoped styles the last component we want to style is our todoitem component. to keep the style def
initions close to the component we can add a <style> element inside it. however, if these styles alter things outside of this component, it could be challenging to track down the styles responsible, and fix the problem. this is where the scoped attribute can be useful — this attaches a unique html data attribute selector to all of your styles, preventing them from colliding globally. to use the sco...
Handling common accessibility problems - Learn web development
for example, we installed the firefox version, then used it to audit our bad-table.html example. we got the following results: axe is also installable using npm, and can be integrated with task runners like grunt and gulp, automation frameworks like selenium and cucumber, unit testing frameworks like jasmin, and more besides (again, see the main axe page for details). screenreaders it is def
initely worth testing with a screenreader to get used to how severely visually impaired people use the web. there are a number of screenreaders available: some are paid-for commercial products, like jaws (windows) and window eyes (windows). some are free products, like nvda (windows), chromevox (chrome, windows, and mac os x), and orca (linux). some are built into the operating system, like voice...
Introduction to automated testing - Learn web development
s easy to do. for example, let's first create a test directory to allow us to play without fear of breaking anything. create a new directory somewhere sensible using your file manager ui, or, on a command line, by navigating to the location you want and running the following command: mkdir node-test to make this directory an npm project, you just need to go inside your test directory and
initialize it, with the following: cd node-test npm
init this second command will ask you many questions to find out the information required to set up the project; you can just select the defaults for now. once all the questions have been asked, it will ask you if the information entered is ok. type yes and press enter/return and npm will generate a package.json file in your directory. this f...
Strategies for carrying out testing - Learn web development
note: when using google analytics, you need to beware 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 def
initely include accessibility as a grade a testing requirement (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 mobil...
Command line crash course - Learn web development
e terminal is available on macos at applications/utilities/terminal. windows as with some other programming tools, using the terminal (or command line) on windows has traditionally not been as simple or easy as on other operating systems. but things are getting better. windows has traditionally had its own terminal-like program called cmd (“the command prompt”) for a long time, but this def
initely doesn’t have parity with unix commands, and is equivalent to the old-style windows dos prompt. better programs exist for providing a terminal experience on windows, such as powershell (see here to find installers), and gitbash (which comes as part of the git for windows toolset) however, the best option for windows in the modern day is the windows subsystem for linux (wsl) — a compatibi...
Client-side tooling overview - Learn web development
e and likely improve the overall quality of your code. it often takes some time for new developer tools to settle down in their complexity. one of the best known tools, webpack, has a reputation for being overly complicated to work with, but in the latest major release there was a huge push to simplify common usage so the configuration required is reduced down to an absolute minimum. there's def
initely no silver bullet that will guarantee success with tools, but as your experience increases you'll find workflows that work for you or for your team and their projects. once all the kinks in the process are flattened out, your tool chain should be something you can forget about and it should just work. how to choose and get help with a particular tool most tools tend to get written and release...
Learn web development
erver-side development. begin with our javascript first steps and server-side first steps modules. frameworks and tooling: after mastering the essentials of vanilla html, css, and javascript, you should learn about client-side web development tools, and then consider digging into client-side javascript frameworks, and server-side website programming. note: our glossary provides terminology def
initions. besides, if you have a specific question about web development, our common questions section may have something to help you. random glossary entry semantics in programming, semantics refers to the meaning of a piece of code — for example "what effect does running that line of javascript have?", or "what purpose or role does that html element have" (rather than "what does it...
Chrome Worker Modules
as follows: try { mymodule.foo(); } catch (ex) { log("exception raised at " + ex.modulename) log("stack: " + ex.modulestack); } subtleties you shouldn’t mix both styles exports.foo = bar and module.exports = {foo: bar}. if you do, know that any call to module.exports will overwrite all calls to `exports.foo = bar. you should not modify exports or module.exports once your module
initialization is complete. the module loader supports cyclic calls to require(). however, if you have cyclic requirements, some of the modules involved in the cyclic requirements may become visible by the other modules before they are fully evaluated. no attempt is made to fully isolate modules from each other. in particular, globals (string, math, object, self) and the worker global scope itself (th...
Embedding API for Accessibility
in part, being accessible means supporting a built-in accessibility apis for a platform, such as microsoft active accessibility or atk for linux and unix desktops. there are many other pieces, such as preferences to allow the user to change foreground and background colors, and font sizes. mozilla already supports some of these options. ...
Links and Resources
here are some useful links for those interested in web accessibility as well as open source accessibility. guidelines & standards information and resources on section 508 - legal policy for us government purchases requiring software accessibility. wai - web accessibility
initiative web content accessibility guidelines (wcag) 1.0 the first set of official guidelines from the w3c web accessibility
initiative (wai). the european union is looking to base their upcoming accessibility regulations on these guidelines. wai interest group - discussion list for standards in web accessibility. web accessibility checklist from ibm. ibm's java accessibility checklist - guidelines to making java accessibility. accessibility information resource center for developers at adobe - flash m...
Accessible Toolkit Checklist
logs/windows/general escape key cancels dialogs and refocuses the previously focused on the parent window. alt+f4 closes windows, similar to escape but even works on dialogs without cancel button alt+space opens window menu with restore, move, size, minimize, maximize, close the move and size options must be usable with the arrow keys on the keyboard in windows,
initial focus goes to first focusable widget that is not a clickable tabbed property sheet label making tab order definable. default tab order should be in document order. tab order must wrap, not have invisible items in tab order dynamically added items must not corrupt the tab cycle or make it disorderly tab cycle must be identical backwards and forwards the f6 and shif...
Theme concepts
patibility between themes in the major browsers. opera takes an entirely different approach, and microsoft edge themes are not yet open to developers. there is good compatibility between firefox static themes and chrome themes, providing the ability to port a single header image theme from firefox to chrome. however, noting that "frame": and "tab_background_text": only support rgb color array def
inition on chrome. so, in the single image theme example (weta_fade) could be supported in chrome using the following manifest.json file: { "manifest_version": 2, "version": "1.0", "name": "<your_theme_name>", "theme": { "images": { "theme_frame": "weta.png" }, "colors": { "frame": [ 173 , 176 , 159 ], "tab_background_text": [ 0 , 0 , 0 ] } } } also, note...
Adding a new event
widgeteventimple.cpp. e.g., if your event shouldn't cause dom event, you need to modify widgetevent::isallowedtodispatchdomevent(). if your event should be fired on focused node, you need to modify widgetevent::istargetedatfocusedcontent(). how to implement a dom event class if you're in the case 3 (non-dom events), you can skip this section. create webidl of the event write a dom event def
inition with webidl. it should be created under dom/webidl/. see webidl bindings for the detail. if your new event shouldn't be created with event constructor such as: var event = new fooevent("bar", { bubbles: true, cancelable: true, detail: 5 }); you shouldn't define construnctor in it. create xpcom interface for the dom event if your event class should be accessible via xpcom interface, you sh...
A bird's-eye view of the Mozilla framework
m a new source tree checked out 11/04/05. the build id is 2005110409. thehelp viewer files referenced in the article are located in /seamonkey/extensions/help/ this article also assumes you are familiar with the javascript and c++ programming languages, object-oriented programming (oop) terminology and design concepts, the microsoft® component object model (com), and the corba omg interface def
inition language (idl). organization this article first covers some conceptual groundwork, then walks through a user scenario to illustrate how key mozilla architectural components work together to support a simplehelp viewer ui action. framework layers at a high level, you can think of the mozilla framework as consisting of a suite of applications, each of which is organized into three basic laye...
Continuous Integration
this document will help you understand all the pieces that comprise mozilla's continuous integration systems. taskcluster and treeherder taskcluster, mozilla's continuous integration (ci) system picks up changes pushed to hg. taskcluster generate binary builds for firefox and firefox for android across a variety of operating sytems. after the builds are completed, they are used to run a series of correctness and performance tests. the results of taskcluster jobs (both builds and tests) are displayed in treeherder. ...
Creating a Language Pack
this page is out of date. please consult the documentation on localized builds on firefox-source-docs. to create a language pack, or a localization repack, you first need to go through the
initial setup process. pre-build steps in the .mozconfig, you want to have mk_add_options moz_objdir=@topsrcdir@/obj-firefox-build ac_add_options --disable-compile-environment ac_add_options --with-l10n-base=../l10n-central # path relative to moz_objdir ac_add_options --enable-application=[browser or mail] the given path should have your localization directory as child (i.e., a subdirectory ab-cd where ab-cd is your locale code). you still need to specify which application you're localizing (e.g., for firefox, that's browser, thunderbird would be mail). configure step you need to prepare t...
Creating a Login Manager storage module
age) { dump("sampleloginmanager: " + message + "\n"); this._logservice.logstringmessage("sampleloginmanager: " + message); }, // logs function name and arguments for debugging stub: function(arguments) { var args = []; for (let i = 0; i < arguments.length; i++) args.push(arguments[i]) this.log("called " + arguments.callee.name + "(" + args.join(",") + ")"); },
init: function slms_
init() { this.stub(arguments); },
initwithfile: function slms_
initwithfile(ainputfile, aoutputfile) { this.stub(arguments); }, addlogin: function slms_addlogin(login) { this.stub(arguments); }, removelogin: function slms_removelogin(login) { this.stub(arguments); }, modifylogin: function slms_modifylogin(oldlogin, newlogin) { this.stub(arguments)...
Makefile - variables
en_us_binary_url server url from which wget will ftp binaries. l10nbasedir moz_chrome_multilocale a list of locale names to process moz_chrome_file_format both, file, jar, omni, symlink packager_no_libs hack to allow one makefile to include another without pulling in libs:: target def
initions. stagedist local staging directory for localization and packaging. todo: xpcom/xpinstall variables: https://developer.mozilla.org/en/adding_xpcom_components_to_mozilla_build_system ...
Makefiles - Best practices and suggestions
ift platform logic into your source code. if a unit test is platform specific write your makefile so it can be used on all platforms but only do work on the specific hardware or class 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 t...
Old Thunderbird build
d to build a thunderbird up to version 59. for thunderbird 60 and later, see the new build instructions. for additional information, see the build documentation. hardware requirements at least 4 gb of ram. 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. build prerequisites 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 instructions. to build on windows, please read the prerequisites so you don't skip preparing the mapi headers needed to compile thunderbird. windows build...
Simple Instantbird build
entation. this should be kept in sync with simple thunderbird build, you might want to take a look at that page too. build prerequisites hardware requirements: 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 instructions. windows build prerequisites gnu/linux build prerequisites mac os x build prerequisites tip: after completing setup for your os, and before you get the s...
Simple SeaMonkey build
uite' > .mozconfig # let's build seamonkey... echo 'mk_add_options moz_objdir=/path/to/comm-central/obj-sm-release' >> .mozconfig # specify amount of parallel building. if the below is left out, a best guess will be taken automatically. echo 'mk_add_options moz_make_flags="-j4"' >> .mozconfig # ...quickly. # build! # note: this requires autoconf 2.13 (at least
initially). # on windows, be sure to use mozmake instead of make, otherwise parallel building will break. make -f client.mk for a debug build, you need different configuration options in your .mozconfig file. this requires more disk space, about 3 gb, and twice as much available ram. mk_add_options moz_objdir=/path/to/comm-central/obj-sm-debug ac_add_options --enable-application=suite ac_add_op...
Simple Thunderbird build
on of thunderbird 60 or later. for thunderbird up to 59, see the old build documentation. for additional, more detailed information, see the build documentation. hardware requirements at least 4 gb of ram. 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. build prerequisites 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 instructions. windows build prerequisites gnu/linux build prerequisites macos build prerequisites mapi headers on windows: check that the mapi header fi...
The Firefox codebase: CSS Guidelines
dealism aside -moz-appearance should always be in theme css. [2] however there is probably a better way than using absolute positioning. colors for common areas of the firefox interface (panels, toolbar buttons, etc.), mozilla-central often comes with some useful css variables that are adjusted with the correct values for different platform configurations, so using those css variables can def
initively save some testing time, as you can assume they already work correctly. using the currentcolor keyword or inheriting is also good practice, because sometimes the needed value is already in the color or on the parent element. this is especially useful in conjunction with icons using -moz-context-properties: fill; where the icon can adjust to the right platform color automatically from the tex...
Commenting IDL for better documentation
the interface. this helps keep the documentation tidy. be concise and to the point. writers will expand upon your documentation if necessary. keep in mind that people for whom english is not their native language will be reading your comments (as well as the generated documentation), so try to avoid slang and abbreviations when possible. if possible, avoid putting comments in the middle of the def
initions of apis. if an interface is used as a parameter or as the type of the value returned by a method, please use the full name of the interface in the description of the method. this will help the tools generate proper links to help make the documentation easier to read and browse through. special commands you can use special commands in your doxygen comments; the ones listed below are interpret...
Contributing to the Mozilla code base
welcome, we're delighted to see you! :) need help? the mozilla community prides itself on being an open, accessible, and friendly community for new participants. if you have any difficulties getting involved or finding answers to your questions, please come and ask your questions in our chatroom, where we can help you get started. we know even before you start contributing that getting set up to work on firefox and finding a bug that's a good fit for your skills can be a challenge. we're always looking for ways to improve this process: making mozilla more open, accessible, and easier to participate with. ...
Communicating with frame scripts
> { target: <div#searchcontainer> } if your code requires access to a window (for example to run window.opendialog), and your message listener is run from somewhere without access to a window (e.g. an xpcom component), you can access the window of the browser that sent the message with message.target.ownerdocument.defaultview. synchronous messaging to send a synchronous message...
Message manager overview
different tabs may run in different processes. message managers are designed to enable code in one process to communicate with code in a different process. at the top level, there are two different sorts of message managers: frame message managers: these enable chrome process code to load a script into a browser frame (essentially, a single browser tab) in the content process. these scripts are called frame scripts, and as the name suggests, they are scoped to a specific browser frame. ...
Tracking Protection
le.com', event);"> visit example.com </a> <script> function tracklink(url,event) { event.preventdefault(); ga('send', 'event', 'outbound', 'click', url, { 'transport': 'beacon', 'hitcallback': function() { document.location = url; } }); } </script> instead, you should account for the case when google analytics is missing by checking to see if the ga object has
initialized: <a href="http://www.example.com" onclick="tracklink('http://www.example.com', event);"> visit example.com </a> <script> function tracklink(url,event) { event.preventdefault(); if (window.ga && ga.loaded) { ga('send', 'event', 'outbound', 'click', url, { 'transport': 'beacon', 'hitcallback': function() { document.location = url; } }); } els...
mozbrowseractivitydone
the mozbrowseractivitydone event is fired when something inside the browser <iframe> triggers a web activity, and that web activity's message is consumed by the receiving app. if the activity has a returnvalue set to true, then the activity is consumed when postresult or posterror is invoked on the activity by the receiving app. note: for activities where the receiving app's activity def
inition in its manifest does not include returnvalue or returnvalue is false, no mozbrowseractivitydone event will be generated as of the landing of bug 1194525 in firefox os 2.5. postresult and posterror calls made on such an activity will be ignored and have no effect. general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default acti...
mozbrowserfirstpaint
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 mozbrowserfirstpaint event is fired when the <iframe> paints content for the first time (this doesn't include the
initial paint from about:blank). general info specification non standard interface customevent bubbles yes cancelable yes target <iframe> default action none properties property type description target read only eventtarget the event target (the topmost target in the dom tree). type read only domstring the type of event. bub...
mozbrowsershowmodalprompt
the return value for the window.prompt() methods. this should be set by the embedder. unblock() a function to be called when the iframe is unblocked. note that if the embedder calls preventdefault() on this event, the iframe is blocked until unblock() is called. obsolete properties of details msg_name a string representing the type of message. for that event, it's always showmodalprompt.
initialvalue a string representing the
initial value for the window.prompt() methods. example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsershowmodalprompt", function( event ) { console.log("asking for prompt:" + json.stringify(event.detail)); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowseric...
Browser API
ew paint occurs on any document in the browser <iframe>. mozbrowsererror sent when an error occurs while trying to load content within a browser <iframe>. mozbrowserfindchange sent when a search operation is performed on the browser <iframe> content (see htmliframeelement search methods.) mozbrowserfirstpaint sent when the <iframe> paints content for the first time (this doesn't include the
initial paint from about:blank.) mozbrowsericonchange sent when a new icon (e.g. <link rel="icon"> or <link rel="apple-touch-icon">) is available in the browser <iframe>'s content. mozbrowserloadend sent when the browser <iframe> has finished loading all its assets. mozbrowserloadstart sent when the browser <iframe> starts to load a new page. mozbrowserlocationchange sent when a browser <ifram...
-moz-window-dragging
the -moz-window-dragging css property specifies whether a window is draggable or not. it only works in chrome code, and only on mac os x. the property was added in firefox 35 to solve intermittent problems related to firefox windows not being moveable when busy (bug 944836).
initial value drag applies to all elements that create native windows, e.g. <window>, <panel> inherited no media visual computed value as specified animation type discrete canonical order the unique non-ambiguous order defined by the formal grammar syntax the -moz-window-dragging property is specified as one of the keyword values listed below. values drag the window is draggable. no-drag the window is not...
overflow-clip-box-block
the overflow-clip-box-block css property specifies relative to which box the clipping happens when there is an overflow — in the block direction. /* keyword values */ overflow-clip-box-block: padding-box; overflow-clip-box-block: content-box; /* global values */ overflow-clip-box-block: inherited; overflow-clip-box-block:
initial; overflow-clip-box-block: unset; note: on gecko, by default, padding-box is used everywhere, but <input type="text"> and similar use the value content-box. note that this property is activated by default only in the ua stylesheet and chrome contexts. value not found in db! syntax values padding-box this keyword makes the clipping be related to the padding box. content-box this keyword makes the clipping be related to the content box. formal ...
overflow-clip-box-inline
the overflow-clip-box-inline css property specifies relative to which box the clipping happens when there is an overflow — in the inline direction. /* keyword values */ overflow-clip-box-inline: padding-box; overflow-clip-box-inline: content-box; /* global values */ overflow-clip-box-inline: inherited; overflow-clip-box-inline:
initial; overflow-clip-box-inline: unset; note: on gecko, by default, padding-box is used everywhere, but <input type="text"> and similar use the value content-box. note that this property is activated by default only in the ua stylesheet and chrome contexts. value not found in db! syntax values padding-box this keyword makes the clipping be related to the padding box. content-box this keyword makes the clipping be related to the content box. ...
Embedding Tips
"my_prop_name", "my_prop_contract_id", pr_true, pr_true, getter_copies(previous)); that way you will be able to do: var my_comp = new my_prop_name(); this was taken from weirdal's excellent "burning chrome" article. how do i specify alternate locations for profiles? specify a profile directory in your implementation of nsidirectoryserviceprovider passed to xre_
initembedding. use xre_notifyprofile to make gecko actually use a profile location. how do i change the user agent string? the default useragent is set using the value from your application.ini/nsxreappdata. you can override this default using the "general.useragent.override" preference. how do i display my own message, alert and prompt boxes? you need to implement and register your own prompt ser...
HTTP Cache
f this feature (watch bug 938186). nsicacheentry //github.com/realityripple/uxp/blob/master/netwerk/cache2/nsicacheentry.idl obtained asynchronously or pseudo-asynchronously by a call to nsicachestorage.asyncopenuri. provides access to a cached entry data and meta data for reading or writing or in some cases both, see below. lifetime of a new entry such entry is
initially empty (no data or meta data is stored in it). the anew argument in oncacheentryavailable is true for and only for new entries. only one consumer (the so called "writer") may have such an entry available (obtained via oncacheentryavailable). other parallel openers of the same cache entry are blocked (wait) for invocation of their oncacheentryavailable until one of the follow...
How to get a stacktrace for a bug report
or a full process dump, see how to get a process dump with windows task manager [en-us] os x run /applications/utilities/console.app. expand "~/library/logs" and "crashreporter", then look for logs for "firefox-bin". linux note that for most distros, the package you need to get symbols for will be something 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 crea...
How to implement a custom autocomplete search component
ocation(class_id, alocation); }, getclassobject: function(acompmgr, acid, aiid) { if (!aiid.equals(components.interfaces.nsifactory)) throw components.results.ns_error_not_implemented; if (acid.equals(class_id)) return simpleautocompletesearchfactory; throw components.results.ns_error_no_interface; }, canunload: function(acompmgr) { return true; } }; // module
initialization function nsgetmodule(acompmgr, afilespec) { return simpleautocompletesearchmodule; } starting in gecko 2.0, component registration has been changed, so you need to make the following changes: add an nsgetfactory() function: function nsgetfactory(cid) { if (cid.tostring().touppercase() != class_id.tostring().touppercase()) { throw components.results.ns_error_f...
How to Report a Hung Firefox
e users. if that's not you, or you just want to fix a firefox hang without reporting it, see firefox hangs or is not responding - how to fix. is your firefox not responding? or are you regularly seeing the "firefox is running but is not responding..." dialog? this usually means that something in firefox is hung. this may be because of a code error within firefox itself, such as a deadlock or inf
inite loop, or it may be caused by 3rd-party software such as a firefox extension, antivirus software, or even malware or a virus on your computer. what information to include in a bug report as usual, following bug writing guidelines will make your report much more likely to lead to a fix in firefox. check the cpu usage of the firefox process(es): is it idle, using 100% of a core (which may show...
IME handling guide
e state at dom focus change. first, when a dom node gets focus, nsfocusmanager notifies imestatemanager of the new focused node (calls imestatemanager::onchangefocus()). imestatemanager asks desired ime state by calling nsicontent::getdesiredimestate() of the node. if the node owns nseditor instance, it asks for the desired ime state from the editor and returns the result. next, imestatemanager
initializes inputcontext (defined in imedata.h) with the desired ime state and node information. then, it calls nsiwidget::setinputcontext() with the inputcontext. finally, widget stores the inputcontext and enables or disables ime if the platform has such an api. inputcontext inputcontext is a struct. its mimestate, mhtmlinputtype, mhtmlinputinputmode and mactionhint are set at nsiwidget::setinput...
Implementing Download Resuming
protocols support getting partial files. this means that if a download was interrupted, it can be resumed from that point on, rather than regetting the whole file. the necko implementations of http 1.1 (rfc 2616) as well as ftp support this feature. not only is the ability to specify a start position important, but it's also important to have some assurance that the file did not change since the
initial download attempt. that would lead to a situation where 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 f...
Introduction to Layout in Mozilla
style data is computed lazily, as it is asked for reflow recursively compute geometry (x, y, w, h) for frames, views, and widgets given w & h constraints of “root frame” compute (x, y, w, h) for all children constraints propagated “down” via nshtmlreflowstate desired size returned “up” via nshtmlreflowmetrics basic pattern parent frame
initializes child reflow state (available w, h); places child frame (x, y); invokes child’s reflow method child frame computes desired (w, h), returns via reflow metrics parent frame sizes child frame and view based on child’s metrics n.b. many don’t work like this! (tables, blocks, xul boxes) reflow “global” reflows
initial, resize, style-change proce...
Add-on Manager
nstalled in the application. through its apis information about all installed add-ons can be retrieved and new add-ons can be installed. the apis are designed to be generic and support many different types of add-ons. many functions in the add-on manager interface operate asynchronously returning results through callbacks passed to the functions. the callbacks may be called immediately while the
initial function is still executing or shortly after, depending on when the requested data becomes available. accessing installed add-ons information about installed add-ons can be retrieved through the main addonmanager api. all of its functions are asynchronous, meaning that a callback function must be passed to receive the addon instances. the callback may well only be called after the api functi...
Downloads.jsm
le (using task.jsm): try { yield downloads.fetch(sourceuri, targetfile); } catch (ex if ex instanceof downloads.error && ex.becausetargetfailed) { console.log("unable to write to the target file, ignoring the error."); } methods createdownload() creates a new download object. promise<download> createdownload( object aproperties ); parameters aproperties provides the
initial properties for the newly created download. this matches the serializable representation of a download object. some of the most common properties in this object include: source: string containing the uri for the download source. alternatively, may be an nsiuri, a downloadsource object, or an object with the following properties: url: string containing the uri for the download source...
Interfacing with the Add-on Repository
pository for add-ons matching given search criteria. retrieverecommendedaddons() retrieves a list of recommended add-ons, as determined by the amo site administrators. this example will use the latter, in order to randomly select a recommended add-on and offer to install it. however, the code to perform a search term based query would be very similar. when the user clicks a toolbar button to
initiate the query, the following code gets run to start the request: addonrepository.retrieverecommendedaddons(10, this); this asks the repository to fetch up to 10 add-ons, using the object this as the target for callbacks. the callback object needs to implement the searchcallback interface, providing the methods that get called when a search either fails or completes successfully. handling fail...
NetUtil.jsm
. var file = cc["@mozilla.org/file/directory_service;1"]. getservice(ci.nsiproperties). get("tmpd", ci.nsifile); file.append("test-file.tmp"); file.createunique(ci.nsifile.normal_file_type, 0666); // then, we need an output stream to our output file. var ostream = cc["@mozilla.org/network/file-output-stream;1"]. createinstance(ci.nsifileoutputstream); ostream.
init(file, -1, -1, 0); // finally, we need an input stream to take data from. const test_data = "this is a test string"; let istream = cc["@mozilla.org/io/string-input-stream;1"]. createinstance(ci.nsistringinputstream); istream.setdata(test_data, test_data.length); netutil.asynccopy(istream, ostream, function(aresult) { if (!components.issuccesscode(aresult)) { // an error occur...
OS.File.Info
ix filesystems it is not possible to get a creation date as it was never stored, on new unix filesystems creation date is stored but the method to obtain this date differs per filesystem, bugzilla :: bug 1167143 explores implementing solutions for all these different filesystems) lastaccessdate the date at which the file was last accessed, as a javascript date object. note that the def
inition of last access may depend on the underlying operating system and file system. lastmodificationdate the date at which the file was last modified, as a javascript date object. platform-specific attributes unix unixowner a number holding the identifier of the unix owner of this file. unixgroup a number holding the identifier of the unix group of this f...
PerfMeasurement.jsm
ating systems. method overview 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 perfmeasurement object, then they are not zeroed again unless you explicitly call the reset() method. this lets you accumulate measurements 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 me...
Deferred
a deferred object is returned by the promiseutils.defer() method to provide a new promise along with methods to change its state. method overview void resolve([optional] avalue); void reject([optional] areason); properties attribute type description promise read only promise a newly created promise,
initially in the pending state. methods resolve() fulfills the associated promise with the specified value, or propagates the state of an existing promise. if the associated promise has already been resolved, either to a value, a rejection, or another promise, this method does nothing. note: this function is exactly same as promise constructor's resolve argument, and can be called with any value of this. note: calling this metho...
WebRequest.jsm
e not supported. the "requestbody" instruction in opt_extrainfospec is not supported. redirection is not allowed in onbeforerequest or onheadersreceived, but is allowed in onbeforesendheaders. see bug 1176092. handlerbehaviorchanged() is not supported. requestid is not included in the argument passed to the listener. ...
Webapps.jsm
the webapps.jsm modules exposes the domapplicationregistry, which is responsible for managing all of the open web apps. ...
Localizing with Koala
mozilla\l10n\locale\x-testing> rmdir 3.6 c:\mozilla\l10n\locale\x-testing> hg clone http://bitbucket.org/mozillal10n/x-testing 3.6 otherwise, it's a good idea to create your local repository in order to be able to track changes you make to the localization files. to do this, open the console and type: c:\users\stas> cd c:\mozilla\l10n\locale\x-testing\3.6 c:\mozilla\l10n\locale\x-testing\3.6> hg
init you should now see the the koala's starpage in komodo. you are ready to start localizing firefox! comparing and translating now that we have set up koala to localize firefox from en-us into x-testing, we can start translating the localization files. koala features a very handy tool called compare-locales, which compares the files from en-us with your files in x-testing and gives you statist...
Localizing with Mercurial
s 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 your l10n directory. inside your l10n directory,
init your repo with mq by running hg
init --mq. to create a new patch, run hg qnew -m "your commit message" patch-name.patch. 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 <r...
Localizing with Mozilla Translator
en running "untranslated strings" and "view fuzzy" if you are up to date in localization regularly running qa checks and trying to minimize them. you will always do better if you can export a partial glossary and reimport it as needed. see the following example. let's assume you have a firefox product in mt with the directory layout present in language packs, as you probably would need for a
initial localization. the directory structure will look like this: (ab-cd jar root) locale |-- branding | |-- brand.dtd | `-- brand.properties |-- browser | |-- aboutdialog.dtd . . |-- browser-region | `-- region.properties `-- ab-cd |-- alerts | `-- notificationnames.properties |-- autoconfig | `-- autoconfig.properties |-- cookie ...
Localizing without a specialized tool
ll serve as localization base: $ mkdir l10n-mozilla-1.9.2 $ cd l10n-mozilla-1.9.2 inside this directory you will put all the localization files in a folder named after your locale, e.g. x-testing. depending on your case, you can do it in one of the following ways: if no localization exists yet, create an empty folder and create a mercurial repository in it: $ mkdir x-testing $ cd x-testing $ hg
init if there is a bitbucket repository with localization files, you can pull from it. this will automatically create an "x-testing" directory in your current directory (you should be in l10n-mozilla-1.9.2). $ hg clone http://bitbucket.org/mozillal10n/x-testing if there is an hg.mozilla.org repository with localization files, you can pull from it too: $ hg clone http://hg.mozilla.org/releases/l1...
Translation phase
this is where the technical aspect of the process begins to divide. at mozilla, we localize many different projects that can be categorized into three different groups. each group of projects employs a different type of l10n tool for, you guessed it, localizing the projects. the l10n tools are meant to help you maintain your localized content from release to release and leverage already localized materials when localizing new content. here we'll identify those groups of projects and the l10n tools associated with them. ...
SVN for Localizers
s add needed files to your repository or update your files with new strings in english. it's very important for you to update your working copy with the newest files from mozilla svn repository before you start making changes. enter the following command from the command-line: svn update your local svn repository (i.e., working directory) will be updated with the newest files from the url you
initially cloned your repository from. it's very important that you do this often. as a general rule, you should at least do it before translating anything. sometimes mistakes happen and you need to start over. go back to the root of your working directory and execute this command: svn revert * this is a really helpful command because it reverts all of your changes to your working directory's l...
Basics
he usual view source. this demo has been made to illustrate the following aspects. you can right-click on any math fragment of interest throughout this document. the context menu won't show up. rather, the math fragment will zoom, and if you right-click a second time, you will see the mathml wysiwyg markup of the fragment, and if you right-click again a third time, the fragment will revert to its
initial state. this tri-state mode is aimed at limiting conflicts with other agents that compete for the mouse. with mathml, one can build sets such as (go on, right-click any of these equations to experiment the zoom) { 0 , 1 , 2 , 3 , 4 } or { ⌊ a b ⌋ | a 2 + b 2 ≤ 3 } , write calculus d y d x = 1 y 2 , form rather complicated expressions lim n → n ...
Updates
ml conference april 14, 2000 status report february 12, 2000 mathml-enabled m13 builds for win32 september 21, 1999 mathml has landed. september 18, 1999 status report - mozillazine annoucement september 3, 1999 xsl coming to mozilla? mathml too? may 23, 1999 reader opinion: mathml's viability - talkback may 14, 1999 mozilla mathml project underway may 1999 mozilla mathml project
initiation ...
Various MathML Tests
care to read. testing mathml <merror>, <mtext>: this is a text in mtext this is a text in merror testing <maction>: click to toggle between expressions, and watch the status line onmouseover/onmouseout: statusline#first expression first expression statusline#second expression second expression statusline#and so on... and so on.. click the expression below to see several def
initions of pi: π = 3.14159265358... π = 2i log 1-i 1+i π = 2 . 2 2 . 2 2 + 2 . 2 2 + 2 + 2 ... π 4 = 1 2 + 12 2 + 32 2 + 52 2 + 72 2+... thomson scattering theory d 2 p d Ω s d ω s = r e 2 ∫ v < s i > d 3 r ∫ | e ^ . Π ↔ . e ^ | 2 κ 2 f δ ( k . ...
mozilla::CondVar
wait() nsresult wait( in printervaltime interval = pr_interval_no_timeout ); wait on this condvar until it is notifyed. notify() nsresult notify(void); notify one thread waiting on this condvar. ...
mozilla::MonitorAutoEnter
the mozilla::monitorautoenter constructor will enter() the underlying mozilla::monitor automatically. when the mozilla::monitorautoenter goes out of scope, its destructor will exit() the underlying mozilla::monitorautoenter. important: when a mozilla::monitorautoenter is live on the stack, your code is guaranteed to own the underlying mozilla::monitor. ...
mozilla::Mutex
lock() lock the mutex. unlock() unlock the mutex. assertcurrentthreadowns() assert that the current thread has locked this mutex. does not incur a runtime penalty in optimized builds. ...
mozilla::MutexAutoLock
mozilla::mutexautolock is an raii helper for mozilla::mutex. it is designed to make using mozilla::mutex safer and easier. to use mozilla::mutexautolock, declare and
initialize it with a reference to an mozilla::mutex. the mozilla::mutexautolock constructor will lock() the underlying mozilla::mutex automatically. when the mozilla::mutexautolock goes out of scope, its destructor will unlock() the underlying mozilla::mutex. because of mozilla::mutexautounlock, the rule for determining if your code owns the mutex underlying the mutexautolock is slightly more complicated than that for monitorautoenter. this is because mutexautounlocks can be nested within mutexautolocks and vice versa, indef
initely deeply. important: when a mozilla::mutexautolock is the mutex raii wrapper most recently pushed on ...
mozilla::MutexAutoUnlock
mozilla::mutexautounlock is an raii helper for mozilla::mutex. it is designed to make using mozilla::mutex safer and easier. to use mozilla::mutexautounlock, declare and
initialize it with a reference to a locked mozilla::mutex. the mozilla::mutexautounlock constructor will unlock() the underlying mozilla::mutex automatically. when the mozilla::mutexautounlock goes out of scope, its destructor will lock() the underlying mozilla::mutex. because of mozilla::mutexautolock, the rule for determining if your code does not own the mutex underlying the mutexautounlock is slightly more complicated than that for monitorautoenter. this is because mutexautounlocks can be nested within mutexautolocks and vice versa, indef
initely deeply. important: when a mozilla::mutexautounlock is the mutex raii wrapper ...
Build Metrics
installer size size in bytes of the firefox installer. ...
BloatView
t number is a metric determined by multiplying the total number of objects allocated of a given class by the class size. note that although this isn't necessarily the amount of memory consumed at any given time, it does give an indication of how much memory we're consuming. the more memory in general, the worse the performance and footprint. the percentage 99999.99% will show up indicating an "inf
inite" amount of leakage. this happens when something that didn't leak before is now leaking. bloatview and continuous integration bloatview runs on debug builds for many of the test suites mozilla has running under continuous integration. if a new leak occurs, it will trigger a test job failure. bloatview's output file can also show you where the leaked objects are allocated. to do so, the xpcom_...
JS::PerfMeasurement
created in that argument slot. the jsval you receive points to a javascript wrapper object. to extract the c++-level perfmeasurement object, call this function. it will return null if javascript passed in something with the wrong dynamic type. jsobject* js::registerperfmeasurement(jscontext* cx, jsobject* global) you shouldn't need to use this function, but we mention it for completeness. it
initializes the javascript wrapper interface for this api and pokes the constructor function into the global object you provide. ...
Power profiling overview
pts 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 measurements of it are determined in a non-instantaneous fashion, i.e. by dividing an energy amount by a non-inf
initesimal 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 energy, and the speed at which that stored energy is depleted depends on the power consumption of the mobile d...
Scroll-linked effects
this article discusses scroll-linked effects, their effect on performance, related tools, and possible mitigation techniques. scrolling effects explained often scrolling effects are implemented by listening for the scroll event and then updating elements on the page in some way (usually the css position or transform property.) you can find a sampling of such effects at css scroll api: use cases. these effects work well in browsers where the scrolling is done synchronously on the browser's main thread. ...
TimerFirings logging
indicates that the function timer lacks an explicit name, and the comment within the square brackets explains why the fallback mechanism wasn't used. if an unannotated timer function appears frequently it is worth explicitly annotating it so that it will be usefully identified on other platforms. (running on mac or linux is obviously necessary to learn the timer function's name.) this is done by
initializing it with
initwithnamedfunccallback or
initwithnameablefunccallback instead of
initwithnamecallback. post-processing timerfirings logging quickly produces thousands of lines of output. this output needs post-processing for it to be useful. if the output is redirected to a file called out, then the following command will pull out the timer-related lines, count how many times each unique li...
Productization guide
product the first one (provide users with useful and relevant content) is obvious: we want to improve our users’ experience on the web, so we provide a couple of well-thought suggestions for different services. for example, we ship firefox with 6 or 7 search engine plug-ins to make users’ lives easier when they’re looking for information, translation, products, multimedia, spelling and def
initions, etc. another example: when the user clicks on a mailto: link, we suggest a couple of possible handlers chosen from the applications installed on their computer. but we also suggest a few web-based clients (like yahoo! mail and gmail), so that if the user happens to use one of these in the browser, they don’t have to configure them. the second purpose (demonstrate certain features of the pr...
Firefox Sync
n and key management. all data is encrypted and decrypted on each device; no sync data is ever transmitted to a server without being encrypted. mozilla does not hold any keys to your sync data. your data can only be decrypted by someone who is able to log in to your firefox account (ie, that knows your firefox accounts password and has access to your email for the verification required during the
initial login). documentation this document serves as an index for all technical documentation related to sync. it is not designed for use by end-users, but instead for people who wish to understand the details of how sync is implemented or wish to interact with it. general the always prolific richard newman has written a couple of notes about bookmark syncing (first, second) and has a blog where ...
L20n HTML Bindings
m elements, but only modifies their text nodes and their attributes. this makes it possible to use l20n in conjunction with mvc frameworks. when all dom nodes are localized, the document element will fire a documentlocalized event, which you can listen to: document.addeventlistener('documentlocalized', function() { // the dom has been localized and the user sees it in their language yourapp.
init(); }); exposing context data you can expose important bits of data to the localization context in form of context data. <script type="application/l10n-data+json"> { "newnotifications": 3, "user": { "name": "jane", "gender": "feminine" } } </script> this data will be available context-wide to all localized strings. for instance, a string could use the information about the use...
About NSPR
regard to whether the addressing technology is ipv4 or ipv6. time timing facilities are available in two forms: interval timing and calendar functions. interval timers are based on a free running, 32-bit, platform dependent resolution timer. such timers are normally used to specify timeouts on i/o, waiting on condition variables and other rudimentary thread scheduling. since these timers have f
inite namespace and are free running, they can wrap at any time. nspr does not provide an epoch , but expects clients to deal with that issue. the granularity of the timers is guaranteed to be between 10 microseconds and 1 millisecond. this allows a minimal timer period in of approximately 12 hours. but in order to deal with the wrap-around issue, only half that namespace may be utilized. therefore, t...
NSPR's Position On Abrupt Thread Termination
admit it isn't much fun either). the implementation of either strategy within the nspr runtime is not difficult. that is not what this memo is about. this is about providing an api that coaxes people to do the right thing in as many ways as possible. the existence of exit() in the unix/c environment is a perfect example of how programmers will employ the most expediant solution available. the def
inition of the language c is such that returning from main() is a perfectly fine thing to do. but what percentage of c programs actually bother? in unix, with its complex def
inition of a protection domain, it happens to work (one might even say it's more efficient) to exit from anywhere. but threads are not processes. if threads have to maintain the same type of resource knowledge as a process, they l...
Date and Time
prtime prtimeparameters prexplodedtime time parameter callback functions in some geographic locations, use of daylight saving time (dst) and the rule for determining the dates on which dst starts and ends have changed a few times. therefore, a callback function is used to determine time zone information. you can define your own time parameter callback functions, which must conform to the def
inition prtimeparamfn. two often-used callback functions of this type are provided by nspr: prtimeparamfn pr_localtimeparameters and pr_gmtparameters functions the functions that create and manipulate time and date values are: pr_now pr_explodetime pr_implodetime pr_normalizetime ...
Interval Timing
ion variables. nspr 2.0 provides interval times that are efficient in terms of performance and storage requirements. conceptually, they are based on free-running counters that increment at a fixed rate without possibility of outside influence (as might be observed if one was using a time-of-day clock that gets reset due to some administrative action). the counters have no fixed epoch and have a f
inite period. to make use of these counters, the application must declare a point in time, the epoch, and an amount of time elapsed since that epoch, the interval. in almost all cases the epoch is defined as the value of the interval timer at the time it was sampled. printervaltime interval functions interval timing functions are divided into three groups: getting the current interval and tic...
NSPR Error Handling
is locked. pr_no_more_files_error there are no more entries in the directory. pr_end_of_file_error unexpectedly encountered end of file (mac os only). pr_file_seek_error an unexpected seek error (mac os only). pr_file_is_busy_error the file is busy and the operation cannot be performed. pr_in_progress_error the operation is still in progress (probably a nonblocking connect). pr_already_
initiated_error the (retried) operation has already been
initiated (probably a nonblocking connect). pr_group_empty_error the wait group is empty. pr_invalid_state_error the attempted operation is on an object that was in an improper state to perform the request. pr_max_error placeholder for the end of the list. ...
PRCallOnceFN
defines the signature of the function a client must implement. syntax #include <pr
init.h> typedef prstatus (pr_callback *prcalloncefn)(void); description the function is called to perform the
initialization desired. the function is expected to return a prstatus indicating the outcome of the process. ...
PRCallOnceType
structure for tracking
initialization. syntax #include <pr
init.h> typedef struct prcalloncetype { printn
initialized; print32 inprogress; prstatus status; } prcalloncetype; fields the structure has these fields:
initialized if not zero, the
initialization process has been completed. inprogress if not zero, the
initialization process is currently being executed. calling threads that observe this status block until inprogress is zero. status an indication of the outcome of the
initialization process. description the client is responsible for
initializing the prcalloncetype structure to all zeros. this
initialization must be accomplished before any threading issues exist. ...
PRFileInfo
ucture used with pr_getfileinfo and pr_getopenfileinfo. syntax #include <prio.h> struct prfileinfo { prfiletype type; pruint32 size; prtime creationtime; prtime modifytime; }; typedef struct prfileinfo prfileinfo; fields the structure has the following fields: type type of file. see prfiletype. size size, in bytes, of file's contents. creationtime creation time per def
inition of prtime. see prtime.h. modifytime last modification time per def
inition of prtime. see prtime.h. description the prfileinfo structure provides information about a file, a directory, or some other kind of file system object, as specified by the type field. ...
NSS_3.12.1_release_notes.html
bug 439123: assertion failure in libpkix at shutdown bug 440062: incorrect list element count in pkix_list_appenditem function bug 442618: eliminate dead function cert_certpackagetype bug 443755: extra semic...
NSS_3.12.2_release_notes.html
bug 432260: [[@ pkix_pl_httpdefaultclient_hdrcheckcomplete - pkix_pl_memcpy] crashes when there is no content-length header in the http response bug 436599: pkix: aia extension is not used in some bridge ca / known certs configuration bug 437804: certutil -r for cert renewal should derive the...
NSS 3.14.1 release notes
ocspsuccessresponse 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 authenticating with such tokens, it was possible for an internal lock to be acquired twice, causing a hang. this hang has been fixed in nss 3.14.1. bug 802429 - in previous versions of nss, the "ci...
NSS 3.14.2 release notes
ges please visit /docs/nss new in nss 3.14.2 nss will now make use of the intel aes-ni and avx instruction sets for hardware-accelerated aes-gcm on 64-bit linux systems. note: the new assembly code requires gnu as version 2.19 or newer. on red hat enterprise linux 5.x systems, install the binutils220 package and add /usr/libexec/binutils220 to the beginning of your path environment variable.
initial manual pages for some nss command line tools have been added. they are still under review, and contributions are welcome. the documentation is in the docbook format and can be rendered as html and unix-style manual pages using an optional build target. new types: in certt.h cert_pi_useonlytrustanchors in secoidt.h sec_oid_ms_ext_key_usage_ctl_signing ...
NSS 3.14.3 release notes
would like to thank nadhem alfardan and kenny patterson (royal holloway, university of london) for responsibly disclosing the issue by providing advance copies of their research. in addition, thanks to adam langley (google) for the development of a mitigation for the issues raised in the paper, along with emilia kasper and bodo möller (google) for assisting in the review and improvements to the
initial patches. bugs fixed in nss 3.14.3 https://bugzilla.mozilla.org/buglist.cgi?list_id=5689256;resolution=fixed;classification=components;query_format=advanced;target_milestone=3.14.3;product=nss compatibility nss 3.14.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.14.3 shared librari...
NSS 3.14.4 release notes
spr 4.9.5 or newer. nss 3.14.4 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_14_4_rtm/src/ security advisories the following security-relevant bugs have been resolved in nss 3.14.4. users are encouraged to upgrade immediately. bug 894370 - (cve-2013-1739) avoid un
initialized data read in the event of a decryption failure. new in nss 3.14.4 new functionality no new major functionality is introduced in this release. this release is a patch release to address cve-2013-1739. bugs fixed in nss 3.14.4 https://bugzilla.mozilla.org/buglist.cgi?bug_id=894370%2c832942%2c863947&bug_id_type=anyexact&list_id=8338081&resolution=fixed&classification=components&query_...
NSS 3.15.1 release notes
lextensiontype enum type. new pkcs #11 mechanisms none. notable changes in nss 3.15.1 bug 856060 - enforce name constraints on the common name in libpkix when no subjectaltname is present. bug 875156 - add const to the function arguments of sec_certnicknameconflict. bug 877798 - fix ssltap to print the certificate_status handshake message correctly. bug 882829 - on windows, nss
initialization fails if nss cannot call the rtlgenrandom function. bug 875601 - secmod_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 ...
NSS 3.15.2 release notes
ibution information nss 3.15.2 source distributions are also available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_15_2_rtm/src/ security advisories the following security-relevant bugs have been resolved in nss 3.15.2. users are encouraged to upgrade immediately. bug 894370 - (cve-2013-1739) avoid un
initialized data read in the event of a decryption failure. new in nss 3.15.2 new functionality aes-gcm ciphersuites: aes-gcm cipher suite (rfc 5288 and rfc 5289) support has been added when tls 1.2 is negotiated. specifically, the following cipher suites are now supported: tls_ecdhe_ecdsa_with_aes_128_gcm_sha256 tls_ecdhe_rsa_with_aes_128_gcm_sha256 tls_dhe_rsa_with_aes_128...
NSS 3.18 release notes
ficate found in a sec_pkcs12decodercontext. in pk11pub.h __pk11_setcertificatenickname - this is an internal symbol for nss use only, as with all exported nss symbols that have a leading underscore '_'. applications that use or depend on these symbols can and will break in future nss releases. new types in p12.h sec_pkcs12nicknamerenamecallback - a function pointer def
inition. an application that uses sec_pkcs12decoderrenamecertnicknames must implement a callback function that implements this function interface. notable changes in nss 3.18 the highest tls protocol version enabled by default has been increased from tls 1.0 to tls 1.2. similarly, the highest dtls protocol version enabled by default has been increased from dtls 1.0 to dtls 1.2. the default ...
NSS 3.19.1 release notes
rmation the hg tag is nss_3_19_1_rtm. nss 3.19.1 requires nspr 4.10.8 or newer. nss 3.19.1 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_1_rtm/src/ security fixes in nss 3.19.1 bug 1138554 / cve-2015-4000 - the minimum strength of keys that libssl will accept for f
inite field algorithms (rsa, diffie-hellman, and dsa) have been increased to 1023 bits. new in nss 3.19.1 new functionality no new functionality is introduced in this release. this patch release includes a fix for the recently published logjam attack. notable changes in nss 3.19.1 nss reports the bit length of keys more accurately. thus, the seckey_publickeystrength and seckey_publickeystreng...
NSS 3.20 release notes
d: tls_dhe_dss_with_aes_128_gcm_sha256 tls_dhe_dss_with_aes_128_cbc_sha256 tls_dhe_dss_with_aes_256_cbc_sha256 by default, the server side tls implementation will use dhe parameters with a size of 2048 bits when using dhe ciphersuites. nss embeds fixed dhe parameters sized 2048, 3072, 4096, 6144 and 8192 bits, which were copied from version 08 of the internet-draft "negotiated f
inite field diffie-hellman ephemeral parameters for tls", appendix a. a new api ssl_dhegroupprefset has been added to nss, which allows a server application to select one or multiple of the embedded dhe parameters as the preferred parameters. the current implementation of nss will always use the first entry in the array that is passed as a parameter to the ssl_dhegroupprefset api. in future versions ...
NSS 3.28.3 release notes
ectly through ecpublickey, ecprivatekey, nsslowkeypublickey, nsslowkeyprivatekey, or potentially other data structures that reference ecparams. the change has been reverted to the original state in bug 1334108. seckeyecpublickey had been extended with a new attribute, named "encoding". if an application passed type seckeyecpublickey to nss (as part of seckeypublickey), the nss library read the un
initialized attribute. with this nss release seckeyecpublickey.encoding is deprecated. nss no longer reads the attribute, and will always set it to ecpoint_undefined. see bug 1340103. compatibility nss 3.28.3 shared libraries are backward compatible with most older nss 3.x shared libraries, but depending on your application, may be incompatible, if you application has been compiled against header fi...
NSS 3.28.5 release notes
ires nspr 4.13.1 or newer. nss 3.28.5 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_28_5_rtm/src/ new in nss 3.28.5 no new functionality is introduced in this release. this is a patch release to update the list of root ca certificates. it backports the changes that were
initially released in nss version 3.30.2. notable changes in nss 3.28.5 the following ca certificates were removed: o = japanese government, ou = applicationca sha-256 fingerprint: 2d:47:43:7d:e1:79:51:21:5a:12:f3:c5:8e:51:c7:29:a5:80:26:ef:1f:cc:0a:5f:b3:d9:dc:01:2f:60:0d:19 cn = wellssecure public root certificate authority sha-256 fingerprint: a7:12:72:ae:...
NSS 3.28 release notes
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 def
inition 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 with p-256 ecdsa certificates, sha-384 with p-384 certificates, and sha-512 with p-521 certificates. sha-1 is permitted (in tls 1.2 only) with a...
NSS 3.29.1 release notes
ectly through ecpublickey, ecprivatekey, nsslowkeypublickey, nsslowkeyprivatekey, or potentially other data structures that reference ecparams. the change has been reverted to the original state in bug 1334108. seckeyecpublickey had been extended with a new attribute, named "encoding". if an application passed type seckeyecpublickey to nss (as part of seckeypublickey), the nss library read the un
initialized attribute. with this nss release seckeyecpublickey.encoding is deprecated. nss no longer reads the attribute, and will always set it to ecpoint_undefined. see bug 1340103. note that nss 3.28.3 from the older nss 3.28.x branch has also been released with the identical fixes. compatibility nss 3.29.1 shared libraries are backward compatible with most older nss 3.x shared libraries, but de...
NSS 3.29.3 release notes
tion the hg tag is nss_3_29_3_rtm. nss 3.29.3 requires nspr 4.13.1 or newer. nss 3.29.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_29_3_rtm/src/ new in nss 3.29.3 no new functionality is introduced in this release. notable changes in nss 3.29.3 a rare crash when
initializing an ssl socket fails has been fixed. bugs fixed in nss 3.29.3 bug 1342358 - crash in tls13_destroykeyshares compatibility nss 3.29.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.29.3 shared libraries without recompiling or relinking. furthermore, applications that restrict th...
NSS 3.33 release notes
lag 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 fixes. new in nss 3.33 new functionality when listing an nss database, using certutil -l, and the database hasn't yet been
initialized with any non-empty or empty password, the text "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 p...
NSS 3.34 release notes
:c2:c9:e5:1d:09:03:ee:94:6b:02:c3:01:58:1e:d9:9e:16 cn = ca wosign ecc root sha-256 fingerprint: 8b:45:da:1c:06:f7:91:eb:0c:ab:f2:6b:e5:88:f5:fb:23:16:5c:2e:61:4b:f8:85:56:2d:0d:ce:50:b2:9b:02 libfreebl no longer requires sse2 instructions. new in nss 3.34 new functionality when listing an nss database. using certutil -l, and the database hasn't yet been
initialized with any non-empty or empty password, the text "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. sslkeylogfile is now supported with tls 1.3, see bug 1287711 for details. sslchannelinfo has two new fields (bug 1396525) sslnamedgroup originalke...
NSS 3.44 release notes
rballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_44_rtm/src/ other releases are available in nss releases. new in nss 3.44 new functionality new functions in lib/certdb/cert.h cert_getcertificateder - access the der-encoded form of a certcertificate. notable changes in nss 3.44 it is now possible to build nss as a static library (bug 1543545)
initial support for building for ios. bugs fixed in nss 3.44 1501542 - implement checkarmsupport for android 1531244 - use __builtin_bswap64 in crypto_primitives.h 1533216 - cert_decodecertpackage() crash with netscape certificate sequences 1533616 - sdb_getattributevaluenolock should make at most one sql query, rather than one for each attribute 1531236 - provide accessor for certcertificate...
NSS 3.45 release notes
nding certificates 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. 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. certificate authority changes the following ca certificates were removed: bug 1552374 - cn = certi...
NSS 3.47.1 release notes
zilla.org/security/nss/releases/nss_3_47_1_rtm/src/ other releases are available in nss releases. new in nss 3.47.1 no new functionality is introduced in this release. bugs fixed in nss 3.47.1 cve-2019-11745 - encryptupdate should use maxout, not block size bug 1590495 - fix a crash that could be caused by client certificates during startup bug 1589810 - fix compile-time warnings from un
initialized variables in a perl script this bugzilla query returns all the bugs fixed in nss 3.47: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.47 compatibility nss 3.47.1 shared libraries are backward compatible with all older nss 3.x shared libraries. a program linked with older nss 3.x shared libraries ...
NSS 3.47 release notes
resented in clienthello bug 1570501 - add cmac to freebl and pkcs #11 libraries bugs fixed in nss 3.47 bug 1459141 - make softoken cbc padding removal constant time bug 1589120 - more cbc padding tests bug 1465613 - add ability to distrust certificates issued after a certain date for a specified root cert bug 1588557 - bad debug statement in tls13con.c bug 1579060 - mozilla::pkix tag def
initions for issueruniqueid and subjectuniqueid shouldn't have the constructed bit set bug 1583068 - nss 3.47 should pick up fix from bug 1575821 (nspr 4.23) bug 1152625 - support aes hw acceleration on armv8 bug 1549225 - disable dsa signature schemes for tls 1.3 bug 1586947 - pk11_importandreturnprivatekey does not store nickname for ec keys bug 1586456 - unnecessary conditional in pki3hack, pk...
NSS 3.48 release notes
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-un
initialized 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 un
initialized 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 3.48: https://bu...
NSS 3.54 release notes
emove 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 inf
inite recursion building nss. bug 1642638 - fix fuzzing assertion crash. bug 1642871 - enable ssl_sendsessionticket after resumption. bug 1643123 - support ssl_exportearlykeyingmaterial with external psks. bug 1643557 - fix numerous compile warnings in nss. bug 1644774 - ssl gtests to use clearservercache when resetting self-encrypt keys. bug 1645479 - don't use secitem_makeitem in secutil.c. b...
NSS 3.55 release notes
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 when compiled with nss_disable_deprecated_seed. bug 1646594 - fix avx2 detection 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 t...
NSS Sample Code sample2
argc, char **argv) { ck_mechanism_type ciphermech; pk11slotinfo* slot = null; pk11symkey* symkey = null; secitem* secparam = null; pk11context* enccontext = null; secitem keyitem, ivitem; secstatus rv, rv1, rv2; unsigned char data[1024], buf1[1024], buf2[1024]; int i, result_len, tmp1_outlen, tmp2_outlen; /*
initialize nss * if your application code has already
initialized nss, you can skip it * here. * this code uses the simplest of the
init functions, which does not * require a nss database to exist */ rv = nss_nodb_
init("."); if (rv != secsuccess) { fprintf(stderr, "nss
initialization failed (err %d)\n", pr_geterror()); goto out; } /* choose mechanism: ckm_...
New NSS Samples
ographic operations, certificate handling, ssl, etc. it also demonstrates some best practices in the application of cryptography. these new examples are a work in progress. ...
Notes on TLS - SSL 3.0 Intolerant Servers
re is an upgraded version which fixes the problem, it is indicated by an asterisked remark in the parentheses. ) domino-go-webserver/4.6.2.6 (and perhaps some later versions) ibm_http_server/1.3.6.3 or earlier (* update to 1.3.6.4) ibm_http_server/1.3.12.1 or earlier (* update to 1.3.12.2) java web server 2 osu/3.2 - decthreads http server for openvm stronghold/2.2 webmail v. 3.6.1 by inf
inite technologies (* update available) n.b. there might be servers other than those listed above which exhibit this problem. if you find such a server, feel free to add it to this page. for up-to-date information, you can read this bug 59321 which keeps a list of tls/ssl 3.0 intolerant servers. users: how to avoid this problem? netscape 6.1 preview release 1, or mozilla 0.9.1 and earlier these v...
FC_DecryptDigestUpdate
ssion handle. pencryptedpart [in] pointer to the encrypted data part. ulencryptedpartlen [in] length of encrypted data in bytes. ppart [in] pointer to the location which receives the recovered data part or null. pulpartlen [in] pointer to the length of the recovered part buffer. description fc_decryptdigestupdate continues a multi-part decrypt and digest operation. after calling both fc_decrypt
init and fc_digest
init to set up the operations this function may be called multiple times. the operation is finished by calls to fc_digestfinal and fc_decryptfinal. a user must log into the token (to assume the nss user role) before calling fc_decryptdigestupdate. return value examples see also nsc_decryptdigestupdate ...
FC_DecryptVerifyUpdate
ddata [in] pointer to the encrypted data part. ulencrypteddatalen [in] length of encrypted data in bytes. pdata [in] pointer to the location which receives the recovered data part or null. puldatalen [in] pointer to the length of the recovered part buffer. description fc_decryptverifyupdate continues a multi-part decryption and and signature verification operation. after calling both fc_decrypt
init and fc_verify
init to set up the operations this function may be called multiple times. the operation is finished by calls to fc_decryptfinal and fc_verifyfinal. a user must log into the token (to assume the nss user role) before calling fc_decryptverifyupdate. return value examples see also nsc_decryptverifyupdate ...
FC_DigestEncryptUpdate
on [in] session handle. ppart [in] pointer to the data part. ulpartlen [in] length of data in bytes. pencryptedpart [in] pointer to the location which receives the digested and encrypted part or null. pulencryptedpartlen [in] pointer to the length of the encrypted part buffer. description fc_digestencryptupdate continues a multi-part digest and encryption operation. after calling both fc_digest
init and fc_encrypt
init to set up the operations this function may be called multiple times. the operation is finished by calls to fc_digestfinal and fc_encryptfinal in that order. a user must log into the token (to assume the nss user role) before calling fc_digestencryptupdate. return value examples see also nsc_digestencryptupdate ...
FC_DigestFinal
fc_digestfinal finishes a multi-part digest operation by returning the complete digest and clearing the operation context. if pdigest is null the length of the digest is returned and fc_digestfinal may be called again with pdigest set to retrieve the digest. a user may call fc_digestfinal without logging into the token (to assume the nss user role). return value examples see also fc_digest
init, nsc_digestfinal ...
FC_EncryptFinal
t encrypted data part, if any puslastencryptedpartlen [in,out] pointer to location where the number of bytes of the last encrypted data part is to be stored. description fc_encryptfinal returns the last block of data of a multi-part encryption operation. a user must log into the token (to assume the nss user role) before calling fc_encryptfinal. return value examples see also fc_encrypt
init, nsc_encryptfinal ...
FC_GetInfo
padded with spaces to 32 characters and not null-terminated. libraryversion: pkcs #11 library version number, for example, 3.11 (major=0x03, minor=0x0b). a user may call fc_getinfo without logging into the token (to assume the nss user role). return value fc_getinfo always returns ckr_ok. fc_getinfo should return ckr_arguments_bad if pinfo is null. fc_getinfo should return ckr_cryptoki_not_
initialized if the library is not
initialized. examples note the use of the %.32s format string to print the manufacturerid and librarydescription members of the ck_info structure. #include <assert.h> #include <stdio.h> ck_function_list_ptr pfunctionlist; ck_rv crv; ck_info info; crv = fc_getfunctionlist(&pfunctionlist); assert(crv == ckr_ok); ... /* invoke fc_getinfo as pfunctionlist->c_geti...
FC_SeedRandom
rator. syntax ck_rv fc_seedrandom( ck_session_handle hsession, ck_byte_ptr pseed, ck_ulong usseedlen ); parameters hsession [in] session handle. pseed [in] pointer to the seed material usseedlen [in] length of the seed material in bytes. description fc_seedrandom() mixes additional seed material into the token's random number generator. note that fc_seedrandom() doesn't provide the
initial seed material for the random number generator. the
initial seed material is provided by the nss cryptographic module itself. a user may call fc_seedrandom() without logging into the token (to assume the nss user role). return value examples see also nsc_seedrandom ...
FC_SignEncryptUpdate
[in] session handle. ppart [in] pointer to the data part. ulpartlen [in] length of data in bytes. pencryptedpart [in] pointer to the location which receives the signed and encrypted data part or null. pulencryptedpartlen [in] pointer to the length of the encrypted part buffer. description fc_signencryptupdate continues a multi-part signature and encryption operation. after calling both fc_sign
init and fc_encrypt
init to set up the operations this function may be called multiple times. the operation is finished by calls to fc_signfinal and fc_encryptfinal. a user must log into the token (to assume the nss user role) before calling fc_signencryptupdate. return value examples see also nsc_signencryptupdate ...
FC_SignUpdate
signed. uspartlen [in] length of data block in bytes. ...
FC_Verify
ssignaturelen [in] length of the signature in bytes. description fc_verify verifies a signature in a single-part operation, where the signature is an appendix to the data. a user must log into the token (to assume the nss user role) before calling fc_verify. return value ckr_ok is returned on success. ckr_signature_invalid is returned for signature mismatch. examples see also fc_verify
init, nsc_verify ...
NSPR functions
nspr is a platform abstraction library that provides a cross-platform api to common os services. nss uses nspr internally as the porting layer. however, a small number of nspr functions are required for using the certificate verification and ssl functions in nss. these nspr functions are listed in this section. nspr
initialization and shutdown nspr is automatically
initialized by the first nspr function called by the application. call pr_cleanup to shut down nspr and clean up its resources. pr_cleanup error reporting nss uses nspr's thread-specific error code to report errors. call pr_geterror to get the error code of the last failed nss or nspr function. call pr_seterror to set the error code, which can be retrieved with pr_geterror later. the nss functions port_geterror and ...
NSS Key Functions
this chapter describes two functions used to manipulate private keys and key databases such as the key3.db database provided with nss. this was converted from "chapter 6: key functions". back to the nss reference main page. seckey_getdefaultkeydb seckey_destroyprivatekey seckey_getdefaultkeydb returns a handle to the default key database opened by nss_
init. syntax include <key.h> include <keyt.h> seckeykeydbhandle *seckey_getdefaultkeydb(void); returns the function returns a handle of type seckeykeydbhandle. description nss_
init opens the certificate, key, and security module databases that you specify for use with nss. seckeykeydbhandle returns a handle to the key database opened by nss_
init. seckey_destroyprivatekey destroys a private key structure. syntax include <...
NSS tools : crlutil
name crlutil — list, generate, modify, or delete crls within the nss security database file(s) and list, create, modify or delete certificates entries in a particular crl. synopsis crlutil [options] [[arguments]] status this documentation is still work in progress. please contribute to the
initial review in mozilla nss bug 836477[1] description the certificate revocation list (crl) management tool, crlutil, is a command-line utility that can list, generate, modify, or delete crls within the nss security database file(s) and list, create, modify or delete certificates entries in a particular crl. the key and certificate management process generally begins with creating keys in the key database, then generating and managing certificates in the certificate database(see ce...
pkfnc.html
rse of an ssl operation, it may be necessary for the user to log in to a pkcs #11 token (either a smart card or soft token) to access protected information, such as a private key. such information is protected with a password that can be retrieved by calling an application-supplied callback function. the callback function is identified in a call to pk11_setpasswordfunc that takes place during nss
initialization. the callback function set up by pk11_setpasswordfunc has the following prototype: typedef char *(*pk11passwordfunc)( pk11slotinfo *slot, prbool retry, void *arg); this callback function has the following parameters: slot a pointer to a slot info structure. retry set to pr_...
sslkey.html
raded documentation may be found in the current nss reference key functions chapter 6 key functions this chapter describes two functions used to manipulate private keys and key databases such as the key3.db database provided with communicator. seckey_getdefaultkeydb seckey_destroyprivatekey seckey_getdefaultkeydb returns a handle to the default key database opened by nss_
init. syntax #include <key.h> #include <keyt.h> seckeykeydbhandle *seckey_getdefaultkeydb(void); returns the function returns a handle of type seckeykeydbhandle. description nss_
init opens the certificate, key, and security module databases that you specify for use with nss. seckeykeydbhandle returns a handle to the key database opened by nss_
init. seckey_destroyprivatekey destroys a p...
SSL functions
the nss_reference documents the functions most commonly used by applications to support ssl. the nss home page links to additional ssl documentation. if documentation is available for a function listed below, the function name is linked to either its mdc wiki page or its entry in the old ssl reference. the mozilla cross reference (dxr) link for each function provides access to the function def
inition, prototype def
inition, and source code references. the nss version column indicates which versions of nss support the function. function name/documentation source code nss versions nss_getclientauthdata mxr 3.2 and later nss_setdomesticpolicy mxr 3.2 and later nss_setexportpolicy mxr 3.2 and later nss_setfrancepolicy mx...
NSS Tools
or questions, please feel free to post to mozilla.dev.tech.crypto. this newsgroup is the preferred forum for all questions about nss and nss tools. overall objectives provide a tool for analyzing and repairing certificate databases (dbck). migrate tools from secutil.h interface to pkcs #11 interface. eliminate redundant functionality in tools. many tools implement private versions of pkcs11
init(), opencertdb(), etc. eliminate use of getopt() and replace with nspr calls to get command options (to eliminate platform dependencies with getopt()). tools information tool description links certutil 2.0 manage certificate and key databases (cert7.db and key3.db). source, documentation, tasks/plans cmsutil 1.0 performs basic cms operations such as e...
modutil-tasks.html
nss security tools: modutil tasks newsgroup: mozilla.dev.tech.crypto task list the jar installation script is very fragile with respect to platform def
initions (especially version numbers). a fix was made for "hpux b.11.00," but issues may still arise for platforms like "linux 2.2.12-20." documentation needs to be explicit about the use of fo ...
NSS Tools certutil-tasks
e imminent (????) encryption key for password files). support importing keys from a file. improve hardware token support. (bugfix) some certificate extensions cause certutil to crash. (bugfix) certificate entries require a serial number; one should be generated automatically if not provided. (bugfix) null password is given to new key3.db; should prompt user for an
initial password. (bugfix) listing provate keys does not work: requires password authentication. (bugfix) listing certificate extensions has typos and does not provide much information. ...
NSS Tools modutil-tasks
nss security tools: modutil tasks newsgroup: mozilla.dev.tech.crypto task list the jar installation script is very fragile with respect to platform def
initions (especially version numbers). a fix was made for "hpux b.11.00," but issues may still arise for platforms like "linux 2.2.12-20." documentation needs to be explicit about the use of fo ...
NSS tools : signtool
that issue object-signing certificates. you must also have a certificate for the ca that issues your signing certificate before you can sign files. if the certificate authority's certificate isn't already installed in your copy of communicator, you typically install it by clicking the appropriate link on the certificate authority's web site, for example on the page from which you
initiated enrollment for your signing certificate. this is the case for some test certificates, as well as certificates issued by netscape certificate management system: you must download the the ca certificate in addition to obtaining your own signing certificate. ca certificates for several certificate authorities are preinstalled in the communicator certificate database. when ...
Necko Interfaces Overview
an uri, with getters and setters for various uri parts (eg. scheme, host, path, ...) per protocol implementation necko provides uri impl's for common uri formats (see nsstandardurl, nssimpleuri) nsichannel : nsirequest represents a logical connection to the resource identified by a nsiuri per protocol implementation single use (ie. channel is used to download the resource once) download
initiated via nsichannel::asyncopen method can be canceled via nsirequest::cancel method at anytime after invocation of asyncopen method nsiprotocolhandler a service that manages a protocol, identified by it's uri scheme (eg. http) maps uri string to nsiuri instance via newuri method creates nsichannel instance from nsiuri instance via newchannel method nsistreamlistener : nsirequestobserver ...
Installing Pork
$ export path=/builds/gcc-3.4.6-installed/bin:$path $ export cppflags=-m32 $ cc=gcc34 cxx=g++34 cppflags=-m32 ldflags=-m32 ../src/configure --enable-replace-cpp --prefix=/builds/gcc-3.4.6-installed --target=i686-pc-linux $ make $ make install program_transform_name= ...
Pork Tools
<caption>rewrites performed</caption> nsresult getter(nsifoo **aresult) { *aresult = ... if (!*aresult) return ns_error_failure; return ns_ok; } nsifoo* getter() { nsifoo *result = null; // aresult below is kept for complicated cases // typically it wont be needed and can be removed nsifoo **aresult = &result; // *aresult patterns are replaced with result result = ... ...
Rhino downloads archive
if you would like to use e4x you need to add xbean.jar from xmlbeans distribution to your class path. in rhino 1.6r6 and later the e4x support has been rewritten to rely solely on the dom3 apis supported natively by java 1.5. (pre-java 1.5 users can use dom3 using java's endorsed standards ov...
Rhino overview
or more information on the standard, and rhino version 1.6r1 release notes for details on the implementation in rhino. in addition, rhino has implemented javaadapters, which allows javascript to implement any java interface or extend any java class with a javascript object. see the enum.js example for more information. numerous books and tutorials on javascript are available. javascript: the def
initive guide is recommended, and contains a chapter on rhino. deprecated language features several language features introduced in javascript 1.2 are now deprecated. these features allow "computational reflection": that is, the ability for a script to determine and influence aspects of the way it is evaluated. these features are generally not broadly useful, yet they impose significant constraints ...
Performance Hints
} this is not equivalent code because the second version does not modify global variables result and i. however, if you don't intend for any other function to access these variables, then storing them globally is probably wrong anyway (what if you called another function that had a loop like the one in sum!). arrays use the forms of the array constructor that specify a size or take a list of
initial elements. for example, the code var a = new array(); for (var i=0; i < n; i++) a[i] = i; could be sped up by changing the constructor call to new array(n). a constructor call like that indicates to the runtime that a javascript array should be used for the first n entries of the array. similarly, new array("a", "b", "c") or ["a", "b", "c"] will cause a 3-element array to be allo...
Rhino requirements and limitations
requirements recent versions of rhino have only been tested with jdk 1.4 and greater. older versions support jdks as early as 1.1. to use the javaadapter feature or an optimization level of 0 or greater, rhino must be running under a security manager that allows the def
inition of class loaders. limitations liveconnect if a javaobject's field's name collides with that of a method, the value of that field is retrieved lazily, and can be counter-intuitively affected by later assignments: javaobj.fieldandmethod = 5; var field = javaobj.fieldandmethod; javaobj.fieldandmethod = 7; // now, field == 7 you can work around this by forcing the field value to be converted to a javascript type when you take its value: javaobj.fieldandmethod = 5; var field = javaobj.fieldandmethod + 0; // f...
Scripting Java
implementing java interfaces now that we can access java classes, create java objects, and access fields, methods, and properties of those objects, we have a great deal of power at our fingertips. however, there are a few instances where that is not enough: many apis in java work by providing interfaces that clients must implement. one example of this is the thread ...
Creating JavaScript jstest reftests
mascript. directory overview in the js/src/tests directory, there are a few important subdirectories. non262 tests the directory js/src/tests/non262/ should contain all tests of the following type: regressions of spidermonkey non-standard spidermonkey extensions to the javascript language test of "implementation-defined" details of the ecmascript standard for example, the exact def
inition of pi or some details of array sorting. you should not add tests of the following type: tests of the jit test of jit correctness belong 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 e...
64-bit Compatibility
irwriter::insimmptr() for pointer types or lirwriter::insimmword() for integral types. note that lirwriter::insimm() is always 32-bit. quad versus float internally, "quads" are 64-bit opaque values in nanojit. they can be either floating point values or integral values. to help form well-typed lir, there is a special opcode called lir_float which specifies that the associated constant value is def
initely floating-point. tracemonkey uses this to decide whether arbitrary constants in lir are pointers or doubles. you should never use lirwriter::insimmq() to inject a floating point value. use lirwriter::insimmf() instead. mucking with native integers in lir the following opcodes can be used to safely load, modify, and compare native integers. for such opcodes there are two forms, an "undecorated" ...
Statistics API
y describes how long each slice took and what work was done during the slice. each element of the slices array is an object with these fields: slice: integer - the slice index, starting at 0. pause: number (milliseconds) - the slice duration. when: number (milliseconds) - the time this slice started, relative to the first slice's start time. reason: string - a string describing the api that
initiated this gc slice. page_faults: integer - number of page faults incurred during the processing of this slice. start_timestamp: integer (microseconds) - time of slice start from epoch. end_timestamp: integer (microseconds) - time of slice end from epoch. times: object - a map from phase names to the total time taken by that phase during this slice. ...
JIT Optimization Outcomes
var x; return function () { x++; } } closes over x in f. cantinlineneedsargsobj unable to inline function call. the interpreted callee function requires an arguments object to be created. cantinlinedebuggee unable to inline function call. the interpreted callee function is being debugged by the debugger api. cantinlineunknownprops unable to inline function call. the engine knows nothing def
inite about the type of the callee function object. cantinlineunreachable unable to inline function call. the call site has not been observed to have ever been executed. it lacks observed type information for its arguments, its return value, or both. cantinlinebound unable to inline function call. the interpreted callee is a bound function generated from function.prototype.bind that failed some su...
JS::Add*Root
points each time the collector checks to see what memory is reachable. the garbage collector aggressively collects and recycles memory that it deems unreachable, so roots are often necessary to protect data from being prematurely collected. vp/rp is the address of a c/c++ variable (or field, or array element) of type js::value, jsstring *, jsobject *, or jsscript *. this variable must already be
initialized. (for example, it must not be an un
initialized local variable. that could cause sporadic crashes during garbage collection, which can be hard to debug.) the variable must remain in memory until the balancing call to js::remove*root. 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. if ...
JS::AutoValueArray
. description js::autovaluearray<n> holds a rooted array of js::value. this is typically used for local variables being passed to function which requires js::handlevaluearray or a pointer to js::value array. examples pass to function as a pointer to js::value. bool somefunction1(jscontext *cx, unsigned argc, const js::value *argv) { /* ... */ } js::autovaluearray<2> args(cx); /* ...
initialize args[0] and args[1] here ... */ somefunction1(cx, 2, args.begin()); pass to function as js::handlevaluearray. bool somefunction2(jscontext *cx, const js::handlevaluearray &args) { /* ... */ } js::autovaluearray<2> args(cx); /* ...
initialize args[0] and args[1] here ... */ somefunction2(cx, args); see also mxr id search for js::autovaluearray js::value js::handlevaluearray bug...
JS::CallArgs
is the individual function's responsibility to box the value if needed. js::value computethis(jscontext *cx) const returns the this value if this is an object, otherwise calls js_computethis and returns it. bool isconstructing() const returns true if the function is called via new. mutablehandlevalue rval() const returns the currently-set return value. the
initial contents of this value are unspecified. once this method has been called, callee() and calleev() can no longer be used. (if you're compiling against a debug build of spidermonkey, these methods will assert to aid debugging.) if the method you're implementing succeeds by returning true, you *must* set this. (spidermonkey doesn't currently assert this, but it will do so eventually.) you don...
JS::CompileOptions
itten out in the markup text as an attribute value). source belongs to a dom element if it was assigned to one of the element's event handler idl attributes as a string. (note that one may assign both strings and functions to dom elements' event handler idl attributes. if one assigns a function, that function's script's source does not belong to the dom element; the function's def
inition must appear elsewhere.) jsstring *elementattributename() const if this source belongs to a dom element because it is an event handler content attribute or an event handler idl attribute, this returns the name of that attribute, a string. otherwise, this returns null. jsscript *introductionscript() const returns a pointer to jsscript which introduces the file. ...
JS::Rooted
this article covers features introduced in spidermonkey 17 local variable of type t whose value is always rooted. syntax js::rooted<t> var(cx); js::rooted<t> var(cx,
initial); js::rooted<t> var(rt); js::rooted<t> var(rt,
initial); name type description cx jscontext * the context in which to add the root. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. rt jsruntime * the runtime in which to add the root.
initial t an
initial value for the rooted variable. methods here, ptr represents the private member of js::rooted<t>, typed with t. method description t &get() returns ptr. const t &get() const operator const t&() const ...
JSFastNative
obsolete since javascript 1.8.5this 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 1.8 jsfastnative is the type of fast native functions in the jsapi. apis such as js_
initclass and js_definefunctions can create custom methods that are implemented as c/c++ functions of this type, instead of jsnative. the term "native" here refers to c/c++ code as opposed to javascript code. added in spidermonkey 1.8.1 jsfastnative has been renamed to jsnative. syntax typedef jsbool (*jsfastnative)(jscontext *cx, unsigned int argc, jsval *vp); name type description cx jscontext * the context in which the fa...
JSNative
the term "native" here refers to c/c++ code as opposed to javascript code. syntax typedef bool (* jsnative)(jscontext *cx, unsigned argc, js::value *vp); name type description cx jscontext * the context in which the native function is being called. provides request. in js_threadsafe builds, the javascript engine calls this callback only from within an active request on cx. the callback does not need to call js_beginrequest()). ...
JSObjectOps.defineProperty
id, jsval value, jspropertyop getter, jspropertyop setter, unsigned int attrs); name type description cx jscontext * pointer to the js context in which the property is being defined. obj jsobject * the object on which the property is being defined. id jsid the name or index of the property to define. value jsval the
initial value for the new property. getter jspropertyop the getter for the new property. setter jspropertyop the setter for the new property. attrs unsigned int the property attributes for the new property. description define obj[id], an own property of obj named id, having the given
initial value, with the specified getter, setter, and attributes. ...
JSObjectOps.getRequiredSlot
setrequiredslotop. description get and set a required slot, one that should already have been allocated. these operations are infallible, so required slots must be pre-allocated, or implementations must suppress out-of-memory errors. the native ops (js_objectops, see js/src/jsobj.cpp) access slots reserved by including a call to the jsclass_has_reserved_slots(n) macro in the jsclass.flags
initializer. note: the slot parameter is a zero-based index into obj slots, unlike the index parameter to the js_getreservedslot and js_setreservedslot api entry points, which is a zero-based index into the jsclass_reserved_slots(clasp) reserved slots that come after the
initial well-known slots: proto, parent, class, and optionally, the private data slot. ...
JSPropertyOp
perty is called just after a new property is added to an object. this happens when a program sets a property that isn't already an own property of the target object. it also happens in jsapi functions such as js_defineproperty. on entry, *vp contains the value provided by the code defining or setting the property. the callback may modify *vp. on success, the post-callback value of *vp becomes the
initial stored value of the new property. in js_threadsafe builds, this callback is called with obj locked. it is therefore dangerous for the callback to call jsapi functions, particularly if obj may have been visible to more than one thread. jsclass.getproperty is the default getter for new properties. see the section on getters and setters above. jsclass.getproperty is also called when a...
JSPropertySpec
perty attributes. getter jsnativewrapper or selfhostedwrapper getter method for the property. setter jsnativewrapper or selfhostedwrapper setter method for the property. if a property is read-only, its setter is never called. description jspropertyspec defines the attributes for a single js property to associate with an object. pass to js_defineproperties or js_
initclass to create the properties and assign them to an object. to define an array of jspropertyspec, use js_psg, js_psgs, js_self_hosted_get, js_self_hosted_getset, and js_ps_end see also mxr id search for jspropertyspec jsfunctionspec jsnativewrapper js_defineproperties js_psg js_psgs js_self_hosted_get js_self_hosted_getset js_ps_end bug 766448 - changed type of getter and setter to wra...
JSReserveSlotsOp
ing a few internal classes such as function, call, and block). jsclass hooks jsclass offers the following hook: the jsclass.reserveslots callback is called each time a new object is created. the optional jsclass.reserveslots hook allows a class to make computed per-instance object slots reservations, in addition to or instead of using jsclass_has_reserved_slots(n) in the jsclass.flags
initializer to reserve a constant-per-class number of slots. implementations of this hook should return the number of slots to reserve, not including any reserved by using jsclass_has_reserved_slots(n) in jsclass.flags. see also jsclass ...
JS_Add*Root
tarting points each time the collector checks to see what memory is reachable. the garbage collector aggressively collects and recycles memory that it deems unreachable, so roots are often necessary to protect data from being prematurely collected. vp/spp/opp/rp is the address of a c/c++ variable (or field, or array element) of type jsstring *, jsobject *, or jsval. this variable must already be
initialized. (for example, it must not be an un
initialized local variable. that could cause sporadic crashes during garbage collection, which can be hard to debug.) the variable must remain in memory until the balancing call to js_removeroot. 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. if js_ad...
JS_CompareStrings
t is unchanged. this function imposes a total order on all javascript strings, the same order imposed by the javascript string comparison operators (<, <=, >, >=), as described in ecma 262-3 § 11.8.5. as the standard says: the comparison of strings uses a simple lexicographic ordering on sequences of code point value values. there is no attempt to use the more complex, semantically oriented def
initions of character or string equality and collating order defined in the unicode specification. therefore strings that are canonically equal according to the unicode standard could test as unequal. see also mxr id search for js_comparestrings js_convertvalue js_getstringchars js_getstringlength js_valuetostring ...
JS_ConvertArguments
s to ensure gc safety.) format const char * null-terminated string describing the types of the out parameters and how to convert the values in argv. ... void * out parameters. pointers to variables into which to store the converted values. there must be one pointer for each parameter described in format. variables for optional parameters must already be
initialized, because if an optional parameter is not in argv, js_convertarguments does not modify the corresponding variable. the variables do not need to be rooted. (if conversion creates a new gc thing, the corresponding jsval is written back to argv, which is rooted.) description js_convertarguments provides a convenient way to translate a series of js values into their corresponding js...
JS_DefineObject
e new property being defined. description js_defineobject creates a new object of the class clasp and assigns it to a new property of an existing object, obj. name is the property name to assign to obj to hold the new object, and flags contains the property attributes to set for the newly created property. the new object's parent is obj. js_defineobject does not call clasp->constructor.
initialization of the new object is up to the caller. on success, js_defineobject returns a pointer to the new object. on error or exception (if the object cannot be created, the property already exists, or the property cannot be created), js_defineobject returns null. this function combines two operations: creating an object and storing it in a property of another object. use js_constructobject, js...
JS_DefinePropertyWithTinyId
to create the new property. name const char * or const jschar * name for the property to create. namelen size_t (only in js_defineucpropertywithtinyid) the length of name in characters; or (size_t) -1 to indicate that name is null-terminated. tinyid int8 8-bit id to aid in sharing getter and setter callbacks among properties. value jsval
initial stored value for the new property. getter jspropertyop getproperty method for retrieving the current property value. setter jspropertyop setproperty method for specifying a new property value. attrs unsigned int property attributes. description js_definepropertywithtinyid defines an object property with a tiny id. js_defineucpropertywithtiny...
JS_DoubleIsInt32
ip int32_t * a pointer to int32_t value to compare description js_doubleisint32 returns true if d i sequal to *ip. (comment from mozilla::numberequalsint32) casting a floating-point value that doesn't truncate to int32_t, to int32_t, induces undefined behavior. we should def
initely fix this (bug 744965), but as apparently it "works" in practice, it's not a pressing concern now. see also mxr id search for js_doubleisint32 js_doubletoint32 js_doubletouint32 bug 631132 bug 744965 ...
JS_EnumerateStandardClasses
requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject an object to enumerate standard classes. ...
JS_ExecuteScript
must be in a request on this jscontext. obj js::handleobject the scope in which to execute the script. in the simplest cases, this should just be the embedding's global object. obsolete since jsapi 39 obj must not be an array, an e4x xml object, a with object, or a proxy. in ecmascript terms, the script is executed in a new execution context, but that context is not
initialized quite as described in any of the three cases in ecma 262-3 §10.2. instead: the scope chain is
initialized to contain obj, followed by its parent, then its parent's parent, etc. until null is reached. variable
initialization is performed. if the jsoption_varobjfix option is in effect (recommended), then the last object in the scope chain is used as the variable object. othe...
JS_ExecuteScriptVersion
s_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the scope in which to execute the script. in the simplest cases, this should just be the embedding's global object. obj must not be an array, an e4x xml object, a with object, or a proxy. in ecmascript terms, the script is executed in a new execution context, but that context is not
initialized quite as described in any of the three cases in ecma 262-3 §10.2. instead: the scope chain is
initialized to contain obj, followed by its parent, then its parent's parent, etc. until null is reached. variable
initialization is performed. if the jsoption_varobjfix option is in effect (recommended), then the last object in the scope chain is used as the variable object. othe...
JS_GetCompartmentPrivate
data void * (in js_setcompartmentprivate) pointer to application-defined data to be associated with the compartment. description each jscompartment has a field of type void * which the application may use for any purpose. it is especially useful for storing data needed by callbacks. js_getcompartmentprivate gets this field and js_setcompartmentprivate sets it. the field is
initially null. memory management for this private data is the application's responsibility. the javascript engine itself never uses it. see also mxr id search for js_setcompartmentprivate mxr id search for js_getcompartmentprivate js_getruntimeprivate js_setruntimeprivate js_getprivate js_setprivate js_getinstanceprivate js_getcontextprivate js_setcontextprivate js_getcontextprivate js...
JS_GetContextPrivate
ivate) pointer to application-defined data to be associated with the context cx. description each jscontext has two fields of type void * which the application may use for any purpose. they are especially useful for storing data needed by callbacks. js_getcontextprivate and js_getsecondcontextprivate get this field and js_setcontextprivate and js_setsecondcontextprivate set it. the field is
initially null. memory management for this private data is the application's responsibility. the javascript engine itself never uses it. see also mxr id search for js_getcontextprivate mxr id search for js_setcontextprivate mxr id search for js_getsecondcontextprivate mxr id search for js_setsecondcontextprivate js_getruntimeprivate js_setruntimeprivate js_getcompartmentprivate js_setcompartm...
JS_GetGCParameter
ezones 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 incremental gc slice. 0 for inf
inite. 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. when the gc is in "high freq...
JS_GetInstancePrivate
instance of clasp, this function reports a class mismatch error before returning null. ...
JS_GetPrivate
access the private data field of an object. syntax void * js_getprivate(jsobject *obj); name type description obj jsobject * an object whose jsclass has the jsclass_has_private flag. description js_getprivate accesses an object's private data field. obj must be an instance of a class that has the jsclass_has_private flag. new objects' private data fields are
initially null. if obj is a function object, as reported by js_objectisfunction, the private data is a pointer to a jsfunction. (but consider using js_valuetofunction instead to access it.) warning: it is dangerous to call js_getprivate on a jsobject * unless the object's jsclass is known. if the object is not of the expected jsclass, the result of js_getprivate would probably be null or a point...
JS_GetReservedSlot
0) or uint32_t, when non-javascript values must be stored; the garbage collector ignores such values when it sees them. (note that private values must not be exposed directly to javascript. it's only legal to store and retrieve data from private values. they cannot be returned from functions, set as properties on objects, embedded in javascript arrays, and so on.) new objects' reserved slots are
initialized to undefined. see also mxr id search for js_getreservedslot mxr id search for js_setreservedslot bug 1184564 -- changed jsval to js::value ...
JS_GetRuntimePrivate
a void * (in js_setruntimeprivate) pointer to application-defined data to be associated with the runtime rt. description each jsruntime has a field of type void * which the application may use for any purpose. it is especially useful for storing data which callbacks may then easily access. js_getruntimeprivate gets the value of this field and js_setruntimeprivate sets it. the field is
initially null. memory management for this private data is the application's responsibility. the javascript engine itself never uses it. see also mxr id search for js_getruntimeprivate js_getcontextprivate js_setcontextprivate js_getsecondcontextprivate js_setsecondcontextprivate js_getcompartmentprivate js_setcompartmentprivate js_getprivate js_setprivate js_getinstanceprivate ...
JS_GetVersion
t version number used within a specified executable script context. syntax jsversion js_getversion(jscontext *cx); name type description cx jscontext * the context to query. description js_getversion returns the javascript version currently used by the given jscontext, cx. the result is one of the jsversion constants. when a context is created, its version is
initially jsversion_default. scripts are compiled using the latest version of the javascript language. to configure a context to run scripts using a specific version of javascript, use js_setversion. see also mxr id search for js_getversion js_versiontostring js_stringtoversion js_setversionforcompartment ...
JS_IsConstructing
ption cx jscontext * the cx parameter passed to the jsnative. vp jsval * the vp parameter passed to the jsnative. description js_isconstructing must be called only from a jsnative called from the engine. cx and vp must be the arguments that the engine passed to that jsnative. js_isconstructing returns js_true if the native was defined with jsfun_constructor (js_
initclass automatically sets that flag when defining a constructor) and it was called as a constructor, either from javascript, using the new keyword, or from c/c++ using a jsapi function such as js_constructobject. otherwise it returns js_false. ordinary non-constructor jsnatives have no need to call this; it always returns js_false for such functions. many constructors do not need to call it either.
JS_LookupProperty
have as though the name appeared in an idiom like "if (obj.name) ..." or "obj.name ? ... : ...". objects may pretend that the property does not exist when this flag is set. for example, mozilla's document.all property is hidden in this way. jsresolve_declaring behave as though the name were being declared in a var, const, or function declaration. jsresolve_classname search for the
initial value of a standard class such as object, array, or error. do not automatically infer and enable other flags by looking at the currently executing bytecode. notes js_lookupproperty does not distinguish between a property with a value of undefined and a property that does not exist. use js_getpropertyattributes to distinguish these cases. js_lookupproperty differs from js_getproperty in that j...
JS_NewArrayObject
ded in spidermonkey 31 jsobject * js_newarrayobject(jscontext *cx, int length, jsval *vector); // obsolete since jsapi 30 name type description cx jscontext * the context in which to create the new array. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. contents js::handlevaluearray& reference to the
initial values for the array's elements. added in spidermonkey 31 length size_t or int the length of the new array. this must not be negative. vector jsval * pointer to the
initial values for the array's elements, or null. obsolete since jsapi 30 description js_newarrayobject with contents parameter creates a new array object with the specified contents elements. ...
JS_NewGlobalObject
his compartment. hookoption js::onnewglobalhookoption see debugger api hook added in spidermonkey 31 options const js::compartmentoptions & the option for new compartment (passed to jscompartment constructor). added in spidermonkey 31 description js_newglobalobject creates a new global object based on the specified class. the new object has no parent. it
initially has no prototype either, since it is typically the first object created; call js_
initstandardclasses to create all the standard objects, including object.prototype, and set the global object's prototype. the constructor clasp->construct is not called. on success, js_newglobalobject returns a pointer to the new object. otherwise it returns null. debugger api hook during global creation...
JS_SetArrayLength
escription js_setarraylength sets the .length property of an object obj. length indicates the number of elements. js_setarraylength(cx, obj, n) is exactly the same as setting the length property of obj to n using js_setproperty. this is true even if obj is not an array object. you can call js_setarraylength either to set the number of elements for an array object you created without specifying an
initial number of elements, or to change the number of elements allocated for an array. if you set a shorter array length on an existing array, the elements that no longer fit in the array are destroyed. setting the number of array elements does not
initialize those elements. to
initialize an element call js_defineelement. if you call js_setarraylength on an existing array, and length is less than the...
JS_SetContextCallback
ility the callback must do nothing and return true if any other value is passed. data void * data specified in js_setcontextcallback. added in spidermonkey 31 typedef enum jscontextop { jscontext_new, jscontext_destroy } jscontextop; enumeration meaning jscontext_new js_newcontext successfully created a new jscontext instance. the callback can
initialize the instance as required. if the callback returns js_false, the instance will be destroyed and js_newcontext returns null. in this case the callback is not called again. jscontext_destroy one of js_destroycontext, js_destroycontextnogc, or js_destroycontextmaybegc was called. the callback may perform its own cleanup and must always return true. in a debug build, if the callback ...
JS_SetGlobalObject
to have no global object. each context's global object is in the garbage collector's root set. this means that global objects are automatically protected from garbage collection, as are any values reachable from their properties. for full ecmascript standard compliance, obj should be of a jsclass that has the jsclass_global_flags flag. applications typically set a context's global object using js_
initstandardclasses instead. see the sample code at jsapi user guide. see also js_getglobalobject bug 899245 ...
JS_SetICUMemoryFunctions
n, js_icufreefn freefn); type description allocfn js_icuallocfn an allocation function. reallocfn js_icureallocfn a reallocation function. freefn js_icufreefn a free function. description js_seticumemoryfunctions sets the allocator functions used by the icu internationalization library. it must be called before js_
init. only use this function if you know what you are doing! mxr id search for js_seticumemoryfunctions. ...
JS_SetNativeStackQuota
ng embedders to keep higher-priority machinery running in the face of scripted stack exhaustion by something else. the stack quotas for each kind of code should be monotonically descending, and may be specified with this function. if 0 is passed for a given kind of code, it defaults to the value of the next-highest-priority kind. this function may only be called immediately after the runtime is
initialized and before any code is executed and/or interrupts requested. see also mxr id search for js_setnativestackquota js_settrustedprincipals bug 516832 bug 732665 bug 723021 ...
JS_SetProperty
read-only property or obj non-extensible, nothing happens, but this is not an error. in strict mode, a warning is issued. otherwise, if obj has an own property with the given name, then the existing property's value is set as described below. creation of new properties one of the cases above involves creating a new own property on obj. the name of the new property is given by name or id. the
initial stored value of the new property is undefined. its getter and setter are the jsclass.getproperty and setproperty hooks of obj's class, and its property attributes are exactly jsprop_enumerate. after the new property is added, the jsclass.addproperty hook is called with the arguments (cx, obj, id, &v). this hook may assign to v. if the hook succeeds and the property has a stored value, then the...
JS_SetPrototype
so. obj is a pointer to an existing js object, and proto is a pointer to second existing object upon which the first object is to be based. on success, js_setprototype returns true. otherwise it returns false. take care not to create a circularly-linked list of prototypes using this function, because such a set of prototypes cannot be resolved by the javascript engine and can easily lead to an inf
inite loop. to get an object's prototype, use js_getprototype. see also lxr id search js_getprototype ...
JS_ValueToInt32
request on this jscontext. v jsval the value to convert. ip int32 * out parameter. on success, *ip receives the converted integer value. description js_valuetoint32 converts a specified js value, v, to a 32-bit signed integer (-2147483648 to 2147483647). first it converts v to a floating-point number as if by calling js::tonumber. if the result is nan, an inf
inity, or a number outside the 32-bit range, js_valuetoint32 reports an error and conversion fails. otherwise, the floating-point number is rounded to the nearest integer value. on success, js_valuetoint32 stores the converted value in *ip and returns js_true. on error or exception, it returns js_false, and the value left in *ip is undefined. js_valuetoint32 is pre-ecma-262 edition 1, and rounds dif...
JS_ValueToString
esult is like the javascript expression ""+v. if v is already a string, conversion succeeds. if v is true, false, null, or undefined, conversion succeeds, and the result is the string "true", "false", "null", or "undefined", accordingly. if v is a number, conversion succeeds, and the result is a string representation of that number as specified in ecma 262-3 §9.8.1. this might be "nan", "inf
inity", or "-inf
inity". otherwise the result is a decimal representation of the number, possibly using exponential notation. otherwise v is an object. js_valuetostring uses the steps below to convert it to a string. if at any point an error or exception occurs, or conversion succeeds, the rest of the steps are skipped. (this behavior is implemented by v's jsobjectops.defaultvalue method, so host obje...
JS_YieldRequest
st on the calling thread. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. description for more information about thread safety and requests, see js_threadsafe. js_yieldrequest momentarily suspends the current request. a program can call this function periodically to ensure that a long-running request does not block garbage collection indef
initely. the effect is the same as a call to js_suspendrequest immediately followed by a call to js_resumerequest. jsapi 1.7 and earlier js_yieldrequest did not cause cx to relinquish objects it created to other threads that are blocked waiting for them. this bug (bug 402898) will be fixed in spidermonkey 1.8. jsapi 1.7 and earlier js_yieldrequest is available only in js_threadsafe builds. in spider...
JS_malloc
(js_malloc and js_realloc only) amount of space, in bytes, to allocate. s const char * (js_strdup only) pointer to a null-terminated string. s must not be null. description js_malloc allocates a region of memory nbytes in size. on success, js_malloc returns a pointer to the beginning of the region. as with the standard c function malloc, memory allocated by js_malloc is un
initialized. js_realloc tries to change the allocation size of the region of memory at p to nbytes. failing that, js_realloc allocates a new region of size nbytes and copies as much of the existing data in p as will fit to the new region. then it frees the region at p and returns a pointer to the new region. apart from whatever is copied, any newly allocated space is un
initialized. js_realloc(cx, null...
JS_updateMallocCounter
scription cx jscontext * pointer to a js context to decrement the malloc counter. nbytes size_t number of bytes to decrement from malloc counter. description js_updatemalloccounter decrements malloc counter of gc and the zone of the context. 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. see also mxr id search for js_updatemalloccounter changeset 88cfae411a2a js_newruntime js_getgcparameter bug 517665 ...
Stored value
. the javascript engine sets aside a field of type jsval for the stored value of most object properties, even properties that have getters. the stored value is updated each time the program gets or sets the property. the new stored value is the result of getting or setting the property, after the getter or setter, if any, is called. js_defineproperty allows the application to specify a property's
initial stored value. js_lookupproperty fetches a property's stored value without triggering its getter. properties with the jsprop_shared attribute do not have a stored value. es5 accessor properties, as in {get length() { return 0; }, automatically have jsprop_shared. properties of objects that have custom jsobjectops do not have a stored value. stored values are strong references for the purpose of...
SpiderMonkey 38
deleted apis js::addnamedobjectroot (bug 1107639) js::addnamedscriptroot (bug 1107639) js::addnamedstringroot (bug 1107639) js::addnamedvalueroot (bug 1107639) js::addnamedvaluerootrt (bug 1107639) js::addobjectroot (bug 1107639) js::addstringroot (bug 1107639) js::addvalueroot (bug 1107639) js::removeobjectr...
Setting up CDT to work on SpiderMonkey
ing things up for just spidermonkey instead of the whole mozilla codebase. hence, here is a short-ish guide for doing just that. step 1 - preparing a spidermonkey build for cdt to index all code, spidermonkey has to be built with debug information. the full process of and requisites for doing so are described here. please follow those instructions up until the point of invoking configure. the
initial build was in clang, so the modified build commands look like this: mkdir _dbg.obj cd _dbg.obj cc='clang -qunused-arguments -fcolor-diagnostics' cxx='clang++ -qunused-arguments -fcolor-diagnostics' \ ../configure --enable-debug --disable-optimize --enable-debug-symbols note: if you want to use ccache, you can enable it by adding --with-ccache to the arguments list. due to a bug in cdt, y...
TPS History Lists
epresenting visits to the page, each object has the following properties: type: required. an integer value from one of the transition types listed at https://developer.mozilla.org/en/nsinavhistoryservice#constants. date: required. an integer representing when the visit took place, expressed in hours from the present. for example, 0 is now, -24 is 24 hours in the past. for example: var history_
initial = [ { uri: "http://www.google.com/", title: "google", visits: [ { type: 1, date: 0 }, { type: 2, date: -1 } ] }, { uri: "http://www.cnn.com/", title: "cnn", visits: [ { type: 1, date: -1 }, { type: 2, date: -36 } ] }, ]; the history list used for deletions looks different. it's an array of objects, each of which represents a type of hist...
Thread Sanitizer
ignoring known races in some cases, races can be confirmed to be benign and fixing them would cause possible performance issues. tsan offers two possibilities to ignore such known races. compile-time blacklisting functions with racy memory access can be flagged, such that the compiler will not instrument them. in our codebase, this is done using the moz_tsan_blacklist macro on the function def
inition. it will expand to the appropriate attributes if the compiler supports them. compile-time blacklisting is the preferred way of blacklisting, because it does not have a performance impact. still, blacklisting should be done very carefully so we won't miss important bugs. runtime suppressions to prevent races from showing up at runtime, tsan also provides a runtime suppression list. this list ...
Mozinfo
t cannot be determined unknown has the string representation "unknown". unknown will evaluate as false in python: if not mozinfo.os: ... # unknown! command line usage mozinfo comes with a command line, mozinfo which may be used to diagnose one's current system. example output: os: linux version: ubuntu 10.10 bits: 32 processor: x86 three of these fields, os, bits, and processor, have a f
inite set of choices. you may display the value of these choices using mozinfo --os, mozinfo --bits, and mozinfo --processor. mozinfo --help documents command-line usage. ...
Redis Tips
0, -1, 'withscores', print); ["lloyd", "1339627441.115", "zcarter", "1339627437.7579999", "jparsons", "1339627432.928"] awesome. in addition to getting elements by their rank in the zset, you can get them by score. for example, to see everyone who's logged in in the last hour, you could do: > var an_hour_ago = now() - (60 * 60); > r.zrevrangebyscore('last-login', an_hour_ago, inf
inity, print); here are two ways to get the last person who logged in: > r.zrevrange('last-login', 0, 0, print); ["lloyd"] > r.zrevrangebyscore('last-login', inf
inity, 0, 'withscores', 'limit', 0, 1, print); ["lloyd", "1339627441.115"] timeout keys you can set an expiration date on keys in redis. how cool is that? expire expireat ttl persist setex example: redis> set foo 42 ok red...
XForms Accessibility
cs). it can have the following presentations: text - see the docs. calendar - see the docs. upload provides a means for the user to select a file (see the spec, the docs). this element is represented by upload. range allows the user to choose a value from within a specific range of values (see the spec, the docs). currently it is represented by a slider only. trigger allows the user to
initiate actions (see the spec, the docs). this element is represented by button. submit invokes the submission of the selected instance data to its target destination (see the spec, the docs). this element is represented by button. select allows the user to choose one or multiple values from a list of pre-defined values (see the spec, the docs). it can have the following representations: listb...
Feed content access API
o get a copy of the title translated into plain text. we then scan the array of items in the feed by looking at the feed.items nsiarray. this array contains nsifeedentry objects that describe each feed item. we build the contents of the document by looking at the title, link, summary, and content properties for each item. the full url of the link is retrieved using the link's resolve() method. to
initialize a fetch of the feed, we simply call fetch(url). this opens a new window containing the feed contents, with each item's title a clickable link that takes you to the article itself. for details on each of the feed access interfaces, visit their respective reference pages. ...
Frecency algorithm
-- 252 (4 * 252 / 4) - final frecency score notes the number of sampled visits is min(10 most recent visits pref, total visit counts). the total visit count includes embedded, undefined, etc visits (does not exclude invalid or embedded visits). developer notes there are various development notes you can read about places that may offer additional insights:
initial algorithm ideas implementation notes history the
initial algorithm design was by mike connor and seth spitzer. the
initial implementation was done by seth and dietrich ayala. further features and refinement by ed lee (implemented adaptive matching and most of the character restrictors), marco bonardo and shawn wilsher. the latter two later ported all of the code from c++ to javascript...
Manipulating bookmarks using Places
the places bookmarks service, provided by the nsinavbookmarksservice interface, provides methods for creating, deleting, and manipulating bookmarks and bookmark folders. this article offers examples for how to perform common bookmark management tasks using the bookmarks service.
initiating the bookmarks service as is the case with nearly all interfaces, before you can use the bookmarks service, you need to get access to it: var bmsvc = components.classes["@mozilla.org/browser/nav-bookmarks-service;1"] .getservice(components.interfaces.nsinavbookmarksservice); creating a bookmark folder creating a new bookmark folder is done using the nsinavbookmarksservice.createfolder() method. for example, to create a new folder in the bookmarks menu: var menufolder =...
Places Developer Guide
bserver, 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 ais
initialimport) - this imports all the bookmarks in the specified file into the current bookmarks collection. if ais
initialimport is true, all pre-existing bookmarks in the toolbar and menu folders will be deleted. note: the method importhtmlfromfiletofolder() method was removed in gecko 14.0 (firefox 14.0 / thunderbird 14.0 / seamonkey 2.11). exporting: exporthtmltofile (nsilocalfile afile) - t...
Using the Places livemark service
the livemark service, offered by the nsilivemarkservice interface, is used to create, edit, and reload livemarks. you can also use it to check whether an item is a livemark. livemarks are bookmark folders that contain the most recent items from an rss feed.
initiating the livemark service before using the livemark service, you need to obtain an instance: var livemarkservice = components.classes["@mozilla.org/browser/livemark-service;2"] .getservice(components.interfaces.nsilivemarkservice); creating a new livemark the nsilivemarkservice.createlivemark() method creates a new livemark. var newlvmkid = livemarkservice.createlivemark(parentfolderid, "livemark name", uri("http://example.com/"), ...
Using the Places tagging service
the tagging service, offered by the nsitaggingservice interface, provides methods to tag and untag a uri, to retrieve uris for a given tag, and to retrieve all tags for a uri.
initiating the tagging service before using the tagging service, you need to obtain a reference to an instance of it: var taggingsvc = components.classes["@mozilla.org/browser/tagging-service;1"] .getservice(components.interfaces.nsitaggingservice); tagging a uri the nsitaggingservice.taguri() method tags a url with the given set of tags. current tags set for the url persist, and tags which are already set for the given url are ignored. taggingsvc.taguri(uri("http://example.com/"), ["tag 1"]); //first argument = uri //second argu...
The Publicity Stream API
lalabs.com/jsapi/publicity.js all apis related to open web applications are accessed under the navigator.apps object. publicity stream api (navigator.apps.publicity.*) the publicity api is exposed as properties on the navigator.apps.publicity object. publicizeactivity( <activity>, [ { [ onsuccess: <function> ], [ onerror: <function> ] } ]): applications should call this method when an user-
initiated activity deemed attractive to potential consumers occurs. this spawns a doorhanger which allows the user to specify which users can view the activity, and (following successful login and authorization with the stream server) registers the activity in a stream at [address]. this stream can be pulled down by getpublicitystream() and helps determine the results for getuserrecommendedapps(). e...
Generating GUIDs
ying several types of entities, including xpcom interfaces (this type of guids is callled iid), components (cid), and legacy add-ons—like extensions and themes—that were created prior to firefox 1.5. add-ons can (and should) be identified with ids of the form extensionname@organization.tld since firefox 1.5. warning: if you just want an id for your add-on, generating a guid is almost def
initely not what you want to do. using the extensionname@organization.tld form is approximately one thousand times easier for everyone involved. don't have a domain name? do you have a blog on a subdomain? use that. if all else fails, using extensionname@yourusername.addons.mozilla.org should be fine; no one will care. remember, these are identifiers, not e-mail addresses, and they're never resolved. ...
Generic factory
fnsiid aiid, void **aresult); nsgenericfactory(creatorprocptr creator); virtual ~nsgenericfactory(); ns_decl_isupports ns_imethod createinstance(nsisupports *aouter, refnsiid aiid, void **aresult); ns_imethod lockfactory(prbool alock); private: creatorprocptr mcreator; }; nsgenericfactory::nsgenericfactory(creatorprocptr creator) : mcreator(creator) { ns_
init_refcnt(); } nsgenericfactory::~nsgenericfactory() {} static ns_define_iid(kifactoryiid, ns_ifactory_iid); ns_impl_isupports(nsgenericfactory, kifactoryiid) ns_imethodimp nsgenericfactory::createinstance(nsisupports *aouter, refnsiid aiid, void **aresult) { return mcreator(aouter, aiid, aresult); } ns_imethodimp nsgenericfactory::loc...
Using XPCOM Components
read from disk). unlock unlock the browser for unrestricted use. addsite add a new site to the whitelist. removesite remove a given site from the whitelist. sites enumerator for the list of approved sites read in from the whitelist. the weblock component is software that implements all of these methods in the way described by the interface def
inition. it registers itself for use when the browser starts up, and provides a factory that creates an instance of it for use when the user or administrator clicks the weblock icon in the browser's user interface. component use in mozilla so how are components obtained and used in mozilla? you've seen some enticing snippets of javascript in earlier sections of this chapter, but we haven't explained...
Creating XPCOM components
ng status codes variable mappings common xpcom error codes using xpcom components component examples cookie manager the webbrowserfind component the weblock component component use in mozilla finding mozilla components using xpcom components in your cpp xpconnect: using xpcom components from script component internals creating components in cpp xpcom
initialization xpcom registry manifests registration methods in xpcom autoregistration the shutdown process three parts of a xpcom component library xpcom glue the glue library xpcom string classes creating the component code what we'll be working on component registration the regxpcom program registration alternatives overview of the weblock module source ...
Receiving startup notifications
getter_copies(previous)); with "service," specified, the component is instantiated using nsicomponentmanager.getservice(). in either case, there's no need to additionally register for the startup notifications. simply registering with the category manager is enough. what happens next once you've registered with the category manager, at mozilla startup time (or when the embedding application's ns_
initembedding() function is called), the appstartupnotifier component is instantiated, and its observe() method is called; this in turn enumerates all components in the app-startup category and sends them the appropriate notifications. ...
Interfacing with the XPCOM cycle collector
h two nscomptr edges mbar and mbaz, the process can be distilled to a few simple modifications: include the header nscyclecollectionparticipant.h in both nsfoo.h and nsfoo.cpp. add a line declaring that your class nsfoo participates in the cycle collection in nsfoo.cpp: ns_impl_cycle_collection_class(nsfoo) change the line ns_decl_isupports to ns_decl_cycle_collecting_isupports in the def
inition of nsfoo. add a line ns_decl_cycle_collection_class(nsfoo) within the public portion of def
inition of nsfoo. or ns_decl_cycle_collection_class_ambiguous(nsfoo, nsibar) if nsfoo inherits from multiple interfaces, where nsibar is the interface which is returned when you queryinterface nsfoo to nsisupports. (we call nsibar the canonical isupports type for nsfoo.) add a line ns_interface_m...
mozIRegistry
me arbitrary desired properties. nsrepository this is basically the same as is provided today (see mozilla/xpcom/public/nsrepository.h). the primary change to this component is that we will modify it to utilize the new moziregistry interface versus the nsreg.h functions it calls today. in addition, it likely will have a couple of minor extensions: support for specifying the .reg file name on
initialize(). i think this might make it a little more flexible, thereby making xpcom more general-purpose. adding support so that the underlying moziregistry implementation can be tailored by the
initializer (client application). this is so that one can choose the basic libreg-based registry implementation versus a more advanced, e.g., rdf-based, one. nsrepository will only know clsids. the burde...
nsIArray
if the array is empty (to make it easy to detect errors). ns_error_out_of_memory if there is not enough memory to complete the operation. indexof() get the position of a specific element. note that since null is a valid input, exceptions are used to indicate that an element is not found. unsigned long indexof( in unsigned long startindex, in nsisupports element ); parameters startindex the
initial element to search in the array. to start at the beginning, use 0 as the startindex. element the element you are looking for. return value a number >= startindex which is the position of the element in the array. exceptions thrown ns_error_failure if the element was not in the array. queryelementat() retrieve a specific element of the array, and queryinterface it to the specified interface. ...
nsIChannelEventSink
ntical to the old one. redirect_permanent 1 << 1 this is a permanent redirect. new requests for this resource should use the uri of the new channel (this might be an http 301 reponse). if this flag is not set, this is a temporary redirect. the new uri may be identical to the old one. redirect_internal 1 << 2 this is an internal redirect, i.e. it was not
initiated by the remote server, but is specific to the channel implementation. the new uri may be identical to the old one. methods asynconchannelredirect() called when a redirect occurs. this may happen due to an http 3xx status code. this method notifies the sink that a redirect is about to happen, but also to gives the sink the right to veto the redirect by throwing an exception or passin...
nsIConsoleService
you must provide this. asourcename — the url for a file associated with an error. this will be a hyperlink in the error console, so you'd better use real url. you may pass null if it's not applicable. asour...
nsIContentPrefService2
ve 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 simply name-value pairs that aren't associated with any particular domain. as a consumer of this interface, you might choose to let a global preference override all non- global preferences of the same name, for example, for whatever def
inition of "override" is appropriate for your use case. domain parameters many methods of this interface accept a "domain" parameter. domains may be specified either exactly, like "example.com", or as full urls, like "http://example.com/foo/bar". in the latter case the api extracts the full domain from the url, so if you specify "http://foo.bar.example.com/baz", the domain is taken to be "foo.bar.exam...
nsIContentSecurityPolicy
wseval boolean whether this policy allows eval and eval-like functions such as settimeout("code string", time). calls to this may trigger violation reports when queried, so this value should not be cached. read only. allowsinlinescript boolean whether this policy allows in-page script. calls to this may trigger violation reports when queried, so this value should not be cached. read only. is
initialized boolean set to true when the content security policy has been read in and parsed and is ready to enforce. this is a barrier for the nsdocument so it doesn't load any sub-content until either it knows that a content security policy is ready or will not be used. policy astring a read-only string version of the policy for debugging. read only. reportonlymode boolean when set to true, cont...
nsICookiePermission
hese may be relocated somewhere else if we ever consider freezing this interface. methods canaccess() tests whether or not the given uri/channel may access the cookie database, either to set or get cookies. nscookieaccess canaccess( in nsiuri auri, in nsiuri afirsturi, obsolete since gecko 1.9 in nsichannel achannel ); parameters auri the uri trying to access cookies. afirsturi the uri
initiated by the user that resulted in auri being loaded. achannel the channel corresponding to auri. return value one of the nscookieaccess values: access_default, access_allow, or access_deny. cansetcookie() tests whether or not the given uri/channel may set a specific cookie. this method is always preceded by a call to canaccess(). it may modify the issession and expiry attributes of the cookie vi...
nsIDNSRecord
oid rewind(); attributes attribute type description canonicalname acstring for example, www.mozilla.org --> rheet.mozilla.org. read only. methods native code only!getnextaddr this function copies the value of the next ip address into the given prnetaddr struct and increments the internal address iterator. prnetaddr getnextaddr( in pruint16 aport ); parameters aport a port number to
initialize the prnetaddr with. return value the value of the next ip address. getnextaddrasstring() this function returns the value of the next ip address as a string and increments the internal address iterator. acstring getnextaddrasstring(); parameters none. return value the value of the next ip address as a string. hasmore() this method checks if there is another address in the record. boolean h...
nsIDOMChromeWindow
getattention() void getattention(); parameters none. getattentionwithcyclecount() same as getattention method excepting that this can specify the maximum number of times to animate the window per system conventions. void getattentionwithcyclecount( in long acyclecount ); parameters acyclecount the maximum number of times to animate the window per system conventions. if set to -1, cycles indef
initely until window is brought into the foreground. this behavior is same as getattention method. maximize() maximizes the window. void maximize(); parameters none. minimize() minimizes the window. void minimize(); parameters none. notifydefaultbuttonloaded() when a document has been loaded, the document can notify the default button of the document to the window by using this method. when this me...
nsIDOMClientRect
ectangle box (this is identical to right minus left). read only. x float x-coordinate, relative to the viewport origin, of the left of the rectangle box. read only. y float y-coordinate, relative to the viewport origin, of the top of the rectangle box. read only. see also cssom view module : the clientrect interfacewd this object was renamed a few times:
initial name was textrectangle, then clientrect, then domrect.
initially it had just the top/left/right/bottom attributes, then width/height/x/y were added. ...
nsIDOMHTMLAudioElement
le, specify 44100 for 44.1khz. mozwriteaudio() writes samples to the audio stream. unsigned long mozwriteaudio( in jsval data ); parameters data the samples to write into the audio stream, specified either as a javascript array or as a numeric typed array. return value the actual number of bytes written to the stream. exceptions thrown ns_error_dom_invalid_state_err the stream has not been
initialized for writing by a call to mozsetup(). ns_error_dom_type_mismatch_err the data isn't a valid data type (an array or typed array of numeric values). ns_error_dom_index_size_err the number of samples specified doesn't divide evenly across the number of channels; you must provide exactly the same number of samples for all channels. ...
nsIDOMNSHTMLDocument
same as body.bgcolor compatmode domstring returns "backcompat" if the document is in quirks mode or "css1compat" if the document is in full standards or almost standards mode. read only. designmode domstring set to "on" or "off" to enable or disable editing for the entire document at once. roughly equivalent to body.contenteditable domain domstring
initially the host name of the document's url, but may be changed to the parent (but not top-level) domain in order to facilitate data exchange between documents from different sites in the same domain. embeds nsidomhtmlcollection equivalent to getelementsbytagname("embed") read only. fgcolor domstring same as body.text head nsidomhtmlheadelement returns th...
nsIDOMWindowInternal
ilable arguments (i.e. see window.prompt). method overview firefox 3.5 note the prompt() and find() methods changed in firefox 3.5 to make all their parameters optional; in previous versions, all parameters were required. ...
nsIDOMWindowUtils
nformation about code that has executed since a preceding call to startpccountprofiling() will be constructed, and will be retained until a call to purgepccounts(). this profile information may be queried using getpccountscriptcount(), getpccountscriptsummary(), and getpccountscriptcontents(). void stoppccountprofiling(); parameters none. suppresseventhandling() suppresses/unsuppresses user
initiated event handling in window's document and subdocuments. void suppresseventhandling( in boolean asuppress ); parameters asuppress suspendtimeouts() suspend/resume timeouts on this window and its descendant windows. void suspendtimeouts(); parameters none. wrapdomfile() wraps the specified nsidomfile in a dom file object. nsidomfile wrapdomfile( nsifile afile ); paramete...
nsIDOMXPathEvaluator
h to be created. resolver a name space resolver created by creatensresolver(), or a user defined name space resolver. read more on implementing a user defined namespace resolver if you wish to take the latter approach. return value an xpath expression, as an nsidomxpathexpression object. creatensresolver() creates an nsidomxpathexpression which resolves name spaces with respect to the def
initions in scope for a specified node. it is used to resolve prefixes within the xpath itself, so that they can be matched with the document. null is common for html documents or when no name space prefixes are used. nsidomxpathnsresolver creatensresolver( in nsidomnode noderesolver ); parameters noderesolver the node to be used as a context for name space resolution. return value a name...
getFile
ns_xpcom_component_dir "comsd" ns_xpcom_component_dir_list "comsdl" ns_xpcom_component_registry_file "comregf" ns_xpcom_xpti_registry_file "xptiregf" ns_xpcom_library_file "xpcomlib" ns_gre_dir "gred" note: on mac os x, up through firefox 34 this is the contents/macos directory ...
nsIDownloadProgressListener
nt of progress that's been made on all downloads. amaxtotalprogress the value that the total progress needs to reach to indicate that all downloads are complete. adownload the nsidownload object whose progress is represented by the acurselfprogress and amaxselfprogress parameters. onsecuritychange() called when the level of security being used while downloading changes; for example, if the
initial request is made via https but the download switches to http, this function gets called to notify you of that transition. void onsecuritychange( in nsiwebprogress awebprogress, in nsirequest arequest, in unsigned long astate, in nsidownload adownload ); parameters awebprogress the nsiwebprogress instance used by the download manager to monitor downloads. arequest the nsichannel...
nsIDownloader
n of a nsistreamlistener that will make the contents of the stream available as a file. this may utilize the disk cache as an optimization to avoid an extra copy of the data on disk. the resulting file is valid from the time the downloader completes until the last reference to the downloader is released. inherits from: nsistreamlistener last changed in gecko 1.7 method overview void
init(in nsidownloadobserver observer, in nsifile downloadlocation); methods
init()
initialize this downloader. void
init( in nsidownloadobserver observer, in nsifile downloadlocation ); parameters observer the nsidownloadobserver to be notified when the download completes. downloadlocation the location where the stream contents should be written. if null, the downloader wil...
nsIDroppedLinkHandler
isallowinherit ); parameters aevent a drop event. aname the link title if it exists, or an empty string otherwise. return value a uri, or null if there is no valid link to be dropped. exceptions thrown ns_error_dom_security_err error will be thrown and the event canceled if the receiving target should not load the uri for security reasons. this will occur if the source of the drag
initiated a link for dragging that it itself cannot access. this prevents a source document from tricking the user into a dragging a chrome url for example. droplinks() given a drop event, determines the link being dragged. if non-empty links array is returned the caller can, for instance, load it. if empty links array is returned, there is no valid link to be dropped. void droplinks( in nsidomd...
nsIEnvironment
env variable. an empty string will be returned when the env variable does not exist or when the value itself is an empty string - please use exists() to probe whether the env variable exists or not. exists() check the existence of an environment variable. this method checks whether an environment variable is present in the environment or not. note: * for unix/linux platforms we follow the unix def
inition: an environment variable exists when getenv() returns a non-null value. an environment variable does not exist when getenv() returns null. for non-unix/linux platforms we have to fall back to a "portable" def
inition (which is incorrect for unix/linux!!!!) which simply checks whether the string returned by get() is empty or not. boolean exists( in astring aname ); parameters aname...
nsIFileView
d="lastmodifiedcolumn" label="date" flex="1"/> <treecol id="size" label="size" flex="1"/> </treecols> <treechildren/> </tree> <script> var dir="/home/"; //the directory to be opened var ftree = document.getelementbyid("ftree"); //the xul tree element var lfile = components.classes["@mozilla.org/file/local;1"] .createinstance(components.interfaces.nsilocalfile); lfile.
initwithpath(dir); // open the directory var fview = components.classes["@mozilla.org/filepicker/fileview;1"] .createinstance(components.interfaces.nsifileview); //create an instance of the component tview = fview.queryinterface(components.interfaces.nsitreeview); //get the nsitreeview interface fview.setdirectory(lfile.queryinterface(components.interfaces.nsifile)); //set the d...
nsIGeolocationProvider
1.0) this must be called on the main thread interface provides location information to the nsgeolocator via the nsidomgeolocationcallback interface. after startup() is called, any geo location change should call callback.update(). the nsigeolocationprovider interface provides information about the current users location to interested parties via nsigeolocationupdate. after the provider has been
initialized, any changes to location should call callback.onrequest(). you may find the wifi access point monitoring service useful if you wish to implement support for wifi-based location services. see dom/src/geolocation/networkgeolocationprovider.js for an example of how to write a geolocation provider. method overview boolean isready(); obsolete since gecko 1.9.2 void shutdown(); void start...
nsIHapticFeedback
66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) implemented by: @mozilla.org/widget/hapticfeedback;1 as a service: var hapticfeedback = components.classes["@mozilla.org/widget/hapticfeedback;1"] .getservice(components.interfaces.nsihapticfeedback); once you have the service, you can
initiate haptic feedback (that is, cause the device to vibrate, if it's supported) by calling performsimpleaction(): hapticfeedback.performsimpleaction(components.interfaces.nsihapticfeedback.longpress); method overview void performsimpleaction(in long islongpress); constants press length constants constant value description shortpress 0 specify as t...
nsIHttpChannel
s channel is allowed to make. if zero, the channel will fail to redirect and will generate a ns_error_redirect_loop failure status. note: an http redirect results in a new channel being created. if the new channel supports nsihttpchannel, then it will be assigned a value to its redirectionlimit attribute one less than the value of the redirected channel's redirectionlimit attribute. the
initial value for this attribute may be a configurable preference (depending on the implementation). referrer nsiuri get or set the uri of the http referer: header. this is the address (uri) of the resource from which this channel's uri was obtained (see rfc2616 section 14.36). this attribute may only be set before the channel is opened. note: the channel ma...
nsIINIParser
tion you can call to obtain the value for a specific key in a given ini file. /** * returns the value for a given property in an ini file * @param {nsifile} inifile * the ini file to get the value from * @param {string} section * the name of the section in the ini file. ini sections are * defined by square brakets and look like this: [settings] * all entries below such a section def
inition belong to that * section (until the next section). * @param {string} prop * the name of the property to get. */ function getinivalue (inifile, section, prop) { var inifact = components.manager.getclassobjectbycontractid( "@mozilla.org/xpcom/ini-parser-factory;1", components.interfaces.nsiiniparserfactory ); var iniparser = inifact.createiniparser(inifile); try { ret...
nsIINIParserWriter
which to place the property. akey the name of the property for which the value is to be set. avalue the value to assign to the property. writefile() write to the ini file. void writefile( in nsifile ainifile, optional in unsigned long aflags optional ); parameters ainifile optional if specified, this nsifile based object is used as the output file instead of the one specified at
initialization time (if any). aflags optional flags controlling the file write operation. see file writing constants for details on the permitted values. see also ini file nsiiniparser nsiiniparserfactory ...
nsIMacDockSupport
notice the activateapplication(true), if this is not done then firefox will not be activated. the result of this code is shown below. notice how the "new window" and "new private window" menuitem's are missing. therefore, if you would like to add or remo...
nsIMessageBroadcaster
tchildat(in unsigned long aindex); broadcastasyncmessage() like sendasyncmessage(), but also broadcasts this message to all "child" message managers of this message manager. see nsimessagelistener::receivemessage() for the format of the data delivered to listeners. warning: broadcasting messages can be very expensive and leak sensitive data. use with extreme caution. throws ns_error_not_
initialized if the sender is not
initialized. for example, we will throw ns_error_not_
initialized if we try to send a message to a cross-process frame but the other process has not yet been set up. throws ns_error_failure when the message receiver cannot be found. for example, we will throw ns_error_failure if we try to send a message to a cross-process frame whose process has crashed. parameters ...
nsIMessageSender
[optional] in jsval objects, [optional] in nsiprincipal principal); sendasyncmessage() send messagename and obj to the "other side" of this message manager. this invokes listeners who registered for messagename using a nsimessagelistenermanager. see nsimessagelistener::receivemessage() for the format of the data delivered to listeners. throws ns_error_not_
initialized if the sender is not
initialized. for example, we will throw ns_error_not_
initialized if we try to send a message to a cross-process frame but the other process has not yet been set up. throws ns_error_failure when the message receiver cannot be found. for example, we will throw ns_error_failure if we try to send a message to a cross-process frame whose process has crashed. parameters ...
nsIMsgCompFields
ool from astring hasrecipients prbool readonly new in thunderbird 23 indicates whether something is filled in in the to, cc, or bcc attribute. (bug 68784) messageid char * needtocheckcharset prbool indicates whether we need to check if the current documentcharset can represent all the characters in the message body. it should be
initialized to true and set to false when 'send anyway' is selected by a user. (bug 249530) newsgroups astring newshost char * newsposturl char * organization astring otherrandomheaders astring no longer exists - see https://groups.google.com/forum/#!topic/mozilla.dev.apps.thunderbird/s4ofmm8_b28 priority ch...
nsIMsgWindow
essage'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. set this to
initialize the rootdocshell. methods displayhtmlinmessagepane() loads the specified html in the message pane. this is equivalent to calling loaduri on the nsiwebnavigation object with a data: url specifying the html. void displayhtmlinmessagepane(in astring title, in astring body, in boolean clearmsghdr); parameters title ...
nsINavHistoryResultNode
specialized result node interface. read only. uri autf8string the uri of the resource represented by the node. for visits and urls, this is the url of the page. for folders and queries, this is the place: uri of the corresponding folder or query. this may be empty for other types of objects, like host containers. read only. viewindex long value with undefined meaning for use by the view. its
initial value will be -1. the result implementation treats nodes with this property set to -1 as invisible! view-implementations may use this value to track the node index in the view, for example the tree view uses this value to indicate the row in the tree that this node is at. other views may choose not to use this, but should
inititalize this value to anything but -1 for visible nodes. obsolete si...
nsINavHistoryResultTreeViewer
results with a tree. 1.0 66 introduced gecko 1.8 inherits from: nsinavhistoryresultobserver last changed in gecko 1.9 (firefox 3) this object removes itself from the associated result when the tree is detached; this prevents circular references. it's important to be aware of this—if you want to reuse the same viewer, you need to keep your own reference to it, then re
initialize it when the tree changes. if you use this object and attach it to a result without attaching it to a tree, then forget about it, it will leak. method overview nsinavhistoryresultnode nodefortreeindex(in unsigned long aindex); unsigned long treeindexfornode(in nsinavhistoryresultnode anode); attributes attribute type description collapseduplicates boolean controls whether dupli...
nsINavHistoryService
iews (unless it has been unhidden by visiting it with a non-redirect). asessionid the session id that this page belongs to. use "0" for no session. return value returns the id of the created visit. this will be "0" if the uri is not valid for adding to history (canadduri = false). getnewquery() this method returns a new query object that you can pass to executequery/ies methods. it will be
initialized to all empty (so using it will give you all history). nsinavhistoryquery getnewquery(); parameters none. return value returns a new query object. getnewqueryoptions() this method returns a new options object that you can pass to executequery/ies methods after setting the desired options. nsinavhistoryqueryoptions getnewqueryoptions(); parameters none. return value returns a n...
nsIPrefService
resenting the requested default branch. readuserprefs() called to read in the preferences specified in a user preference file. note: if nsnull is passed in for the afile parameter the default preferences file(s) [prefs.js, user.js] will be read and processed. void readuserprefs( in nsifile afile ); parameters afile the file to be read. resetprefs() called to completely flush and re-
initialize the preferences system. void resetprefs(); parameters none. resetuserprefs() called to reset all preferences with user set values back to the application default values. void resetuserprefs(); parameters none. savepreffile() called to write current preferences state to a file. note: if nsnull is passed in for the afile parameter the preference data is written out to the current...
nsIProcess2
void runasync( [array, size_is(count)] in string args, in unsigned long count, in nsiobserver observer, optional in boolean holdweak optional ); parameters args an array of arguments to pass into the process, using the native character set. this array must have count entries. count the ...
nsISHistory
thods addshistorylistener() called to register a listener for the session history component. listeners are notified when pages are loaded or purged from history. note: a listener object must implement nsishistorylistener and nssupportsweakreference. void addshistorylistener( in nsishistorylistener alistener ); parameters alistener listener object to be notified for all page loads that
initiate in session history. getentryatindex() called to obtain handle to the history entry at a given index. nsishentry getentryatindex( in long index, in boolean modifyindex ); parameters index the 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...
nsIScreenManager
e type description numberofscreens unsigned long the number of screens on the user's computer. read only. primaryscreen nsiscreen the primary display screen; this is the screen with the menu bar (on the mac) or taskbar or equivalent on windows or linux. read only. methods native code only!screenfornativewidget returns the nsiscreen instance for the native widget pointer. this pointer's def
inition is specific to the platform's native widget implementation, and is typically of the same type as ns_native_window. nsiscreen screenfornativewidget( in voidptr nativewidget ); parameters nativewidget the native widget for which to obtain an nsiscreen instance. return value the nsiscreen instance for the native widget pointer. screenforrect() returns the nsiscreen containing the specified r...
nsISimpleEnumerator
n the enumerator. nsisupports getnext(); parameters none. return value ns_ok if the call succeeded in returning a non-null value through the out parameter. ns_error_failure if there are no more elements to enumerate. hasmoreelements() called to determine whether or not the enumerator has any elements that can be returned via getnext(). this method is generally used to determine whether or not to
initiate or continue iteration over the enumerator, though it can be called without subsequent getnext() calls. does not affect internal state of enumerator. boolean hasmoreelements(); parameters none. return value pr_true if there are remaining elements in the enumerator. pr_false if there are no more elements in the enumerator. remarks this interface was frozen for gecko 0.9.6. see bug 154047 for d...
nsISocketTransport
t may offer and will only attempt to connect to ipv4 addresses. methods native code only!getpeeraddr returns the ip address of the socket connection peer. this attribute is defined only once a connection has been established. prnetaddr getpeeraddr(); parameters none. return value an prnetaddr containing the resolved ip address. native code only!getselfaddr returns the ip address of the
initiating end. this attribute is defined only once a connection has been established. prnetaddr getselfaddr(); parameters none. return value an prnetaddr containing the resolved ip address. gettimeout() retrieves a socket timeout. unsigned long gettimeout( in unsigned long atype ); parameters atype the timeout type, who's associated value should be retrieved. can be one of the cons...
nsIStringEnumerator
his method is generally called within a loop to iterate over the strings in the enumerator. astring getnext(); parameters none. return value the next string in the enumerator. throws an exception if there are no more strings. hasmore() called to determine whether or not the enumerator has any strings that can be returned via getnext(). this method is generally used to determine whether or not to
initiate or continue iteration over the enumerator, though it can be called without subsequent getnext() calls. does not affect internal state of enumerator. boolean hasmore(); parameters none. return value true if there are remaining strings in the enumerator. false if there are no more strings in the enumerator. ...
nsISupportsPriority
w void adjustpriority(in long delta); attributes attribute type description priority long the object's priority. it can be modified to change the priority of the object. typical priority values are defined in the idl file as priority_highest ... priority_lowest. the implementation is free to truncate a given priority value to whatever limits are appropriate. typically this attribute is
initialized to priority_normal, but implementations may choose to assign a different
initial value. constants constant value description priority_highest -20 the highest priority. priority_high -10 higher than normal priority. priority_normal 0 the default priority. priority_low 10 lower than normal priority. priority_lowest 20 the lowest priority. methods adjustpriority() this meth...
nsISupports proxies
.js scripts that were used in xpinstall in older mozilla versions. they from the majority of javascript code, which is small and can be quickly run. xpinstall installation scripts are sometimes very complex and can require long execution time due to unzipping or native file system actions. if xpinstall ran on the ui thread, the product would appear frozen until the script was complete. this is def
initely bad. because of this, xpinstall was moved to its own thread. now xpinstall can do its installations while the product renders, but now xpinstall can not access ui elements such as a progress meter or a confirmation dialog. how can a separate non-ui thread act as if it was on the ui thread? herein lays the utility of nsisupports proxies. i believe that other people working on mozilla need simi...
nsISyncMessageSender
til all listeners of the message have been invoked. returns an array containing return values from each listener invoked. send messagename and obj to the "other side" of this message manager. this invokes listeners who registered for messagename using a nsimessagelistenermanager. see nsimessagelistener::receivemessage() for the format of the data delivered to listeners. throws ns_error_not_
initialized if the sender is not
initialized. for example, we will throw ns_error_not_
initialized if we try to send a message to a cross-process frame but the other process has not yet been set up. throws ns_error_failure when the message receiver cannot be found. for example, we will throw ns_error_failure if we try to send a message to a cross-process frame whose process has crashed. parameters ...
nsITXTToHTMLConv
amconverter last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) implemented by "@mozilla.org/streamconv;1?from=text/plain&to=text/html". you should normally obtain an instance via the nsistreamconverterservice interface. method overview void preformathtml(in boolean value); void settitle(in wstring text); prior versions of the interface named the methods using the
initialcaps style instead of the intercaps style. methods preformathtml() specifies whether or not to wrap the resulting html in an <pre> block. void preformathtml( in boolean value ); parameters value true to wrap the resulting html in a <pre> block. settitle() sets the title to use on the resulting html document. void settitle( in wstring text ); parameters text title to set for the html do...
nsITimerCallback
xpcom/threads/nsitimer.idlscriptable defines the callback interface for nsitimer events. inherits from: nsisupports last changed in gecko 1.7 method overview void notify(in nsitimer timer); methods notify()
initialize a timer to fire after the given millisecond interval. this version takes a function to call and a closure to pass to that function. void notify( in nsitimer timer ); parameters timer nsitimer the timer which has expired see also nsitimer nsitimercallbackfunc ...
nsIToolkit
widget/public/nsitoolkit.idlnot scriptable this interface is used to
initialize a message pump. inherits from: nsisupports last changed in gecko 1.0 method overview void
init(in prthread athread); methods
init()
initialize this toolkit with athread. void
init( in prthread athread ); parameters athread the thread passed in runs the message pump. null can be passed in, in which case a new thread gets created and a message pump will run in that thread. see also prthread ...
nsITraceableChannel
holds chunks as they come, onstoprequest we join these junks to get the full source this.responsebody; // we'll set this to the this.responsestatuscode; this.deferreddone = { promise: null, resolve: null, reject: null }; this.deferreddone.promise = new promise(function(resolve, reject) { this.res...
nsIURLParser
netwerk/base/public/nsiurlparser.idlscriptable specifies the interface to an url parser that attempts to follow the def
initions of rfc 2396. inherits from: nsisupports last changed in gecko 1.7 method overview void parseauthority(in string authority, in long authoritylen, out unsigned long usernamepos, out long usernamelen, out unsigned long passwordpos, out long passwordlen, out unsigned long hostnamepos, out long hostnamelen, out long port); void parsefilename(in string filename, in long filenamelen, out unsigned long basenamepos, out long basenamelen, out unsigned long extensionpos, out long extensionlen); void parsefilepath(in string filepath, in long filepathlen, out unsigned long directorypos, out long directorylen, out unsigned long basenamepos, out long basenamel...
nsIUTF8StringEnumerator
_true. this method is generally called within a loop to iterate over the strings in the enumerator. autf8string getnext(); parameters none. return value the next string in the enumerator. throws an exception if there are no more strings. hasmore() reports whether or not the enumerator has any strings that can be returned via getnext(). this method is generally used to determine whether or not to
initiate or continue iteration over the enumerator, athough it can be called without subsequent getnext() calls. calling this method doesn't affect the internal state of the enumerator. boolean hasmore(); parameters none. return value true if there are remaining strings in the enumerator, otherwise false. ...
nsIUpdatePrompt
is already displayed the call will be a no-op. void showupdateavailable( in nsiupdate update ); parameters update an nsiupdate describing the update that's available. showupdatedownloaded() shows a message advising the user that an update has been downloaded, and that the user should restart the application in order to install it. if background is true (for example the download was not user
initiated) and the app.update.silent preference is true the call will be a no-op. void showupdatedownloaded( in nsiupdate update, in boolean background optional ); parameters update an nsiupdate describing the update that was downloaded. background optional an optional parameter that, if provided and true, presents a less-obtrusive, non-modal notification alert. showupdateerror() displays an e...
nsIVersionComparator
duced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) version strings are dot-separated sequences of version-parts. a version-part consists of up to four parts, all of which are optional: <number-a><string-b><number-c><string-d (everything else)> a version-part may also consist of a single asterisk "*" which indicates * "inf
inity". numbers are base-10, and are zero if left out. strings are compared bytewise. for additional backwards compatibility, if "string-b" is "+" then "number-a" is incremented by 1 and "string-b" becomes "pre". 1.0pre1 < 1.0pre2 < 1.0 == 1.0.0 == 1.0.0.0 < 1.1pre == 1.1pre0 == 1.0+ < 1.1pre1a < 1.1pre1 < 1.1pre10a < 1.1pre10 implemented by: @m...
nsIWebBrowser
the interface may also 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. ...
nsIWebBrowserChrome
r chrome. the implementation should reflect the value of this attribute by hiding or showing its chrome appropriately. webbrowser nsiwebbrowser the currently loaded webbrowser. the browser chrome may be told to set the webbrowser object to a new object by setting this attribute. in this case the implementer is responsible for taking the new webbrowser object and doing any necessary
initialization or setup as if it had created the webbrowser itself. this includes positioning setting up listeners etc. constants constant value description status_script 1 flag for setstatus() status_script_default 2 flag for setstatus() status_link 3 flag for setstatus() chrome_default 1 value for the chromeflags attrib...
nsIWebBrowserPersist
ttploc, sourcewindow) { try { //new obj_uri object var obj_uri = components.classes["@mozilla.org/network/io-service;1"].getservice(components.interfaces.nsiioservice).newuri(httploc, null, null); //new file object var obj_targetfile = components.classes["@mozilla.org/file/local;1"].createinstance(components.interfaces.nsilocalfile); //set file with path obj_targetfile.
initwithpath("c:\\temp\\test.pdf"); //if file doesn't exist, create if(!obj_targetfile.exists()) { obj_targetfile.create(0x00,0644); } //new persistence object var obj_persist = components.classes["@mozilla.org/embedding/browser/nswebbrowserpersist;1"].createinstance(components.interfaces.nsiwebbrowserpersist); // with persist flags if desired const nsiwbp = compone...
nsIWinTaskbar
on.version". for example, if the vendor is configured to "foobar systems", the application's name is "squashweb", and the application's version is 1.0, the defaultgroupid attribute would be "foobar systems.squashweb.1.0". see xul application packaging for additional details. methods createjumplistbuilder() retrieve a taskbar jump list builder. fails if a jump list build operation has already been
initiated, developers should make use of a single instance of nsijumplistbuilder for building lists within an application. nsijumplistbuilder createjumplistbuilder(); parameters none. return value an nsijumplistbuilder. createtaskbartabpreview() creates a taskbar tab preview, given an nsidocshell reference to a top-level window. nsitaskbartabpreview createtaskbartabpreview( in nsidocshell shell, ...
nsIWindowCreator
embedding/base/nsiwindowcreator.idlscriptable a callback interface used by gecko to create new browser windows. the application, either mozilla or an embedding app, must provide an implementation of the window watcher component and notify the windowwatcher during application
initialization. inherits from: nsisupports last changed in gecko 0.9.6 method overview nsiwebbrowserchrome createchromewindow(in nsiwebbrowserchrome parent, in pruint32 chromeflags); methods createchromewindow() create a new window. gecko will/may call this method, if made available to it, to create new windows. nsiwebbrowserchrome createchromewindow( in nsiwebbrowserchrome parent, in pruint32 chromeflags ); parameters parent the nsiwebbrowserchrome of the parent window, if any. null if no paren...
nsIWindowWatcher
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 requirement. 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 acurrentwindow); nsisimpleenume...
nsIXMLHttpRequest
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. the interface def
inition: //github.com/realityripple/uxp/blob/master/dom/xhr/nsixmlhttprequest.idl elevated privileges as mentioned in the "non-standard properties" the property of channel was read-only. when using the xpcom interface, as seen below in example 2, we can get access to this. the most obvious benefit is that we can set nsirequest - constants in the xhr.channel.loadflags. for instance, as done in exampl...
nsIXULWindow
void center( in nsixulwindow arelative, in boolean ascreen, in boolean aalert ); parameters arelative if not null, the window relative to which the window is moved. see ascreen parameter for details. ascreen true to center the window relative to the screen containing arelative if arelative is not null. if arelative is null then relative to the screen of the opener window if it was
initialized by passing it to nswebshellwindow::
initialize. failing that relative to the main screen. false to center it relative to arelative itself (arelative must be set in this case.) aalert true to move the window to an alert position, generally centered horizontally and 1/3 down from the top. createnewwindow() create a new window. nsixulwindow createnewwindow( in print32 achromeflags, i...
nsMsgRuleActionType
iltercore.idl typedef long nsmsgruleactiontype; [scriptable, uuid(59af7696-1e28-4642-a400-fa327ae0b8d8)] interface nsmsgfilteraction { /* if you change these, you need to update filter.properties, look for filteractionx */ /* these longs are all actually of type nsmsgfilteractiontype */ const long custom=-1; /* see nsmsgfilteraction */ const long none=0; /* un
initialized state */ const long movetofolder=1; const long changepriority=2; const long delete=3; const long markread=4; const long killthread=5; const long watchthread=6; const long markflagged=7; const long label=8; const long reply=9; const long forward=10; const long stopexecution=11; const long deletefrompop3server=12; const long leaveonpop3serv...
nsMsgSearchAttrib
the numerical order * from here will also be used to determine the order that the * attributes display in the filter editor. ...
XPCOM Interface Reference
icationcenternsidomelementnsidomeventnsidomeventgroupnsidomeventlistenernsidomeventtargetnsidomfilensidomfileerrornsidomfileexceptionnsidomfilelistnsidomfilereadernsidomfontfacensidomfontfacelistnsidomgeogeolocationnsidomgeopositionnsidomgeopositionaddressnsidomgeopositioncallbacknsidomgeopositioncoordsnsidomgeopositionerrornsidomgeopositionerrorcallbacknsidomgeopositionoptionsnsidomglobalproperty
initializernsidomhtmlaudioelementnsidomhtmlformelementnsidomhtmlmediaelementnsidomhtmlsourceelementnsidomhtmltimerangesnsidomjswindownsidommousescrolleventnsidommoznetworkstatsnsidommoznetworkstatsdatansidommoznetworkstatsmanagernsidommoztoucheventnsidomnshtmldocumentnsidomnavigatordesktopnotificationnsidomnodensidomofflineresourcelistnsidomorientationeventnsidomparsernsidomprogresseventnsidomserializ...
NS_CStringAppendData
sured in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null-terminated. return values the ns_cstringappenddata 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 nscstringcontainer str; ns_cstringcontainer
init(str); ns_cstringsetdata(str, "hello"); ns_cstringappenddata(str, " world"); const char* data; ns_cstringgetdata(str, &data); printf("%s\n", data); // prints out "hello world" ns_cstringcontainerfinish(str); history this function was frozen for mozilla 1.7. see bug 239123 for details. see also ns_cstringsetdatarange, nsacstring ...
NS_CStringContainerFinish
ry the ns_cstringcontainerfinish function releases any memory allocated by a nscstringcontainer instance. #include "nsstringapi.h" void ns_cstringcontainerfinish( nscstringcontainer& astring ); parameters astring [in] a nscstringcontainer instance that is no longer needed. history this function was finalized for mozilla 1.7. see bug 239123 for details. see also ns_cstringcontainer
init, ns_cstringcontainer
init2 ...
NS_CStringCutData
ngth 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 . example code nscstringcontainer str; ns_cstringcontainer
init(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_CStringInsertData
d in storage units. if equal to pr_uint32_max, then adata is assumed to be null-terminated. otherwise, adata need not be null terminated. return values the ns_cstringinsertdata 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_cstringcontainer
init(str); ns_cstringsetdata(str, "hello"); ns_cstringinsertdata(str, 5, " world"); const char* data; ns_cstringgetdata(str, &data); printf("%s\n", data); // prints out "hello world" ns_cstringcontainerfinish(str); history this function was frozen for mozilla 1.7. see bug 239123 for details. see also ns_cstringsetdatarange, nsacstring, nsacstring ...
NS_CStringSetData
haracter array to copy into 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. return values the ns_cstringsetdata function returns ns_ok if successful. otherwise, it returns an error code. example nscstringcontainer str; rv = ns_cstringcontainer
init(str); if (ns_succeeded(rv)) { rv = ns_cstringsetdata(str, "hello world"); if (ns_succeeded(rv)) { // now, pass |str| to some function expecting a |const nsacstring&| parameter. } ns_cstringcontainerfinish(str); } history this function was frozen for mozilla 1.7. see bug 239123 for details. see also nsacstring ...
NS_StringAppendData
e ns_stringappenddata 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 requires the -fshort-wchar option to compile this example since prunichar is an unsigned short. this example should compile by default under msvc. example code nsstringcontainer str; ns_stringcontainer
init(str); ns_stringsetdata(str, l"hello"); ns_stringappenddata(str, l" world"); const prunichar* data; ns_stringgetdata(str, &data); // data now points to the string: l"hello world" ns_stringcontainerfinish(str); history this function was frozen for mozilla 1.7. see bug 239123 for details. see also ns_stringsetdatarange, nsastring ...
NS_StringCutData
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 requires the -fshort-wchar option to compile this example since prunichar is an unsigned short. this example should compile by default under msvc. example code nsstringcontainer str; ns_stringcontainer
init(str); ns_stringsetdata(str, l"hello world"); // remove " world" portion of string ns_stringcutdata(str, 5, pr_uint32_max); const prunichar* data; ns_stringgetdata(str, &data); // data now ponts to the string: l"hello" ns_stringcontainerfinish(str); history this function was frozen for mozilla 1.7. see bug 239123 for details. see also ns_stringsetdatarange, nsastring ...
NS_StringInsertData
ns_stringinsertdata 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 requires the -fshort-wchar option to compile this example since prunichar is an unsigned short. this example should compile by default under msvc. example code nsstringcontainer str; ns_stringcontainer
init(str); ns_stringsetdata(str, l"hello"); ns_stringinsertdata(str, 5, l" world"); const prunichar* data; ns_stringgetdata(str, &data); // data now points to the string: l"hello world" ns_stringcontainerfinish(str); history this function was frozen for mozilla 1.7. see bug 239123 for details. see also ns_stringsetdatarange , nsacstring ...
NS_StringSetData
haracter array to copy into 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. return values the ns_stringsetdata function returns ns_ok if successful. otherwise, it returns an error code. example code nsstringcontainer str; rv = ns_stringcontainer
init(str); if (ns_succeeded(rv)) { rv = ns_stringsetdata(str, "hello world"); if (ns_succeeded(rv)) { // now, pass |str| to some function expecting a |const nsastring&| parameter. } ns_stringcontainerfinish(str); } history this function was frozen for mozilla 1.7. see bug 239123 for details. see also nsastring ...
nsStaticModuleInfo
#include "nsxpcom.h" struct nsstaticmoduleinfo { const char* name; nsgetmoduleproc getmodule; }; members name this member provides the name of the module as a null-terminated, ascii-valued character array. ...
Using nsCOMPtr
ter you've been using nscomptrs for a while, and you reach unfamiliar territory, or run into compiler errors; you may want to return to this document to get help from the reference manual or the faq. contents status, recent changes, and plans recent changes to nscomptr getting started guide introduction using nscomptr summary reference manual the basics
initialization and assignment using an nscomptr<t> as a t* efficiency and correctness compiler annoyances frequently asked questions buildtime errors runtime errors how do i... general bibliography original document information author(s): scott collins last updated date: december 11, 2001 copyright information: copyright © 1999, 2000 by the mozilla organi...
Working with Multiple Versions of Interfaces
. the problem now is not just interface identifier mismatch, but class declaration mismatch. getwindowhandle is the tenth method declared in the nsiaccessibledocument.h that firefox 2 was built with, but actually the eighth method in the sdk that i used to build my extension (and hence xpcom component). since these classes don't use vtables this means i'm probably, no i can be more positive, def
initely calling the wrong method. if i were a betting man, i'd hedge a bet on getaccessibleinparentchain, that being the tenth method in the interface declaration in the new sdk. in actual fact we were lucky we actually got as far as we did, since the very first interface we made use of has changed substantially. if there is any truth to the story i weave here, then this is because getaccessiblefor is...
XPCOM tasks
is progressing on this. see in particular, the new ns_interface_map_... macros in "nsisupportsutils.h". p1 we need to use ns_get_iid instead of ns_define_iid. see bug 25886. work is progressing on this. p2 classes that parallel standard library classes should have compatible apis, i.e., nsdeque bug 18505 nsstring nsavltree nshashtable our various array classes in some cases, this might
initially be provided by additional interfaces. in all cases, we want to transition the primary apis toward the standard. p2 our various enumerator classes should be made compatible with the enumerators from the standard c library, so that we can apply the standard algorithms to our containers. this is probably best done with a c wrapper around an xpcom enumerator. p2 do we still require our own ve...
XSLT 2.0
uses the new incarnation of liveconnect (handled by java 1.6v12+ instead of mozilla-specific code) to connect with the java-based saxon-b library, and adds support for having xslt performed automatically when visiting a page with the appropriate xslt processing instruction (and which isn't processed by firefox's own xslt 1.0 processor). for developers saxon-ce a javascript api is provided for
initiating an xslt 2.0 transform from a web page. error and diagnostics output from saxon-ce can be reviewed in the firefox developer console or in firebug. saxon-b the extension demonstrates how one can use liveconnect code to communicate with the saxon-b library, but one might find the javascript code module approach used inside the extension xquseme as a more reusable approach. the code does not...
XUL Overlays
toolbars, submenus, boxes, and any other subtrees that appear in multiple places can be defined in overlays files in this way and referenced for reuse wherever necessary. see also chapter 12 "overlays and chrome" of "rapid application development with mozilla" "overlays", "cross package overlays of xul tutorial ...
Address Book examples
setproperty("random2", "foo"); ... my value = card.getproperty("random1"); note: local (mork) address books are currently the only built-in type of address book that supports saving of non-built-in properties. however, outlook directories are the only other built-in write capable directories. ...
Autoconfiguration in Thunderbird
many cases, people should be able to download and install thunderbird, enter their real name, email address and password in the account setup wizard and have a fully functioning mail client and get and send their mail as securely as possible. see also: for instructions for users, see automatic account configuration on the thunderbird knowledge base. the configuration file description and def
inition the original project page on the mozilla wiki for background, design, implementation and project details this document describes how autoconfiguration in thunderbird works, and what to do to allow mail servers to be autoconfigured. mechanisms thunderbird gets the server settings via different means, each of which is intended for different cases: ispdb the ispdb is a central database,...
Events
such as those created by the dom. others are internal to gecko or other parts of mozilla application code. this reference will help you track those events down and learn how to use them. composition event name event type fired when... compose-send-message a message gets sent compose-window-close a compose window gets closed compose-window-
init a compose window has been opened compose-window-reopen a cached compose window has been reopened. no load event is fired in this case. folders event name event type fired when... msgcreatedbview onactivecreatedview onactivemessagesloaded the active messages in the folder have been loaded oncre...
Filelink Providers
{ "username": {type: "char", value: usernamevalue}, }; } in this example, the username value is read from the input, and then the specially-crafted object is returned. once this is done, the field is accessible from within the implementation via the preferences api using the key mail.cloud_files.accounts.account_key.username where account_key is the value passed into the implementations
init function. the hightail settings.xhtml and settings.js file have examples of this. management interface once an account has been created, it is manageable from within the preferences dialog, in the attachment pane, in the outgoing tab. the content to the right of the menulist is an iframe, pointed at a url read from the providers managementurl attribute, which should point to an xhtml page. ...
MailNews fakeserver
cle, with the additional properties: flags, keys (array of keys), nextkey (next key to use for new articles) getgroupstats group name array of [size, min, max] the size is an estimate if nntp_real_length is not specified in the daemon flags. getarticle message id newsarticle object pretty self-explanatory newsarticle api name arguments returns notes [constructor] text (as a string) n/a
initializes all fields headers (property) map of header (lower-case) -> value body (property) text of body messageid (property) message id fulltext (property) full text as message without modification except added headers. ...
MailNews Protocols
op3incomingserver, nsimapincomingserver, nsnntpincomingserver. a folder class, which implements nsimsgfolder, and inherits from nsmsgdbfolder. most commands/operations go through the folder object. nsimapmailfolder, nsnewsfolder, nslocalmailfolder (for pop3) a service class, which generally sits between the folder object or the server object, and the protocol object. the service class creates and
initializes the url object for the operation, and hands that off to a protocol object to run. the service classes usually have their own interface, but they also implement nsimsgmessageservice. a url object. these implement nsimsgmailnewsurl, inherit from base/util/nsmsgmailnewsurl, and implement their own protocol-specific interface (nsiimapurl, nsinntpurl, nsipop3url). a protocol object that takes a...
Adding items to the Folder Pane
// only insert our nodes into the "all" mode if (gfoldertreeview.mode != "all") return; gfoldertreeview._rowmap.push(containerrow); }, right now, clicking on these additional items has no effect. however, the complete example file includes code to display the number selected in thunderbird's main viewing pane, when such a number is selected in the folder pane. a note about the
initial rebuild when thunderbird first starts up, the folder pane does an
initial rebuild to get the first data it should display. unfortunately, this rebuild will occur before an extension's "load" event fires. thus, extensions may need to do manual insertions when this load event fires, if they want to add items to the
initial display. add_code.js also includes code to accomplish this result. ...
Building a Thunderbird extension 2: extension file layout
/defaults/preferences/ //building an extension# defaults files the following tutorial pages will explain how to write each of these files (except locale/ and defaults/) and package them into an xpi (zippy) file. you can find information about the locale/ and defaults/ folders in the more general "building an extension" documentation. to start with the tutorial, manually create the
initial directory structure for the extension as it is depicted above in a folder called myfirstext@jen.zed. this directory could be created anywhere on your filesystem. « previous next » ...
Filter Incoming Mail
e, true); // here with have a string to modify with javascript. by example, setting it to lower case subject = subject.tolocalelowercase(); // then we rebuild a subject objet by rencoding the string // and assign it to the message headers and we're done amsghdr.subject = mimeconvert.encodemimepartiistr_utf8(subject, false, "utf-8", 0, 72); } } }; function
init() { var notificationservice = components.classes["@mozilla.org/messenger/msgnotificationservice;1"] .getservice(components.interfaces.nsimsgfoldernotificationservice); notificationservice.addlistener(newmaillistener, notificationservice.msgadded); } addeventlistener("load",
init, true); have a look to nsimsgdbhdr to get the full list of properties to be modified. you can take a look a...
Use SQLite
ll create an sqlite db named tbird.sqlite inside your profile directory with a table called attachments. you can see the schema for the attachments table in the code. to double check the information you've inserted you can query the tbird.sqlite file using regular sqlite programs. const cc = components.classes; const ci = components.interfaces; var tbirdsqlite = { onload: function() { //
initialization code this.
initialized = true; this.db
init(); }, dbconnection: null, dbschema: { tables: { attachments:"id integer primary key, \ name text \ encoded text not null" } }, db
init: function() { var dirservice = cc["@mozilla.org/file/directory_service;1"]. getservice(ci.nsiproperties...
Tips and Tricks from the newsgroups
sageuri, folderuri and gdbview are unknown) determine whether a message has been flagged as junk imap: getting message key of copied message by nsimsgcopyservice::copyfilemessage access the plain text content of the email body get information about attachment without selecting message repeat image display using css sprites scan for new messages at startup and manually scan a folder
initiated by user force listeners to run consecutively to prevent pop messages from getting garbled during message retrieval ...
Toolkit version format
-numeric ascii characters. a few examples of valid version parts: 0 (as in 1.0): <number-a>=0 5a (as in 1.5a): <number-a>=5, <string-b>=a 5pre4 (as in 3.5pre4): <number-a>=5, <string-b>=pre, <number-c>=4 * (as in 1.0.*): <string-b>=* a few special parsing rules are applied for backwards compatibility and readability: if the version part is a single asterisk, it is interpreted as an inf
initely-large number: 1.5.0.* is the same as 1.5.0.(inf
inity) if string-b is a plus sign, number-a is incremented to be compatible with the firefox 1.0.x version format: 1.0+ is the same as 1.1pre the rationale behind splitting a version part into a sequence of strings and numbers is that when comparing version parts, the numeric parts are compared as numbers, e.g. '1.0pre1' < '1.0pre10', while...
Using tab-modal prompts
var window = gbrowser.contentwindow; var promptfact = components.classes['@mozilla.org/prompter;1'].getservice(components.interfaces.nsipromptfactory); var prompt = promptfact.getprompt(window, components.interfaces.nsiprompt); var promptbag = prompt.queryinterface(components.interfaces.nsiwritablepropertybag2); promptbag.setpropertyasbool('allowtabmodal', true); var check = {value: false}; //
initial state of checkbox, however if no text is supplied the checkbox is not shown var input = {value: 'pre filled value'}; var ok = prompt.prompt.apply(null, ['title - but not shown in tab modal', 'text goes here', input, 'check text, if no text, checkbox is not shown', check]); //this here is just an alert, showing the values of the prompt prompt.alert.apply(null, ['title not shown in modal', 'use...
Working with windows in chrome code
d nsidomwindow, but it also contains the user-defined properties for global variables and functions of the window. so, for example, to access the dom document corresponding to the window, you can use win.document. note however, that the open() call returns before the window is fully loaded, so some calls, like win.document.getelementbyid() will fail. to overcome this difficulty, you can move the
initialization code to a load handler of the window being opened or pass a callback function, as described below. you can get a window object from a document using document.defaultview. content windows when a xul window contains a widget capable of displaying a page, such as <browser> or <iframe>, the document in that widget is, naturally, separate from the document of the chrome window itself. the...
Examples
js-ctypes an example how to use com api of windows systems from js-ctypes, by converting c++ code to c code. using jni from js-ctypes an example how to use java from js-ctypes, by converting java code into c code. js-macosx an extension that demonstrates javascript-cocoa bridge for mac os x. lightweight bridge for calling cocoa frameworks from javascript, js-macosx transparently handles def
inition of cocoa api, both c and objective-c, and provides automatic declarations for framework functions, structures, constants and enumerations, as well as allows creating and subclassing cocoa classes. the js-macosx bridge has dependency on bridgesupport metadata: whenever a cocoa class, function, struct or const is encountered in the javascript code, js-macosx will replace it with the correspon...
Type conversion
owing rules are applied: boolean type target type source converted value ctype.bool js value toboolean(src) console.log(ctypes.bool("123").tostring()); // 'ctypes.bool(true)' console.log(ctypes.bool("").tostring()); // 'ctypes.bool(false)' integer types target type source converted value any integer types js number except -inf
inity, inf
inity, nan c-style cast -inf
inity 0 inf
inity nan ctypes.int64 c-style cast ctypes.uint64 js string with base-10 or base-16 string (only if fits to the size) parse src as base-10 or base-16 string console.log(ctypes.int32_t(inf
inity).tostring()); // 'ctypes.int32_t(0)' console.log(ctypes.int32_t("0xff").tostr...
PKCS #11 Netscape Trust Objects - Network Security Services
value description ck_untrusted explicitly untrusted. ck_unknown trust is unknown and should be determined elsewhere. ck_trusted explicitly trusts the certificate referred to in the trust object. ckt_trusted_delegator trusts the certificate as a certificate authority, and delegates trust (for the purpose) to other signed certificates. def
initions def
initions for all of the above values are defined in pkcs11n.h in the nss source. ...
Blocking By Domain - Plugins
ut plugins, but still prompt users for activation. in order to improve site performance and reduce the number of plugin prompts that users see, popular sites that show unnecessary plugin prompts or slow the browser down with unnecessary plugins will be added to the plugin block list. list contents and updates the plugin block lists are freely-licensed lists maintained by mozilla in github. the
initial contents of the third-party plugin block list are based on disconnect's open source blocklist. subsequent updates to the list will be made using telemetry from firefox experiments. in general, sites will not be removed from the list unless there is an error that renders a site in a seriously defective manner. any concerns or questions about the plugin block lists should be directed to plugin-...
Browser Side Plug-in API - Plugins
sh requests that the browser free a specified amount of memory. npn_memfree deallocates a block of allocated memory. npn_newstream requests the creation of a new data stream produced by the plug-in and consumed by the browser. npn_pluginthreadasynccall thread-safe way to request that the browser calls a plug-in function on the browser or plug-in thread (the thread on which the plug-in was
initiated). npn_poppopupsenabledstate pops the popups-enabled state. npn_posturl posts data to a url. npn_posturlnotify posts data to a url, and receives notification of the result. npn_pushpopupsenabledstate pushes the popups-enabled state. npn_reloadplugins reloads all plug-ins in the plugins directory. npn_requestread requests a range of bytes for a seekable stream. npn_setvalue set...
Plug-in Development Overview - Plugins
unction should return a string containing the type, extension list, and type description separated by colons. each mime types should be separated by semicolons. for example: image/xbm:xbm:x bitmap or for 2 mime types: image/xbm:xbm:x bitmap;image/png:png:portable network graphics. this information will then appear in the navigator.mimetypes dom object. npp_getvalue is called after the plug-in is
initialized to get the scripting interface while np_getvalue is called during
initialization to retrieve the plug-in's name and description, which will appear in the navigator.plugins dom object which is used to populate about:plugins. caution: gecko caches the values returned by these functions and will only call it if the plug-in's timestamp has changed. see bug 125469. mac os x mac os x plug-i...
Scripting plugins - Plugins
alue that has been added to the nppvariable enumeration. the new nppvariable enumeration is defined in npapi.h as: nppvpluginscriptablenpobject = 15 threading model this api is not designed to be thread safe. the threading model for this api is such that all calls through this api are synchronous and calls from a plugin to methods in this api must come from the thread on which the plugin was
initiated, and likewise all calls to methods in this api by the browser are guaranteed to come from the same thread. future revisions to this api might provide a mechanism for proxying calls from one thread to another to aid in using this api from other threads. security model the security model for making calls through this api is much like the general same-origin security model enforced by the bro...
Version, UI, and Status Information - Plugins
rowser, this information can help you. the plug-in calls the npn_useragent method to retrieve the contents of the user_agent field. const char* npn_useragent(npp instance); the instance parameter represents the current plug-in instance. this function returns a string that contains the user_agent field of the browser. getting the current version your plug-in should make sure, possibly during
initialization, that the version of the plug-in api it is using is compatible with the version the browser is using. to do so, it must find the major and minor version numbers, which are determined when the plug-in and navigator are compiled, and compare them. if the versions are not compatible, the plug-in can let the user know. the plug-in can also use the version number to find out whether a partic...
Accessibility Inspector - Firefox Developer Tools
ml pane of the page inspector, and choose show accessibility properties in the context menu. once activated, the accessibility engine remains running until you close the developer tools toolbox. if you don't wish to allow the accessibility features to be automatically enabled, you can use the configuration editor (also known as about:config) to define the preference devtools.accessibility.auto-
init.enabled, and set it to false. if you don't wish to use the accessibility features at all, you can use the configuration editor to set the preference devtools.accessibility.enabled to false. if you do this, the ways listed above for activating the accessibility inspector do nothing. features of the accessibility panel the enabled accessibility panel looks like so: on the left-hand side, ther...
Debugging service workers - Firefox Developer Tools
e individual items stored in the cache, then right/ctrl click on it to get options for deleting just that item, or every item in the cache. these options make it much easier to remove a cache if it is required for testing a code update. it is also worth knowing that if you are testing an app's offline capabilities, you'll be able to see whether requests are being retrieved from a service worker-
initiated cache rather than from the network by looking at network monitor. resources retrieved from the cache are indicated with service worker in the transferred column. note: there is currently a bug whereby the network monitor cannot show network requests from a service worker running in a different process to the application (bug 1432311). finding registered service workers on other domain...
UI Tour - Firefox Developer Tools
ore files outside this directory causes all files other than those within the selected directory to be skipped by the debugger. all such files acquire the eye icon, and the menu option for that folder changes to unignore files outside this directory. outline view the outline view shows a tree for navigating the currently open file. use it to jump directly to a function, class or method def
inition. source pane this shows the javascript file currently loaded. when the source pane is focused you can search for a string in the file using ctrl + f (cmd + f on a mac). breakpoints have a blue arrow overlaid on the line number. conditional breakpoints have an orange arrow. if you're stopped at a breakpoint, the entire line gets a green overlay. in the screenshot below there are three break...
Debugger.Environment - Firefox Developer Tools
a declarative environment record, this accessor throws a typeerror (since declarative environment records have no such object). both "object" and "with" environments have object properties that provide the object whose properties they reflect as variable bindings. callee if this environment represents the variable environment (the top-level environment within the function, which receives var def
initions) for a call to a functionf, then this property’s value is a debugger.object instance referring tof. otherwise, this property’s value is null. optimizedout true if this environment is optimized out. false otherwise. for example, functions whose locals are never aliased may present optimized-out environments. when true, getvariable returns an ordinary javascript object whose optimizedout ...
Debugger.Script - Firefox Developer Tools
e we have a script for the following source code: a=[] for (i=1; i < 10; i++) // it's hip to be square. a[i] = i*i; calling getalloffsets() on that code might yield an array like this: [[0], [5, 20], , [10]] this array indicates that: the first line’s code starts at offset 0 in the script; the for statement head has two entry points at offsets 5 and 20 (for the
initialization, which is performed only once, and the loop test, which is performed at the start of each iteration); the third line has no code; and the fourth line begins at offset 10. if the instance refers to webassembly code, throw a typeerror. getallcolumnoffsets(): if the instance refers to a jsscript, return an array describing the relationship between bytecode in...
All keyboard shortcuts - Firefox Developer Tools
nsole output (only if the command line is empty) end end end page up through console output page up page up page up page down through console output page down page down page down go backward through command history up arrow up arrow up arrow go forward through command history down arrow down arrow down arrow
initiate reverse search through command history/step backwards through matching commands f9 ctrl + r f9 step forward through matching command history (after
initiating reverse search) shift + f9 ctrl + s shift + f9 move to the beginning of the line home ctrl + a ctrl + a move to the end of the line end ctrl + e ctrl + e execute th...
Aggregate view - Firefox Developer Tools
objects). let's get an allocation trace: open the memory tool check "record call stacks" load https://mdn.github.io/performance-scenarios/dom-allocs/alloc.html take a snapshot select "view/aggregate" select "group by/call stack" you should see something like this: this is telling us that 93% of the total heap snapshot was allocated in functions called from "alloc.js", line 35 (our
initial createtoolbars() call). we can use the disclosure arrow to expand the tree to find out exactly where we're allocating memory: this is where the "bytes" and "count" columns are useful: they show allocation size and number of allocations at that exact point. so in the example above, we can see that we made 4002 allocations, accounting for 89% of the total heap, in createtoolbarbutton(), at ...
Monster example - Firefox Developer Tools
; makemonstersbutton.addeventlistener("click", makemonsters); the page contains a button: when you push the button, the code creates some monsters. specifically: the code creates an object with three properties, each an array: one for fierce monsters one for friendly monsters one for monsters who haven't decided yet. for each array, the code creates and appends 5000 randomly-
initialized monsters. each monster has: a string, for the monster's name a number representing the number of eyes it has a number representing the number of tentacles it has. so the structure of the memory allocated on the javascript heap is an object containing three arrays, each containing 5000 objects (monsters), each object containing a string and two integers: ...
Network request details - Firefox Developer Tools
shown since firefox 62 (bug 1452715). params tab this tab displays the get parameters and post data of a request: response tab the complete content of the response. if the response is html, js, or css, it will be shown as text: if the response is json, it will be shown as an inspectable object: if the response is an image, the tab displays a preview: for network responses that are
initiated by a websocket connection, the details pane shows any associated messages. for more information, see inspecting web sockets. cache tab if the response is cached (i.e. a 304), the cache tab displays details about that cached resource. these details include: last fetched: the date the resource was last fetched fetched count: the number of times in the current session that the resource...
Network request list - Firefox Developer Tools
cleared each time you navigate to a new page or reload the current page. you can override this behavior by checking "enable persistent logs" in the settings. network request columns you can toggle columns on and off by right-clicking on the table header and choosing the specific column from the context menu. a reset columns command is available on the context menu to reset the columns to their
initial configuration. you can also change the width of the columns to help make the information you are looking for easier to view. the mouse pointer changes to a resize icon when you move it over the border of a column. you can drag to manually set the size of column. starting in firefox 76 you can double-click a column divider to resize the column to the left of it to fit its contents. the reset ...
Examine and edit CSS - Firefox Developer Tools
so remember, as noted above, that changes you make to the css rules are temporary and will be reset if you reload the page. if you are satisfied with the changes you have made, you can copy the new settings to page the edited rule into your stylesheet. right-click on the changes panel and select copy rule from the context menu. the copy rule command copies the entire element, class, or id def
inition, including any unchanged rules and the rules that describe your changes. for example, copying the changes in the preceding image, you get the following: .text-content p { box-sizing:border-box; max-width:24rem; text-decoration: underline; color: cadetblue; font-weight: bold; } add rules you can add new rules in the rules view. just right-click to show the context menu and select "add r...
Work with animations - Firefox Developer Tools
n the element. animation details if you click one of the bars, you'll see details of all the properties that were changed in the animation. for example, try clicking on the bar for img#icon's animation: this is telling us that two properties were modified: filter and transform. each dot represents an entry for that property in the set of keyframes used for the animation. both properties were
initialized at 0ms and finalized at 750ms. filter was given a value at 250ms and transform at 500ms. if you hover over a dot, you'll see the value assigned to that property at that point in the timeline: this is essentially a visual representation of the animation's keyframes: var iconkeyframeset = [ { transform: 'scale(1)', filter: 'grayscale(100%)' }, { ...
Waterfall - Firefox Developer Tools
in response to a dom event. event type for example, "click" or "message". event phase for example, "target" or "capture". javascript functions executed in the page are labeled with the reason the function was called: script tag setinterval settimeout requestanimationframe promise callback promise
init worker javascript uri event handler stack call stack, with links to functions. parse html time spent parsing the page's html. stack call stack, with links to functions. parse xml time spent parsing the page's xml. stack call stack, with links to f...
Cookies - Firefox Developer Tools
the value of this column will be "session" size — the size of the cookie name plus value in bytes. httponly — is this cookie http only? secure — is this cookie a secure cookie? samesite — is this cookie a same-site cookie? same-site cookies allow servers to mitigate the risk of csrf and information leakage attacks by asserting that a particular cookie should only be sent with requests
initiated from the same registrable domain. last accessed — date and time when the cookie was last read. created — date and time when the cookie was created. hostonly — is this cookie a domain cookie? that is, the domain value matches exactly the domain of the current website. note: some of the columns are not shown by default — to change the column display, right-click on the existing t...
Tips - Firefox Developer Tools
t it within the inspector. check "enable persistent logs" in the settings to keep logged messages from before even after navigation. check "enable timestamps" in the settings to show timestamps besides the logged messages. debugger skip javascript libraries in debugging sessions via the black box icon (). press ctrl+alt+f to search in all scripts. press ctrl+d to search for a function def
inition. press ctrl+l to go to a specific line. style editor the black box icon () in the style sheet pane toggles the visibility of a style sheet. click an @media rule to apply it in responsive design mode. click the import button () to import a style sheet or the create button () to create a new one. click the options button in the style sheet pane and click "show original sources" to toggl...
Web console keyboard shortcuts - Firefox Developer Tools
nsole output (only if the command line is empty) end end end page up through console output page up page up page up page down through console output page down page down page down go backward through command history up arrow up arrow up arrow go forward through command history down arrow down arrow down arrow
initiate reverse search through command history/step backwards through matching commands f9 ctrl + r f9 step forward through matching command history (after
initiating reverse search) shift + f9 ctrl + s shift + f9 move to the beginning of the line home ctrl + a ctrl + a move to the end of the line end ctrl + e ctrl + e execute th...
about:debugging (before Firefox 68) - Firefox Developer Tools
orkers other workers, including chrome workers and dedicated workers you can connect the developer tools to each worker, and send push notifications to service workers. service worker state from firefox 52, the list of service workers shows the state of the service worker in its lifecycle. three states are distinguished: "registering": this covers all states between the service worker's
initial registration, and its assuming control of pages. that is, it subsumes the "installing", "activating", and "waiting" states. "running": the service worker is currently running. it's installed and activated, and is currently handling events. "stopped": the service worker is installed and activated, but has been terminated after being idle. this section uses a simple serviceworker demo, ho...
about:debugging - Firefox Developer Tools
all registered shared workers other workers, including chrome workers and dedicated workers you can connect the developer tools to each worker, and send push notifications to service workers. service worker state the list of service workers shows the state of the service worker in its lifecycle. three states are possible: registering: this covers all states between the service worker's
initial registration, and its assuming control of pages. that is, it subsumes the installing, activating, and waiting states. running: the service worker is currently running. it's installed and activated, and is currently handling events. stopped: the service worker is installed and activated, but has been terminated after being idle. this section uses a simple serviceworker demo, hosted at htt...
ANGLE_instanced_arrays.drawArraysInstancedANGLE() - Web APIs
gl.invalid_enum error is thrown. if first, count or primcount are negative, a gl.invalid_value error is thrown. if gl.current_program is null, a gl.invalid_operation error is thrown. examples var ext = gl.getextension('angle_instanced_arrays'); ext.drawarraysinstancedangle(gl.points, 0, 8, 4); specifications specification status comment angle_instanced_arraysthe def
inition of 'angle_instanced_arrays' in that specification. recommendation
initial def
inition. ...
ANGLE_instanced_arrays.drawElementsInstancedANGLE() - Web APIs
a invalid multiple of the size of the given type, a gl.invalid_operation error is thrown. if count or primcount are negative, a gl.invalid_value error is thrown. examples var ext = gl.getextension('angle_instanced_arrays'); ext.drawelementsinstancedangle(gl.points, 2, gl.unsigned_short, 0, 4); specifications specification status comment angle_instanced_arraysthe def
inition of 'angle_instanced_arrays' in that specification. recommendation
initial def
inition. ...
ANGLE_instanced_arrays.vertexAttribDivisorANGLE() - Web APIs
x a gluint specifying the index of the generic vertex attributes. divisor a gluint specifying the number of instances that will pass between updates of the generic attribute. return value none. examples var ext = gl.getextension('angle_instanced_arrays'); ext.vertexattribdivisorangle(0, 2); specifications specification status comment angle_instanced_arraysthe def
inition of 'angle_instanced_arrays' in that specification. recommendation
initial def
inition. ...
AbsoluteOrientationSensor - Web APIs
latter for frequencies less than a second. the actual reading frequency depends device hardware and consequently may be less than requested. referenceframe: either 'device' or 'screen'. the default is 'device'. specifications specification status comment generic sensor api candidate recommendation defines sensors in general. orientation sensorthe def
inition of 'absoluteorientationsensor' in that specification. candidate recommendation ...
AbstractRange.collapsed - Web APIs
ange interface returns true if the range's start position and end position are the same. syntax var iscollpased = range.collapsed value a boolean value which is true if the range is collapsed. a collapsed range is one in which the start and end positions are the same, resulting in a zero-character-long range.. specifications specification status comment domthe def
inition of 'collapsed' in that specification. living standard static rangethe def
inition of 'collapsed' in that specification. editor's draft
initial def
inition. ...
AbstractRange.endContainer - Web APIs
the endcontainer property of the abstractrange interface returns the node in which the end of the range is located. syntax var endnode = range.endcontainer value the dom node which contains the final character of the range. specifications specification status comment domthe def
inition of 'endcontainer' in that specification. living standard static rangethe def
inition of 'endcontainer' in that specification. editor's draft
initial def
inition. ...
AbstractRange.endOffset - Web APIs
the endoffset property of the abstractrange interface returns the offset into the end node of the range's end position. syntax var endoffset = range.endoffset; value an integer value indicating the number of characters into the node indicated by endcontainer at which the final character of the range is located. specifications specification status comment domthe def
inition of 'endoffset' in that specification. living standard static rangethe def
inition of 'endoffset' in that specification. editor's draft
initial def
inition. ...
AbstractRange.startContainer - Web APIs
the read-only startcontainer property of the abstractrange interface returns the start node for the range. syntax var startnode = range.startcontainer value the dom node inside which the start position of the range is found. specifications specification status comment domthe def
inition of 'startcontainer ' in that specification. living standard static rangethe def
inition of 'startcontainer' in that specification. editor's draft
initial def
inition. ...
BasicCardResponse.billingAddress - Web APIs
onary, and may look something like this: { "cardnumber' : '9999999999999999", "cardholdername' : 'mr. dick straw", "cardsecuritycode" : "999", "expirymonth" : "07", "expiryyear" : "2021", "billingaddress" : { "country" : "gb", // etc. billing address is a paymentaddress object } } specifications specification status comment basic card paymentthe def
inition of 'billingaddress' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome ...
BasicCardResponse.cardNumber - Web APIs
onary, and may look something like this: { "cardnumber' : '9999999999999999", "cardholdername' : 'mr. dick straw", "cardsecuritycode" : "999", "expirymonth" : "07", "expiryyear" : "2021", "billingaddress" : { "country" : "gb", // etc. billing address is a paymentaddress object } } specifications specification status comment basic card paymentthe def
inition of 'cardnumber' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for ...
BasicCardResponse.cardSecurityCode - Web APIs
onary, and may look something like this: { "cardnumber' : '9999999999999999", "cardholdername' : 'mr. dick straw", "cardsecuritycode" : "999", "expirymonth" : "07", "expiryyear" : "2021", "billingaddress" : { "country" : "gb", // etc. billing address is a paymentaddress object } } specifications specification status comment basic card paymentthe def
inition of 'cardsecuritycode' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrom...
BasicCardResponse.cardholderName - Web APIs
onary, and may look something like this: { "cardnumber' : '9999999999999999", "cardholdername' : 'mr. dick straw", "cardsecuritycode" : "999", "expirymonth" : "07", "expiryyear" : "2021", "billingaddress" : { "country" : "gb", // etc. billing address is a paymentaddress object } } specifications specification status comment basic card paymentthe def
inition of 'cardholdername' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome ...
BasicCardResponse.expiryMonth - Web APIs
onary, and may look something like this: { "cardnumber' : '9999999999999999", "cardholdername' : 'mr. dick straw", "cardsecuritycode" : "999", "expirymonth" : "07", "expiryyear" : "2021", "billingaddress" : { "country" : "gb", // etc. billing address is a paymentaddress object } } specifications specification status comment basic card paymentthe def
inition of 'expirymonth' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for...
BasicCardResponse.expiryYear - Web APIs
onary, and may look something like this: { "cardnumber' : '9999999999999999", "cardholdername' : 'mr. dick straw", "cardsecuritycode" : "999", "expirymonth" : "07", "expiryyear" : "2021", "billingaddress" : { "country" : "gb", // etc. billing address is a paymentaddress object } } specifications specification status comment basic card paymentthe def
inition of 'expiryyear' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for ...
BasicCardResponse - Web APIs
onary, and may look something like this: { "cardnumber' : '9999999999999999", "cardholdername' : 'mr. dick straw", "cardsecuritycode" : "999", "expirymonth" : "07", "expiryyear" : "2021", "billingaddress" : { "country" : "gb", // etc. billing address is a paymentaddress object } } specifications specification status comment basic card paymentthe def
inition of 'basiccardresponse' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchro...
BatteryManager.level - Web APIs
if the system is not battery-powered. example html content <div id="level">(battery level unknown)</div> javascript content navigator.getbattery().then(function(battery) { var level = battery.level; document.queryselector('#level').textcontent = level; }); specifications specification status comment battery status api candidate recommendation
initial def
inition ...
BatteryManager.onchargingchange - Web APIs
ttery().then(function(battery) { battery.onchargingchange = chargingchange(); function chargingchange() { document.queryselector('#level').textcontent = battery.level; document.queryselector('#chargingtime').textcontent = battery.chargingtime; } }); specifications specification status comment battery status api candidate recommendation
initial def
inition ...
BatteryManager.onchargingtimechange - Web APIs
on(battery) { battery.onchargingtimechange = chargingtimechange(); function chargingtimechange(){ document.queryselector('#level').textcontent = battery.level; document.queryselector('#chargingtime').textcontent = battery.chargingtime; } }); specifications specification status comment battery status api candidate recommendation
initial def
inition ...
BatteryManager.ondischargingtimechange - Web APIs
ery) { battery.ondischargingtimechange = dischargingtimechange; function dischargingtimechange(){ document.queryselector('#level').textcontent = battery.level; document.queryselector('#chargingtime').textcontent = battery.chargingtime; } }); specifications specification status comment battery status api candidate recommendation
initial def
inition ...
BatteryManager.onlevelchange - Web APIs
document.queryselector('#statebaterry').textcontent = "charging time: " + (battery.chargingtime / 60); } else { document.queryselector('#statebaterry').textcontent = "discharging time: " + (battery.dischargingtime / 60); } }; }); specifications specification status comment battery status api candidate recommendation
initial def
inition ...
BatteryManager - Web APIs
zilla 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) eventhandler geteventhandler(domstring type) specifications specification status comment battery status api candidate recommendation
initial def
inition ...
Using the Beacon API - Web APIs
this document contains examples of the beacon interfaces. see beacon api for an overview. navigator.sendbeacon() the beacon api's navigator.sendbeacon() method sends a beacon request to the server in the global browsing context. the method takes two arguments: the url and the data to send. ...
Beacon API - Web APIs
example use cases of the beacon api are logging activity and sending analytics data to the server. example code of the interfaces described in this document is included in using the beacon api. ...
BlobEvent.BlobEvent() - Web APIs
the blobevent() constructor returns a newly created blobevent object with an associated blob. syntax blobevent = new blobevent({data: aspecificblob}[, timecode]); arguments the blobevent() constructor also inherits arguments from event(). data is a blob associated with the event. timecode optional a domhighrestimestamp to be used in
initializing the blob event. specifications specification status comment mediastream recordingthe def
inition of 'blobevent: blobevent' in that specification. working draft
initial def
inition. ...
BlobEvent.data - Web APIs
the blobevent.data read-only property represents a blob associated with the event. syntax associatedblob = blobevent.data specifications specification status comment mediastream recordingthe def
inition of 'blobevent.data' in that specification. working draft
initial def
inition. ...
BlobEvent.timecode - Web APIs
ifference between the timestamp of the first chunk in data, and the timestamp of the first chunk in the first blobevent produced by this recorder. note that the timecode in the first produced blobevent does not need to be zero. syntax var timecode = blobevent.timecode value a domhighrestimestamp. specifications specification status comment mediastream recordingthe def
inition of 'timecode' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for an...
Bluetooth - Web APIs
ue returned by this method. bluetooth.getdevices() returns a promise that resolved to an array of bluetoothdevices which the origin already obtained permission for via a call to bluetooth.requestdevice(). bluetooth.requestdevice() returns a promise to a bluetoothdevice object with the specified options. specifications specification status comment web bluetooththe def
inition of 'bluetooth' in that specification. draft
initial def
inition. ...
BluetoothRemoteGATTCharacteristic.getDescriptors() - Web APIs
hat resolves to an array of all bluetoothgattdescriptor objects for a given descriptor uuid. syntax bluetoothremotegattcharacteristic.getdescriptors(bluetoothdescriptoruuid).then(function(bluetoothgattdescriptors[]) { ... }) returns a promise that resolves to an array of bluetoothgattdescriptor objects. specifications specification status comment web bluetooththe def
inition of 'getdescriptors()' in that specification. draft
initial def
inition. ...
BluetoothRemoteGATTCharacteristic.value - Web APIs
cteristic.value read-only property returns currently cached characteristic value. this value gets updated when the value of the characteristic is read or updated via a notification or indication. syntax var value = bluetoothremotegattcharacteristic.value returns the currently cached characteristic value. specifications specification status comment web bluetooththe def
inition of 'value' in that specification. draft
initial def
inition. ...
BluetoothRemoteGATTCharacteristic - Web APIs
urns a promise. bluetoothremotegattcharacteristic.startnotifications() returns a promise when navigator.bluetooth is added to the active notification context. bluetoothremotegattcharacteristic.stopnotifications() returns a promise when navigator.bluetooth is removed from the active notification context. specifications specification status comment web bluetooththe def
inition of 'bluetoothremotegattcharacteristic' in that specification. draft
initial def
inition. ...
characteristic - Web APIs
the bluetoothremotegattdescriptor.characteristic read-only property returns the bluetoothremotegattcharacteristic this descriptor belongs to. syntax var characteristic = bluetoothremotegattcharacteristic.characteristic returns an instance of bluetoothremotegattcharacteristic. specifications specification status comment web bluetooththe def
inition of 'characteristic' in that specification. draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidope...
readValue() - Web APIs
advalue() method returns a promise that resolves to an arraybuffer holding a duplicate of the value property if it is available and supported. otherwise it throws an error. syntax bluetoothremotegattdescriptor.readvalue().then(function(value[]) { ... }) returns a promise that resolves to an arraybuffer. specifications specification status comment web bluetooththe def
inition of 'readvalue()' in that specification. draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for android...
uuid - Web APIs
the bluetoothremotegattdescriptor.uuid read-only property returns the uuid of the characteristic descriptor, for example '00002902-0000-1000-8000-00805f9b34fb' for theclient characteristic configuration descriptor. syntax var uuid = bluetoothremotegattdescriptor.uuid returns a uuid. specifications specification status comment web bluetooththe def
inition of 'uuid' in that specification. draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera f...
value - Web APIs
the bluetoothremotegattdescriptor.value read-only property returns an arraybuffer containing the currently cached descriptor value. this value gets updated when the value of the descriptor is read. syntax var characteristic = bluetoothremotegattdescriptor.characteristic returns an arraybuffer. specifications specification status comment web bluetooththe def
inition of 'value' in that specification. draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for an...
writeValue() - Web APIs
emotegattdescriptor.writevalue() method sets the value property to the bytes contained in an arraybuffer and returns a promise. syntax bluetoothremotegattdescriptor.writevalue(array[]).then(function() { ... }) parameters array sets the value with the bytes contained in the array. returns a promise. specifications specification status comment web bluetooththe def
inition of 'writevalue()' in that specification. draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androi...
BluetoothRemoteGATTDescriptor - Web APIs
iptor.readvalue() returns a promise that resolves to an arraybuffer holding a duplicate of the value property if it is available and supported. otherwise it throws an error. bluetoothremotegattdescriptor.writevalue() sets the value property to the bytes contained in an arraybuffer and returns a promise. specifications specification status comment web bluetooththe def
inition of 'bluetoothremotegattdescriptor' in that specification. draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewc...
BluetoothRemoteGATTServer.getPrimaryService() - Web APIs
viceuuid. syntax bluetoothremotegattserver.getprimaryservice(bluetoothserviceuuid).then(function(bluetoothgattservice) { ... }) returns a promise that resolves to a bluetoothgattservice object. parameters bluetoothserviceuuid a bluetooth service universally unique identifier for a specified device. specifications specification status comment web bluetooththe def
inition of 'getprimaryservice()' in that specification. draft
initial def
inition. ...
getCharacteristic() - Web APIs
characteristic(characteristic).then(function(bluetoothgattcharacteristic) { ... } ) returns a promise to an instance of bluetoothgattcharacteristic parameters characteristic the uuid of a characteristic, for example '00002a37-0000-1000-8000-00805f9b34fb' for the heart rate measurement characteristic. specifications specification status comment web bluetooththe def
inition of 'getcharacteristic()' in that specification. draft
initial def
inition. ...
ChannelMergerNode() - Web APIs
return value a new channelmergernode object instance. exceptions invalidstateerror an option such as channelcount or channelcountmode has been given an invalid value. example var ac = new audiocontext(); var options = { numberofinputs : 2 } var mymerger = new channelmergernode(ac, options); specifications specification status comment web audio apithe def
inition of 'channelmergernode' in that specification. working draft ...
ChannelMergerNode - Web APIs
reo image. gainnode.connect(merger, 0, 1); splitter.connect(merger, 1, 0); var dest = ac.createmediastreamdestination(); // because we have used a channelmergernode, we now have a stereo // mediastream we can use to pipe the web audio graph to webrtc, // mediarecorder, etc. merger.connect(dest); }); specifications specification status comment web audio apithe def
inition of 'channelmergernode' in that specification. working draft ...
ChannelSplitterNode.ChannelSplitterNode() - Web APIs
ining the number of inputs the channelsplitternode should have. if not specified, the default value used is 6. return value a new channelsplitternode object instance. example var ac = new audiocontext(); var options = { numberofoutputs : 2 } var mysplitter = new channelsplitternode(ac, options); specifications specification status comment web audio apithe def
inition of 'channelsplitternode' in that specification. working draft ...
ChannelSplitterNode - Web APIs
reo image. gainnode.connect(merger, 0, 1); splitter.connect(merger, 1, 0); var dest = ac.createmediastreamdestination(); // because we have used a channelmergernode, we now have a stereo // mediastream we can use to pipe the web audio graph to webrtc, // mediarecorder, etc. merger.connect(dest); }); specifications specification status comment web audio apithe def
inition of 'channelsplitternode' in that specification. working draft ...
Client.postMessage() - Web APIs
// send a message to the client. client.postmessage({ msg: "hey i just got a fetch from you!", url: event.request.url }); }()); }); receiving that message: navigator.serviceworker.addeventlistener('message', event => { console.log(event.data.msg, event.data.url); }); specifications specification status comment service workersthe def
inition of 'postmessage()' in that specification. working draft
initial def
inition. ...
Client - Web APIs
stmessage() sends a message to the client. properties client.id read only the universally unique identifier of the client as a string. client.type read only the client's type as a string. it can be "window", "worker", or "sharedworker". client.url read only the url of the client as a string. specifications specification status comment service workersthe def
inition of 'client' in that specification. working draft
initial def
inition. ...
Clients.get() - Web APIs
{ // do something with your returned client }); parameters id a domstring representing the id of the client you want to get. return value a promise that resolves to a client object or undefined. examples self.clients.get(id).then(function(client) { self.clients.openwindow(client.url); }); specifications specification status comment service workersthe def
inition of 'get()' in that specification. working draft
initial def
inition ...
Clients - Web APIs
chatclient = client; break; } } // if we didn't find an existing chat window, // open a new one: if (!chatclient) { chatclient = await clients.openwindow('/chat/'); } // message the client: chatclient.postmessage("new chat messages!"); }()); }); specifications specification status comment service workersthe def
inition of 'clients' in that specification. working draft
initial def
inition ...
Clipboard.readText() - Web APIs
tead. you can write text to the clipboard using writetext(). example this example retrieves the textual contents of the clipboard and inserts the returned text into an element's contents. navigator.clipboard.readtext().then( cliptext => document.getelementbyid("outbox").innertext = cliptext); specifications specification status comment clipboard api and eventsthe def
inition of 'readtext()' in that specification. working draft
initial def
inition. ...
Clipboard.writeText() - Web APIs
r does not have permission to write to the clipboard. example this example sets the clipboard's contents to the string "<empty clipboard>". navigator.clipboard.writetext("<empty clipboard>").then(function() { /* clipboard successfully set */ }, function() { /* clipboard write failed */ }); specifications specification status comment clipboard api and eventsthe def
inition of 'writetext()' in that specification. working draft
initial def
inition. ...
Clipboard - Web APIs
rd.writetext(). content scripts applied on http sites do not have access to the clipboard object. see extensions in firefox 63. in addition, read() and write() are disabled by default and require changing a preference to enable them. check the compatibility tables for each method before using it. specifications specification status comment clipboard api and eventsthe def
inition of 'clipboard' in that specification. working draft
initial def
inition. ...
ClipboardEvent - Web APIs
devent interface represents events providing information related to modification of the clipboard, that is cut, copy, and paste events. constructor clipboardevent() creates a clipboardevent event with the given parameters. properties also inherits properties from its parent event. clipboardevent.clipboarddata read only is a datatransfer object containing the data affected by the user-
initiated cut, copy, or paste operation, along with its mime type. methods no specific methods; inherits methods from its parent event. specifications specification status comment clipboard api and eventsthe def
inition of 'clipboardevent' in that specification. working draft
initial def
inition. ...
Comment() - Web APIs
the comment() constructor returns a newly created comment object with the optional domstring given in parameter as its textual content. syntax comment1 = new comment(); // create an empty comment comment2 = new comment("this is a comment"); example var comment = new comment("test"); specifications specification status comment domthe def
inition of 'comment: comment' in that specification. living standard
initial def
inition ...
CompositionEvent - Web APIs
hod that raised the event; its varies depending on the type of event that generated the compositionevent object. compositionevent.locale read only returns the locale of current input method (for example, the keyboard layout locale if the composition is associated with ime). methods this interface also inherits methods of its parent, uievent, and its ancestor — event. compositionevent.
initcompositionevent()
initializes the attributes of a compositionevent object. specifications specification status comment ui eventsthe def
inition of 'compositionevent' in that specification. working draft document object model (dom) level 3 events specificationthe def
inition of 'compositionevent' in that specification. obsolete ...
console.count() - Web APIs
r = ""; function greet() { console.count(user); return "hi " + user; } user = "bob"; greet(); user = "alice"; greet(); greet(); console.count("alice"); we will see output like this: "bob: 1" "alice: 1" "alice: 2" "alice: 3" we're now maintaining separate counts based only on the value of label. specifications specification status comment console apithe def
inition of 'console.count()' in that specification. living standard
initial def
inition ...
Console.countReset() - Web APIs
user = "bob"; greet(); user = "alice"; greet(); greet(); console.countreset("bob"); console.count("alice"); we will see output like this: "bob: 1" "alice: 1" "alice: 2" "bob: 0" "alice: 3" resetting the value of the counter "bob" only changes the value of that counter. the value of "alice" is unchanged. specifications specification status comment console apithe def
inition of 'console.countreset()' in that specification. living standard
initial def
inition ...
Console.dir() - Web APIs
the way to see all the properties of a specified javascript object in console by which the developer can easily get the properties of the object. note: this feature is available in web workers. syntax console.dir(object); parameters object a javascript object whose properties should be output. specifications specification status comment console apithe def
inition of 'console.dir()' in that specification. living standard
initial def
inition ...
Console.group() - Web APIs
l 2"); console.group(); console.log("level 3"); console.warn("more of level 3"); console.groupend(); console.log("back to level 2"); console.groupend(); console.log("back to the outer level"); the output looks like this: see using groups in the console in the documentation of console for more details. specifications specification status comment console apithe def
inition of 'console.group()' in that specification. living standard
initial def
inition ...
Console.timeEnd() - Web APIs
for the user to dismiss the second alert: notice that the timer's name is displayed when the timer value is logged using timelog() and again when it's stopped. in addition, the call to timeend() has the additional information, "timer ended" to make it obvious that the timer is no longer tracking time. specifications specification status comment console apithe def
inition of 'console.timeend()' in that specification. living standard
initial def
inition ...
Console.timeLog() - Web APIs
k for the user to dismiss the second alert: notice that the timer's name is displayed when the timer value is logged using timelog() and again when it's stopped. in addition, the call to timeend() has the additional information, "timer ended" to make it obvious that the timer is no longer tracking time. specifications specification status comment console apithe def
inition of 'console.timelog()' in that specification. living standard
initial def
inition ...
Console API - Web APIs
cific variable. interfaces console provides rudimentary debugging functionality, including logging, stack traces, timers, and counters. examples let mystring = 'hello world'; // output "hello world" to the console console.log(mystring) see the console reference page for more examples. specifications specification status comment console api living standard
initial def
inition. ...
ConstrainBoolean - Web APIs
value if it needs to in order to come up with a workable configuration. you can also specify the value of the property as simply true or false, in which case the user agent will use that value if possible once all efforts have been made to match the exact and ideal values for other properties. specifications specification status comment media capture and streamsthe def
inition of 'constrainboolean' in that specification. candidate recommendation
initial def
inition technically, constrainboolean is actually based on an intermediary dictionary named constrainbooleanparameters, which adds exact and ideal to the simple boolean type. however, for the sake of documentation clarity, the intermediate type (present only because of quirks in webidl syntax) is ign...
ConstrainDOMString - Web APIs
y can't be set to one of the listed values, matching will fail. ideal either a single domstring or an arrray of domstrings specifying ideal values for the property. if possible, one of the listed values will be used, but if it's not possible, the user agent will use the closest possible match. specifications specification status comment media capture and streamsthe def
inition of 'constraindomstring' in that specification. candidate recommendation
initial def
inition technically, constraindomstring is actually based on an intermediary dictionary named constraindomstringparameters, which adds exact and ideal to domstring. however, for the sake of documentation clarity, the intermediate type (present only because of quirks in webidl syntax) is ignored her...
ConstrainDouble - Web APIs
ouble-precision floating-point number specifying a specific, required, value the property must have to be considered acceptable. ideal a double-precision floating-point number specifying a value the property would ideally have, but which can be considered optional if necessary to find a match. specifications specification status comment media capture and streamsthe def
inition of 'constraindouble' in that specification. candidate recommendation
initial def
inition technically, constraindouble is actually based on an intermediary dictionary named constraindoublerange, which adds exact and ideal to doublerange, with constraindouble being a type that can be either a long integer or a doublerange. however, for the sake of documentation clarity, the intermed...
ConstrainULong - Web APIs
on to the properties it inherits from ulongrange. exact an integer specifying precise, required, value the property must have to be considered acceptable. ideal an integer specifying a value the property would ideally have, but which can be considered optional if necessary to find a match. specifications specification status comment media capture and streamsthe def
inition of 'constrainulong' in that specification. candidate recommendation
initial def
inition technically, constrainulong is actually based on an intermediary dictionary named constrainulongrange, which adds exact and ideal to ulongrange, with constrainulong being a type that can be either a long integer or a ulongrange. however, for the sake of documentation clarity, the intermediate t...
Constraint validation API - Web APIs
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 def
inition of 'constraint validation api' in that specification. living standard html 5.1the def
inition of 'constraint validation api' in that specification. recommendation no change from the previous snapshot html5. html5the def
inition of 'constraint validation api' in that specification. recommendation first snapshot of html living standard containing this interfac...
ContentIndex - Web APIs
le.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(); specifications specification status comment unknownthe def
inition of 'contentindex' in that specification. unknown
initial def
inition. ...
ContentIndexEvent.id - Web APIs
x id. the contentindexevent is only available to the {domxref('serviceworkerglobalscope','global scope')}} of a serviceworker. 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 def
inition of 'id' in that specification. unknown
initial def
inition. ...
DOMException() - Web APIs
ssage, name); parameters message optional a description of the exception. if not present, the empty string '' is used. name optional returns a domstring that contains one of the strings associated with an error constant. return value domexception a newly created domexception object. example tbd specifications specification status comment web idlthe def
inition of 'domexception()' in that specification. candidate recommendation adds the constructor for the domexception class. 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. desktopmobilechromeedgefirefoxinternet ex...
DOMException.code - Web APIs
face returns a short that contains one of the error code constants, or 0 if none match. this field is used for historical reasons. new dom exceptions don't use this anymore: they put this info in the domexception.name attribute. syntax var domexceptioncode = domexceptioninstance.code; value a short number. specifications specification status comment web idlthe def
inition of 'code' in that specification. candidate 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox...
DOMException.message - Web APIs
the message read-only property of the domexception interface returns a domstring representing a message or description associated with the given error name. syntax var domexceptionmessage = domexceptioninstance.message; value a domstring. specifications specification status comment web idlthe def
inition of 'message' in that specification. candidate 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetmessage...
DOMException - Web APIs
ant name). operationerror the operation failed for an operation-specific reason (no legacy code value and constant name). notallowederror the request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission (no legacy code value and constant name). specifications specification status comment web idlthe def
inition of 'constructor' in that specification. candidate recommendation adds the constructor for the domexception class. adds the notreadableerror, unknownerror, constrainterror, dataerror, transactioninactiveerror, readonlyerror, versionerror, operationerror, and notallowederror values. ...
DOMHighResTimeStamp - Web APIs
can do something like this: let starttime = performance.now(); /* ... do things for a while ... */ let elapsedtime = performance.now() - starttime; upon completion, the value of elapsedtime is the number of milliseconds that have elapsed since you recorded the starting time in line 1. specifications specification status comment high resolution time level 2the def
inition of 'domhighrestimestamp' in that specification. recommendation stricter def
initions of interfaces and types. high resolution timethe def
inition of 'domhighrestimestamp' in that specification. recommendation
initial def
inition. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, plea...
DOMImplementation.createHTMLDocument() - Web APIs
our new document into the new document's context. finally, line 20 actually replaces the contents of the frame with the new document's contents. view live examples the returned document is pre-constructed with the following html: <!doctype html> <html> <head> <title>title</title> </head> <body> </body> </html> specifications specification status comment domthe def
inition of 'domimplementation.createhtmldocument' in that specification. living standard
initial def
inition. ...
DOMImplementationList - Web APIs
urce.getdomimplementationlist() and domimplementationregistry.getdomimplementationlist() . can be iterated with 0-based index. properties domimplementationlist.length read only returns an integer. methods domimplementationlist.item() returns the pos item. specifications specification status comment document object model (dom) level 3 core specificationthe def
inition of 'domimplementationlist' in that specification. obsolete
initial def
inition. ...
DOMMatrixReadOnly() - Web APIs
the dommatrixreadonly constructor creates a new dommatrixreadonly object which represents 4x4 matrices, suitable for 2d and 3d operations. syntax var dommatrixreadonly = new dommatrixreadonly([
init]) parameters
init optional either a string containing a sequence of numbers or an array of integers specifying the matrix you want to create. specifications specification status comment geometry interfaces module level 1the def
inition of 'dommatrixreadonly' in that specification. candidate recommendation
initial def
inition. ...
DOMMatrixReadOnly.scale() - Web APIs
scaledmatrixwithorigin = matrix.scale(0.5, 0.5, 1, 25, 25, 0); } document.queryselector('#transformed').setattribute('transform', scaledmatrix.tostring()); document.queryselector('#transformedorigin').setattribute('transform', scaledmatrixwithorigin.tostring()); screenshotlive sample specifications specification status comment geometry interfaces module level 1the def
inition of 'dommatrixreadonly.scale()' in that specification. candidate recommendation
initial def
inition ...
DOMObject - Web APIs
the obsolete domobject interface was used in earlier versions of the dom specification as the base class for any object data type. the specifications now simply use the javascript object type. specifications specification status comment document object model (dom) level 3 core specificationthe def
inition of 'domobject' in that specification. obsolete
initial specification ...
DOMQuad - Web APIs
set of coordinates. domquad.fromquad() returns a new domquad object based on the passed set of coordinates. domquad.getbounds() returns a domrect object with the coordinates and dimensions of the domquad object. domquad.tojson() returns a json representation of the domquad object. specifications specification status comment geometry interfaces module level 1the def
inition of 'domquad' in that specification. candidate recommendation
initial def
inition. ...
DOMRect.DOMRect() - Web APIs
e height of the domrect. examples to create a new domrect, you could run a line of code like so: mydomrect = new domrect(0,0,100,100); // running 'mydomrect' in the console would then return // domrect { x: 0, y: 0, width: 100, height: 100, top: 0, right: 100, bottom: 100, left: 0 } specifications specification status comment geometry interfaces module level 1the def
inition of 'domrect()' in that specification. candidate recommendation
initial def
inition. ...
DOMRectReadOnly() - Web APIs
ly. examples to create a new dompoint, you could run a line of code like so: const mydomrect = new domrectreadonly(0, 0, 100, 100) // running 'mydomrect' in the console would then return // domrect { x: 0, y: 0, width: 100, height: 100, top: 0, right: 100, bottom: 100, left: 0 } specifications specification status comment geometry interfaces module level 1the def
inition of 'domrectreadonly()' in that specification. candidate recommendation
initial def
inition. ...
ExtendableMessageEvent.source - Web APIs
worker to respond to a push messages by sending the data received via pushmessagedata to the main context via a channel message, the event object of onmessage will be a extendablemessageevent. var port; self.addeventlistener('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === '
init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { console.log(e.source); port = e.ports[0]; } specifications specification status comment service workersthe def
inition of 'extendablemessageevent.source' in that specification. working draft
initial def
inition. ...
FeaturePolicy.allowedFeatures() - Web APIs
permissions api, if the user did not grant the corrsponding permission yet. // first, get the feature policy object const featurepolicy = document.featurepolicy // then query feature for specific const allowed = featurepolicy.allowedfeatures() for (const directive of allowed){ console.log(directive) } specifications specification status comment feature policythe def
inition of 'allowsfeature' in that specification. editor's draft
initial def
inition. ...
FeaturePolicy.allowsFeature() - Web APIs
responding permission yet. // first, get the feature policy object const featurepolicy = document.featurepolicy // then query feature for specific const allowed = featurepolicy.allowsfeature("camera") if (allowed){ console.log("fp allows camera.") } else { console.log("fp does not allows camera.") } specifications specification status comment feature policythe def
inition of 'allowsfeature' in that specification. editor's draft
initial def
inition. ...
FeaturePolicy.getAllowlistForFeature() - Web APIs
api, if the user did not grant the corrsponding permission yet. // first, get the feature policy object const featurepolicy = document.featurepolicy // then query feature for specific const allowlist = featurepolicy.getallowlistforfeature("camera") for (const origin of allowlist){ console.log(origin) } specification specification status comment feature policythe def
inition of 'getallowlistforfeature' in that specification. editor's draft
initial def
inition. ...
FederatedCredential.protocol - Web APIs
identity protocol. if this property is null, the protocol may be inferred from the federatedcredential.provider property. syntax var protocol = federatedcredential.protocol value a domstring containing a credential's federated identity protocol (e.g. openidconnect). examples // tbd specifications specification status comments credential management level 1the def
inition of 'protocol' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for and...
FederatedCredential.provider - Web APIs
provider property of the federatedcredential interface returns a usvstring containing a credential's federated identity provider. syntax var provider = federatedcredential.provider value a usvstring containing a credential's federated identity provider. example // tbd specifications specification status comments credential management level 1 working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung inte...
FetchEvent.clientId - Web APIs
worker is controlling. the clients.get() method could then be passed this id to retrieve the associated client. syntax var myclientid = fetchevent.clientid; value a domstring that represents the client id. example self.addeventlistener('fetch', function(event) { console.log(event.clientid); }); specifications specification status comment service workersthe def
inition of 'clientid' in that specification. working draft
initial def
inition. ...
FetchEvent.navigationPreload - Web APIs
sponse = await caches.match(event.request); if (cachedresponse) return cachedresponse; // else, use the preloaded response, if it's there const response = await event.preloadresponse; if (response) return response; // else try the network. return fetch(event.request); }()); }); specifications specification status comment service workersthe def
inition of 'navigationpreload' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchro...
FetchEvent.replacesClientId - Web APIs
ring. this could be used to access/communicate with a client that will imminently be replaced, right before a navigation. syntax var myreplacedclientid = fetchevent.replacesclientid; value a domstring. example self.addeventlistener('fetch', function(event) { console.log(event.replacesclientid); }); specifications specification status comment service workersthe def
inition of 'replacesclientid' in that specification. working draft
initial def
inition. ...
Fetch basic concepts - Web APIs
of the basic concepts of the fetch api. note: this article will be added to over time. if you find a fetch concept that you feel needs explaining better, let someone know on the mdn discussion forum, or mdn web docs room on matrix. in a nutshell at the heart of fetch are the interface abstractions of http requests, responses, headers, and body payloads, along with a global fetch method for
initiating asynchronous resource requests. because the main components of http are abstracted as javascript objects, it is easy for other apis to make use of such functionality. service workers is an example of an api that makes heavy use of fetch. fetch takes the asynchronous nature of such requests one step further. the api is completely promise-based. guard guard is a feature of headers objects...
Cross-global fetch usage - Web APIs
the edge case many sites will never comes up against this edge case. to see it: you need a same-origin iframe that same-origin iframe needs to have a location with a different base url you have to use the fetch function cross-global, e.g. ...
File.name - Web APIs
ithout path, such as "my resume.rtf". example <input type="file" multiple onchange="processselectedfiles(this)"> function processselectedfiles(fileinput) { var files = fileinput.files; for (var i = 0; i < files.length; i++) { alert("filename " + files[i].name); } } try the results out below: specifications specification status comment file apithe def
inition of 'name' in that specification. working draft
initial def
inition. ...
File.type - Web APIs
mmon file types like images, html documents, audio and video. uncommon file extensions would return an empty string. client configuration (for instance, the windows registry) may result in unexpected values even for common types. developers are advised not to rely on this property as a sole validation scheme. specifications specification status comment file apithe def
inition of 'type' in that specification. working draft
initial def
inition. ...
File - Web APIs
file contents. blob.prototype.text() transforms the file into a stream and reads it to completion. it returns a promise that resolves with a usvstring (text). blob.prototype.arraybuffer() transforms the file into a stream and reads it to completion. it returns a promise that resolves with an arraybuffer. specifications specification status comment file apithe def
inition of 'the file interface' in that specification. working draft
initial def
inition. ...
FileReader() - Web APIs
ollowing code snippet shows creation of a filereader object using the filereader() constructor and subsequent usage of the object: function printfile(file) { var reader = new filereader(); reader.onload = function(evt) { console.log(evt.target.result); }; reader.readastext(file); } specifications specification status comment file api working draft
initial def
inition ...
FileReader.readAsDataURL() - Web APIs
} } if (files) { [].foreach.call(files, readandpreview); } } note: the filereader() constructor was not supported by internet explorer for versions before 10. for a full compatibility code you can see our crossbrowser possible solution for image preview. see also this more powerful example. specifications specification status comment file apithe def
inition of 'readasdataurl()' in that specification. working draft
initial def
inition ...
FileReader.readyState - Web APIs
tate will be 0 reader.readastext(blob); console.log('loading', reader.readystate); // readystate will be 1 reader.onloadend = function () { console.log('done', reader.readystate); // readystate will be 2 }; value a number which is one of the three possible state constants define for the filereader api. specifications specification status comment file apithe def
inition of 'readystate' in that specification. working draft
initial def
inition ...
FileReaderSync.readAsArrayBuffer() - Web APIs
ointed by the resource is unsafe for a use from the web (like it is a system file). notreadableerror is raised when the resource cannot be read due to a permission problem, like a concurrent lock. encodingerror is raised when the resource is a data url and exceed the limit length defined by each browser. specifications specification status comment file apithe def
inition of 'readasarraybuffersync' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webview...
FileReaderSync.readAsBinaryString() - Web APIs
ointed by the resource is unsafe for a use from the web (like it is a system file). notreadableerror is raised when the resource cannot be read due to a permission problem, like a concurrent lock. encodingerror is raised when the resource is a data url and exceed the limit length defined by each browser. specifications specification status comment file apithe def
inition of 'readasbinarystringsync' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webvie...
FileReaderSync.readAsDataURL() - Web APIs
ointed by the resource is unsafe for a use from the web (like it is a system file). notreadableerror is raised when the resource cannot be read due to a permission problem, like a concurrent lock. encodingerror is raised when the resource is a data url and exceed the limit length defined by each browser. specifications specification status comment file apithe def
inition of 'readasdataurl' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome f...
FileReaderSync.readAsText() - Web APIs
ointed by the resource is unsafe for a use from the web (like it is a system file). notreadableerror is raised when the resource cannot be read due to a permission problem, like a concurrent lock. encodingerror is raised when the resource is a data url and exceed the limit length defined by each browser. specifications specification status comment file apithe def
inition of 'readastext' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for ...
FileReaderSync - Web APIs
t string. the optional encoding parameter indicates the encoding to be used (e.g., iso-8859-1 or utf-8). if not present, the method will apply a detection algorithm for it. filereadersync.readasdataurl() this method converts a specified blob or a file into a domstring representing the input data as a data url. specifications specification status comment file apithe def
inition of 'filereadersync' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome ...
FileSystem.name - Web APIs
roperty of the filesystem interface indicates the file system's name. this usvstring is unique among all file systems currently exposed by the file and directory entries api. syntax var fsname = filesystem.name; value a usvstring representing the file system's name. example // tbd specifications specification status comment file and directory entries apithe def
inition of 'name' in that specification. draft
initial 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfiref...
FileSystem.root - Web APIs
specifies a filesystemdirectoryentry object representing the root directory of the file system, for use with the file and directory entries api. syntax var rootdirent = filesystem.root; value a filesystemdirectoryentry representing the file system's root directory. example // tbd specifications specification status comment file and directory entries apithe def
inition of 'root' in that specification. draft
initial 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfiref...
FileSystem - Web APIs
e system's name. this name is unique among the entire list of exposed file systems. filesystem.root read only a filesystemdirectoryentry object which represents the file system's root directory. through this object, you can gain access to all files and directories in the file system. specifications specification status comment file and directory entries apithe def
inition of 'filesystem' in that specification. draft 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidop...
FileSystemDirectoryEntry.createReader() - Web APIs
ctory, concatenating each batch to the array. each iteration, readentries() is called to get more entries. when it returns an empty array, the end of the directory has beenr reached, and the recursion ends. once control is returned to readdirectory(), the array is returned to the caller. specifications specification status comment file and directory entries apithe def
inition of 'createreader()' in that specification. draft
initial 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for an...
FileSystemDirectoryEntry.getDirectory() - Web APIs
file; the success callback for this, in turn, creates a new filereader and uses it to load the contents of the file. when that is loaded successfully (as indicated by the loadend event being fired), the loaded text is passed into json.parse() to be reconstituted into a javascript object. specifications specification status comment file and directory entries apithe def
inition of 'getdirectory()' in that specification. draft
initial 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for an...
FileSystemDirectoryEntry.getFile() - Web APIs
file; the success callback for this, in turn, creates a new filereader and uses it to load the contents of the file. when that is loaded successfully (as indicated by the loadend event being fired), the loaded text is passed into json.parse() to be reconstituted into a javascript object. specifications specification status comment file and directory entries apithe def
inition of 'getfile()' in that specification. draft
initial 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for android...
FileSystemDirectoryEntry - Web APIs
g 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 def
inition of 'filesystemdirectoryentry' in that specification. draft 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox...
FileSystemEntry.filesystem - Web APIs
e a filesystem representing the file system on which the file or directory described by the filesystementry is located.. example this example obtains a filesystemdirectoryentry for the root directory of the file system containing a file. let rootdirentry = fileentry.filesystem.root; specifications specification status comment file and directory entries apithe def
inition of 'filesystem' in that specification. draft
initial 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androi...
FileSystemEntry.fullPath - Web APIs
e }, function(entry) { path = fullpath; }, handleerror(error)); return path; } obviously, this is somewhat contrived, since we know that the file's full path is "/data.json", having just looked it up ourselves, but the concept holds up for scenarios in which you don't know it. specifications specification status comment file and directory entries apithe def
inition of 'fullpath' in that specification. draft
initial specification. 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinterne...
FileSystemEntry.getParent() - Web APIs
ethod. you can, however, create a simple helper function to adapt it, like this: function getparentpromise(entry) { return new promise((resolve, reject) => { entry.getparent(resolve, reject); }); } a similar approach can be taken elsewhere in the file and directory entries api. specifications specification status comment file and directory entries apithe def
inition of 'getparent()' in that specification. draft
initial 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for andro...
FileSystemEntry.isDirectory - Web APIs
as a directory or file. if the entry is neither, an error handler is called with an appropriate message. if (entry.isdirectory) { processsubdirectory(entry); } else if (entry.isfile) { processfile(entry); } else { displayerrormessage("unsupported file system entry specified."); } specifications specification status comment file and directory entries apithe def
inition of 'isdirectory' in that specification. draft
initial 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for andro...
FileSystemEntry.isFile - Web APIs
as a directory or file. if the entry is neither, an error handler is called with an appropriate message. if (entry.isdirectory) { processsubdirectory(entry); } else if (entry.isfile) { processfile(entry); } else { displayerrormessage("unsupported file system entry specified."); } specifications specification status comment file and directory entries apithe def
inition of 'isfile' in that specification. draft
initial 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfir...
FileSystemEntry.name - Web APIs
s example shows a function called isfilewithextension() which returns true if the specified filesystementry is both a file and the file's name ends with a given extension. function isfilewithextension(entry, extension) { return (entry.isfile && entry.name.endswith("." + extension)); } specifications specification status comment file and directory entries apithe def
inition of 'name' in that specification. draft
initial 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfiref...
FileSystemFileEntry.file() - Web APIs
thod which proceeds to use a filereader to read the file as text. the filereader's load event handler is set up to deliver the loaded string to the successcallback specified when the readfile() method was called; similarly, its error handler is set up to call the errorcallback specified. specifications specification status comment file and directory entries apithe def
inition of 'file()' in that specification. draft
initial 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfir...
FileSystemFlags.create - Web APIs
.path_exists_err. true true path doesn't exist the file or directory is created, then a filesystemfileentry or a filesystemdirectoryentry is passed to the successcallback, as appropriate. [1] when create is false, the value of exclusive is irrelevant and ignored. specifications specification status comment file and directory entries apithe def
inition of 'filesystemflags' in that specification. draft
initial 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for a...
FileSystemFlags.exclusive - Web APIs
.path_exists_err. true true path doesn't exist the file or directory is created, then a filesystemfileentry or a filesystemdirectoryentry is passed to the successcallback, as appropriate. [1] when create is false, the value of exclusive is irrelevant and ignored. specifications specification status comment file and directory entries apithe def
inition of 'filesystemflags' in that specification. draft
initial 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for a...
FileSystemFlags - Web APIs
.path_exists_err. true true path doesn't exist the file or directory is created, then a filesystemfileentry or a filesystemdirectoryentry is passed to the successcallback, as appropriate. [1] when create is false, the value of exclusive is irrelevant and ignored. specifications specification status comment file and directory entries apithe def
inition of 'filesystemflags' in that specification. draft
initial 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for a...
File and Directory Entries API support in Firefox - Web APIs
de code similar to the following: var filesystemdirectoryentry = window.filesystemdirectoryentry || window.directoryentry; var filesystementry = window.filesystementry || window.entry; limitations in firefox next, let's look at limitations of the firefox implementation of the api. in broad strokes, those limitations can be summarized as follows: content scripts can't create file systems or
initiate access to a file system. there are only two ways to get access to file system entries at this time: the <input> element, using the htmlinputelement.webkitentries property to access an array of filesystementry objects describing file system entries you can then read. using drag and drop by calling the datatransferitem.getasentry() method, which lets you get a filesystemfileentry or fi...
FocusEvent.relatedTarget - Web APIs
note that many elements can't have focus, which is a common reason for relatedtarget to be null. relatedtarget may also be set to null for security reasons, like when tabbing in or out of a page. mouseevent.relatedtarget is a similar property for mouse events. syntax secondtarget = focusevent.relatedtarget specifications specification status comment ui eventsthe def
inition of 'focusevent.relatedtarget' in that specification. working draft document object model (dom) level 3 events specificationthe def
inition of 'focusevent.relatedtarget' in that specification. obsolete
initial def
inition. ...
FocusEvent - Web APIs
tedtarget is an eventtarget representing a secondary target for this event. in some cases (such as when tabbing in or out a page), this property may be set to null for security reasons. methods this interface has no specific methods. it inherits methods from its parent uievent, and indirectly from event. specifications specification status comment ui eventsthe def
inition of 'focusevent' in that specification. working draft document object model (dom) level 3 events specificationthe def
inition of 'focusevent' in that specification. obsolete
initial def
inition. ...
FontFace.FontFace() - Web APIs
async function loadfonts() { const font = new fontface('myfont', 'url(myfont.woff)'); // wait for font to be loaded await font.load(); // add font to document document.fonts.add(font); // enable font with css class document.body.classlist.add('fonts-loaded'); } specifications specification status comment css font loading module level 3the def
inition of 'fontface constructor' in that specification. working draft
initial def
inition ...
FontFace.featureSettings - Web APIs
t features that are not available from a font's variant properties. it is equivalent to the font-feature-settings descriptor. syntax var featuresettingdescriptor = fontface.featuresettings; fontface.featuresettings = featuresettingdescriptor; value a cssomstring containing a descriptor. specifications specification status comment css font loading module level 3the def
inition of 'featuresettings' in that specification. working draft
initial def
inition. ...
HTMLIFrameElement.csp - Web APIs
the csp property of the htmliframeelement interface specifies the content security policy that an embedded document must agree to enforce upon itself. syntax var csp = htmliframeelement.csp htmliframeelement.csp = csp value a content security policy. specifications specification status comment content security policy: embedded enforcementthe def
inition of 'csp' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androido...
HTMLIFrameElement.referrerPolicy - Web APIs
. carefully consider the impact of this setting. examples var iframe = document.createelement("iframe"); iframe.src = "/"; iframe.referrerpolicy = "unsafe-url"; var body = document.getelementsbytagname("body")[0]; body.appendchild(iframe); // fetch the image using the complete url as the referrer specifications specification status comment referrer policythe def
inition of 'referrerpolicy attribute' in that specification. candidate recommendation added the referrerpolicy attribute. html living standardthe def
inition of 'htmliframeelement: referrerpolicy' in that specification. living standard browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, ple...
HTMLIFrameElement.src - Web APIs
when fetching the resource. syntax refstr = iframeelt.src; iframeelt.src= refstr; example var iframe = document.createelement("iframe"); iframe.src = "/"; var body = document.getelementsbytagname("body")[0]; body.appendchild(iframe); // fetch the image using the complete url as the referrer specifications specification status comment html living standardthe def
inition of 'htmliframeelement: src' in that specification. living standard 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androi...
srcdoc - Web APIs
the srcdoc property of the htmliframeelement specifies the content of the page. examples var iframe = document.createelement("iframe"); iframe.srcdoc = `<!doctype html><p>hello world!</p>`; document.body.appendchild(iframe); specifications specification status comment html living standardthe def
inition of 'htmliframeelement: srcdoc' in that specification. living standard ...
Image() - Web APIs
nstructor both pairs of properties have the same values. examples var myimage = new image(100, 200); myimage.src = 'picture.jpg'; document.body.appendchild(myimage); this would be the equivalent of defining the following html tag inside the <body>: <img width="100" height="200" src="picture.jpg"> specifications specification status comment html living standardthe def
inition of 'image()' in that specification. living standard ...
HTMLImageElement.align - Web APIs
or right. left floats the image over to place the left edge flush against the curent margin. any text that follows will flow against the image's right edge. right floats the image to place its right edge flush against the right margin. subsequent text will flow along the image's left edge. specifications specification status comment html living standardthe def
inition of 'htmlimageelement.align' in that specification. living standard html 4.01 specificationthe def
inition of 'htmlimageelement.align' in that specification. 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...
HTMLImageElement.alt - Web APIs
.contents { margin-top: 1em; font: 16px arial,helvetica,verdana,sans-serif; } result other images images simply showing objects or scenes should have alt text describing what's seen in the image. a photo of a yellow teapot might literally have its alt attribute set to "a yellow teapot". specifications specification status comment html living standardthe def
inition of 'htmlimageelement.alt' in that specification. unknown 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox f...
HTMLImageElement.complete - Web APIs
pg", lightboximgelem); lightboxcontrolselem.disabled = false; } /* ... */ function fixredeyecommand() { if (lightboxelem.style.display === "block" && lightboximgelem.complete) { fixredeye(lightboximgelem); } else { /* can't start doing this until the image is fully loaded */ } } specifications specification status comment html living standardthe def
inition of 'htmlimageelement.complete' in that specification. unknown 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfire...
HTMLImageElement.crossOrigin - Web APIs
unknown 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidf...
HTMLImageElement.currentSrc - Web APIs
living standard 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for a...
HTMLImageElement.decoding - Web APIs
your image. if doing so would cause problems, you can specify sync to disable asynchronous loading. this can be useful when applied to <img> elements, but may be even more so when used for offscreen image objects. examples var img = new image(); img.decoding = 'sync'; img.src = 'img/logo.png'; specifications specification status comment html living standardthe def
inition of 'decoding' in that specification. living standard 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for a...
HTMLImageElement.height - Web APIs
ctor("img"); let output = document.queryselector(".size"); const updateheight = event => { output.innertext = clockimage.height; }; window.addeventlistener("load", updateheight); window.addeventlistener("resize", updateheight); result this example may be easier to try out in its own window. specifications specification status comment html living standardthe def
inition of 'htmlimageelement.height' in that specification. living standard 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for andro...
HTMLImageElement.hspace - Web APIs
usage notes the value specified for hspace is mapped to the margin-left and margin-right properties to specify the width of those margins in pixels. important: this property is obsolete. you should instead use the css margin property and its longhand forms to establish margins around an <img>. specifications specification status comment html living standardthe def
inition of 'htmlimageelement.hspace' in that specification. living standard html 4.01 specificationthe def
inition of 'htmlimageelement.hspace' in that specification. recommendation provides additional details not present in the newer specification. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to ...
HTMLImageElement.isMap - Web APIs
ft corner of the image, specified in css pixels. the browser then fetches that url from the server and displays or downloads it depending on the value of the download attribute. unlike server-side image maps, client-side image maps don't cause the <img> element to adopt interactive content mode. specifications specification status comment html living standardthe def
inition of 'htmlimageelement.ismap' in that specification. living standard 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androi...
HTMLImageElement.longDesc - Web APIs
age taco-tuesday.jpg in the html file image-descriptions/taco-tuesday.html. this can be easily converted into modern html: <a href="image-descriptions/taco-tuesday.html"> <img src="taco-tuesday.jpg"> </a> with that, the image is a link to the html file describing the image in more detail. specifications specification status comment html 4.01 specificationthe def
inition of 'htmlimageelement.longdesc' in that specification. recommendation provides an actual description of this property; the html5 spec only says it's deprecated. 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.
HTMLImageElement.name - Web APIs
string = htmlimageelement.name; value a domstring providing a name by which the image can be referenced. important: this property is deprecated and is only in the specification still for backward compatibility purposes. since it functions identically to id, you can and should use it instead. specifications specification status comment html living standardthe def
inition of 'htmlimageelement.name' in that specification. living standard html 4.01 specificationthe def
inition of 'htmlimageelement.name' in that specification. recommendation provides additional details not available in the html 5 browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please...
HTMLImageElement.naturalHeight - Web APIs
.height} pixels`; }); the javascript code simply dumps the natural and as-displayed sizes into the <div> with the class output. this is done in response to the window's load event handler, in order to ensure that the image is available before attempting to examine its width and height. result specifications specification status comment html living standardthe def
inition of 'htmlimageelement.naturalheight' in that specification. living standard 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome fo...
HTMLImageElement.naturalWidth - Web APIs
.height} pixels`; }); the javascript code simply dumps the natural and as-displayed sizes into the <div> with the class output. this is done in response to the window's load event handler, in order to ensure that the image is available before attempting to examine its width and height. result specifications specification status comment html living standardthe def
inition of 'htmlimageelement.naturalwidth' in that specification. living standard 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for...
HTMLImageElement.referrerPolicy - Web APIs
s it can leak path information that has been concealed to third-party by using tls. examples var img = new image(); img.src = 'img/logo.png'; img.referrerpolicy = 'origin'; var div = document.getelementbyid('divaround'); div.appendchild(img); // fetch the image using the origin as the referrer specifications specification status comment referrer policythe def
inition of 'referrerpolicy attribute' in that specification. candidate recommendation added the referrerpolicy property. 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. desktopmobilechromeedgefirefoxinternet explor...
HTMLImageElement.sizes - Web APIs
cument.getelementbyid("break50"); break40.addeventlistener("click", event => image.sizes = image.sizes.replace(/50em,/, "40em,")); break50.addeventlistener("click", event => image.sizes = image.sizes.replace(/40em,/, "50em,")); result this result may be viewed in its own window here. specifications specification status comment html living standardthe def
inition of 'htmlimageelement.sizes' in that specification. living standard 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androi...
HTMLImageElement.src - Web APIs
g viewport-bases selection of an image from a srcset by also specifying the sizes property, the src property serves as the fallback to be used on browsers that don't support viewport-based selection. browsers that do support viewport-based selection will ignore src in this situation. html result specifications specification status comment html living standardthe def
inition of 'htmlimageelement.src' in that specification. living standard 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidf...
HTMLImageElement.srcset - Web APIs
with whether your display results in selecting the 1x or the 2x version of the image. if you happen to have both standard and high density displays, try moving this window between them and reloading the page to see the results change. for additional examples, see our guide to responsive images. specifications specification status comment html living standardthe def
inition of 'htmlimageelement.srcset' in that specification. living standard 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for andro...
HTMLImageElement.useMap - Web APIs
nd <area> elements, as well as the guide to using image maps. example 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. specifications specification status comment html living standardthe def
inition of 'htmlimageelement.usemap' in that specification. living standard 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for and...
HTMLImageElement.vspace - Web APIs
sage notes the value specified for vspace is mapped to the margin-top and margin-bottom properties to specify the height of those margins in pixels. important: this property is obsolete. you should instead use the css margin property and its longhand forms to establish margins around an <img>. specifications specification status comment html living standardthe def
inition of 'htmlimageelement.vspace' in that specification. living standard html 4.01 specificationthe def
inition of 'htmlimageelement.vspace' in that specification. recommendation the html 4.01 specification offers additional details. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, ple...
HTMLImageElement.width - Web APIs
selector("img"); let output = document.queryselector(".size"); const updatewidth = event => { output.innertext = clockimage.width; }; window.addeventlistener("load", updatewidth); window.addeventlistener("resize", updatewidth); result this example may be easier to try out in its own window. specifications specification status comment html living standardthe def
inition of 'htmlimageelement.width' in that specification. living standard 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androi...
HTMLImageElement.x - Web APIs
working draft 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfiref...
HTMLImageElement.y - Web APIs
working draft 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfiref...
HTMLInputElement.labels - Web APIs
<label id="label2" for="test">label 2</label> javascript window.addeventlistener("domcontentloaded", function() { const input = document.getelementbyid("test"); for(var i = 0; i < input.labels.length; i++) { console.log(input.labels[i].textcontent); // "label 1" and "label 2" } }); specifications specification status comment html living standardthe def
inition of 'labels' in that specification. living standard no change html5the def
inition of 'labels' in that specification. recommendation
initial def
inition ...
HTMLInputElement.setRangeText() - Web APIs
ype="text" id="text-box" size="30" value="this text has not been updated."> <button onclick="selecttext()">update text</button> javascript function selecttext() { const input = document.getelementbyid('text-box'); input.focus(); input.setrangetext('already', 14, 17, 'select'); } result specifications specification status comment html living standardthe def
inition of 'htmlinputelement.setselectionrange()' in that specification. living standard no change html5the def
inition of 'htmlinputelement.setselectionrange()' in that specification. recommendation
initial def
inition ...
HTMLInputElement.webkitEntries - Web APIs
addeventlistener("change", function(event) { event.target.webkitentries.foreach(function(entry) { /* do stuff with the entry */ }); }); each time a change event occurs, this code iterates over the selected files, obtaining their filesystementry-based objects and acting on them. specifications specification status comment file and directory entries apithe def
inition of 'webkitentries' in that specification. draft
initial specification. 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 out https://github.com/mdn/browser-compat-data and send us a pull request. desktopmobilechromeedgefirefoxin...
HTMLLabelElement.control - Web APIs
elelement.control value an htmlelement derived object representing the control with which the <label> is associated, or null if the label stands alone. if this property has a value and htmllabelelement.htmlfor has a value, the htmllabelelement.htmlfor property must refer to the same control. specifications specification status comment html living standardthe def
inition of 'control' in that specification. living standard
initial def
inition ...
HTMLLinkElement.as - Web APIs
the as property of the htmllinkelement interface returns a domstring representing the type of content being loaded by the html link, one of "script", "style", "image", "video", "audio", "track", "font", "fetch". syntax var as = htmllinkelement.as htmllinkelement.as = as value a domstring. specifications specification status comment preloadthe def
inition of 'as' in that specification. candidate recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox f...
HTMLLinkElement.referrerPolicy - Web APIs
rpolicy attribute of the <link> element defining which referrer is sent when fetching the resource. see the http referrer-policy header for details. syntax domstring htmllinkelement.referrerpolicy example var links = document.getelementsbytagname("link"); links[0].referrerpolicy; // "no-referrer" specifications specification status comment referrer policythe def
inition of 'referrerpolicy attribute' in that specification. candidate recommendation ...
HTMLMediaElement.audioTracks - Web APIs
shes the element itself. <video id="video" src="somevideo.mp4"></video> javascript the javascript code handles muting the video element's audio tracks. var video = document.getelementbyid("video"); for (var i = 0; i < video.audiotracks.length; i += 1) { video.audiotracks[i].enabled = false; } specifications specification status comment html living standardthe def
inition of 'htmlmediaelement.audiotracks' in that specification. living standard no change from html5 html5the def
inition of 'htmlmediaelement.audiotracks' in that specification. recommendation
initial def
inition. ...
HTMLMediaElement.autoplay - Web APIs
... <video id="video" controls> <source src="https://player.vimeo.com/external/250688977.sd.mp4?s=d14b1f1a971dde13c79d6e436b88a6a928dfe26b&profile_id=165"> </video> *** disable autoplay (recommended) *** false is the default value document.queryselector('#video').autoplay = false; specifications specification status comment html living standardthe def
inition of 'htmlmediaelement.autoplay' in that specification. living standard no change from html5 html5the def
inition of 'htmlmediaelement.autoplay' in that specification. recommendation
initial def
inition. ...
HTMLMediaElement.buffered - Web APIs
red value a timeranges object. this object is normalized, which means that ranges are ordered, don't overlap, aren't empty, and don't touch (adjacent ranges are folded into one bigger range). example var obj = document.createelement('video'); console.log(obj.buffered); // timeranges { length: 0 } specifications specification status comment html living standardthe def
inition of 'htmlmediaelement.buffered' in that specification. living standard no change from html5 html5the def
inition of 'htmlmediaelement.buffered' in that specification. recommendation
initial def
inition. ...
HTMLMediaElement.controller - Web APIs
the htmlmediaelement.controller property represents the media controller assigned to the element. syntax ... value a mediacontroller object or null if no media controller is assigned to the element. the default is null. example ... specifications specification status comment html5the def
inition of 'htmlmediaelement.controller' in that specification. recommendation
initial def
inition. ...
HTMLMediaElement.controls - Web APIs
bute, which controls whether user interface controls for playing the media item will be displayed. syntax var ctrls = video.controls; audio.controls = true; value a boolean. a value of true means controls will be displayed. example var obj = document.createelement('video'); obj.controls = true; specifications specification status comment html living standardthe def
inition of 'htmlmediaelement.controls' in that specification. living standard no change from html5 html5the def
inition of 'htmlmediaelement.controls' in that specification. recommendation
initial def
inition. ...
HTMLMediaElement.currentSrc - Web APIs
y be an empty string if networkstate is empty; otherwise, it will be one of the resources listed by the htmlsourceelement contained within the media element, or the value or src if no <source> element is provided. example var obj = document.createelement('video'); console.log(obj.currentsrc); // "" specifications specification status comment html living standardthe def
inition of 'htmlmediaelement.currentsrc' in that specification. living standard no change from html5 html5the def
inition of 'htmlmediaelement.currentsrc' in that specification. recommendation
initial def
inition. ...
HTMLMediaElement.currentTime - Web APIs
determined using the duration property. example var video = document.createelement('video'); console.log(video.currenttime); usage notes reduced time precision to offer protection against timing attacks and fingerprinting, browsers may round or otherwise adjust the value returned by currenttime. specifications specification status comment html living standardthe def
inition of 'htmlmediaelement.currenttime' in that specification. living standard no change from html5 html5the def
inition of 'htmlmediaelement.currenttime' in that specification. recommendation
initial def
inition. ...
HTMLMediaElement.defaultMuted - Web APIs
x var dmuted = video.defaultmuted; audio.defaultmuted = true; value a boolean. a value of true means that the audio output will be muted by default. example var videoele = document.createelement('video'); videoele.defaultmuted = true; console.log(videoele.outerhtml); // <video muted=""></video> specifications specification status comment html living standardthe def
inition of 'htmlmediaelement.defaultmuted' in that specification. living standard no change from html5 html5the def
inition of 'htmlmediaelement.defaultmuted' in that specification. recommendation
initial def
inition. ...
HTMLMediaElement.defaultPlaybackRate - Web APIs
value a double. 1.0 is "normal speed," values lower than 1.0 make the media play slower than normal, higher values make it play faster. the value 0.0 is invalid and throws a not_supported_err exception. example var obj = document.createelement('video'); console.log(obj.defaultplaybackrate); // 1 specifications specification status comment html living standardthe def
inition of 'htmlmediaelement.defaultplaybackrate' in that specification. living standard no change from html5 html5the def
inition of 'htmlmediaelement.defaultplaybackrate' in that specification. recommendation
initial def
inition. ...
HTMLMediaElement.disableRemotePlayback - Web APIs
ui. syntax var remoteplaybackdisabled = element.disableremoteplayback; value a boolean indicating whether the media element may have a remote playback ui. (false means "not disabled", which means "enabled") example var obj = document.createelement('audio'); obj.disableremoteplayback = true; specifications specification status comment remote playback apithe def
inition of 'disableremoteplayback' in that specification. candidate recommendation
initial def
inition. ...
HTMLMediaElement.duration - Web APIs
ement property duration indicates the length of the element's media in seconds. syntax myduration = htmlmediaelement.duration value a double-precision floating-point value indicating the duration of the media in seconds. if no media data is available, the value nan is returned. if the element's media doesn't have a known duration—such as for live media streams—the value of duration is +inf
inity. examples var obj = document.createelement('video'); console.log(obj.duration); // nan specifications specification status comment html living standardthe def
inition of 'htmlmediaelement.duration' in that specification. living standard html5the def
inition of 'htmlmediaelement.duration' in that specification. recommendation
initial def
inition. ...
HTMLMediaElement: emptied event - Web APIs
; video.addeventlistener('emptied', (event) => { console.log('uh oh. the media is empty. did you call load()?'); }); using the onemptied event handler property: const video = document.queryselector('video'); video.onemptied = (event) => { console.log('uh oh. the media is empty. did you call load()?'); }; specifications specification status html living standardthe def
inition of 'emptied media event' in that specification. living standard html5the def
inition of 'emptied media event' in that specification. recommendation ...
HTMLMediaElement.ended - Web APIs
ded value a boolean which is true if the media contained in the element has finished playing. if the source of the media is a mediastream, this value is true if the value of the stream's active property is false. example var obj = document.createelement('video'); console.log(obj.ended); // false specifications specification status comment html living standardthe def
inition of 'htmlmediaelement.ended' in that specification. living standard html5the def
inition of 'htmlmediaelement.ended' in that specification. recommendation ...
HTMLMediaElement.error - Web APIs
it; the error handler simply logs the details to console. var videoelement = document.createelement('video'); videoelement.onerror = function() { console.log("error " + videoelement.error.code + "; details: " + videoelement.error.message); } videoelement.src = "https://example.com/bogusvideo.mp4"; specifications specification status comment html living standardthe def
inition of 'htmlmediaelement.error' in that specification. living standard html5the def
inition of 'htmlmediaelement.error' in that specification. recommendation ...
HTMLMediaElement.fastSeek() - Web APIs
d set htmlmediaelement.currenttime instead. syntax htmlmediaelement.fastseek(time); parameters time a double. return value none. example this example quickly seeks to 20-second position of the video element. let myvideo = document.getelementbyid("myvideoelement"); myvideo.fastseek(20); specifications specification status comment html living standardthe def
inition of 'fastseek()' in that specification. living standard
initial def
inition; living specification. ...
HTMLMediaElement: loadedmetadata event - Web APIs
and dimensions ' + ' of the media and tracks are now known. '); }); using the onloadedmetadata event handler property: const video = document.queryselector('video'); video.onloadedmetadata = (event) => { console.log('the duration and dimensions ' + ' of the media and tracks are now known. '); }; specifications specification status html living standardthe def
inition of 'loadedmetadata media event' in that specification. living standard html5the def
inition of 'canplay media event' in that specification. recommendation ...
HTMLMediaElement.loop - Web APIs
the htmlmediaelement.loop property reflects the loop html attribute, which controls whether the media element should start over when it reaches the end. syntax var loop = video.loop; audio.loop = true; value a boolean. example var obj = document.createelement('video'); obj.loop = true; // true specifications specification status comment html living standardthe def
inition of 'htmlmediaelement.loop' in that specification. living standard html5the def
inition of 'htmlmediaelement.loop' in that specification. recommendation ...
HTMLMediaElement.muted - Web APIs
the htmlmediaelement.muted indicates whether the media element muted. syntax var ismuted = audioorvideo.muted audio.muted = true; value a boolean. true means muted and false means not muted. example var obj = document.createelement('video'); console.log(obj.muted); // false specifications specification status comment html living standardthe def
inition of 'htmlmediaelement.muted' in that specification. living standard html5the def
inition of 'htmlmediaelement.muted' in that specification. recommendation ...
HTMLMediaElement.networkState - Web APIs
aying and then check if it is still loading data. <audio id="example" preload="auto"> <source src="sound.ogg" type="audio/ogg" /> </audio> var obj = document.getelementbyid('example'); obj.addeventlistener('playing', function() { if (obj.networkstate === 2) { // still loading... } }); specifications specification status comment html living standardthe def
inition of 'htmlmediaelement.networkstate' in that specification. living standard html5the def
inition of 'htmlmediaelement.networkstate' in that specification. recommendation ...
HTMLMediaElement.onencrypted - Web APIs
ize="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlmediaelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} syntax htmlmediaelement.onencrypted = function(encrypted) { ... } specifications specification status comment encrypted media extensionsthe def
inition of 'onencrypted' in that specification. recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome fo...
HTMLMediaElement.onerror - Web APIs
hen some form of error occurs while attempting to load or perform the media. syntax htmlmediaelement.onerror = eventlistener; value a function which serves as the event handler for the error event. when an error occurs, the specified function will be called. if null, no error handler is in effect. specifications specification status comment html living standardthe def
inition of 'onerror' in that specification. living standard ...
HTMLMediaElement.onwaitingforkey - Web APIs
x" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlmediaelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} syntax htmlmediaelement.onwaitingforkey = function(waitingforkey) { ... } specifications specification status comment encrypted media extensionsthe def
inition of 'onwaitingforkey' in that specification. recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrom...
HTMLMediaElement.pause() - Web APIs
the htmlmediaelement.pause() method will pause playback of the media, if the media is already in a paused state this method will have no effect. syntax htmlmediaelement.pause() parameters none. return value none. exceptions none. specifications specification status comment html living standardthe def
inition of 'pause()' in that specification. living standard
initial def
inition; living specification. html5the def
inition of 'pause()' in that specification. recommendation
initial def
inition. ...
HTMLMediaElement.paused - Web APIs
the read-only htmlmediaelement.paused property tells whether the media element is paused. syntax var ispaused = audioorvideo.paused value a boolean. true is paused and false is not paused. example var obj = document.createelement('video'); console.log(obj.paused); // true specifications specification status comment html living standardthe def
inition of 'htmlmediaelement.paused' in that specification. living standard html5the def
inition of 'htmlmediaelement.paused' in that specification. recommendation ...
HTMLMediaElement.playbackRate - Web APIs
.5; // audio audio.playbackrate = 1.0; value a double. 1.0 is "normal speed," values lower than 1.0 make the media play slower than normal, higher values make it play faster. (default: 1.0) example var obj = document.createelement('video'); console.log(obj.playbackrate); // expected output: 1 specifications specification status comment html living standardthe def
inition of 'htmlmediaelement.playbackrate' in that specification. living standard html5the def
inition of 'htmlmediaelement.playbackrate' in that specification. recommendation ...
HTMLMediaElement.setMediaKeys() - Web APIs
ia during playback. syntax var promise = htmlmediaelement.setmediakeys(mediakeys); parameters mediakeys a reference to a mediakeys object that the htmlmediaelement can use for decryption of media data during playback. returns a promise that resolves to the passed instance of mediakeys. specifications specification status comment encrypted media extensionsthe def
inition of 'setmediakeys()' in that specification. recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome...
HmacImportParams - Web APIs
bits of the key. if this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. unless you have a good reason to use a different length, omit this property and use the default. examples see the examples for subtlecrypto.importkey(). specifications specification status comment web cryptography apithe def
inition of 'subtlecrypto.hmacimportparams' in that specification. recommendation ...
HmacKeyGenParams - Web APIs
ts of the key. if this is omitted the length of the key is equal to the length of the digest generated by the digest function you have chosen. unless you have a good reason to use a different length, omit this property and use the default. examples see the examples for subtlecrypto.generatekey(). specifications specification status comment web cryptography apithe def
inition of 'subtlecrypto.hmackeygenparams' in that specification. recommendation ...
IDBDatabase.deleteObjectStore() - Web APIs
b.open(dbname, dbversion); request.onupgradeneeded = function(e) { var db = request.result; if (e.oldversion < 1) { db.createobjectstore("store1"); } if (e.oldversion < 2) { db.deleteobjectstore("store1"); db.createobjectstore("store2"); } // etc. for version < 3, 4... }; specification specification status comment indexed database api 2.0the def
inition of 'deleteobjectstore()' in that specification. recommendation indexed database api draftthe def
inition of 'deleteobjectstore()' in that specification. 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 ...
IDBDatabase.onclose - Web APIs
ed. note: this feature is available in web workers. syntax idbdatabase.onclose = function(event) { ... }; value a function which is called when the close event is fired. example db.onclose = function(event) { myappshowalert('the database "' + db.name + '" has unexpectedly closed.'); }; specifications specification status comment indexed database api draftthe def
inition of 'onclose' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for a...
IDBFactory.cmp() - Web APIs
ons this method may raise a domexception of the following types: attribute description dataerror one of the supplied keys was not a valid key. example var a = 1; var b = 2; var result = window.indexeddb.cmp(a, b); console.log( "comparison results: " + result ); specifications specification status comment indexed database api 2.0the def
inition of 'cmp()' in that specification. recommendation indexed database api draftthe def
inition of 'cmp()' in that specification. 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. ...
databases - Web APIs
attribute description securityerror the method is called from an opaque origin. other error specification does not describe all possible errors. example const promise = indexeddb.databases() promise.then(databases => { console.log(databases) }) specifications specification status comment indexed database api draftthe def
inition of 'databases()' in that specification. recommendation
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome f...
IDBFactory - Web APIs
prefixed these objects, so we don't need window.mozidb*) // let us open version 4 of our database var dbopenrequest = window.indexeddb.open("todolist", 4); // these two event handlers act on the database being opened successfully, or not dbopenrequest.onerror = function(event) { console.error("error loading database."); }; dbopenrequest.onsuccess = function(event) { console.info("database
initialised."); // store the result of opening the database in the db variable. this is used a lot later on, for opening transactions and suchlike. db = dbopenrequest.result; }; specifications specification status comment indexed database api 2.0the def
inition of 'idbfactory' in that specification. recommendation indexed database api draftthe def
init...
IDBIndex.get() - Web APIs
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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for andr...
IDBIndex.getAll() - Web APIs
x has been deleted or removed. a typeerror exception is thrown if the count parameter is not between 0 and 232-1 included. example var myindex = objectstore.index('index'); var getallrequest = myindex.getall(); getallrequest.onsuccess = function() { console.log(getallrequest.result); } specification specification status comment indexed database api draftthe def
inition of 'getall()' in that specification. recommendation
initial def
inition. ...
IDBIndex.getAllKeys() - Web APIs
emoved. a typeerror exception is thrown if the count parameter is not between 0 and 232-1 included. example var myindex = objectstore.index('index'); var getallkeysrequest = myindex.getallkeys(); getallkeysrequest.onsuccess = function() { console.log(getallkeysrequest.result); } specification specification status comment indexed database api draftthe def
inition of 'getall()' in that specification. recommendation
initial def
inition. indexed database api draftthe def
inition of 'getall()' in that specification. recommendation ...
IDBObjectStore.count() - Web APIs
dler fires, we log the count value (an integer) to the console. var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); var countrequest = objectstore.count(); countrequest.onsuccess = function() { console.log(countrequest.result); } specification specification status comment indexed database api 2.0the def
inition of 'count()' in that specification. recommendation indexed database api draftthe def
inition of 'count()' in that specification. 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 reque...
IDBObjectStore.getAllKeys() - Web APIs
eption description transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the key or key range provided contains an invalid key or is null. invalidstateerror the idbobjectstore has been deleted or removed. specifications specification status comment indexed database api draftthe def
inition of 'getallkeys()' in that specification. recommendation
initial def
inition ...
IDBOpenDBRequest.onupgradeneeded - Web APIs
h two indexes. var magazines = db.createobjectstore("magazines"); var publisherindex = magazines.createindex("by_publisher", "publisher"); var frequencyindex = magazines.createindex("by_frequency", "frequency"); } }; request.onerror = function(event) { note.innerhtml += '<li>error loading database.</li>'; }; request.onsuccess = function(event) { note.innerhtml += '<li>database
initialised.</li>'; db = request.result; populateanddisplaydata(); }; specifications specification status comment indexed database api 2.0the def
inition of 'onupgradeneeded' in that specification. recommendation indexed database api draftthe def
inition of 'onupgradeneeded' in that specification. recommendation browser compatibility the...
IDBRequest.transaction - Web APIs
{ // upgrading from v1 database: add index on "title" to "books" store. var bookstore = openrequest.transaction.objectstore('books'); bookstore.createindex('by_title', 'title'); } }; openrequest.onsuccess = function() { console.log(openrequest.transaction); // will log "null". }; specifications specification status comment indexed database api 2.0the def
inition of 'transaction' in that specification. recommendation indexed database api draftthe def
inition of 'transaction' in that specification. 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 pu...
IntersectionObserver.takeRecords() - Web APIs
intersectionobserverentries = intersectionobserver.takerecords(); parameters none. return value an array of intersectionobserverentry objects, one for each target element whose intersection with the root has changed since the last time the intersections were checked. examples <<<...>>> specifications specification status comment intersection observerthe def
inition of 'intersectionobserver.takerecords()' in that specification. working draft
initial def
inition. ...
IntersectionObserver.unobserve() - Web APIs
e this snippet simply shows an observer being created, an element being observed, and then being unobserved. var observer = new intersectionobserver(callback); observer.observe(document.getelementbyid("elementtoobserve")); /* ... */ observer.unobserve(document.getelementbyid("elementtoobserve")); specifications specification status comment intersection observerthe def
inition of 'intersectionobserver.unobserve()' in that specification. working draft
initial def
inition. ...
IntersectionObserverEntry.boundingClientRect - Web APIs
same algorithm as element.getboundingclientrect(), so refer to that article for details on precisely what is done to obtain this rectangle and what is and is not included within its bounds. in the general case, however, it's safe to simply think of this as the bounds rectangle of the target element. specifications specification status comment intersection observerthe def
inition of 'intersectionobserverentry.boundingclientrect' in that specification. working draft
initial def
inition ...
IntersectionObserverEntry.isIntersecting - Web APIs
) { entries.foreach(function(entry) { if (entry.isintersecting) { intersectingcount += 1; } else { intersectingcount -= 1; } }); } to see a more concrete example, take a look at handling intersection changes in timing element visibility with the intersection observer api. specifications specification status comment intersection observerthe def
inition of 'intersectionobserverentry.isintersecting' in that specification. working draft
initial def
inition ...
Keyboard.lock() - Web APIs
y press. assuming a standard us qwerty layout, registering "keyw" ensures that "w", shift+"w", control+"w", control+shift+"w", and all other key modifier combinations with "w" are sent to the app. the same applies to for "keya", "keys" and "keyd". navigator.keyboard.lock(["keyw", "keya", "keys", "keyd"]); specifications specification status comment keyboard lockthe def
inition of 'lock()' in that specification. editor's draft
initial def
inition. ...
Keyboard.unlock() - Web APIs
the unlock() method of the keyboard interface unlocks all keys captured by the keyboard.lock() method and returns synchronously. syntax keyboard.unlock() parameters none. return value undefined specifications specification status comment keyboard mapthe def
inition of 'keyboard' in that specification. editor's draft defines the keyboard interface. keyboard lockthe def
inition of 'unlock()' in that specification. editor's draft
initial def
inition. ...
Keyboard - Web APIs
ds to the 'w' key 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. } specifications specification status comment keyboard mapthe def
inition of 'keyboard' in that specification. editor's draft
initial def
inition. keyboard lockthe def
inition of 'keyboard' in that specification. editor's draft adds lock() and unlock(). ...
KeyboardEvent.code - Web APIs
appens, and stop the motion when the corresponding keyup occurs, instead of relying on key repeats. that would allow both smoother and faster movement, but would also allow the player to be moving and steering at the same time. transitions or animations could be used to make the ship's movement smoother, too. specification specification status comment ui eventsthe def
inition of 'keyboardevent.code' in that specification. working draft
initial def
inition, included code values. ...
KeyboardEvent.isComposing - Web APIs
property returns a boolean value indicating if the event is fired within a composition session, i.e. after compositionstart and before compositionend. syntax var bool = event.iscomposing; example var kbdevent = new keyboardevent("synthetickey", false); console.log(kbdevent.iscomposing); // return false specifications specification status comment ui eventsthe def
inition of 'keyboardevent.prototype.iscomposing' in that specification. working draft document object model (dom) level 3 events specificationthe def
inition of 'keyboardevent.prototype.iscomposing' in that specification. obsolete
initial def
inition. ...
Key Values - Web APIs
al" the redial button. redials the last-called number. qt::key_lastnumberredial (0x01100009) "notification" the notification key. keycode_notification (83) "mannermode" a button which cycles among the notification modes: silent, vibrate, ring, and so forth. keycode_manner_mode (205) "voicedial" the voice dial key.
initiates voice dialing. qt::key_voicedial (0x01100008) keycode_voice_assist (231) [1] prior to firefox 37, the home button generated a key code of "exit". starting in firefox 37, the button generates the key code "mozhomescreen". multimedia keys the multimedia keys are extra buttons or keys for controlling media devices, found on some keyboards. keyboardevent.key valu...
KeyboardEvent.key - Web APIs
break; case "esc": // ie/edge specific value case "escape": // do something for "esc" key press. break; default: return; // quit when this doesn't handle the key event. } // cancel the default action to avoid it being handled twice event.preventdefault(); }, true); specification specification status comment ui eventsthe def
inition of 'keyboardevent.key' in that specification. working draft document object model (dom) level 3 events specificationthe def
inition of 'keyboardevent.key' in that specification. obsolete
initial def
inition, included key values. ...
KeyboardEvent.location - Web APIs
on android. starting 18, native key events on android may have this value. however, at gecko 38, this is dropped. syntax var location = event.location; example function keyevent(event) { console.log("location of key pressed: " + event.location); } specifications specification status comment document object model (dom) level 3 events specificationthe def
inition of 'keyboardevent.location' in that specification. obsolete
initial def
inition. ...
KeyboardEvent.which - Web APIs
own handler: \n" + "keycode property: " + evt.keycode + "\n" + "which property: " + evt.which + "\n" ); } </script> </head> <body onkeypress="showkeypress(event);" onkeydown="keydown(event);" > <p>please press any key.</p> </body> </html> specifications specification status comment document object model (dom) level 3 events specificationthe def
inition of 'keyboardevent.which' in that specification. obsolete
initial def
inition; specified as deprecated ...
MediaList - Web APIs
dex value inside the medialist. examples the following would log to the console a textual representation of the medialist of the first stylesheet applied to the current document. const stylesheets = document.stylesheets; let stylesheet = stylesheets[0]; console.log(stylesheet.media.mediatext); specifications specification status comment css object model (cssom)the def
inition of 'medialist' in that specification. working draft ...
MediaMetadata.album - Web APIs
the album property of the mediametadata interface returns or sets the name of the album or collection containing the media to be played. syntax var album = mediametadata.album mediametadata.album = album value a string containing the name of the album. specifications specification status comment media session standardthe def
inition of 'album' in that specification. draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on i...
MediaMetadata.artist - Web APIs
the artist property of the mediametadata interface returns or sets the name of the artist, group, creator, etc., of the media to be played. syntax var artist = mediametadata.artist mediametadata.artist = artist value a string containing the name of the artist. specifications specification status comment media session standardthe def
inition of 'artist' in that specification. draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsa...
MediaMetadata.artwork - Web APIs
the artwork property of the mediametadata interface returns or sets an array of mediaimage objects representing images associated with playing media. syntax var artwork[] = mediametadata.artwork mediametadata.artwork = artwork[] value an array of mediaimage objects. specifications specification status comment media session standardthe def
inition of 'artwork' in that specification. draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for an...
MediaMetadata.title - Web APIs
the title property of the mediametadata interface returns or sets the title of the media to be played. syntax var title = mediametadata.title mediametadata.title = title value a string containing the title of the media. specifications specification status comment media session standardthe def
inition of 'title' in that specification. draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internettitle experimen...
MediaMetadata - Web APIs
ata.artist returns or sets the name of the artist, group, creator, etc. of the media to be played. mediametadata.album returns or sets the name of the album or collection containing the media to be played. mediametadata.artwork returns or sets an array of images associated with playing media. specifications specification status comment media session standardthe def
inition of 'mediametadata' in that specification. draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for andro...
MediaPositionState.playbackRate - Web APIs
ect, then submits it to the browser it by calling navigator.mediasession.setpositionstate(). let positionstate = { duration: mymediaduration; playbackrate: 2.0; position: mymediaposition; }; navigator.mediasession.setpositionstate(positionstate); note the value 2.0 as the playbackrate. specifications specification status comment media session standardthe def
inition of 'mediapositionstate.playbackrate' in that specification. draft
initial def
inition. ...
MediaQueryList.addListener() - Web APIs
x wide.'; document.body.style.backgroundcolor = 'red'; } else { /* the viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } } mql.addlistener(screentest); specifications specification status comment css object model (cssom) view modulethe def
inition of 'addlistener' in that specification. working draft
initial def
inition ...
MediaQueryList.matches - Web APIs
istener("change", callback); } else { mq.addlistener(callback); } } addmqlistener(window.matchmedia("(orientation:landscape)"), event => { if (event.matches) { /* now in landscape orientation */ } else { /* now in portrait orientation */ } } ); specifications specification status comment css object model (cssom) view modulethe def
inition of 'matches' in that specification. working draft
initial def
inition ...
MediaQueryList.onchange - Web APIs
if (e.matches) { /* the viewport is 600 pixels wide or less */ console.log('this is a narrow screen — less than 600px wide.') } else { /* the viewport is more than than 600 pixels wide */ console.log('this is a wide screen — more than 600px wide.') } }) specifications specification status comment css object model (cssom) view modulethe def
inition of 'onchange' in that specification. working draft
initial def
inition ...
MediaQueryList.removeListener() - Web APIs
* the viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } } mql.addlistener(screentest); // later on, when it is no longer needed mql.removelistener(screentest); specifications specification status comment css object model (cssom) view modulethe def
inition of 'removelistener' in that specification. working draft
initial def
inition ...
MediaQueryList - Web APIs
x wide.'; document.body.style.backgroundcolor = 'blue'; } } mql.addeventlistener('change', screentest); note: you can find this example on github (see the source code, and also see it running live). you can find other examples on the individual property and method pages. specifications specification status comment css object model (cssom) view modulethe def
inition of 'mediaquerylist' in that specification. working draft
initial def
inition ...
MediaQueryListEvent.matches - Web APIs
wide.'; document.body.style.backgroundcolor = 'red'; } else { /* the viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } } mql.addlistener(screentest); specifications specification status comment css object model (cssom) view modulethe def
inition of 'matches' in that specification. working draft
initial def
inition ...
MediaQueryListEvent.media - Web APIs
y.style.backgroundcolor = 'red'; } else { /* the viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } console.log(e.media); } mql.addlistener(screentest); specifications specification status comment css object model (cssom) view modulethe def
inition of 'media' in that specification. working draft
initial def
inition ...
MediaQueryListEvent - Web APIs
x wide.'; document.body.style.backgroundcolor = 'red'; } else { /* the viewport is more than than 600 pixels wide */ para.textcontent = 'this is a wide screen — more than 600px wide.'; document.body.style.backgroundcolor = 'blue'; } } mql.addlistener(screentest); specifications specification status comment css object model (cssom) view modulethe def
inition of 'mediaquerylistevent' in that specification. working draft
initial def
inition ...
MediaTrackConstraints.latency - Web APIs
possible value. latency is always prone to some variation due to hardware usage demands, network constraints, and so forth, so even in an "exact" match, some variation should be expected. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe def
inition of 'latency' in that specification. candidate recommendation
initial specification. ...
MediaTrackConstraints.sampleSize - Web APIs
same value) or to a best-possible value. since this property can only represent linear sample sizes, this constraint can only be met by devices that can produce audio with linear samples. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe def
inition of 'samplesize' in that specification. candidate recommendation
initial specification. ...
MediaTrackConstraints - Web APIs
ond to display areas. these may include backing buffers for windows to allow capture of window contents that are hidden by other windows in front of them, or buffers containing larger documents that need to be scrolled through to see the entire contents in their windows. specifications specification status comment media capture and streams candidate recommendation
initial def
inition. mediastream image capture working draft adds image constraints. ...
MediaTrackSettings.aspectRatio - Web APIs
l simply ignore any constraints they're unfamiliar with. syntax var aspectratio = mediatracksettings.aspectratio; value a double-precision floating-point number indicating the current configuration of the track's aspect ratio. the aspect ratio is computed by taking the track's width, dividing by its height, and rounding the result to ten decimal places. for example, the standard 16:9 high-def
inition aspect ratio can be computed as 1920/1080, or 1.7777777778. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe def
inition of 'aspectratio' in that specification. candidate recommendation
initial specification. ...
MediaTrackSettings.autoGainControl - Web APIs
r with. syntax var autogaincontrol = mediatracksettings.autogaincontrol; value a boolean value which is true if the track has automatic gain control enabled or false if agc is disabled. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe def
inition of 'autogaincontrol' in that specification. candidate recommendation
initial specification. ...
MediaTrackSettings.cursor - Web APIs
sible in the video content of the {domxref("mediastream"), unless the mouse has moved outside the area of the content. motion the mouse cursor should always be included in the video if it's moving, and for a short time after it stops moving. never the mouse cursor is never included in the shared video. specifications specification status comment screen capturethe def
inition of 'mediatracksettings.cursor' in that specification. working draft
initial def
inition ...
MediaTrackSettings.deviceId - Web APIs
pplyconstraints(). an exception to the rule that device ids are the same across browsing sessions: private browsing mode will use a different id, and will change it each browsing session. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe def
inition of 'deviceid' in that specification. candidate recommendation
initial specification. ...
MediaTrackSettings.facingMode - Web APIs
toward the user but over their left shoulder. "right" the video source is facing toward the user but to their right, such as a camera aimed toward the user but over their right shoulder. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe def
inition of 'facingmode' in that specification. candidate recommendation
initial specification. ...
MediaTrackSettings.groupId - Web APIs
m the same group (or that they don't use devices from the same group). there is no situation in which the groupid is useful when calling applyconstraints(), since the value can't be changed. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe def
inition of 'groupid' in that specification. candidate recommendation
initial specification. ...
MediaTrackSettings.height - Web APIs
constraints they're unfamiliar with. syntax var height = mediatracksettings.height; value an integer value indicating the height, in pixels, of the video track as currently configured. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe def
inition of 'height' in that specification. candidate recommendation
initial specification. ...
MediaTrackSettings.noiseSuppression - Web APIs
ith. syntax var noisesuppression = mediatracksettings.noisesuppression; value a boolean value which is true if the input track has noise suppression enabled or false if agc is disabled. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe def
inition of 'noisesuppression' in that specification. candidate recommendation
initial specification. ...
MediaTrackSettings.sampleSize - Web APIs
ck requires samplesize bits. that means that a given sample actually uses (samplesize/8)*channelcount bytes of data. for example, 16-bit stereo audio requires (16/8)*2 or 4 bytes per sample. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe def
inition of 'samplesize' in that specification. candidate recommendation
initial specification. ...
MediaTrackSettings.width - Web APIs
any constraints they're unfamiliar with. syntax var width = mediatracksettings.width; value an integer value indicating the width, in pixels, of the video track as currently configured. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status comment media capture and streamsthe def
inition of 'width' in that specification. candidate recommendation
initial specification. ...
MediaTrackSupportedConstraints.cursor - Web APIs
{ displaysurface: "browser" }, audio: false; }; if (supportedconstraints.cursor) { displaymediaoptions.video.cursor = "always"; } try { videoelem.srcobject = await navigator.mediadevices.getdisplaymedia(displaymediaoptions); } catch(err) { /* handle the error */ } } specifications specification status comment screen capturethe def
inition of 'mediatracksupportedconstraints.cursor' in that specification. unknown
initial def
inition ...
MediaTrackSupportedConstraints.displaySurface - Web APIs
= { video: { }, audio: false; }; if (supportedconstraints.displaysurface) { displaymediaoptions.video.displaysurface = "monitor"; } try { videoelem.srcobject = await navigator.mediadevices.getdisplaymedia(displaymediaoptions); } catch(err) { /* handle the error */ } } specifications specification status comment screen capturethe def
inition of 'mediatracksupportedconstraints.displaysurface' in that specification. working draft
initial def
inition ...
performance.clearMarks() - Web APIs
markcount() // "found this many entries: 6" // delete just the "squirrel" performancemark entries. performance.clearmarks('squirrel'); logmarkcount() // "found this many entries: 4" // delete all of the performancemark entries. performance.clearmarks(); logmarkcount() // "found this many entries: 0" specifications specification status comment user timing level 2the def
inition of 'clearmarks()' in that specification. working draft clarifies clearmarks(). user timingthe def
inition of 'clearmarks()' in that specification. recommendation basic def
inition. ...
performance.clearMeasures() - Web APIs
entries: 5" // delete just the "from navigation" performancemeasure entries. performance.clearmeasures("from navigation"); logmeasurecount() // "found this many entries: 3" // delete all of the performancemeasure entries. performance.clearmeasures(); logmeasurecount() // "found this many entries: 0" specifications specification status comment user timing level 2the def
inition of 'clearmeasures()' in that specification. working draft clarifies clearmeasures(). user timingthe def
inition of 'clearmeasures()' in that specification. recommendation basic def
inition. ...
performance.mark() - Web APIs
t allentries = performance.getentriesbytype("mark"); console.log(allentries.length); // 6 // get all of the "monkey" performancemark entries. const monkeyentries = performance.getentriesbyname("monkey"); console.log(monkeyentries.length); // 2 // clear out all of the marks. performance.clearmarks(); specifications specification status comment user timing level 2the def
inition of 'mark()' in that specification. working draft clarifies mark() processing model. user timingthe def
inition of 'mark()' in that specification. recommendation basic def
inition. ...
performance.measure() - Web APIs
ameb); performance.measure("measure from the start of navigation to now"); // pull out all of the measurements. console.log(performance.getentriesbytype("measure")); // finally, clean up the entries. performance.clearmarks(); performance.clearmeasures(); }, 1000); }, 1000); specifications specification status comment user timing level 2the def
inition of 'measure()' in that specification. working draft clarifies measure() processing model. user timingthe def
inition of 'measure()' in that specification. recommendation basic def
inition. ...
Performance.onresourcetimingbufferfull - Web APIs
rcetimingbufferfull = buffer_full_cb; return value callback an eventhandler that is invoked when the resourcetimingbufferfull event is fired. examples the following example sets a callback function on the onresourcetimingbufferfull property. function buffer_full(event) { console.log("warning: resource timing buffer is full!"); performance.setresourcetimingbuffersize(200); } function
init() { // set a callback if the resource buffer becomes filled performance.onresourcetimingbufferfull = buffer_full; } <body onload="
init()"> specifications specification status comment resource timing level 1the def
inition of 'onresourcetimingbufferfull' in that specification. candidate recommendation
initial def
inition. ...
performance.setResourceTimingBufferSize() - Web APIs
ported = typeof performance.setresourcetimingbuffersize == "function"; if (supported) { log("... performance.setresourcetimingbuffersize() = yes"); performance.setresourcetimingbuffersize(maxsize); } else { log("... performance.setresourcetimingbuffersize() = not supported"); } } specifications specification status comment resource timing level 1the def
inition of 'setresourcetimingbuffersize()' in that specification. candidate recommendation
initial def
inition. ...
Performance.timeOrigin - Web APIs
the timeorigin read-only property of the performance interface returns the high resolution timestamp of the start time of the performance measurement. note: this feature is available in web workers. syntax var timeorigin = performance.timeorigin value a high resolution timestamp. specifications specification status high resolution time level 2the def
inition of 'timeorigin' in that specification. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for and...
performance.toJSON() - Web APIs
his feature is available in web workers. syntax myperf = performance.tojson() arguments none return value myperf a json object that is the serialization of the performance object. example var js; js = window.performance.tojson(); console.log("json = " + json.stringify(js)); specifications specification status comment high resolution time level 2the def
inition of 'tojson() serializer' in that specification. recommendation defines tojson(). ...
PerformanceEntry - Web APIs
nd the navigation value for entrytype. user timing level 2 working draft user timing recommendation adds the performancemark and performancemeasure interfaces as well as the mark and measure values for entrytype. frame timing draft adds the performanceframetiming interface and the frame value for entrytype. performance timeline level 2the def
inition of 'performanceentry' in that specification. candidate recommendation added tojson() serializer method. performance timelinethe def
inition of 'performanceentry' in that specification. recommendation
initial def
inition. ...
PerformanceFrameTiming - Web APIs
address. performanceentry.starttime returns the timestamp when the frame was started. performanceentry.duration returns a timestamp indicating the difference between the starttimes of two successive frames. methods this interface has no methods. example see the example in using the frame timing api. specifications specification status comment frame timingthe def
inition of 'performanceframetiming' in that specification. draft
initial def
inition. ...
PerformanceLongTaskTiming.attribution - Web APIs
the attribution readonly property of the performancelongtasktiming interface returns a sequence of taskattributiontiming instances. syntax var taskattributetiming = performancelongtasktiming.attribution; value a sequence of taskattributiontiming instances. specifications specification status comment long tasks api 1the def
inition of 'attribution' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for android...
PerformanceLongTaskTiming - Web APIs
,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">performancelongtasktiming</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties performancelongtasktiming.attribution read only returns a sequence of taskattributiontiming instances. specifications specification status comment long tasks api 1the def
inition of 'performancelongtasktiming' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webv...
PerformanceMark - Web APIs
created via a call to performance.mark(). performanceentry.starttime returns the domhighrestimestamp when performance.mark() was called. performanceentry.duration returns "0". (a mark has no duration.) methods this interface has no methods. example see the example in using the user timing api. specifications specification status comment user timing level 2the def
inition of 'performancemark' in that specification. working draft user timingthe def
inition of 'performancemark' in that specification. recommendation basic def
inition. ...
PerformanceMeasure - Web APIs
performance.measure() was called. performanceentry.duration returns a domhighrestimestamp that is the duration of the measure (typically, the measure's end mark timestamp minus its start mark timestamp). methods this interface has no methods. example see the example in using the user timing api. specifications specification status comment user timing level 2the def
inition of 'performancemeasure' in that specification. working draft user timingthe def
inition of 'performancemeasure' in that specification. recommendation basic def
inition. ...
Performance Timeline - Web APIs
meline. performance extensions the performance timeline api extends the performance interface with three methods that provide different mechanisms to get a set of performance records (metrics), depending on the specified filter criteria. the methods are: getentries() returns all recorded performance entries or, optionally, the entries based on the specified name, performance type and/or the
initiatortype (such as an html element). getentriesbyname() returns the recorded performance entries based on the specified name and optionally the performance type. getentriesbytype() returns the recorded performance entries based on the specified performance type. performanceentry interface the performanceentry interface encapsulates a single performance entry — that is, a single data point...
PeriodicWave.PeriodicWave() - Web APIs
periodicwave object instance. example var real = new float32array(2); var imag = new float32array(2); var ac = new audiocontext(); real[0] = 0; imag[0] = 0; real[1] = 1; imag[1] = 0; var options = { real : real, imag : imag, disablenormalization : false } var wave = new periodicwave(ac, options); specifications specification status comment web audio apithe def
inition of 'periodicwave' in that specification. working draft ...
PermissionStatus.onchange - Web APIs
ion() { ... }) example navigator.permissions.query({name:'geolocation'}).then(function(permissionstatus) { console.log('geolocation permission state is ', permissionstatus.state); permissionstatus.onchange = function() { console.log('geolocation permission state has changed to ', this.state); }; }); specification specification status comment permissionsthe def
inition of 'onchange' in that specification. working draft
initial def
inition. ...
PermissionStatus - Web APIs
us changes. example navigator.permissions.query({name:'geolocation'}).then(function(permissionstatus) { console.log('geolocation permission status is ', permissionstatus.state); permissionstatus.onchange = function() { console.log('geolocation permission status has changed to ', this.state); }; }); specification specification status comment permissionsthe def
inition of 'permissionstatus' in that specification. working draft
initial def
inition. ...
Permissions.query() - Web APIs
th uservisibleonly). example navigator.permissions.query({name:'geolocation'}).then(function(result) { if (result.state == 'granted') { showlocalnewswithgeolocation(); } else if (result.state == 'prompt') { showbuttontoenablelocalnews(); } // don't do anything if the permission was denied. }); specification specification status comment permissionsthe def
inition of 'query()' in that specification. working draft
initial def
inition. ...
Permissions - Web APIs
t on a given api. example navigator.permissions.query({name:'geolocation'}).then(function(result) { if (result.state === 'granted') { showlocalnewswithgeolocation(); } else if (result.state === 'prompt') { showbuttontoenablelocalnews(); } // don't do anything if the permission was denied. }); specification specification status comment permissionsthe def
inition of 'permissions' in that specification. working draft
initial def
inition. browser support 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for andro...
Using the Permissions API - Web APIs
permission... let's face it, permissions on the web are a necessary evil, and they are not much fun to deal with as developers. historically, different apis handle their own permissions inconsistently — for example the notifications api allows for explicit checking of permission status and requesting permission, whereas the geolocation api doesn't (which causes problems if the user denied the
initial permission request, as we'll see below). the permissions api provides the tools to allow developers to implement a better user experience as far as permissions are concerned. for example, it can query whether permission to use a particular api is granted or denied, and specifically request permission to use an api. at the moment, implementation of the api is at an early stage, so support in ...
PhotoCapabilities.fillLightMode - Web APIs
lude auto, off, or flash. syntax const lightmodes = photocapabilities.filllightmode value an array of available fill light modes. auto the device's fill light will be used automatically in low light conditions. off no fill light will be used. flash always use the device's fill light. specifications specification status comment mediastream image capturethe def
inition of 'filllightmode' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome f...
PhotoCapabilities.imageHeight - Web APIs
the imageheight read-only property of the photocapabilities interface returns a mediasettingsrange object indicating the image height range supported by the user agent. syntax var mediasettingsrange = photocapabilities.imageheight value a mediasettingsrange object. specifications specification status comment mediastream image capturethe def
inition of 'imageheight' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for andro...
imageWidth - Web APIs
the imagewidth read-only property of the photocapabilities interface returns a mediasettingsrange object indicating the image width range supported by the user agent. syntax var mediasettingsrange = photocapabilities.imagewidth value a mediasettingsrange is an object. specifications specification status comment mediastream image capturethe def
inition of 'imagewidth' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for and...
PhotoCapabilities.redEyeReduction - Web APIs
on value one of "never", "always", or "controllable". never red-eye reduction is not available. always red-eye reduction is available in the source and it is always turned on. controllable red-eye reduction is available in the source and it is configurable via the photosettings object. specifications specification status comment mediastream image capturethe def
inition of 'redeyereduction' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome...
Plugin - Web APIs
in.name read only the name of the plugin. plugin.version read only the plugin's version number string. methods plugin.item returns the mime type of a supported content type, given the index number into a list of supported types. plugin.nameditem returns the mime type of a supported item. specifications specification status comment html living standardthe def
inition of 'plugin' in that specification. living standard
initial def
inition. ...
PointerEvent.getCoalescedEvents() - Web APIs
etcoalescedevents() method of the pointerevent interface returns a sequence of all pointerevent instances that were coalesced into the dispatched pointermove event. syntax var pointerevents[] = pointerevent.getcoalescedevents() parameters none. returns a sequence of pointerevent instances. specifications specification status comment pointer events – level 3the def
inition of 'getcoalescedevents()' in that specification. editor's draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webvie...
PointerEvent.height - Web APIs
t report the contact geometry to the browser, the height defaults to 1. syntax var contactheight = pointerevent.height; return value contactheight the height of the event's contact area (in css pixels). example an example of this property is included in the pointerevent.width example. specifications specification status comment pointer events – level 2the def
inition of 'height' in that specification. recommendation non-stable version. pointer eventsthe def
inition of 'height' in that specification. obsolete
initial def
inition. ...
PointerEvent.isPrimary - Web APIs
erwise. example this example illustrates using the value of isprimary to call the appropriate processing function. target.addeventlistener('pointerdown', function(event) { if (event.isprimary) process_primary_pointer(event); else process_secondary_pointer(event); }, false); specifications specification status comment pointer events – level 2the def
inition of 'isprimary' in that specification. recommendation non-stable version. pointer eventsthe def
inition of 'isprimary' in that specification. obsolete
initial def
inition. ...
PushManager.supportedContentEncodings - Web APIs
the supportedcontentencodings read-only property of the pushmanager interface returns an array of supported content codings that can be used to encrypt the payload of a push message. syntax var encodings[] = pushmanager.supportedcontentencodings value an array of strings. specifications specification status comment push apithe def
inition of 'supportedcontentencodings' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for ...
PushManager - Web APIs
tprequest. }, function(error) { // during development it often helps to log errors to the // console. in a production environment it might make sense to // also report information about errors back to the // application server. console.log(error); } ); }); specifications specification status comment push apithe def
inition of 'pushmanager' in that specification. working draft
initial def
inition. ...
PushMessageData.arrayBuffer() - Web APIs
a interface extracts push message data as an arraybuffer object. syntax var myarraybuffer = pushevent.data.arraybuffer(); parameters none. returns an arraybuffer. examples self.addeventlistener('push', function(event) { var buffer = event.data.arraybuffer(); // do something with your array buffer }); specifications specification status comment push apithe def
inition of 'arraybuffer()' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome f...
PushMessageData.blob() - Web APIs
the blob()method of the pushmessagedata interface extracts push message data as a blob object. syntax var myblob = pushevent.data.blob(); parameters none. returns a blob. examples self.addeventlistener('push', function(event) { var blob = event.data.blob(); // do something with your blob }); specifications specification status comment push apithe def
inition of 'blob()' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfir...
PushMessageData.json() - Web APIs
on(); parameters none. returns the result of parsing push event data as json. this could be anything that can be represented by json — an object, an array, a string, a number... examples self.addeventlistener('push', function(event) { var mydata = event.data.json(); // do something with your data }); specifications specification status comment push apithe def
inition of 'json()' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for andr...
PushMessageData.text() - Web APIs
ext()method of the pushmessagedata interface extracts push message data as a plain text string. syntax var mytext = pushevent.data.text(); parameters none. returns a usvstring. examples self.addeventlistener('push', function(event) { var textobj = event.data.text(); // do something with your text }); specifications specification status comment push apithe def
inition of 'text()' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for andr...
PushMessageData - Web APIs
data as a blob object. pushmessagedata.json() extracts the data as a json object. pushmessagedata.text() extracts the data as a plain text string. examples self.addeventlistener('push', function(event) { var obj = event.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { firenotification(obj, event); port.postmessage(obj); } else if(obj.action === '
init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); specifications specification status comment push apithe def
inition of 'pushmessagedata' in that specification. working draft
initial def
inition. ...
PushSubscription.expirationTime - Web APIs
the expirationtime read-only property of the pushsubscription interface returns a domhighrestimestamp of the subscription expiration time associated with the push subscription, if there is one, or null otherwise. syntax var expirationtime = pushsubscription.expirationtime value a domhighrestimestamp. specifications specification status comment push apithe def
inition of 'expirationtime' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for an...
PushSubscription.getKey() - Web APIs
/ unsubscribes from // push messages. subbtn.disabled = false; if (!subscription) { console.log('not yet subscribed to push') // we aren't subscribed to push, so set ui // to allow the user to enable push return; } // set your ui to show they have subscribed for // push messages subbtn.textcontent = 'unsubscribe from push messaging'; ispushenabled = true; //
initialize status, which includes setting ui elements for subscribed status // and updating subscribers list via push var endpoint = subscription.endpoint; var key = subscription.getkey('p256dh'); var auth = subscription.getkey('auth'); ... specifications specification status comment push api working draft this is the push api spec, but note that getkey() i...
PushSubscription.options - Web APIs
hose effect is made visible to the user. applicationserverkey: a public key your push server will use to send messages to client apps via a push server. this value is part of a signing key pair generated by your application server, and usable with elliptic curve digital signature (ecdsa), over the p-256 curve. specifications specification status comment push apithe def
inition of 'options' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for and...
PushSubscription.subscriptionId - Web APIs
the endpoint read-only property of the pushsubscription interface returns a domstring containing the subscription id associated with the push subscription. syntax var subid = pushsubscription.subscriptionid; specifications specification status comment push api working draft
initial def
inition 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetsubscriptionidchrome full support 42edg...
PushSubscription.toJSON() - Web APIs
object. it currently only contains the subscription endpoint, as an endpoint member. example navigator.serviceworker.ready.then(function(reg) { reg.pushmanager.getsubscription().then(function(subscription) { var mysubscription = subscription.tojson(); // do something with subscription details }) }); specifications specification status comment push apithe def
inition of 'pushsubscription: tojson' in that specification. working draft ...
PushSubscription.unsubscribe() - Web APIs
nsubscribed. example navigator.serviceworker.ready.then(function(reg) { reg.pushmanager.getsubscription().then(function(subscription) { subscription.unsubscribe().then(function(successful) { // you've successfully unsubscribed }).catch(function(e) { // unsubscription failed }) }) }); specifications specification status comment push apithe def
inition of 'unsubscribe()' in that specification. working draft
initial def
inition. ...
Push API - Web APIs
e an event handler fired whenever a pushsubscriptionchange event occurs; for example, when a push subscription has been invalidated, or is about to be invalidated (e.g. when a push service sets an expiration time.) examples mozilla's serviceworker cookbook contains many useful push examples. specifications specification status comment push api working draft
initial def
inition ...
RTCAnswerOptions - Web APIs
n which it's based. note: at this time, rtcansweroptions does not have any additional properties defined beyond those included in rtcofferansweroptions. however, this is likely to change in the future, so the type has been defined in preparation for that eventuality. specifications specification status comment webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcansweroptions' in that specification. candidate recommendation
initial def
inition. ...
Range.cloneRange() - Web APIs
oints identical to the cloned range. the returned clone is copied by value, not reference, so a change in either range does not affect the other. syntax clone = range.clonerange(); example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); clone = range.clonerange(); specifications specification status comment domthe def
inition of 'range.clonerange()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.clonerange()' in that specification. obsolete
initial specification. ...
Range.collapse() - Web APIs
tostart); parameters tostart optional a boolean value: true collapses the range to its start, false to its end. if omitted, it defaults to false . example var range = document.createrange(); referencenode = document.getelementsbytagname("div").item(0); range.selectnode(referencenode); range.collapse(true); specifications specification status comment domthe def
inition of 'range.collapse()' in that specification. living standard the parameter is now optional and default to false. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.collapse()' in that specification. obsolete
initial specification. ...
Range.collapsed - Web APIs
ty (containing no content), and specifies a single point in a dom tree. to collapse a range, see the range.collapse() method. syntax iscollapsed = range.collapsed; example let range = document.createrange(); range.setstart(startnode, startoffset); range.setend(endnode, endoffset); iscollapsed = range.collapsed; specifications specification status comment domthe def
inition of 'range.collapsed' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.collapsed' in that specification. obsolete
initial specification. ...
Range.compareBoundaryPoints() - Web APIs
e range. example var range, sourcerange, compare; range = document.createrange(); range.selectnode(document.getelementsbytagname("div")[0]); sourcerange = document.createrange(); sourcerange.selectnode(document.getelementsbytagname("div")[1]); compare = range.compareboundarypoints(range.start_to_end, sourcerange); specifications specification status comment domthe def
inition of 'range.compareboundarypoints()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.compareboundarypoints()' in that specification. obsolete
initial specification. ...
Range.comparePoint() - Web APIs
node to compare with the range. offset an integer greater than or equal to zero representing the offset inside the referencenode. example range = document.createrange(); range.selectnode(document.getelementsbytagname('div').item(0)); returnvalue = range.comparepoint(document.getelementsbytagname('p').item(0), 1); specification specification status comment domthe def
inition of 'range.comparepoint()' in that specification. living standard
initial specification. ...
Range.deleteContents() - Web APIs
he contents of the range from the document. unlike range.extractcontents(), this method does not return a documentfragment containing the deleted content. syntax range.deletecontents() example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); range.deletecontents(); specifications specification status comment domthe def
inition of 'range.deletecontents()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.deletecontents()' in that specification. obsolete
initial specification. ...
Range.detach() - Web APIs
detach() method does nothing. it used to disable the range object and enable the browser to release associated resources. the method has been kept for compatibility. syntax range.detach(); example var range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); range.detach(); specifications specification status comment domthe def
inition of 'range.detach()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.detach()' in that specification. obsolete
initial specification. ...
Range.endContainer - Web APIs
ode within which the range ends. to change the end position of a node, use the range.setend() method or a similar one. syntax endrangenode = range.endcontainer; example var range = document.createrange(); range.setstart(startnode,startoffset); range.setend(endnode,endoffset); endrangenode = range.endcontainer; specifications specification status comment domthe def
inition of 'range.endcontainer' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.endcontainer' in that specification. obsolete
initial specification. ...
Range.endOffset - Web APIs
y point of the range. this property is read-only. to change the endoffset of a range, use one of the range.setend methods. syntax endrangeoffset = range.endoffset; example var range = document.createrange(); range.setstart(startnode,startoffset); range.setend(endnode,endoffset); endrangeoffset = range.endoffset; specifications specification status comment domthe def
inition of 'range.endoffset' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.endoffset' in that specification. obsolete
initial specification. ...
Range.getClientRects() - Web APIs
ed by aggregating the results of calls to element.getclientrects() for all the elements in the range. syntax rectlist = range.getclientrects() example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); rectlist = range.getclientrects(); specification specification status comment css object model (cssom) view modulethe def
inition of 'range.getclientrects()' in that specification. working draft
initial specification. ...
Range.intersectsNode() - Web APIs
the range. syntax bool = range.intersectsnode( referencenode ) parameters referencenode the node to compare with the range. example var range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); var bool = range.intersectsnode(document.getelementsbytagname("p").item(0)); specification specification status comment domthe def
inition of 'range.intersectnode()' in that specification. living standard
initial def
inition. ...
Range.isPointInRange() - Web APIs
parameters referencenode the node to compare with the range. offset the offset into node of the point to compare with the range. example range = document.createrange(); range.selectnode(document.getelementsbytagname("div").item(0)); bool = range.ispointinrange(document.getelementsbytagname("p").item(0),1); specification specification status comment domthe def
inition of 'range.ispointinrange()' in that specification. living standard
initial def
inition. ...
Range.selectNode() - Web APIs
f the range will be the same as the parent of the referencenode. syntax range.selectnode(referencenode); parameters referencenode the node to select within a range. example let range = document.createrange(); let referencenode = document.getelementsbytagname('div').item(0); range.selectnode(referencenode); specifications specification status comment domthe def
inition of 'range.selectnode()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.selectnode()' in that specification. obsolete
initial specification. ...
Range.setEnd() - Web APIs
ild nodes between the start of the endnode. example const range = document.createrange(); const endnode = document.getelementsbytagname('p').item(3); const endoffset = endnode.childnodes.length; range.setend(endnode, endoffset); setend() is commonly used in conjunction with setstart() to fully configure a range. specifications specification status comment domthe def
inition of 'range.setend()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.setend()' in that specification. obsolete
initial specification. ...
Range.setEndAfter() - Web APIs
end of the range will be the same as that for the referencenode. syntax range.setendafter(referencenode); parameters referencenode the node to end the range after. example var range = document.createrange(); var referencenode = document.getelementsbytagname('div').item(0); range.setendafter(referencenode); specifications specification status comment domthe def
inition of 'range.setendafter()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.setendafter()' in that specification. obsolete
initial specification. ...
Range.setEndBefore() - Web APIs
of the range will be the same as that for the referencenode. syntax range.setendbefore(referencenode); parameters referencenode the node to end the range before. example var range = document.createrange(); var referencenode = document.getelementsbytagname("div").item(0); range.setendbefore(referencenode); specifications specification status comment domthe def
inition of 'range.setendbefore()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.setendbefore()' in that specification. obsolete
initial specification. ...
Range.setStartAfter() - Web APIs
the range will be the same as that for the referencenode. syntax range.setstartafter(referencenode); parameters referencenode the node to start the range after. example var range = document.createrange(); var referencenode = document.getelementsbytagname("div").item(0); range.setstartafter(referencenode); specifications specification status comment domthe def
inition of 'range.setstartafter()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.setstartafter()' in that specification. obsolete
initial specification. ...
Range.setStartBefore() - Web APIs
l be the same as that for the referencenode. syntax range.setstartbefore(referencenode); parameters referencenode the node before which the range should start. example var range = document.createrange(); var referencenode = document.getelementsbytagname("div").item(0); range.setstartbefore(referencenode); specifications specification status comment domthe def
inition of 'range.setstartbefore()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.setstartbefore()' in that specification. obsolete
initial specification. ...
Range.startContainer - Web APIs
node within which the range starts. to change the start position of a node, use one of the range.setstart() methods. syntax startrangenode = range.startcontainer; example range = document.createrange(); range.setstart(startnode,startoffset); range.setend(endnode,endoffset); startrangenode = range.startcontainer; specifications specification status comment domthe def
inition of 'range.endcontainer' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.startcontainer' in that specification. obsolete
initial specification. ...
Range.startOffset - Web APIs
ner and the boundary point of the range. to change the startoffset of a range, use the range.setstart method. syntax startrangeoffset = range.startoffset; example var range = document.createrange(); range.setstart(startnode,startoffset); range.setend(endnode,endoffset); var startrangeoffset = range.startoffset; specifications specification status comment domthe def
inition of 'range.startoffset' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.startoffset' in that specification. obsolete
initial specification. ...
Range.surroundContents() - Web APIs
a node with which to surround the contents. example html <span class="header-text">put this in a headline</span> javascript const range = document.createrange(); const newparent = document.createelement('h1'); range.selectnode(document.queryselector('.header-text')); range.surroundcontents(newparent); result specifications specification status comment domthe def
inition of 'range.surroundcontents()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.surroundcontents()' in that specification. obsolete
initial specification. ...
Range.toString() - Web APIs
b>words</b>. look at the output below.</p> <p id="log"></p> javascript const range = document.createrange(); range.setstartbefore(document.getelementsbytagname('b').item(0), 0); range.setendafter(document.getelementsbytagname('b').item(1), 0); document.getelementbyid('log').textcontent = range.tostring(); result specifications specification status comment domthe def
inition of 'range.tostring()' in that specification. living standard no change. document object model (dom) level 2 traversal and range specificationthe def
inition of 'range.tostring()' in that specification. obsolete
initial specification. ...
ReadableByteStreamController.close() - Web APIs
m the stream, but once those are read, the stream will become closed. syntax readablebytestreamcontroller.close(); parameters none. return value undefined. exceptions typeerror the source object is not a readablebytestreamcontroller, or the stream is not readable for some other reason. examples tbd. specifications specification status comment streamsthe def
inition of 'close()' in that specification. living standard
initial def
inition. ...
ReadableByteStreamController.enqueue() - Web APIs
ameters chunk the chunk to enqueue. return value undefined. exceptions typeerror the source object is not a readablebytestreamcontroller, or the stream cannot be read for some other reason, or the chunk is not an object, or the chunk's internal array buffer is non-existant or detached. examples tbd. specifications specification status comment streamsthe def
inition of 'enqueue()' in that specification. living standard
initial def
inition. ...
ReadableByteStreamController.error() - Web APIs
stream to error. syntax readablebytestreamcontroller.error(e); parameters e the error you want future interactions to fail with. return value undefined. exceptions typeerror the source object is not a readablebytestreamcontroller, or the stream is not readable for some other reason. examples tbd. specifications specification status comment streamsthe def
inition of 'error()' in that specification. living standard
initial def
inition. ...
ReadableStream.locked - Web APIs
is locked to a reader. syntax var locked = readablestream.locked; value a boolean indicating whether or not the readable stream is locked. examples const stream = new readablestream({ ... }); const reader = stream.getreader(); stream.locked // should return true, as the stream has been locked to a reader specifications specification status comment streamsthe def
inition of 'locked' in that specification. living standard
initial def
inition. ...
ReadableStream.pipeTo() - Web APIs
able stream/readable stream, or one or both of the streams are locked. examples // fetch the original image fetch('png-logo.png') // retrieve its body as readablestream .then(response => response.body) .then(body => body.pipethrough(new pngtransformstream())) .then(rs => rs.pipeto(new finaldestinationstream())) specifications specification status comment streamsthe def
inition of 'pipeto()' in that specification. living standard
initial def
inition. ...
ReadableStream - Web APIs
controller.close(); return; } // get the data and send it to the browser via the controller controller.enqueue(value); push(); }); }; push(); } }); return new response(stream, { headers: { "content-type": "text/html" } }); }); specifications specification status comment streamsthe def
inition of 'readablestream' in that specification. living standard
initial def
inition ...
ReadableStreamBYOBReader.ReadableStreamBYOBReader() - Web APIs
the readablestream to be read. return value an instance of the readablestreambyobreader object. exceptions typeerror the supplied stream parameter is not a readablestream, or it is already locked for reading by another reader, or its stream controller is not a readablebytestreamcontroller. examples tbd specifications specification status comment streamsthe def
inition of 'readablestreambyobreader()' in that specification. living standard
initial def
inition. ...
ReadableStreamBYOBReader.read() - Web APIs
alue: undefined, done: true }. if the stream becomes errored, the promise will be rejected with the relevant error. exceptions typeerror the source object is not a readablestreambyobreader, the stream has no owner, the view is not an object or has become detached, or the view's length is 0. examples tbd. specifications specification status comment streamsthe def
inition of 'read()' in that specification. living standard
initial def
inition. ...
TreeWalker.expandEntityReferences - Web APIs
ted filter. syntax expand = treewalker.expandentityreferences; example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); expand = treewalker.expandentityreferences; specifications document object model (dom) level 2 traversal and range specificationthe def
inition of 'treewalker.expandentityreferences' in that specification. obsolete
initial def
inition. ...
TreeWalker.filter - Web APIs
ether or not to accept it. syntax nodefilter = treewalker.filter; example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); nodefilter = treewalker.filter; // document.body in this case specifications specification status comment domthe def
inition of 'treewalker.filter' in that specification. living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe def
inition of 'treewalker.filter' in that specification. obsolete
initial def
inition. ...
TreeWalker.parentNode() - Web APIs
not changed. syntax node = treewalker.parentnode(); example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); var node = treewalker.parentnode(); // returns null as there is no parent specifications specification status comment domthe def
inition of 'treewalker.parentnode' in that specification. living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe def
inition of 'treewalker.parentnode' in that specification. obsolete
initial def
inition. ...
TreeWalker.previousNode() - Web APIs
changed. syntax node = treewalker.previousnode(); example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); var node = treewalker.previousnode(); // returns null as there is no parent specifications specification status comment domthe def
inition of 'treewalker.previousnode' in that specification. living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe def
inition of 'treewalker.previousnode' in that specification. obsolete
initial def
inition. ...
TreeWalker.root - Web APIs
the root of what the treewalker traverses. syntax root = treewalker.root; example var treewalker = document.createtreewalker( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); root = treewalker.root; // document.body in this case specifications specification status comment domthe def
inition of 'treewalker.root' in that specification. living standard no change from document object model (dom) level 2 traversal and range specification document object model (dom) level 2 traversal and range specificationthe def
inition of 'treewalker.root' in that specification. obsolete
initial def
inition. ...
TreeWalker - Web APIs
at the object construction, returns null and the current node is not changed. treewalker.nextnode() moves the current node to the next visible node in the document order, and returns the found node. it also moves the current node to this one. if no such node exists, returns null and the current node is not changed. specifications specification status comment domthe def
inition of 'treewalker' in that specification. living standard removed the expandentityreferences property. document object model (dom) level 2 traversal and range specificationthe def
inition of 'treewalker' in that specification. obsolete
initial def
inition. ...
UIEvent.detail - Web APIs
or next, depending on the event) click count. for click or dblclick events, uievent.detail is the current click count. for mousedown or mouseup events, uievent.detail is 1 plus the current click count. for all other uievent objects, uievent.detail is always zero. specifications specification status comment document object model (dom) level 3 events specificationthe def
inition of 'uievent.detail' in that specification. obsolete document object model (dom) level 2 events specificationthe def
inition of 'uievent.detail' in that specification. obsolete
initial def
inition. ...
UIEvent.view - Web APIs
the uievent.view read-only property returns the windowproxy object from which the event was generated. in browsers, this is the window object the event happened in. syntax var view = event.view; view is a reference to an abstractview object. specifications specification status comment document object model (dom) level 3 events specificationthe def
inition of 'uievent' in that specification. obsolete from document object model (dom) level 2 events specification, changed the type of view from abstractview to windowproxy. document object model (dom) level 2 events specificationthe def
inition of 'uievent' in that specification. obsolete
initial def
inition. ...
URL.createObjectURL() - Web APIs
ed creating an object url for the mediastream. this is no longer necessary, and browsers are removing support for doing this. important: if you still have code that relies on createobjecturl() to attach streams to media elements, you need to update your code to simply set srcobject to the mediastream directly. specifications specification status comment file apithe def
inition of 'createobjecturl()' in that specification. working draft
initial def
inition. media source extensionsthe def
inition of 'url' in that specification. recommendation mediasource extension. older versions of this specification used createobjecturl() for mediastream objects; this is no longer supported. ...
URL.host - Web APIs
l('https://developer.mozilla.org:443/docs/web/api/url/host'); console.log(url.host); // "developer.mozilla.org" // the port number is not included because 443 is the scheme's default port url = new url('https://developer.mozilla.org:4097/docs/web/api/url/host'); console.log(url.host); // "developer.mozilla.org:4097" specifications specification status comment urlthe def
inition of 'url.host' in that specification. living standard
initial def
inition ...
URL.hostname - Web APIs
url interface is a usvstring containing the domain name of the url. note: this feature is available in web workers. syntax const domain = url.hostname url.hostname = domain value a usvstring. examples const url = new url('/docs/web/api/url/hostname'); console.log(url.hostname); // logs: 'developer.mozilla.org' specifications specification status comment urlthe def
inition of 'url.hostname' in that specification. living standard
initial def
inition. ...
URL.href - Web APIs
f property of the url interface is a usvstring containing the whole url. note: this feature is available in web workers. syntax const urlstring = url.href url.href = newurlstring value a usvstring. examples const url = new url('/docs/web/api/url/href'); console.log(url.href); // logs: '/docs/web/api/url/href' specifications specification status comment urlthe def
inition of 'url.href' in that specification. living standard
initial def
inition. ...
URL.origin - Web APIs
ill be used, e.g "blob:https://mozilla.org" will be returned as "https://mozilla.org". note: this feature is available in web workers. syntax const originstring = url.origin value a usvstring. examples const url = new url("blob:https://mozilla.org:443/") console.log(url.origin); // logs 'https://mozilla.org' specifications specification status comment urlthe def
inition of 'url.origin' in that specification. living standard
initial def
inition. ...
URL.password - Web APIs
ty, it silently fails. note: this feature is available in web workers. syntax const passwordstring = url.password url.password = newpassword value a usvstring. examples const url = new url('https://anonymous:flabada@developer.mozilla.org/docs/web/api/url/password'); console.log(url.password) // logs "flabada" specifications specification status comment urlthe def
inition of 'url.password' in that specification. living standard
initial def
inition. ...
URL.pathname - Web APIs
the pathname property of the url interface is a usvstring containing an
initial '/' followed by the path of the url (or the empty string if there is no path). note: this feature is available in web workers. syntax const path = url.pathname url.pathname = newpath value a usvstring. examples const url = new url('/docs/web/api/url/pathname?q=value'); console.log(url.pathname); // logs "/docs/web/api/url/pathname" specifications specification status comment urlthe def
inition of 'url.pathname' in that specification. living standard
initial def
inition. ...
URLSearchParams.toString() - Web APIs
/add a second foo parameter. params.append('foo', 4); console.log(params.tostring()); //prints 'foo=1&bar=2&foo=4' // note: params can also be directly created let url = new url('https://example.com?foo=1&bar=2'); let params = url.searchparams; // or even simpler let params = new urlsearchparams('foo=1&bar=2'); specifications specification status comment urlthe def
inition of 'tostring() (see "stringifier")' in that specification. living standard
initial def
inition. ...
URLSearchParams.values() - Web APIs
searchparams.values(); parameters none. return value returns an iterator. examples // create a test urlsearchparams object var searchparams = new urlsearchparams("key1=value1&key2=value2"); // display the values for(var value of searchparams.values()) { console.log(value); } the result is: value1 value2 specifications specification status comment urlthe def
inition of 'values() (see "iterable")' in that specification. living standard
initial def
inition. ...
URLUtilsReadOnly.hash - Web APIs
nly property returns a domstring containing a '#' followed by the fragment identifier of the url. the hash is not percent encoded. syntax string = object.hash; examples // in a web worker, on the page https://developer.mozilla.org/docs/urlutilsreadonly.hash#example var result = window.self.hash; // returns:'#hash' specifications specification status comment urlthe def
inition of 'urlutilsreadonly.hash' in that specification. living standard
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webvie...
URLUtilsReadOnly.host - Web APIs
only.host read-only property returns a domstring containing the host, that is the hostname, a ':', and the port of the url. syntax string = object.host; examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.host var result = window.self.host; // returns:'developer.mozilla.org:80' specifications specification status comment urlthe def
inition of 'urlutilsreadonly.host' in that specification. living standard
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webvie...
URLUtilsReadOnly.hostname - Web APIs
the urlutilsreadonly.hostname read-only property returns a domstring containing the domain of the url. syntax string = object.hostname; examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.hostname var result = window.self.hostname; // returns:'developer.mozilla.org' specifications specification status comment urlthe def
inition of 'urlutilsreadonly.hostname' in that specification. living standard
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchro...
URLUtilsReadOnly.href - Web APIs
only.href read-only property is a stringifier that returns a domstring containing the whole url. syntax string = object.href; examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.href var result = window.self.href; // returns:'https://developer.mozilla.org/urlutilsreadonly.href' specifications specification status comment urlthe def
inition of 'urlutilsreadonly.href' in that specification. living standard
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webvie...
URLUtilsReadOnly.origin - Web APIs
citely specified). for url using file: scheme, the value is browser dependant. this version of origin is implemented by workerlocation for use on workers. syntax string = object.origin; examples // on this page, returns the origin var result = self.location.origin; // returns:'https://developer.mozilla.org:443' specifications specification status comment urlthe def
inition of 'urlutilsreadonly.origin' in that specification. living standard
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webv...
URLUtilsReadOnly.port - Web APIs
the urlutilsreadonly.port read-only property returns a domstring containing the port number of the url. syntax string = object.port; examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.port var result = window.self.port; // returns:'80' specifications specification status comment urlthe def
inition of 'urlutilsreadonly.port' in that specification. living standard
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androido...
URLUtilsReadOnly.protocol - Web APIs
urlutilsreadonly.protocol read-only property returns a domstring containing the protocol scheme of the url, including the final ':'. syntax string = object.protocol; examples // in a web worker, on the page https://developer.mozilla.org/urlutilsreadonly.href var result = window.self.protocol; // returns:'https:' specifications specification status comment urlthe def
inition of 'urlutilsreadonly.protocol' in that specification. living standard
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid we...
URLUtilsReadOnly.search - Web APIs
the urlutilsreadonly.search read-only property returns a domstring containing a '?' followed by the parameters of the url. syntax string = object.search; examples // in a web worker, on the page https://developer.mozilla.org/docs/urlutilsreadonly.href?t=67 var result = window.self.search; // returns:'?t=67' specifications specification status comment urlthe def
inition of 'urlutilsreadonly.search' in that specification. living standard
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webview...
URLUtilsReadOnly - Web APIs
', and the port of the url. urlutilsreadonly.hostname read only is a domstring containing the domain of the url. urlutilsreadonly.origin read only returns a domstring containing the canonical form of the origin of the specific location. urlutilsreadonly.port read only is a domstring containing the port number of the url. urlutilsreadonly.pathname read only is a domstring containing an
initial '/' followed by the path of the url. urlutilsreadonly.search read only is a domstring containing a '?' followed by the parameters of the url. urlutilsreadonly.hash read only is a domstring containing a '#' followed by the fragment identifier of the url. methods this interface doesn't inherit any methods. urlutilsreadonly.tostring() returns a domstring containing the whole url. it ...
URL API - Web APIs
niform resource locator and the api that accesses and manipulates urls. the url standard also defines concepts such as domains, hosts, and ip addresses, and also attempts to describe in a standard way the legacy application/x-www-form-urlencoded mime type used to submit web forms' contents as a set of key/value pairs. url concepts and usage the majority of the url standard is taken up by the def
inition of a url and how it is structured and parsed. also covered are def
initions of various terms related to addressing of computers on a network, and the algorithms for parsing ip addresses and dom addresses are specified. more interesting to most developers is the api itself. accessing url components creating an url object for a given url parses the url and provides quick access to its constitue...
USB.getDevices() - Web APIs
es to the console. for information on pairing devices, see usb.requestdevice(). navigator.usb.getdevices() .then(devices => { console.log("total devices: " + devices.length); devices.foreach(device => { console.log("product name: " + device.productname + ", serial number " + device.serialnumber); }); }); specifications specification status comment webusbthe def
inition of 'getdevices' in that specification. draft
initial def
inition. ...
USB.requestDevice() - Web APIs
ted. const filters = [ {vendorid: 0x1209, productid: 0xa800}, {vendorid: 0x1209, productid: 0xa850} ]; navigator.usb.requestdevice({filters: filters}) .then(usbdevice => { console.log("product name: " + usbdevice.productname); }) .catch(e => { console.log("there is no device. " + e); }); specifications specification status comment webusbthe def
inition of 'requestdevice' in that specification. draft
initial def
inition. ...
USB - Web APIs
nnected. methods usb.getdevices() returns a promise that resolves with an array of usbdevice objects for paired attached devices. usb.requestdevice() returns a promise that resolves with an instance of usbdevice if the specified device is found. calling this function triggers the user agent's pairing flow. specifications specification status comment webusbthe def
inition of 'usb' in that specification. draft
initial def
inition. ...
USBIsochronousInTransferResult - Web APIs
packets. see the individual dataview objects in the packets array for the portion of this buffer containing data from each packet. usbisochronousintransferresult.packetsread only returns an array of usbisochronousintransferpacket objects containing the result of each request to receive a packet from the device. specifications specification status comment webusbthe def
inition of 'usbisochronousintransferresult' in that specification. draft
initial def
inition. ...
USBIsochronousOutTransferPacket - Web APIs
o the device. usbisochronousouttransferpacket.statusread only returns the status of the transfer request, one of: "ok" - the transfer was successful. "stall" - the device indicated an error by generating a stall condition on the endpoint. a stall on an isochronous endpoint does not need to be cleared. specifications specification status comment webusbthe def
inition of 'usbisochronousouttransferpacket' in that specification. draft
initial def
inition. ...
USVString - Web APIs
r apis that perform text processing and need a string of unicode scalar values to operate on. usvstring is equivalent to domstring except for not allowing unpaired surrogate codepoints. unpaired surrogate codepoints present in usvstring are converted by the browser to unicode 'replacement character' u+fffd, (�). specifications specification status comment web idlthe def
inition of 'usvstring' in that specification. candidate recommendation
initial def
inition. ...
VRStageParameters - Web APIs
} else { info.innerhtml = '<strong>display stage parameters</strong>' + '<br>sitting to standing transform: ' + stageparams.sittingtostandingtransform + '<br>play area width (m): ' + stageparams.sizex + '<br>play area depth (m): ' + stageparams.sizey } }); specifications specification status comment webvr 1.1the def
inition of 'vrstageparameters' in that specification. draft
initial def
inition ...
validityState.badInput - Web APIs
rnet explorer, any non-numeric value will be dismissed from the field if it is a number input. example <input type="number" id="age"> var input = document.getelementbyid("age"); if (input.validity.badinput) { console.log("bad input detected…"); } else { console.log("content of input ok."); } specifications specification status comment html living standardthe def
inition of 'validitystate.badinput' in that specification. living standard live standard html 5.1the def
inition of 'validitystate.badinput' in that specification. recommendation no change from the previous snapshot html5. html5the def
inition of 'validitystate.badinput' in that specification. recommendation first snapshot of html living standard containing this inte...
ValidityState.patternMismatch - Web APIs
he email input type requires, at minimum, a match of x@y and the url type requires, at minimum, a match to x:, with no pattern attribute present. when invalid, the validitystate.typemismatch will be true, if there is no pattern attribute (or if the pattern attribute is not valid for that input type). specifications specification status comment html living standardthe def
inition of 'validitystate.patternmismatch' in that specification. living standard html 5.1the def
inition of 'validitystate.patternmismatch' in that specification. recommendation html5the def
inition of 'validitystate.patternmismatch' in that specification. recommendation ...
ValidityState.rangeOverflow - Web APIs
don't doesn't conform to the constraints set by the max value, the rangeoverflow property will be true. given the following: <input type="number" min="20" max="40" step="2"/> if value > 40, rangeoverflow will be true. when true, the element matches the :invalid and :out-of-range css pseudo-classes. specifications specification status comment html living standardthe def
inition of 'validitystate.rangeoverflow' in that specification. living standard html 5.1the def
inition of 'validitystate.rangeoverflow' in that specification. recommendation html5the def
inition of 'validitystate.rangeoverflow' in that specification. recommendation ...
ValidityState.rangeUnderflow - Web APIs
n't doesn't conform to the constraints set by the min value, the rangeunderflow property will be true. given the following: <input type="number" min="20" max="40" step="2"/> if value < 20, rangeunderflow will be true. when true, the element matches the :invalid and :out-of-range css pseudo-classes. specifications specification status comment html living standardthe def
inition of 'validitystate.rangeunderflow' in that specification. living standard html 5.1the def
inition of 'validitystate.rangeunderflow' in that specification. recommendation html5the def
inition of 'validitystate.rangeunderflow' in that specification. recommendation ...
ValidityState.stepMismatch - Web APIs
ivided by the step value (which defaults to 1 if ommitted) is not zero, there is a mismatch. given the following: <input type="number" min="20" max="40" step="2"/> if (value - min) / 2 != 0, stepmismatch will be true. if true, the element matches the :invalid and :out-of-range css pseudo-classes. specifications specification status comment html living standardthe def
inition of 'validitystate.stepmismatch' in that specification. living standard html 5.1the def
inition of 'validitystate.stepmismatch' in that specification. recommendation html5the def
inition of 'validitystate.stepmismatch' in that specification. recommendation ...
validityState.tooLong - Web APIs
the read-only toolong property of a validitystate object indicates if the value of an <input> or <textarea>, after having been edited by the user, exceeds the maximum code-unit length established by the element's maxlength attribute. specifications specification status comment html living standardthe def
inition of 'validitystate.toolong' in that specification. living standard html 5.1the def
inition of 'validitystate.toolong' in that specification. recommendation html5the def
inition of 'validitystate.toolong' in that specification. recommendation ...
validityState.tooShort - Web APIs
the read-only tooshort property of a validitystate object indicates if the value of an <input>, <button>, <select>, <output>, <fieldset> or <textarea>, after having been edited by the user, is less than the minimum code-unit length established by the element's minlength attribute. specifications specification status comment html living standardthe def
inition of 'validitystate.tooshort' in that specification. living standard html 5.1the def
inition of 'validitystate.tooshort' in that specification. recommendation html5the def
inition of 'validitystate.tooshort' in that specification. recommendation ...
ValidityState.typeMismatch - Web APIs
and url types. when the value provided doesn't match the expected value based on the type for other input types, you get different errors. for example, if the number input value is not a floating point number, the badinput is true. if the email is required but is empty, the valuemissing will be true. specifications specification status comment html living standardthe def
inition of 'validitystate.typemismatch' in that specification. living standard html 5.1the def
inition of 'validitystate.typemismatch' in that specification. recommendation html5the def
inition of 'validitystate.typemismatch' in that specification. recommendation ...
ValidityState - Web APIs
ls any constraint. if true, the element matches the :valid css pseudo-class; the :invalid css pseudo-class otherwise. valuemissing read only a boolean that is true if the element has a required attribute, but no value, or false otherwise. if true, the element matches the :invalid css pseudo-class. specifications specification status comment html living standardthe def
inition of 'validitystate' in that specification. living standard living standard html 5.1the def
inition of 'validitystate' in that specification. recommendation no change from the previous snapshot html5. html5the def
inition of 'validitystate' in that specification. recommendation first snapshot of html living standard containing this interface. ...
VideoConfiguration - Web APIs
contenttype : "video/webm;codecs=vp8", // valid content type width : 800, // width of the video height : 600, // height of the video bitrate : 10000, // number of bits used to encode 1s of video framerate : 30 // number of frames making up that 1s. } }; specifications specification status comment media capabilitiesthe def
inition of 'videoconfiguration' in that specification. draft
initial def
inition ...
VideoPlaybackQuality.corruptedVideoFrames - Web APIs
ideo() that would be implemented to switch to a different video that might tax the network less. var videoelem = document.getelementbyid("my_vid"); var quality = videoelem.getvideoplaybackquality(); if (quality.corruptedvideoframes/quality.totalvideoframes > 0.05) { downgradevideo(videoelem); } specifications specification status comment media playback qualitythe def
inition of 'videoplaybackquality: corruptedvideoframes' in that specification. editor's draft ...
WEBGL_draw_buffers.drawBuffersWEBGL() - Web APIs
none. examples see webgl_draw_buffers for more context with this example code. ext.drawbufferswebgl([ ext.color_attachment0_webgl, // gl_fragdata[0] ext.color_attachment1_webgl, // gl_fragdata[1] ext.color_attachment2_webgl, // gl_fragdata[2] ext.color_attachment3_webgl // gl_fragdata[3] ]); specifications specification status comment webgl_draw_buffersthe def
inition of 'webgl_draw_buffers' in that specification. recommendation
initial def
inition. opengl es 3.0the def
inition of 'gldrawbuffers' in that specification. standard man page of the (similar) opengl api. ...
WakeLock.request() - Web APIs
r any reason. const requestwakelock = async () => { try { const wakelock = await navigator.wakelock.request('screen'); } catch (err) { // the wake lock request fails - usually system related, such low as battery console.log(`${err.name}, ${err.message}`); } } requestwakelock(); specifications specification status comment screen wake lock apithe def
inition of 'request()' in that specification. unknown
initial def
inition. ...
WakeLock - Web APIs
r any reason. const requestwakelock = async () => { try { const wakelock = await navigator.wakelock.request('screen'); } catch (err) { // the wake lock request fails - usually system related, such low as battery console.log(`${err.name}, ${err.message}`); } } requestwakelock(); specifications specification status comment screen wake lock apithe def
inition of 'wakelock' in that specification. unknown
initial def
inition. ...
WakeLockSentinel.release() - Web APIs
ptions no exceptions are thrown. you should always listen for the onrelease event to check if a wake lock has been released. examples in this example, when a user clicks a button the wakelocksentinel is released. wakelockoffbutton.addeventlistener('click', () => { wakelocksentinel.release(); }) specifications specification status comment screen wake lock apithe def
inition of 'release()' in that specification. unknown
initial def
inition. ...
WakeLockSentinel.type - Web APIs
een. examples this example shows an asynchronous function that acquires a wakelocksentinel, then logs the type to the console. const requestwakelock = async () => { wakelock = await navigator.wakelock.request('screen'); console.log(wakelock.type); // logs 'screen' }; requestwakelock(); specifications specification status comment screen wake lock apithe def
inition of 'wakelocktype' in that specification. unknown
initial def
inition. ...
WaveShaperNode.WaveShaperNode() - Web APIs
or the waveshaping effect. the input signal is nominally within the range [-1;1]. oversample: specifies what type of oversampling (if any) should be used when applying the shaping curve. valid values are 'none', '2x', or '4x'. the default is 'none'. return value a new waveshapernode object instance. specifications specification status comment web audio apithe def
inition of 'waveshapernode()' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrom...
WebGL2RenderingContext.beginQuery() - Web APIs
nd faster version. gl.transform_feedback_primitives_written: number of primitives that are written to transform feedback buffers. query a webglquery object for which to start the querying. return value none. examples var query = gl.createquery(); gl.beginquery(gl.any_samples_passed, query); // ... specifications specification status comment webgl 2.0the def
inition of 'beginquery' in that specification. editor's draft
initial def
inition. opengl es 3.0the def
inition of 'glbeginquery' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.beginTransformFeedback() - Web APIs
transform feedback. possible values: gl.points gl.lines gl.triangles return value none. examples var transformfeedback = gl.createtransformfeedback(); gl.bindtransformfeedback(gl.transform_feedback, transformfeedback); gl.begintransformfeedback(gl.triangles); gl.drawarrays(gl.triangles, 0, 3); specifications specification status comment webgl 2.0the def
inition of 'begintransformfeedback' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glbegintransformfeedback' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.bindBufferBase() - Web APIs
for the bind operation. possible values: gl.transform_feedback_buffer gl.uniform_buffer index a gluint specifying the index of the target. buffer a webglbuffer which to bind to the binding point (target). return value none. examples gl.bindbufferbase(gl.transform_feedback_buffer, 0, buffer); specifications specification status comment webgl 2.0the def
inition of 'bindbufferbase' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glbindbufferbase' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.bindBufferRange() - Web APIs
target. buffer a webglbuffer which to bind to the binding point (target). offset a glintptr specifying the starting offset. size a glsizeiptr specifying the amount of data that can be read from the buffer. return value none. examples gl.bindbufferrange(gl.transform_feedback_buffer, 1, buffer, 0, 4); specifications specification status comment webgl 2.0the def
inition of 'bindbufferrange' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glbindbufferrange' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.bindSampler() - Web APIs
unit at the passed index. syntax void gl.bindsampler(unit, sampler); parameters unit a gluint specifying the index of the texture unit to which to bind the sampler to. sampler a webglsampler object to bind. return value none. examples var sampler = gl.createsampler(); gl.bindsampler(0, sampler); specifications specification status comment webgl 2.0the def
inition of 'bindsampler' in that specification. editor's draft
initial def
inition. opengl es 3.0the def
inition of 'glbindsampler' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.bindTransformFeedback() - Web APIs
meters target a glenum specifying the target (binding point). must be gl.transform_feedback. transformfeedback a webgltransformfeedback object to bind. return value none. examples var transformfeedback = gl.createtransformfeedback(); gl.bindtransformfeedback(gl.transform_feedback, transformfeedback); specifications specification status comment webgl 2.0the def
inition of 'bindtransformfeedback' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glbindtransformfeedback' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.bindVertexArray() - Web APIs
yntax void gl.bindvertexarray(vertexarray); parameters vertexarray a webglvertexarrayobject (vao) object to bind. return value none. examples var vao = gl.createvertexarray(); gl.bindvertexarray(vao); // ... // calls to bindbuffer or vertexattribpointer // which will be "recorded" in the vao // ... specifications specification status comment webgl 2.0the def
inition of 'bindvertexarray' in that specification. editor's draft
initial def
inition. opengl es 3.0the def
inition of 'glbindvertexarray' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.blitFramebuffer() - Web APIs
specifying the interpolation to be applied if the image is stretched. possible values: gl.nearest gl.linear return value none. examples gl.blitframebuffer(0, 0, canvas.width, canvas.height, 0, 0, canvas.width, canvas.height, gl.color_buffer_bit, gl.nearest); specifications specification status comment webgl 2.0the def
inition of 'blitframebuffer' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glblitframebuffer' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.clearBuffer[fiuv]() - Web APIs
n value none. examples gl.clearbufferiv(gl.color, 0, new int32array([r, g, b, a])); gl.clearbufferuiv(gl.color, 0, new uint32array([r, g, b, a])); gl.clearbufferfv(gl.color, 0, new float32array([r, g, b, a])); gl.clearbufferfv(gl.color, 0, [0.0, 0.0, 0.0, 0.0]); gl.clearbufferfi(gl.depth_stencil, 0, 1.0, 0); specifications specification status comment webgl 2.0the def
inition of 'clearbuffer[fiuv]()' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glclearbuffer' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.clientWaitSync() - Web APIs
ect did not become signaled. gl.condition_satisfied: indicates that the sync object was signaled before the timeout expired. gl.wait_failed: indicates that an error occurred during the execution. examples var sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); var status = gl.clientwaitsync(sync, 0, 0); specifications specification status comment webgl 2.0the def
inition of 'clientwaitsync' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glclientwaitsync' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.compressedTexSubImage3D() - Web APIs
in bytes from which to read from the buffer bound to gl.pixel_unpack_buffer. srcdata an arraybufferview that be used as a data store for the compressed image data in memory. return value none. examples gl.compressedtexsubimage3d(gl.texture_3d, 0, 0, 0, 512, 512, 512, gl.compressed_r11_eac, texturedata); specifications specification status comment webgl 2.0the def
inition of 'compressedtexsubimage3d' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glcompressedtexsubimage3d' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGL2RenderingContext.copyTexSubImage3D() - Web APIs
start copying. y a glint specifying the y coordinate of the lower left corner where to start copying. width a glsizei specifying the width of the texture. height a glsizei specifying the height of the texture. return value none. examples gl.copytexsubimage3d(gl.texture_3d, 0, 0, 0, 0, 0, 0, 16, 16); specifications specification status comment webgl 2.0the def
inition of 'copytexsubimage3d' in that specification. editor's draft
initial def
inition. opengl es 3.0the def
inition of 'glcopytexsubimage3d' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.createQuery() - Web APIs
the webgl2renderingcontext.createquery() method of the webgl 2 api creates and
initializes webglquery objects, which provide ways to asynchronously query for information. syntax webglquery gl.createquery(); parameters none. return value a webglquery object. examples gl must be a webgl2renderingcontext. webglquery objects are not available in webgl 1. var query = gl.createquery(); specifications specification status comment webgl 2.0the def
inition of 'createquery' in that specification. editor's draft
initial def
inition. opengl es 3.0the def
inition of 'glgenqueries' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.createSampler() - Web APIs
the webgl2renderingcontext.createsampler() method of the webgl 2 api creates and
initializes webglsampler objects. syntax webglsampler gl.createsampler(); parameters none. return value a webglsampler object. examples gl must be a webgl2renderingcontext. webglsampler objects are not available in webgl 1. var sampler = gl.createsampler(); specifications specification status comment webgl 2.0the def
inition of 'createsampler' in that specification. editor's draft
initial def
inition. opengl es 3.0the def
inition of 'glgensamplers' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.createTransformFeedback() - Web APIs
the webgl2renderingcontext.createtransformfeedback() method of the webgl 2 api creates and
initializes webgltransformfeedback objects. syntax webgltransformfeedback gl.createtransformfeedback(); parameters none. return value a webgltransformfeedback object. examples gl must be a webgl2renderingcontext. webgltransformfeedback objects are not available in webgl 1. var transformfeedback = gl.createtransformfeedback(); specifications specification status comment webgl 2.0the def
inition of 'createtransformfeedback' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glgentransformfeedbacks' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.deleteQuery() - Web APIs
api deletes a given webglquery object. syntax void gl.deletequery(query); parameters query a webglquery object to delete. return value none. examples gl must be a webgl2renderingcontext. webglquery objects are not available in webgl 1. var query = gl.createquery(); // ... gl.deletequery(query); specifications specification status comment webgl 2.0the def
inition of 'deletequery' in that specification. editor's draft
initial def
inition. opengl es 3.0the def
inition of 'gldeletequeries' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.deleteSampler() - Web APIs
webglsampler object. syntax void gl.deletesampler(sampler); parameters sampler a webglsampler object to delete. return value none. examples gl must be a webgl2renderingcontext. webglsampler objects are not available in webgl 1. var sampler = gl.createsampler(); // ... gl.deletesampler(sampler); specifications specification status comment webgl 2.0the def
inition of 'deletesampler' in that specification. editor's draft
initial def
inition. opengl es 3.0the def
inition of 'gldeletesamplers' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.deleteSync() - Web APIs
webglsync object. syntax void gl.deletesync(sync); parameters sync a webglsync object to delete. return value none. examples gl must be a webgl2renderingcontext. webglsync objects are not available in webgl 1. var sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); // ... gl.deletesync(sync); specifications specification status comment webgl 2.0the def
inition of 'deletesync' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'gldeletesync' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.deleteTransformFeedback() - Web APIs
eters transformfeedback a webgltransformfeedback object to delete. return value none. examples gl must be a webgl2renderingcontext. webgltransformfeedback objects are not available in webgl 1. var transformfeedback = gl.createtransformfeedback(); // ... gl.deletetransformfeedback(transformfeedback); specifications specification status comment webgl 2.0the def
inition of 'deletetransformfeedback' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'gldeletetransformfeedbacks' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.deleteVertexArray() - Web APIs
ebgl 2 api deletes a given webglvertexarrayobject object. syntax void gl.deletevertexarray(vertexarray); parameters vertexarray a webglvertexarrayobject (vao) object to delete. return value none. examples var vao = gl.createvertexarray(); gl.bindvertexarray(vao); // ... gl.deletevertexarray(vao); specifications specification status comment webgl 2.0the def
inition of 'deletevertexarray' in that specification. editor's draft
initial def
inition. opengl es 3.0the def
inition of 'gldeletevertexarrays' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.drawArraysInstanced() - Web APIs
a glint specifying the starting index in the array of vector points. count a glsizei specifying the number of indices to be rendered. instancecount a glsizei specifying the number of instances of the range of elements to execute. return value none. examples gl.drawarraysinstanced(gl.points, 0, 8, 4); specifications specification status comment webgl 2.0the def
inition of 'drawarraysinstanced' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'gldrawarraysinstanced' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.drawBuffers() - Web APIs
fer. gl.color_attachment{0-15}: fragment shader output is written in the nth color attachment of the current framebuffer. return value none. exceptions if buffers contains not one of the accepted values, a gl.invalid_enum error is thrown. examples gl.drawbuffers([gl.none, gl.color_attachment1]); specifications specification status comment webgl 2.0the def
inition of 'drawbuffers' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'gldrawbuffers' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.drawElementsInstanced() - Web APIs
the accepted values, a gl.invalid_enum error is thrown. if offset is a valid multiple of the size of the given type, a gl.invalid_operation error is thrown. if count or instancecount are negative, a gl.invalid_value error is thrown. examples gl.drawelementsinstanced(gl.points, 2, gl.unsigned_short, 0, 4); specifications specification status comment webgl 2.0the def
inition of 'drawelementsinstanced' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'gldrawelementsinstanced' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.drawRangeElements() - Web APIs
f mode is not one of the accepted values, a gl.invalid_enum error is thrown. if offset is a valid multiple of the size of the given type, a gl.invalid_operation error is thrown. if count is negative, a gl.invalid_value error is thrown. examples gl.drawrangeelements(gl.points, 0, 7, 8, gl.unsigned_byte, 0); specifications specification status comment webgl 2.0the def
inition of 'drawrangeelements' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'gldrawrangeelements' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.endQuery() - Web APIs
ove, but less accurate and faster version. gl.transform_feedback_primitives_written: number of primitives that are written to transform feedback buffers. return value none. examples var query = gl.createquery(); gl.beginquery(gl.any_samples_passed, query); // ... gl.endquery(gl.any_samples_passed); specifications specification status comment webgl 2.0the def
inition of 'endquery' in that specification. editor's draft
initial def
inition. opengl es 3.0the def
inition of 'glendquery' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.endTransformFeedback() - Web APIs
ax void gl.endtransformfeedback(); parameters none. return value none. examples var transformfeedback = gl.createtransformfeedback(); gl.bindtransformfeedback(gl.transform_feedback, transformfeedback); gl.begintransformfeedback(gl.triangles); gl.drawarrays(gl.triangles, 0, 3); gl.endtransformfeedback(); specifications specification status comment webgl 2.0the def
inition of 'endtransformfeedback' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glendtransformfeedback' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.fenceSync() - Web APIs
ying a bitwise combination of flags controlling the behavior of the sync object. must be 0 (exists for extensions only). return value a webglsync object. examples gl must be a webgl2renderingcontext. webglsync objects are not available in webgl 1. var sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); specifications specification status comment webgl 2.0the def
inition of 'fencesync' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glfencesync' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.framebufferTextureLayer() - Web APIs
ect whose image to attach. level a glint specifying the mipmap level of the texture image to attach. layer a glint specifying the layer of the texture image to attach. return value none. examples gl.framebuffertexturelayer(gl.framebuffer, gl.color_attachment0, texture, 0, 8); specifications specification status comment webgl 2.0the def
inition of 'framebuffertexturelayer' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glframebuffertexturelayer' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getActiveUniformBlockName() - Web APIs
index); parameters program a webglprogram containing the uniform block. uniformblockindex a gluint specifying the index of the uniform block to whose name to retrieve. return value a domstring indicating the active uniform block name. examples var blockname = gl.getactiveuniformblockname(program, 0); specifications specification status comment webgl 2.0the def
inition of 'getactiveuniformblockname' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glgetactiveuniformblockname' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getActiveUniformBlockParameter() - Web APIs
e uniform block is referenced by the fragment shader. return value depends on which information is requested using the pname parameter. if an error occurs, null is returned. examples var blocksize = gl.getactiveuniformblockparameter(program, blockindex, gl.uniform_block_data_size); specifications specification status comment webgl 2.0the def
inition of 'getactiveuniformblockparameter' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glgetactiveuniformblockiv' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getActiveUniforms() - Web APIs
uniforms is a row-major matrix or not. return value depends on which information is requested using the pname parameter. examples var uniformindices = gl.getuniformindices(program, ['ubored', 'ubogreen', 'uboblue']); var uniformoffsets = gl.getactiveuniforms(program, uniformindices, gl.uniform_offset); specifications specification status comment webgl 2.0the def
inition of 'getactiveuniforms' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glgetactiveuniformsiv' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getBufferSubData() - Web APIs
urrently active. examples var buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, new float32array(vertices), gl.static_draw); var arrbuffer = new arraybuffer(vertices.length * float32array.bytes_per_element); gl.getbuffersubdata(gl.array_buffer, 0, arrbuffer); specifications specification status comment webgl 2.0the def
inition of 'getbuffersubdata' in that specification. editor's draft
initial def
inition. ...
WebGL2RenderingContext.getFragDataLocation() - Web APIs
; parameters program a webglprogram to query. name a domstring specifying the name of the user-defined varying out variable. return value a glint indicating the assigned color number binding, or -1 otherwise. examples // program is a linked webglprogram gl.getfragdatalocation(program, 'fragcolor'); specifications specification status comment webgl 2.0the def
inition of 'getfragdatalocation' in that specification. editor's draft
initial def
inition. opengl es 3.0the def
inition of 'glgetfragdatalocation' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getIndexedParameter() - Web APIs
returns a glsizeiptr. gl.uniform_buffer_start: returns a glintptr. index a gluint specifying the index of the target that is queried. return value depends on the requested information (as specified with target). examples var binding = gl.getindexedparameter(gl.transform_feedback_buffer_binding, 0); specifications specification status comment webgl 2.0the def
inition of 'getindexedparameter' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glget' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getInternalformatParameter() - Web APIs
orted for internalformat in descending order. return value depends on the requested information (as specified with pname). it is an int32array if pname is gl.samples. examples var samples = gl.getinternalformatparameter(gl.renderbuffer, gl.rgba8, gl.samples); specifications specification status comment webgl 2.0the def
inition of 'getinternalformatparameter' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glgetinternalformativ' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getQuery() - Web APIs
.transform_feedback_primitives_written: number of primitives that are written to transform feedback buffers. pname a glenum specifying the query object target. must be gl.current_query. return value a webglquery object. examples var currentquery = gl.getquery(gl.any_samples_passed, gl.current_query); specifications specification status comment webgl 2.0the def
inition of 'getquery' in that specification. editor's draft
initial def
inition. opengl es 3.0the def
inition of 'glgetqueryiv' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getQueryParameter() - Web APIs
ilable: returns a glboolean indicating whether or not a query result is available. return value depends on the pname parameter, either a gluint or a glboolean. examples var query = gl.createquery(); gl.beginquery(gl.any_samples_passed, query); var result = gl.getqueryparameter(query, gl.query_result); specifications specification status comment webgl 2.0the def
inition of 'getqueryparameter' in that specification. editor's draft
initial def
inition. opengl es 3.0the def
inition of 'glgetqueryobjectuiv' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getSamplerParameter() - Web APIs
ture coordinate s. gl.texture_wrap_t: returns a glenum indicating the texture wrapping function for the texture coordinate t. return value depends on the pname parameter, either a glenum or a glfloat. examples var sampler = gl.createsampler(); gl.getsamplerparameter(sampler, gl.texture_compare_func); specifications specification status comment webgl 2.0the def
inition of 'getsamplerparameter' in that specification. editor's draft
initial def
inition. opengl es 3.0the def
inition of 'glgetsamplerparameter' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getSyncParameter() - Web APIs
returns a glenum indicating the flags with which the sync object was created (always 0 as no flags are supported). return value depends on the pname parameter, either a glenum or a glbitfield. examples var sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); gl.getsyncparameter(sync, gl.sync_status); specifications specification status comment webgl 2.0the def
inition of 'getsyncparameter' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glgetsynciv' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getTransformFeedbackVarying() - Web APIs
tax webglactiveinfo gl.gettransformfeedbackvarying(program, index); parameters program a webglprogram. index a gluint specifying the index of the varying variable whose information to retrieve. return value a webglactiveinfo object. examples activeinfo = gl.gettransformfeedbackvarying(program, 0); specifications specification status comment webgl 2.0the def
inition of 'gettransformfeedbackvarying' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glgettransformfeedbackvarying' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getUniformBlockIndex() - Web APIs
hose index to retrieve. return value a gluint indicating the uniform block index. examples // assuming a shader with the following declaration: // uniform ubodata { // mat4 foo; // } instancename; // use the block name, not the instance name: var blockindex = gl.getuniformblockindex(program, 'ubodata'); specifications specification status comment webgl 2.0the def
inition of 'getuniformblockindex' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glgetuniformblockindex' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.getUniformIndices() - Web APIs
ram a webglprogram containing uniforms whose indices to query. uniformnames an array of domstring specifying the names of the uniforms to query. return value an array of gluint containing the uniform indices. examples var uniformindices = gl.getuniformindices(program, ['ubored', 'ubogreen', 'uboblue']); specifications specification status comment webgl 2.0the def
inition of 'getuniformindices' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glgetuniformindices' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.invalidateFramebuffer() - Web APIs
stencil_attachment: invalidates the framebuffer's stencil buffer. gl.depth_stencil_attachment: invalidates both the framebuffer's depth and stencil buffer. return value none. examples gl.invalidateframebuffer(gl.read_framebuffer, [gl.color_attachment0, gl.color_attachment1]); specifications specification status comment webgl 2.0the def
inition of 'invalidateframebuffer' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glinvalidateframebuffer' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.invalidateSubFramebuffer() - Web APIs
e pixel rectangle to invalidate. height a glsizei specifying the height of the pixel rectangle to invalidate. return value none. examples gl.invalidatesubframebuffer(gl.read_framebuffer, [gl.color_attachment0, gl.color_attachment1], 0, 0, 256, 256); specifications specification status comment webgl 2.0the def
inition of 'invalidatesubframebuffer' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glinvalidatesubframebuffer' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.isQuery() - Web APIs
s query a webglquery object to test. return value a glboolean indicating whether the given object is a valid webglquery object (true) or not (false). examples gl must be a webgl2renderingcontext. webglquery objects are not available in webgl 1. var query = gl.createquery(); // ... gl.isquery(query); specifications specification status comment webgl 2.0the def
inition of 'isquery' in that specification. editor's draft
initial def
inition. opengl es 3.0the def
inition of 'glisquery' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.isSampler() - Web APIs
webglsampler object to test. return value a glboolean indicating whether the given object is a valid webglsampler object (true) or not (false). examples gl must be a webgl2renderingcontext. webglsampler objects are not available in webgl 1. var sampler = gl.createsampler(); // ... gl.issampler(sampler); specifications specification status comment webgl 2.0the def
inition of 'issampler' in that specification. editor's draft
initial def
inition. opengl es 3.0the def
inition of 'glissampler' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.isSync() - Web APIs
object to test. return value a glboolean indicating whether the given object is a valid webglsync object (true) or not (false). examples gl must be a webgl2renderingcontext. webglsync objects are not available in webgl 1. var sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); // ... gl.issync(sync); specifications specification status comment webgl 2.0the def
inition of 'issync' in that specification. editor's draft
initial def
inition. opengl es 3.0the def
inition of 'glissync' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.isTransformFeedback() - Web APIs
icating whether the given object is a valid webgltransformfeedback object (true) or not (false). examples gl must be a webgl2renderingcontext. webgltransformfeedback objects are not available in webgl 1. var transformfeedback = gl.createtransformfeedback(); // ... gl.istransformfeedback(transformfeedback); specifications specification status comment webgl 2.0the def
inition of 'istransformfeedback' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glistransformfeedback' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.isVertexArray() - Web APIs
rray); parameters vertexarray a webglvertexarrayobject (vao) object to test. return value a glboolean indicating whether the given object is a valid webglvertexarrayobject object (true) or not (false). examples var vao = gl.createvertexarray(); gl.bindvertexarray(vao); // ... gl.isvertexarray(vao); specifications specification status comment webgl 2.0the def
inition of 'isvertexarray' in that specification. editor's draft
initial def
inition. opengl es 3.0the def
inition of 'glisvertexarray' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.pauseTransformFeedback() - Web APIs
alue none. examples var transformfeedback = gl.createtransformfeedback(); gl.bindtransformfeedback(gl.transform_feedback, transformfeedback); gl.begintransformfeedback(gl.triangles); gl.pausetransformfeedback(); //... gl.resumetransformfeedback(); gl.drawarrays(gl.triangles, 0, 3); gl.endtransformfeedback(); specifications specification status comment webgl 2.0the def
inition of 'pausetransformfeedback' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glpausetransformfeedback' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.readBuffer() - Web APIs
parameters src a glenum specifying a color buffer. possible values: gl.back: reads from the back color buffer. gl.none: reads from no color buffer. gl.color_attachment{0-15}: reads from one of the 16 color attachment buffers. return value none. examples gl.readbuffer(gl.color_attachment0); specifications specification status comment webgl 2.0the def
inition of 'readbuffer' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glreadbuffer' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.resumeTransformFeedback() - Web APIs
alue none. examples var transformfeedback = gl.createtransformfeedback(); gl.bindtransformfeedback(gl.transform_feedback, transformfeedback); gl.begintransformfeedback(gl.triangles); gl.pausetransformfeedback(); //... gl.resumetransformfeedback(); gl.drawarrays(gl.triangles, 0, 3); gl.endtransformfeedback(); specifications specification status comment webgl 2.0the def
inition of 'resumetransformfeedback' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glresumetransformfeedback' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.texStorage2D() - Web APIs
_alpha8_etc2_eac gl.compressed_rgb8_punchthrough_alpha1_etc2 gl.compressed_srgb8_punchthrough_alpha1_etc2 width a glsizei specifying the width of the texture. height a glsizei specifying the height of the texture. return value none. examples gl.texstorage2d(gl.texture_2d, 1, gl.rgb8, 256, 256); specifications specification status comment webgl 2.0the def
inition of 'texstorage2d' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'gltexstorage2d' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGL2RenderingContext.texStorage3D() - Web APIs
c2 gl.compressed_srgb8_punchthrough_alpha1_etc2 width a glsizei specifying the width of the texture. height a glsizei specifying the height of the texture. depth a glsizei specifying the depth of the texture. return value none. examples gl.texstorage3d(gl.texture_3d, 1, gl.rgb8, 256, 256, 256); specifications specification status comment webgl 2.0the def
inition of 'texstorage3d' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'gltexstorage3d' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGL2RenderingContext.texSubImage3D() - Web APIs
te offset into the webglbuffer's data store. used to upload data to the currently bound webgltexture from the webglbuffer bound to the pixel_unpack_buffer target. return value none. examples gl.texsubimage3d(gl.texture_3d, 0, 0, 0, 0, image.width, image.height, 1, gl.rgba, gl.unsigned_byte, image); specifications specification status comment webgl 2.0the def
inition of 'texsubimage3d' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'gltexsubimage2d' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGL2RenderingContext.uniform[1234][uif][v]() - Web APIs
data, v0, v1, v2, v3 a new value to be used for the uniform variable. possible types: a number for unsigned integer values (methods with ui), for integer values (methods with i), or for floats (methods with f). a uint32array for unsigned integer vector methods (methods with uiv). return value none. specifications specification status comment webgl 2.0the def
inition of 'uniform' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'gluniform' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.uniformBlockBinding() - Web APIs
e active uniform block whose binding to assign. uniformblockindex a gluint specifying the index of the active uniform block within the program. uniformblockbinding a gluint specifying the binding point to which to bind the uniform block. return value none. examples gl.uniformblockbinding(program, 0, 1); specifications specification status comment webgl 2.0the def
inition of 'uniformblockbinding' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'gluniformblockbinding' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.uniformMatrix[234]x[234]fv() - Web APIs
location a webgluniformlocation object containing the location of the uniform attribute to modify. transpose a glboolean specifying whether to transpose the matrix. must be false. data a float32array of float values. return value none. examples gl.uniformmatrix2x3fv(loc, false, [1, 2, 3, 4, 5, 6]); specifications specification status comment webgl 2.0the def
inition of 'uniformmatrix' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'gluniformmatrix' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.vertexAttribDivisor() - Web APIs
yntax void gl.vertexattribdivisor(index, divisor); parameters index a gluint specifying the index of the generic vertex attributes. divisor a gluint specifying the number of instances that will pass between updates of the generic attribute. return value none. examples gl.vertexattribdivisor(0, 2); specifications specification status comment webgl 2.0the def
inition of 'vertexattribdivisor' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glvertexattribdivisor' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.vertexAttribI4[u]i[v]() - Web APIs
uint specifying the position of the vertex attribute to be modified. v0, v1, v2, v3 an integer number for the vertex attribute value. value a uint32array/int32array or sequences of gluint/ glint for integer vector vertex attribute values. return value none. examples gl.vertexattribi4i(a_foobar, 10); specifications specification status comment webgl 2.0the def
inition of 'vertexattribi' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glvertexattribi' in that specification. standard man page of the (similar) opengl api. ...
WebGL2RenderingContext.waitSync() - Web APIs
ling the flushing behavior. must be 0 (exists for extensions only). timeout a glint64 specifying a timeout the server should wait before continuing. must be gl.timeout_ignored. return value none. examples var sync = gl.fencesync(gl.sync_gpu_commands_complete, 0); gl.waitsync(sync, 0, gl.timeout_ignored); specifications specification status comment webgl 2.0the def
inition of 'waitsync' in that specification. editor's draft
initial def
inition for webgl. opengl es 3.0the def
inition of 'glwaitsync' in that specification. standard man page of the (similar) opengl api. ...
WebGLContextEvent.statusMessage - Web APIs
f the webglcontextcreationerror event is fired. var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); canvas.addeventlistener('webglcontextcreationerror', function(e) { console.log('webgl context creation failed:' + e.statusmessage || 'unknown error'); }, false); specifications specification status comment webgl 1.0the def
inition of 'webglcontextevent.statusmessage' in that specification. recommendation
initial def
inition. ...
WebGLRenderingContext.activeTexture() - Web APIs
bined_texture_image_units constant. it is, per specification, at least 8. gl.getparameter(gl.max_combined_texture_image_units); to get the active texture, query the active_texture constant. gl.activetexture(gl.texture0); gl.getparameter(gl.active_texture); // returns "33984" (0x84c0, gl.texture0 enum value) specifications specification status comment webgl 1.0the def
inition of 'activetexture' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glactivetexture' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.bindAttribLocation() - Web APIs
he index of the generic vertex to bind. name a domstring specifying the name of the variable to bind to the generic vertex index. this name cannot start with "webgl_" or "_webgl_", as these are reserved for use by webgl. return value none. examples gl.bindattriblocation(program, colorlocation, 'vcolor'); specifications specification status comment webgl 1.0the def
inition of 'bindattriblocation' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glbindattriblocation' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.blendColor() - Web APIs
glclampf for the alpha component (transparency) in the range of 0 to 1. return value none. examples to set the blend color, use: gl.blendcolor(0, 0.5, 1, 1); to get the blend color, query the blend_color constant which returns a float32array. gl.getparameter(gl.blend_color); // float32array[0, 0.5, 1, 1] specifications specification status comment webgl 1.0the def
inition of 'blendcolor' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glblendcolor' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.blendEquation() - Web APIs
tion_rgb and blend_equation_alpha constants which return gl.func_add, gl.func_subtract, gl.func_reverse_subtract, or if the ext_blend_minmax is enabled: ext.min_ext or ext.max_ext. gl.getparameter(gl.blend_equation_rgb) === gl.func_add; // true gl.getparameter(gl.blend_equation_alpha) === gl.func_add; // true specifications specification status comment webgl 1.0the def
inition of 'blendequation' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glblendequation' in that specification. standard man page of the opengl es 2.0 api. opengl es 3.0the def
inition of 'glblendequation' in that specification. standard man page of the opengl es 3.0 api. ...
WebGLRenderingContext.blendEquationSeparate() - Web APIs
tion_rgb and blend_equation_alpha constants which return gl.func_add, gl.func_subtract, gl.func_reverse_subtract, or if the ext_blend_minmax is enabled: ext.min_ext or ext.max_ext. gl.getparameter(gl.blend_equation_rgb) === gl.func_add; // true gl.getparameter(gl.blend_equation_alpha) === gl.func_add; // true specifications specification status comment webgl 1.0the def
inition of 'blendequationseparate' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glblendequationseparate' in that specification. standard man page of the opengl es 2.0 api. opengl es 3.0the def
inition of 'glblendequationseparate' in that specification. standard man page of the opengl es 3.0 api. ...
WebGLRenderingContext.blendFunc() - Web APIs
gl.dst_color); to get the current blend function, query the blend_src_rgb, blend_src_alpha, blend_dst_rgb, and blend_dst_alpha constants which return one of the blend function constants. gl.enable(gl.blend); gl.blendfunc(gl.src_color, gl.dst_color); gl.getparameter(gl.blend_src_rgb) == gl.src_color; // true specifications specification status comment webgl 1.0the def
inition of 'blendfunc' in that specification. recommendation
initial def
inition. in webgl, constant color and constant alpha cannot be used together as source and destination factors in the blend function. see section 6.13. of the specification. opengl es 2.0the def
inition of 'glblendfunc' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.blendFuncSeparate() - Web APIs
the current blend function, query the blend_src_rgb, blend_src_alpha, blend_dst_rgb, and blend_dst_alpha constants which return one of the blend function constants. gl.enable(gl.blend); gl.blendfuncseparate(gl.src_color, gl.dst_color, gl.one, gl.zero); gl.getparameter(gl.blend_src_rgb) == gl.src_color; // true specifications specification status comment webgl 1.0the def
inition of 'blendfunc' in that specification. recommendation
initial def
inition. in webgl, constant color and constant alpha cannot be used together as source and destination factors in the blend function. see section 6.13. of the specification. opengl es 2.0the def
inition of 'glblendfunc' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.bufferSubData() - Web APIs
of the allowed enums. examples using buffersubdata var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, buffer); gl.bufferdata(gl.array_buffer, 1024, gl.static_draw); gl.buffersubdata(gl.array_buffer, 512, data); specifications specification status comment webgl 1.0the def
inition of 'buffersubdata' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glbuffersubdata' in that specification. standard man page of the opengl es 2 api. opengl es 3.0the def
inition of 'glbuffersubdata' in that specification. standard man page of the (similar) opengl es 3 api. adds new target buffers: ...
WebGLRenderingContext.clear() - Web APIs
gl.depth_buffer_bit); gl.clear(gl.depth_buffer_bit | gl.color_buffer_bit); to get the current clear values, query the color_clear_value, depth_clear_value, and stencil_clear_value constants. gl.getparameter(gl.color_clear_value); gl.getparameter(gl.depth_clear_value); gl.getparameter(gl.stencil_clear_value); specifications specification status comment webgl 1.0the def
inition of 'clear' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glclear' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.clearColor() - Web APIs
nsparency) value used when the color buffers are cleared. default value: 0. return value none. examples gl.clearcolor(1, 0.5, 0.5, 3); to get the current clear color, query the color_clear_value constant which returns a float32array. gl.getparameter(gl.color_clear_value); // float32array[1, 0.5, 0.5, 1] specifications specification status comment webgl 1.0the def
inition of 'clearcolor' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glclearcolor' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.clearDepth() - Web APIs
leardepth(depth); parameters depth a glclampf specifying the depth value used when the depth buffer is cleared. default value: 1. return value none. examples gl.cleardepth(0.5); to get the current depth clear value, query the depth_clear_value constant. gl.getparameter(gl.depth_clear_value); // 0.5 specifications specification status comment webgl 1.0the def
inition of 'cleardepth' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glcleardepthf' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.clearStencil() - Web APIs
void gl.clearstencil(s); parameters s a glint specifying the index used when the stencil buffer is cleared. default value: 0. return value none. examples gl.clearstencil(1); to get the current stencil clear value, query the stencil_clear_value constant. gl.getparameter(gl.stencil_clear_value); // 1 specifications specification status comment webgl 1.0the def
inition of 'clearstencil' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glclearstencil' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.colorMask() - Web APIs
ransparency) component can be written into the frame buffer. default value: true. return value none. examples gl.colormask(true, true, true, false); to get the current color mask, query the color_writemask constant which returns an array. gl.getparameter(gl.color_writemask); // [true, true, true, false] specifications specification status comment webgl 1.0the def
inition of 'colormask' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glcolormask' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.compileShader() - Web APIs
bgl api compiles a glsl shader into binary data so that it can be used by a webglprogram. syntax void gl.compileshader(shader); parameters shader a fragment or vertex webglshader. examples var shader = gl.createshader(gl.vertex_shader); gl.shadersource(shader, shadersource); gl.compileshader(shader); specifications specification status comment webgl 1.0the def
inition of 'compileshader' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glcompileshader' in that specification. standard opengl man page. ...
WebGLRenderingContext.compressedTexSubImage2D() - Web APIs
e. examples var ext = ( gl.getextension('webgl_compressed_texture_s3tc') || gl.getextension('moz_webgl_compressed_texture_s3tc') || gl.getextension('webkit_webgl_compressed_texture_s3tc') ); gl.compressedtexsubimage2d(gl.texture_2d, 0, 256, 256, 512, 512, ext.compressed_rgba_s3tc_dxt5_ext, texturedata); specifications specification status comment webgl 1.0the def
inition of 'compressedtexsubimage2d' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glcompressedtexsubimage2d' in that specification. standard man page of the (similar) opengl es 2.0 api. opengl es 3.0the def
inition of 'glcompressedtexsubimage2d' in that specification. standard man page of the (similar) opengl es ...
WebGLRenderingContext.copyTexImage2D() - Web APIs
er left corner where to start copying. width a glsizei specifying the width of the texture. height a glsizei specifying the height of the texture. border a glint specifying the width of the border. must be 0. return value none. examples gl.copyteximage2d(gl.texture_2d, 0, gl.rgba, 0, 0, 512, 512, 0); specifications specification status comment webgl 1.0the def
inition of 'copyteximage2d' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glcopyteximage2d' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.copyTexSubImage2D() - Web APIs
e to start copying. y a glint specifying the y coordinate of the lower left corner where to start copying. width a glsizei specifying the width of the texture. height a glsizei specifying the height of the texture. return value none. examples gl.copytexsubimage2d(gl.texture_2d, 0, 0,0, 0, 0, 16, 16); specifications specification status comment webgl 1.0the def
inition of 'copytexsubimage2d' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glcopytexsubimage2d' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.createBuffer() - Web APIs
the webglrenderingcontext.createbuffer() method of the webgl api creates and
initializes a webglbuffer storing data such as vertices or colors. syntax webglbuffer gl.createbuffer(); parameters none. return value a webglbuffer storing data such as vertices or colors. examples creating a buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); specifications specification status comment webgl 1.0the def
inition of 'createbuffer' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glgenbuffers' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.createFramebuffer() - Web APIs
the webglrenderingcontext.createframebuffer() method of the webgl api creates and
initializes a webglframebuffer object. syntax webglframebuffer gl.createframebuffer(); parameters none. return value a webglframebuffer object. examples creating a frame buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var framebuffer = gl.createframebuffer(); specifications specification status comment webgl 1.0the def
inition of 'createframebuffer' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glgenframebuffers' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.createRenderbuffer() - Web APIs
the webglrenderingcontext.createrenderbuffer() method of the webgl api creates and
initializes a webglrenderbuffer object. syntax webglrenderbuffer gl.createrenderbuffer(); parameters none. return value a webglrenderbuffer object that stores data such an image, or can be source or target of an rendering operation. examples creating a render buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var renderbuffer = gl.createrenderbuffer(); specifications specification status comment webgl 1.0the def
inition of 'createrenderbuffer' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glgenrenderbuffers' in that specification. standard man page of the (similar) opengl...
WebGLRenderingContext.createShader() - Web APIs
l api creates a webglshader that can then be configured further using webglrenderingcontext.shadersource() and webglrenderingcontext.compileshader(). syntax webglshader gl.createshader(type); parameters type either gl.vertex_shader or gl.fragment_shader examples see webglshader for usage and examples. specifications specification status comment webgl 1.0the def
inition of 'createshader' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glcreateshader' in that specification. standard opengl man page. ...
WebGLRenderingContext.createTexture() - Web APIs
the webglrenderingcontext.createtexture() method of the webgl api creates and
initializes a webgltexture object. syntax webgltexture gl.createtexture(); parameters none. return value a webgltexture object to which images can be bound to. examples see also the webgl tutorial on using textures in webgl. creating a texture var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var texture = gl.createtexture(); specifications specification status comment webgl 1.0the def
inition of 'createtexture' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glgentextures' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.cullFace() - Web APIs
by default. to enable or disable culling, use the enable() and disable() methods with the argument gl.cull_face. gl.enable(gl.cull_face); gl.cullface(gl.front_and_back); to check the current cull face mode, query the cull_face_mode constant. gl.getparameter(gl.cull_face_mode) === gl.front_and_back; // true specifications specification status comment webgl 1.0the def
inition of 'cullface' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glcullface' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.deleteBuffer() - Web APIs
y been deleted. syntax void gl.deletebuffer(buffer); parameters buffer a webglbuffer object to delete. return value none. examples deleting a buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); // ... gl.deletebuffer(buffer); specifications specification status comment webgl 1.0the def
inition of 'deletebuffer' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'gldeletebuffers' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.deleteFramebuffer() - Web APIs
ffer(framebuffer); parameters framebuffer a webglframebuffer object to delete. return value none. examples deleting a frame buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var framebuffer = gl.createframebuffer(); // ... gl.deleteframebuffer(framebuffer); specifications specification status comment webgl 1.0the def
inition of 'deleteframebuffer' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'gldeleteframebuffers' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.deleteProgram() - Web APIs
leted. syntax void gl.deleteprogram(program); parameters program a webglprogram object to delete. return value none. examples deleting a program var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var program = gl.createprogram(); // ... gl.deleteprogram(program); specifications specification status comment webgl 1.0the def
inition of 'deleteprogram' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'gldeleteprogram' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.deleteRenderbuffer() - Web APIs
nderbuffer); parameters renderbuffer a webglrenderbuffer object to delete. return value none. examples deleting a renderbuffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var renderbuffer = gl.createrenderbuffer(); // ... gl.deleterenderbuffer(renderbuffer); specifications specification status comment webgl 1.0the def
inition of 'deleterenderbuffer' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'gldeleterenderbuffers' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.deleteShader() - Web APIs
the shader has already been deleted, and the webglshader is automatically marked for deletion when it is destroyed by the garbage collector. syntax void gl.deleteshader(shader); parameters shader a webglshader object to delete. return value none. examples deleting a shader gl.deleteshader(shader); specifications specification status comment webgl 1.0the def
inition of 'deleteshader' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'gldeleteshader' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.deleteTexture() - Web APIs
leted. syntax void gl.deletetexture(texture); parameters texture a webgltexture object to delete. return value none. examples deleting a texture var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var texture = gl.createtexture(); // ... gl.deletetexture(texture); specifications specification status comment webgl 1.0the def
inition of 'deletetexture' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'gldeletetextures' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.depthFunc() - Web APIs
sting is disabled by default. to enable or disable depth testing, use the enable() and disable() methods with the argument gl.depth_test. gl.enable(gl.depth_test); gl.depthfunc(gl.never); to check the current depth function, query the depth_func constant. gl.getparameter(gl.depth_func) === gl.never; // true specifications specification status comment webgl 1.0the def
inition of 'depthfunc' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'gldepthfunc' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.depthMask() - Web APIs
cifying whether or not writing into the depth buffer is enabled. default value: true, meaning that writing is enabled. return value none. examples gl.depthmask(false); to get the current depth mask, query the depth_writemask constant which returns a boolean. gl.getparameter(gl.depth_writemask); // false specifications specification status comment webgl 1.0the def
inition of 'depthmask' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'gldepthmask' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.depthRange() - Web APIs
ping plane to window or viewport coordinates. clamped to the range 0 to 1. the default value is 1. return value none. examples gl.depthrange(0.2, 0.6); to check the current depth range, query the depth_range constant which returns a float32array gl.getparameter(gl.depth_range); // float32array[0.2, 0.6] specifications specification status comment webgl 1.0the def
inition of 'depthrange' in that specification. recommendation
initial def
inition. unlike opengl, webgl requires znear and zfar values to be clamped to the range 0 to 1. additionally, znear must be less than or equal to zfar. opengl es 2.0the def
inition of 'gldepthrangef' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.detachShader() - Web APIs
the webglrenderingcontext.detachshader() method of the webgl api detaches a previously attached webglshader from a webglprogram. syntax void gl.detachshader(program, shader); parameters program a webglprogram. shader a fragment or vertex webglshader. specifications specification status comment webgl 1.0the def
inition of 'detachshader' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'gldetachshader' in that specification. standard opengl man page. ...
WebGLRenderingContext.disable() - Web APIs
iately before the rasterization stage, but after the optional transform feedback stage. gl.clear() commands are ignored. return value none. examples gl.disable(gl.dither); to check if a capability is disabled, use the webglrenderingcontext.isenabled() method: gl.isenabled(gl.dither); // false specifications specification status comment webgl 1.0the def
inition of 'disable' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'gldisable' in that specification. standard man page of the (similar) opengl es 2.0 api. opengl es 3.0the def
inition of 'gldisable' in that specification. standard man page of the (similar) opengl es 3.0 api. ...
WebGLRenderingContext.disableVertexAttribArray() - Web APIs
ttribarray() method of the webgl api turns the generic vertex attribute array off at a given index position. syntax void gl.disablevertexattribarray(index); parameters index a gluint specifying the index of the vertex attribute to disable. return value none. examples gl.disablevertexattribarray(0); specifications specification status comment webgl 1.0the def
inition of 'disablevertexattribarray' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'gldisablevertexattribarray' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.drawArrays() - Web APIs
be rendered. return value none. exceptions if mode is not one of the accepted values, a gl.invalid_enum error is thrown. if first or count are negative, a gl.invalid_value error is thrown. if gl.current_program is null, a gl.invalid_operation error is thrown. examples gl.drawarrays(gl.points, 0, 8); specifications specification status comment webgl 1.0the def
inition of 'drawarrays' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'gldrawarrays' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.drawElements() - Web APIs
ns if mode is not one of the accepted values, a gl.invalid_enum error is thrown. if offset is not a valid multiple of the size of the given type, a gl.invalid_operation error is thrown. if count is negative, a gl.invalid_value error is thrown. examples gl.drawelements(gl.points, 8, gl.unsigned_byte, 0); specifications specification status comment webgl 1.0the def
inition of 'drawelements' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'gldrawelements' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.drawingBufferHeight - Web APIs
requested height. syntax gl.drawingbufferheight; examples given this <canvas> element: <canvas id="canvas"></canvas> you can get the height of the drawing buffer with the following lines: var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); gl.drawingbufferheight; // 150 specifications specification status comment webgl 1.0the def
inition of 'webglrenderingcontext.drawingbufferheight' in that specification. recommendation
initial def
inition. ...
WebGLRenderingContext.drawingBufferWidth - Web APIs
the requested width. syntax gl.drawingbufferwidth; examples given this <canvas> element: <canvas id="canvas"></canvas> you can get the width of the drawing buffer with the following lines: var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); gl.drawingbufferwidth; // 300 specifications specification status comment webgl 1.0the def
inition of 'webglrenderingcontext.drawingbufferwidth' in that specification. recommendation
initial def
inition. ...
WebGLRenderingContext.enable() - Web APIs
mediately before the rasterization stage, but after the optional transform feedback stage. gl.clear() commands are ignored. return value none. examples gl.enable(gl.dither); to check if a capability is enabled, use the webglrenderingcontext.isenabled() method: gl.isenabled(gl.dither); // true specifications specification status comment webgl 1.0the def
inition of 'enable' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glenable' in that specification. standard man page of the opengl es 2.0 api. opengl es 3.0the def
inition of 'glenable' in that specification. standard man page of the opengl es 3.0 api. ...
WebGLRenderingContext.enableVertexAttribArray() - Web APIs
e effect. but as a result, accessing avertexposition now obtains data from the vertex buffer. with the association in place between the vertex buffer for our shape and the avertexposition attribute used to deliver vertexes one by one into the vertex shader, we're ready to draw the shape by calling drawarrays(). specifications specification status comment webgl 1.0the def
inition of 'enablevertexattribarray' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glenablevertexattribarray' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.finish() - Web APIs
the webglrenderingcontext.finish() method of the webgl api blocks execution until all previously called commands are finished. syntax void gl.finish(); parameters none. return value none. specifications specification status comment webgl 1.0the def
inition of 'finish' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glfinish' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.flush() - Web APIs
the webglrenderingcontext.flush() method of the webgl api empties different buffer commands, causing all commands to be executed as quickly as possible. syntax void gl.flush(); parameters none. return value none. specifications specification status comment webgl 1.0the def
inition of 'flush' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glflush' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.framebufferRenderbuffer() - Web APIs
raw_framebuffer, or gl.read_framebuffer. a gl.invalid_enum error is thrown if renderbuffertarget is not gl.renderbuffer. a gl.invalid_enum error is thrown if attachment is not one of the allowed enums. examples gl.framebufferrenderbuffer(gl.framebuffer, gl.color_attachment0, gl.renderbuffer, renderbuffer); specifications specification status comment webgl 1.0the def
inition of 'framebufferrenderbuffer' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glframebufferrenderbuffer' in that specification. standard man page of the (similar) opengl api. opengl es 3.0the def
inition of 'glframebufferrenderbuffer' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.framebufferTexture2D() - Web APIs
rget is not one of the accepted texture targets. a gl.invalid_value error is thrown if level is not 0. a gl.invalid_operation error is thrown if texture isn't 0 or the name of an existing texture object. examples gl.framebuffertexture2d(gl.framebuffer, gl.color_attachment0, gl.texture_2d, texture, 0); specifications specification status comment webgl 1.0the def
inition of 'framebuffertexture2d' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glframebuffertexture2d' in that specification. standard man page of the (similar) opengl es 2 api. opengl es 3.0the def
inition of 'glframebuffertexture2d' in that specification. standard man page of the (similar) opengl es 3 api. ...
WebGLRenderingContext.frontFace() - Web APIs
or back-facing by setting a winding orientation. syntax void gl.frontface(mode); parameters mode a glenum type winding orientation. the default value is gl.ccw. possible values: gl.cw: clock-wise winding. gl.ccw: counter-clock-wise winding. return value none. examples gl.frontface(gl.cw); specifications specification status comment webgl 1.0the def
inition of 'frontface' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glfrontface' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.generateMipmap() - Web APIs
gl.texture_cube_map: a cube-mapped texture. when using a webgl 2 context, the following values are available additionally: gl.texture_3d: a three-dimensional texture. gl.texture_2d_array: a two-dimensional array texture. return value none. examples gl.generatemipmap(gl.texture_2d); specifications specification status comment webgl 1.0the def
inition of 'generatemipmap' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glgeneratemipmap' in that specification. standard man page of the (similar) opengl es 2.0 api. opengl es 3.0the def
inition of 'glgeneratemipmap' in that specification. standard man page of the (similar) opengl es 3.0 api. adds: gl.textu...
WebGLRenderingContext.getActiveAttrib() - Web APIs
gl.active_attributes). return value a webglactiveinfo object. examples const numattribs = gl.getprogramparameter(program, gl.active_attributes); for (let i = 0; i < numattribs; ++i) { const info = gl.getactiveattrib(program, i); console.log('name:', info.name, 'type:', info.type, 'size:', info.size); } specifications specification status comment webgl 1.0the def
inition of 'getactiveattrib' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glgetactiveattrib' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.getActiveUniform() - Web APIs
[0, gl.getprogramparameter(program, gl.active_uniforms) - 1]. examples const numuniforms = gl.getprogramparameter(program, gl.active_uniforms); for (let i = 0; i < numuniforms; ++i) { const info = gl.getactiveuniform(program, i); console.log('name:', info.name, 'type:', info.type, 'size:', info.size); } specifications specification status comment webgl 1.0the def
inition of 'getactiveuniform' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glgetactiveuniform' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.getAttachedShaders() - Web APIs
or. return value an array of webglshader objects that are attached to the given webglprogram. examples var program = gl.createprogram(); // attach pre-existing shaders gl.attachshader(program, vertexshader); gl.attachshader(program, fragmentshader); gl.linkprogram(program); gl.getattachedshaders(program); specifications specification status comment webgl 1.0the def
inition of 'getattachedshaders' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glgetattachedshaders' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.getAttribLocation() - Web APIs
rs program a webglprogram containing the attribute variable. name a domstring specifying the name of the attribute variable whose location to get. return value a glint number indicating the location of the variable name if found. returns -1 otherwise. examples gl.getattriblocation(program, 'vcolor'); specifications specification status comment webgl 1.0the def
inition of 'getattriblocation' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glgetattriblocation' in that specification. standard main page of the opengl api. ...
WebGLRenderingContext.getError() - Web APIs
command. gl.context_lost_webgl if the webgl context is lost, this error is returned on the first call to geterror. afterwards and until the context has been restored, it returns gl.no_error. examples gl.geterror(); // gl.no_error (0) gl.enable(gl.foobar); gl.geterror(); // gl.invalid_enum; specifications specification status comment webgl 1.0the def
inition of 'geterror' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glgeterror' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.getParameter() - Web APIs
oint_ext glboolean ext_disjoint_timer_query returns whether or not the gpu performed any disjoint operation. ext.max_views_ovr glint ovr_multiview2 maximum number of views. examples gl.getparameter(gl.dither); gl.getparameter(gl.version); gl.getparameter(gl.viewport); specifications specification status comment webgl 1.0the def
inition of 'getparameter' in that specification. recommendation
initial def
inition. webgl 2.0the def
inition of 'getparameter' in that specification. editor's draft adds additional parameter names. opengl es 2.0the def
inition of 'glget' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.getProgramParameter() - Web APIs
s to capture in transform feedback mode. gl.active_uniform_blocks: returns a glint indicating the number of uniform blocks containing active uniforms. return value returns the requested program information (as specified with pname). examples gl.getprogramparameter(program, gl.delete_status); specifications specification status comment webgl 1.0the def
inition of 'getprogramparameter' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glgetprogramiv' in that specification. standard man page of the (similar) opengl api. webgl 2.0the def
inition of 'getprogramparameter' in that specification. editor's draft adds new pname values: gl.transform_feedback_buffer_mode, gl.tra...
WebGLRenderingContext.getShaderParameter() - Web APIs
was successful. gl.shader_type: returns a glenum indicating whether the shader is a vertex shader (gl.vertex_shader) or fragment shader (gl.fragment_shader) object. return value returns the requested shader information (as specified with pname). examples gl.getshaderparameter(shader, gl.shader_type); specifications specification status comment webgl 1.0the def
inition of 'getshaderparameter' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glgetshaderiv' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.getShaderPrecisionFormat() - Web APIs
s the precision format of a gl.vertex_shader with a gl.medium_float precision type. var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); gl.getshaderprecisionformat(gl.vertex_shader, gl.medium_float); // webglshaderprecisionformat { rangemin: 127, rangemax: 127, precision: 23 } specifications specification status comment webgl 1.0the def
inition of 'getshaderprecisionformat' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glgetshaderprecisionformat' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.getShaderSource() - Web APIs
gl.getshadersource(shader); parameters shader a webglshader object to get the source code from. return value a domstring containing the source code of the shader. examples var shader = gl.createshader(gl.vertex_shader); gl.shadersource(shader, originalsource); var source = gl.getshadersource(shader); specifications specification status comment webgl 1.0the def
inition of 'getshadersource' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glgetshadersource' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.getTexParameter() - Web APIs
apping function for texture coordinate r gl.repeat (default value), gl.clamp_to_edge, gl.mirrored_repeat. return value returns the requested texture information (as specified with pname). if an error occurs, null is returned. examples gl.gettexparameter(gl.texture_2d, gl.texture_mag_filter); specifications specification status comment webgl 1.0the def
inition of 'gettexparameter' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glgettexparameter' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the def
inition of 'gettexparameter' in that specification. editor's draft updated def
inition for webgl. opengl es 3.0the defi...
WebGLRenderingContext.getUniform() - Web APIs
32array (with 6 elements) mat3x4 float32array (with 12 elements) mat4x2 float32array (with 8 elements) mat4x3 float32array (with 12 elements) any sampler type glint examples var loc = gl.getuniformlocation(program, 'u_foobar'); gl.getuniform(program, loc); specifications specification status comment webgl 1.0the def
inition of 'getuniform' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'glgetuniform' in that specification. standard man page of the (similar) opengl es 2 api. webgl 2.0the def
inition of 'getuniform' in that specification. editor's draft updated def
inition for webgl. opengl es 3.0the def
inition of 'glgetu...
WebGLRenderingContext.getUniformLocation() - Web APIs
], the components in this 4-component vector represent the values of red, green, blue, and alpha, respectively. having done this, the next time the shading functions are called, their own variables named uscalingfactor, uglobalcolor, and urotationvector will all have the values provided by the javascript code. specifications specification status comment webgl 1.0the def
inition of 'getuniformlocation' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glgetuniformlocation' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.getVertexAttribOffset() - Web APIs
riboffset(index, pname); parameters index a gluint specifying the index of the vertex attribute. pname a glenum which must be gl.vertex_attrib_array_pointer. return value a glintptr indicating the address of the vertex attribute. examples gl.getvertexattriboffset(i, gl.vertex_attrib_array_pointer); specifications specification status comment webgl 1.0the def
inition of 'getvertexattriboffset' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glgetvertexattribpointerv' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.hint() - Web APIs
t quality option should be used. gl.dont_care: there is no preference for this behavior. return value none. examples the following example hints that the quality of filtering when generating mipmap images should be most efficient instead of best quality. gl.hint(gl.generate_mipmap_hint, gl.fastest); specifications specification status comment webgl 1.0the def
inition of 'hint' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glhint' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.isBuffer() - Web APIs
gl.isbuffer(buffer); parameters buffer a webglbuffer to check. return value a glboolean indicating whether or not the buffer is valid. examples creating a buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var buffer = gl.createbuffer(); gl.isbuffer(buffer); specifications specification status comment webgl 1.0the def
inition of 'isbuffer' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glisbuffer' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.isFramebuffer() - Web APIs
buffer a webglframebuffer to check. return value a glboolean indicating whether or not the frame buffer is valid. examples checking a frame buffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var framebuffer = gl.createframebuffer(); gl.isframebuffer(framebuffer); specifications specification status comment webgl 1.0the def
inition of 'isframebuffer' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glisframebuffer' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.isProgram() - Web APIs
am); parameters program a webglprogram to check. return value a glboolean indicating whether or not the program is valid. examples checking a program var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var program = gl.createprogram(); // ... gl.isprogram(program); specifications specification status comment webgl 1.0the def
inition of 'isprogram' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glisprogram' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.isRenderbuffer() - Web APIs
r a webglrenderbuffer to check. return value a glboolean indicating whether or not the renderbuffer is valid. examples checking a renderbuffer var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var renderbuffer = gl.createrenderbuffer(); gl.isrenderbuffer(renderbuffer); specifications specification status comment webgl 1.0the def
inition of 'isrenderbuffer' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glisrenderbuffer' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.isShader() - Web APIs
arameters shader a webglshader to check. return value a glboolean indicating whether or not the shader is valid. examples checking a shader var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var shader = gl.createshader(gl.vertex_shader); // ... gl.isshader(shader); specifications specification status comment webgl 1.0the def
inition of 'isshader' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glisshader' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.isTexture() - Web APIs
re(texture); parameters texture a webgltexture to check. return value a glboolean indicating whether or not the texture is valid. examples checking a texture var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); var texture = gl.createtexture(); gl.istexture(texture); specifications specification status comment webgl 1.0the def
inition of 'istexture' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glistexture' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.lineWidth() - Web APIs
a glfloat specifying the width of rasterized lines. default value: 1. return value none. examples setting the line width: gl.linewidth(5); getting the line width: gl.getparameter(gl.line_width); getting the range of available widths. returns a float32array. gl.getparameter(gl.aliased_line_width_range); specifications specification status comment webgl 1.0the def
inition of 'linewidth' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'gllinewidth' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.polygonOffset() - Web APIs
argument gl.polygon_offset_fill. gl.enable(gl.polygon_offset_fill); gl.polygonoffset(2, 3); to check the current polygon offset factor or units, query the polygon_offset_factor and polygon_offset_units constants. gl.getparameter(gl.polygon_offset_factor); // 2 gl.getparameter(gl.polygon_offset_units); // 3 specifications specification status comment webgl 1.0the def
inition of 'polygonoffset' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glpolygonoffset' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.sampleCoverage() - Web APIs
ge and gl.sample_alpha_to_coverage. gl.enable(gl.sample_coverage); gl.samplecoverage(0.5, false); to check the sample coverage values, query the sample_coverage_value and sample_coverage_invert constants. gl.getparameter(gl.sample_coverage_value); // 0.5 gl.getparameter(gl.sample_coverage_invert); // false specifications specification status comment webgl 1.0the def
inition of 'samplecoverage' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glsamplecoverage' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.scissor() - Web APIs
xecute drawing commands in the scissor box (e.g. clear) // turn off scissor test again gl.disable(gl.scissor_test); to get the current scissor box dimensions, query the scissor_box constant which returns an int32array. gl.scissor(0, 0, 200, 200); gl.getparameter(gl.scissor_box); // int32array[0, 0, 200, 200] specifications specification status comment webgl 1.0the def
inition of 'scissor' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glscissor' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.shaderSource() - Web APIs
, source); parameters shader a webglshader object in which to set the source code. source a domstring containing the glsl source code to set. return value none. examples var shader = gl.createshader(gl.vertex_shader); gl.shadersource(shader, originalsource); var source = gl.getshadersource(shader); specifications specification status comment webgl 1.0the def
inition of 'shadersource' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glshadersource' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.stencilFunc() - Web APIs
ery the following constants with getparameter(). gl.getparameter(gl.stencil_func); gl.getparameter(gl.stencil_value_mask); gl.getparameter(gl.stencil_ref); gl.getparameter(gl.stencil_back_func); gl.getparameter(gl.stencil_back_value_mask); gl.getparameter(gl.stencil_back_ref); gl.getparameter(gl.stencil_bits); specifications specification status comment webgl 1.0the def
inition of 'stencilfunc' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glstencilfunc' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.stencilFuncSeparate() - Web APIs
ery the following constants with getparameter(). gl.getparameter(gl.stencil_func); gl.getparameter(gl.stencil_value_mask); gl.getparameter(gl.stencil_ref); gl.getparameter(gl.stencil_back_func); gl.getparameter(gl.stencil_back_value_mask); gl.getparameter(gl.stencil_back_ref); gl.getparameter(gl.stencil_bits); specifications specification status comment webgl 1.0the def
inition of 'stencilfuncseparate' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glstencilfuncseparate' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.stencilMask() - Web APIs
eturn value none. examples gl.stencilmask(110101); to get the current stencil masks, query the stencil_writemask, stencil_back_writemask, or stencil_bits constants. gl.getparameter(gl.stencil_writemask); // 110101 gl.getparameter(gl.stencil_back_writemask); // 110101 gl.getparameter(gl.stencil_bits); // 0 specifications specification status comment webgl 1.0the def
inition of 'stencilmask' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glstencilmask' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.stencilMaskSeparate() - Web APIs
examples gl.stencilmaskseparate(gl.front, 110101); to get the current stencil masks, query the stencil_writemask, stencil_back_writemask, or stencil_bits constants. gl.getparameter(gl.stencil_writemask); // 110101 gl.getparameter(gl.stencil_back_writemask); // 110101 gl.getparameter(gl.stencil_bits); // 0 specifications specification status comment webgl 1.0the def
inition of 'stencilmaskseparate' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glstencilmaskseparate' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.stencilOp() - Web APIs
etparameter(). gl.getparameter(gl.stencil_fail); gl.getparameter(gl.stencil_pass_depth_pass); gl.getparameter(gl.stencil_pass_depth_fail); gl.getparameter(gl.stencil_back_fail); gl.getparameter(gl.stencil_back_pass_depth_pass); gl.getparameter(gl.stencil_back_pass_depth_fail); gl.getparameter(gl.stencil_bits); specifications specification status comment webgl 1.0the def
inition of 'stencilop' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glstencilop' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.stencilOpSeparate() - Web APIs
etparameter(). gl.getparameter(gl.stencil_fail); gl.getparameter(gl.stencil_pass_depth_pass); gl.getparameter(gl.stencil_pass_depth_fail); gl.getparameter(gl.stencil_back_fail); gl.getparameter(gl.stencil_back_pass_depth_pass); gl.getparameter(gl.stencil_back_pass_depth_fail); gl.getparameter(gl.stencil_bits); specifications specification status comment webgl 1.0the def
inition of 'stencilopseparate' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glstencilopseparate' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.texParameter[fi]() - Web APIs
ture_wrap_r wrapping function for texture coordinate r gl.repeat (default value), gl.clamp_to_edge, gl.mirrored_repeat. return value none. examples gl.texparameterf(gl.texture_2d, gl.texture_mag_filter, gl.linear); gl.texparameteri(gl.texture_2d, gl.texture_min_filter, gl.linear_mipmap_nearest); specifications specification status comment webgl 1.0the def
inition of 'texparameter[fi]' in that specification. recommendation
initial def
inition for webgl. opengl es 2.0the def
inition of 'gltexparameter' in that specification. standard man page of the (similar) opengl es 2.0 api. webgl 2.0the def
inition of 'texparameter[fi]' in that specification. editor's draft updated def
inition for webgl. opengl es 3.0the defin...
WebGLRenderingContext.uniformMatrix[234]fv() - Web APIs
d using getuniformlocation(). transpose a glboolean specifying whether to transpose the matrix. must be false. value a float32array or sequence of glfloat values. the values are assumed to be supplied in column major order. return value undefined examples gl.uniformmatrix2fv(loc, false, [2,1, 2,2]); specifications specification status comment webgl 1.0the def
inition of 'uniformmatrix' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'gluniform' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.useProgram() - Web APIs
tax void gl.useprogram(program); parameters program a webglprogram to use. return value none. examples var program = gl.createprogram(); // attach pre-existing shaders gl.attachshader(program, vertexshader); gl.attachshader(program, fragmentshader); gl.linkprogram(program); gl.useprogram(program); specifications specification status comment webgl 1.0the def
inition of 'useprogram' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'gluseprogram' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext.viewport() - Web APIs
ementation dependent. to get this range, you can use the max_viewport_dims constant, which returns an int32array. gl.getparameter(gl.max_viewport_dims); // e.g. int32array[16384, 16384] to get the current viewport, query the viewport constant. gl.getparameter(gl.viewport); // e.g. int32array[0, 0, 640, 480] specifications specification status comment webgl 1.0the def
inition of 'viewport' in that specification. recommendation
initial def
inition. opengl es 2.0the def
inition of 'glviewport' in that specification. standard man page of the opengl api. ...
WebGLRenderingContext - Web APIs
return; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); gl.enable(gl.scissor_test); gl.scissor(30, 10, 60, 60); gl.clearcolor(1.0, 1.0, 0.0, 1.0); gl.clear(gl.color_buffer_bit); }); }, false); the source code of this example is also available on github. specifications specification status comment webgl 1.0the def
inition of 'webglrenderingcontext' in that specification. recommendation
initial def
inition ...
WebGLShaderPrecisionFormat.precision - Web APIs
e represented. for integer formats this value is always 0. examples var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); gl.getshaderprecisionformat(gl.vertex_shader, gl.medium_float).precision; // 23 gl.getshaderprecisionformat(gl.fragment_shader, gl.low_int).precision; // 0 specifications specification status comment webgl 1.0the def
inition of 'webglshaderprecisionformat.precision' in that specification. recommendation
initial def
inition. ...
WebGLShaderPrecisionFormat.rangeMax - Web APIs
bsolute value of the maximum value that can be represented. examples var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); gl.getshaderprecisionformat(gl.vertex_shader, gl.medium_float).rangemax; // 127 gl.getshaderprecisionformat(gl.fragment_shader, gl.low_int).rangemax; // 24 specifications specification status comment webgl 1.0the def
inition of 'webglshaderprecisionformat.rangemax' in that specification. recommendation
initial def
inition. ...
WebGLShaderPrecisionFormat.rangeMin - Web APIs
bsolute value of the minimum value that can be represented. examples var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); gl.getshaderprecisionformat(gl.vertex_shader, gl.medium_float).rangemin; // 127 gl.getshaderprecisionformat(gl.fragment_shader, gl.low_int).rangemin; // 24 specifications specification status comment webgl 1.0the def
inition of 'webglshaderprecisionformat.rangemin' in that specification. recommendation
initial def
inition. ...
WebGLShaderPrecisionFormat - Web APIs
t object is returned by the webglrenderingcontext.getshaderprecisionformat() method. var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); gl.getshaderprecisionformat(gl.vertex_shader, gl.medium_float); // webglshaderprecisionformat { rangemin: 127, rangemax: 127, precision: 23 } specifications specification status comment webgl 1.0the def
inition of 'webglshaderprecisionformat' in that specification. recommendation
initial def
inition. ...
Clearing by clicking - Web APIs
ddeventlistener("click", switchcolor, false); button.addeventlistener("click", switchcolor, false); // a variable to hold the webglrenderingcontext. var gl; // the click event handler. function switchcolor () { // referring to the externally defined gl variable. // if undefined, try to obtain the webglrenderingcontext. // if failed, alert user of failure. // otherwise,
initialize the drawing buffer (the viewport). if (!gl) { gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); if (!gl) { alert("failed to get webgl context.\n" + "your browser or device may not support webgl."); return; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); } // get a rand...
Clearing with colors - Web APIs
nly needs to run once. window.removeeventlistener(evt.type, setupwebgl, false); // references to the document elements. var paragraph = document.queryselector("p"), canvas = document.queryselector("canvas"); // getting the webgl rendering context. var gl = canvas.getcontext("webgl") || canvas.getcontext("experimental-webgl"); // if failed, inform user of failure. otherwise,
initialize // the drawing buffer (the viewport) and clear the context // with a solid color. if (!gl) { paragraph.innerhtml = "failed to get webgl context. " + "your browser or device may not support webgl."; return; } paragraph.innerhtml = "congratulations! your browser supports webgl. "; gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); // set the ...
Color masking - Web APIs
o sea greens, blues, and so on). note that the calls to colormask() only occur when the user clicks on one of the toggle buttons. but rendering is done every second, using the timer. the color mask state of webgl is preserved, so we do not need to call colormask() every frame to set up the color mask. this is an important aspect of the webgl state machine. it allows us to setup webgl in a single
initialization phase, and then just execute drawing commands for each frame. color masking gives you fine control of updating pixel values on the screen. by limiting the color channels that are written by each drawing command, you can use each channel, for example, to store a different grayscale image. alternatively, you may use the rgb components for color, but the alpha component for some custom pi...
Scissor animation - Web APIs
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. position = [0, gl.drawingbufferheight]; var button = document.queryselector("button"); var timer; function startanimation(evt) { button.removeeventlistener(evt.type, startanimation, false); button.addeventlistener("click", stopanimation, false); document.queryselector("strong").innerhtml =...
Simple color animation - Web APIs
eedback 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) { var canvas = document.getelementbyid("canvas-view"); gl = canvas.getcontext("webgl") ||canvas.getcontext("experimental-webgl"); if (!gl) { clearinterval(timer); alert("failed to get webgl context.\n" + "your bro...
WebGL constants - Web APIs
a boolean indicating whether or not a query result is available. time_elapsed_ext 0x88bf elapsed time (in nanoseconds). timestamp_ext 0x8e28 the current time. gpu_disjoint_ext 0x8fbb a boolean indicating whether or not the gpu performed any disjoint operation. specifications specification status comment webgl 1.0the def
inition of 'webglrenderingcontext' in that specification. recommendation
initial def
inition webgl 2.0the def
inition of 'webgl2renderingcontext' in that specification. editor's draft defines additional constants. ...
Data in WebGL - Web APIs
h its own purpose and use cases: attributes, varyings, and uniforms. attributes attributes are glsl variables which are only available to the vertex shader (as variables) and the javascript code. attributes are typically used to store color information, texture coordinates, and any other data calculated or retrieved that needs to be shared between the javascript code and the vertex shader. ...
Animating objects with WebGL - Web APIs
ed on this code. our sample loads a copy from a cdn in our html's <head>. making the square rotate let's start by making the square rotate. the first thing we'll need is a variable in which to track the current rotation of the square: var squarerotation = 0.0; now we need to update the drawscene() function to apply the current rotation to the square when drawing it. after translating to the
initial drawing position for the square, we apply the rotation like this: mat4.rotate(modelviewmatrix, // destination matrix modelviewmatrix, // matrix to rotate squarerotation, // amount to rotate in radians [0, 0, 1]); // axis to rotate around this rotates the modelviewmatrix by the current value of squarerotation, around the z axis. to actua...
Creating 3D objects using WebGL - Web APIs
of each vertex in three different colors, one for each face. this example uses the glmatrix library to perform its matrix and vertex math. you'll need to include it if you create your own project based on this code. our sample loads a copy from a cdn in our html's <head>. define the positions of the cube's vertices first, let's build the cube's vertex position buffer by updating the code in
initbuffers(). this is pretty much the same as it was for the square plane, but somewhat longer since there are 24 vertices (4 per side): const positions = [ // front face -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 1.0, 1.0, // back face -1.0, -1.0, -1.0, -1.0, 1.0, -1.0, 1.0, 1.0, -1.0, 1.0, -1.0, -1.0, // top face -1.0, 1.0, -1.0, -1.0, 1.0, 1.0...
Using shaders to apply color in WebGL - Web APIs
xel, the entire square was rendered as solid white. let's say we want to render a gradient in which each corner of the square is a different color: red, blue, green, and white. the first thing to do is to establish these colors for the four vertices. to do this, we first need to create an array of vertex colors, then store it into a webgl buffer. we'll do that by adding the following code to our
initbuffers() function: function
initbuffers(){ ... const colors = [ 1.0, 1.0, 1.0, 1.0, // white 1.0, 0.0, 0.0, 1.0, // red 0.0, 1.0, 0.0, 1.0, // green 0.0, 0.0, 1.0, 1.0, // blue ]; const colorbuffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, colorbuffer); gl.bufferdata(gl.array_buffer, new float32array(colors), gl.static_draw); retu...
WebGL types - Web APIs
sed as well. type web idl type description glint64 long long signed 64-bit integer number. webgl extensions these types are used within webgl extensions. type web idl type description gluint64ext long long unsigned 64-bit integer number. specifications specification status comment webgl 1.0the def
inition of 'types' in that specification. recommendation
initial def
inition webgl 2.0the def
inition of 'types' in that specification. editor's draft defines additional types. ext_disjoint_timer_querythe def
inition of 'gluint64ext' in that specification. working draft adds gluint64ext ...
WebGL: 2D and 3D graphics for the web - Web APIs
mes. redgl is an open-source 3d webgl library. vtk.js is a javascript library for scientific visualization in your browser. specifications specification status comment opengl es 3.0 standard opengl es 2.0 standard webgl 2.0 editor's draft builds on top of webgl 1. based on opengl es 3.0. webgl 1.0 recommendation
initial def
inition. based on opengl es 2.0 ...
WebKitCSSMatrix - Web APIs
an alias for dommatrix. specifications specification status comment geometry interfaces module level 1the def
inition of 'webkitcssmatrix' in that specification. candidate recommendation ...
Lifetime of a WebRTC session - Web APIs
, etc. -- more coming up ice restart sometimes, during the lifetime of a webrtc session, network conditions change. one of the users might transition from a cellular to a wifi network, or the network might become congested, for example. when this happens, the ice agent may choose to perform ice restart. this is a process by which the network connection is renegotiated, exactly the same way the
initial ice negotiation is performed, with one exception: media continues to flow across the original network connection until the new one is up and running. then media shifts to the new network connection and the old one is closed. note: different browsers support ice restart under different sets of conditions. not all browsers will perform ice restart due to network congestion, for example. if y...
WebRTC API - Web APIs
ound nat (turn) uniform resource identifiers an offer/answer model with session description protocol (sdp) session traversal utilities for nat (stun) extension for third party authorization webrtc statistics webrtc statistics api specifications specification status comment webrtc 1.0: real-time communication between browsers candidate recommendation the
initial def
inition of the api of webrtc. media capture and streams candidate recommendation the
initial def
inition of the object conveying the stream of media content. media capture from dom elements working draft the
initial def
inition on how to obtain stream of content from dom elements in additions to these specifications defining the api needed to use webrtc, t...
WebRTC Statistics API - Web APIs
related to a specific rtcrtptransceiver. rtcrtptransceiverstats rtcstats transport statistics about a transport used by the connection. rtctransportstats rtcstats specifications specification status comment identifiers for webrtc's statistics apithe def
inition of 'webrtc statistics types' in that specification. candidate recommendation compatibility for individual statistic types webrtc 1.0: real-time communication between browsersthe def
inition of 'rtcstatsreport' in that specification. candidate recommendation compatibility of statistic reporting ...
WebSocket() - Web APIs
r to be able to handle different types of interactions depending on the specified protocol). if you don't specify a protocol string, an empty string is assumed. exceptions thrown security_err the port to which the connection is being attempted is being blocked. syntaxerror the url is invalid. specifications specification status comment html living standardthe def
inition of 'the websocket constructor' in that specification. living standard ...
WebSocket.onclose - Web APIs
the websocket.onclose property is an eventhandler that is called when the websocket connection's readystate changes to closed. it is called with a closeevent. syntax awebsocket.onclose = function(event) { console.log("websocket is closed now."); }; value an eventlistener. specifications specification status comment html living standardthe def
inition of 'websocket: onclose' in that specification. living standard
initial def
inition ...
XPathResult.iterateNext() - Web APIs
r result = document.evaluate(xpath, document, null, xpathresult.any_type, null); var node = null; var tagnames = []; while(node = result.iteratenext()) { tagnames.push(node.localname); } document.queryselector("output").textcontent = tagnames.join(", "); result specifications specification status comment document object model (dom) level 3 xpath specificationthe def
inition of 'xpathresult.iteratenext()' in that specification. recommendation
initial def
inition ...
XPathResult.numberValue - Web APIs
le</div> <div>number of <div>s: <output></output></div> javascript var xpath = "count(//div)"; var result = document.evaluate(xpath, document, null, xpathresult.number_type, null); document.queryselector("output").textcontent = result.numbervalue; result specifications specification status comment document object model (dom) level 3 xpath specificationthe def
inition of 'xpathresult.numbervalue' in that specification. recommendation
initial def
inition ...
XPathResult.resultType - Web APIs
var result = document.evaluate(xpath, document, null, xpathresult.any_type, null); document.queryselector("output").textcontent = result.resulttype >= xpathresult.unordered_node_iterator_type && result.resulttype <= xpathresult.first_ordered_node_type; result specifications specification status comment document object model (dom) level 3 xpath specificationthe def
inition of 'xpathresult.resulttype' in that specification. recommendation
initial def
inition ...
XPathResult.singleNodeValue - Web APIs
tput></output></div> javascript var xpath = "//*[text()='xpath example']"; var result = document.evaluate(xpath, document, null, xpathresult.first_ordered_node_type, null); document.queryselector("output").textcontent = result.singlenodevalue.localname; result specifications specification status comment document object model (dom) level 3 xpath specificationthe def
inition of 'xpathresult.singlenodevalue' in that specification. recommendation
initial def
inition ...
XPathResult.snapshotItem() - Web APIs
ered_node_snapshot_type, null); var node = null; var tagnames = []; for(var i = 0; i < result.snapshotlength; i++) { var node = result.snapshotitem(i); tagnames.push(node.localname); } document.queryselector("output").textcontent = tagnames.join(", "); result specifications specification status comment document object model (dom) level 3 xpath specificationthe def
inition of 'xpathresult.snapshotitem()' in that specification. recommendation
initial def
inition ...
XPathResult.snapshotLength - Web APIs
v>number of matched nodes: <output></output></div> javascript var xpath = "//div"; var result = document.evaluate(xpath, document, null, xpathresult.ordered_node_snapshot_type, null); document.queryselector("output").textcontent = result.snapshotlength; result specifications specification status comment document object model (dom) level 3 xpath specificationthe def
inition of 'xpathresult.snapshotlength' in that specification. recommendation
initial def
inition ...
XPathResult.stringValue - Web APIs
ext content of the <div> above: <output></output></div> javascript var xpath = "//div/text()"; var result = document.evaluate(xpath, document, null, xpathresult.string_type, null); document.queryselector("output").textcontent = result.stringvalue; result specifications specification status comment document object model (dom) level 3 xpath specificationthe def
inition of 'xpathresult.stringvalue' in that specification. recommendation
initial def
inition ...
XRBoundedReferenceSpace - Web APIs
x in the polygon defining the boundaries within which the user will be required to remain. these vertices must be sorted such that they move clockwise around the viewer's position. methods xrboundedreferencespace inherits the methods of its parent interface, xrreferencespace. it has no further methods. specifications specification status comment webxr device apithe def
inition of 'xrboundedreferencespace' in that specification. working draft
initial def
inition. ...
XREnvironmentBlendMode - Web APIs
provides relative weights of the artificial layer during the compositing process. pixels whose alpha value is 1.0 are rendered fully opaque, totally obscuring the real world, while pixels with an alpha of 1.0 are totally transparent, leaving the surrounding environment to pass through. specifications specification status comment webxr augmented reality modulethe def
inition of 'xrenvironmentblendmode' in that specification. editor's draft
initial def
inition. ...
XREye - Web APIs
he xrview represents the point-of-view of the viewer's left eye. right the view represents the viewer's right eye. none the xrview describes a monoscopic view, or the view otherwise doesn't represent a particular eye's point-of-view. usage notes these values are used by the xrview property eye. specifications specification status comment webxr device apithe def
inition of 'xreye' in that specification. working draft
initial def
inition. ...
XRFrame.getPose() - Web APIs
btain an xrpose describing the item's position and orientation. basespace an xrspace to use as the base or origin for the purposes of computing the relative position and orientation. return value an xrpose object specifying the position and orientation, relative to the xrspace indicated by basespace. specifications specification status comment webxr device apithe def
inition of 'xrframe.getpose()' in that specification. working draft
initial def
inition. ...
XRFrame - Web APIs
tained by calling one of the methods on the object. methods getpose() returns an xrpose object representing the spatial relationship between the two specified xrspace objects. getviewerpose() returns an xrviewerpose describing the viewer's position and orientation in a given xrreferencespace. specifications specification status comment webxr device apithe def
inition of 'xrframe' in that specification. working draft
initial def
inition. ...
XRHandedness - Web APIs
rmed into the current reference space. assuming that's then valid, a function called myrenderhandobject() is called with the grip's pose and the value of handedness. with these values in hand (no pun intended), myrenderhandobject() can draw the appropriate model positioned and formed for the correct hand. specifications specification status comment webxr device apithe def
inition of 'xrhandedness' in that specification. working draft
initial def
inition. ...
XRInputSource.handedness - Web APIs
rmed into the current reference space. assuming that's then valid, a function called myrenderhandobject() is called with the grip's pose and the value of handedness. with these values in hand (no pun intended), myrenderhandobject() can draw the appropriate model positioned and formed for the correct hand. specifications specification status comment webxr device apithe def
inition of 'xrinputsource.handedness' in that specification. working draft
initial def
inition. ...
XRInputSource - Web APIs
map the input's coordinate system into the world coordinate system. the grip space's coordinate system can then be used to render objects so they appear to be held in the user's hand. for more details on the input source's coordinate system, see the article that covers the gripspace property in detail. specifications specification status comment webxr device apithe def
inition of 'xrinputsource' in that specification. working draft
initial def
inition. ...
XRInputSourceArray.entries() - Web APIs
} } } for each input in the llist, gamepad inputs are dispatched to a checkgamepad() with the input's gamepad object, taken from its gamepad property, as an input for other devices, we look for tracked-pointer devices in the player's main hand, dispatching those to a handlemainhandinput() method. specifications specification status comment webxr device apithe def
inition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in information contained in a webidl file for information on how an iterable declaration in an interface def
inition causes entries(), foreach(), keys(), and values() methods to be exposed from objects that implement the interface. ...
XRInputSourceArray.forEach() - Web APIs
for each input in the llist, the callback dispatches gamepad inputs to a checkgamepad() with the input's gamepad object, taken from its gamepad property, as an input for other devices, we look for tracked-pointer devices in the player's main hand, dispatching those to a handlemainhandinput() method. specifications specification status comment webxr device apithe def
inition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in information contained in a webidl file for information on how an iterable declaration in an interface def
inition causes entries(), foreach(), keys(), and values() methods to be exposed from objects that implement the interface. ...
XRInputSourceArray.keys() - Web APIs
ssion.inputsources.keys()) { /* the keys are the indexes into the list of inputs */ checkinput(xrsession.inputsources[inputidx]); } here, for...of is used to iterate over each of the keys. for each key, the input is retrieved using the index with array notation: xrsession.inputsources[inputidx]. specifications specification status comment webxr device apithe def
inition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in information contained in a webidl file for information on how an iterable declaration in an interface def
inition causes entries(), foreach(), keys(), and values() methods to be exposed from objects that implement the interface. ...
XRInputSourceArray.values() - Web APIs
returned value. for (const source of xrsession.inputsources.values()) { checkinput(source); } here, for...of is used to iterate over the array's contents. each pass through the loop, source is the next xrinputsource in the list. the loop exits once every input has been delivered to checkinput(). specifications specification status comment webxr device apithe def
inition of 'xrinputsourcearray' in that specification.1 working draft xrinputsourcearray interface [1] see iterator-like methods in information contained in a webidl file for information on how an iterable declaration in an interface def
inition causes entries(), foreach(), keys(), and values() methods to be exposed from objects that implement the interface. ...
XRInputSourceEvent.frame - Web APIs
e if the ray was pointing at anything when the select was triggered. xrsession.onselectstart = event => { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (targetraypose) { checkandhandlehit(targetraypose.transform); } }; specifications specification status comment webxr device apithe def
inition of 'xrinputsourceevent.frame' in that specification. working draft
initial def
inition. ...
XRInputSourceEvent.inputSource - Web APIs
h happen on gaze input devices. the device type is identified by looking at the xrinputsource in inputsource and its targetraymode property. xrsession.onselect = event => { let source = event.inputsource; if (source.targetraymode == "gaze") { /* handle selection using a gaze input */ } }; specifications specification status comment webxr device apithe def
inition of 'xrinputsourceevent.inputsource' in that specification. working draft
initial def
inition. ...
XRPermissionStatus.granted - Web APIs
ough 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 usage notes examples specifications specification status comment webxr device apithe def
inition of 'xrpermissionstatus.granted' in that specification. working draft
initial def
inition. ...
XRPermissionStatus - Web APIs
ions.query() was called. any feature which was specified in either the optionalfeatures or requiredfeatures when calling navigator.permissions.query() are listed in granted if and only if permission to use them is granted. methods no methods are defined by xrpermissionstatus. usage notes examples specifications specification status comment webxr device apithe def
inition of 'xrpermissionstatus' in that specification. working draft
initial def
inition. ...
XRPose.emulatedPosition - Web APIs
ue is true. this information is important because devices whose position is emulated are prone to their offset drifting relative to the real world space over time. this is because emulating a position based on accelerometer inputs and models tends to introduce minor errors which accumulate over time. specifications specification status comment webxr device apithe def
inition of 'xrpose.emulatedposition' in that specification. working draft
initial def
inition. ...
XRPose - Web APIs
side motion of the viewer). if any component of the transform is computed or created artificially (such as by using mouse or keyboard controls to move through space), this value is instead true, indicating that the transform is in part emulated in software. example <<<--- todo: needs example --->>> specifications specification status comment webxr device apithe def
inition of 'xrpose' in that specification. working draft
initial def
inition. ...
XRReferenceSpace.onreset - Web APIs
ntly altered to compensate. syntax xrreferencespace.onreset = eventhandler; eventhandler = xrreferencespace.onreset; value an event handler function which will be called whenever the reset event is received by the xrreferencespace. usage notes see the reset event documentation for further details. specifications specification status comment webxr device apithe def
inition of 'onreset' in that specification. working draft
initial def
inition. ...
XRReferenceSpaceEvent.transform - Web APIs
g it with the event's given transform. the scene is represented by a scene object, with all the objects in an array called objects within it. xrreferencespace.addeventlistener("reset", event => { for (let obj of scene.objects) { mat4.multiply(obj.transform, obj.transform, event.transform); } }); specifications specification status comment webxr device apithe def
inition of 'xrreferencespaceevent.transform' in that specification. working draft
initial def
inition. ...
XRReferenceSpaceType - Web APIs
mmersive 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 specifications specification status comment webxr device apithe def
inition of 'xrreferencespacetype' in that specification. working draft
initial def
inition. ...
XRRenderState.inlineVerticalFieldOfView - Web APIs
face returns the default vertical field of view for "inline" sessions and null for all immersive sessions. syntax var inlineverticalfieldofview = xrrenderstate.inlineverticalfieldofview; value a number for "inline" sessions, which represents the default field of view, and null for immersive sessions. specifications specification status comment webxr device apithe def
inition of 'xrrenderstate.inlineverticalfieldofview' in that specification. working draft
initial def
inition. ...
XRRenderState - Web APIs
the display, at which rendering of the scene begins. any closer to the viewer than this, and no portions of the scene are drawn. inlineverticalfieldofview read only the default vertical field of view, defined in radians, to use when the session is in inline mode. null for all immersive sessions. specifications specification status comment webxr device apithe def
inition of 'xrrenderstate' in that specification. working draft
initial def
inition. ...
ARIA: alert role - Accessibility
class="alert">the alert will trigger when the button is pressed.</p> function triggeralert() { var alertel = document.queryselector('.alert'); alertel.addattribute("role", "alert"); } accessibility concerns the alert role should read out content that has changed, or bring the user's attention to it immediately, so it should not be used for static content or used regularly. alerts, by def
inition, are disruptive. lots of alerts at once or unnecessary alerts willl create a bad user experience. specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'alert' in that specification. recommendation wai-aria authoring practicesthe def
inition of 'alert' in that specification. working draft ...
ARIA: application role - Accessibility
age, so be very mindful of using it. think hard on if you actually need it and cannot just use a set of other, known, widgets to accomplish the same task. if used, the application role should be added to the lowest common container possible, not on the <body> element, for example. specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'application' in that specification. recommendation precedence order applying the application role will cause this and all of the descendant elements of this element to be treated like application content, not web content. any reading mechanisms assistive technologies may have for web content will not apply. see also if you use the wai-aria role "application", please do so wi...
ARIA: article role - Accessibility
. always use native element if available. instead of a div with the article role, the <article> element should be used. examples the restaurant recommendations feed display along with its separate documentation from the wai-aria 1.1 authoring practices feed design pattern specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'article' in that specification. recommendation wai-aria authoring practicesthe def
inition of 'feed' in that specification. working draft precedence order this role corresponds to the <article> element in html, and that element should be used instead, if possible. this role does not require any specific roles to be present among its children. it is the only role allow...
ARIA: banner role - Accessibility
scendant of any subsection of the page, sometimes you don't have access to the underlying html. if this is the case, you can add the role of banner to the main header of the page with javascript. identifying the page's banner in this way will help improve the site's accessibility. specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'aria: banner role' in that specification. recommendation wai-aria authoring practicesthe def
inition of 'banner landmark role' in that specification. working draft screen reader support tbd ...
ARIA: cell role - Accessibility
ndex="24">dt</td> </tr> </tbody> </table> above is the semantic way of writing a table. the aria roles are not necessary if the native semantics of the table, and therefore the table rows, have not been altered, such as through the display property. added benefits none specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'aria cell role' in that specification. recommendation wai-aria authoring practicesthe def
inition of 'aria cell role' in that specification. working draft ...
ARIA: Complementary role - Accessibility
ementary sidebar". added benefits certain technologies such as browser extensions can generate lists of all landmark roles present on a page, allowing non-screen reader users to also quickly identify and navigate to large sections of the document. landmarks browser extension specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'aria: complementary role' in that specification. recommendation wai-aria authoring practicesthe def
inition of 'complementary landmark role' in that specification. working draft screen reader support tbd ...
ARIA: contentinfo role - Accessibility
dered contentinfo. added benefits certain technologies such as browser extensions can generate lists of all landmark roles present on a page, allowing non-screen reader users to also quickly identify and navigate to large sections of the document. landmarks browser extension specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'contentinfo landmark role' in that specification. recommendation wai-aria authoring practicesthe def
inition of 'contentinfo landmark role' in that specification. working draft screen reader support ...
ARIA: document role - Accessibility
x attribute with a value of 0. that will also include it in the tab order. added benefits the document role is an easy way to indirectly control assistive technology behavior by unambiguously stating that this is content the user should read with standard screen reader commands. specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'document' in that specification. recommendation screen reader support ...
ARIA: form role - Accessibility
nstead. added benefits certain technologies such as browser extensions can generate lists of all landmark roles present on a page, allowing non-screen reader users to also quickly identify and navigate to large sections of the document. landmarks browser extension specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'aria form role' in that specification. recommendation wai-aria authoring practicesthe def
inition of 'role form' in that specification. working draft screen reader support tbd ...
ARIA: grid role - Accessibility
rids examples w3c/wai tutorial: tables accessibility concerns even if the keyboard use is properly implemented, some users might not be aware that they have to use the arrow keys. make sure that the functionality and interaction needed can be best achieved using the grid role. specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'role grid' in that specification. recommendation wai-aria authoring practicesthe def
inition of 'role grid' in that specification. working draft screen reader support tbd ...
ARIA: Navigation Role - Accessibility
ation navigation". added benefits certain technologies such as browser extensions can generate lists of all landmark roles present on a page, allowing non-screen reader users to also quickly identify and navigate to large sections of the document. landmarks browser extension specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'aria navigtion role' in that specification. recommendation wai-aria authoring practicesthe def
inition of 'navigation landmark role' in that specification. working draft screen reader support tbd ...
ARIA: Region role - Accessibility
g to be described. added benefits certain technologies such as browser extensions can generate lists of all landmark roles present on a page, allowing non-screen reader users to also quickly identify and navigate to large sections of the document. landmarks browser extension specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'aria region role' in that specification. recommendation wai-aria authoring practicesthe def
inition of 'region landmark role' in that specification. working draft screen reader support tbd ...
ARIA: row role - Accessibility
d> </tr> </tbody> </table> above is the semantic way of writing a table. the aria roles are only necessary if the native semantics of the table, and therefore the table rows, are obliterated, such as via setting the display property to flex or grid. added benefits none specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'aria row role' in that specification. recommendation wai-aria authoring practicesthe def
inition of 'aria row role' in that specification. working draft ...
ARIA: search role - Accessibility
de search search". added benefits certain technologies such as browser extensions can generate lists of all landmark roles present on a page, allowing non-screen reader users to also quickly identify and navigate to large sections of the document. landmarks browser extension specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'aria search role' in that specification. recommendation wai-aria authoring practicesthe def
inition of 'aria search role' in that specification. working draft screen reader support tbd ...
ARIA: switch role - Accessibility
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" class="switch"> <span>off</span> <span>on</span> </button> <label for="speakerpower" class="switch">speaker power</label> javascr...
ARIA: tab role - Accessibility
heir built-in functional and accessible features instead, as opposed to needing to add them yourself. 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. specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'tab' in that specification. recommendation wai-aria authoring practicesthe def
inition of 'tabs' in that specification. working draft precedence order what are the related properties, and in what order will this attribute or property be read (which property will take precendence over this one, and which property will be overwritten. screen reader support tbd ...
ARIA: table role - Accessibility
of the table be removed, such as with css. a relevant use case for the aria table role is when css's display property overrides the native semantics of a table, such as by display: grid. in this case, you can use the aria table roles to re-add the semantics. added benefits none specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'aria table role' in that specification. recommendation wai-aria authoring practicesthe def
inition of 'aria table role' in that specification. working draft ...
ARIA: button role - Accessibility
, <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 requirements by default, without need for additional customization. specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'button' in that specification. recommendation wai-aria authoring practicesthe def
inition of 'button' in that specification. working draft notes aria attributes used button aria-pressed aria-expanded aria-haspopup additional resources strong native semantics in html5 notes on using aria in html official wai-aria example code aria menubutton role ...
ARIA: heading role - Accessibility
le is to not use it at all, and instead use the native heading tags <h1> through <h6> as shown in the example above. the heading role and aria-level attribute should only be used to retrofit accessibility on legacy code that you cannot make major changes to. added benefits none. specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'heading' in that specification. recommendation precedence order the heading role overrides the native semantic meaning of the element it is being used for. the aria-level attribute, in addition, determines what level of heading is being exposed. screen reader support tbd ...
ARIA: listbox role - Accessibility
get, it should have the aria-labelledby property set. if one or more entries are not dom children of listbox, additional aria-* properties will need to be set (see aria best practices). if there is a valid reason to expand the listbox, the combobox role may be more appropriate. specifications specification status accessible rich internet applications (wai-aria) 1.1the def
inition of 'aria listbox role' in that specification. recommendation wai-aria authoring practicesthe def
inition of 'listbox role' in that specification. working draft screen reader support tbd ...
Basic form hints - Accessibility
ype="checkbox" value="gewurztraminer"/> <label for="wine-4">gewürztraminer</label> </li> </ul> </form> labeling with aria the html <label> element is appropriate for form-related elements, but many form controls are implemented as a dynamic javascript widget, using <div>s or <span>s. wai-aria, the accessible rich internet applications specification from the w3c's web accessibility
initiative, provides the aria-labelledby attribute for these cases. the example below shows a radio button group implemented using an unordered list. note that on line 3, the <ul> element sets the aria-labelledby attribute to rg1_label, the id of the <h3> element on line 1, which is the label for the radio group. <h3 id="rg1_label">lunch options</h3> <ul class="radiogroup" id="rg1" role="radiogrou...
Keyboard-navigable JavaScript widgets - Accessibility
andler to each element in the group, and when an arrow key is used to move to another element: programmatically apply focus to the new element, update the tabindex of the focused element to "0", and update the tabindex of the previously focused element to "-1". here's an example of a wai-aria tree view using this technique. tips use element.focus() to set focus do not use createevent(),
initevent() and dispatchevent() to send focus to an element. dom focus events are considered informational only: generated by the system after something is focused, but not actually used to set focus. use element.focus() instead. use onfocus to track the current focus don't assume that all focus changes will come via key and mouse events: assistive technologies such as screen readers can set the foc...
Operable - Accessibility
this article provides practical advice on how to write your web content so that it conforms to the success criteria outlined in the operable principle of the web content accessibility guidelines (wcag) 2.0 and 2.1. operable states that user interface components and navigation must be operable. note: to read the w3c def
initions for operable and its guidelines and success criteria, see principle 2: operable — user interface components and navigation must be operable. guideline 2.1 — keyboard accessible: make all functionality available from a keyboard this guideline covers the necessity of making core website functionality available via a keyboard in addition to other means (e.g. mouse), so that users that rely on keyboard controls can access them. success criteria ...
Perceivable - Accessibility
this article provides practical advice on how to write your web content so that it conforms to the success criteria outlined in the perceivable principle of the web content accessibility guidelines (wcag) 2.0 and 2.1. perceivable states that users must be able to perceive it in some way, using one or more of their senses. note: to read the w3c def
initions for perceivable and its guidelines and success criteria, see principle 1: perceivable - information and user interface components must be presentable to users in ways they can perceive. guideline 1.1 — providing text alternatives for non-text content the key here is that text can be converted to other forms that people with disabilities can use. for example, it can be spoken by a screenreader, converted to large print, or repr...
Robust - Accessibility
that it conforms to the success criteria outlined in the robust principle of the web content accessibility guidelines (wcag) 2.0 and 2.1. robust states that content must be robust enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies. this can generally be achieved by following web standards and testing rigorously. note: to read the w3c def
initions for robust and its guidelines and success criteria, see principle 4: robust — content must be robust enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies. guideline 4.1 — compatible: maximize compatibility with current and future user agents, including assistive technologies this guideline focuses on making content as compatible ...
Text labels and names - Accessibility
me title in both places. example <iframe title="mdn web docs" width="300" height="200" src="https://developer.mozilla.org"> </iframe> use alt attribute to label mglyph elements when writing equations with mathml, give each <mglyph> element an alt attribute containing a name that describes the symbol. since mglyph elements are used for non-standard symbols without unicode def
initions, screen readers won't automatically be able to name them. alternative text helps users of screen readers understand the symbol. headings must be labeled make sure that your headings have non-empty text content, and are not hidden, such as with css display:none or aria-hidden=true. users of screen readers rely on headings to understand the structure and content of a document. also, be sure ...
Understanding the Web Content Accessibility Guidelines - Accessibility
id understanding of. for this reason, we have summarised the practical steps you need to take to satisfy the different recommendations, with further links to more details where required. the four principles wcag is broadly broken down into four principles — major things that web content must be to be considered accessible (see understanding the four principles of accessibility for the wcag def
initions). each of the links below will take you to pages that further expand on these areas, giving you practical advice on how to write your web content so it conforms to the success criteria outlined in each of the wcag 2.0 and 2.1 guidelines that further sub-divides each principle. perceivable: users must be able to perceive it in some way, using one or more of their senses. operable: users m...
-moz-outline-radius-topleft - CSS: Cascading Style Sheets
g dimensions of the border box. the calc() function may be used as well. values <length> the radius of the circle defining the curvature of the top and left edges of the element, specified as a css <length>. <percentage> the radius of the circle defining the rounding of the top-left corner of the element, specified as the percentages of the top and left sides of the border box. formal def
inition
initial value0applies toall elementsinheritednopercentagesrefer to the corresponding dimension of the border boxcomputed valueas specifiedanimation typea length, percentage or calc(); formal syntax <outline-radius>where <outline-radius> = <length> | <percentage> examples the example below will not display the desired effect if you are viewing this in a browser other than firefox. html <...
-webkit-overflow-scrolling - CSS: Cascading Style Sheets
diately ceases to scroll when you remove your finger from the touchscreen. touch use momentum-based scrolling, where the content continues to scroll for a while after finishing the scroll gesture and removing your finger from the touchscreen. the speed and duration of the continued scrolling is proportional to how vigorous the scroll gesture was. also creates a new stacking context. formal def
inition
initial valueautoapplies toscrolling boxesinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | touch examples html <div class="scroll-touch"> <p> this paragraph has momentum scrolling </p> </div> <div class="scroll-auto"> <p> this paragraph does not. </p> </div> css div { width: 100%; overflow: auto; } p { width: 200%; background: #...
-webkit-text-security - CSS: Cascading Style Sheets
-webkit-text-security is a non-standard css property that obfuscates characters in a <form> field (such as <input> or <textarea>) by replacing them with a shape. it only affects fields that are not of type=password. syntax -webkit-text-security: circle; -webkit-text-security: disc; -webkit-text-security: square; -webkit-text-security: none; formal def
inition value not found in db! formal syntax syntax not found in db! examples obscuring a text input try typing in the field below. if your browser supports this property, the characters should be visually replaced with squares. html <label for="name">name:</label> <input type="text" name="name" id="name" /> css input { -webkit-text-security: square; } result specifications not part of any standard. ...
::marker - CSS: Cascading Style Sheets
animation and transition properties the specification states that additional css properties may be supported in future. syntax ::marker examples html <ul> <li>peaches</li> <li>apples</li> <li>plums</li> </ul> css ul li::marker { color: red; font-size: 1.5em; } result specifications specification status comment css pseudo-elements level 4the def
inition of '::marker' in that specification. working draft no significant change. css lists module level 3the def
inition of '::marker' in that specification. working draft
initial def
inition. ...
::selection - CSS: Cascading Style Sheets
io of 4.5:1, or 3:1 for larger text such as headings. (wcag defines large text as between 18.66px and 24px and bold, or 24px or larger.) webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 specifications specification status comment css pseudo-elements level 4the def
inition of '::selection' in that specification. working draft
initial def
inition. note: ::selection was in drafts of css selectors level 3, but it was removed in the candidate recommendation phase because its was under-specified (especially with nested elements) and interoperability wasn't achieved (based on discussion in the w3c style mailing list). it returned in pseudo-elements level ...
::slotted() - CSS: Cascading Style Sheets
ut better next to the slots that haven't been successfully filled. the element looks like this when inserted into the page: <person-details> <p slot="person-name">dr. shazaam</p> <span slot="person-age">immortal</span> <span slot="person-occupation">superhero</span> </person-details> specifications specification status comment css scoping module level 1the def
inition of '::slotted' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for an...
:checked - CSS: Cascading Style Sheets
seudo-class to build an image gallery with full-size images that show only when the user clicks on a thumbnail. see this demo for a possible cue. note: for an analogous effect, but based on the :hover pseudo-class and without hidden radioboxes, see this demo, taken from the :hover reference page. specifications specification status comment html living standardthe def
inition of ':checked' in that specification. living standard no change. html5the def
inition of ':checked' in that specification. recommendation defines the semantic regarding html. selectors level 4the def
inition of ':checked' in that specification. working draft no change. selectors level 3the def
inition of ':checked' in that specification. recommendati...
:dir() - CSS: Cascading Style Sheets
ght-to-left elements. formal syntax :dir( ltr | rtl ) examples html <div dir="rtl"> <span>test1</span> <div dir="ltr">test2 <div dir="auto">עִבְרִית</div> </div> </div> css :dir(ltr) { background-color: yellow; } :dir(rtl) { background-color: powderblue; } result specifications specification status comment html living standardthe def
inition of ':dir(ltr)' in that specification. living standard no changes. selectors level 4the def
inition of ':dir()' in that specification. working draft
initial def
inition. ...
:first - CSS: Cascading Style Sheets
ipt document.queryselector("button").addeventlistener('click', () => { window.print(); }); result press the "print!" button to print the example. the words on the first page should be somewhere around the center, while other pages will have their contents at the default position. specifications specification status comment css paged media module level 3the def
inition of ':first' in that specification. working draft no change. css level 2 (revision 1)the def
inition of ':first' in that specification. recommendation
initial def
inition. ...
:fullscreen - CSS: Cascading Style Sheets
ment to not have the :fullscreen pseudo-class applied to it. #fs-toggle:not(:fullscreen) { background-color: #afa; } when the document is in full-screen mode, the following css applies instead, setting the background color to a pale shade of red. #fs-toggle:fullscreen { background-color: #faa; } specifications specification status comment fullscreen apithe def
inition of ':fullscreen' in that specification. living standard
initial def
inition. ...
:host() - CSS: Cascading Style Sheets
padding: 2px 5px; }'; the :host(.footer) { color : red; } rule styles all instances of the <context-span> element (the shadow host in this instance) in the document that have the footer class set on them — we've used it to give instances of the element inside the <footer> a special color. specifications specification status comment css scoping module level 1the def
inition of ':host()' in that specification. working draft
initial def
inition. browser compatibility desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internet:host()chrome full support 54edge full support ...
:host-context() - CSS: Cascading Style Sheets
tyle: italic; } and :host-context(h1):after { content: " - no links in headers!" } rules style the instance of the <context-span> element (the shadow host in this instance) inside the <h1>. we've used it to make it clear that the custom element shouldn't appear inside the <h1> in our design. specifications specification status comment css scoping module level 1the def
inition of ':host-context()' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome ...
:host - CSS: Cascading Style Sheets
':host(.footer) { color : red; }' + ':host { background: rgba(0,0,0,0.1); padding: 2px 5px; }'; the :host { background: rgba(0,0,0,0.1); padding: 2px 5px; } rule styles all instances of the <context-span> element (the shadow host in this instance) in the document. specifications specification status comment css scoping module level 1the def
inition of ':host' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for andro...
:invalid - CSS: Cascading Style Sheets
share the same value for their name attribute.) gecko defaults by default, gecko does not apply a style to the :invalid pseudo-class. however, it does apply a style (a red "glow" using the box-shadow property) to the :-moz-ui-invalid pseudo-class, which applies in a subset of cases for :invalid. specifications specification status comment html living standardthe def
inition of ':invalid' in that specification. living standard no change. html5the def
inition of ':invalid' in that specification. recommendation defines the semantics of html and constraint validation. selectors level 4the def
inition of ':invalid' in that specification. working draft
initial def
inition. ...
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
between :is() and :where() the diffference between the two is that :is() counts towards the specificity of the overall selector (it takes the specificity of its most specific argument), whereas :where() has a specificity value of 0. this is demonstrated by the example on the :where() reference page. specifications specification status comment selectors level 4the def
inition of ':is()' in that specification. working draft
initial def
inition 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for android...
:left - CSS: Cascading Style Sheets
he margin, padding, border, and background properties of the page box. all other properties will be ignored, and only the page box, not the document content on the page, will be affected. syntax :left examples setting a margin for left-hand pages @page :left { margin: 2in 3in; } specifications specification status comment css paged media module level 3the def
inition of ':left' in that specification. working draft no change. css level 2 (revision 1)the def
inition of ':left' in that specification. recommendation
initial def
inition. ...
:not() - CSS: Cascading Style Sheets
ration: underline; } /* elements that are not <div> and not <span> elements */ body :not(div):not(span) { font-weight: bold; } /* elements that are not `.crazy` or `.fancy` */ /* note that this syntax is not well supported yet. */ body :not(.crazy, .fancy) { font-family: sans-serif; } result specifications specification status comment selectors level 4the def
inition of ':not()' in that specification. working draft extends its argument to allow some non-simple selectors. selectors level 3the def
inition of ':not()' in that specification. recommendation
initial def
inition. ...
:only-of-type - CSS: Cascading Style Sheets
e html <main> <div>i am `div` #1.</div> <p>i am the only `p` among my siblings.</p> <div>i am `div` #2.</div> <div>i am `div` #3. <i>i am the only `i` child.</i> <em>i am `em` #1.</em> <em>i am `em` #2.</em> </div> </main> css main :only-of-type { color: red; } result specifications specification status comment selectors level 4the def
inition of ':only-of-type' in that specification. working draft matching elements are not required to have a parent. selectors level 3the def
inition of ':only-of-type' in that specification. recommendation
initial def
inition. ...
:optional - CSS: Cascading Style Sheets
required inputs should also be indicated visually, using a treatment that does not rely solely on color to convey meaning. typically, descriptive text and/or an icon are used. mdn understanding wcag, guideline 3.3 explanations understanding success criterion 3.3.2 | w3c understanding wcag 2.0 specifications specification status comment html living standardthe def
inition of ':optional' in that specification. living standard no change. html5the def
inition of ':optional' in that specification. recommendation defines the semantics of html and constraint validation. selectors level 4the def
inition of ':optional' in that specification. working draft no change. ...
:read-only - CSS: Cascading Style Sheets
er. <p contenteditable>this paragraph is editable; it is read-write.</p> <p>this paragraph is not editable; it is read-only.</p> p { font-size: 150%; padding: 5px; border-radius: 5px; } p:read-only { background-color: red; color: white; } p:read-write { background-color: lime; } specifications specification status comment html living standardthe def
inition of ':read-only' in that specification. living standard no change. html5the def
inition of ':read-only' in that specification. recommendation defines the semantics regarding html and constraint validation. selectors level 4the def
inition of ':read-only' in that specification. working draft defines the pseudo-class, but not the associated semantics. brow...
:read-write - CSS: Cascading Style Sheets
it. <p contenteditable>this paragraph is editable; it is read-write.</p> <p>this paragraph is not editable; it is read-only.</p> p { font-size: 150%; padding: 5px; border-radius: 5px; } p:read-only { background-color: red; color: white; } p:read-write { background-color: lime; } specifications specification status comment html living standardthe def
inition of ':read-write' in that specification. living standard no change. html5the def
inition of ':read-write' in that specification. recommendation defines the semantics regarding html and constraint validation. selectors level 4the def
inition of ':read-write' in that specification. working draft defines the pseudo-class, but not the associated semantics. b...
:required - CSS: Cascading Style Sheets
uts, required inputs should be indicated visually using a treatment that does not rely solely on color to convey meaning. typically, descriptive text and/or an icon are used. mdn understanding wcag, guideline 3.3 explanations understanding success criterion 3.3.2 | w3c understanding wcag 2.0 specifications specification status comment html living standardthe def
inition of ':required' in that specification. living standard no change. html5the def
inition of ':required' in that specification. recommendation defines the semantics of html and constraint validation. selectors level 4the def
inition of ':required' in that specification. working draft no change. ...
:right - CSS: Cascading Style Sheets
margin, padding, border, and background properties of the page box. all other properties will be ignored, and only the page box, not the document content on the page, will be affected. syntax :right examples setting margins for right-hand pages @page :right { margin: 2in 3in; } specifications specification status comment css paged media module level 3the def
inition of ':right' in that specification. working draft no change. css level 2 (revision 1)the def
inition of ':right' in that specification. recommendation
initial def
inition. ...
:root - CSS: Cascading Style Sheets
is higher. /* selects the root element of the document: <html> in the case of html */ :root { background: yellow; } syntax :root examples declaring global css variables :root can be useful for declaring global css variables: :root { --main-color: hotpink; --pane-padding: 5px 42px; } specifications specification status comment selectors level 4the def
inition of ':root' in that specification. working draft no change. selectors level 3the def
inition of ':root' in that specification. recommendation
initial def
inition. ...
:valid - CSS: Cascading Style Sheets
rmine the input's state unless it is accompanied by an additional indicator that does not rely on color to convey meaning. typically, descriptive text and/or an icon are used. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.1 | w3c understanding wcag 2.0 specifications specification status comment html living standardthe def
inition of ':valid' in that specification. living standard no change. html5the def
inition of ':valid' in that specification. recommendation defines the semantics of html and constraint validation. selectors level 4the def
inition of ':valid' in that specification. working draft
initial def
inition. ...
Styling Columns - CSS: Cascading Style Sheets
ht be. for now, however, we are able to change the spacing and add lines between columns. the column-gap property the gap between our columns is controlled by the column-gap property. this property was originally defined in the multi-column layout specification. however, it is now defined in box alignment in order to unify gaps between boxes in other specifications such as css grid layout. the
initial value of column-gap in multicol is 1em. this means your columns will not run into each other. in other layout methods the
initial value for column-gap is 0. if you use the keyword value “normal” the gap will be set to 1em. you can change the gap by using any length unit as the value of column-gap. in the example below, the column-gap is set to 40px. the allowed value for column-gap is ...
Using multi-column layouts - CSS: Cascading Style Sheets
people have trouble reading text if lines are too long; if it takes too long for the eyes to move from the end of the one line to the beginning of the next, they lose track of which line they were on. therefore, to make maximum use of a large screen, authors should have limited-width columns of text placed side by side, just as newspapers do. unfortunately this is impossible to do with css and html without forcing column breaks at fixed positions, or severely restricting the markup allowed in the text, or using heroic scripting. ...
CSS Multi-column Layout - CSS: Cascading Style Sheets
ow in multicol what happens when an item overflows the column it is in and what happens when there is too much columned content to fit a container. content breaks in multicol introduction to the fragmentation specification and how to control where column content breaks. specifications specification status comment css multi-column layout module working draft
initial def
inition ...
CSS Conditional Rules - CSS: Cascading Style Sheets
css conditional rules is a css module that allows to define a set of rules that will only apply based on the capabilities of the processor or the document the style sheet is being applied to. reference at-rules @document @media @supports @import specifications specification status comment css conditional rules module level 3 candidate recommendation
initial def
inition ...
CSS Device Adaptation - CSS: Cascading Style Sheets
css device adaptation is a module of css that lets you define the size, zoom factor, and orientation of the viewport. reference at-rules @viewport specifications specification status comment css device adaptation working draft
initial def
inition ...
CSS Display - CSS: Cascading Style Sheets
ine-based placement grid template areas layout using named grid lines auto-placement in grid layout box alignment in grid layout grids, logical values and writing modes css grid layout and accessibility css grid layout and progressive enhancement realizing common layouts using grids specifications specification status comment css display module level 3the def
inition of 'display' in that specification. candidate recommendation added run-in, flow, flow-root, contents and multi-keyword values. css level 2 (revision 1)the def
inition of 'display' in that specification. recommendation added the table model values and inline-block. css level 1the def
inition of 'display' in that specification. recommendation
initial def
inition.
Backwards Compatibility of Flexbox - CSS: Cascading Style Sheets
-webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; } autoprefixer online is a useful way to see which prefixes are recommended, depending on how many versions you wish to go back with browser support. you can also check can i use for information about when prefixes were removed in browsers to make your decision. 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. the specification defines what happens if you use other layout methods on an element which then becomes a flex item. floated items “float and clear do not create floating or clearance of flex item, and ...
Mastering Wrapping of Flex Items - CSS: Cascading Style Sheets
it deals with laying out items as a row or as a column — but not both at once. there is however the ability to wrap flex items onto new lines, creating new rows if flex-direction is row and new columns if flex-direction is column. in this guide i will explain how this works, what it is designed for and what situations really require css grid layout rather than flexbox. making things wrap the
initial value of the flex-wrap property is nowrap. this means that if you have a set of flex items that are too wide for their container, they will overflow it. if you want to cause them to wrap once they become too wide you must add the flex-wrap property with a value of wrap, or use the shorthand flex-flow with values of row wrap or column wrap. items will then wrap in the container. in the next ex...
Flow Layout and Writing Modes - CSS: Cascading Style Sheets
inline direction as well. while certain languages will use a particular writing mode or text direction, we can also use these properties for creative effect, such as running a heading vertically. the writing-mode property and block flow the writing-mode property accepts the values horizontal-tb, vertical-rl and vertical-lr. these values control the direction that blocks flow on the page. the
initial value is horizontal-tb, which is a top to bottom block flow direction with a horizontal inline direction. left to right languages, such as english, and right to left languages. such as arabic, are all horizontal-tb. the following example shows blocks using horizontal-tb. the value vertical-rl gives you a right-to-left block flow direction with a vertical inline direction, as shown in the n...
OpenType font features guide - CSS: Cascading Style Sheets
nt. the example below shows a string of glyphs with only the opentype set 'jis78' enabled. uncheck the box below and you'll see more characters displayed. note: these glyphs were copied out of a font sample and are not intended as prose. font variant shorthand (font-variant) this is the shorthand syntax for defining all of the above. setting a value of normal resets all properties to their
initial value. setting a value of none sets font-variant-ligatures to none and all other properties to their
initial value. (meaning that if kerning is on by default, it will still be on even with a value of none being supplied here.) font feature settings font-feature-settings is the 'low level syntax' that allows explicit access to every named available opentype feature. this gives a lot of cont...
CSS Fonts - CSS: Cascading Style Sheets
status comment css fonts module level 4 working draft adds font-variation-settings (and related higher-level properties) and font-optical-sizing. css fonts module level 3 candidate recommendation adds font-feature-settings (and related higher-level properties) css level 2 (revision 1) recommendation css level 1 recommendation
initial def
inition ...
CSS Generated Content - CSS: Cascading Style Sheets
circumstances with a generated value. see the how to guide for generated content to learn more, and the content and quotes properties for implementation information. reference properties content quotes specifications specification status comment css generated content module level 3 working draft css level 2 (revision 1) recommendation
initial def
inition ...
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
rid. currently the only way to do this is to use display: contents to cause the box generated 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 def
inite 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 t...
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
} .box3 { grid-column: 2 / 3; grid-row: 1 / 2; } .box4 { grid-column: 2 / 4; grid-row: 3 / 4; } default spans in the above examples i specified every end row and column line, in order to demonstrate the properties, however in practice if an item only spans one track you can omit the grid-column-end or grid-row-end value. grid defaults to spanning one track. ...
Subgrid - CSS: Cascading Style Sheets
ested 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 def
inition of subgrids. see also on the mozilla developer youtube channel, see the videos laying out forms using subgrid and don't wait to use subgrid for better card layouts hello subgrid! a presentation from cssconf.eu ...
Compositing and Blending - CSS: Cascading Style Sheets
compositing and blending is a css module that defines how shapes of different elements are combined into a single image. reference properties background-blend-mode isolation mix-blend-mode data types <blend-mode> specifications specification status comment compositing and blending level 1 candidate recommendation
initial def
inition ...
Questions about CSS - CSS: Cascading Style Sheets
cascading style sheets (css) is a rule-based language allowing developers to define styles to apply to html elements (or other markup structures). css gives more control over the appearance of a web page to the page creator than to the browser designer or the viewer. with css, the sources of style def
inition for a given document element are in this order of precedence: the style attribute on an individual element tag the style element that defines a specific style sheet containing style declarations or a link element that links to a separate document containing the style element. in a web page, the style element is placed between the title statement and the body statement. an imported style sheet, using the css @import notation to automatically import and merge an external sty...
ID selectors - CSS: Cascading Style Sheets
ly (but not specificity-wise), this is equivalent to the following attribute selector: [id=id_value] { style properties } examples css #identified { background-color: skyblue; } html <div id="identified">this div has a special id on it!</div> <div>this is just a regular div.</div> result specifications specification status comment selectors level 4the def
inition of 'id selectors' in that specification. working draft selectors level 3the def
inition of 'id selectors' in that specification. recommendation css level 2 (revision 1)the def
inition of 'id selectors' in that specification. recommendation css level 1the def
inition of 'id selectors' in that specification. recommendation
initial def
inition ...
Using Media Queries for Accessibility - CSS: Cascading Style Sheets
tified the system that they prefer an interface that minimizes the amount of movement or animation, preferably to the point where all non-essential movement is removed. example this example has an annoying animation unless you turn on reduce motion in your accessibility preferences. html <div class="animation">animated box</div> css .animation { -webkit-animation: vibrate 0.3s linear inf
inite both; animation: vibrate 0.3s linear inf
inite both; } @media (prefers-reduced-motion: reduce) { .animation { animation: none; } } high contrast mode the -ms-high-contrast css media feature is a microsoft extension that describes whether the application is being displayed in high contrast mode, and with what color variation. this will help not only users with low vision and cont...
Media queries - CSS: Cascading Style Sheets
p users understand your website better. specifications specification status comment media queries level 5 editor's draft css conditional rules module level 3 candidate recommendation media queries level 4 candidate recommendation media queries recommendation css level 2 (revision 1) recommendation
initial def
inition ...
Mozilla CSS extensions - CSS: Cascading Style Sheets
tyle [prefixed version still accepted] -moz-transition [prefixed version still accepted] -moz-transition-delay [prefixed version still accepted] -moz-transition-duration [prefixed version still accepted] -moz-transition-property [prefixed version still accepted] -moz-transition-timing-function [prefixed version still accepted] -moz-user-select values global values -moz-
initial -moz-appearance button button-arrow-down button-arrow-next button-arrow-previous button-arrow-up button-bevel checkbox checkbox-container checkbox-label checkmenuitem dialog groupbox listbox menuarrow menucheckbox menuimage menuitem menuitemtext menulist menulist-button menulist-text menulist-textfield menupopup menuradio menuseparator -moz-mac-unified-toolbar ...
Viewport concepts - CSS: Cascading Style Sheets
the <svg> element. <svg height="300" width="400"></svg> in this examples, the viewport has an aspect ratio of 3::4, and is, but default, 400 by 300 units, with a unit generally being a css pixel. svg also has an internal coordinate system defined via the viewbox attribute, which is not related to this viewport discussion. if you include an svg file in your html, the viewport of the svg is the
initial containing block, or the width and height of the svg container. using the @media query in your svg's css is relative to that container, not the browser. @media screen and (min-width: 400px) and (max-width: 500px) { /* css goes here */ } generally, when you write the above media query, the styles are applied if the viewport, generally the browser window, is between 400px and 500px, inclusiv...
Visual formatting model - CSS: Cascading Style Sheets
top-to-bottom language. however, you might design something that requires scrolling in the inline dimension too. box generation box generation is the part of the css visual formatting model that creates boxes from the document's elements. generated boxes are of different types, which affect their visual formatting. the type of the box generated depends on the value of the css display property.
initially defined in css2, the display property is extended in the css display module level 3. in addition, some of the terminologies around the display have been updated and clarified in the years since css2. css takes your source document and renders it onto a canvas. to do this, it generates an intermediary structure, the box tree, which represents the formatting structure of the rendered document...
WebKit CSS extensions - CSS: Cascading Style Sheets
c -webkit-column-axis -webkit-column-break-after -webkit-column-break-before -webkit-column-break-inside -webkit-column-progression -webkit-cursor-visibility d-i -webkit-dashboard-region -webkit-font-size-delta -webkit-font-smoothing -webkit-highlight -webkit-hyphenate-character -webkit-hyphenate-limit-after -webkit-hyphenate-limit-before -webkit-hyphenate-limit-lines -webkit-
initial-letter l -webkit-line-align -webkit-line-box-contain -webkit-line-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**...
<angle-percentage> - CSS: Cascading Style Sheets
ocumentation for <angle> and <percentage> for details of the individual syntaxes allowed by this type. use in calc() where an <angle-percentage> is specified as an allowable type, this means that the percentage resolves to an angle and therefore can be used in a calc() expression. specifications specification status comment css values and units module level 4the def
inition of '<angle-percentage>' in that specification. editor's draft css values and units module level 3the def
inition of '<angle-percentage>' in that specification. candidate recommendation defines <angle-percentage>. adds calc() ...
animation-delay - CSS: Cascading Style Sheets
is implicit, the starting value is taken from the moment the animation is applied to the element. note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property values. formal def
inition
initial value0sapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <time># examples see css animations for examples. specifications specification status comment css animationsthe def
inition of 'animation-delay' in that specification. working draft
initial def
inition. ...
animation-duration - CSS: Cascading Style Sheets
laration to be ignored. some early, prefixed, implementations may consider them as identical to 0s. note: when you specify multiple comma-separated values on an animation-* property, they will be assigned to the animations specified in the animation-name property in different ways depending on how many there are. for more information, see setting multiple animation property values. formal def
inition
initial value0sapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <time># examples see css animations for examples. specifications specification status comment css animationsthe def
inition of 'animation-duration' in that specification. working draft
initial def
inition. ...
calc() - CSS: Cascading Style Sheets
assigned to .foo's width property, all inner calc()s (no matter how deeply nested) will be flattened to just parentheses, so the width property's value will be eventually calc( ( 100px / 2) / 2), i.e. 25px. in short: a calc() inside of a calc() is identical to just parentheses. specifications specification status comment css values and units module level 3the def
inition of 'calc()' in that specification. candidate recommendation
initial def
inition ...
clamp() - CSS: Cascading Style Sheets
hasellus sit amet placerat lorem. </p> css html { font-family: sans-serif; } body { margin: 0 auto; width: min(1000px, calc(70% + 100px)); } h1 { letter-spacing: 2px; font-size: clamp(1.8rem, 2.5vw, 2.8rem); } p { line-height: 1.5; font-size: max(1.2rem, 1.2vw); } specifications specification status comment css values and units module level 4the def
inition of 'clamp()' in that specification. editor's draft
initial def
inition. ...
saturate() - CSS: Cascading Style Sheets
it. a value of 0% is completely unsaturated, while a value of 100% leaves the input unchanged. the lacuna value for interpolation is 1. examples saturate(0) /* completely unsaturated */ saturate(.4) /* 40% saturated */ saturate(100%) /* no effect */ saturate(200%) /* double saturation */ specifications specification status filter effects module level 1the def
inition of 'saturate()' in that specification. working draft ...
sepia() - CSS: Cascading Style Sheets
e>. a value of 100% is completely sepia, while a value of 0% leaves the input unchanged. values between 0% and 100% are linear multipliers on the effect. the lacuna value for interpolation is 0. examples sepia(0) /* no effect */ sepia(.65) /* 65% sepia */ sepia(100%) /* completely sepia */ specifications specification status filter effects module level 1the def
inition of 'sepia()' in that specification. working draft ...
<flex> - CSS: Cascading Style Sheets
x> data type is specified as a <number> followed by the unit fr. the fr unit represents a fraction of the leftover space in the grid container. as with all css dimensions, there is no space between the unit and the number. examples 1fr /* using an integer value */ 2.5fr /* using a float value */ specifications specification status comment css grid layoutthe def
inition of '<flex>' in that specification. candidate recommendation
initial def
inition. ...
<frequency-percentage> - CSS: Cascading Style Sheets
with a leading - and a unit invalid frequency values 12.0 this is a <number>, not an <frequency>, because it is missing a unit. 7 hz no space is allowed between the number and the unit. 0 although unitless zero is an allowable <length>, it's an invalid <frequency>. specifications specification status comment css values and units module level 4the def
inition of '<frequency-percentage>' in that specification. editor's draft css values and units module level 3the def
inition of '<frequency-percentage>' in that specification. candidate recommendation defines <frequency-percentage>. adds calc() ...
<frequency> - CSS: Cascading Style Sheets
with a leading - and a unit invalid frequency values 12.0 this is a <number>, not an <frequency>, because it is missing a unit. 7 hz no space is allowed between the number and the unit. 0 although unitless zero is an allowable <length>, it's an invalid <frequency>. specifications specification status comment css values and units module level 3the def
inition of '<frequency>' in that specification. candidate recommendation
initial def
inition. note: this data type was
initially introduced in css level 2 for the now-obsolete aural media type, where it was used to define the pitch of the voice. however, the <frequency> data type has been reintroduced in css3, though no css property is using it at the moment. ...
<gradient> - CSS: Cascading Style Sheets
gradient example a simple conic gradient example. note that this isn't supported widely across browser as of yet. <div class="conic-gradient">conic gradient</div> div { width: 200px; height: 200px; } .conic-gradient { background: conic-gradient(lightpink, white, powderblue); } specifications specification status comment css images module level 4the def
inition of '<gradient>' in that specification. working draft adds conic-gradient css images module level 3the def
inition of '<gradient>' in that specification. candidate recommendation
initial def
inition. ...
ident - CSS: Cascading Style Sheets
od invalid identifiers 34rem it must not start with a decimal digit. -12rad it must not start with a dash followed by a decimal digit. bili.bob only alphanumeric characters, _, and - needn't be escaped. 'bilibob' this would be a <string>. "bilibob" this would be a <string>. specifications specification status comment css values and units module level 4the def
inition of '<ident>' in that specification. editor's draft css values and units module level 3the def
inition of '<ident>' in that specification. candidate recommendation ...
image-set() - CSS: Cascading Style Sheets
ey nothing to its users. if the image contains information critical to understanding the page's overall purpose, it is better to describe it semantically in the document. mdn understanding wcag, guideline 1.1 explanations understanding success criterion 1.1.1 | w3c understanding wcag 2.0 specifications specification status comment css images module level 4the def
inition of 'the image-set() notation' in that specification. working draft 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androi...
<image> - CSS: Cascading Style Sheets
be an image. */ element(#fakeid) /* an element id must be an existing id on the page. */ image(z.jpg#xy=0,0) /* the spatial fragment must be written in the format of xywh=#,#,#,# */ image-set('cat.jpg' 1x, 'dog.jpg' 1x) /* every image in an image set must have a different resolutions */ specifications specification status comment css images module level 4the def
inition of '<image>' in that specification. working draft adds element(), image(), image-set(), conic-gradient(), repeating-conic-gradient(), and image-resolution. css images module level 3the def
inition of '<image>' in that specification. candidate recommendation
initial def
inition. before this, there was no explicitly defined <image> data type. images could only be defined using...
<length-percentage> - CSS: Cascading Style Sheets
here a <length-percentage> is specified as an allowable type, this means that the percentage resolves to a length and therefore can be used in a calc() expression. therefore, all of the following values are acceptable for width: width: 200px; width: 20%; width: calc(100% - 200px); specifications specification status comment css values and units module level 4the def
inition of '<length-percentage>' in that specification. editor's draft css values and units module level 3the def
inition of '<length-percentage>' in that specification. candidate recommendation defines <length-percentage>. adds calc() ...
min() - CSS: Cascading Style Sheets
g or 400px wide, whichever is smaller. in other words, the widest that the label and input can be is 400px. the narrowest they will be is 40% of the form's width, which on a smartwatch's screen is very small. <form> <label>type something:</label> <input type="text"> </form> specifications specification status comment css values and units module level 4the def
inition of 'min()' in that specification. editor's draft
initial def
inition. ...
minmax() - CSS: Cascading Style Sheets
v { background-color: #8ca0ff; padding: 5px; } html <div id="container"> <div> item as wide as the content, but at most 300 pixels. </div> <div> item with flexible width but a minimum of 200 pixels. </div> <div> inflexible item of 150 pixels width. </div> </div> result specifications specification status comment css grid layoutthe def
inition of 'minmax()' in that specification. candidate recommendation
initial def
inition ...
Guide to scroll anchoring - CSS: Cascading Style Sheets
if one node doesn't seem appropriate to be an anchor, you can exclude it using overflow-anchor, as described below. what if i need to disable it? the specification provides a new property, overflow-anchor, which can be used to disable scroll anchoring on all or part of the document. it's essentially a way to opt out of the new behavior. the only possible values are auto or none: auto is the
initial value; as long as the user has a supported browser the scroll anchoring behavior will happen, and they should see fewer content jumps. none means that you have explicitly opted the document, or part of the document, out of scroll anchoring. to opt out the entire document, you can set it on the <body> element: body { overflow-anchor: none; } to opt out a certain part of the document use ...
paint() - CSS: Cascading Style Sheets
(hollowhighlights, filled, 3px); } li:nth-of-type(3n+1) { --boxcolor: hsla(255, 90%, 60%, 1.0); background-image: paint(hollowhighlights, stroke, 1px); } we've included a custom property in the selector block defining a boxcolor. custom properties are accessible to the paintworklet. specifications specification status comment css painting api level 1the def
inition of 'paint notation' in that specification. working draft
initial def
inition. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome f...
<ratio> - CSS: Cascading Style Sheets
ratio usage 4/3 traditional tv format in the 20th century. 16/9 modern "widescreen" tv format. 185/100 = 91/50 the most common movie format since the 1960s. 239/100 "widescreen," anamorphic movie format. specifications specification status comment media queries level 4the def
inition of '<ratio>' in that specification. candidate recommendation media queriesthe def
inition of '<ratio>' in that specification. recommendation
initial def
inition. ...
<resolution> - CSS: Cascading Style Sheets
use in a media query @media print and (min-resolution: 300dpi) { ... } valid resolutions 96dpi 50.82dpcm 3dppx invalid resolutions 72 dpi spaces are not allowed between the number and the unit. ten dpi the number must use digits only. 0 the unit is required. specifications specification status comment css values and units module level 4the def
inition of '<resolution>' in that specification. editor's draft adds the x unit. css values and units module level 3the def
inition of '<resolution>' in that specification. candidate recommendation adds the dppx unit. media queriesthe def
inition of '<resolution>' in that specification. recommendation
initial def
inition. ...
Resolved value - CSS: Cascading Style Sheets
the resolved value of a css property is the value returned by getcomputedstyle(). for most properties, it is the computed value, but for a few legacy properties (including width and height), it is instead the used value. see the specification link below for more per-property details. specifications specification status comment css object model (cssom)the def
inition of 'resolved value' in that specification. working draft
initial def
inition. ...
<shape> - CSS: Cascading Style Sheets
hape> data type are interpolated over their top, right, bottom, and left components, each treated as a real, floating-point number. the speed of the interpolation is determined by the timing function associated with the animation. example img.clip04 { clip: rect(10px, 20px, 20px, 10px); } specifications specification status comment css level 2 (revision 1)the def
inition of '<shape>' in that specification. recommendation defines with the clip property. 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewch...
<time-percentage> - CSS: Cascading Style Sheets
zero with a leading - and a unit invalid times 0 although unitless zero is allowed for <length>s, it's invalid for <time>s. 12.0 this is a <number>, not a <time>, because it's missing a unit. 7 ms no space is allowed between the number and the unit. specifications specification status comment css values and units module level 4the def
inition of '<time-percentage>' in that specification. editor's draft css values and units module level 3the def
inition of '<time-percentage>' in that specification. candidate recommendation defines <time-percentage>. adds calc() ...
<time> - CSS: Cascading Style Sheets
zero with a leading - and a unit invalid times 0 although unitless zero is allowed for <length>s, it's invalid for <time>s. 12.0 this is a <number>, not a <time>, because it's missing a unit. 7 ms no space is allowed between the number and the unit. specifications specification status comment css values and units module level 4the def
inition of '<time>' in that specification. editor's draft css values and units module level 3the def
inition of '<time>' in that specification. candidate recommendation normative def
inition of s and ms. css level 2 (revision 1)the def
inition of '<time>' in that specification. recommendation informal def
inition of s and ms. ...
matrix() - CSS: Cascading Style Sheets
(), skewy(), skewx(), scaley(), translatex(), translatey() ) examples html <div>normal</div> <div class="changed">changed</div> css div { width: 80px; height: 80px; background-color: skyblue; } .changed { transform: matrix(1, 2, -1, 1, 80, 80); background-color: pink; } result specifications specification status comment css transforms level 1the def
inition of 'matrix()' in that specification. working draft
initial def
inition ...
perspective() - CSS: Cascading Style Sheets
eg) rotatey(30deg); } .top { background-color: skyblue; transform: rotatex(90deg) translate3d(0, 0, 50px); } .left { background-color: pink; transform: rotatey(-90deg) translate3d(0, 0, 50px); } .front { background-color: limegreen; transform: translate3d(0, 0, 50px); } result specifications specification status comment css transforms level 2the def
inition of 'perspective()' in that specification. editor's draft
initial def
inition ...
rotate() - CSS: Cascading Style Sheets
.rotate { background-color: transparent; outline: 2px dashed; transform: rotate(45deg); } .rotate-translate { background-color: pink; transform: rotate(45deg) translatex(180px); } .translate-rotate { background-color: gold; transform: translatex(180px) rotate(45deg); } result specifications specification status comment css transforms level 1the def
inition of 'rotate()' in that specification. working draft
initial def
inition ...
rotate3d() - CSS: Cascading Style Sheets
result rotating on a custom axis html <div>normal</div> <div class="rotated">rotated</div> css body { perspective: 800px; } div { width: 80px; height: 80px; background-color: skyblue; } .rotated { transform: rotate3d(1, 2, -1, 192deg); background-color: pink; } result specifications specification status comment css transforms level 2the def
inition of 'rotate3d()' in that specification. editor's draft
initial def
inition ...
rotateX() - CSS: Cascading Style Sheets
)-sin(a)0sin(a)cos(a) 10000cos(a)-sin(a)00sin(a)cos(a)00001 examples html <div>normal</div> <div class="rotated">rotated</div> css div { width: 80px; height: 80px; background-color: skyblue; } .rotated { transform: rotatex(45deg); background-color: pink; } result specifications specification status comment css transforms level 2the def
inition of 'rotatex()' in that specification. editor's draft
initial def
inition ...
rotateY() - CSS: Cascading Style Sheets
n(a)010-sin(a)0cos(a) cos(a)0sin(a)00100-sin(a)0cos(a)00001 examples html <div>normal</div> <div class="rotated">rotated</div> css div { width: 80px; height: 80px; background-color: skyblue; } .rotated { transform: rotatey(60deg); background-color: pink; } result specifications specification status comment css transforms level 2the def
inition of 'rotatey()' in that specification. editor's draft
initial def
inition ...
rotateZ() - CSS: Cascading Style Sheets
n(a)cos(a)0001 cos(a)-sin(a)00 sin(a)cos(a)00 0010 0001 examples html <div>normal</div> <div class="rotated">rotated</div> css div { width: 80px; height: 80px; background-color: skyblue; } .rotated { transform: rotatez(45deg); background-color: pink; } result specifications specification status comment css transforms level 2the def
inition of 'rotatez()' in that specification. editor's draft
initial def
inition ...
CSS: Cascading Style Sheets
n problems when creating a web page. reference css reference: this exhaustive reference for seasoned web developers describes every property and concept of css. css key concepts: the syntax and forms of the language specificity, inheritance and the cascade css units and values box model and margin collapse the containing block stacking and block-formatting contexts
initial, computed, used, and actual values css shorthand properties css flexible box layout css grid layout media queries animation cookbook the css layout cookbook aims to bring together recipes for common layout patterns, things you might need to implement in your sites. in addition to providing code you can use as a starting point in your projects, these recipes highlight the...
Getting Started - Developer guides
of xmlhttprequest.done (corresponding to 4), that means that the full server response was received and it's ok for you to continue processing it. if (httprequest.readystate === xmlhttprequest.done) { // everything is good, the response was received. } else { // not ready yet. } the full list of the readystate values is documented at xmlhttprequest.readystate and is as follows: 0 (un
initialized) or (request not
initialized) 1 (loading) or (server connection established) 2 (loaded) or (request received) 3 (interactive) or (processing request) 4 (complete) or (request finished and response is ready) next, check the http response status codes of the http response. the possible codes are listed at the w3c. in the following example, we differentiate between a successful and unsu...
Creating and triggering events - Developer guides
ow you to access the additional data in the event listener: function eventhandler(e) { console.log('the time is: ' + e.detail); } the old-fashioned way the older approach to creating events uses apis inspired by java. the following shows an example with document.createevent(): // create the event. const event = document.createevent('event'); // define that the event name is 'build'. event.
initevent('build', true, true); // listen for the event. elem.addeventlistener('build', function (e) { // e.target matches elem }, false); // target can be any element or other eventtarget. elem.dispatchevent(event); event bubbling it is often desirable to trigger an event from a child element, and have an ancestor catch it; optionally, with data: <form> <textarea></textarea> </form> cons...
DOM onevent handlers - Developer guides
lick="alert(this)"> or window.onload = function() { … }. when discussing the various methods of listening to events: event listener refers to a function or object registered via eventtarget.addeventlistener() event handler refers to a function registered via on… attributes or properties specifications specification status comment html living standardthe def
inition of 'event handlers' in that specification. living standard html5the def
inition of 'event handlers' in that specification. recommendation browser compatibility detecting the presence of event handler properties you can detect the presence of an event handler property with the javascript in operator. for example: if ("onsomenewfeature" in window) { /* do someth...
Using device orientation with 3D transforms - Developer guides
this article provides tips on how to use device orientation information in tandem with css 3d transforms. using orientation to rotate an element the easiest way to convert orientation data to a 3d transform is basically to use the alpha, gamma, and beta values as rotatez, rotatex and rotatey values. ...
HTML5 Parser - Developer guides
nd <!--, you should prevent them from being parsed literally by expressing them as \u003cscript,\u003c/script>, and \u003c!--. the older practice of escaping the string </script> by surrounding it with comment markers, while supported by html5, is problematic in cases where the closing comment marker is omitted (see preceding point). you can avoid such problems by using the character code for the
initial '<' instead. (it is valid to use an escape character, e.g., <\/script>, but this strategy does not work for <script and <!--, because \s and \! are not valid javascript escapes; the character code strategy is more general-purpose.) inline svg and mathml support as a completely new parsing feature, html5 introduced support for inline svg and mathml in text/html. this means that you can now u...
Using HTML sections and outlines - Developer guides
n> <h1>amazing mdn contributors</h1> <ul> <li><img src="link" alt="descriptive text"></li> <li><img src="link" alt="descriptive text"></li> <li><img src="link" alt="descriptive text"></li> </ul> </section> aside element the <aside> element defines related content that has a different placement than the main content. it is often used for call-outs, blockquotes, and def
initions. the <aside> element is often used for sidebars containing extra, but relevant, information. <section> <h1>amazing mdn contributors</h1> <ul> <li><img src="link" alt="descriptive text"></li> <li><img src="link" alt="descriptive text"></li> <li><img src="link" alt="descriptive text"></li> </ul> <aside> <p>to get involved contact</p> </aside> </section>...
A hybrid approach - Developer guides
propriate under different circumstances. the most important concept to remember is that server-side and client-side techniques can be combined to fit your situation. the good responsive web design is great — right now it is the best technique available for making layouts look as good as possible in a variety of circumstances. if your mobile and desktop use cases are similar enough, this is def
initely the preferred option for layout changes. however, it can be a pain to use client-side techniques to alter site content to fit the user’s context. luckily, we aren’t technically constrained to using client-side techniques here: another option is to use server-side user-agent detection to show the user the proper content. this keeps the complexity of altering content on the server side, but...
Mobile-friendliness - Developer guides
“give your users a smooth experience, even on a slow connection.” though things have been getting better in recent years, browsing the internet over a wireless data connection can still be pretty painful. this makes it more essential than ever to practice good performance practices, only sending the user the bits they will actually need. know your audience while not strictly a part of the def
inition of being mobile friendly, defining who your target audience is makes these goals much more concrete. for example, it is absolutely critical to keep in mind which browsers and devices you will target when picking a mobile strategy. if your audience is full of early-adopters, you can focus on tablets and smartphones with standards-friendly browsers. on the other hand, if many of your site’s us...
The Unicode Bidirectional Text Algorithm - Developer guides
lating ranges etc. overiding bidi using unicode control characters unicode provides a number of special control characters that make it possible to control directionality of ranges of text. there are two sets of control characters; one set opens the override, and another restores the original directionality. you must always follow each opening character with an appropriate closing character. ...
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
rs can result in your content being outright unusable by people withcertain vision problems, particularly color blindness. finding the right colors coming up with just the right colors can be tricky, especially without training in art or design. fortunately, there are tools available that can help you. while they can't replace having a good designer helping you make these decisions, they can def
initely get you started. base color the first step is to choose your base color. this is the color that in some way defines your website or the subject matter of the site. just as we associate green with the beverage mountain dew and one might think of the color blue in relationship with the sky or the ocean, choosing an appropriate base color to represent your site is a good place to start. there a...
HTML attribute: minlength - HTML: Hypertext Markup Language
ue is valid. the value will be valid as long as it is either null (empty) or five or more characters long. lime is invalid, lemon is valid. input { border: 2px solid currentcolor; } input:invalid { border: 2px dashed red; } input:invalid:focus { background-image: linear-gradient(pink, lightgreen); } specifications specification status html living standardthe def
inition of 'minlength attribute' in that specification. living standard html 5.1the def
inition of 'minlength attribute' in that specification. recommendation ...
HTML attribute: multiple - HTML: Hypertext Markup Language
cting an item at the top or bottom of the range they want to select using the up and down cursor keys to go up and down the options. the selection of non-contiguous is not as well supported: items should be able to be selected and deselected by pressing space , but support varies between browsers. specifications specification status comment html living standardthe def
inition of 'multiple attribute' in that specification. living standard html5the def
inition of 'multiple 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...
HTML attribute: pattern - HTML: Hypertext Markup Language
ers how to fill out the the control to match the requirements. 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 def
inition of 'pattern' in that specification. living standard html 5.1the def
inition of 'pattern' in that specification. recommendation html5the def
inition of 'pattern' in that specification. recommendation ...
HTML attribute: required - HTML: Hypertext Markup Language
"true" doesn't hurt, in case the browser / screen reader combination does not support required yet. constraint validation if the element is required and the element's value is the empty string, then the element is suffering from valuemissing and the element will match the :invalid pseudo class. specifications specification status comment html living standardthe def
inition of 'required attribute' in that specification. living standard html5the def
inition of 'required attribute' in that specification. recommendation html 5.1the def
inition of 'required attribute' in that specification. recommendation accessibility concerns provide an indication to users informing them the form control is required. ensure the messaging...
HTML attribute: step - HTML: Hypertext Markup Language
alues of 1.2 and greater note: when the data entered by the user doesn't adhere to the stepping configuration, the value is considered invalid in contraint validation and will match the :invalid and :out-of-range pseudoclasses see client-side validation and stepmismatch for more information. specifications specification status comment html living standardthe def
inition of 'step attribute' in that specification. living standard html5the def
inition 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 t...
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
one called "footer navigation". if labels were not provided, the person using screen reading software may have to investigate each nav element's contents to determine their purpose. using the aria-labelledby attribute labeling regions • page structure • w3c wai web accessibility tutorials specifications specification status comment html living standardthe def
inition of '<h1>, <h2>, <h3>, <h4>, <h5>, and <h6>' in that specification. living standard html5the def
inition of '<h1>, <h2>, <h3>, <h4>, <h5>, and <h6>' in that specification. recommendation html 4.01 specificationthe def
inition of '<h1>, <h2>, <h3>, <h4>, <h5>, and <h6>' in that specification. recommendation ...
<a>: The Anchor element - HTML: Hypertext Markup Language
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 tremors and the giant-button-problem specifications specification status comment referrer policythe def
inition of 'referrer attribute' in that specification. candidate recommendation added the referrerpolicy attribute. html living standardthe def
inition of '<a>' in that specification. living standard html5the def
inition of '<a>' in that specification. recommendation html 4.01 specificationthe def
inition of '<a>' in that specification. recommendation ...
<acronym> - HTML: Hypertext Markup Language
owsers not only add a dotted underline, but also put it in small caps; to avoid this styling, adding something like font-variant: none in the css takes care of this case. it is therefore recommended that web authors either explicitly style this element, or accept some cross-browser variation. specifications specification status comment html 4.01 specificationthe def
inition of '<acronym>' in that specification. recommendation 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for a...
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
ed above and below the applet. width this attribute specifies in pixels the width that the applet needs. example html <applet code="game.class" align="left" archive="game.zip" height="250" width="350"> <param name="difficulty" value="easy"> <b>sorry, you need java to play this game.</b> </applet> specifications specification status comment html 5.2the def
inition of '<applet>' in that specification. recommendation html 5.1the def
inition of '<applet>' in that specification. recommendation html5the def
inition of '<applet>' in that specification. recommendation made obsolete html 4.01 specificationthe def
inition of '<applet>' in that specification. recommendation deprecated in favor of <object> ...
<article>: The Article Contents element - HTML: Hypertext Markup Language
<p> posted on <time datetime="2015-05-17 19:00">may 17</time> by tom. </p> </footer> </article> </section> <footer> <p> posted on <time datetime="2015-05-15 19:00">may 15</time> by staff. </p> </footer> </article> specifications specification status comment html living standardthe def
inition of '<article>' in that specification. living standard html 5.1the def
inition of '<article>' in that specification. recommendation html5the def
inition of '<article>' in that specification. recommendation ...
<aside>: The Aside element - HTML: Hypertext Markup Language
his kind of text is considered part of the main flow. examples using <aside> this example uses <aside> to mark up a paragraph in an article. the paragraph is only indirectly related to the main article content: <article> <p> the disney movie <cite>the little mermaid</cite> was first released to theatres in 1989. </p> <aside> <p> the movie earned $87 million during its
initial release. </p> </aside> <p> more info about the movie... </p> </article> specifications specification status comment html living standardthe def
inition of '<aside>' in that specification. living standard html5the def
inition of '<aside>' in that specification. recommendation ...
<b>: The Bring Attention To element - HTML: Hypertext Markup Language
tead in order to make text bold. examples <p> this article describes several <b class="keywords">text-level</b> elements. it explains their usage in an <b class="keywords">html</b> document. </p> keywords are displayed with the default style of the <b>element, likely in bold.</b> result specifications specification status comment html living standardthe def
inition of '<b>' in that specification. living standard html5the def
inition of '<b>' in that specification. recommendation html 4.01 specificationthe def
inition of '<b>' in that specification. recommendation ...
<base>: The Document Base URL element - HTML: Hypertext Markup Language
aph open graph tags do not acknowledge <base>, and should always have full absolute urls. for example: <meta property="og:image" content="https://example.com/thumbnail.jpg"> examples <base href="https://www.example.com/"> <base target="_blank"> <base target="_top" href="https://example.com/"> specifications specification status comment html living standardthe def
inition of '<base>' in that specification. living standard no change since last snapshot. html5the def
inition of '<base>' in that specification. recommendation specified the behavior of target html 4.01 specificationthe def
inition of '<base>' in that specification. recommendation added the target attribute ...
<bdo>: The Bidirectional Text Override element - HTML: Hypertext Markup Language
tion. examples <!-- switch text direction --> <p>this text will go left to right.</p> <p><bdo dir="rtl">this text will go right to left.</bdo></p> result notes the html 4 specification did not specify events for this element; they were added in xhtml. this is most likely an oversight. specifications specification status comment html living standardthe def
inition of '<bdo>' in that specification. living standard html5the def
inition of '<bdo>' in that specification. recommendation html 4.01 specificationthe def
inition of '<bdo>' in that specification. recommendation ...
<blockquote>: The Block Quotation element - HTML: Hypertext Markup Language
of early spring. this is because of the 3d ether space available to the carriers, in contrast to the 1d ether used by ieee802.3. the carriers have an intrinsic collision avoidance system, which increases availability.</p> </blockquote> the output from this html snippet looks like this: specifications specification status comment html living standardthe def
inition of '<blockquote>' in that specification. living standard html5the def
inition of '<blockquote>' in that specification. recommendation html 4.01 specificationthe def
inition of '<blockquote>' in that specification. recommendation ...
<br>: The Line Break element - HTML: Hypertext Markup Language
ust not have an end tag. in xhtml documents, write this element as <br />. permitted parents any element that accepts phrasing content. implicit aria role no corresponding role permitted aria roles none, presentation dom interface htmlbrelement specifications specification status comment html living standardthe def
inition of '<br>' in that specification. living standard html5the def
inition of '<br>' in that specification. recommendation html 4.01 specificationthe def
inition of '<br>' in that specification. recommendation ...
<caption>: The Table Caption element - HTML: Hypertext Markup Language
r2</td> <td>user2@sample.com</td> </tr> </table> caption { caption-side: top; align: right; } table { border-collapse: collapse; border-spacing: 0px; } table, th, td { border: 1px solid black; } table {background: red;} do not alter caption. for that you need display: block. specifications specification status comment html living standardthe def
inition of '<caption>' in that specification. living standard html5the def
inition of '<caption>' in that specification. recommendation html 4.01 specificationthe def
inition of '<caption>' in that specification. recommendation ...
<cite>: The Citation element - HTML: Hypertext Markup Language
t, use the cite attribute on the element. typically, browsers style the contents of a <cite> element in italics by default. to avoid this, apply the css font-style property to the <cite> element. example <p>more information can be found in <cite>[iso-0000]</cite>.</p> the html above outputs: specifications specification status comment html living standardthe def
inition of '<cite>' in that specification. living standard html5the def
inition of '<cite>' in that specification. recommendation html 4.01 specificationthe def
inition of '<cite>' in that specification. recommendation ...
<code>: The Inline Code element - HTML: Hypertext Markup Language
p the <code> element within a <pre> element. the <code> element by itself only represents a single phrase of code or line of code. a css rule can be defined for the code selector to override the browser's default font face. preferences set by the user might take precedence over the specified css. specifications specification status comment html living standardthe def
inition of '<code>' in that specification. living standard html5the def
inition of '<code>' in that specification. recommendation html 4.01 specificationthe def
inition of '<code>' in that specification. recommendation ...
<colgroup> - HTML: Hypertext Markup Language
after this selector the vertical-align property can be used. if the table does use a colspan attribute, the effect can be achieved by combining adequate css attribute selectors like [colspan=n], though this is not trivial. examples please see the <table> page for examples on <colgroup>. specifications specification status comment html living standardthe def
inition of '<colgroup>' in that specification. living standard html5the def
inition of '<colgroup>' in that specification. recommendation html 4.01 specificationthe def
inition of '<colgroup>' in that specification. recommendation ...
<command>: The HTML Command element - HTML: Hypertext Markup Language
ault state and indicates that this is a normal command. checkbox indicates that the command can be toggled using a checkbox. radio indicates that the command can be toggled using a radio button. examples <command type="command" label="save" icon="icons/save.png" onclick="save()"> specifications specification status comment html5the def
inition of '<command>' in that specification. recommendation ...
<data> - HTML: Hypertext Markup Language
ent. examples the following example displays product names but also associates each name with a product number. <p>new products</p> <ul> <li><data value="398">mini ketchup</data></li> <li><data value="399">jumbo ketchup</data></li> <li><data value="400">mega jumbo ketchup</data></li> </ul> specifications specification status comment html living standardthe def
inition of '<data>' in that specification. living standard no change from html5 html5the def
inition of '<data>' in that specification. recommendation
initial def
inition. ...
<del>: The Deleted Text element - HTML: Hypertext Markup Language
sity. because of this, it is important to not abuse this technique and only apply it in situations where not knowing content has been deleted would adversely affect understanding. short note on making your mark (more accessible) | the paciello group tweaking text level styles | adrian roselli specifications specification status comment html living standardthe def
inition of '<del>' in that specification. living standard html5the def
inition of '<del>' in that specification. recommendation html 4.01 specificationthe def
inition of '<del>' in that specification. recommendation ...
<dialog>: The Dialog element - HTML: Hypertext Markup Language
elect(e) { confirmbtn.value = selectel.value; }); // "confirm" button of form triggers "close" on dialog because of [method="dialog"] favdialog.addeventlistener('close', function onclose() { outputbox.value = favdialog.returnvalue + " button clicked - " + (new date()).tostring(); }); result specifications specification status comment html living standardthe def
inition of '<dialog>' in that specification. living standard html 5.2the def
inition of '<dialog>' in that specification. recommendation
initial def
inition ...
<embed>: The Embed External Content element - HTML: Hypertext Markup Language
it contains. the title's value should concisely describe the embedded content. without a title, they may not be able to determine what its embedded content is. this context shift can be confusing and time-consuming, especially if the embed element contains interactive content like video or audio. specifications specification status comment html living standardthe def
inition of '<embed>' in that specification. living standard html5the def
inition of '<embed>' in that specification. recommendation ...
<figcaption>: The Figure Caption element - HTML: Hypertext Markup Language
st child. implicit aria role no corresponding role permitted aria roles group, none, presentation dom interface htmlelement attributes this element only includes the global attributes. examples please see the <figure> page for examples on <figcaption>. specifications specification status comment html living standardthe def
inition of '<figcaption>' in that specification. living standard html5the def
inition of '<figcaption>' in that specification. recommendation ...
<footer> - HTML: Hypertext Markup Language
as an issue where the footer landmark role is not announced in the landmark rotor. to address this, add role="contentinfo" to the footer element. webkit bugzilla: 146930 – ax: html native elements (header, footer, main, aside, nav) should work the same as aria landmarks, sometimes they don't specifications specification status comment html living standardthe def
inition of '<footer>' in that specification. living standard html5the def
inition of '<footer>' in that specification. recommendation ...
<form> - HTML: Hypertext Markup Language
name: <input name="submitted-name" autocomplete="name"> </label> <button>save</button> </form> <!-- form with fieldset, legend, and label --> <form method="post"> <fieldset> <legend>title</legend> <label><input type="radio" name="radio"> select me</label> </fieldset> </form> specifications specification status comment html living standardthe def
inition of '<form>' in that specification. living standard html5the def
inition of '<form>' in that specification. recommendation html 4.01 specificationthe def
inition of '<form>' in that specification. recommendation
initial def
inition ...
<head>: The Document Metadata (Header) element - HTML: Hypertext Markup Language
rofiles, separated by white space. example <!doctype html> <html> <head> <title>document title</title> </head> </html> notes html5-compliant browsers automatically create a <head> element if its tags are omitted in the markup. this auto-creation is not guaranteed in ancient browsers. specifications specification status comment html living standardthe def
inition of '<head>' in that specification. living standard no change from latest shapshot html5the def
inition of '<head>' in that specification. recommendation obsoleted profile html 4.01 specificationthe def
inition of '<head>' in that specification. recommendation ...
<hr>: The Thematic Break (Horizontal Rule) element - HTML: Hypertext Markup Language
the first paragraph of text. this is the first paragraph of text. this is the first paragraph of text. </p> <hr> <p> this is the second paragraph of text. this is the second paragraph of text. this is the second paragraph of text. this is the second paragraph of text. </p> result specifications specification status comment html living standardthe def
inition of '<hr>' in that specification. living standard def
inition of the <hr> element html5the def
inition of '<hr>' in that specification. recommendation html 4.01 specificationthe def
inition of '<hr>' in that specification. recommendation the align, noshade, size, and width attributes are deprecated ...
manifest - HTML: Hypertext Markup Language
downloaded in the early stages of page load. note: manifest-based caching mechanism has been deprecated. use service workers instead. the manifest attribute has only effect during early stages of page load, thus changing it via regular dom interfaces has no effect, window.applicationcache interface instead. specifications specification status comment html5the def
inition of '<html> manifest attribute' in that specification. recommendation added support for the manifest attribute and deprecated it later ...
<input type="email"> - HTML: Hypertext Markup Language
efaultemails" size="64" maxlength="256" multiple> <datalist id="defaultemails"> <option value="jbond007@mi6.defence.gov.uk"> <option value="jbourne@unknown.net"> <option value="nfury@shield.org"> <option value="tony@starkindustries.com"> <option value="hulk@grrrrrrrr.arg"> </datalist> specifications specification status comment html living standardthe def
inition of '<input type="email">' in that specification. living standard
initial def
inition html 5.1the def
inition of '<input type="email">' in that specification. recommendation
initial def
inition ...
<input type="file"> - HTML: Hypertext Markup Language
turnfilesize(number) { if(number < 1024) { return number + 'bytes'; } else if(number >= 1024 && number < 1048576) { return (number/1024).tofixed(1) + 'kb'; } else if(number >= 1048576) { return (number/1048576).tofixed(1) + 'mb'; } } the example looks like this; have a play: specifications specification status comment html living standardthe def
inition of '<input type="file">' in that specification. living standard
initial def
inition html 5.1the def
inition of '<input type="file">' in that specification. recommendation
initial def
inition html media capturethe def
inition of 'capture attribute' in that specification. recommendation
initial capture attribute ...
<input type="radio"> - HTML: Hypertext Markup Language
owsers, and some do not support it at all. the differences are smaller in the newest browsers. notice that when clicking on a radio button, there's a nice, smooth fade out/in effect as the two buttons change state. in addition, the style and coloring of the legend and submit button are customized to have strong contrast. this might not be a look you'd want in a real web application, but it def
initely shows off the possibilities. specifications specification status html living standardthe def
inition of '<input type="radio">' in that specification. living standard html5the def
inition of '<input type="radio">' in that specification. recommendation ...
<input type="range"> - HTML: Hypertext Markup Language
pe of range, changing the writing mode from the default to bt-lr, or bottom-to-top and left-to-right, for edge and internet explorer, and add -webkit-appearance: slider-vertical for all -webkit-based browsers: input[type="range"] { writing-mode: bt-lr; -webkit-appearance: slider-vertical; } specifications specification status comment html living standardthe def
inition of '<input type="range">' in that specification. living standard
initial def
inition html 5.1the def
inition of '<input type="range">' in that specification. recommendation
initial def
inition ...
<input type="submit"> - HTML: Hypertext Markup Language
dation submit buttons don't participate in constraint validation; they have no real value to be constrained. examples we've included simple examples above. there isn't really anything more to say about submit buttons. there's a reason this kind of control is sometimes called a "simple button." specifications specification status comments html living standardthe def
inition of '<input type="submit">' in that specification. living standard html5the def
inition of '<input type="submit">' in that specification. recommendation ...
<input type="tel"> - HTML: Hypertext Markup Language
input[type="number"] { width: 100px; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; color: #8b0000; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; color: #009000; } specifications specification status comment html living standardthe def
inition of '<input type="tel">' in that specification. living standard
initial def
inition html 5.1the def
inition of '<input type="tel">' in that specification. recommendation
initial def
inition ...
<input type="text"> - HTML: Hypertext Markup Language
e; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } this renders like so: examples you can see good examples of text inputs used in context in our your first html form and how to structure an html form articles. specifications specification status comment html living standardthe def
inition of '<input type="text">' in that specification. living standard
initial def
inition html 5.1the def
inition of '<input type="text">' in that specification. recommendation
initial def
inition ...
<input type="url"> - HTML: Hypertext Markup Language
helpful error messages there to aid you in solving the problem. examples there's not much else to say about url type inputs; check the pattern validation and using url inputs sections for numerous examples. you can also find our pattern validation example on github (see it running live also). specifications specification status comment html living standardthe def
inition of '<input type="url">' in that specification. living standard
initial def
inition html 5.1the def
inition of '<input type="url">' in that specification. recommendation
initial def
inition urlthe def
inition of 'url syntax' in that specification. living standard living standard ...
<ins> - HTML: Hypertext Markup Language
ity. because of this, it is important to not abuse this technique and only apply it in situations where not knowing content has been inserted would adversely affect understanding. short note on making your mark (more accessible) | the paciello group tweaking text level styles | adrian roselli specifications specification status comment html living standardthe def
inition of '<ins>' in that specification. living standard html5the def
inition of '<ins>' in that specification. recommendation html 4.01 specificationthe def
inition of '<ins>' in that specification. recommendation ...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
nt permitted parents any element that accepts metadata elements. if itemprop is present: any element that accepts phrasing content. implicit aria role link with href attribute permitted aria roles no role permitted dom interface htmllinkelement specifications specification status comment html living standardthe def
inition of '<link>' in that specification. living standard no changes from latest snapshot html5the def
inition of '<link>' in that specification. recommendation added crossorigin and sizes attributes; extended values of media to any media queries; added numerous new values for rel. html 4.01 specificationthe def
inition of '<link>' in that specification. recommendation ...
<main> - HTML: Hypertext Markup Language
im: "skip navigation" links reader mode browser reader mode functionality looks for the presence of the <main> element, as well as heading and content sectioning elements when converting content into a specialized reader view. building websites for safari reader mode and other reading apps. specifications specification status comment html living standardthe def
inition of '<main>' in that specification. living standard html 5.1the def
inition of '<main>' in that specification. recommendation no change from html5. html5the def
inition of '<main>' in that specification. recommendation
initial def
inition. ...
<map> - HTML: Hypertext Markup Language
map="#primary" src="https://udn.realityripple.com/samples/6a/7e559101b3.png" alt="350 x 150 pic"> result expected live example output the live example above should appear similar to the following images (when using your keyboard tab key): for the left.html link: for the right.html link specifications specification status comment html living standardthe def
inition of '<map>' in that specification. living standard html5the def
inition of '<map>' in that specification. recommendation html 4.01 specificationthe def
inition of '<map>' in that specification. recommendation
initial def
inition ...
<mark>: The Mark Text element - HTML: Hypertext Markup Language
. because of this, it is important to not abuse this technique and only apply it in situations where not knowing content has been highlighted would adversely affect understanding. short note on making your mark (more accessible) | the paciello group tweaking text level styles | adrian roselli specifications specification status comment html living standardthe def
inition of '<mark>' in that specification. living standard html5the def
inition of '<mark>' in that specification. recommendation ...
<menuitem> - HTML: Hypertext Markup Language
commands don't render their contents. </menuitem> <hr> <menuitem type="radio" radiogroup="group1">radio button 1</menuitem> <menuitem type="radio" radiogroup="group1">radio button 2</menuitem> </menu> css content div { width: 300px; height: 80px; background-color: lightgreen; } result specifications specification status comment html 5.2the def
inition of '<menuitem>' in that specification. recommendation snapshot of the html living standard, made obsolete. html 5.1the def
inition of '<menuitem>' in that specification. recommendation snapshot of the html living standard,
initial def
inition. ...
<span> - HTML: Hypertext Markup Language
nt) attributes this element only includes the global attributes. example example 1 html <p><span>some text</span></p> result example 2 html <li><span> <a href="portfolio.html" target="_blank">see my portfolio</a> </span></li> css li span { background: gold; } result specifications specification status comment html living standardthe def
inition of '<span>' in that specification. living standard html5the def
inition of '<span>' in that specification. recommendation the dom interface is now htmlspanelement. html 4.01 specificationthe def
inition of '<span>' in that specification. recommendation ...
<strike> - HTML: Hypertext Markup Language
e <del> instead. in all other cases use <s>. dom interface htmlelement attributes this element includes the global attributes. example <strike>: <strike>today's special: salmon</strike> sold out<br /> <s>: <s>today's special: salmon</s> sold out the result of this code is: specifications specification status comment html5the def
inition of '<strike>' in that specification. recommendation make obsolete in favor of <del> and <s>. html 4.01 specificationthe def
inition of '<strike>' in that specification. recommendation make deprecated in favor of <del> and <s>. ...
<strong>: The Strong Importance element - HTML: Hypertext Markup Language
r stress emphasis, respectively. examples basic example <p>before proceeding, <strong>make sure you put on your safety goggles</strong>.</p> the resulting output: labeling warnings <p><strong>important:</strong> before proceeding, make sure you add plenty of butter.</p> this results in: specifications specification status comment html living standardthe def
inition of '<strong>' in that specification. living standard html5the def
inition of '<strong>' in that specification. recommendation html 4.01 specificationthe def
inition of '<strong>' in that specification. recommendation ...
<style>: The Style Information element - HTML: Hypertext Markup Language
ribute, that is text/css. tag omission neither tag is omissible. permitted parents any element that accepts metadata content. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlstyleelement specifications specification status comment html living standardthe def
inition of 'style' in that specification. living standard html5the def
inition of 'style' in that specification. recommendation the type attribute becomes optional. html 4.01 specificationthe def
inition of 'style' in that specification. recommendation ...
<sub>: The Subscript element - HTML: Hypertext Markup Language
ted number; in the case of water, the subscripted "2" indicates that there are two atoms of hydrogen in the molecule. another example: <p>almost every developer's favorite molecule is c<sub>8</sub>h<sub>10</sub>n<sub>4</sub>o<sub>2</sub>, which is commonly known as "caffeine."</p> the output: specifications specification status comment html living standardthe def
inition of '<sub> and <sup>' in that specification. living standard html5the def
inition of '<sub> and <sup>;' in that specification. recommendation ...
<summary>: The Disclosure Summary element - HTML: Hypertext Markup Language
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 specification status comment html living standardthe def
inition of '<summary>' in that specification. living standard html 5.1the def
inition of '<summary>' in that specification. recommendation
initial def
inition ...
<table>: The Table element - HTML: Hypertext Markup Language
ith the header(s) the cell is associated with. mdn tables for visually impaired users tables with multi-level headers • tables • w3c wai web accessibility tutorials h43: using id and headers attributes to associate data cells with header cells in data tables | techniques for w3c wcag 2.0 specifications specification status comment html living standardthe def
inition of 'table element' in that specification. living standard html5the def
inition of 'table element' in that specification. recommendation ...
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
e text in the cell. and top: positions the text near the top of the cell. to achieve a similar effect, use the css vertical-align property. width this attribute is used to define a recommended cell width. use the css width property instead. examples see <table> for examples on <td>. specifications specification status comment html living standardthe def
inition of 'td element' in that specification. living standard html5the def
inition of 'td element' in that specification. recommendation ...
<template>: The Content Template element - HTML: Hypertext Markup Language
clickhandler); container.appendchild(secondclone); result firstclone is a documentfragment instance, so while it gets appended inside the container as expected, clicking on it does not trigger the click event. secondclone is an htmldivelement instance, clicking on it works as one would expect. specifications specification status comment html living standardthe def
inition of 'template element' in that specification. living standard html5the def
inition of 'template element' in that specification. recommendation
initial def
inition ...
<textarea> - HTML: Hypertext Markup Language
text tag omission none, both the starting and ending tag are mandatory. permitted parents any element that accepts phrasing content. implicit aria role textbox permitted aria roles no role permitted dom interface htmltextareaelement specifications specification status comment html living standardthe def
inition of '<textarea>' in that specification. living standard html5the def
inition of '<textarea>' in that specification. recommendation html 4.01 specificationthe def
inition of '<textarea>' in that specification. recommendation browser compatibility the compatibility table in this page is generated from structured data. if you'd like to contribute to the...
<tfoot>: The Table Foot element - HTML: Hypertext Markup Language
nd top, which will put the text as close to the top of the cell as it is possible. note: do not use this attribute as it is obsolete (and not supported) in the latest standard: instead set the css vertical-align property on it. examples please see the <table> page for examples on <tfoot>. specifications specification status comment html living standardthe def
inition of 'tfoot element' in that specification. living standard html5the def
inition of 'tfoot element' in that specification. recommendation ...
<th> - HTML: Hypertext Markup Language
can also create extra width. but, if a column's width is too narrow to show a particular cell properly, it will be widened when displayed. note: do not use this attribute as it is obsolete in the latest standard: use the css width property instead. examples see <table> for examples on <th>. specifications specification status comment html living standardthe def
inition of 'th element' in that specification. living standard html5the def
inition of 'th element' in that specification. recommendation ...
<thead>: The Table Head element - HTML: Hypertext Markup Language
ext in the cell; top, which will put the text as close to the top of the cell as it is possible. note: do not use this attribute as it is obsolete (and not supported) in the latest standard: instead set the css vertical-align property on it. examples see <table> for examples on <thead>. specifications specification status comment html living standardthe def
inition of 'thead element' in that specification. living standard html5the def
inition of 'thead element' in that specification. recommendation ...
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
"oz"> <track kind="metadata" src="keystage1.vtt" srclang="en" label="key stage 1"> <track kind="metadata" src="keystage2.vtt" srclang="en" label="key stage 2"> <track kind="metadata" src="keystage3.vtt" srclang="en" label="key stage 3"> <!-- fallback --> ... </video> specifications specification status comment html living standardthe def
inition of 'track element' in that specification. living standard html5the def
inition of 'track element' in that specification. recommendation
initial def
inition ...
<tt>: The Teletype Text element (obsolete) - HTML: Hypertext Markup Language
le overriding the default font above. user-configured changes to the default monospace font setting may take precedence over your css. although this element wasn't officially deprecated in html 4.01, its use was discouraged in favor of the semantic elements and/or css. the <tt> element is obsolete in html 5. specifications specification status comment html5the def
inition of '<tt>' in that specification. recommendation html 4.01 specificationthe def
inition of '<tt>' in that specification. recommendation ...
Preloading content with rel="preload" - HTML: Hypertext Markup Language
o work out a priority for the items (as didn't exist back then), so they all got fetched with fairly low priority. there are a number of script-based resource loaders out there, but they don't have any power over the browser's fetch prioritization queue, and are subject to much the same performance problems. specifications specification status comment preloadthe def
inition of 'preload' in that specification. candidate recommendation further details of preload. html living standardthe def
inition of 'rel=preload' in that specification. living standard def
inition of rel=preload. ...
Choosing between www and non-www URLs - HTTP
this domain name is hosted on a server where the document resides. a server isn't necessarily a physical machine: several servers can reside on the same physical machine. or, one server can be handled by several machines, cooperating to produce the answer or balancing the load of the requests between them. ...
MIME types (IANA media types) - HTTP
s strict parsing rules, <![cdata[…]]> sections, or elements that aren't from html/svg/mathml namespaces. text/javascript per the html specification, javascript files should always be served using the mime type text/javascript. no other values are considered valid, and using any of those may result in scripts that do not load or run. ...
HTTP caching - HTTP
ses and is therefore not a reliable replacement for the general http/1.1 cache-control header, although it does behave the same as cache-control: no-cache, if the cache-control header field is omitted in a request. use pragma only for backwards compatibility with http/1.0 clients. freshness once a resource is stored in a cache, it could theoretically be served by the cache forever. caches have f
inite storage so items are periodically removed from storage. this process is called cache eviction. on the other side, some resources may change on the server so the cache should be updated. as http is a client-server protocol, servers can't contact caches and clients when a resource changes; they have to communicate an expiration time for the resource. before this expiration time, the resource is fr...
Compression in HTTP - HTTP
the required quality. there are numerous tools that are specialized for this. lossy compression algorithms are usually more efficient than loss-less ones. as compression works better on a specific kind of files, it usually provides nothing to compress them a second time. in fact, this is often counter productive as the cost of the overhead (algorithms usually need a dictionary that add to the
initial size) can be higher than the extra gain in compression resulting in a larger file. do not use the two following techniques for files in a compressed format. end-to-end compression for compression, end-to-end compression is where the largest performance improvements of web sites reside. end-to-end compression refers to a compression of the body of a message that is done by the server and wil...
List of default Accept values - HTTP
this article documents the default values for the http accept header for specific inputs and browser versions. default values these are the values sent when the context doesn't give better information. note that all browsers add the */* mime type to cover all cases. this is typically used for requests
initiated via the address bar of a browser, or via an html <a> element. user agent value comment firefox text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 (since firefox 66) text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 (in firefox 65) text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 (before) in firefox 65 and earlier, this value can be modified using the network.http.accept.
Content negotiation - HTTP
video, or a script: it is different when fetching a document entered in the address bar or an element linked via an <img>, <video> or <audio> element. browsers are free to use the value of the header that they think is the most adequate; an exhaustive list of default values for common browsers is available. the accept-ch header this is part of an experimental technology called client hints.
initial support is in chrome 46 or later. the device-memory value is in chrome 61 or later. the experimental accept-ch lists configuration data that can be used by the server to select an appropriate response. valid values are: value meaning device-memory indicates the approximate amount of device ram. this value is an approximation given by rounding to the nearest power...
Using HTTP cookies - HTTP
set-cookie header in various server-side applications: php node.js python ruby on rails define the lifetime of a cookie the lifetime of a cookie can be defined in two ways: session cookies are deleted when the current session ends. the browser defines when the "current session" ends, and some browsers use session restoring when restarting, which can cause session cookies to last indef
initely long. permanent cookies are deleted at a date specified by the expires attribute, or after a period of time specified by the max-age attribute. for example: set-cookie: id=a3fwa; expires=wed, 31 oct 2021 07:28:00 gmt; note: when an expires date is set, the time and date set is relative to the client the cookie is being set on, not the server. if your site authenticates users, it should...
Access-Control-Allow-Methods - HTTP
l wildcard value for requests without credentials (requests without http cookies or http authentication information). in requests with credentials, it is treated as the literal method name "*" without special semantics. examples access-control-allow-methods: post, get, options access-control-allow-methods: * specifications specification status comment fetchthe def
inition of 'access-control-allow-methods' in that specification. living standard
initial def
inition ...
Access-Control-Max-Age - HTTP
(600 seconds). chromium (starting in v76) caps at 2 hours (7200 seconds). chromium also specifies a default value of 5 seconds. a value of -1 will disable caching, requiring a preflight options check for all calls. examples cache results of a preflight request for 10 minutes: access-control-max-age: 600 specifications specification status comment fetchthe def
inition of 'access-control-max-age' in that specification. living standard
initial def
inition. ...
Access-Control-Request-Method - HTTP
use the same method as the actual request. header type request header forbidden header name yes syntax access-control-request-method: <method> directives <method> one of the http request methods, for example get, post, or delete. examples access-control-request-method: post specifications specification status comment fetchthe def
inition of 'access-control-request-method' in that specification. living standard
initial def
inition. ...
CSP: report-uri - HTTP
file is deleted:\n\n" . $log_file; mail($email_address, $email_subject, $message, 'content-type: text/plain;charset=utf-8'); } else if (filesize($log_file) > $log_file_size_limit) { exit(0); } file_put_contents($log_file, $json_data, file_append | lock_ex); } specifications specification status comment content security policy level 3the def
inition of 'report-uri' in that specification. working draft no changes. content security policy level 2the def
inition of 'report-uri' in that specification. recommendation
initial def
inition. ...
Content-Security-Policy - HTTP
irectives navigation directives govern to which locations a user can navigate or submit a form, for example. form-action restricts the urls which can be used as the target of a form submissions from a given context. frame-ancestors specifies valid parents that may embed a page using <frame>, <iframe>, <object>, <embed>, or <applet>. navigate-to restricts the urls to which a document can
initiate navigation by any means, including <form> (if form-action is not specified), <a>, window.location, window.open, etc. reporting directives reporting directives control the reporting process of csp violations. see also the content-security-policy-report-only header. report-uri instructs the user agent to report attempts to violate the content security policy. these violation reports con...
Forwarded - HTTP
address (v4 or v6, optionally with a port, and ipv6 quoted and enclosed in square brackets), an obfuscated identifier (such as "_hidden" or "_secret"), or "unknown" when the preceding entity is not known (and you still want to indicate that forwarding of the request was made). by=<identifier> the interface where the request came in to the proxy server. for=<identifier> the client that
initiated the request and subsequent proxies in a chain of proxies. host=<host> the host request header field as received by the proxy. proto=<http|https> indicates which protocol was used to make the request (typically "http" or "https"). examples using the forwarded header forwarded: for="_mdn" # case insensitive forwarded: for="[2001:db8:cafe::17]:4711" # separated by semicolon forwar...
Index - HTTP
t. there are three main cases this header is used: 97 sec-websocket-accept draft, http, needscompattable, needscontent, reference, sec-websocket-accept, websockets, header the sec-websocket-accept header is used in the websocket opening handshake. it would appear in the response headers. that is, this is header is sent from server to client to inform that server is willing to
initiate a websocket connection. 98 server http, reference, header the server header contains information about the software used by the origin server to handle the request. 99 server-timing http, performance, reference, header the server-timing header communicates one or more metrics and descriptions for a given request-response cycle. it is used to surface a...
Link - HTTP
le links separated by commas, for example: link: <https://one.example.com>; rel="preconnect", <https://two.example.com>; rel="preconnect", <https://three.example.com>; rel="preconnect" specifications specification status comments rfc 8288, section 3: link serialisation in http headers ietf rfc rfc 5988, section 5: the link header field ietf rfc
initial def
inition ...
Origin - HTTP
rver (for virtual hosting) or the ip. <port> optional tcp port number on which the server is listening. if no port is given, the default port for the service requested (e.g., "80" for an http url) is implied. examples origin: https://developer.mozilla.org specifications specification comment rfc 6454, section 7: origin the web origin concept fetchthe def
inition of 'origin header' in that specification. supplants the origin header as defined in rfc6454. ...
Sec-Fetch-Site - HTTP
the sec-fetch-site fetch metadata header indicates the relationship between a request
initiator's origin and the origin of the resource. header type fetch metadata request header forbidden header name yes, since it has prefix sec- cors-safelisted response header cors-safelisted request header syntax sec-fetch-site: cross-site sec-fetch-site: same-origin sec-fetch-site: same-site sec-fetch-site: none values cross-site same-origin same-site none this request does not relate to any context like site, origin, or frame. this can happen when user had
initiated this request by, e.g. directly entering a url in the address bar, opening a bookmark, or draging-and-dropping a file into the browser window. examples todo specif...
Sec-WebSocket-Accept - HTTP
the sec-websocket-accept header is used in the websocket opening handshake. it would appear in the response headers. that is, this is header is sent from server to client to inform that server is willing to
initiate a websocket connection. header type response header forbidden header name no syntax sec-websocket-accept: <hashed key> directives <hashed key> the server takes the value of the sec-websocket-key sent in the handshake request, appends 258eafa5-e914-47da-95ca-c5ab0dc85b11, takes sha-1 of the new value, and is then base64 encoded. examples sec-websocket-accept: s3pplmbitxaq9kygzzhzrbk+xoo= specification specification title rfc 6455, section 11.3.3: sec-websocket-accept the websocket protocol ...
Server-Timing - HTTP
tools to automatically collect and process metrics from javascript. this interface is restricted to the same origin, but you can use the timing-allow-origin header to specify the domains that are allowed to access the server metrics. the interface is only available in secure contexts (https) in some browsers. specifications specification status title server timingthe def
inition of 'server-timing header field' in that specification. working draft
initial def
inition. ...
SameSite cookies - HTTP
the samesite attribute of the set-cookie http response header allows you to declare if your cookie should be restricted to a first-party or same-site context. values the samesite attribute accepts three values: lax cookies are allowed to be sent with top-level navigations and will be sent along with get request
initiated by third party website. this is the default value in modern browsers. strict cookies will only be sent in a first-party context and not be sent along with requests
initiated by third party websites. none cookies will be sent in all contexts, i.e sending cross-origin is allowed. none used to be the default value, but recent browser versions made lax the default value to have reasonably robust defense against some classes of cross-site request forgery (csrf) attacks. ...
Set-Cookie - HTTP
the entire mechanism is inherently insecure and doesn't encrypt any information.) note: insecure sites (http:) can't set cookies with the secure attribute (since chrome 52 and firefox 52). httponly optional forbids javascript from accessing the cookie, for example, through the document.cookie property. note that a cookie that has been created with httponly will still be sent with javascript-
initiated requests, e.g. when calling xmlhttprequest.send() or fetch(). this mitigates attacks against cross-site scripting (xss). samesite=<samesite-value> optional strict: the browser sends the cookie only for same-site requests (that is, requests originating from the same site that set the cookie). if the request originated from a different url than the current one, no cookies with the sames...
Timing-Allow-Origin - HTTP
y see the timing resources. you can specify multiple origins, separated by commas. examples to allow any resource to see timing resources: timing-allow-origin: * to allow https://developer.mozilla.org to see timing resources, you can specify: timing-allow-origin: https://developer.mozilla.org specifications specification status comment resource timing level 3the def
inition of 'timing-allow-origin' in that specification. editor's draft
initial def
inition. ...
Tk - HTTP
ct a tracking preference received from the requesting user agent. u updated. the request resulted in a potential change to the tracking status applicable to this user, user agent, or device. examples a tk header for a resource that claims not to be tracking would look like: tk: n specifications specification status comment tracking preference expression (dnt)the def
inition of 'tk header field' in that specification. obsolete
initial def
inition. ...
Upgrade-Insecure-Requests - HTTP
host: example.com upgrade-insecure-requests: 1 the server can now redirect to a secure version of the site. a vary header can be used so that the site isn't served by caches to clients that don’t support the upgrade mechanism. location: https://example.com/ vary: upgrade-insecure-requests specifications specification status comment upgrade insecure requeststhe def
inition of 'upgrade-insecure-requests' in that specification. candidate recommendation
initial def
inition. ...
X-Content-Type-Options - HTTP
t a javascript mime type enables cross-origin read blocking (corb) protection for the mime-types: text/html text/plain text/json, application/json or any other type with a json extension: */*+json text/xml, application/xml or any other type with an xml extension: */*+xml (excluding image/svg+xml) specifications specification status comment fetchthe def
inition of 'x-content-type-options def
inition' in that specification. living standard
initial def
inition ...
HTTP headers - HTTP
c public key with a certain web server to decrease the risk of mitm attacks with forged certificates. public-key-pins-report-only sends reports to the report-uri specified in the header and does still allow clients to connect to the server even if the pinning is violated. fetch metadata request headers sec-fetch-site it is a request header that indicates the relationship between a request
initiator's origin and its target's origin. it is a structured header whose value is a token with possible values cross-site, same-origin, same-site, and none. sec-fetch-mode it is a request header that indicates the request's mode to a server. it is a structured header whose value is a token with possible values cors, navigate, nested-navigate, no-cors, same-origin, and websocket. sec-fetch-user ...
HTTP Messages - HTTP
e request (like content of an html form), or the document associated with a response. the presence of the body and its size is specified by the start-line and http headers. the start-line and http headers of the http message are collectively known as the head of the requests, whereas its payload is known as the body. http requests start line http requests are messages sent by the client to
initiate an action on the server. their start-line contain three elements: an http method, a verb (like get, put or post) or a noun (like head or options), that describes the action to be performed. for example, get indicates that a resource should be fetched or post means that data is pushed to the server (creating or modifying a resource, or generating a temporary document to send back). the req...
Redirections in HTTP - HTTP
ere is not even a transmitted page. html redirects (<meta>) execute if there weren't any http redirects. javascript redirects execute last, and only if javascript is enabled. when possible, use http redirects and don't add <meta> element redirects. if someone changes the http redirects but forgets to change the html redirects, the redirects will no longer be identical, which could cause an inf
inite loop or other nightmares. use cases there are numerous use cases for redirects, but as performance is impacted with every redirect, their use should be kept to a minimum. domain aliasing ideally, there is one location, and therefore one url, for each resource. but there are reasons for alternative names for a resource: expanding the reach of your site a common case is when a site resides...
HTTP resources and specifications - HTTP
/2 on the standard track rfc 7838 http alternative services on the standard track rfc 7301 transport layer security (tls) application-layer protocol negotiation extension used to negotiate http/2 at the transport to save an extra request/response round trip. proposed standard rfc 6454 the web origin concept proposed standard fetchthe def
inition of 'cors' in that specification. cross-origin resource sharing living standard rfc 7034 http header field x-frame-options informational rfc 6797 http strict transport security (hsts) proposed standard upgrade insecure requests upgrade insecure requests candidate recommendation content security policy 1.0 content security policy 1.0...
A typical HTTP session - HTTP
ding a status code and appropriate data. as of http/1.1, the connection is no longer closed after completing the third phase, and the client is now granted a further request: this means the second and third phases can now be performed any number of times. establishing a connection in client-server protocols, it is the client which establishes the connection. opening a connection in http means
initiating a connection in the underlying transport layer, usually this is tcp. with tcp the default port, for an http server on a computer, is port 80. other ports can also be used, like 8000 or 8080. the url of a page to fetch contains both the domain name, and the port number, though the latter can be omitted if it is 80. see identifying resources on the web for more details. note: the client-ser...
100 Continue - HTTP
the http 100 continue informational status response code indicates that everything so far is ok and that the client should continue with the request or ignore it if it is already finished. to have a server check the request's headers, a client must send expect: 100-continue as a header in its
initial request and receive a 100 continue status code in response before sending the body. status 100 continue specifications specification title rfc 7231, section 6.2.1: 100 continue hypertext transfer protocol (http/1.1): semantics and content ...
103 Early Hints - HTTP
the http 103 early hints information response status code is primarily intended to be used with the link header to allow the user agent to start preloading resources while the server is still preparing a response. syntax 103 early hints specifications specification status comments rfc 8297: 103 early hints ietf rfc
initial def
inition 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. no compatibility data found. please contribute data for "http.status.103" (depth: 1) to the mdn compatibility data repository. ...
301 Moved Permanently - HTTP
a browser redirects to this page and search engines update their links to the resource (in 'seo-speak', it is said that the 'link-juice' is sent to the new url). even if the specification requires the method (and the body) not to be altered when the redirection is performed, not all user-agents align with it - you can still find this type of bugged software out there. ...
308 Permanent Redirect - HTTP
a browser redirects to this page and search engines update their links to the resource (in 'seo-speak', it is said that the 'link-juice' is sent to the new url). the request method and the body will not be altered, whereas 301 may incorrectly sometimes be changed to a get method. note: some web applications may use the 308 permanent redirect in a non-standard way and for other purposes. ...
508 Loop Detected - HTTP
the hypertext transfer protocol (http) 508 loop detected response status code may be given in the context of the web distributed authoring and versioning (webdav) protocol. it indicates that the server terminated an operation because it encountered an inf
inite loop while processing a request with "depth: inf
inity". this status indicates that the entire operation failed. status 508 loop detected specifications specification title rfc 5842, section 7.2: 508 loop detected web distributed authoring and versioning ...
CSS Houdini
api an api exposing the css parser more directly, for parsing arbitrary css-like languages into a mildly typed representation. no guide or reference has currently been written for this api. css properties and values api defines an api for registering new css properties. properties registered using this api are provided with a parse syntax that defines a type, inheritance behaviour, and an
initial value. css properties and values api reference css properties and values api guide css typed om converting cssom value strings into meaningfully typed javascript representations and back can incur a significant performance overhead. the css typed om exposes css values as typed javascript objects to allow their performant manipulation. css typed om reference css typed om guide css ...
About JavaScript - JavaScript
anguage constructs, such as if statements, for and while loops, and switch and try ... catch blocks function the same as in these languages (or nearly so). javascript can function as both a procedural and an object oriented language. objects are created programmatically in javascript, by attaching methods and properties to otherwise empty objects at run time, as opposed to the syntactic class def
initions common in compiled languages like c++ and java. once an object has been constructed it can be used as a blueprint (or prototype) for creating similar objects. javascript's dynamic capabilities include runtime object construction, variable parameter lists, function variables, dynamic script creation (via eval), object introspection (via for ... in), and source code recovery (javascript progra...
Enumerability and ownership of properties - JavaScript
enumerable properties show up in for...in loops unless the property's key is a symbol. ownership of properties is determined by whether the property belongs to the object directly and not to its prototype chain. properties of an object can also be retrieved in total. ...
Expressions and operators - JavaScript
n arithmetic operator takes numerical values (either literals or variables) as their operands and returns a single numerical value. the standard arithmetic operators are addition (+), subtraction (-), multiplication (*), and division (/). these operators work as they do in most other programming languages when used with floating point numbers (in particular, note that division by zero produces inf
inity). 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 return...
Meta programming - JavaScript
because reflect.defineproperty returns a boolean success status, you can just use an if...else block here: if (reflect.defineproperty(target, property, attributes)) { // success ...
while - JavaScript
iteration, the loop increments n and adds it to x. therefore, x and n take on the following values: after the first pass: n = 1 and x = 1 after the second pass: n = 2 and x = 3 after the third pass: n = 3 and x = 6 after completing the third pass, the condition n < 3 is no longer true, so the loop terminates. specifications specification ecmascript (ecma-262)the def
inition of 'while statement' in that specification. ...
with - JavaScript
math object is the default object. the statements following the with statement refer to the pi property and the cos and sin methods, without specifying an object. javascript assumes the math object for these references. var a, x, y; var r = 10; with (math) { a = pi * r * r; x = r * cos(pi); y = r * sin(pi / 2); } specifications specification ecmascript (ecma-262)the def
inition of 'with statement' in that specification. ...
Transitioning to strict mode - JavaScript
d and null). in strict mode, the value is passed directly without conversion or replacement. arguments doesn't alias named function arguments in non-strict mode, modifying a value in the arguments object modifies the corresponding named argument. this made optimizations complicated for javascript engine and made code harder to read/understand. in strict mode, the arguments object is created and
initialized with the same values than the named arguments, but changes to either the arguments object or the named arguments aren't reflected in one another. change to eval in strict mode code, eval doesn't create a new variable in the scope from which it was called. also, of course, in strict mode, the string is evaluated with strict mode rules. thorough testing will need to be performed to make su...
categories - Web app manifests
free to ignore them. note: categories values are lower-cased by the stores and catalogs before processing, so "news" and "news" are treated as the same value. developers are encouraged to use lower case in the first place. example "categories": ["books", "education", "medical"] specification specification status comment feedback web app manifestthe def
inition of 'categories' in that specification. working draft
initial def
inition. web app manifest working group drafts ...
display - Web app manifests
of ui elements for controlling navigation. the elements will vary by browser. browser browser the application opens in a conventional browser tab or new window, depending on the browser and platform. this is the default. (none) example "display": "standalone" specification specification status comment feedback web app manifestthe def
inition of 'display' in that specification. working draft
initial def
inition. web app manifest working group drafts ...
iarc_rating_id - Web app manifests
e for. note: the same code can be shared across multiple participating storefronts, as long as the distributed product remains the same (i.e., doesn’t serve totally different code paths on different storefronts). examples "iarc_rating_id": "e84b072d-71b3-4d3e-86ae-31a8ce4e53b7" specification specification status comment feedback web app manifestthe def
inition of 'iarc_rating_id' in that specification. working draft
initial def
inition. web app manifest working group drafts ...
lang - Web app manifests
e string mandatory no the lang member is a string containing a single language tag. it specifies the primary language for the values of the manifest's directionality-capable members, and together with dir determines their directionality. examples "lang": "en-us" specification specification status comment feedback web app manifestthe def
inition of 'lang' in that specification. working draft
initial def
inition. web app manifest working group drafts ...
name - Web app manifests
t can be displayed left-to-right or right-to-left based on the values of the dir and lang manifest members. examples simple name in left-to-right language: "name": "awesome application" right-to-left name in arabic: "dir": "rtl", "lang": "ar", "name": "!أنا من التطبيق" specification specification status comment feedback web app manifestthe def
inition of 'name' in that specification. working draft
initial def
inition. web app manifest working group drafts ...
orientation - Web app manifests
ation can be changed at runtime via the screen orientation api. values orientation can take one of the following values: any natural landscape landscape-primary landscape-secondary portrait portrait-primary portrait-secondary examples "orientation": "portrait-primary" specification specification status comment feedback web app manifestthe def
inition of 'orientation' in that specification. working draft
initial def
inition. web app manifest working group drafts ...
prefer_related_applications - Web app manifests
er the web application. if the prefer_related_applications member is set to true, the user agent might suggest installing one of the related applications instead of this web app. if omitted, prefer_related_applications defaults to false. examples "prefer_related_applications": true specification specification status comment feedback web app manifestthe def
inition of 'prefer_related_applications' in that specification. working draft
initial def
inition. web app manifest working group drafts ...
related_applications - Web app manifests
lues: member description platform the platform on which the application can be found. list of available values url the url at which the application can be found. id the id used to represent the application on the specified platform. specification specification status comment feedback web app manifestthe def
inition of 'related_applications' in that specification. working draft
initial def
inition. web app manifest working group drafts ...
screenshots - Web app manifests
ication. these images are intended to be used by progressive web app stores. examples "screenshots" : [ { "src": "screenshot1.webp", "sizes": "1280x720", "type": "image/webp" }, { "src": "screenshot2.webp", "sizes": "1280x720", "type": "image/webp" } ] specification specification status comment feedback web app manifestthe def
inition of 'screenshots' in that specification. working draft
initial def
inition. web app manifest working group drafts ...
short_name - Web app manifests
lang manifest members. examples simple short_name in left-to-right language: "name": "awesome application", "short_name": "awesome app" short_name in arabic, which will be displayed right-to-left: "dir": "rtl", "lang": "ar", "name": "تطبيق رائع", "short_name": "رائع" specification specification status comment feedback web app manifestthe def
inition of 'short_name' in that specification. working draft
initial def
inition. web app manifest working group drafts ...
start_url - Web app manifests
ry, and a user agent may ignore it or allow the user to alter it at install time or afterwards. examples absolute url "start_url": "https://example.com" relative url if the url is relative, the manifest url is used as the base url to resolve it. "start_url": "../startpoint.html" specification specification status comment feedback web app manifestthe def
inition of 'start_url' in that specification. working draft
initial def
inition. web app manifest working group drafts ...
theme_color - Web app manifests
ring mandatory no the theme_color member is a string that defines the default theme color for the application. this sometimes affects how the os displays the site (e.g., on android's task switcher, the theme color surrounds the site). examples "theme_color": "red" specification specification status comment feedback web app manifestthe def
inition of 'theme_color' in that specification. working draft
initial def
inition. web app manifest working group drafts ...
<maction> - MathML
"> <mfrac> <mn>6</mn> <mn>8</mn> </mfrac> <mfrac> <mrow> <mn>3</mn> <mo>⋅</mo> <mn>2</mn> </mrow> <mrow> <mn>4</mn> <mo>⋅</mo> <mn>2</mn> </mrow> </mfrac> <mfrac> <mn>3</mn> <mn>4</mn> </mfrac> </maction> </math> specifications specification status comment mathml 3.0the def
inition of 'maction' in that specification. recommendation current specification mathml 2.0the def
inition of 'maction' in that specification. recommendation
initial specification ...
<menclose> - MathML
a2 + b2 arabic factorial symbol updiagonalarrow a2 + b2 diagonal arrow phasorangle a2 + b2 phasor angle examples <math> <menclose notation="circle box"> <mi> x </mi> <mo> + </mo> <mi> y </mi> </menclose> </math> specifications specification status comment mathml 3.0the def
inition of 'menclose' in that specification. recommendation current specification mathml 2.0the def
inition of 'menclose' in that specification. recommendation
initial specification ...
<mmultiscripts> - MathML
tiscripts> <mi>x</mi> <!-- base expression --> <none /> <!-- postsubscript --> <mi>c</mi> <!-- postsuperscript --> <mprescripts /> <mi>b</mi> <!-- presubscript --> <none /> <!-- presuperscript --> </mmultiscripts> </math> specifications specification status comment mathml 3.0the def
inition of 'mmultiscripts' in that specification. recommendation current specification mathml 2.0the def
inition of 'mmultiscripts' in that specification. recommendation
initial specification ...
<mstyle> - MathML
<mrow> <mi>i</mi> <mo form="infix">=</mo> <mn>1</mn> </mrow> <mi>n</mi> </munderover> <mstyle displaystyle="true"> <mfrac> <mn>1</mn> <mi>n</mi> </mfrac> </mstyle> </mrow> </mstyle> </math> specifications specification status comment mathml 3.0the def
inition of 'mstyle' in that specification. recommendation current specification mathml 2.0the def
inition of 'mstyle' in that specification. recommendation
initial specification ...
<mtable> - MathML
> <mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> </mtr> <mtr> <mtd><mi>c</mi></mtd> <mtd><mi>d</mi></mtd> </mtr> <mtr> <mtd><mi>e</mi></mtd> <mtd><mi>f</mi></mtd> </mtr> </mtable> </math> specifications specification status comment mathml 3.0the def
inition of 'mtable' in that specification. recommendation current specification mathml 2.0the def
inition of 'mtable' in that specification. recommendation
initial specification ...
Autoplay guide for media and Web Audio APIs - Web media technologies
e playback will likely be blocked. the exact situations that result in blocking, and the specifics of how sites become whitelisted vary from browser to browser, but the above are good guidelines to go by. for details, see the auto-play policies for google chrome and webkit. note: put another way, playback of any media that includes audio is generally blocked if the playback is programmatically
initiated in a tab which has not yet had any user interaction. browsers may additionally choose to block under other circumstances. autoplay of media elements now that we've covered what autoplay is and what can prevent autoplay from being allowed, we'll look at how your web site or app can automatically play media upon page load, how to detect when autoplay fails to occur, and tips for coping when...
Media container formats (file types) - Web media technologies
by ogg codec browser support chrome edge firefox safari flac yes opus yes vorbis yes quicktime the quicktime file format (qtff, qt, or mov) was created by apple for use by its media framework of the same name. the extension for these files, .mov, comes from the fact that the format was
initially used for movies and was usually called the "quicktime movie" format. while qtff served as the basis for the mpeg-4 file format, there are differences and the two are not quite interchangeable. quicktime files support any sort of time-based data, including audio and video media, text tracks, and so forth. quicktime files are primarily supported by macos, but for a number of years, quicktime ...
CSS and JavaScript animation performance - Web Performance
bar, enter about:config; click the i’ll be careful, i promise! button to enter the config screen. in the search bar, search for the layers.acceleration.draw-fps preference. double-click the entry to set the value to true. now you will be able to see three little purple boxes at the upper left corner of the firefox window. the first box represents fps. running the performance test
initially in the test seen below, a total of 1000 <div> elements are transformed by css animation. the animation can be switched to requestanimationframe() by clicking the toggle button. try running them both now, comparing the fps for each (the first purple box.) you should see that the performance of css animations and requestanimationframe() are very close. off main thread animation even giv...
Optimizing startup performance - Web Performance
avascript files. try to send the minify version of the file to the browser and use compression like gzip or brotli. utilize resource hints (like preconnect or preload) whenever possible to indicate to the browser which files are more critical for your application. the more stuff you can do asynchronously, the better advantage your app can take of multicore processors. porting issues once the
initial loading is done and the app's main code starts to run, it's possible your app may necessarily be single-threaded,especially if it's a port. the most important thing to do to try to help with the main code's startup process is to refactor the code into small pieces that can be done in chunks interspersed across multiple calls to your app's main loop, so that the main thread gets to handle input...
Web Performance
d always strive to reduce the amount of javascript you use in your applications, it can be difficult to know where to start. in this guide, we'll show you how to analyze your application's script bundles, so you know what you're using, as well how to detect if your app contains duplicated scripts between bundles. lazy loading it isn't always necessary to load all of a web applications assets on
initial page load. lazy loading is deferring the loading of assets on a page, such as scripts, images, etc., on a page to a later point in time i.e when those assets are actually needed. lazy-loading javascript with dynamic imports when developers hear the term "lazy loading", they immediately think of below-the-fold imagery that loads when it scrolls into the viewport. but did you know you can lazy...
Add to Home screen - Progressive web apps (PWAs)
home screen</button> we then gave it some simple styling: .add-button { position: absolute; top: 1px; left: 1px; } javascript for handling the install at the bottom of our index.js file, we added some javascript to handle the installation. first of all, we declare a deferredprompt variable (which we'll explain later on), get a reference to our install button, and set it to display: none
initially: let deferredprompt; const addbtn = document.queryselector('.add-button'); addbtn.style.display = 'none'; we hide the button
initially because the pwa will not be available for install until it follows the a2hs criteria. when this happens, supporting browsers will fire a beforeinstallprompt event. we can then use a handler like the one below to handle the installation: window.addeventlist...
How to make PWAs installable - Progressive web apps (PWAs)
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 manifest file. for instance, the prompt includes the app's name and icon. if the user clicks the button, there is a final step showing what the app will look like, and letting the user choose if they def
initely want to add the app. when confirmed, the app will be installed on the home screen. now the user can launch and use the web app just like any other application on their device. depending on the device and operating system, the web app's icon may be badged with a small icon that indicates that it's a web app. in the screen shot above, for example, the app has a tiny firefox icon, indicatin...
Introduction to progressive web apps - Progressive web apps (PWAs)
overview: progressive web apps next this article provides an introduction to progressive web apps (pwas), discussing what they are and the advantages they offer over regular web apps. what is a progressive web app? the term "progressive web app" isn't a formal or official name. it's just a shorthand used
initially by google for the concept of creating a flexible, adaptable app using only web technologies. pwas are web apps developed using a number of specific technologies and standard patterns to allow them to take advantage of both web and native app features. for example, web apps are more discoverable than native apps; it's a lot easier and faster to visit a website than to install an application, and you can also share web apps by simply sending a link. on the other ...
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
fecycle of a service worker when registration is complete, the sw.js file is automatically downloaded, then installed, and finally activated. installation the api allows us to add event listeners for key events we are interested in — the first one is the install event: self.addeventlistener('install', (e) => { console.log('[service worker] install'); }); in the install listener, we can
initialize the cache and add files to it for offline use. our js13kpwa app does exactly that. first, a variable for storing the cache name is created, and the app shell files are listed in one array. var cachename = 'js13kpwa-v1'; var appshellfiles = [ '/pwa-examples/js13kpwa/', '/pwa-examples/js13kpwa/index.html', '/pwa-examples/js13kpwa/app.js', '/pwa-examples/js13kpwa/style.css', '/pwa-...
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
kpwa demo. in this particular case, after registering, we use the registration object to subscribe, and then use the resulting subscription object to complete the whole process. in the registration part, the code looks like this: if(subscription) { return subscription; } if the user has already subscribed, we then return the subscription object and move to the subscription part. if not, we
initialize a new subscription: const response = await fetch('./vapidpublickey'); const vapidpublickey = await response.text(); const convertedvapidkey = urlbase64touint8array(vapidpublickey); the app fetches the server's public key and converts the response to text; then it needs to be converted to a uint8array (to support chrome). to learn more about vapid keys you can read the sending vapid identi...
Mobile first - Progressive web apps (PWAs)
n when developing mobile app layouts, you often run into problems with navigation menus. the concept is the same regardless of the target device — you want to provide a mechanism for users to search for things and get to different views/pages of the application — but because mobile screens are so much smaller, a reasonable desktop navigation can spoil the experience by filling up most of the
initial view of the app, covering up the content. there several ways to solve the problem of navigation getting in the way on mobile, a few of which i'll discuss here. the main objective is to put the content first and to hide away the navigation until the user really needs it. first of all, you can consider a different navigation mechanism on mobile. so, if you were planning to have a vertical navi...
accent-height - SVG: Scalable Vector Graphics
-face for <font-face>, accent-height defines the distance from the origin to the top of accent characters, measured by a distance within the font coordinate system. value <number> default value value of ascent animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'accent-height' in that specification. recommendation
initial def
inition ...
ascent - SVG: Scalable Vector Graphics
font-face> font-face for <font-face>, ascent defines the maximum unaccented height of the font within the font coordinate system. value <number> default value difference between units-per-em and vert-origin-y animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'ascent' in that specification. recommendation
initial def
inition ...
azimuth - SVG: Scalable Vector Graphics
<circle cx="100" cy="100" r="80" style="filter: url(#distantlight1);" /> <circle cx="100" cy="100" r="80" style="filter: url(#distantlight2); transform: translatex(240px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the def
inition of 'azimuth' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'azimuth' in that specification. recommendation
initial def
inition ...
baseFrequency - SVG: Scalable Vector Graphics
requency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> specifications specification status comment filter effects module level 1the def
inition of 'basefrequency' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'basefrequency' in that specification. recommendation
initial def
inition ...
baseProfile - SVG: Scalable Vector Graphics
t is using this attribute: <svg> context notes value profile name default value none animatable no example <svg width="120" height="120" version="1.1" xmlns="http://www.w3.org/2000/svg" baseprofile="full"> ... </svg> specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'baseprofile' in that specification. recommendation
initial def
inition ...
bbox - SVG: Scalable Vector Graphics
e <string> default value none animatable no <string> a comma-separated list of exactly four numbers specifying, in order, the lower left x, lower left y, upper right x, and upper right y of the bounding box for the complete font. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'bbox' in that specification. recommendation
initial def
inition ...
cap-height - SVG: Scalable Vector Graphics
ntics of the obsolete cap-height descriptor of the @font-face at-rule defined in an early version of css 2. only one element is using this attribute: <font-face> usage notes value <number> default value none animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'cap-height' in that specification. recommendation
initial def
inition ...
clip-rule - SVG: Scalable Vector Graphics
« svg attribute reference home the clip-rule attribute only applies to graphics elements that are contained within a <clippath> element. the clip-rule attribute basically works as the fill-rule attribute, except that it applies to <clippath> def
initions. the following fragment of code will cause an evenodd clipping rule to be applied to the clipping path because clip-rule is specified on the <path> element that defines the clipping shape: <g> <clippath id="myclip"> <path d="..." clip-rule="evenodd" /> </clippath> <rect clip-path="url(#myclip)" ... /> </g> whereas the following fragment of code will not cause an evenodd clipping rule to be applied because the clip-rule is specified on the referencing element, not on the object defining the clipping shape: <g> ...
color-interpolation - SVG: Scalable Vector Graphics
n't require that color interpolation occur in a particular color space. srgb indicates that color interpolation should occur in the srgb color space. linearrgb indicates that color interpolation should occur in the linearized rgb color space as described in the srgb specification. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'color-interpolation' in that specification. candidate recommendation no significant change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'color-interpolation' in that specification. recommendation
initial def
inition browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to...
color-profile - SVG: Scalable Vector Graphics
ing profile overrides an embedded profile inside an image. if no match is found, then the embedded profile inside the image is used. <iri> an iri reference to the source color profile. the referenced color profile overrides an embedded profile inside the image. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'color-profile' in that specification. recommendation
initial def
inition 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. desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome fo...
data-* - SVG: Scalable Vector Graphics
lons (;, u+003a). no capital a to z letters. the svgelement.dataset property is a domstringmap that provides the attribute data-test-value via svgelement.dataset.testvalue. hyphen characters (-, u+002d) are removed and the next letter is capitalized, resulting in the camelcase format. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'data-*' in that specification. candidate recommendation custom data attributes are new in svg 2. ...
diffuseConstant - SVG: Scalable Vector Graphics
00" height="200" style="filter: url(#diffuselighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 1 animatable yes specifications specification status comment filter effects module level 1the def
inition of 'diffuseconstant' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'diffuseconstant' in that specification. recommendation
initial def
inition ...
elevation - SVG: Scalable Vector Graphics
<circle cx="100" cy="100" r="80" style="filter: url(#distantlight1);" /> <circle cx="100" cy="100" r="80" style="filter: url(#distantlight2); transform: translatex(240px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the def
inition of 'elevation' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'elevation' in that specification. recommendation
initial def
inition ...
exponent - SVG: Scalable Vector Graphics
ansfer2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 1 animatable yes <number> if the type attribute of the component element is set to gamma, this value specifies the exponent of the gamma function specifications specification status comment filter effects module level 1the def
inition of 'exponent' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'exponent' in that specification. recommendation
initial def
inition ...
filter - SVG: Scalable Vector Graphics
ion="2" /> </filter> <rect x="10" y="10" width="80" height="80" filter="url(#blur)" /> </svg> usage notes value none | <filter-function-list> default value none animatable yes for a description of the values see the css filter property. specifications specification status comment filter effects module level 1the def
inition of 'filter' in that specification. working draft extended the values by several special filter functions. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'filter' in that specification. recommendation
initial def
inition browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to t...
filterRes - SVG: Scalable Vector Graphics
ne animatable yes <number-optional-number> this value takes one or two values, the first one outlining the resolution in horizontal direction, the second one in vertical direction. if only one value is specified, it is used for both directions. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'filterres' in that specification. recommendation
initial def
inition ...
font-size - SVG: Scalable Vector Graphics
t> <text x="100" y="20" font-size="2em">2em</text> </svg> usage notes value <absolute-size> | <relative-size> | <length-percentage> default value medium animatable yes for a description of the values, please refer to the css font-size property. specifications specification status comment css fonts module level 3the def
inition of 'font-size' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'font-size' in that specification. recommendation
initial def
inition ...
format - SVG: Scalable Vector Graphics
type-1 postscript™ type 1 truetype truetype opentype opentype, including truetype open truetype-gx truetype with gx extensions speedo speedo intellifont intellifont specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'format for <glyphref>' in that specification. recommendation
initial def
inition for <glyphref> scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'format for <altglyph>' in that specification. recommendation
initial def
inition for <altglyph> ...
fr - SVG: Scalable Vector Graphics
ill="white" stroke="white"/> <circle cx="60" cy="60" r="2" fill="white" stroke="white"/> <text x="38" y="40" fill="white" font-family="sans-serif" font-size="10pt">(fx,fy)</text> <text x="63" y="63" fill="white" font-family="sans-serif" font-size="10pt">(cx,cy)</text> </svg> specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'fr' in that specification. candidate recommendation
initial def
inition ...
fx - SVG: Scalable Vector Graphics
" fill="white" stroke="white"/> <circle cx="60" cy="60" r="2" fill="white" stroke="white"/> <text x="38" y="40" fill="white" font-family="sans-serif" font-size="10pt">(fx,fy)</text> <text x="63" y="63" fill="white" font-family="sans-serif" font-size="10pt">(cx,cy)</text> </svg> specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'fx' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'fx' in that specification. recommendation
initial def
inition ...
fy - SVG: Scalable Vector Graphics
" fill="white" stroke="white"/> <circle cx="60" cy="60" r="2" fill="white" stroke="white"/> <text x="38" y="40" fill="white" font-family="sans-serif" font-size="10pt">(fx,fy)</text> <text x="63" y="63" fill="white" font-family="sans-serif" font-size="10pt">(cx,cy)</text> </svg> specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'fy' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'fy' in that specification. recommendation
initial def
inition ...
g1 - SVG: Scalable Vector Graphics
efault value none animatable no <name># this value indicates a comma-separated sequence of glyph names (i.e., values that match glyph-name attributes on <glyph> elements) which identify a set of possible first glyphs in the kerning pair. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'g1' in that specification. recommendation
initial def
inition ...
g2 - SVG: Scalable Vector Graphics
fault value none animatable no <name># this value indicates a comma-separated sequence of glyph names (i.e., values that match glyph-name attributes on <glyph> elements) which identify a set of possible second glyphs in the kerning pair. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'g2' in that specification. recommendation
initial def
inition ...
in - SVG: Scalable Vector Graphics
//developer.mozilla.org/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%"/> <feblend in2="sourcegraphic" mode="multiply"/> </filter> </defs> <circle cx="50%" cy="40%" r="40%" fill="#c00" style="filter:url(#imagemultiply);"/> </svg> </div> result specifications specification status comment filter effects module level 1the def
inition of 'in' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'in' in that specification. recommendation
initial def
inition ...
intercept - SVG: Scalable Vector Graphics
url(#componenttransfer1);" /> <rect x="0" y="0" width="200" height="200" fill="url(#gradient)" style="filter: url(#componenttransfer2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the def
inition of 'intercept' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'intercept' in that specification. recommendation
initial def
inition ...
k - SVG: Scalable Vector Graphics
sing this attribute: <hkern> and <vkern> context notes value <number> default value none animatable no <number> this value indicates the amount for decreasing the spacing between the two glyphs in the kerning pair. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'k' in that specification. recommendation
initial def
inition ...
k1 - SVG: Scalable Vector Graphics
/> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the def
inition of 'k1' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'k1' in that specification. recommendation
initial def
inition ...
k2 - SVG: Scalable Vector Graphics
/> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the def
inition of 'k2' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'k2' in that specification. recommendation
initial def
inition ...
k3 - SVG: Scalable Vector Graphics
/> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the def
inition of 'k3' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'k3' in that specification. recommendation
initial def
inition ...
k4 - SVG: Scalable Vector Graphics
/> <image href="https://mdn.mozillademos.org/files/12668/mdn.svg" x="0" y="0" width="200" height="200" style="filter: url(#composite2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the def
inition of 'k4' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'k4' in that specification. recommendation
initial def
inition ...
lighting-color - SVG: Scalable Vector Graphics
0" height="200" style="filter: url(#diffuselighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting2); transform: translatex(220px);" /> </svg> usage notes value color default value white animatable yes specifications specification status comment filter effects module level 1the def
inition of 'lighting-color' in that specification. working draft removed the <icccolor> value. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'lighting-color' in that specification. recommendation
initial def
inition ...
limitingConeAngle - SVG: Scalable Vector Graphics
"0" width="200" height="200" style="filter: url(#spotlight1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#spotlight2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 0 animatable yes specifications specification status comment filter effects module level 1the def
inition of 'limitingconeangle' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'limitingconeangle' in that specification. recommendation
initial def
inition ...
local - SVG: Scalable Vector Graphics
this attribute: <color-profile> usage notes value <string> default value none animatable no <string> this value specifies the unique id for a locally stored color profile as specified by international color consortium. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'local' in that specification. recommendation
initial def
inition ...
markerUnits - SVG: Scalable Vector Graphics
erwidth and markerunits attributes and the contents of the <marker> element represent values in a coordinate system which has a single unit equal the size in user units of the current stroke width (see the stroke-width attribute) in place for the graphic object referencing the marker. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'markerunits' in that specification. candidate recommendation no significant change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'markerunits' in that specification. recommendation
initial def
inition ...
mask - SVG: Scalable Vector Graphics
s: <a>, <circle>, <clippath>, <ellipse>, <g>, <glyph>, <image>, <line>, <marker>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <svg>, <symbol>, <text>, <use> usage notes value see the css property mask default value none animatable yes specifications specification status comment css masking module level 1the def
inition of 'mask' in that specification. candidate recommendation extends its usage to html elements. extends its syntax by making it a shorthand for the new mask-* properties defined in that specification. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'mask' in that specification. recommendation
initial def
inition ...
mode - SVG: Scalable Vector Graphics
n_logo_only_color.png" width="200" height="200" style="filter:url(#blending2); transform:translatex(220px);"/> </svg> usage notes value <blend-mode> default value normal animatable yes for a description of the values, see <blend-mode>. specifications specification status comment filter effects module level 1the def
inition of 'mode' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'mode' in that specification. recommendation
initial def
inition ...
numOctaves - SVG: Scalable Vector Graphics
requency="0.05" numoctaves="3" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> specifications specification status comment filter effects module level 1the def
inition of 'numoctaves' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'numoctaves' in that specification. recommendation
initial def
inition ...
onclick - SVG: Scalable Vector Graphics
0%; margin: 0; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <circle cx="100" cy="100" r="100" onclick="alert('you have clicked the circle.')" /> </svg> usage notes value <anything> default value none animatable no specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'onclick' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'onclick' in that specification. recommendation
initial def
inition ...
orientation - SVG: Scalable Vector Graphics
none (meaning glyph can be used for both text directions) animatable yes h this value indicates that the glyph is only used for a horizontal text direction. v this value indicates that the glyph is only used for a vertical text direction. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'orientation' in that specification. recommendation
initial def
inition ...
paint-order - SVG: Scalable Vector Graphics
y="75">stroke over</text> <text x="200" y="150" paint-order="stroke" id="stroke-under">stroke under</text> </g> </svg> the example would be rendered as follows: the stroke under effect could be achieved via the following css property: #stroke-under { paint-order: stroke; } specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'paint-order' in that specification. candidate recommendation
initial def
inition ...
pointsAtX - SVG: Scalable Vector Graphics
y="0" width="200" height="200" style="filter: url(#lighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting2); transform: translatex(220px);" /> </svg> usage notes default value 0 value <number> animatable yes specifications specification status comment filter effects module level 1the def
inition of 'pointsatx' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'pointsatx' in that specification. recommendation
initial def
inition ...
pointsAtY - SVG: Scalable Vector Graphics
y="0" width="200" height="200" style="filter: url(#lighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#lighting2); transform: translatex(220px);" /> </svg> usage notes default value 0 value <number> animatable yes specifications specification status comment filter effects module level 1the def
inition of 'pointsaty' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'pointsaty' in that specification. recommendation
initial def
inition ...
rendering-intent - SVG: Scalable Vector Graphics
is method usually converts out of gamut colors to colors that have the same lightness but fall just inside the gamut. absolute-colorimetric this value disables white point matching when converting colors. note: this option is generally not recommended. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'rendering-intent' in that specification. recommendation
initial def
inition ...
requiredFeatures - SVG: Scalable Vector Graphics
t x="20" y="1152">http://www.w3.org/tr/svg11/feature#extensibility</text> </svg> css .ko { fill: #900; } .ok { fill: #060; } rect { stroke: #000; stroke-width: 2px; } text{ fill: #fff; font: 12px sans-serif; } result see also requiredfeatures.svg specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'requiredfeatures' in that specification. recommendation
initial def
inition ...
seed - SVG: Scalable Vector Graphics
sefrequency="0.05" seed="1000" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> specifications specification status comment filter effects module level 1the def
inition of 'seed' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'seed' in that specification. recommendation
initial def
inition ...
shape-rendering - SVG: Scalable Vector Graphics
bly just for straight lines which are close to vertical or horizontal. also, the user agent might adjust line positions and line widths to align edges with device pixels. geometricprecision indicates that the user agent shall emphasize geometric precision over speed and crisp edges. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'shape-rendering' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'shape-rendering' in that specification. recommendation
initial def
inition browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please ch...
side - SVG: Scalable Vector Graphics
left animatable yes left this value places the text on the left side of the path (relative to the path direction). right this value places the text on the right side of the path (relative to the path direction). this effectively reverses the path direction. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'side' in that specification. candidate recommendation
initial def
inition ...
specularConstant - SVG: Scalable Vector Graphics
ht="200" style="filter: url(#specularlighting1);" /> <rect x="0" y="0" width="200" height="200" style="filter: url(#specularlighting2); transform: translatex(220px);" /> </svg> usage notes value <number> default value 1 animatable yes specifications specification status comment filter effects module level 1the def
inition of 'specularconstant' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'specularconstant' in that specification. recommendation
initial def
inition ...
stitchTiles - SVG: Scalable Vector Graphics
alue indicates that the user agent will automatically adjust the x and y values of the base frequency such that the <feturbulence> node’s width and height (i.e., the width and height of the current subregion) contain an integral number of the tile width and height for the first octave. specifications specification status comment filter effects module level 1the def
inition of 'stitchtiles' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'stitchtiles' in that specification. recommendation
initial def
inition ...
string - SVG: Scalable Vector Graphics
t of formats that are supported by the font referenced by the parent <font-face-uri> element. the available types are: "woff", "woff2", "truetype", "opentype", "embedded-opentype", and "svg". see the src descriptor of the @font-face at-rule for more information. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'string' in that specification. recommendation
initial def
inition ...
stroke-linejoin - SVG: Scalable Vector Graphics
each stroke --> <g id="p"> <path d="m1,5 l2,-3 l2,3" stroke="pink" fill="none" stroke-width="0.025" /> <circle cx="1" cy="5" r="0.05" fill="pink" /> <circle cx="3" cy="2" r="0.05" fill="pink" /> <circle cx="5" cy="5" r="0.05" fill="pink" /> </g> </svg> specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'stroke-linejoin' in that specification. candidate recommendation def
inition for shapes and texts scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'stroke-linejoin' in that specification. recommendation
initial def
inition for shapes and texts ...
stroke - SVG: Scalable Vector Graphics
een" /> <stop offset="100%" stop-color="white" /> </lineargradient> </defs> <circle cx="15" cy="5" r="4" fill="none" stroke="url(#mygradient)" /> </svg> usage notes value <paint> default value none animatable yes specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'stroke' in that specification. candidate recommendation def
inition for shapes and texts. adds context-fill and context-stroke. scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'stroke' in that specification. recommendation
initial def
inition for shapes and texts browser compatibility the compatibility table on this page is generated from...
tabindex - SVG: Scalable Vector Graphics
tabindex="2" /> <circle cx="160" cy="160" r="60" tabindex="4" /> </svg> usage notes value valid integer default value none animatable no valid integer relative order of the element for the purposes of sequential focus navigation. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'tabindex' in that specification. candidate recommendation
initial def
inition ...
targetX - SVG: Scalable Vector Graphics
convolvematrix> usage notes value <integer> default value floor(orderx / 2) animatable yes <integer> this value indicates the positioning in horizontal direction of the convolution matrix relative to a given target pixel in the input image. specifications specification status comment filter effects module level 1the def
inition of 'targetx' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'targetx' in that specification. recommendation
initial def
inition ...
targetY - SVG: Scalable Vector Graphics
feconvolvematrix> usage notes value <integer> default value floor(ordery / 2) animatable yes <integer> this value indicates the positioning in vertical direction of the convolution matrix relative to a given target pixel in the input image. specifications specification status comment filter effects module level 1the def
inition of 'targety' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'targety' in that specification. recommendation
initial def
inition ...
text-rendering - SVG: Scalable Vector Graphics
value indicates that the user agent shall emphasize geometric precision over legibility and rendering speed. this option will usually cause the user agent to suspend the use of hinting so that glyph outlines are drawn with comparable geometric precision to the rendering of path data. specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'text-rendering' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'text-rendering' in that specification. recommendation
initial def
inition browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please chec...
u1 - SVG: Scalable Vector Graphics
default value none animatable no [ <character> | <urange> ]# this value indicates a comma-separated sequence of unicode characters and/or ranges of unicode characters, which identify a set of possible first glyphs in a kerning pair. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'u1' in that specification. recommendation
initial def
inition ...
u2 - SVG: Scalable Vector Graphics
default value none animatable no [ <character> | <urange> ]# this value indicates a comma-separated sequence of unicode characters and/or ranges of unicode characters, which identify a set of possible second glyphs in a kerning pair. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'u2' in that specification. recommendation
initial def
inition ...
unicode-range - SVG: Scalable Vector Graphics
ement is using this attribute: <font-face> usage notes value <urange># default value none animatable no <urange># this value is a comma-separated list of iso 10646 characters possibly covered by the glyphs in the font. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'unicode-range' in that specification. recommendation
initial def
inition ...
v-alphabetic - SVG: Scalable Vector Graphics
the value is an offset in the font coordinate system relative to the glyph-specific vert-origin-x attribute. only one element is using this attribute: <font-face> usage notes value <number> default value none animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'v-alphabetic' in that specification. recommendation
initial def
inition ...
v-hanging - SVG: Scalable Vector Graphics
one element is using this attribute: <font-face> usage notes value <number> default value none animatable no <number> this value indicates the alignment coordinate for the glyphs to achieve hanging baseline alignment. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'v-hanging' in that specification. recommendation
initial def
inition ...
vector-effect - SVG: Scalable Vector Graphics
"m10,20l40,100l39,200z" stroke="black" stroke-width="2px" fill="none"></path> <!-- fixed--> <path vector-effect="non-scaling-stroke" transform="translate(300,0)scale(4,1)" d="m10,20l40,100l39,200z" stroke="black" stroke-width="2px" fill="none"></path> </svg> result specifications specification status comment scalable vector graphics (svg) 2the def
inition of 'vector-effect' in that specification. candidate recommendation
initial def
inition ...
vert-origin-x - SVG: Scalable Vector Graphics
ent is using this attribute: <font> usage notes value <number> default value half of horiz-adv-x value animatable no <number> this value indicates the x-coordinate of the origin of a glyph for vertically oriented text. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'vert-origin-x' in that specification. recommendation
initial def
inition ...
vert-origin-y - SVG: Scalable Vector Graphics
only one element is using this attribute: <font> usage notes value <number> default value ascent value animatable no <number> this value indicates the y-coordinate of the origin of a glyph for vertically oriented text. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'vert-origin-y' in that specification. recommendation
initial def
inition ...
visibility - SVG: Scalable Vector Graphics
.invisible { visibility: hidden; } javascript document.queryselector("button").addeventlistener("click", function (evt) { this.queryselector("svg > path:nth-of-type(1)").classlist.toggle("invisible"); this.queryselector("svg > path:nth-of-type(2)").classlist.toggle("invisible"); }); specifications specification status comment css level 2 (revision 1)the def
inition of 'visibility' in that specification. recommendation css def
inition of the property scalable vector graphics (svg) 2the def
inition of 'visibility' in that specification. candidate recommendation mainly refers to css 2.1 scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'visibility' in that specification. recommendation
initial def
inition ...
xlink:arcrole - SVG: Scalable Vector Graphics
ient>, <script>, <set>, <textpath>, <tref>, <use> usage notes value <iri> default value none animatable no <iri> this value specifies an iri reference that identifies some resource that describes the intended property. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'xlink:arcrole' in that specification. recommendation
initial def
inition ...
xlink:type - SVG: Scalable Vector Graphics
<mpath>, <pattern>, <radialgradient>, <script>, <set>, <textpath>, <tref>, and <use> usage notes value simple default value simple animatable no simple this value specifies that the referred resource is a simple link. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'xlink:type' in that specification. recommendation
initial def
inition ...
zoomAndPan - SVG: Scalable Vector Graphics
y="60" z="20" /> </fediffuselighting> </filter> <rect x="0" y="0" width="200" height="200" style="filter: url(#diffuselighting);" /> </svg> usage notes value disable | magnify default value magnify animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of 'zoomandpan' in that specification. recommendation
initial def
inition ...
<a> - SVG: Scalable Vector Graphics
any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<a>' in that specification. candidate recommendation replaced xlink:href attribute by href scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<a>' in that specification. recommendation
initial def
inition ...
<altGlyph> - SVG: Scalable Vector Graphics
it, stroke-opacity, stroke-width, text-anchor, transform, vector-effect, visibility xlink attributes xlink:href, xlink:type, xlink:role, xlink:arcrole, xlink:title, xlink:show, xlink:actuate dom interface this element implements the svgaltglyphelement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<altglyph>' in that specification. recommendation
initial def
inition ...
<altGlyphDef> - SVG: Scalable Vector Graphics
elementpermitted contenteither: one or more <glyphref> elements, or one or more <altglyphitem> elements attributes global attributes core attributes specific attributes none dom interface this element implements the svgaltglyphdefelement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<altglyphdef>' in that specification. recommendation
initial def
inition ...
<circle> - SVG: Scalable Vector Graphics
a-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<circle>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<circle>' in that specification. recommendation
initial def
inition ...
<color-profile> - SVG: Scalable Vector Graphics
ing elements, in any order:descriptive elements attributes global attributes core attributes » xlink attributes » specific attributes local name rendering-intent xlink:href dom interface this element implements the svgcolorprofileelement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<color-profile>' in that specification. recommendation
initial def
inition ...
<defs> - SVG: Scalable Vector Graphics
any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<defs>' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<defs>' in that specification. recommendation
initial def
inition ...
<desc> - SVG: Scalable Vector Graphics
includes global attributes global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesdescriptive elementpermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<desc>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<desc>' in that specification. recommendation
initial def
inition ...
<discard> - SVG: Scalable Vector Graphics
entpermitted contentany number of the following elements, in any order:descriptive elements<script> attributes global attributes conditional processing attributes core attributes aria attributes specific attributes begin href (but note that <discard> has never supported xlink:href) specifications specification status comment svg animations level 2the def
inition of '<discard>' in that specification. editor's draft
initial def
inition ...
<ellipse> - SVG: Scalable Vector Graphics
a-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<ellipse>' in that specification. candidate recommendation added auto value for rx and ry scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<ellipse>' in that specification. recommendation
initial def
inition ...
<feBlend> - SVG: Scalable Vector Graphics
acity="1"/> <feblend in="sourcegraphic" in2="floodfill" mode="multiply"/> </filter> </defs> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%" style="filter:url(#spotlight);"/> </svg> result specifications specification status comment filter effects module level 1the def
inition of '<feblend>' in that specification. working draft outsourced blend modes to compositing and blending level 1 scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<feblend>' in that specification. recommendation
initial def
inition ...
<feColorMatrix> - SVG: Scalable Vector Graphics
toalpha --> <filter id="colormelta"> <fecolormatrix in="sourcegraphic" type="luminancetoalpha" /> </filter> <use href="#circles" transform="translate(0 350)" filter="url(#colormelta)" /> <text x="70" y="400">luminancetoalpha</text> </svg> result screenshotlive sample specifications specification status comment filter effects module level 1the def
inition of '<fecolormatrix>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<fecolormatrix>' in that specification. recommendation
initial def
inition ...
<feComponentTransfer> - SVG: Scalable Vector Graphics
ction</text> <rect x="0" y="230" width="100%" height="20" style="filter:url(#linear)"></rect> <text x="0" y="270">gamma function</text> <rect x="0" y="280" width="100%" height="20" style="filter:url(#gamma)"></rect> </g> </svg> css rect { fill: url(#rainbow); } result specifications specification status comment filter effects module level 1the def
inition of '<fecomponenttransfer>' in that specification. working draft specified that missing transfer function elements are treated like they were specified with their type attributes set to identity. scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<fecomponenttransfer>' in that specification. recommendation
initial def
inition ...
<feComposite> - SVG: Scalable Vector Graphics
late(900,25)"> <use xlink:href="#red100" filter="url(#arithmeticnoflood)" /> <use xlink:href="#red50" filter="url(#arithmeticnoflood)" /> <text x="-25" y="275">arithmetic</text> </g> </g> </g> </svg> result this image shows just the desired effect. specifications specification status comment filter effects module level 1the def
inition of '<fecomposite>' in that specification. working draft added lighter value for operator attribute. scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<fecomposite>' in that specification. recommendation
initial def
inition ...
<feConvolveMatrix> - SVG: Scalable Vector Graphics
d="emboss"> <feconvolvematrix kernelmatrix="3 0 0 0 0 0 0 0 -3"/> </filter> </defs> <image xlink:href="/files/12668/mdn.svg" x="0" y="0" height="200" width="200" style="filter:url(#emboss);" /> </svg> result specifications specification status comment filter effects module level 1the def
inition of '<feconvolvematrix>' in that specification. working draft scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<feconvolvematrix>' in that specification. recommendation
initial def
inition ...
<feDiffuseLighting> - SVG: Scalable Vector Graphics
0"/> </fediffuselighting> <fecomposite in="sourcegraphic" in2="light" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"/> </filter> <circle cx="390" cy="80" r="50" fill="green" filter="url(#lightme3)" /> </svg> expected rendering: live rendering: specifications specification status comment filter effects module level 1the def
inition of '<fediffuselighting>' in that specification. working draft deprecated kernelunitlength attribute scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<fediffuselighting>' in that specification. recommendation
initial def
inition ...
<feDisplacementMap> - SVG: Scalable Vector Graphics
requency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> specifications specification status comment filter effects module level 1the def
inition of '<fedisplacementmap>' in that specification. working draft no changes scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<fedisplacementmap>' in that specification. recommendation
initial def
inition ...
<feDistantLight> - SVG: Scalable Vector Graphics
categorieslight source elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes specific attributes azimuth elevation dom interface this element implements the svgfedistantlightelement interface. specifications specification status comment filter effects module level 1the def
inition of '<fedistantlight>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<fedistantlight>' in that specification. recommendation
initial def
inition ...
<feDropShadow> - SVG: Scalable Vector Graphics
es class, style filter primitive attributes height, in, result, x, y, width presentation attributes most notably: flood-color, flood-opacity usage notes categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <script>, <set> specifications specification status comment filter effects module level 1the def
inition of '<fedropshadow>' in that specification. working draft
initial def
inition ...
<feFuncA> - SVG: Scalable Vector Graphics
context categoriesnonepermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes transfer function attributes specific attributes none dom interface this element implements the svgfefuncaelement interface. specifications specification status comment filter effects module level 1the def
inition of '<fefunca>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<fefunca>' in that specification. recommendation
initial def
inition ...
<feFuncB> - SVG: Scalable Vector Graphics
context categoriesnonepermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes transfer function attributes specific attributes none dom interface this element implements the svgfefuncbelement interface. specifications specification status comment filter effects module level 1the def
inition of '<fefuncb>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<fefuncb>' in that specification. recommendation
initial def
inition ...
<feFuncG> - SVG: Scalable Vector Graphics
context categoriesnonepermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes transfer function attributes specific attributes none dom interface this element implements the svgfefuncgelement interface. specifications specification status comment filter effects module level 1the def
inition of '<fefuncg>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<fefuncg>' in that specification. recommendation
initial def
inition ...
<feFuncR> - SVG: Scalable Vector Graphics
context categoriesnonepermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes transfer function attributes specific attributes none dom interface this element implements the svgfefuncrelement interface. specifications specification status comment filter effects module level 1the def
inition of '<fefuncr>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<fefuncr>' in that specification. recommendation
initial def
inition ...
<feGaussianBlur> - SVG: Scalable Vector Graphics
lpha" stddeviation="3" /> <feoffset dx="2" dy="4" /> <femerge> <femergenode /> <femergenode in="sourcegraphic" /> </femerge> </filter> <circle cx="60" cy="60" r="50" fill="green" filter="url(#dropshadow)" /> </svg> result screenshotlive sample specifications specification status comment filter effects module level 1the def
inition of '<fegaussianblur>' in that specification. working draft added edgemode attribute scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<fegaussianblur>' in that specification. recommendation
initial def
inition ...
<feImage> - SVG: Scalable Vector Graphics
3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <filter id="image"> <feimage xlink:href="/files/6457/mdn_logo_only_color.png"/> </filter> </defs> <rect x="10%" y="10%" width="80%" height="80%" style="filter:url(#image);"/> </svg> result specifications specification status comment filter effects module level 1the def
inition of '<feimage>' in that specification. working draft added href attribute and deprecated xlink:href. added crossorigin attribute. scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<feimage>' in that specification. recommendation
initial def
inition ...
<feMerge> - SVG: Scalable Vector Graphics
: #000000; fill: green; filter: url(#feoffset);" /> </svg> result attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes none dom interface this element implements the svgfemergeelement interface. specifications specification status comment filter effects module level 1the def
inition of '<femerge>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<femerge>' in that specification. recommendation
initial def
inition ...
<feMergeNode> - SVG: Scalable Vector Graphics
eoffset);" /> <rect x="40" y="40" width="100" height="100" style="stroke: #000000; fill: green;" /> </svg> result attributes global attributes core attributes » specific attributes in dom interface this element implements the svgfemergenodeelement interface. specifications specification status comment filter effects module level 1the def
inition of '<femergenode>' in that specification. working draft scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<femergenode>' in that specification. recommendation
initial def
inition ...
<feMorphology> - SVG: Scalable Vector Graphics
erator="dilate" radius="2"/> </filter> </svg> <p>normal text</p> <p id="thin">thinned text</p> <p id="thick">fattened text</p> css p { margin: 0; font-family: arial, helvetica, sans-serif; font-size: 3em; } #thin { filter: url(#erode); } #thick { filter: url(#dilate); } specifications specification status comment filter effects module level 1the def
inition of '<femorphology>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<femorphology>' in that specification. recommendation
initial def
inition ...
<feOffset> - SVG: Scalable Vector Graphics
h="180" height="180"> <feoffset in="sourcegraphic" dx="60" dy="60" /> </filter> </defs> <rect x="0" y="0" width="100" height="100" stroke="black" fill="green"/> <rect x="0" y="0" width="100" height="100" stroke="black" fill="green" filter="url(#offset)"/> </svg> result specifications specification status comment filter effects module level 1the def
inition of '<feoffset>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<feoffset>' in that specification. recommendation
initial def
inition ...
<fePointLight> - SVG: Scalable Vector Graphics
fecomposite in="sourcegraphic" in2="spotlight" operator="arithmetic" k1="0" k2="1" k3="1" k4="0"/> </filter> </defs> <image xlink:href="/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%" style="filter:url(#spotlight);"/> </svg> result specifications specification status comment filter effects module level 1the def
inition of '<fepointlight>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<fepointlight>' in that specification. recommendation
initial def
inition ...
<feSpotLight> - SVG: Scalable Vector Graphics
<fecomposite in="sourcegraphic" in2="spotlight" operator="out" k1="0" k2="1" k3="1" k4="0"/> </filter> </defs> <image xlink:href="/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%" style="filter:url(#spotlight);"/> </svg> result specifications specification status comment filter effects module level 1the def
inition of '<fespotlight>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<fespotlight>' in that specification. recommendation
initial def
inition ...
<feTile> - SVG: Scalable Vector Graphics
100%"> <fetile in="sourcegraphic" x="50" y="50" width="100" height="100" /> <fetile/> </filter> </defs> <image xlink:href="/files/6457/mdn_logo_only_color.png" x="10%" y="10%" width="80%" height="80%" style="filter:url(#tile);"/> </svg> result specifications specification status comment filter effects module level 1the def
inition of '<fetile>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<fetile>' in that specification. recommendation
initial def
inition ...
<feTurbulence> - SVG: Scalable Vector Graphics
requency="0.05" numoctaves="2" result="turbulence"/> <fedisplacementmap in2="turbulence" in="sourcegraphic" scale="50" xchannelselector="r" ychannelselector="g"/> </filter> <circle cx="100" cy="100" r="100" style="filter: url(#displacementfilter)"/> </svg> specifications specification status comment filter effects module level 1the def
inition of '<feturbulence>' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<feturbulence>' in that specification. recommendation
initial def
inition ...
<filter> - SVG: Scalable Vector Graphics
height="120" xmlns="http://www.w3.org/2000/svg"> <filter id="blurme"> <fegaussianblur stddeviation="5"/> </filter> <circle cx="60" cy="60" r="50" fill="green" /> <circle cx="170" cy="60" r="50" fill="green" filter="url(#blurme)" /> </svg> result screenshotlive sample specifications specification status comment filter effects module level 1the def
inition of '<filter>' in that specification. working draft scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<filter>' in that specification. recommendation
initial def
inition ...
<font-face-src> - SVG: Scalable Vector Graphics
nt elementpermitted contentone or more of the following elements, in any order:<font-face-name>, <font-face-uri> attributes global attributes core attributes specific attributes none dom interface this element implements the svgfontfacesrcelement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<font-face-src>' in that specification. recommendation
initial def
inition ...
<font-face> - SVG: Scalable Vector Graphics
hanging v-ideographic v-alphabetic v-mathematical v-hanging underline-position underline-thickness strikethrough-position strikethrough-thickness overline-position overline-thickness dom interface this element implements the svgfontfaceelement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<font-face>' in that specification. recommendation
initial def
inition ...
<font> - SVG: Scalable Vector Graphics
core attributes presentation attributes class style externalresourcesrequired specific attributes horiz-origin-x horiz-origin-y horiz-adv-x vert-origin-x vert-origin-y vert-adv-y dom interface this element implements the svgfontelement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<font>' in that specification. recommendation
initial def
inition ...
<foreignObject> - SVG: Scalable Vector Graphics
adonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesnonepermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<foreignobject>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<foreignobject>' in that specification. recommendation
initial def
inition ...
<g> - SVG: Scalable Vector Graphics
any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<g>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<g>' in that specification. recommendation
initial def
inition ...
<glyph> - SVG: Scalable Vector Graphics
ph unicode="@" d="m0,50l100,300l400,100z"></glyph> </font> </defs> <text x="100" y="100" style="font-family: 'super sans', helvetica, sans-serif; font-weight: bold; font-style: normal">text using embe@dded font!</text> </svg> result specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<glyph>' in that specification. recommendation
initial def
inition ...
<glyphRef> - SVG: Scalable Vector Graphics
entempty attributes global attributes core attributes » presentation attributes » xlink attributes » class style specific attributes x y dx dy glyphref format xlink:href dom interface this element implements the svgglyphrefelement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<glyphref>' in that specification. recommendation
initial def
inition ...
<image> - SVG: Scalable Vector Graphics
mple basic rendering of a png image in svg: svg <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <image href="https://mdn.mozillademos.org/files/6457/mdn_logo_only_color.png" height="200" width="200"/> </svg> result specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<image>' in that specification. candidate recommendation allows omitting height and width scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<image>' in that specification. recommendation
initial def
inition ...
<line> - SVG: Scalable Vector Graphics
a-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<line>' in that specification. candidate recommendation changed the x1, y1, x2 and y2 attributes to take <length>s, <percentage>s and <number>s scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<line>' in that specification. recommendation
initial def
inition ...
<linearGradient> - SVG: Scalable Vector Graphics
t, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes xlink:href, xlink:title usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatetransform>, <set>, <stop> specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<lineargradient>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<lineargradient>' in that specification. recommendation
initial def
inition ...
<mask> - SVG: Scalable Vector Graphics
s, in any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment css masking module level 1the def
inition of '<mask>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<mask>' in that specification. recommendation
initial def
inition ...
<missing-glyph> - SVG: Scalable Vector Graphics
>, <text>, <view> attributes global attributes core attributes presentation attributes class style specific attributes d horiz-adv-x vert-origin-x vert-origin-y vert-adv-y dom interface this element implements the svgmissingglyphelement interface. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<missing-glyph>' in that specification. recommendation
initial def
inition ...
<path> - SVG: Scalable Vector Graphics
a-rowcount, aria-rowindex, aria-rowspan, aria-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesgraphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment svg pathsthe def
inition of '<path>' in that specification. working draft scalable vector graphics (svg) 2the def
inition of '<path>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<path>' in that specification. recommendation
initial def
inition ...
<polygon> - SVG: Scalable Vector Graphics
a-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<polygon>' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<polygon>' in that specification. recommendation
initial def
inition ...
<polyline> - SVG: Scalable Vector Graphics
a-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<polyline>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<polyline>' in that specification. recommendation
initial def
inition ...
<radialGradient> - SVG: Scalable Vector Graphics
t, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes xlink:href, xlink:title usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatetransform>, <set>, <stop> specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<radialgradient>' in that specification. candidate recommendation added fr attribute scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<radialgradient>' in that specification. recommendation
initial def
inition ...
<rect> - SVG: Scalable Vector Graphics
a-selected, aria-setsize, aria-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesbasic shape element, graphics element, shape elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<rect>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<rect>' in that specification. recommendation
initial def
inition ...
<script> - SVG: Scalable Vector Graphics
l> ; default value: none; animatable: no global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesnonepermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<script>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<script>' in that specification. recommendation
initial def
inition ...
<set> - SVG: Scalable Vector Graphics
lobal attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesanimation elementpermitted contentany number of the following elements, in any order:descriptive elements specifications specification status comment svg animations level 2the def
inition of '<set>' in that specification. editor's draft scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<set>' in that specification. recommendation
initial def
inition ...
<solidcolor> - SVG: Scalable Vector Graphics
the <solidcolor> svg element lets authors define a single color for use in multiple places in an svg document. it is also useful as away of animating a palette colors. note: this is an experimental technology, and not yet implemented in browsers. a workaround is to use a <lineargradient> with only one color stop. this is less elegant, and unlike <solidcolor>, cannot itself be used in the def
inition of gradients. usage context missing attributes global attributes core attributes global event attributes presentation attributes style attributes specific attributes none. dom interface this element implements the svgsolidcolorelement interface. example svg <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 300 200" height="150"> <defs> <!-- solidcolor is experimental. ...
<stop> - SVG: Scalable Vector Graphics
event attributes, document element event attributes presentation attributes most notably: color, display, stop-color, stop-opacity, visibility usage notes categoriesgradient elementpermitted contentany number of the following elements, in any order:<animate>, <animatecolor>, <set> specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<stop>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<stop>' in that specification. recommendation
initial def
inition ...
<style> - SVG: Scalable Vector Graphics
ng>; default value: none; animatable: no global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesnonepermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<style>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<style>' in that specification. recommendation
initial def
inition ...
<svg> - SVG: Scalable Vector Graphics
any order:animation elementsdescriptive elementsshape elementsstructural elementsgradient elements<a>, <altglyphdef>, <clippath>, <color-profile>, <cursor>, <filter>, <font>, <font-face>, <foreignobject>, <image>, <marker>, <mask>, <pattern>, <script>, <style>, <switch>, <text>, <view> specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<svg>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<svg>' in that specification. recommendation
initial def
inition ...
<switch> - SVG: Scalable Vector Graphics
ystemlanguage="en">hello!</text> <text systemlanguage="es">hola!</text> <text systemlanguage="fr">bonjour!</text> <text systemlanguage="ja">こんにちは</text> <text systemlanguage="ru">Привет!</text> <text>☺</text> </switch> </svg> result specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<switch>' in that specification. candidate recommendation clarified the evaluation of the systemlanguage attribute scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<switch>' in that specification. recommendation
initial def
inition ...
<text> - SVG: Scalable Vector Graphics
a-sort, aria-valuemax, aria-valuemin, aria-valuenow, aria-valuetext, role usage notes categoriesgraphics element, text content elementpermitted contentcharacter data and any number of the following elements, in any order:animation elementsdescriptive elementstext content elements<a> specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<text>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<text>' in that specification. recommendation
initial def
inition ...
<textPath> - SVG: Scalable Vector Graphics
xt, role xlink attributes xlink:title usage notes categoriestext content element, text content child elementpermitted contentcharacter data and any number of the following elements, in any order:descriptive elements<a>, <altglyph>, <animate>, <animatecolor>, <set>, <tref>, <tspan> specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<textpath>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<textpath>' in that specification. recommendation
initial def
inition ...
<title> — the SVG accessible name element - SVG: Scalable Vector Graphics
includes global attributes global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesdescriptive elementpermitted contentany elements or character data specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<title>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<title>' in that specification. recommendation
initial def
inition ...
<tref> - SVG: Scalable Vector Graphics
data </text> <text x="100" y="200" font-size="45" fill="red" > <tref xlink:href="#referencedtext"/> </text> <!-- show outline of canvas using 'rect' element --> <rect x="1" y="1" width="998" height="298" fill="none" stroke-width="2" /> </svg> specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<font>' in that specification. recommendation
initial def
inition ...
<tspan> - SVG: Scalable Vector Graphics
in, aria-valuenow, aria-valuetext, role usage notes categoriestext content element, text content child elementpermitted contentcharacter data and any number of the following elements, in any order:descriptive elements<a>, <altglyph>, <animate>, <animatecolor>, <set>, <tref>, <tspan> specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<tspan>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<tspan>' in that specification. recommendation
initial def
inition ...
<use> - SVG: Scalable Vector Graphics
aluemin, aria-valuenow, aria-valuetext, role xlink attributes xlink:href, xlink:title usage notes categoriesgraphics element, graphics referencing element, structural elementpermitted contentany number of the following elements, in any order:animation elementsdescriptive elements specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<use>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<use>' in that specification. recommendation
initial def
inition ...
<view> - SVG: Scalable Vector Graphics
> <a xlink:href="#normalsizeview"> <text x="5" y="40" font-size="20">normal size</text> </a> <a xlink:href="#doublesizeview"> <text x="5" y="60" font-size="20">double size</text> </a> </svg> result dom interface this element implements the svgviewelement interface. specifications specification status comment scalable vector graphics (svg) 2the def
inition of '<view>' in that specification. candidate recommendation scalable vector graphics (svg) 1.1 (second edition)the def
inition of '<view>' in that specification. recommendation
initial def
inition ...
Example - SVG: Scalable Vector Graphics
ngth, sum_y/motes.length]; } // a nicer, integer random function rand(modulo) { return math.round( math.random() * (modulo-1)); } // class mote function mote() { // dimensions of drawing area. var dims = dimensions(); var width = dims[0], height = dims[1]; // choose a random coordinate to start at. this.x = rand( width ); this.y = rand( height ); // nil
initial velocity. this.vx = this.vy = 0; // a visual element---
initially none this.elt = null; } // turn this into a class. new mote(); // mote::applyforce() -- adjust velocity // towards the given position. // warning: pseudo-physics -- not really // governed by any /real/ physical principles. mote.prototype.applyforce = function(pos, mag) { if( pos[0] > this.x ) ...
SVG 1.1 Support in Firefox - SVG: Scalable Vector Graphics
implemented. hkern not implemented. vkern not implemented. font-face-src not implemented. font-face-uri not implemented. font-face-format not implemented. font-face-name not implemented. def
inition-src not implemented. extensibility module foreignobject implemented. ...
SVG as an Image - SVG: Scalable Vector Graphics
is. :visited-link styles aren't rendered. platform-native widget styling (based on os theme) is disabled. note that the above restrictions are specific to image contexts; they don't apply when svg content is viewed directly, or when it's embedded as a document via the <iframe>, <object>, or <embed> elements. specifications specification status comment html5the def
inition of 'svg within <img> element' in that specification. recommendation defines the usage of svg within <img> elements. css backgrounds and borders module level 3the def
inition of 'svg within 'background-image' css property' in that specification. candidate recommendation defines the usage of svg within the background-image property. ...
Clipping and masking - SVG: Scalable Vector Graphics
acity, which leads effectively to a double-color stroke. using well-known css techniques one of the most powerful tools in a web developer's toolbox is display: none. it is therefore little surprise, that it was decided to take this css property into svg as well, together with visibility and clip as defined by css 2. for reverting a previously set display: none it is important to know, that the
initial value for all svg elements is inline. « previousnext » ...
Fills and Strokes - SVG: Scalable Vector Graphics
odified with css, the latter not. css can be inserted inline with the element via the style attribute: <rect x="10" height="180" y="10" width="180" style="stroke: black; fill: red;"/> or it can be moved to a special style section that you include. instead of shoving such a section into a <head> section like you do in html, though, it's included in an area called <defs>. <defs> stands for def
initions, and it is here that you can create elements that don't appear in the svg directly, but are used by other elements. <?xml version="1.0" standalone="no"?> <svg width="200" height="200" xmlns="http://www.w3.org/2000/svg" version="1.1"> <defs> <style type="text/css"><![cdata[ #myrect { stroke: black; fill: red; } ]]></style> </defs> <rect x="10" hei...
Certificate Transparency - Web security
el of the root node therefore depends on all other nodes in the tree. in the context of certificate transparency, the data hashed by the leaf nodes are the certificates that have been issued by the various different cas operating today. certificate inclusion can be verified via an audit proof which can be generated and verified efficiently, in logarithmic o(log n) time. certificate transparency
initially came about in 2013 against a backdrop of ca compromises (diginotar breach in 2011), questionable decisions (trustwave subordinate root incident in 2012) and technical issuance issues (weak, 512 bit certificate issuance by digicert sdn bhd of malaysia). implementation when certificates are submitted to a ct log, a signed certificate timestamp (sct) is generated and returned. this serves as ...
Features restricted to secure contexts - Web security
current features available only in secure contexts this section lists all the apis available only in secure contexts, along with browser versions the limitation was introduced in, as appropriate. note: only the browsers that actually support secure contexts are listed in this document. see here for information on secure contexts support. ...
HTML Imports - Web Components
google's webcomponents.js. html imports is intended to be the packaging mechanism for web components, but you can also use html imports by itself. you import an html file by using a <link> tag in an html document like this: <link rel="import" href="myfile.html"> the import link type is new. specification specification status comment html imports working draft
initial def
inition. ...
Using shadow DOM - Web Components
s focused, it displays the text in a pop up information box to provide further in-context information. to begin with, in our javascript file we define a class called popupinfo, which extends htmlelement: class popupinfo extends htmlelement { constructor() { // always call super first in constructor super(); // write element functionality in here ... } } inside the class def
inition we define the element's constructor, which defines all the functionality the element will have when an instance of it is instantiated. creating the shadow root we first attach a shadow root to the custom element: // create a shadow root let shadow = this.attachshadow({mode: 'open'}); creating the shadow dom structure next, we use some dom manipulation to create the element's internal shad...
child - XPath
the child axis indicates the children of the context node. if an xpath expression does not specify an axis, the child axis is understood by default. since only the root node or element nodes have children, any other use will select nothing. specifications specification status comment xpath 3.1the def
inition of 'child' in that specification. recommendation xpath 3.0the def
inition of 'child' in that specification. recommendation xpath 2.0the def
inition of 'child' in that specification. recommendation xpath 1.0the def
inition of 'child' in that specification. recommendation
initial def
inition. ...
self - XPath
the self axis indicates the context node itself. it can be abbreviated as a single period (.). specifications specification status comment xpath 3.1the def
inition of 'self' in that specification. recommendation xpath 3.0the def
inition of 'self' in that specification. recommendation xpath 2.0the def
inition of 'self' in that specification. recommendation xpath 1.0the def
inition of 'self' in that specification. recommendation
initial def
inition. ...
string - XPath
s object(optional) the object to convert to a string. if omitted, the context node is used. returns a string notes if the object is a node-set, the string value of the first node in the set is returned. a number is converted as follows: nan is converted to the string nan. positive zero is converted to the string 0. negative zero is converted to the string 0. positive inf
inity is converted to the string inf
inity. negative inf
inity is converted to the string -inf
inity. decimal numbers between -1 and 1 are converted to a string with a single leading 0 before the decimal point. boolean true is converted to the string true. boolean false is converted to the string false. defined xpath 1.0 4.2 gecko support supported. ...
XPath
note: support for xpath varies widely; it's supported reasonably well in firefox (although there are no plans to improve support further), while other browsers implement it to a lesser extent, if at all. if you need a polyfill, you may consider js-xpath or wicked-good-xpath. documentation introduction to using xpath in javascript describes a non-xslt use of xpath. xpath:axes list and def
inition of the axes defined in the xpath specification. axes are used to describe the relationships between nodes. xpath:functions list and description of the core xpath functions and xslt-specific additions to xpath. transforming xml with xslt xslt uses xpath to address code segments in an xml document that it wishes to transform. xpath snippets these are javascript utility functions, that can ...
<xsl:template> - XSLT: Extensible Stylesheet Language Transformations
ifies a name for this template, by which it can be invoked through the <xsl:call-template> element. mode specifies a particular mode for this template, which can be matched by an attribute of the <xsl:apply-templates> element. this is useful for processing the same information in multiple ways. priority specifies a numeric priority for this template. this can be any number other than inf
inity. the processor uses this number when more than one template matches the same node. type top-level, must be the child of <xsl:stylesheet> or <xsl:transform>. defined xslt, section 5.3. gecko support supported. ...
PI Parameters - XSLT: Extensible Stylesheet Language Transformations
set the parameter 'books' to a nodeset containing all <book> elements in the null namespace: <?xslt-param name="books" select="//book"?> set the parameter 'show-toc' to boolean true: <?xslt-param name="show-toc" select="true()"?> the select attribute context the following context is used to parse and evaluate the expression in the select attribute. the context node is the node used as
initial current node used when executing the stylesheet. the context position is the position of the context node in the
initial current node list used when executing the stylesheet. the context size is the size of the
initial current node list used when executing the stylesheet. no variables are available. the function library is the standard xpath function library. the namespace declarations ar...