Search completed in 1.01 seconds.
Specified value - CSS: Cascading Style Sheets
the
specified value of a css property is the value it receives from the document'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. ...
...roperty 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 is not an inheriting property.</p> </div> css .fun { b...
Index - Web APIs
e value given for the address's city property. the returned string explains the error and should offer suggestions for how to correct it. 32 addresserrors.country api, addresserrors, error, payment request, payment request api, property, reference, validation, country, payment an object based on addresserrors includes a country property if during validation of the address the
specified value of country was determined to be invalid. the value is a string describing the error and should offer suggestions for how to correct it. 33 addresserrors.dependentlocality api, addresserrors, error, locality, payment request, payment request api, property, read-only, reference, dependentlocality, payment an object based on addresserrors includes a dependentlocality prope...
...animations api the animationeffect.gettiming() method of the animationeffect interface returns an effecttiming object containing the timing properties for the animation effect. 85 animationeffect.updatetiming() api, animation, experimental, method, reference, web animations, waapi, web animations api the updatetiming() method of the animationeffect interface updates the
specified timing properties for an animation effect. 86 animationevent api, experimental, interface, reference, web animations the animationevent interface represents events providing information related to animations. 87 animationevent() api, animationevent, cssom, constructor, experimental, reference, web animations the animationevent() constructor returns a newl...
...turns the local part of the qualified name of an element. 101 attr.namespaceuri api, dom, property, reference the attr.namespaceuri read-only property returns the namespace uri of the attribute, or null if the element is not in a namespace. 102 attr.prefix api, dom, property, reference the attr.prefix read-only property returns the namespace prefix of the
specified attribute, or null if no prefix is
specified. 103 audiobuffer api, audiobuffer, interface, reference, web audio api the audiobuffer interface represents a short audio asset residing in memory, created from an audio file using the audiocontext.decodeaudiodata() method, or from raw data using audiocontext.createbuffer(). once put into an audiobuffer, the audio can then be playe...
...And 252 more matches
Index
:deflatestringtoutf8buffer 18 boolean_to_jsval jsapi reference, obsolete, spidermonkey boolean_to_jsval converts a bool argument, b, to a boolean jsval. 19 double_to_jsval jsapi reference, obsolete, spidermonkey double_to_jsval is the inverse of js::tonumber. 20 int_fits_in_jsval jsapi reference, obsolete, spidermonkey determines if a
specified c integer value, i, lies within the range allowed for integer jsvals. if so, int_fits_in_jsval returns true, and i can be cast to jsval by calling int_to_jsval(i). otherwise, int_fits_in_jsval returns false. in this case, the application can still convert i to a jsval using js_newnumbervalue. 21 int_to_jsval jsapi reference, obsolete, spidermonkey int_to_jsval converts a c in...
...eference, référence(2), spidermonkey js::autovectorrooter<t> holds a variable-size rooted array of type t. 27 js::booleanvalue jsapi reference, reference, référence(2), spidermonkey js::booleanvalue converts a c boolean of type bool to js::value, the type of javascript values. 28 js::call jsapi reference, reference, spidermonkey js::call calls a
specified function, fun, on an object, thisobj. in terms of function execution, the object is treated as this. 29 js::callargs jsapi reference, reference, référence(2), spidermonkey js::callargs is helper class encapsulating access to the callee, this value, arguments, and argument count for a function call. 30 js::clonefunctionobject jsapi reference, reference, réfé...
...y js::compileoffthread compiles a script, chars for execution. 34 js::compileoptions jsapi reference, reference, référence(2), spidermonkey some methods of js::owningcompileoptions and js::compileoptions return the instance itself to allow method chain. 35 js::construct jsapi reference, reference, référence(2), spidermonkey js::construct calls a
specified function as a constructor, fun. 36 js::createerror jsapi reference, reference, référence(2), spidermonkey js::createerror creates an error object with
specified properties. 37 js::currentglobalornull jsapi reference, reference, référence(2), spidermonkey js::currentglobalornull() returns the global object for whatever function is currently running on ...
...And 72 more matches
Index - Archive of obsolete content
r extension for firefox and thunderbird, with a code signing certificate for object signing. the following instructions also apply to a theme and other xpi files. 301 supporting search suggestions in search plugins add-ons, opensearch, search, search plugins firefox supports search suggestions in opensearch plugins; as the user types in the search bar, firefox queries the url
specified by the search plugin to fetch live search suggestions. 302 tabbed browser add-ons, code snippets, extensions here you should find a set of useful code snippets to help you work with firefox's tabbed browser. the comments normally mark where you should be inserting your own code. 303 techniques . 304 promises add-ons, examples, snippets, as...
... layout is primarily concerned with providing a presentation to an html or xml document. this presentation is typically formatted in accordance with the requirements of the css1 and css2 specifications from the w3c. presentation formatting is also required to provide compatibility with legacy browsers (microsoft internet explorer and netscape navigator 4.x). the decision about when to apply css-
specified formatting and when to apply legacy formatting is controlled by the document's doctype specification. these layout modes are referred to as 'standards' and 'navquirks' modes. (doctype and modes are explained in more detail in article mozilla's doctype sniffing. 457 multiple firefox profiles no summary! 458 repackaging firefox enterprise notice: the artic...
...ta to streams, files and sockets in an internationalization-aware way. 694 xbl landing, mozilla, reference, xbl xml binding language (xbl, sometimes also called extensible bindings language) is a language for describing bindings that can be attached to elements in other documents. the element that the binding is attached to, called the bound element, acquires the new behavior
specified by the binding. 695 xbl 1.0 reference xbl no summary! 696 anonymous content a binding can specify an anonymous content template using the content element. this template describes a content tree that will be generated around the bound element during binding attachment. an element declared in a bound document using a single tag can then be constructed out...
...And 37 more matches
Index
it works by inserting a special set of entry points between nss and the module. 192 nss tech note3 no summary! 193 nss tech note4 no summary! 194 nss tech note5 note: aes encryption, a fixed blocksize of 16 bytes is used. the rijndael algorithm permits 3 blocksizes (16, 24, 32 bytes), but the aes standard requires ...
...ns and arguments options options specify an action. option arguments modify an action. the options and arguments for the crlutil command are defined as follows: -g create new certificate revocation list(crl). -d delete certificate revocation list from cert database. -i import a crl to the cert database -e erase all crls of
specified type from the cert database -l list existing crl located in cert database file. -m modify existing crl which can be located in cert db or in arbitrary file. if located in file it should be encoded in asn.1 encode format. -g arguments option arguments modify an action and are lowercase. -b bypass ca signature checks.
...y databases is not recommended. -a use ascii format or allow the use of ascii format for input and output. this formatting follows rfc #1113. -c crl-gen-file specify script file that will be used to control crl generation/modification. see crl-cript-file format below. if options -m|-g is used and -c crl-script-file is not
specified, crlutil will read script data from standard input. -d directory specify the database directory containing the certificate and key database files. on unix the certificate database tool defaults to $home/.netscape (that is, ~/.netscape). on windows nt the default is the current directory. the nss database files must reside in ...
...And 34 more matches
sslfnc.html
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 retrieve the error code. description nss_init opens the certn.db, keyn.db, and secmod.db files (wheren is a numeric digit) in the
specified directory. nss_init isnot idempotent, so call it only once. nss_init opens the database files read-only. if you are performing operations that require write permission, for example s/mime operations such as adding a certificate, use nss_initreadwrite instead. before calling nss_init, your program must call pr_init. the policy flags for all cipher suites are turned off by default, disallowi...
...tory 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 retrieve the error code. description nss_initreadwrite opens the certn.db, keyn.db, and secmod.db files (wheren is a numeric digit) with both read and write permission in the
specified directory. nss_initreadwrite isnot idempotent, so call it only once. use nss_initreadwrite rather than nss_init if you are performing operations that require write permission, such as some s/mime operations. before calling nss_initreadwrite, your program must call pr_init. the policy flags for all cipher suites are turned off by default, disallowing all cipher suites. therefore, an applicat...
...fore calling nss_nodb_init, your program must call pr_init. the policy flags for all cipher suites are turned off by default, disallowing all cipher suites. therefore, an application cannot use nss to perform any cryptographic operations until after it enables appropriate cipher suites by calling one of the ssl export policy functions. ssl_optionsetdefault changes the default value of a
specified ssl option for all subsequently opened sockets as long as the current application program is running. ssl_optionsetdefault replaces the deprecated function ssl_enabledefault. syntax #include "ssl.h" secstatus ssl_optionsetdefault(print32 option, prbool on); parameters this function has the following parameters: option one of the following values (except ...
...And 29 more matches
Index
ake an object defined in a privileged scope and create a structured clone of it in a less-privileged scope. it returns a reference to the clone: 33 components.utils.createobjectin add-ons, developing mozilla, extensions, javascript, reference, référence(2), xpcom:language bindings, xpconnect components.utils.createobjectin creates a new javascript object in the scope of the
specified object's compartment. 34 components.utils.evalinsandbox add-ons, developing mozilla, extensions, javascript, xpcom:language bindings, xpconnect the evalinsandbox() function enables you to evaluate javascript code inside a sandbox you've previously created using the components.utils.sandbox constructor. 35 components.utils.evalinwindow this function enabl...
...leged code using an xray to a dom object sees only the original, native version of the dom object. any expando properties are not visible, and if any native properties have been redefined, this has no effect. 43 components.utils.makeobjectpropsnormal add-ons, developing mozilla, extensions, javascript, needstechnicalreview, xpcom:language bindings, xpconnect ensures that the
specified object's methods are all in the object's scope, and aren't cross-component wrappers. 44 components.utils.reporterror xpcom:language bindings, xpconnect components.utils.reporterror reports a javascript error object to the error console, and returns. it is meant for use by extension developers who have exception handler blocks which want to "eat" an exception, but still want t...
...at ats can easily determine specific information about the application such as its name or version. 164 iaccessiblecomponent interfaces, xpcom, xpcom interface reference this interface provides the standard mechanism for an assistive technology to retrieve information concerning the graphical representation of an object. coordinates used by the functions of this interface are
specified in different coordinate systems. their scale is the same and is equal to that of the screen coordinate system. in other words all coordinates are measured in pixels. they differ in their respective origin: 165 iaccessibleeditabletext interfaces, xpcom, xpcom interface reference this interface is typically used in conjunction with the iaccessibletext interface and complements ...
...And 27 more matches
nsIDOMWindowUtils
ments in this window. we have audiomuted and audiovolume to preserve the volume across mute/umute. audiovolume float range: greater or equal to 0. the real volume level is affected by the volume of all ancestor windows. ...
...l is affected by the volume of all ancestor windows. constants constant value description modifier_alt 0x0001 getmodifierstate("alt") of the send event will return true if this is
specified for amodifiers of send*event() except sendnative*event(). modifier_control 0x0002 getmodifierstate("control") of the send event will return true if this is
specified for amodifiers of send*event() except sendnative*event(). ...
... send event will return true if this is
specified for amodifiers of send*event() except sendnative*event(). modifier_control 0x0002 getmodifierstate("control") of the send event will return true if this is
specified for amodifiers of send*event() except sendnative*event(). modifier_shift 0x0004 getmodifierstate("shift") of the send event will return true if this is
specified for amodifiers of send*event() except sendnative*event(). modifier_meta 0x0008 getmodifierstate("meta") of the send event will return true if this is
specified for amodifiers of send*event() except sendnative*event(). ...
...And 22 more matches
Scaling of SVG backgrounds - CSS: Cascading Style Sheets
if background-size specifies a fixed dimension (that is, percentages and relative units are fixed by their context), that dimension wins. if the image has an intrinsic ratio (that is, its width:height ratio is constant, such as 16:9, 4:3, 2.39:1, 1:1, and so forth), the rendered size preserves that ratio. if the image specifies a size, and the size isn't modified by constrain or cover, that
specified size wins. if none of the above cases are met, the image is rendered at the same size as the background area. it's worth noting that the sizing algorithm only cares about the image's dimensions and proportions, or lack thereof. an svg image with fixed dimensions will be treated just like a raster image of the same size. source image examples before diving in to look at the results of using d...
... looks like rendered in a 150x150 box, and provide a link to the svg source. dimensionless and proportionless this image is both dimensionless and proportionless. it doesn't care what size it is, nor does it care about remaining at a particular aspect ratio. this would make a good gradient desktop background that would work regardless of your screen size and its aspect ratio. svg source one
specified dimension and proportionless this image specifies a width of 100 pixels but no height or intrinsic ratio. this is, basically, a thin strip of wallpaper that could be stretched across the entire height of a block. svg source one
specified dimension with intrinsic ratio this image specifies a 100 pixel height but no width. it also specifies an intrinsic aspect ratio of 3:4. this ensures that ...
...screenshots below show the expected rendering. not all browsers currently render these correctly. specifying fixed lengths for both dimensions if you use background-size to specify fixed lengths for both dimensions, those lengths are always used, per rule 1 above. ...
...And 19 more matches
OS.File for the main thread
write. the default is true, i.e. opening a file for appending. specify append: false to open the file in regular mode. optionsoptional platform-specific options for opening the file. for advanced users only. most users will never have need of these options. ...
... specify append: false to open the file in regular mode. optionsoptional platform-specific options for opening the file. for advanced users only. most users will never have need of these options. to specify options, pass an object that may contain some of the following flags: unixflags (ignored under non-unix platforms) if
specified, file opening flags, as per libc function open. if un
specified, build these flags from the contents of mode. you can build these flags from values os.constants.libc.o_*. unixmode (ignored under non-unix platforms) if
specified, file creation mode, as per libc function open. if un
specified, files are created with a default mode of 0600 (file is private to the user, the user can read and write). you can build this mode from values os.constants.libc.s_i*. ...
...n build these flags from values os.constants.libc.o_*. unixmode (ignored under non-unix platforms) if
specified, file creation mode, as per libc function open. if un
specified, files are created with a default mode of 0600 (file is private to the user, the user can read and write). you can build this mode from values os.constants.libc.s_i*. winshare (ignored under non-windows platforms) if
specified, a sharing policy, as per windows function createfile. if un
specified, files are opened with a default sharing policy (file is not protected against being read/written/removed by another process or another use in the same process). ...
...And 16 more matches
source-editor.jsm
adds a new event listener to the editor. you can listen for any of the events listed in event name constants. to stop listening for the event, call removeeventlistener(). void addeventlistener( string aeventtype, function acallback ); parameters aeventtype the name of the event type to listen for; see event name constants for possible values. acallback the function to call when the
specified event occurs. canredo() determines whether or not there are changes that can be redone. boolean canredo(); parameters none. return value true if there are changes that can be redone, otherwise false. canundo() determines whether or not there are changes that can be undone. boolean canundo(); parameters none. return value true if there are changes that can be undone, otherwise fal...
...ted by calling startcompoundchange(). all changes made to the text between the two calls is considered to be a single edit for the purposes of undo operations. void endcompoundchange(); parameters none. find() finds a string in the editor's text. number find( [optional] string astring [optional] object aoptions ); parameters astring optional the string for which to search. if not
specified, the currently selected text in the editor is used as the search string. aoptions optional an optional object containing properties customizing the search operation. see find options for details. return value returns an integer indicating the offset into the text at which the first character of the found string is located, or -1 if the string wasn't found. find options the aoptions object ...
...integer indicating the offset into the text at which the first character of the found string is located, or -1 if the string wasn't found. find options the aoptions object can customize the search operation. it may have the following properties: property type description backwards boolean if true, the search begins at start (or the end of the text, if start is not
specified) and progresses toward the beginning of the text. otherwise the search progresses forward. the default is false. ignorecase boolean if true, the search is performed in a case-insensitive manner; otherwise case is considered. the default is false. start number an integer value indicating the offset into the text at which to begin the find operation. the default is 0 i...
...And 15 more matches
WebIDL bindings
errorresult& and return from your c++ back into the binding code. in cases when the specification calls for throwing a typeerror, you should use errorresult::throwtypeerror() instead of calling throw(). custom extended attributes our webidl parser and code generator recognize several extended attributes that are not present in the webidl spec. [alias=propname] this extended attribute can be
specified on a method and indicates that another property with the
specified name will also appear on the interface prototype object and will have the same function object value as the property for the method. for example: interface myinterface { [alias=performsomething] void dosomething(); }; myinterface.prototype.performsomething will have the same function object value as myinterface.prototype.doso...
...] void dosomething(); }; myinterface.prototype.performsomething will have the same function object value as myinterface.prototype.dosomething. multiple [alias] extended attribute can be used on the one method. [alias] cannot be used on a static method, nor on methods on a global interface (such as window). aside from regular property names, the name of an alias can be symbol.iterator. this is
specified by writing [alias="@@iterator"]. [bindingalias=propname] this extended attribute can be
specified on an attribute and indicates that another property with the
specified name will also appear on the interface prototype object and will call the same underlying c++ implementation for the getter and setter. this is more efficient than using the same binaryname for both attributes, because it shares...
...=otherattr] readonly attribute boolean attr; }; myinterface.prototype.otherattr and myinterface.prototype.attr will both exist, have separate getter/setter functions, but call the same binding glue code and implementation function on the objects implementing myinterface. multiple [bindingalias] extended attributes can be used on a single attribute. [chromeonly] this extended attribute can be
specified on any method, attribute, or constant on an interface or on an interface as a whole. it can also be
specified on dictionary members. interface members flagged as [chromeonly] are only exposed in chrome windows (and in particular, are not exposed to webpages). from the point of view of web content, it's as if the interface member were not there at all. these members are exposed to chrome script ...
...And 15 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
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. <input> types how an <input> works varies considerably depending on the value of its type attribute, hence the different types are covered in their own separate reference pages. if this attribute is not
specified, the default type adopted is text. the available types are as follows: type description basic examples spec button a push button with no default behavior displaying the value of the value attribute, empty by default. <input type="button" name="button" /> checkbox a check box allowing single values to be selected/deselec...
...y the specification, firefox will by default persist the dynamic disabled state of an <input> across page loads. use the autocomplete attribute to control this feature. form a string specifying the <form> element with which the input is associated (that is, its form owner). this string's value, if present, must match the id of a <form> element in the same document. if this attribute isn't
specified, the <input> element is associated with the nearest containing form, if any. the form attribute lets you place an input anywhere in the document but have it included with a form elsewhere in the document. note: an input can only be associated with one form. formaction valid for the image and submit input types only. see the submit input type for more information. formenctype v...
... of max may be lower than the value of min, which indicates that the range may wrap around; for example, this allows you to specify a time range from 10 pm to 4 am. maxlength valid for text, search, url, tel, email, and password, it defines the maximum number of characters (as utf-16 code units) the user can enter into the field. this must be an integer value 0 or higher. if no maxlength is
specified, or an invalid value is
specified, the field has no maximum length. this value must also be greater than or equal to the value of minlength. the input will fail constraint validation if the length of the text entered into the field is greater than maxlength utf-16 code units long. by default, browsers prevent users from entering more characters than allowed by the maxlength attribute. see clien...
...And 15 more matches
<input type="email"> - 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. the input value is automatically validated to ensure that it's either empty or a properly-formatted e-mail address (or list of addresses) before the form can be submitted. ...
...ue was removed. a single properly-formed e-mail address. this doesn't necessarily mean the e-mail address exists, but it is at least formatted correctly. in simple terms, this means username@domain or username@domain.tld. there's more to it than that, of course; see validation for a regular expression that matches the e-mail address validation algorithm. if and only if the multiple attribute is
specified, the value can be a list of properly-formed comma-separated e-mail addresses. any trailing and leading whitespace is removed from each address in the list. see validation for details on how e-mail addresses are validated to ensure that they're formatted properly. additional attributes in addition to the attributes that operate on all <input> elements regardless of their type, email inputs sup...
... values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requirements: users can select from this predefined list or provide a different value. maxlength the maximum number of characters (as utf-16 code units) the user can enter into the email input. this must be an integer value 0 or higher. if no maxlength is
specified, or an invalid value is
specified, the email input has no maximum length. this value must also be greater than or equal to the value of minlength. the input will fail constraint validation if the length of the text value of the field is greater than maxlength utf-16 code units long. constraint validation is only applied when the value is changed by the user. minlength the minimum number of cha...
...And 14 more matches
nsITextInputProcessor
eans that the clause is not converted but selected to convert or modify. attr_converted_clause 0x04 a clause attribute. this means that the clause is already converted. attr_selected_clause 0x05 a clause attribute. this means that the clause is already converted and is selected to convert. key_default_prevented 0x00000001 one of akeyflags. when this is
specified, defaultprevented attribute of dispatching keyboard events true. this is not useful in usual cases. this may be useful for automated tests. key_non_printable_key 0x00000002 one of akeyflags. when you attempt to dispatch a non-printable key's events, it's recommented this be
specified. if the key attribute value is not a registered key name, this flag causes throwing an exception. t...
...ception. key_force_printable_key 0x00000004 one of akeyflags. when you attempt to dispatch a printable key's event whose key attribute value (i.e., inputting string) will match with a registered key name, this flag makes dispatched keyboard events 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 ...
... 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 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 co...
...And 13 more matches
Index - Archive of obsolete content
545 openpopupatscreen xul methods, xul reference no summary! 546 opensubdialog xul methods, xul reference no summary! 547 openwindow xul methods, xul reference no summary! 548 pintab xul, xul attribute, xul reference no summary! 549 preferenceforelement xul methods, xul ...
...the content to generate goes directly inside the action element. this content will be copied for each matching result (though see below for an exception) and inserted into the document. let's look at a simple example first. 920 ad...
...the content to generate goes directly inside the action element. ...
...And 12 more matches
SVGLength - Web APIs
svg length interface the svglength interface correspond to the <length> basic data type. an svglength object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
... svg length interface the svglength interface correspond to the <length> basic data type. an svglength object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...he svglength interface correspond to the <length> basic data type. an svglength object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown. ...
...And 12 more matches
<input type="url"> - HTML: Hypertext Markup Language
ny values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requirements: users can select from this predefined list or provide a different value. maxlength the maximum number of characters (as utf-16 code units) the user can enter into the url input. this must be an integer value 0 or higher. if no maxlength is
specified, or an invalid value is
specified, the url input has no maximum length. this value must also be greater than or equal to the value of minlength. the input will fail constraint validation if the length of the text value of the field is greater than maxlength utf-16 code units long. constraint validation is only applied when the value is changed by the user. minlength the minimum number of chara...
... the input will fail constraint validation if the length of the text value of the field is greater than maxlength utf-16 code units long. constraint validation is only applied when the value is changed by the user. minlength the minimum number of characters (as utf-16 code units) the user can enter into the url input. ...
...if the length of the text value of the field is greater than maxlength utf-16 code units long. constraint validation is only applied when the value is changed by the user. minlength the minimum number of characters (as utf-16 code units) the user can enter into the url input. this must be an non-negative integer value smaller than or equal to the value
specified by maxlength. ...
...And 12 more matches
cfx - Archive of obsolete content
r the version of firefox it finds in the platform's default install path. supported options you can point cfx run at a different package.json file using the --pkgdir option, and pass arguments to your add-on using the --static-args option. you can specify a different version of the host application using the --binary option, passing in the path to the application binary to run. the path may be
specified as a full path or may be relative to the current directory. but note that the version must be 4.0b7 or later. cfx run runs the host application with a new profile. you can specify an existing profile using the --profiledir option, and this gives you access to that profile's history, bookmarks, and other add-ons. this enables you to run your add-on alongside debuggers like firebug. see "using --...
...ter. cfx run runs the host application with a new profile. you can specify an existing profile using the --profiledir option, and this gives you access to that profile's history, bookmarks, and other add-ons. this enables you to run your add-on alongside debuggers like firebug. see "using --profiledir" for more information. -b binary, --binary=binary use the host application binary
specified in binary. binary may be
specified as a full path or as a path relative to the current directory. --binary-args=cmdargs pass extra arguments to the binary being executed (for example, firefox). for example, to pass the -jsconsole argument to firefox, which will launch the javascript error console, try the following: cfx run --binary-args -jsconsole to pass multipl...
...mple, firefox). for example, to pass the -jsconsole argument to firefox, which will launch the javascript error console, try the following: cfx run --binary-args -jsconsole to pass multiple arguments, or arguments containing spaces, quote them: cfx run --binary-args '-url "www.mozilla.org" -jsconsole' --extra-packages=extra_packages extra packages to include,
specified as a comma-separated list of package names. -g config, --use-config=config pass a set of options by referencing a named configuration. -p profiledir, --profiledir=profiledir use an existing profile located in profiledir. profiledir may be
specified as a full path or as a path relative to the current directory. see "using --profiledir" for more information. ...
...And 11 more matches
tabbrowser - Archive of obsolete content
the browser which will monitor loaded documents. the progress listener should implement the nsiwebprogresslistener interface. addtab( url, referreruri, charset, postdata, owner, allowthirdpartyfixup ) addtab( url, {referreruri: ..., charset: ..., postdata: ..., owner: ..., allowthirdpartyfixup: ..., relatedtocurrent: ... }) return type: tab element opens a new tab that loads a page with the
specified url. the rest of the parameters are optional. the row of tabs will appear if needed. firefox 3.6 note the second form of this method was added in firefox 3.6; it allows you to specify the parameters by name, in any order. it also adds the relatedtocurrent parameter; firefox uses this to decide whether the new tab should be inserted next to the current tab. see code snippets: tabbed br...
...in firefox add several new tabs to the end of the existing tabs. the argument should be an array of objects, one for each document to load. the objects may be defined in script and contain a uri property for the url of the page to load. a referreruri property may also be optionally used to set the referrer page. getbrowseratindex( index ) return type: browser element returns a browser at the
specified tab index. getbrowserindexfordocument( document ) return type: integer returns the index of the browser for the
specified document in the tabbrowser the method was invoked on. the returned index is dependent on the tabs in the tabbrowser and is invalidated when the tab ordering changes. it should not be used to track per-tab data during a session; the use of linkedpanel on the corresponding t...
...document in the tabbrowser the method was invoked on. the returned index is dependent on the tabs in the tabbrowser and is invalidated when the tab ordering changes. it should not be used to track per-tab data during a session; the use of linkedpanel on the corresponding tab is preferred instead. ...
...And 11 more matches
NSS Tools modutil
to see a usage string, issue the command without options. options and arguments options specify an action. option arguments modify an action. the options and arguments for the modutil command are defined as follows: options -create create new secmod.db, key3.db, and cert8.db files. use the -dbdir directory argument to specify a directory. if any of these databases already exist in a
specified directory, the security module database tool displays an error message. -list [modulename] display basic information about the contents of the secmod.db file. use modulename to display detailed information about a particular module and its slots and tokens. -add modulename add the named pkcs #11 module to the database. use this option with the -libfile, -ciphers, and -mechanisms arguments. ...
...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. -undefault modulename specify the security mechanisms for which the named module will not be a default provider. the security mechanisms are
specified with the -mechanisms mechanism-list argument. -enable modulename enable all slots on the named module. use the [-slot slotname] argument to enable a specific slot. -disable modulename disable all ...
... the -jar jar-file option. this directory should be one below which it is appropriate to store dynamic library files (for example, a server's root directory or the netscape communicator root directory). -tempdir temporary-directory the temporary directory is the location where temporary files will be created in the course of installation by the -jar jar-file option. if no temporary directory is
specified, the current directory will be used. -pwfile old-password-file specify a text file containing a token's existing password so that a password can be entered automatically when the -changepw tokenname option is used to change passwords. -newpwfile new-password-file specify a text file containing a token's new or replacement password so that a password can be entered automatically with the -chan...
...And 11 more matches
IAccessibleTable
this object could be an iaccessible or an iaccessible2. [propget] hresult accessibleat( [in] long row, [in] long column, [out] iunknown accessible ); parameters row the 0 based row index for which to retrieve the cell. column the 0 based column index for which to retrieve the cell. accessible if both row and column index are valid then the corresponding access...
...is nothing to return, [out] value is null. s_ok. childindex() translates the given row and column indexes into the corresponding cell index. [propget] hresult childindex( [in] long rowindex, [in] long columnindex, [out] long cellindex ); parameters rowindex 0 based row index for the cell. columnindex 0 based column index for the cell. cellindex returns the 0 based index of the cell at the
specified row and column indexes. return value e_invalidarg if bad [in] passed, [out] value is 0. s_ok. columndescription() returns the description text of the
specified column in the table. [propget] hresult columndescription( [in] long column, [out] bstr description ); parameters column the 0 based index of the column for which to retrieve the description. description returns the description text ...
...d column indexes. return value e_invalidarg if bad [in] passed, [out] value is 0. s_ok. columndescription() returns the description text of the
specified column in the table. [propget] hresult columndescription( [in] long column, [out] bstr description ); parameters column the 0 based index of the column for which to retrieve the description. description returns the description text of the
specified column in the table if such a description exists. otherwise a null pointer is returned. return value e_invalidarg if bad [in] passed, [out] value is null. s_false if there is nothing to return, [out] value is null. s_ok. ...
...And 11 more matches
Proxy Auto-Configuration (PAC) file - HTTP
ibing the configuration. the format of this string is defined in return value format below. ...
... defined in return value format below. ...
...in that case, the next value will be used, etc. the b...
...And 11 more matches
SVG documentation index - SVG: Scalable Vector Graphics
ew, responsive design, svg, svg attribute, svg reference, vector graphics svg elements can be modified using attributes that specify details about exactly how the element should be handled or rendered. 14 svg conditional processing attributes intermediate, needsexample, property, reference, svg the svg conditional processing attributes are all the attributes that can be
specified on some svg elements to control whether or not the element on which it appears should be rendered. 15 svg core attributes attribute, intermediate, reference, svg the svg core attributes are all the common attributes that can be
specified on any svg element. 16 svg event attributes advanced, attribute, draft, landing, needsupdate, svg event attributes alwa...
...n attributes that can be
specified on any svg element. 16 svg event attributes advanced, attribute, draft, landing, needsupdate, svg event attributes always have their name starting with "on" followed by the name of the event for which they are intended. they specifies some script to run when the event of the given type is dispatched to the element on which the attributes are
specified. 17 svg presentation attributes attribute, beginner, draft, reference, svg svg presentation attributes are css properties that can be used as attributes on svg elements. ...
... 19 accent-height deprecated, needsexample, svg, svg attribute the accent-height attribute defines the distance from the origin to the top of accent characters, measured by a distance within the font coordinate system. ...
...And 11 more matches
Introduction to the JavaScript shell
ions there are a number of command line options you can specify to control the shell. these are summarized below. be sure to use -h with your own jsshell to see if there is anything undocumented. -c, --compileonly tells the shell to compile the program but not run it. this is a convenient way to quickly check for syntax errors in your program without actually running it. -e script runs the
specified script, which is a literal string containing the code to execute. -f filename runs the javascript program
specified by filename. -i enables interactive mode. (default if no filename is provided.) --no-ion disables the optimizing jit compiler. --no-baseline disables the baseline jit compiler. -p if the first line of the file is "/usr/bin/env js -p", then the file content will be interpre...
...from javascript programs or in interactive mode. note: this list is incomplete and overlaps with shell global objects. see js/src/shell/js.cpp (around shell_functions) for more. build() returns the date and time at which the javascript shell was built. note: clear() with no parameters really clears everything. this includes all these built-in functions. clone(function, [scope]) clones the
specified function object. if scope isn't
specified, the new object's parent is the same as the original object's. otherwise, the new object is placed in the scope of the object
specified by scope. countheap([start[, kind]]) added in spidermonkey 1.8 count the number of live gc things in the heap, or things reachable from start when it is given and is not null. kind is either 'all' (default) to count all...
..., 'qname', 'namespace', 'xml' to count only things of that kind. dumpheap([filename[, start[, tofind[, maxdepth[, toignore]]]]]) added in spidermonkey 1.8 dump the graph of all existing objects (or a specific interesting subgraph) to a file. for more information, see the c/c++ version of this function, js_dumpheap. evalcx(string[, object]) evaluates the javascript code in string. if object is
specified, the code is executed in that object, treating it as a sandbox. if string is empty and object is not
specified, evalcx() returns a new object with eager standard classes. if string is "lazy" and object is not
specified, evalcx() returns a new object with lazy standard classes. note: evalcx() is only useful for people doing deep internal work on the javascript engine, for testing evalinsandbox-...
...And 10 more matches
mozIStorageBindingParams
void bindblobbyinde...
... void bindblobbyindex( in unsigned long aindex, [array, const, size_is(avaluesize)] in octet avalue, in unsigned long avaluesize ); parameters aindex the zero-based numerical index for the parameter to be bound. ...
...ndbyindex() binds a to the
specified index. void bindbyindex( in unsigned long aindex, in nsivariant avalue ); parameters aindex the zero-based numerical index for the parameter to be bound. this will be one less than the number used in the sql (<code>?1</code> maps to <code>0</code>, and so on). avalue to be bound to the
specified index. bindblobbyindex() binds a blob to the
specified index. void bindblobbyindex( in unsigned long aindex, [array, const, size_is(avaluesize)] in octet avalue, in unsigned long avaluesize ); parameters aindex the zero-based numerical index for the parameter to be bound. this will be one less than the number used in the sql (<code>?1</code> maps to <code>0</code>, and so on). avalue to be bound to the
specified index. avaluesize the...
...And 10 more matches
HTML documentation index - HTML: Hypertext Markup Language
global attribute, html, html microdata, microdata, reference, itemid the itemid global attribute provides microdata in the form of a unique, global identifier of an item. 22 itemprop attribute, global attribute, html, html microdata, microdata, reference the itemprop global attribute is used to add properties to an item. every html element can have an itemprop attribute
specified, and an itemprop consists of a name-value pair. each name-value pair is called a property, and a group of one or more properties forms an item. property values are either a string or a url and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <track>, and <video>. 23 itemref attribute, global attribute, ht...
...: max attribute, attributes, constraint validation, html, reference the max attribute defines the maximum value that is acceptable and valid for the input containing the attribute. if the value of the element is greater than this, the element fails constraint validation. this value must be greater than or equal to the value of the min attribute. if the max attribute is present by is not
specified or is invalid, no max value is applied. if the max attribute is valid and a non-empty value is greater than the maximum allowed by the max attribute, constraint validation will prevent form submission. 41 html attribute: maxlength attribute, attributes, constraint validation the maxlength attribute defines the maximum number of characters (as utf-16 code units) the user can e...
...alue 0 or higher. 42 html attribute: min attribute, attributes, constraint validation, min the min attribute defines the minimum value that is acceptable and valid for the input containing the attribute. if the value of the element is less than this, the element fails constraint validation. this value must be less than or equal to the value of the max attribute. ...
...And 9 more matches
PKCS #11 Module Specs
the application must pass to the pkcs #11 library at c_initialize() time (see below). 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. if the library is not
specified, the line represents some application specific meta configuration data. other applications and libraries can safely ignore this line. if the name is not
specified, the application can use the library path to describe the pkcs #11 library in any ui it may have. if the parameter is not
specified, no parameters are passed to the pkcs #11 module. if the application/library does not find its applic...
...this line. if the name is not
specified, the application can use the library path to describe the pkcs #11 library in any ui it may have. if the parameter is not
specified, no parameters 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. parameter passing if the parameter is
specified, the application/library will strip the value out, processing any outter quotes and escapes appropriately, and pass the parameter to the pkcs #11 library when it calls c_initialize(). a new ck_c_initialize_args structure is defined as typedef struct ck_c_initialize_args { ck_createmutex createmutex; ck_destroymutex destroymutex; ck_lockmutex lockmutex; ck_unlockmutex unlockmutex; ck_f...
...ze(). a new ck_c_initialize_args structure is defined as typedef struct ck_c_initialize_args { ck_createmutex createmutex; ck_destroymutex destroymutex; ck_lockmutex lockmutex; ck_unlockmutex unlockmutex; ck_flags flags; ck_void_ptr libraryparameters; ck_void_ptr preserved; } ck_c_initialize_args; applications/libraries must set libraryparameters to null if no parameter value is
specified. pkcs #11 libraries which accept parameters must check if the 'new' preserved field is null if and only if libraryparameters field is not null. nss specific parameters in module specs here are the nss application specific parameters in use. this data is currently stored in secmod.db or pkcs11.txt. this isn't part of the generic spec (that is other applications need not parse it, nor pkcs #11 mo...
...And 8 more matches
NSS tools : certutil
nts. 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. -d delete a certificate from the certificate database. --rename ...
... 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 argument to specify explicitly whether to delete a dsa, rsa, or ecc key. if you don't use the -k argument, the option looks for an rsa key matching the
specified nickname. when you delete keys, be sure to also remove any certificates associated with those keys from the certificate database, by using -d. some smart cards (for example, the litronic card) do not let you remove a public key you have generated. in such a case, only the private key is deleted from the key pair. you can ...
...les. certutil supports two types of databases: the legacy security databases (cert8.db, key3.db, and secmod.db) and new sqlite databases (cert9.db, key4.db, and pkcs11.txt). nss recognizes the following prefixes: · sql: requests the newer database · dbm: requests the legacy database if no prefix is
specified the default type is retrieved from nss_default_db_type. if nss_default_db_type is not set then dbm: is the default. --dump-ext-val oid for single cert, print binary der encoding of extension oid. -e check a certificate's signature during the process of validating a certificate. --email email-address specify the email add...
...And 8 more matches
<input type="image"> - HTML: Hypertext Markup Language
used to create graphical submit buttons, i.e. submit buttons that take the form of an image rather than text. 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. value none — the value attribute should not be
specified. events none. supported common attributes alt, src, width, height, formaction, formenctype, formmethod, formnovalidate, formtarget idl attributes none. methods none. value <input type="image"> elements do not accept value attributes. the path to the image to be displayed is
specified in the src attribute. additional attributes in addition ...
...coding the text using an algorithm such as encodeuri(). multipart/form-data uses the formdata api to manage the data, allowing for files to be submitted to the server. you must use this encoding type if your form includes any <input> elements of type file (<input type="file">). text/plain plain text; mostly useful only for debugging, so you can easily see the data that's to be submitted. if
specified, the value of the formenctype attribute overrides the owning form's action attribute. this attribute is also available on <input type="submit"> and <button> elements. formmethod a string indicating the http method to use when submitting the form's data; this value overrides any method attribute given on the owning form. permitted values are: get a url is constructed by starting with the ur...
.... this overrides the value of the novalidate attribute on the element's owning form. this attribute is also available on <input type="submit"> and <button> elements. formtarget a string which specifies a name or keyword that indicates where to display the response received after submitting the form. the string must be the name of a browsing context (that is, a tab, window, or <iframe>. a value
specified here overrides any target given by the target attribute on the <form> that owns this input. in addition to the actual names of tabs, windows, or inline frames, there are a few special keywords that can be used: _self loads the response into the same browsing context as the one that contains the form. this will replace the current document with the received data. this is the default value use...
...And 8 more matches
Date - JavaScript
-independent format. date objects contain a number that represents milliseconds since 1 january 1970 utc. tc39 is working on temporal, a new date/time api. read more about it on the igalia blog and fill out the survey. it needs real-world feedback from web developers, but is not yet ready for production use! description the ecmascript epoch and timestamps a javascript date is fundamentally
specified as the number of milliseconds that have elapsed since midnight on january 1, 1970, utc. this date and time is the same as the unix epoch, which is the predominant base value for computer-recorded date and time values. note: it's important to keep in mind that while the time value at the heart of a date object is utc, the basic methods to fetch the date and time or its components all work in the ...
...rsing of strings with date.parse is strongly discouraged due to browser differences and inconsistencies. date.utc() accepts the same parameters as the longest form of the constructor (i.e. 2 to 7) and returns the number of milliseconds since january 1, 1970, 00:00:00 utc, with leap seconds ignored. instance methods date.prototype.getdate() returns the day of the month (1–31) for the
specified date according to local time. date.prototype.getday() returns the day of the week (0–6) for the
specified date according to local time. date.prototype.getfullyear() returns the year (4 digits for 4-digit years) of the
specified date according to local time. date.prototype.gethours() returns the hour (0–23) in the
specified date according to local time. date.prototype.getmilliseconds() ...
...ype.getday() returns the day of the week (0–6) for the
specified date according to local time. date.prototype.getfullyear() returns the year (4 digits for 4-digit years) of the
specified date according to local time. date.prototype.gethours() returns the hour (0–23) in the
specified date according to local time. date.prototype.getmilliseconds() returns the milliseconds (0–999) in the
specified date according to local time. date.prototype.getminutes() returns the minutes (0–59) in the
specified date according to local time. date.prototype.getmonth() returns the month (0–11) in the
specified date according to local time. date.prototype.getseconds() returns the seconds (0–59) in the
specified date according to local time. date.prototype.gettime() returns the numeric value of...
...And 8 more matches
Content type - SVG: Scalable Vector Graphics
when used in the value of a property in a stylesheet, an <angle> is defined as follows: angle ::= number (~"deg" | ~"grad" | ~"rad")? where deg indicates degrees, grad indicates grads and rad indicates radians. for properties defined in css2, an angle unit identifier must be provided. ...
...indicates radians. for properties defined in css2, an angle unit identifier must be provided. for angle values in svg-specific properties and their corresponding presentation attributes, the angle unit identifier is optional. if not provided, the angle value is assumed to be in degrees. in presentation attributes for all properties, whether defined in svg1.1 or in css2, the angle identifier, if
specified, must be in lower case. when angles are used in an svg attribute, <angle> is instead defined as follows: angle ::= number ("deg" | "grad" | "rad")? the unit identifiers in such <angle> values must be in lower case. in the svg dom, <angle> values are represented using svgangle or svganimatedangle objects. anything <anything> the basic type <anything> is a sequence of zero or more...
...words 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 (#ffffff) can be
specified with the short notation (#fff) and removes any dependencies on the color depth of the display. the format of an rgb value in the functional notation is an rgb start-function, followed by a comma-separated list of three numerical values (either three integer values or three percentage values) followed by ")". an rgb start-function is the case-insensitive string "rgb(", for example "rgb(" or "rgb("...
...And 8 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
> tag, which mozilla does not support, as an html element that can be positioned anywhere. in mozilla, you can position any element using the <div> tag, which internet explorer uses as well and which you'll find in the html specification. table 1. methods used to access elements method description document.getelementbyid( aid ) returns a reference to the element with the
specified id. document.getelementsbytagname( atagname ) returns an array of elements with the
specified name in the document. traverse the dom mozilla supports the w3c dom apis for traversing the dom tree through javascript (see table 2). the apis exist for each node in the document and allow walking the tree in any direction. internet explorer supports these apis as well, but it also s...
...is as well, but it also supports its legacy apis for walking a dom tree, such as the children property. table 2. methods used to traverse the dom property/method description childnodes returns an array of all child nodes of the element. firstchild returns the first child node of the element. getattribute( aattributename ) returns the value for the
specified attribute. hasattribute( aattributename ) returns a boolean stating if the current node has an attribute defined with the
specified name. haschildnodes() returns a boolean stating whether the current node has any child nodes. lastchild returns the last child node of the element. nextsibling returns the node immediately following the current one. ...
...rn their string value. for attribute nodes, the attribute value is returned. for all other nodes, null is returned. ownerdocument returns the document object containing the current node. parentnode returns the parent node of the current node. previoussibling returns the node immediately preceding the current one. removeattribute( aname ) removes the
specified attribute from the current node. setattribute( aname, avalue ) sets the value of the
specified attribute with the
specified value. internet explorer has a nonstandard quirk, where many of these apis will skip white space text nodes that are generated, for example, by new line characters. mozilla will not skip these, so sometimes you need to distinguish these nodes. every node h...
...And 7 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
string a string which is passed to the search component. autofill obsolete since gecko 1.9.1 type: boolean note: applies to: thunderbird and seamonkeyif set to true, the best match will be filled into the textbox as the user types. if false, the default, the value will not be filled in until the user selects an item. as of gecko 1.9.1, this attribute is now always
specified in lower case. autofillaftermatch obsolete since gecko 1.9.1 type: boolean if set to true, the entire text of the best match will be displayed at the end of the input. if false, only the text that hasn't been entered yet will be filled in. the textbox.autofill attribute must be set to true to use this feature. as of gecko 1.9.1, this attribute is superseded by the completedefaultindex at...
... crop type: boolean this attribute is not used and is only provided for compatibility with the menulist element. disableautocomplete obsolete since gecko 1.9.1 type: boolean if true, the autocomplete behavior will be disabled. you might use a script to change this attribute. if false, the default, autocomplete is enabled. as of gecko 1.9.1, this attribute is now always
specified in lower case. disableautocomplete new in thunderbird 3requires seamonkey 2.0 type: boolean if true, the autocomplete behavior will be disabled. you might use a script to change this attribute. if false, the default, autocomplete is enabled. disabled type: boolean indicates whether the element is disabled or not. if this attribute is set, the element is disabled...
...ropdown menu of all available results. focused type: boolean this attribute is true if the element is focused. forcecomplete obsolete since gecko 1.9.1 type: boolean if true, the textbox will be filled in with the best match when it loses the focus. if false, it will only be filled in when the user selects an item. as of gecko 1.9.1, this attribute is now always
specified in lower case. forcecomplete new in thunderbird 3requires seamonkey 2.0 type: boolean if true, the textbox will be filled in with the best match when it loses the focus. if false, it will only be filled in when the user selects an item. highlightnonmatches new in thunderbird 3 requires seamonkey 2.0 type: boolean if true, then the autocomplete field will be hig...
...And 7 more matches
NSS tools : modutil
alent 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, and module databases. use the -dbdir directory argument to specify a directory. if any of these databases already exist in a
specified directory, modutil returns an error message. -default modulename specify the security mechanisms for which the named module will be a default provider. the security mechanisms are
specified with the -mechanisms argument. -delete modulename delete the named module. the default nss pkcs #11 module cannot be deleted. -disable modulename disable all slots on the named module. use the -slot ...
... details the special script needed to perform an installation through a server or with modutil. -list [modulename] display basic information about the contents of the secmod.db file. specifying a modulename displays detailed information about a particular module and its slots and tokens. -rawadd add the module spec string to the secmod.db database. -rawlist display the module specs for a
specified module or for all loadable modules. -undefault modulename specify the security mechanisms for which the named module will not be a default provider. the security mechanisms are
specified with the -mechanisms argument. arguments module give the security module to access. modulespec give the security module spec to load into the security database. -ciphers cipher-enable-list enable spec...
...e (like secmod.db) to load. -slot slotname specify a particular slot to be enabled or disabled with the -enable or -disable options. -string config_string pass a configuration string for the module being added to the database. -tempdir temporary-directory give a directory location where temporary files are created during the installation by the -jar option. if no temporary directory is
specified, the current directory is used. usage and examples creating database files before any operations can be performed, there must be a set of security databases available. modutil can be used to create these files. the only required argument is the database that where the databases will be located. modutil -create -dbdir [sql:]directory adding a cryptographic module adding a pkcs #11 module ...
...And 7 more matches
certutil
nd 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 delete a certificate from the certificate database. -e ad...
... -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 argument to specify explicitly whether to delete a dsa, rsa, or ecc key. if you don't use the -k argument, the option looks for an rsa key matching the
specified nickname. when you delete keys, be sure to also remove any certificates associated with those keys from the certificate database, by using -d. some smart cards (for example, the litronic card) do not let 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 ...
...prevent unauthorized access to this file. -g keysize set a key size to use when generating new public and private key pairs. the minimum is 512 bits and the maximum is 8192 bits. the default is 1024 bits. any size between the minimum and maximum is allowed. -h tokenname specify the name of a token to use or act on. unless
specified otherwise the default token is an internal slot (specifically, internal slot 2). this slot can also be explicitly named with the string "internal". an internal slots is a virtual slot maintained in software, rather than a hardware device. internal slot 2 is used by key and certificate services. internal slot 1 is used by cryptograp...
...And 7 more matches
NSS tools : modutil
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, and module databases. use the -dbdir directory argument to specify a directory. if any of these databases already exist in a
specified directory, modutil returns an error message. -default modulename specify the security mechanisms for which the named module will be a default provider. the security mechanisms are
specified with the -mechanisms argument. -delete modulename delete the named module. the default nss pkcs #11 module cannot be deleted. -di...
... through a server or with modutil. -list [modulename] display basic information about the contents of the secmod.db file. specifying a modulename displays detailed information about a particular module and its slots and tokens. -rawadd add the module spec string to the secmod.db database. -rawlist display the module specs for a
specified module or for all loadable modules. -undefault modulename specify the security mechanisms for which the named module will not be a default provider. the security mechanisms are
specified with the -mechanisms argument. arguments module give the security module to access. modulespec give the security module spec to...
...lot to be enabled or disabled with the -enable or -disable options. -string config_string pass a configuration string for the module being added to the database. -tempdir temporary-directory give a directory location where temporary files are created during the installation by the -jar option. if no temporary directory is
specified, the current directory is used. usage and examples creating database files before any operations can be performed, there must be a set of security databases available. modutil can be used to create these files. the only required argument is the database that where the databases will be located. modutil -create -dbdir [sql:]directory adding a cryptographic module adding...
...And 7 more matches
mozIStorageStatement
ment in order to not leak. finalize will be called for you when the reference count on the statement goes to zero. clone() creates a copy of the statement whose state will be mozistoragestatement.moz_storage_statement_ready. mozistoragestatement clone(); return value a mozistoragestatement that is a copy of the current statement. getparametername() obtains the name of the parameter for the
specified index. autf8string getparametername( in unsigned long aparamindex ); parameters aparamindex the zero-based numerical index for the parameter to be bound. this will be one less than the number used in the sql (<code>?1</code> maps to <code>0</code>, and so on). return value an autf8string representing the parameter name for the
specified index. getparameterindex() obtains the ind...
...this method was added in 1.9.0. ...
... parameter 'foo', name's format is ':foo' in 1.9.0 and 1.9.1. in 1.9.2 the ':' was dropped and name's value should be just 'foo'. see bug 528166 for details. return value the zero-based numerical index for the parameter to be bound. this will be one less than the number used in the sql (<code>?1</code> maps to <code>0</code>, and so on). getcolumnname() obtains the name of the column for the
specified index. autf8string getcolumnname( in unsigned long acolumnindex ); parameters acolumnindex the zero-based numerical index for the column to get data from. return value an autf8string with the of the column name for the
specified index. getcolumnindex() obtains the index of the column with the
specified name. unsigned long getcolumnindex( in autf8string aname ); parameters ...
...And 7 more matches
nsIZipWriter
sion 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 entries within them, some zip utilities may have problems with that, so it m...
...s "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. ...
...f 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 addentryfile( in autf8string azipentry, in print32 acompression, in nsifile afile, in boolean aqueue ); parameters azipentry the path of the file entry to add to the zip file. this is the path it will be located at within the zip file. note: you must use forward sla...
...And 7 more matches
Element - Web APIs
he most general base class from which all element objects (i.e. objects that represent elements) in a document inherit. it only has methods and properties common to all kinds of elements. more specific classes inherit from element. for example, the htmlelement interface is the base interface for html elements, while the svgelement interface is the basis for all svg elements. most functionality is
specified further down the class hierarchy. languages outside the realm of the web platform, like xul through the xulelement interface, also implement element. <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;" ...
...domstring representing the markup of the element including its content. when used as a setter, replaces the element with nodes parsed from the given string. element.part represents the part identifier(s) of the element (i.e. set using the part attribute), returned as a domtokenlist. element.prefix read only a domstring representing the namespace prefix of the element, or null if no prefix is
specified. nondocumenttypechildnode.previouselementsibling read only is a element, the element immediately preceding the given one in the tree, or null if there is no sibling element. element.scrollheight read only returns a number representing the scroll view height of an element. element.scrollleft is a number representing the left scroll offset of the element. element.scrollleftmax read only ...
...n error occurs while attempting to change into full-screen mode. methods inherits methods from its parents node, and its own parent, eventtarget, and implements those of parentnode, childnode, nondocumenttypechildnode, and animatable. eventtarget.addeventlistener() registers an event handler to a specific event type on the element. element.attachshadow() attaches a shadow dom tree to the
specified element and returns a reference to its shadowroot. element.animate() a shortcut method to create and run an animation on an element. returns the created animation object instance. element.closest() returns the element which is the closest ancestor of the current element (or the current element itself) which matches the selectors given in parameter. element.createshadowroot() creates...
...And 7 more matches
KeyframeEffect.setKeyframes() - Web APIs
empty keyframes. there are two different ways to format keyframes: an array of objects (keyframes) consisting of properties and values to iterate over. this is the canonical format returned by the getkeyframes() method. ...
...yframe can be
specified by providing an offset value. element.animate([ { opacity: 1 }, { opacity: 0.1, offset: 0.7 }, { opacity: 0 } ], 2000); note: offset values, if provided, must be between 0.0 and 1.0 (inclusive) and arranged in ascending order. it is not necessary to specify an offset for every keyframe. keyframes without a
specified offset will be evenly spaced between adjacent keyframes. the easing to apply between keyframes can be
specified by providing an easing value as illustrated below. ...
... an object containing key-value pairs consisting of the property to animate and an array of values to iterate over. ...
...And 7 more matches
Keyframe Formats - Web APIs
ined below. syntax there are two different ways to format keyframes: an array of objects (keyframes) consisting of properties and values to iterate over. this is the canonical format returned by the getkeyframes() method. ...
...yframe can be
specified by providing an offset value. element.animate([ { opacity: 1 }, { opacity: 0.1, offset: 0.7 }, { opacity: 0 } ], 2000); note: offset values, if provided, must be between 0.0 and 1.0 (inclusive) and arranged in ascending order. it is not necessary to specify an offset for every keyframe. keyframes without a
specified offset will be evenly spaced between adjacent keyframes. the easing to apply between keyframes can be
specified by providing an easing value as illustrated below. ...
... an object containing key-value pairs consisting of the property to animate and an array of values to iterate over. ...
...And 7 more matches
system - CSS: Cascading Style Sheets
the system descriptor specifies the algorithm to be used for converting the integer value of a counter to a string representation. it is used in a @counter-style to define the behavior of the defined style. if the algorithm
specified in the system descriptor is unable to construct the representation for a particular counter value, then that value's representation will be constructed using the fallback system provided. syntax /* keyword values */ system: cyclic; system: numeric; system: alphabetic; system: symbolic; system: additive; system: fixed; /* combined values */ system: fixed 3; system: extends decimal; this may take one of three forms: one of the keyword values cyclic, numeric, alphabetic, symbolic, additive, or fixed. the keyword value fixed along with an integer. the keyword...
...word value fixed along with an integer. the keyword value or extends along with a @counter-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 finite 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 finite. at least one symbol must be
specified in the symbols descriptor or the counter style is not valid. also an optional <integer> can be ...
...if this integer is omitted, value of the first integer is taken as 1. symbolic cycles through the provided list of symbols. ...
...And 7 more matches
tabs/utils - Archive of obsolete content
functions for working with xul tabs and the xul tabbrowser object. globals functions activatetab(tab, window) set the
specified tab as the active, or selected, tab. parameters tab : tab a xul tab element to activate. window : window a browser window. gettabbrowser(window) get the tabbrowser element for the given browser window. parameters window : window a browser window. returns tabbrowser : gettabcontainer(window) get the tabbrowser's tabcontainer property. parameters window : window a browser window. returns tabcontainer : gettabs(window) returns the tabs for the
specified window. if you omit window, this function will return tabs across all the browser's windows. however, if your add-on has not opted into private browsing, then the function will exclude all tabs tha...
...rt private browsing, refer to the documentation for the private-browsing module. parameters window : nsiwindow optional. returns array : an array of tab elements. getactivetab(window) given a browser window, get the active, or selected, tab. parameters window : window a browser window. returns tab : the currently selected tab. getownerwindow(tab) get the browser window that owns the
specified tab. parameters tab : tab a browser tab. returns window : a browser window. opentab(window, url, options) open a new tab in the
specified browser window. parameters window : window the browser window in which to open the tab. url : string url for the document to load. options : object optional options: name type inbackground boolean if true,...
...bject optional options: name type inbackground boolean if true, open the new tab, but keep the currently selected tab selected. if false, make the new tab the selected tab. optional, defaults to false. pinned boolean pin this tab. optional, defaults to false. returns tab : the new tab. istabopen(tab) test whether the
specified tab is open. parameters tab : tab a xul tab element. returns boolean : true if the tab is open, otherwise false. closetab(tab) close the
specified tab. parameters tab : tab a xul tab element. geturi(tab) get the
specified tab's uri. parameters tab : tab a xul tab element. returns string : the current uri. gettabbrowserfortab(tab) get the
specified tab's tabbrowser. parameters ...
...And 6 more matches
Space Manager Detailed Design - Archive of obsolete content
ize); static void shutdown(); /* * get the frame that's associated with the space manager. this frame * created the space manager, and the world coordinate space is * relative to this frame. * * you can use queryinterface() on this frame to get any additional * interfaces. */ nsiframe* getframe() const { return mframe; } /** * translate the current origin by the
specified (dx, dy). this * creates a new local coordinate space relative to the current * coordinate space. */ void translate(nscoord adx, nscoord ady) { mx += adx; my += ady; } /** * returns the current translation from local coordinate space to * world coordinate space. this represents the accumulated calls to * translate(). */ void gettranslation(nscoord& ax, nscoord& ay) con...
... space. this represents the accumulated calls to * translate(). */ void gettranslation(nscoord& ax, nscoord& ay) const { ax = mx; ay = my; } /** * returns the y-most of the bottommost band or 0 if there are no bands. * * @return pr_true if there are bands and pr_false if there are no bands */ prbool ymost(nscoord& aymost) const; /** * returns a band starting at the
specified y-offset. the band data * indicates which parts of the band are available, and which parts * are unavailable * * the band data that is returned is in the coordinate space of the * local coordinate system. * * the local coordinate space origin, the y-offset, and the max size * describe a rectangle that's used to clip the underlying band of * available space, i.e. * {0...
...he region. must not be null * @param aunavailablespace the bounding rect of the unavailable space * @return ns_ok if successful * ns_error_failure if there is already a region tagged with aframe */ nsresult addrectregion(nsiframe* aframe, const nsrect& aunavailablespace); /** * resize the rectangular region associated with aframe by the
specified * deltas. the height change always applies to the bottom edge or the existing * rect. you specify whether the width change applies to the left or right edge * * returns ns_ok if successful, ns_error_invalid_arg if there is no region * tagged with aframe */ enum affectededge {leftedge, rightedge}; nsresult resizerectregion(nsiframe* aframe, nsco...
...And 6 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
d asynchronous loops and intervals and what they are useful for. introduction for a long time, the web platform has offered javascript programmers a number of functions that allow them to asynchronously execute code after a certain time interval has elapsed, and to repeatedly execute a block of code asynchronously until you tell it to stop. ...
...d what they are useful for. introduction for a long time, the web platform has offered javascript programmers a number of functions that allow them to asynchronously execute code after a certain time interval has elapsed, and to repeatedly execute a block of code asynchronously until you tell it to stop. these functions are: settimeout() execute a
specified block of code once after a
specified time has elapsed. setinterval() execute a
specified block of code repeatedly with a fixed time delay between each call. requestanimationframe() the modern version of setinterval(). executes a
specified block of code before the browser next repaints the display, allowing an animation to be run at a suitable framerate regardless of the environment it is being run in. the asynchronous code set...
... it's important to know that you can (and often will) run other code before a settimeout() call executes, or between iterations of setinterval(). ...
...And 6 more matches
Shell global objects
e are compared. and an assertion is raised if they differ. run('foo.js') run the file named by the first argument, returning the number of of milliseconds spent compiling and executing it. read('bar.js') reads the file named by the first argument, returning the content of the file as string. readline() read a single line from stdin. readlinebuf([ buf ]) emulate readline() on the
specified string. the first call with a string argument sets the source buffer. subsequent calls without an argument then read from this buffer line by line. print([exp ...]) evaluate and print expressions to stdout. printerr([exp ...]) evaluate and print expressions to stderr. putstr([exp]) evaluate and print expression without newline. datenow() return the current time with sub-ms precision. hel...
...y if enable_intl_api is defined addintlextras(obj) adds various not-yet-standardized intl functions as properties on the provided object (this should generally be intl itself). the added functions and their behavior are experimental: don't depend upon them unless you're willing to update your code if these experimental apis change underneath you. functions available if --fuzzing-safe is not
specified clone(fun[, scope]) clone function object. getselfhostedvalue() get a self-hosted value by its name. note that these values don't get cached, so repeatedly getting the same value creates multiple distinct clones. line2pc([fun,] line) map line number to pc. pc2line(fun[, pc]) map pc to line number. nestedshell(shellargs...) execute the given code in a new js shell process, passing this...
.... crash([message]) crashes the process with a moz_crash. setarmhwcapflags("flag1,flag2 flag3") on non-arm, no-op. on arm, set the hardware capabilities. the list of flags is available by calling this function with help as the flag's name wasmloop(filename, imports) performs an afl-style persistent loop reading data from the given file and passing it to thewasmeval function together with the
specified imports object. testing functions testing functions are available also on firefox via components.utils.getjstestingfunctions() functions always available gc([obj] | 'zone' [, 'shrinking']) run the garbage collector. when obj is given, gc only its zone. if zone is given, gc any zones that were scheduled for gc via schedulegc. if shrinking is passed as the optional second argument, perform ...
...And 6 more matches
IAccessibleTable2
urns the caption for the table. the returned object could be an iaccessible or an iaccessible2. [propget] hresult caption( [out] iunknown accessible ); parameters accessible if the table has a caption then a reference to it is returned, else a null pointer is returned. return value s_false if there is nothing to return, [out] value is null. s_ok. cellat() returns the accessible object at the
specified row and column in the table. this object could be an iaccessible or an iaccessible2. [propget] hresult cellat( [in] long row, [in] long column, [out] iunknown cell ); parameters row the 0 based row index for which to retrieve the cell. column the 0 based column index for which to retrieve the cell. cell if both row and column index are valid then the corresponding accessible object is ret...
...ell. column the 0 based column index for which to retrieve the cell. cell if both row and column index are valid then the corresponding accessible object is returned that represents the requested cell regardless of whether the cell is currently visible (on the screen). return value e_invalidarg if bad [in] passed, [out] value is null. s_ok. columndescription() returns the description text of the
specified column in the table. [propget] hresult columndescription( [in] long column, [out] bstr description ); parameters column the 0 based index of the column for which to retrieve the description. description returns the description text of the
specified column in the table if such a description exists. otherwise a null pointer is returned. return value e_invalidarg if bad [in] passed, [out] val...
... of the column for which to retrieve the description. description returns the description text of the
specified column in the table if such a description exists. otherwise a null pointer is returned. return value e_invalidarg if bad [in] passed, [out] value is null. s_false if there is nothing to return, [out] value is null. s_ok. iscolumnselected() returns a boolean value indicating whether the
specified column is completely selected. [propget] hresult iscolumnselected( [in] long column, [out] boolean isselected ); parameters column 0 based index of the column for which to determine whether it is selected. isselected returns true if the
specified column is selected completely and false otherwise. return value e_invalidarg if bad [in] passed, [out] value is false. s_ok. isrowselected() retu...
...And 6 more matches
inIDOMUtils
include_aliases (1<<1) content state flags the content state flags are used in a bitmask. value state 1 :active 2 :focus 4 :hover 8 :-moz-drag-over 16 :target 1<<29 :-moz-focusring methods getbindingurls() returns an array of nsiuri objects representing the current xml binding for the
specified element. nsiarray getbindingurls( in nsidomelement aelement ); parameters aelement a dom element to retrieve the bindings of. return value an array of nsiuri objects representing the current xbl binding (if any) for the element and its hierarchy of base bindings. getchildrenfornode() returns a list of dom nodes that are children of the
specified node. nsidomnodelist getchildrenforn...
...nymous nodes and any children inserted as a result of the insertion point. getcontentstate() a bit mask of the supported content state flags, which are listed in content state flags. unsigned long long getcontentstate( in nsidomelement aelement ); parameters aelement a dom element to retrieve the content states of. return value a bitmask of one of the 6 supported content state flags
specified in content state flags. getcsspropertynames() get a list of all our supported property names void getcsspropertynames( in unsigned long aflags, optional out unsigned long acount, optional [retval, array, size_is(acount)] out wstring aprops ); parameters aflags optional shorthands can be excluded or property aliases included. see constants. acount optional count aprops propertie...
...supported property names void getcsspropertynames( in unsigned long aflags, optional out unsigned long acount, optional [retval, array, size_is(acount)] out wstring aprops ); parameters aflags optional shorthands can be excluded or property aliases included. see constants. acount optional count aprops properties getcssstylerules() returns an array of the css style rules on the
specified element. nsisupportsarray getcssstylerules( in nsidomelement aelement, in domstring apseudo optional ); parameters aelement a dom element to retrieve the style rules of. apseudo optional a pseudo element, such as before. return value an nsisupportsarray containing all the style rules that currently apply to the element, in ascending order of weight. getparentfornode() returns t...
...And 6 more matches
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 the size of multiple background images, separate the value for each one wi...
... cover scales the image as large as possible without stretching the image. if the proportions of the image differ from the element, it is cropped either vertically or horizontally so that no empty space remains. auto scales the background image in the corresponding direction such that its intrinsic proportions are maintained. <length> stretches the image in the corresponding dimension to the
specified length. negative values are not allowed. <percentage> stretches the image in the corresponding dimension to the
specified percentage of the background positioning area. the background positioning area is determined by the value of background-origin (by default, the padding box). however, if the background's background-attachment value is fixed, the positioning area is instead the entire viewpor...
...d using the element() function are currently treated as images with the dimensions of the element, or of the background positioning area if the element is svg, with the corresponding intrinsic proportion. this is non-standard behavior. based on the intrinsic dimensions and proportions, the rendered size of the background image is computed as follows: if both components of background-size are
specified and are not auto: the background image is rendered at the
specified size. if the background-size is contain or cover: while preserving its intrinsic proportions, the image is rendered at the largest size contained within, or covering, the background positioning area. if the image has no intrinsic proportions, then it's rendered at the size of the background positioning area. if the background...
...And 6 more matches
font - CSS: Cascading Style Sheets
the different properties of an element'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 ...
...ing 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. ...
...erning 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 the font property may be
specified as either a single keyword, which will select a system font, or as a shorthand for various font-related properties. if font is
specified as a system keyword, it must be one of: caption, icon, menu, message-box, small-caption, status-bar. ...
...And 6 more matches
HTTP Index - HTTP
e cors request was responded to by the server with an http redirect to a url on a different origin than the original request, which is not permitted during cors requests. 29 reason: cors request not http cors, corsrequestnothttp, cross-origin, error, http, https, messages, reasons, security, console, troubleshooting cors requests may only use the https url scheme, but the url
specified by the request is of a different type. this often occurs if the url specifies a local file, using a file:/// url. 30 reason: credential is not supported if the cors header ‘access-control-allow-origin’ is ‘*’ cors, corsnotsupportingcredentials, cross-origin, error, http, https, messages, reasons, security, console, troubleshooting the cors request was attempted with t...
...rd ("*") as the value of access-control-allow-origin, which doesn't allow the use of credentials. 31 reason: did not find method in cors header ‘access-control-allow-methods’ cors, corsmethodnotfound, cross-origin, error, http, https, messages, reasons, security, console, troubleshooting the http method being used by the cors request is not included in the list of methods
specified by the response's access-control-allow-methods header. this header specifies a comma-delineated list of the http methods which may be used when using cors to access the url
specified in the request; if the request is using any other method, this error occurs. 32 reason: multiple cors header 'access-control-allow-origin' not allowed cors, corsmultiplealloworiginnotallowed, cross-ori...
...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-security-policy object-src directive specifies valid sources for the <object>, <embed...
...And 6 more matches
page-mod - Archive of obsolete content
red 1px;");' + '}' }); } }); to run this example you'll also have to have an icon file named "icon-16.png" saved in your add-on's "data" directory. you could use this icon: . private windows if your add-on has not opted into private browsing, then your page-mods will not attach content scripts to documents loaded into private windows, even if their urls match the pattern you have
specified. to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module. globals constructors pagemod(options) creates a page-mod. parameters options : object required options: name: include type: string, regexp, or array of (string or regexp) a match pattern string or an array of match patt...
...de: ["*.foo.org", "*.bar.com"], contentscript: 'window.alert("matched!");' }); see the match-pattern module for a detailed description of match pattern syntax. optional options: name: contentscriptfile type: string,array this option specifies one or more content scripts to attach to targeted documents. each script is supplied as a separate file under your add-on's "data" directory, and is
specified by a url typically constructed using the url() method of the self module's data object. var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*", contentscriptfile: data.url("my-script.js") }); from firefox 34, you can use "./my-script.js" as an alias for the resource:// url pointing to the script in your "data" directory. so you can rewri...
... var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*", contentscriptfile: "./my-script.js" }); to attach multiple scripts, pass an array of urls. var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*", contentscriptfile: [data.url("jquery.min.js"), data.url("my-script.js")] }); content scripts
specified using this option are loaded before those
specified by the contentscript option. name: contentscript type: string,array this option specifies one or more content scripts to attach to targeted documents. each script is supplied directly as a single string: var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*", contentscript: 'window.alert("matched!");' ...
...And 5 more matches
panel - Archive of obsolete content
creates transient dialogs to implement part of an add-on's user interface. usage this module exports a single constructor function panel() which constructs a new panel. a panel is a dialog. its content is
specified as html and you can execute scripts in it, so the appearance and behavior of the panel is limited only by what you can do using html, css, and javascript. the screenshot below shows a panel whose content is built from the list of currently open tabs: panels are useful for presenting temporary interfaces to users in a way that is easier for users to ignore and dismiss than a modal dialog, since panels are hidden the moment users interact with parts of the application interface outside them. a panel's content is loaded as soon as it is created, before the panel is shown, and the...
...ns when a panel is shown or hidden by listening to its show and hide events. opening a panel will close any panel created by the panel() constructor that is already open, even if that panel was opened by a different add-on sdk based extension. if you want to close an existing panel without opening a new one, you can call the hide() or the destroy() method. panel content the panel's content is
specified as html, which is loaded from the url supplied in the contenturl option to the panel's constructor. you can load remote html into the panel: var mypanel = require("sdk/panel").panel({ width: 180, height: 180, contenturl: "https://en.wikipedia.org/w/index.php?title=jetpack&useformat=mobile" }); mypanel.show(); you can also load html that's been packaged with your add-on, and this is mo...
... 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. ...
...And 5 more matches
menupopup - Archive of obsolete content
the menu will be displayed. <menupopup id="clipmenu"> <menuitem label="cut"/> <menuitem label="copy"/> <menuitem label="paste"/> </menupopup> <label value="right click for popup" context="clipmenu"/> attributes ignorekeys type: boolean if true, keyboard navigation between items in the popup is disabled. left type: integer overrides the horizontal position of the popup
specified by the showpopup method. onpopuphidden type: script code this event is sent to a popup after it has been hidden. this event may also be received while the popup is still open, but when sub-menus contained within this popup are hidden. example: <menupopup id="top" onpopuphidden="console.log('the onpopuphidden method of id=top was called.');"> <menuitem label="item 1"/> <me...
...ike the onload event is sent to a window when it is opened. position type: string the position attribute determines where the popup appears relative to the element the user clicked to invoke the popup. this allows you to place the popup on one side of a button. note that a context menu will never respect this attribute, always appearing relative to the mouse cursor. this value can be
specified either as a single word offering pre-defined alignment positions, or as 2 words specifying exactly which part of the anchor and popup should be aligned. if
specified as 2 words, the value indicates which corner or edge of the anchor (the first word) is aligned which which corner of the popup (the second word). the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, ...
...rds, the value indicates which corner or edge of the anchor (the first word) is aligned which which corner of the popup (the second word). the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcenter, topcenter or bottomcenter. the popup value (ie, the second word) can be one of topleft, topright, bottomleft or bottomright. ...
...And 5 more matches
Command line options
nd to start the application. if the option contains arguments, enter the argument after the option. some options have abbreviations, for example, "-editor" can be abbreviated as "-edit" (available abbreviations are described in the text below). in some cases, option arguments must be enclosed in quotation marks (this is noted in the option descriptions below). multiple command line options can be
specified. in general, the syntax is as follows: application -option -option "argument" -option argument examples the following examples show the use of the "-profilemanager" command, which will open the profile manager prior to starting firefox or thunderbird: windows select run from windows start menu. enter the following command: firefox -profilemanager mac os x go to applications > utilities.
...-instance. firefox -no-remote -p "another profile" note: since firefox 9, this does really mean what its name implies on all platforms, i.e. instances created with this parameter do not accept or send remote commands, see bug 650078. that means that such instances won't be re-used. also when using this argument a new instance is created in any case. -override /path/to/override.ini load the
specified override.ini file to override application.ini (browser/app/application.ini). this can be used to suppress the migration wizard at startup by loading the following override.ini. firefox only. [xre] enableprofilemigrator=0 -profilemanager start with profile manager. short form: -p without a profile name. -p "profile_name" bypass profile manager and launch application with the profile named pro...
... a new window. mail/news -addressbook start with address book. thunderbird and seamonkey only. -compose message_options start with mail composer. see syntax rules. thunderbird and seamonkey only. thunderbird -compose "to=foo@nowhere.net" -mail start with the mail client. thunderbird and seamonkey only. -news news_url start with the news client. if news_url (optional) is given, open the
specified newsgroup. thunderbird and seamonkey only. thunderbird -news news://server/group -options open options/preferences window. thunderbird only. -offline start with the offline mode. thunderbird and seamonkey only. -setdefaultmail set the application as the default email client. thunderbird only. calendar -calendar start with the calendar client. sunbird only. -showdate date show your sc...
...And 5 more matches
nsIContentPrefService
he name of the preference to observe. you may specify null to add a generic observer that is notified of all preference changes. aobserver the name of an object implementing nsicontentprefobserver that will receive notifications of changes to the preference's value. getpref() returns the value of a preference saved for a particular site. note: prior to gecko 2.0, the site could only be
specified by nsiuri. now a string can be used as well. nsivariant getpref( in nsivariant agroup, in astring aname, in nsicontentprefcallback acallback optional ); parameters agroup the group for which to retrieve a preference; this may be
specified as either a uri or as a string; in either case, the group consists of all sites matching the hostname portion of the
specified uri. specify nul...
...lback to receive the result. if desired, javascript callers can instead provide a function to call upon completion. return value the preference's value is returned; this value may be a string, integer, boolean, or any other value. the result may be null (nsidatatype:vtype_empty) if the preference's value is either null, or undefined (nsidatatype:vtype_void) if there is no saved preference by the
specified name. exceptions thrown ns_error_illegal_value if agroup is not a string, nsiuri, or null. or if aname is null or an empty string getprefs() get all preferences and their values for the
specified uri. note: prior to gecko 2.0, the site could only be
specified by nsiuri. now a string can be used as well. nsipropertybag2 getprefs( in nsivariant agroup ); parameters agroup t...
...specify null to get the preferences from the global preference space; those preferences apply to all sites. ...
...And 5 more matches
nsIScriptableIO
missions); nsiuri newuri(in nsivariant auri); methods getfile() retrieves a reference to a file or directory on disk. the file does not have to exist already; this method simply creates the file reference which may then be passed to the newinputstream() or newoutputstream() method to open the file for reading or writing. files are located by starting at a known directory,
specified using a location key string. for example, if the location key is
specified as "desk" and the file name is
specified as "foo.txt", the file reference generated will refer to a file named "foo.txt" on the user's desktop. note: the filename may only be the name of a file. if you need to select a file in a subdirectory, you should get a reference to the directory, then use the file's append() method ...
...nce to the directory itself. nsifile getfile( in astring alocation, in astring afilename ); parameters alocation a location key identifying a known standard directory. the afilename parameter is treated as being local to this directory. afilename the relative path of the file to generate a reference for. return value returns an nsifile object referencing the
specified file location. exceptions thrown ns_error_invalid_arg alocation was null. getfilewithpath() returns a file reference using an absolute file path to locate the file. note: you should avoid using this method, since file paths are platform-dependent and non-portable. instead, you should use getfile() and construct the path from the base location manually. nsifile getfilewithpath( ...
...s method, since file paths are platform-dependent and non-portable. instead, you should use getfile() and construct the path from the base location manually. nsifile getfilewithpath( in astring afilepath ); parameters afilepath the absolute pathname of the file to reference, or the value of a file's persistentdescriptor. return value returns an nsifile object referencing the
specified file location. exceptions thrown ns_error_invalid_arg afilepath was null. newuri() creates a uri object that implements the nsiuri interface. nsiuri newuri( in nsivariant auri ); parameters auri the file for which to create a new nsiuri object. this parameter may be
specified either as a url string or as an nsifile object. return value returns an nsiuri objec...
...And 5 more matches
nsISessionStore
omnode undoclosetab(in nsidomwindow awindow, in unsigned long aindex); nsidomwindow undoclosewindow(in unsigned long aindex); attributes attribute type description canrestorelastsession boolean is it possible to restore the previous session. will always be false when in private browsing mode. methods deletetabvalue() deletes a value from a
specified tab. void deletetabvalue( in nsidomnode atab, in astring akey ); parameters atab the tab for which to delete the value. akey the key whose value is to be deleted. exceptions thrown this method throws a ns_error_illegal_value exception if the key doesn't exist. deletewindowvalue() deletes a value from a
specified window. void deletewindowvalue( in nsidomwindow awindow, in as...
... nsidomnode duplicatetab( in nsidomwindow awindow, in nsidomnode atab ); parameters awindow the window in which the duplicated tab will be created. ...
...ng the current state of all windows in the web browser. getclosedtabcount() returns the number of restorable tabs for a given window. unsigned long getclosedtabcount( in nsidomwindow awindow ); parameters awindow the window whose restorable tab count should be returned. return value the number of restorable tabs in the window. getclosedtabdata() returns a list of closed tabs for a
specified window. astring getclosedtabdata( in nsidomwindow awindow ); parameters awindow the browser window whose closed tab list is to be retrieved. return value a json string representing the list of closed tabs for the window
specified by awindow. the list is in last in/first out (lifo) order, so that the first item in the list is the last tab that was closed. getclosedwindowcount() retur...
...And 5 more matches
RTCPeerConnection.addTrack() - Web APIs
rs renegotiation by firing a negotiationneeded event. see starting negotiation in signaling and video calling for details. syntax rtpsender = rtcpeerconnection.addtrack(track, stream...); parameters track a mediastreamtrack object representing the media track to add to the peer connection. stream... optional one or more local mediastream objects to which the track should be added. the
specified track doesn't necessarily have to already be part of any of the
specified streams. instead, the streams are simply a way to group tracks together on the receiving end of the connection, making sure they are synchronized. any tracks that are added to the same stream on the local end of the connection will be on the same stream on the remote end. return value the rtcrtpsender object which will be...
... remote end. return value the rtcrtpsender object which will be used to transmit the media data. note: every rtcrtpsender is paired with an rtcrtpreceiver to make up an rtcrtptransceiver. the associated receiver is muted (indicating that it is not able to deliver packets) until and unless one or more streams are added to the receiver by the remote peer. exceptions invalidaccesserror the
specified track (or all of its underlying streams) is already part of the rtcpeerconnection. invalidstateerror the rtcpeerconnection is closed. usage notes adding tracks to multiple streams after the track parameter, you can optionally specify one or more mediastream objects to add the track to. only tracks are sent from one peer to another, not streams. since streams are specific to each peer, speci...
... mediastream objects to add the track to. only tracks are sent from one peer to another, not streams. since streams are specific to each peer, specifying one or more streams means the other peer will create a corresponding stream (or streams) automatically on the other end of the connection, and will then automatically add the received track to those streams. streamless tracks if no streams are
specified, then the track is streamless. this is perfectly acceptable, although it will be up to the remote peer to decide what stream to insert the track into, if any. this is a very common way to use addtrack() when building many types of simple applications, where only one stream is needed. for example, if all you're sharing with the remote peer is a single stream with an audio track and a video track, ...
...And 5 more matches
Window - Web APIs
/><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">window</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructors see also the dom interfaces. domparser domparser can parse xml or html source stored in a string into a dom document. domparser is
specified in dom parsing and serialization. image used for creating an htmlimageelement. option used for creating an htmloptionelement. staticrange read only returns a staticrange() constructor which creates a staticrange object. worker used for creating a web worker. xmlserializer converts a dom tree into xml or html source. properties this interface inherits properties from the eventtarge...
...ancels the repeated execution set using setimmediate. window.close() closes the current window. window.confirm() displays a dialog with a message that the user needs to respond to. window.dump() writes a message to the console. window.find() searches for a given string in a window. window.focus() sets focus on the current window. ...
...spond to. window.dump() writes a message to the console. window.find() searches for a given string in a window. window.focus() sets focus on the current window. window.getcomputedstyle() gets computed style for the
specified element. computed style indicates the computed values of all css properties of the element. window.getdefaultcomputedstyle() gets default computed style for the
specified element, ignoring author stylesheets. window.getselection() returns the selection object representing the selected item(s). ...
...And 5 more matches
<input type="tel"> - HTML: Hypertext Markup Language
the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requirements: users can select from this predefined list or provide a different value. maxlength the maximum number of characters (as utf-16 code units) the user can enter into the telephone number field. this must be an integer value 0 or higher. if no maxlength is
specified, or an invalid value is
specified, the telephone number field has no maximum length. this value must also be greater than or equal to the value of minlength. the input will fail constraint validation if the length of the text entered into the field is greater than maxlength utf-16 code units long. minlength the minimum number of characters (as utf-16 code units) the user can enter into the tel...
...st also be greater than or equal to the value of minlength. the input will fail constraint validation if the length of the text entered into the field is greater than maxlength utf-16 code units long. minlength the minimum number of characters (as utf-16 code units) the user can enter into the telephone number field. ...
...ue of minlength. the input will fail constraint validation if the length of the text entered into the field is greater than maxlength utf-16 code units long. minlength the minimum number of characters (as utf-16 code units) the user can enter into the telephone number field. this must be an non-negative integer value smaller than or equal to the value
specified by maxlength. ...
...And 5 more matches
<input type="text"> - HTML: Hypertext Markup Language
y values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requirements: users can select from this predefined list or provide a different value. maxlength the maximum number of characters (as utf-16 code units) the user can enter into the text input. this must be an integer value 0 or higher. if no maxlength is
specified, or an invalid value is
specified, the text input has no maximum length. this value must also be greater than or equal to the value of minlength. the input will fail constraint validation if the length of the text value of the field is greater than maxlength utf-16 code units long. constraint validation is only applied when the value is changed by the user. minlength the minimum number of char...
...the input will fail constraint validation if the length of the text value of the field is greater than maxlength utf-16 code units long. constraint validation is only applied when the value is changed by the user. minlength the minimum number of characters (as utf-16 code units) the user can enter into the text input. ...
...f the length of the text value of the field is greater than maxlength utf-16 code units long. constraint validation is only applied when the value is changed by the user. minlength the minimum number of characters (as utf-16 code units) the user can enter into the text input. this must be an non-negative integer value smaller than or equal to the value
specified by maxlength. ...
...And 5 more matches
d - SVG: Scalable Vector Graphics
e="red" d="m 10,10 h 10 m 0,10 h 10 m 0,10 h 10 m 40,20 h 10 m 0,10 h 10 m 0,10 h 10 m 0,10 h 10 m 50,50 h 10 m-20,10 h 10 m-20,10 h 10 m-20,10 h 10" /> </svg> lineto path commands lineto instructions draw a straight line from the current point (po; {xo, yo}) to the end point (pn; {xn, yn}), based on the parameters
specified. the end point (pn) then becomes the current point for the next command (po′). command parameters notes l (x, y)+ draw a line from the current point to the end point
specified by x,y. any subsequent coordinate pair(s) are interpreted as parameter(s) for implicit absolute lineto (l) command(s). formula: po′ = pn = {x, y} l (dx, dy)+ ...
...line from the current point to the end point, which is the current point shifted by dx along the x-axis and dy along the y-axis. any subsequent coordinate pair(s) are interpreted as parameter(s) for implicit relative lineto (l) command(s) (see below). ...
...+ draw a horizontal line from the current point to the end point, which is
specified by the x parameter and the current point's y coordinate. any subsequent value(s) are interpreted as parameter(s) for implicit absolute horizontal lineto (h) command(s). formula: po′ = pn = {x, yo} h dx+ draw a horizontal line from the current point to the end point, which is
specified by the current point shifted by dx along the x-axis and the current point's y coordinate. any subsequent value(s) are interpreted as parameter(s) for implicit relative horizontal lineto (h) command(s). ...
...And 5 more matches
jpm - Archive of obsolete content
jpm run -b /path/to/firefox/nightly see selecting a browser version. --binary-args cmdargs pass extra arguments to firefox. for example, to pass the -jsconsole argument to firefox and launch the browser console, try the following: jpm run --binary-args -jsconsole ...
...a starting point for your add-on development, with the following file structure: my-addon index.js package.json test test-index.js jpm run this command runs a new instance of firefox with the add-on installed: jpm run jpm run accepts the following options: -b --binary binary use the version of firefox
specified in binary. binary may be
specified as a full path or as a path relative to the current directory. jpm run -b /path/to/firefox/nightly see selecting a browser version. --binary-args cmdargs pass extra arguments to firefox. for example, to pass the -jsconsole argument to firefox and launch the browser console, try the following: jpm run --binary-args -jsconsole to pass multiple arguments, or ...
...wser console, try the following: jpm run --binary-args -jsconsole to pass multiple arguments, or arguments containing spaces, quote them: jpm run --binary-args '-url mzl.la -jsconsole' --debug run the add-on debugger attached to the add-on. -o --overload path rather than use the sdk modules built into firefox, use the modules found at path. if -o is
specified and path is omitted, jpm looks for the jetpack_root environment variable and use its value as the path. see overloading the built-in modules for more information. -p --profile= profile by default, jpm uses a clean temporary firefox profile each time you call jpm run. use the --profile option to instruct jpm to launch firefox with an existing profile. the profile val...
...And 4 more matches
Install Manifests - Archive of obsolete content
ally. examples <em:id>extensionname@example.org</em:id> <em:id>{daf44bf7-a45e-4450-979c-91cf07434c3d}</em:id> name the name of the add-on; intended for display in the ui. examples <em:name>my extension</em:name> targetapplication an object specifying an application targeted by this add-on. this means that the add-on will work with the application identified by the id property (<em:id>)
specified (for a comprehensive list of application ids and valid min/maxversions for them see valid application versions for add-on developers), from the minimum version (<em:minversion>) up to and including the maximum version (<em:maxversion>). however, while <em:maxversion> is a required property, it is ignored unless you also set <em:strictcompatibility> in the main <description> of your install.rdf (i...
...examples <em:type>2</em:type> this property was added for firefox 1.5, and is only required for add-on types other than extensions and themes. firefox 2 and previous supported a value of 16 to represent plug-ins. in firefox 3 this has been removed. version a version string identifying the version of the add-on being supplied. for firefox/thunderbird 1.0, the format must conform to the rules
specified in extension versioning, update and compatibility. for firefox/thunderbird 1.5, see toolkit version format. examples <em:version>2.0</em:version> <em:version>1.0.2</em:version> <em:version>0.4.1.2005090112</em:version> firefox 1.5 / xulrunner 1.8 - add-ons that do not use a valid version format will not be installed. the version format is different from, although backwards-compatible with, 1...
...ible with, 1.0's. for add-ons hosted on addons.mozilla.org - mozilla's update website may repackage your add-on and correct or reject malformed version strings. optional property reference you may need to supply these properties, depending on the capabilities of your add-on. abouturl the chrome:// url of the extension's about dialog box. this is only useful to extensions. if this property is
specified, in the about:addons extensions list, the about... link in the extension's context menu will show this dialog, rather than the default. note: as of gecko 2.0, the dialog receives the addon object representing your add-on as a parameter. examples <em:abouturl>chrome://myext/content/about.xul</em:abouturl> bootstrap a boolean value that tells the application whether the extension is boot-st...
...And 4 more matches
Using microformats - Archive of obsolete content
formats: 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 module. note: if a microformat by the
specified name already exists, it is replaced by the new one. add(name, definition); parameters name the name of the microformat to add to the microformat module. definition 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 = microfo...
...following flags: recurseexternalframes if true, child frames are included in the search. the default is true. showhidden if true, hidden microformats are added; otherwise they're left out. the default is false. debug specify true if debug mode is in use; otherwise, specify false. the default is false. ...
... var microformatsarray = microformats.get(name, rootelement, options, targetarray); parameters name the name of the microformat to find. rootelement required. the dom element at which to begin the search. ...
...And 4 more matches
panel - Archive of obsolete content
th truncated and the panel would not extend to the left of the anchor. ignorekeys type: boolean if false, the default value, the escape key may be used to close the panel. if true, the escape key cannot be used to close the panel. label type: string for panels with titlebars, the label on the titlebar. left type: integer overrides the horizontal position of the popup
specified by the showpopup method. level type: one of the values below specifies whether the panel appears on top of all windows, or just on top of the window the panel is in. if this attribute is not set, the popup window level depends on the platform. on linux, the default value is top, otherwise, the default value is parent. if a panel has one or more text fields, this attribute should not be s...
...ike the onload event is sent to a window when it is opened. position type: string the position attribute determines where the popup appears relative to the element the user clicked to invoke the popup. this allows you to place the popup on one side of a button. note that a context menu will never respect this attribute, always appearing relative to the mouse cursor. this value can be
specified either as a single word offering pre-defined alignment positions, or as 2 words specifying exactly which part of the anchor and popup should be aligned. if
specified as 2 words, the value indicates which corner or edge of the anchor (the first word) is aligned which which corner of the popup (the second word). the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, ...
...rds, the value indicates which corner or edge of the anchor (the first word) is aligned which which corner of the popup (the second word). the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcenter, topcenter or bottomcenter. the popup value (ie, the second word) can be one of topleft, topright, bottomleft or bottomright. positions
specified as a single word string are shortcuts for the values above. valid single-word values are after_start, after_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer. for more details, including examples, please see popup positioning titlebar type: string set the panel's titlebar attribute to the value normal to display a panel...
...And 4 more matches
tooltip - Archive of obsolete content
an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales. end the text will be cropped on its right side in left-to-right text ...
...oltip" page="true"/> <browser tooltip="pagetooltip"/> position type: string the position attribute determines where the popup appears relative to the element the user clicked to invoke the popup. this allows you to place the popup on one side of a button. note that a context menu will never respect this attribute, always appearing relative to the mouse cursor. this value can be
specified either as a single word offering pre-defined alignment positions, or as 2 words specifying exactly which part of the anchor and popup should be aligned. if
specified as 2 words, the value indicates which corner or edge of the anchor (the first word) is aligned which which corner of the popup (the second word). the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, ...
...rds, the value indicates which corner or edge of the anchor (the first word) is aligned which which corner of the popup (the second word). the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcenter, topcenter or bottomcenter. the popup value (ie, the second word) can be one of topleft, topright, bottomleft or bottomright. positions
specified as a single word string are shortcuts for the values above. valid single-word values are after_start, after_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer. for more details, including examples, please see popup positioning properties accessibletype type: integer a value indicating the type of acces...
...And 4 more matches
NPAPI plugin reference - Archive of obsolete content
for any given string or integer, there is only one npidentifier. the lifetime of npidentifiers is controlled by the browser. npn newstream requests the creation of a new data stream produced by the plug-in and consumed by the browser. npn_createobject allocates a new npobject. npn_destroystream closes and deletes a stream. npn_enumerate gets the names of the properties and methods of the
specified npobject. npn_evaluate evaluates a script in the scope of the
specified npobject. npn_forceredraw asks the plugin host to immediately (synchronously) repaint invalid areas. npn_getauthenticationinfo the function is called by plugins to get http authentication information from the browser. npn_getintidentifier returns an opaque identifier for the integer that is passed in. npn_getproperty...
...script in the scope of the
specified npobject. npn_forceredraw asks the plugin host to immediately (synchronously) repaint invalid areas. npn_getauthenticationinfo the function is called by plugins to get http authentication information from the browser. npn_getintidentifier returns an opaque identifier for the integer that is passed in. npn_getproperty gets the value of a property on the
specified npobject. npn_getstringidentifier returns an opaque identifier for the string that is passed in. npn_getstringidentifiers returns an array of opaque identifiers for the names that are passed in. npn_geturl asks the browser to create a stream for the
specified url. npn_geturlnotify requests creation of a new stream with the contents of the
specified url; gets notification of the result. n...
... the
specified url. npn_geturlnotify requests creation of a new stream with the contents of the
specified url; gets notification of the result. npn_getvalue allows the plug-in to query the browser for information. npn_getvalueforurl provides information to a plugin which is associated with a given url, for example the cookies or preferred proxy. npn_hasmethod determines whether or not the
specified npobject has a particular method. npn_hasproperty determines whether or not the
specified npobject has a particular property. npn_identifierisstring determines whether or not an identifier is a string. npn_intfromidentifier returns the integer value corresponding to the given integer identifier. ...
...And 4 more matches
Getting Started with Chat
elopers a channel for mozilla development discussion #sumo a channel for support with firefox for more information about the mozilla irc network and more channels, go here. commands the following is a list of commands you should be familiar with. ...
... the following is a list of commands you should be familiar with. simply type them into the message box at the bottom of the screen and press enter: /join #channel joins you to the
specified channel until you quit your irc client or quit the channel /leave leave the current channel /mode #channel +k password sets a password for the channel. if #channel is not
specified, the command is executed for the current channel. /mode #channel +o nickname sets
specified user as an owner or moderator of the
specified channel. if a #channel is not
specified, the command is executed for the current channel. /mode #channel +s sets the channel as a secret channel. this takes the channel off the public list of active channels and topics. /msg ni...
...nnel. /mode #channel +o nickname sets
specified user as an owner or moderator of the
specified channel. if a #channel is not
specified, the command is executed for the current channel. /mode #channel +s sets the channel as a secret channel. this takes the channel off the public list of active channels and topics. ...
...And 4 more matches
sslcrt.html
returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to obtain the error code. description the cert_verifycertnow function must call one or more pk11 functions to obtain the services of a pkcs #11 module. some of the pk11 functions require a pin argument (see ssl_setpkcs11pinarg for details), which must be
specified in the wincx parameter. to obtain the value to pass in the wincx parameter, call ssl_revealpinarg. cert_verifycertname compares the common name
specified in the subject dn for a certificate with a
specified hostname. syntax #include <cert.h> secstatus cert_verifycertname( certcertificate *cert, char *hostname); parameters this function has the following parameters: ...
...s is ], all others are not special. [a-z] matches any character between a and z [^az] matches any character except a or z ~ followed by another shell expression removes any pattern matching the shell expression from the match list (foo|bar) matches either the substring foo or the substring bar. these can be shell expressions as well. cert_checkcertvalidtimes checks whether a
specified time is within a certificate's validity period. syntax #include <cert.h> #include <certt.h> seccerttimevalidity cert_checkcertvalidtimes( certcertificate *cert, int64 t); parameters this function has the following parameters: cert a pointer to the certificate whose validity period you want to check against. ...
...check against the certificate's validity period. for more information, see the nspr header pr_time.h. returns the function returns an enumerator of type seccerttimevalidity: typedef enum { seccerttimevalid, seccerttimeexpired, seccerttimenotvalidyet } seccerttimevalidity; nss_cmpcertchainwcanames determines whether any of the signers in the certificate chain for a
specified certificate are on a
specified list of ca names. syntax #include <nss.h> secstatus nss_cmpcertchainwcanames( certcertificate *cert, certdistnames *canames); parameters this function has the following parameters: cert a pointer to the certificate structure for the certificate whose certificate chain is to be checked. ...
...And 4 more matches
sslerr.html
ssl_error_post_warning -12275 (unused) ssl_error_ssl2_disabled -12274 "peer only supports ssl version 2, which is locally disabled." the remote server has asked to use ssl version 2, and ssl version 2 is disabled in the local client's configuration. ssl_error_bad_mac_read -12273 "ssl received a record with an...
... "ssl peer was unable to negotiate an acceptable set of security parameters." ssl_error_illegal_parameter_alert -12226 "ssl peer rejected a handshake message for unacceptable content." ssl_error_unsupported_cert_alert -12225 "ssl peer does not support certificates of the type it received." ssl_error_certificate_unknown_alert -12224 "ssl peer had some un
specified issue with the certificate it received." ssl_error_decryption_failed_alert -12197 "peer was unable to decrypt an ssl record it received." ssl_error_record_overflow_alert -12196 "peer received an ssl record that was longer than is permitted." ssl_error_unknown_ca_alert -12195 "peer does not recognize and trust the ca that issued your certificate." ...
...these failures may be caused by the system running out of memory, or errors returned by pkcs#11 routines that did not provide meaningful error codes of their own. these should rarely be seen. (certain of these...
...And 4 more matches
NSS Tools certutil
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 argument to specify explicitly whether to delete a dsa or an rsa key. if you don't use the -k argument, the option looks for an rsa key matching the
specified nickname. when you delete keys, be sure to also remove any certificates associated with those keys from the certificate database, by using -d. some smart cards (for example, the litronic card) do not let 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 -htokenname . ...
...unauthorized access to this file. -g keysize set a key size to use when generating new public and private key pairs. the minimum is 512 bits and the maximum is 8192 bits. the default is 1024 bits. any size that is a multiple of 8 between the minimum and maximum is allowed. -h tokenname specify the name of a token to use or act on. unless
specified otherwise the default token is an internal slot (specifically, internal slot 2). this slot can also be explicitly named with the string "internal". an internal slots is a virtual slot maintained in software, rather than a hardware device. internal slot 2 is used by key and certificate services. internal slot 1 is used by cryptographic services. -i cert|cert-request-file ...
...ng with quotation marks if it contains spaces. if this argument is not used the output destination defaults to standard output. -p phone specify a contact telephone number to include in new certificates or certificate requests. bracket this string with quotation marks if it contains spaces. -q pqgfile read an alternate pqg value from the
specified file when generating dsa key pairs. if this argument is not used, the key database tool generates its own pqg value. pqg files are created with a separate dsa utility. -r display a certificate's binary der encoding when listing information about that certificate with the -l option. -s subject identify a particular certificate owner for n...
...And 4 more matches
NSS tools : signtool
after smartupdate has validated the digital signature. for more details, see the description of -m that follows. the -i option provides a straightforward way to provide this information if you don't need to specify any metadata other than an installer script. -j directory specifies a special javascript directory. this option causes the
specified directory to be signed and tags its entries as inline javascript. this special type of entry does not have to appear in the jar file itself. instead, it is located in the html page containing the inline scripts. when you use signtool -v, these entries are displayed with the string not present. -k key ... directory specifies the nickname ...
...ecial type of entry does not have to appear in the jar file itself. instead, it is located in the html page containing the inline scripts. when you use signtool -v, these entries are displayed with the string not present. -k key ... directory specifies the nickname (key) of the certificate you want to sign with and signs the files in the
specified directory. the directory to sign is always
specified as the last command-line argument. thus, it is possible to write signtool -k mycert -d . signdir you may have trouble if the nickname contains a single quotation mark. to avoid problems, escape the quotation mark using the escape conventions for your platform. it's also possible to use the ...
...ple, you can use it with the -l option to get detailed information about a particular signing certificate. -g nickname generates a new private-public key pair and corresponding object-signing certificate with the given nickname. the newly generated keys and certificate are installed into the key and certificate databases in the directory
specified by the -d option. with the nt version of netscape signing tool, you must use the -d option with the -g option. with the unix version of netscape signing tool, omitting the -d option causes the tool to install the keys and certificate in the communicator key and certificate databases. if you are installing the keys and certificate in the ...
...And 4 more matches
IAccessibleText
t in a left to right language. [propget] hresult caretoffset( [out] long offset ); parameters offset the returned offset is relative to the text() represented by this object. return value s_false if the caret is not currently active on this object, that is the caret is located on some other object. the returned offset value will be -1. s_ok. characterextents() returns the bounding box of the
specified position. the virtual character after the last character of the represented text(), that is the one at position length is a special case. it represents the current input position and will therefore typically be queried by at more often than other positions. because it does not represent an existing character its bounding box is defined in relation to preceding characters. it should be roughly equ...
...egment newtext ); parameters newtext the text() that was just inserted. return value s_false if there is nothing to return, [out] value is null. s_ok. nselections() returns the number of active non-contiguous selections. [propget] hresult nselections( [out] long nselections ); parameters nselections missing description return value s_ok. offsetatpoint() returns the text() position for the
specified screen position. given a point return the zero-based index of the character under that point. the same functionality could be achieved by using the bounding boxes for each character as returned by characterextents(). the method offsetatpoint, however, can be implemented more efficiently. [propget] hresult offsetatpoint( [in] long x, [in] long y, [in] enum ia2coordinatetype coordtype, [out...
...] long endindex, [in] enum ia2scrolltype scrolltype ); parameters startindex 0 based character offset. endindex 0 based character offset - the offset of the character just past the last character of the string. scrolltype defines where the object should be placed on the screen. return value e_invalidarg if bad [in] passed. s_ok. scrollsubstringtopoint() moves the top left of a substring to a
specified location. hresult scrollsubstringtopoint( [in] long startindex, [in] long endindex, [in] enum ia2coordinatetype coordinatetype, [in] long x, [in] long y ); parameters startindex 0 based character offset. endindex 0 based character offset - the offset of the character just past the last character of the string. coordinatetype specifies whether the coordinates are relative to the screen...
...And 4 more matches
nsIComponentManager
a "bootstrapped" chrome manifest supports some of the instructions allowed in a regular chrome manifest, see the chrome registration documentation for details. this method was introduced in gecko 8 to let bootstrapped add-ons provide content at chrome:// uris. until gecko 10 you had to call this method manually from within the add-on's startup() method (with a matching rem...
...tdown() method). if you're targeting gecko 10 or higher there should be no need to call this method, since the bootstrapped add-on's chrome.manifest is loaded automatically now. void addbootstrappedmanifestlocation( in interface nsilocalfile alocation ); parameters alocation the directory or xpi from which to load the chrome.manifest. createinstance() creates an instance of the class
specified by classid. unlike getservice, this returns a new instance each time it is called. (see also nsifactory.createinstance.) void createinstance( in nscidref aclass, in nsisupports adelegate, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result ); parameters aclass the classid of the object instance that is being requested. adelegate the outer object used for aggregation. a...
... aclass, in nsisupports adelegate, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result ); parameters aclass the classid of the object instance that is being requested. adelegate the outer object used for aggregation. aiid the interface type to be returned. result the resulting interface pointer. exceptions thrown ns_error_factory_not_registered indicates that the
specified class is not registered. createinstancebycontractid() creates an instance of the class
specified by contractid. void createinstancebycontractid( in string acontractid, in nsisupports adelegate, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result ); parameters acontractid the contractid of the object instance that is being requested. adelegate the outer object used fo...
...And 4 more matches
nsILoginManager
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 boolean isenabled); methods addlogin() stores a new login in the login manager. note: default values for the nsiloginmetainfo properties are created if the
specified login doesn't explicitly specify them. void addlogin( in nsilogininfo alogin ); parameters alogin the login to store. exceptions thrown an exception is thrown if the login information is already stored in the login manager. to change a login, you have to use modifylogin(). autocompletesearch() generates results for a user field autocomplete menu. note: this method is provided...
...be used for any other purpose. nsiautocompleteresult autocompletesearch( in astring asearchstring, in nsiautocompleteresult apreviousresult, in nsidomhtmlinputelement aelement ); parameters asearchstring missing description apreviousresult missing description aelement missing description return value missing description countlogins() returns the number of logins matching the
specified criteria. called when only the number of logins is needed, and not the actual logins (which avoids prompting the user for a master password, as the logins don't need to be decrypted). unsigned long countlogins( in astring ahostname, in astring aactionurl, in astring ahttprealm ); parameters ahostname the hostname to which to restrict searches, formatted as a url. for example, "http:/...
... appropriate information is available. note: this method will attempt to fill out the form regardless of the setting of the signon.autofillforms preference. boolean fillform( in nsidomhtmlformelement aform ); parameters aform the htmlform to attempt to fill out. return value true if the form was successfully filled out; otherwise false. findlogins() searches for logins matching the
specified criteria. called when looking for logins that might be applicable to a given form or authentication request. void findlogins( out unsigned long count, in astring ahostname, in astring aactionurl, in astring ahttprealm, [retval, array, size_is(count)] out nsilogininfo logins ); parameters count the number of elements in the returned array. javascript callers can simply use the arr...
...And 4 more matches
nsILoginManagerStorage
ize_is(count)] out nsilogininfo logins); void setloginsavingenabled(in astring ahost, in boolean isenabled); attributes attribute type description uibusy boolean true when a master password prompt is being shown. read only. methods addlogin() called by the login manager to store a new login. gecko 1.9.1 note default values for the nsiloginmetainfo properties are created if the
specified login doesn't explicitly specify them. void addlogin( in nsilogininfo alogin ); parameters alogin the login to add to the login storage. countlogins() implement this method to return the number of logins matching the
specified criteria. this method is called, for example, to check to see if there is a login that will match the criteria without having to ask the user for their master passwor...
...ch any logins, and should return 0. aactionurl the url of the form to which the login will be submitted. to match any form login, specify an empty string. to not match to any form login, specify null. ahttprealm the http realm for which the login applies. to match logins for any realm, specify an empty string. to not match any realm, specify null. return value the number of logins that match the
specified criteria. findlogins() implement this method to search the login store for logins matching the
specified criteria. this method is called by the login manager when looking for saved logins that might apply to a form or authentication request. void findlogins( out unsigned long count, in astring ahostname, in astring aactionurl, in astring ahttprealm, [retval, array, size_is(count)] out n...
...oginsavingenabled() implement to report whether 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. 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. voi...
...And 4 more matches
nsIZipReader
at represents the zip with which this zip reader was initialized. 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 un
specified behavior. void close(); parameters none. example demonstrating this function: list contents of xpi and read file contents extract() extracts a zip entry into a local file
specified by outfile. the entry must be stored in the zip in either uncompressed or deflate-compressed format for the extraction to be successful. if the entry is a directory, the directory will be extracted non-recursi...
...cstring() (c++) to get all entries; otherwise, use the following syntax: * matches anything. ? matches one character. $ matches the end of the string. [abc] matches one occurrence of a, b, or c. the only character that must be escaped inside the brackets is ]. ^ and - must never appear in the first and second positions within the brackets, respectively. (in the former case, the behavior
specified for '[^az]' will happen.) [a-z] matches any character between a and z. the characters a and z must either both be letters or both be numbers, with the character represented by 'a' having a lower ascii value than the character represented by 'z'. [^az] matches any character except a or z. if ] is to appear inside the brackets as a character to not match, it must be escaped. pat~pat2 returns ...
...xcept those containing a 'z'. note that a pattern may not use '~' multiple times, so a string such as '*~*z*~*y*' is not a valid pattern. (foo|bar) will match either the pattern foo or the pattern bar. neither of the patterns foo or bar may use the 'pat~pat2' syntax described immediately above. \ will escape a special character. escaping is required for all special characters unless otherwise
specified. all other characters match case-sensitively. an apattern not conforming to this syntax has undefined behavior. return value the nsiutf8stringenumerator containing the matching entry names. exceptions thrown ns_error_illegal_value on many but not all invalid apattern values. getcertificateprincipal() returns an object describing the entity which signed an entry. parsemanifest...
...And 4 more matches
Working with data
e new cdata objects of that type. there are several ways you can go about creating new cdata objects. creating uninitialized cdata objects there are three forms of the syntax for creating 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...
...roes. note: if type.size is undefined, creating a new object this way will throw a typeerror exception. ...
...ed, creating a new object this way will throw a typeerror exception. ...
...And 4 more matches
DOMMatrixReadOnly - Web APIs
inal matrix is not modified. dommatrixreadonly.inverse() returns a new dommatrix created by inverting the source matrix. if the matrix cannot be inverted, the new matrix's components are all set to nan and its is2d property is set to false. the original matrix is not altered. dommatrixreadonly.multiply() returns a new dommatrix created by computing the dot product of the source matrix and the
specified matrix: a⋅b. if no matrix is
specified as the multiplier, the matrix is multiplied by a matrix in which every element is 0 except the bottom-right corner and the element immediately above and to its left: m33 and m34. these have the default value of 1. the original matrix is not modified. dommatrixreadonly.rotateaxisangle() returns a new dommatrix created by rotating the source matrix by the ...
...atrix is
specified as the multiplier, the matrix is multiplied by a matrix in which every element is 0 except the bottom-right corner and the element immediately above and to its left: m33 and m34. these have the default value of 1. the original matrix is not modified. dommatrixreadonly.rotateaxisangle() returns a new dommatrix created by rotating the source matrix by the given angle around the
specified vector. the original matrix is not modified. dommatrixreadonly.rotate() returns a new dommatrix created by rotating the source matrix around each of its axes by the
specified number of degrees. the original matrix is not altered. dommatrixreadonly.rotatefromvector() returns a new dommatrix created by rotating the source matrix by the angle between the
specified vector and (1, 0). the original...
...e matrix around each of its axes by the
specified number of degrees. the original matrix is not altered. dommatrixreadonly.rotatefromvector() returns a new dommatrix created by rotating the source matrix by the angle between the
specified vector and (1, 0). the original matrix is not modified. dommatrixreadonly.scale() returns a new dommatrix created by scaling the source matrix by the amount
specified for each axis, centered on the given origin. by default, the x and z axes are scaled by 1 and the y axis has no default scaling value. the default origin is (0, 0, 0). the original matrix is not modified. dommatrixreadonly.scale3d() returns a new dommatrix created by scaling the source 3d matrix by the given factor along all its axes, centered on the
specified origin point. the default origin i...
...And 4 more matches
Document - Web APIs
s synthetic, such as a standalone image, video, audio file, or the like. document.pluginsread only returns a list of the available plugins. document.featurepolicy read only returns the featurepolicy interface which provides a simple api for introspecting the feature policies applied to a specific document. document.preferredstylesheetsetread only returns the preferred style sheet set as
specified by the page author. document.scriptsread only returns all the <script> elements on the document. document.scrollingelementread only returns a reference to the element that scrolls the document. document.selectedstylesheetset returns which style sheet set is currently in use. document.stylesheetsetsread only returns a list of the style sheet sets available on the document. document.tim...
...the width of the current document. document.xmlencoding returns the encoding as determined by the xml declaration. document.xmlstandalone obsolete since gecko 10 returns true if the xml declaration specifies the document to be standalone (e.g., an external part of the dtd affects the document's content), else false. document.xmlversion obsolete since gecko 10 returns the version number as
specified in the xml declaration or "1.0" if the declaration is absent. methods this interface also inherits from the node and eventtarget interfaces. document.adoptnode() adopt node from an external document. document.captureevents() see window.captureevents. document.caretrangefrompoint() gets a range object for the document fragment under the
specified coordinates. document.createattribu...
...essinginstruction() creates a new processinginstruction object. document.createrange() creates a range object. document.createtextnode() creates a text node. document.createtouch() creates a touch object. document.createtouchlist() creates a touchlist object. document.createtreewalker() creates a treewalker object. document.enablestylesheetsforset() enables the style sheets for the
specified style sheet set. document.exitpointerlock() release the pointer lock. document.getanimations() returns an array of all animation objects currently in effect, whose target elements are descendants of the document. document.getelementsbyclassname() returns a list of elements with the given class name. document.getelementsbytagname() returns a list of elements with the given tag name. d...
...And 4 more matches
EventTarget.addEventListener() - Web APIs
the eventtarget method addeventlistener() sets up a function that will be called whenever the
specified event is delivered to the target. common targets are element, document, and window, but the target may be any object that supports events (such as xmlhttprequest). addeventlistener() works by adding a function or an object that implements eventlistener to the list of event listeners for the
specified event type on the eventtarget on which it's called. syntax target.addeventlistener(type, listener [, options]); target.addeventlistener(type, listener [, usecapture]); target.addeventlistener(type, listener [, usecapture, wantsuntrusted ]); // gecko/mozilla only parameters type a case-sensitive string representing the event type to listen for. listener the object that receives a notificat...
...ntlistener(type, listener [, options]); target.addeventlistener(type, listener [, usecapture]); target.addeventlistener(type, listener [, usecapture, wantsuntrusted ]); // gecko/mozilla only parameters type a case-sensitive string representing the event type to listen for. listener the object that receives a notification (an object that implements the event interface) when an event of the
specified type occurs. this must be an object implementing the eventlistener interface, or a javascript function. see the event listener callback for details on the callback itself. options optional an options object specifies characteristics about the event listener. the available options are: capture a boolean indicating that events of this type will be dispatched to the registered listener befor...
...ture a boolean indicating that events of this type will be dispatched to the registered listener before being dispatched to any eventtarget beneath it in the dom tree. once a boolean indicating that the listener should be invoked at most once after being added. if true, the listener would be automatically removed when invoked. passive a boolean that, if true, indicates that the function
specified by listener will never call preventdefault(). if a passive listener does call preventdefault(), the user agent will do nothing other than generate a console warning. see improving scrolling performance with passive listeners to learn more. mozsystemgroup a boolean indicating that the listener should be added to the system group. available only in code running in xbl or in the chrome of the ...
...And 4 more matches
Intersection Observer API - Web APIs
to watch for intersection relative to the root...
... intersection observer options the options object passed into the intersectionobserver() constructor let you control the circumstances under which the observer's callback is invoked. it has the following fields: root the element that is used as the viewport for checking visibility of the target. must be the ancestor of the target. defaults to the ...
... callback is invoked. intersection observer options the options object passed into the intersectionobserver() constructor let you control the circumstances under which the observer's callback is invoked. it has the following fields: root the element that is used as the viewport for checking visibility of the target. must be the ancestor of the target. defaults to the browser viewport if not
specified or if null. rootmargin margin around the root. can have values similar to the css margin property, e.g. "10px 20px 30px 40px" (top, right, bottom, left). the values can be percentages. this set of values serves to grow or shrink each side of the root element's bounding box before computing intersections. defaults to all zeros. threshold either a single number or an array of numbers which indi...
...And 4 more matches
RTCPeerConnection.setRemoteDescription() - Web APIs
the description specifies the properties of the remote end of the connection, including the media format. the method takes a single parameter—the session description—and it returns a promise which is fulfilled once the description has been changed, asynchronously. this is typically called after receiving an offer or answer from another peer over the signaling server. keep in mind that if setremotedescription() is called while a connection is already in place, it means renegotiation is underway (possibly to adapt to changing network conditions). ...
...ng async/await syntax, you can further simplify this to: await mypeerconnection.setremotedescription(description); createmystream(); since it's unnecessary, the rtcsessiondescription() constructor is deprecated. return value a promise which is fulfilled once the value of the connection's remotedescription is successfully changed or rejected if the change cannot be applied (for example, if the
specified description is incompatible with one or both of the peers on the connection). the promise fulfillment handler receives no input parameters. note: the process of changing descriptions actually involves intermediary steps handled by the webrtc layer to ensure that an active connection can be changed without losing the connection if the change does not succeed. see pending and current descriptions...
...cceed. see pending and current descriptions in webrtc connectivity for more details on this process. exceptions the following exceptions are reported to the rejection handler for the promise returned by setremotedescription(): invalidaccesserror the content of the description is invalid. invalidstateerror the rtcpeerconnection is closed, or it's in a state which isn't compatible with the
specified description's type. for example, if the type is rollback and the signaling state is one of stable, have-local-pranswer, or have-remote-pranswer, this exception is thrown, because you can't roll back a connection that's either fully established or is in the final stage of becoming connected. operationerror any errors that occur which don't match the others specifeid here are reported as operatio...
...And 4 more matches
RTCPeerConnection - Web APIs
also included is a list of any ice ca...
...if this hasn't been set yet, this is null.sctp the read-only sctp property on the rtcpeerconnection interface returns an rtcsctptransport describing the sctp transport over which sctp data is being sent and received. if sctp hasn't been negotiated, this value is null.signalingstate read only the read-only signalingstate property on the rtcpeerconnection interface returns one of the string values
specified by the rtcsignalingstate enum; these values describe the state of the signaling process on the local end of the connection while connecting or reconnecting to another peer. see signaling in lifetime of a webrtc session for more details about the signaling process.event handlersalso inherits event handlers from: eventtargetonaddstream the rtcpeerconnection.onaddstream event handler is a property ...
...if no stream matches, it returns null.gettransceivers()the rtcpeerconnection interface's gettransceivers() method returns a list of the rtcrtptransceiver objects being used to send and receive data on the connection...
...And 4 more matches
Inputs and input sources - Web APIs
gripspace property is an xrspace you can use to render objects so they appear to be held in the viewer's hand. the coordinate system for the left hand's grip space. the coordinate system for the right hand's grip space. the grip space's native origin, located around the center of the player's fist, is (0, 0, 0) within the input source's local coordinate system, while the xrspace
specified by gripspace can be used at any time to convert coordinates or vectors from the input source's space into world coordinates (or vice-versa). this means that if you use a 3d model to represent your controller, your player's avatar's hands, or anything else representative of the controller's position in space, the gripspace can be used as the transform matrix that correctly positions and orients t...
...oller is in that hand. let primaryinputsource = xrsession.inputsources[0]; for (let i=0; i < xrsession.inputsources.length; i++) { if (xrsession.inputsources[i].handedness === user.handedness) { primaryinputsource = inputsources[i]; break; } } this snippet of code starts by assuming that the first input source is the primary, but then looks for one whose handedness matches the one
specified in the user object. if it matches, that input source is selected as the primary. first-used another option is to use the first input the user triggers the select action on. the code below starts by assuming the first input source is the primary, then establishes a handler for the select event that records the event's source as the primary input source. then the select event handler is replaced ...
...y, picks it up. picking up an object involves first looking to see if the hand represented by dropping any object already being held in the hand represented by avatar.heldobject[hand]. if an object is already held in that hand, it's dropped by calling the dropobject() function. then pickupobject() is called, specifying the targeted object as the object to remove from the scene and place into the
specified hand. pickupobject() also records the original position of the object so it can be returned to that spot if the squeeze is canceled or aborted. dropping the object: the squeeze event handler the squeeze event is received when the user ends the squeeze action by releasing their grip. in this example, we interpret that as releasing the currently-held object, dropping it into the scene at the tar...
...And 4 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
if it isn't—and/or the enableforcepolyfill configuration constant is set to true—we install the webxr polyfill by instantiating the webxrpolyfill class. handling the startup and shutdown ui then we call the setupxrbutton() function, which handles configuring the "enter/exit webxr" button to enable or disable it as necessary depending on the availability of webxr support for the session type
specified in the session_type constant. function setupxrbutton() { if (navigator.xr.issessionsupported) { navigator.xr.issessionsupported(session_type) .then((supported) => { xrbutton.disabled = !supported; }); } else { navigator.xr.supportssession(session_type) .then(() => { xrbutton.disabled = false; }) .catch(() => { xrbutton.disabled = true; }); ...
... calling the session's requestreferencespace() method to get a reference space object describing the space in which the object is being created. when the promise returned resolves to a xrreferencespace object, we call its getoffsetreferencespace function to obtain a reference space object to represent the object's coordinate system. the origin of the new space is located at the world coordinates
specified by the viewerstartposition and its orientation set to cubeorientation. then we let the session know we're ready to draw a frame by calling its requestanimationframe() function. we record the returned request id in case we need to cancel the request later. finally, sessionstarted() returns the xrsession representing the user's webxr session. when the session ends when the webxr session ends—...
...e the mouse is by increasing the value of mouse_speed. drawing a frame our callback for xrsession.requestanimationframe() is implemented in the drawframe() function shown below. its job is to obtain the viewer's reference space, compute how much movement needs to be applied to any animated objects given the amount of time that's elapsed since the last frame, and then to render each of the views
specified by the viewer's xrpose. let lastframetime = 0; function drawframe(time, frame) { let session = frame.session; let adjustedrefspace = xrreferencespace; let pose = null; animationframerequestid = session.requestanimationframe(drawframe); adjustedrefspace = applyviewercontrols(xrreferencespace); pose = frame.getviewerpose(adjustedrefspace); if (pose) { let gllayer = session.ren...
...And 4 more matches
display - CSS: Cascading Style Sheets
rticipation in flow layout; the inner type sets the layout of children. some values of display are fully defined in their own individual specifications; for example the detail of what happens when display: flex is declared is defined in the css flexible box model specification. see the table at the end of this document for all of the individual specifications. syntax the css display property is
specified using keyword values. keyword values are grouped into six value categories: .container { display: [ <display-outside> || <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy> ; } outside <display-outside> these keywords specify the element’s outer display type, which is essentially its role in flow layout. valid <display-outside> values: ...
...pending on the surrounding elements. that is: if the run-in box contains a block box, same as block. if a block box follows the run-in box, the run-in box becomes the first inline box of the block box. if an inline box follows, the run-in box becomes a block box. note: browsers that support the two value syntax, on finding the outer value only, such as when display: block or display: inline is
specified, will set the inner value to flow. this will result in expected behavior; for example if you specify an element to be block, you would expect that the children of that element would participate in block and inline normal flow layout. inside <display-inside> these keywords specify the element’s inner display type, which defines the type of formatting context that its contents are laid out ...
...he element behaves like a block element and lays out its content according to the grid model. ruby the element behaves like an inline element and lays out its content according to the ruby formatting model. it behaves like the corresponding html <ruby> elements. note: browsers that support the two value syntax, on finding the inner value only, such as when display: flex or display: grid is
specified, will set their outer value to block. this will result in expected behavior; for example if you specify an element to be display: grid, you would expect that the box created on the grid container would be a block level box. list item <display-listitem> the element generates a block box for the content and a separate list-item inline box. a single value of list-item will cause the element ...
...And 4 more matches
HTML attribute reference - HTML: Hypertext Markup Language
. code <applet> specifies the url of the applet's class file to be loaded and executed. codebase <applet> this attribute gives the absolute or relative url of the directory where applets' .class files referenced by the code attribute are stored. color <basefont>, <font>, <hr> this attribute sets the text color using either a named color or a color
specified in the hexadecimal #rrggbb format. note: this is a legacy attribute. please use the css color property instead. cols <textarea> defines the number of columns in a textarea. colspan <td>, <th> the colspan attribute defines the number of columns a cell should span. content <meta> a value associated with http-equiv or name depending on ...
...ess>, <select>, <textarea> indicates the form that is the owner of the element. formaction <input>, <button> indicates the action of the element, overriding the action defined in the <form>. formenctype <button>, <input> if the button/input is a submit button (type="submit"), this attribute sets the encoding type to use during form submission. if this attribute is
specified, it overrides the enctype attribute of the button's form owner. formmethod <button>, <input> if the button/input is a submit button (type="submit"), this attribute sets the submission method to use during form submission (get, post, etc.). if this attribute is
specified, it overrides the method attribute of the button's form owner. formnovalidate <button>, <input> if...
...is attribute sets the submission method to use during form submission (get, post, etc.). if this attribute is
specified, it overrides the method attribute of the button's form owner. formnovalidate <button>, <input> if the button/input is a submit button (type="submit"), this boolean attribute specifies that the form is not to be validated when it is submitted. if this attribute is
specified, it overrides the novalidate attribute of the button's form owner. ...
...And 4 more matches
<input type="password"> - HTML: Hypertext Markup Language
tributes selectionstart, selectionend, selectiondirection, and value methods select(), setrangetext(), and setselectionrange() value the value attribute contains a domstring whose value is the current contents of the text editing control being used to enter the password. if the user hasn't entered anything yet, this value is an empty string (""). if the required property is
specified, then the password edit box must contain a value other than an empty string to be valid. if the pattern attribute is
specified, the content of a password control is only considered valid if the value passes validation; see validation for more information. note: the line feed (u+000a) and carriage return (u+000d) characters are not permitted in a password value. when setting the value of a pass...
...eld when the field is empty readonly a boolean attribute which, if present, indicates that the field's contents should not be editable size the number of characters wide the input field should be maxlength the maximum number of characters (as utf-16 code units) the user can enter into the password field. this must be an integer value 0 or higher. if no maxlength is
specified, or an invalid value is
specified, the password field has no maximum length. this value must also be greater than or equal to the value of minlength. the input will fail constraint validation if the length of the text entered into the field is greater than maxlength utf-16 code units long. minlength the minimum number of characters (as utf-16 code units) the user can enter into the password en...
...must also be greater than or equal to the value of minlength. the input will fail constraint validation if the length of the text entered into the field is greater than maxlength utf-16 code units long. minlength the minimum number of characters (as utf-16 code units) the user can enter into the password entry field. ...
...And 4 more matches
<input type="search"> - HTML: Hypertext Markup Language
values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requirements: users can select from this predefined list or provide a different value. maxlength the maximum number of characters (as utf-16 code units) the user can enter into the search field. this must be an integer value 0 or higher. if no maxlength is
specified, or an invalid value is
specified, the search field has no maximum length. this value must also be greater than or equal to the value of minlength. the input will fail constraint validation if the length of the text entered into the field is greater than maxlength utf-16 code units long. minlength the minimum number of characters (as utf-16 code units) the user can enter into the search field.
...is value must also be greater than or equal to the value of minlength. the input will fail constraint validation if the length of the text entered into the field is greater than maxlength utf-16 code units long. minlength the minimum number of characters (as utf-16 code units) the user can enter into the search field. ...
... to the value of minlength. the input will fail constraint validation if the length of the text entered into the field is greater than maxlength utf-16 code units long. minlength the minimum number of characters (as utf-16 code units) the user can enter into the search field. this must be a non-negative integer value smaller than or equal to the value
specified by maxlength. if no minlength is
specified, or an invalid value is
specified, the search input has no minimum length. the search field will fail constraint validation if the length of the text entered into the field is fewer than minlength utf-16 code units long. pattern the pattern attribute, when
specified, is a regular expression that the input's value must match in order for the value to pass constraint validation. it must be a val...
...And 4 more matches
Warning: JavaScript 1.6's for-each-in loops are deprecated - JavaScript
instead" occurs when a for each (variable in obj) statement is used. message warning: javascript 1.6's for-each-in loops are deprecated; consider using es6 for-of instead error type warning what went wrong? javascript 1.6's for each (variable in obj) statement is deprecated, and will be removed in the near future. ...
...atement is deprecated, and will be removed in the near future. examples object iteration for each...in has been used to iterate over the
specified object values. ...
... // 20 } alternative standard syntax you can now use the standard for...in loop to iterate over
specified object keys, and get each value inside the loop: var object = { a: 10, b: 20 }; for (var key in object) { var x = object[key]; console.log(x); // 10 // 20 } or, using for...of (es2015) and object.values (es2017), you can get an array of the
specified object values and iterate over the array like this: var object = { a: 10, b: 20 }; for (var x of object.values(object)) { console.log(x); // 10 // 20 } array iteration for each...in has been used to iterate over
specified array elements. deprecated syntax var array = [10, 20, 30]; for each (var x in array) { console.log(x); // 10 ...
...And 4 more matches
DataView - JavaScript
d only. dataview.prototype.bytelength the length (in bytes) of this view from the start of its arraybuffer. fixed at construction time and thus read only. dataview.prototype.byteoffset the offset (in bytes) of this view from the start of its arraybuffer. fixed at construction time and thus read only. instance methods dataview.prototype.getint8() gets a signed 8-bit integer (byte) at the
specified byte offset from the start of the view. dataview.prototype.getuint8() gets an unsigned 8-bit integer (unsigned byte) at the
specified byte offset from the start of the view. dataview.prototype.getint16() gets a signed 16-bit integer (short) at the
specified byte offset from the start of the view. dataview.prototype.getuint16() gets an unsigned 16-bit integer (unsigned short) at the specifie...
...e) at the
specified byte offset from the start of the view. dataview.prototype.getint16() gets a signed 16-bit integer (short) at the
specified byte offset from the start of the view. dataview.prototype.getuint16() gets an unsigned 16-bit integer (unsigned short) at the
specified byte offset from the start of the view. dataview.prototype.getint32() gets a signed 32-bit integer (long) at the
specified byte offset from the start of the view. dataview.prototype.getuint32() gets an unsigned 32-bit integer (unsigned long) at the
specified byte offset from the start of the view. dataview.prototype.getfloat32() gets a signed 32-bit float (float) at the
specified byte offset from the start of the view. ...
...) at the
specified byte offset from the start of the view. dataview.prototype.getuint32() gets an unsigned 32-bit integer (unsigned long) at the
specified byte offset from the start of the view. dataview.prototype.getfloat32() gets a signed 32-bit float (float) at the
specified byte offset from the start of the view. dataview.prototype.getfloat64() gets a signed 64-bit float (double) at the
specified byte offset from the start of the view. dataview.prototype.getbigint64() gets a signed 64-bit integer (long long) at the
specified byte offset from the start of the view. dataview.prototype.getbiguint64() gets an unsigned 64-bit integer (unsigned long long) at the
specified byte offset from the start of the view. dataview.prototype.setint8() stores a signed 8-bit integer (byte) value at the...
...And 4 more matches
Codecs used by WebRTC - Web media technologies
that a specific set of values be allowed. and sometimes the requirements are more intricate. parameters which are useful but not required these parameters don't have to be supported by the webrtc endpoint, and their use is not required either. their use can improve the user experience in various ways, but don't have to be used. indeed, some of these are pretty complicated to use. max-br if
specified and supported by the software, the max-br parameter specifies the maximum video bit rate in units of 1,000 bps for vcl and 1,200 bps for nal. you'll find details about this on page 47 of rfc 6184. max-cpb if
specified and supported by the software, max-cpb specifies the maximum coded picture buffer size. this is a fairly complicated parameter whose unit size can vary. see page 45 of rfc 6184 fo...
...ftware, the max-br parameter specifies the maximum video bit rate in units of 1,000 bps for vcl and 1,200 bps for nal. you'll find details about this on page 47 of rfc 6184. max-cpb if
specified and supported by the software, max-cpb specifies the maximum coded picture buffer size. this is a fairly complicated parameter whose unit size can vary. see page 45 of rfc 6184 for details. max-dpb if
specified and supported, max-dpb indicates the maximum decoded picture buffer size, given in units of 8/3 macroblocks. see rfc 6184, page 46 for further details. ...
... max-cpb if
specified and supported by the software, max-cpb specifies the maximum coded picture buffer size. this is a fairly complicated parameter whose unit size can vary. see page 45 of rfc 6184 for details. max-dpb if
specified and supported, max-dpb indicates the maximum decoded picture buffer size, given in units of 8/3 macroblocks. see rfc 6184, page 46 for further details. max-fs if
specified and supported by the software, max-fs specifies the maximum size of a single video frame, given as a number of macroblocks. max-mbps if
specified and supported by the software, this value is an integer specifying the maximum rate at which macroblocks should be processed per second (in macroblocks per second). ...
...And 4 more matches
listbox - Archive of obsolete content
multiple multiple rows may be selected at once. (default in tree.) for trees, you can also use the following values: cell individual cells can be selected text rows are selected; however, the selection highlight appears only over the text of the primary column. for richlistbox, this is new in firefox 3.5. suppressonselect type: boolean if this attribute is not
specified, a select event is fired whenever an item is selected, either by the user or by calling one of the select methods. if set to true, the select event is never fired. 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: ...
... ) return type: element creates a new item and adds it to the end of the existing list of items. you may optionally set a value. the function returns the newly created element. clearselection() return type: no return value deselects all of the items. a select event is sent before the items are deselected. ensureelementisvisible( element ) return type: no return value if the
specified element is not currently visible to the user, the displayed items are scrolled so that it is. if the item is already visible, no scrolling occurs. ensureindexisvisible( index ) return type: no return value if the item at the
specified index is not currently visible to the user the displayed items are scrolled so that it is. if the item is already visible, no scrolling occurs. getindexoffirs...
...lready visible, no scrolling occurs. getindexoffirstvisiblerow() return type: integer returns the index of the first displayed row. note that this is not the same as the first row -- if the displayed items have been scrolled down, this function will retrieve the index of the first row that the user can see. getindexofitem( item ) return type: integer returns the zero-based position of the
specified item. items are numbered starting at the first item displayed in the list. getitematindex( index ) return type: element returns the element that is at the
specified index. getnumberofvisiblerows() return type: integer returns the number of rows that are currently visible to the user. getrowcount() return type: integer returns the total number of rows in the element, ...
...And 3 more matches
richlistbox - Archive of obsolete content
multiple multiple rows may be selected at once. (default in tree.) for trees, you can also use the following values: cell individual cells can be selected text rows are selected; however, the selection highlight appears only over the text of the primary column. for richlistbox, this is new in firefox 3.5. suppressonselect type: boolean if this attribute is not
specified, a select event is fired whenever an item is selected, either by the user or by calling one of the select methods. if set to true, the select event is never fired. 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...
... return type: element creates a new item and adds it to the end of the existing list of items. you may optionally set a value. the function returns the newly created element. clearselection() return type: no return value deselects all of the items. a select event is sent before the items are deselected. ensureelementisvisible( element ) return type: no return value if the
specified element is not currently visible to the user, the displayed items are scrolled so that it is. if the item is already visible, no scrolling occurs. ensureindexisvisible( index ) return type: no return value if the item at the
specified index is not currently visible to the user the displayed items are scrolled so that it is. if the item is already visible, no scrolling occurs. getindexoffi...
...eady visible, no scrolling occurs. getindexoffirstvisiblerow() return type: integer returns the index of the first displayed row. note that this is not the same as the first row -- if the displayed items have been scrolled down, this function will retrieve the index of the first row that the user can see. getindexofitem( item ) return type: integer returns the zero-based position of the
specified item. items are numbered starting at the first item displayed in the list. getitematindex( index ) return type: element returns the element that is at the
specified index. getnumberofvisiblerows() return type: integer returns the number of rows that are currently visible to the user. getrowcount() return type: integer returns the total number of rows in the elemen...
...And 3 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
ack, callback function, codingscripting, glossary a callback function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of routine or action. 64 canonical order canonical order, codingscripting, glossary in css, canonical order is used to refer to the order in which separate values need to be
specified (or parsed) or are to be serialized as part of a css property value. it is defined by the formal syntax of the property and normally refers to the order in which longhand values should be
specified as part of a single shorthand value. 65 canvas codingscripting, glossary, graphics, html, javascript the canvas element is part of html5 and allows for dynamic, scriptable renderin...
...but it is safe to say that ftp is no longer considered best practice. 139 ftu ftu, firefox os, first time use, gaia, glossary, infrastructure, intro ftu (first time use) is the app that loads when you run a newly-installed version of gecko on a firefox os device. 140 fallback alignment css, glossary, alignment in css box alignment, a fallback alignment is
specified in order to deal with cases where the requested alignment cannot be fullfilled. for example, if you specify justify-content: space-between there must be more than one alignment subject. if there is not, the fallback alignment is used. this is
specified per alignment method, as detailed below. 141 falsy codingscripting, glossary, javascript a falsy (sometimes written falsey) v...
...teractive development environment is a software application that provides comprehensive facilities to computer programmers for software development. an ide normally consists of a source code editor, build automation tools and a debugger. 215 idl codingscripting, glossary, idl, interface description language an idl (interface description language) is a generic language used to
specified objects' interfaces apart from any specific programming language. 216 ietf glossary, ietf, infrastructure, internet the internet engineering task force (ietf) is a worldwide organization that drafts specifications governing the mechanisms behind the internet, especially the tcp/ip or internet protocol suite. 217 iife codingscripting, designpattern, functions, g...
...And 3 more matches
NetUtil.jsm
nction(aresult) { if (!components.issuccesscode(aresult)) { // an error occurred! } }) asyncfetch() the asyncfetch() method opens an input source, asynchronously, and gives an nsiinputstream containing the data obtained to the callback provided. the callback may then consume data from the input stream passed to the callback. note: prior to gecko 2, the input source was required to be
specified as an nsichannel. note: support for specifying an nsiinputstream as the input source was added in gecko 5. asyncfetch( asource, acallback ); parameters asource the source to open asynchronously. this may be
specified as an nsiuri, nsifile, nsichannel, nsiinputstream or as a string specifying the url to open. acallback a function that will be called when the open operation is comp...
...{ // check that we had success. if (!components.issuccesscode(aresult)) { // handle error return; } // consume the input stream. }); remarks note: if you specify an nsichannel as the input source, and its notification callbacks have already been set, callers are responsible for implementing nsibadcertlistener and nsisslerrorlistener. newchannel() creates a new channel for the
specified uri string, nsiuri, or nsifile. nsichannel newchannel( awhattoload, [optional] aorigincharset, [optional] abaseuri ); parameters return value an nsichannel allowing access to the
specified data source. awhattoload a string specifying a uri, or an nsiuri or nsifile object. the returned method will allow access to the
specified data. aorigincharset the optional character set to use...
...only used if awhattoload is a string. newuri() the newuri() method creates a new nsiuri. this method wraps the nsiioservice.newuri(). note: starting in gecko 2, this method supports specifying an nsifile as the target of the uri. in previous versions of gecko, you must use a string to specify the uri. ...
...And 3 more matches
Rhino shell
ell was invoked. environment returns the current environment object. history displays the shell command history. help() executing the help function will print usage and help messages. defineclass(classname) define an extension using the java class named with the string argument classname. uses scriptableobject.defineclass() to define the extension. deserialize(filename) restore from the
specified file an object previously written by a call to serialize. gc() runs the garbage collector. load([filename, ...]) load javascript source files named by string arguments. if multiple arguments are given, each file is read in and executed in turn. loadclass(classname) load and execute the class named by the string argument classname. the class must be a class that implements the script interfa...
...ute the class named by the string argument classname. the class must be a class that implements the script interface, as will any script compiled by rhino javascript compiler. print([expr ...]) evaluate and print expressions. evaluates each expression, converts the result to a string, and prints it. ...
...ch expression, converts the result to a string, and prints it. readfile(path [, charactercoding]) read given file and convert its bytes to a string using the
specified character coding or default character coding if explicit coding argument is not given. readurl(url [, charactercoding]) open an input connection to the given string url, read all its bytes and convert them to a string using the
specified character coding or default character coding if explicit coding argument is not given. runcommand(commandname, [arg, ...] [options]) execute the
specified command with the given argument and options as a separate process and return the exit status of the process. usage: runcommand(command) runcommand(command, arg1, ..., argn) runcommand(command, arg1, ..., argn, options) all except the last...
...And 3 more matches
nsIAccessibleTable
read only. note: renamed from selectedcolumnscount in gecko 1.9.2 selectedrowcount unsigned long the total number of selected rows. read only. note: renamed from selectedrowscount in gecko 1.9.2 summary astring the summary description for the table. for example, @summary attribute on html:table element. read only. methods return the accessible object at the
specified row and column in the table. if both row and column index are valid then the corresponding accessible object is returned that represents the requested cell regardless of whether the cell is currently visible (on the screen). nsiaccessible getcellat( in long rowindex, in long columnindex ); parameters rowindex the row index of the cell. columnindex the column index of the cell. retu...
...column index of the cell. return value an nsiaccessible object. translate the given row and column indices into the corresponding cell index. long getcellindexat( in long rowindex, in long columnindex ); parameters rowindex the row index of the cell. columnindex the column index of the cell. return value a cell index. getcolumndescription() return the description text of the
specified column in the table. astring getcolumndescription( in long columnindex ); parameters columnindex the column index. return value the column description. getcolumnextentat() return the number of columns occupied by the accessible cell at the
specified row and column in the table. the result differs from 1 if the
specified cell spans multiple columns. long getcolumnextentat( in long...
...the given cell index into the corresponding row and column indices. void getrowandcolumnindicesat( in long cellindex, out long rowindex, out long columnindex ); parameters cellindex cell index to return row and column indices for. rowindex row index at the given cell index. columnindex column index at the given cell index. getrowdescription() return the description text of the
specified row in the table. astring getrowdescription( in long rowindex ); parameters rowindex the row index. return value the row description getrowextentat() return the number of rows occupied by the accessible cell at the
specified row and column in the table. the result differs from 1 if the
specified cell spans multiple rows. long getrowextentat( in long row, in long column ); par...
...And 3 more matches
nsIDownloadManager
file returns the user configured downloads directory. the path is dependent on two user configurable prefs set in preferences: browser.download.folderlist defines the default download location for files: 0: files are downloaded to the desktop by default. 1: files are downloaded to the system's downloads folder by default. 2: files are downloaded to the local path
specified by the browser.download.dir preference. if this preference is invalid, the download directory falls back to the default. read only. constants constant value description download_notstarted -1 the download has not been started yet. download_downloading 0 the download is in the process of being downloaded. download_finished ...
...-permanent storage, etc.) return value the newly created download item with the passed-in properties. addlistener() adds a listener to the download manager. void addlistener( in nsidownloadprogresslistener alistener ); parameters alistener the nsidownloadprogresslistener object to receive status information from the download manager. canceldownload() cancels the download with the
specified id if it's currently in-progress. this calls cancel(ns_binding_aborted) on the nsicancelable provided by the download. void canceldownload( in unsigned long aid ); parameters aid the unique id of the download. exceptions thrown ns_error_failure the download is not in progress. cleanup() removes completed, failed, and canceled downloads from the list. also notifies observers of ...
... flush the download datasource to disk. void flush(); parameters none. getdownload() retrieves a download managed by the download manager. this can be one that is in progress, or one that has completed in the past and is stored in the database. nsidownload getdownload( in unsigned long aid ); parameters aid the unique id of the download. return value the download with the
specified id. exceptions thrown ns_error_not_available the download is not in the database. onclose() obsolete since gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. called when the download manager front end is closed. useful for t...
...And 3 more matches
nsITransport
open streams. void close( in nsresult areason ); parameters areason the reason for closing the stream. openinputstream() open an input stream on this transport. nsiinputstream openinputstream( in unsigned long aflags, in unsigned long asegmentsize, in unsigned long asegmentcount ); parameters aflags optional transport specific flags. flags have the following meaning: open_blocking if
specified, then the resulting stream will have blocking stream semantics. this means that if the stream has no data and is not closed, then reading from it will block the calling thread until at least one byte is available or until the stream is closed. if this flag is not
specified, then the stream has non-blocking stream semantics. this means that if the stream has no data and is not closed, then reading...
... asegmentsize if open_unbuffered is not set, then this parameter specifies the size of each buffer segment (pass 0 to use default value). ...
...hen reading from it returns ns_base_stream_would_block. in addition, in non-blocking mode, the stream is guaranteed to support nsiasyncinputstream. this interface allows the consumer of the stream to be notified when the stream can again be read. open_unbuffered if
specified, the resulting stream may not support readsegments. readsegments is only guaranteed to be implemented when this flag is not
specified. asegmentsize if open_unbuffered is not set, then this parameter specifies the size of each buffer segment (pass 0 to use default value). asegmentcount if open_unbuffered is not set, then this parameter specifies the maximum number of buffer segments (pass 0 to use default value). return value openoutputstream() open an output stream on this transport. nsioutputstream openoutputstream( in un...
...And 3 more matches
nsIWebBrowserPersist
4 output without formatting or wrapping the content. this flag may be used to preserve the original formatting as much as possible. encode_flags_body_only 8 output only the body section, no html tags. encode_flags_preformatted 16 wrap even if when not doing formatted output (for example for text fields). encode_flags_wrap 32 wrap documents at the
specified column. encode_flags_format_flowed 64 for plain text output. output for format flowed (rfc 2646). this is used when converting to text for mail sending. this differs just slightly but in an important way from normal formatted, and that is that lines are space stuffed. this can't (correctly) be done later. encode_flags_absolute_links 128 convert links to absolute link...
... 256 attempt to encode entities standardized at w3c (html, mathml, and so on.). this is a catch-all flag for documents with mixed contents. beware of interoperability issues. see below for other flags which might likely do what you want. encode_flags_cr_linebreaks 512 output with carriage return line breaks. may also be combined with encode_flags_lf_linebreaks and if neither is
specified, the platform default format is used. encode_flags_lf_linebreaks 1024 output with linefeed line breaks. may also be combined with encode_flags_cr_linebreaks and if neither is
specified, the platform default format is used. encode_flags_noscript_content 2048 for plain text output. output the content of noscript elements. encode_flags_noframes_content 4096 ...
...argument of ns_binding_aborted. void cancelsave(); parameters none. savechannel() save a channel to a file. it must not be opened yet. void savechannel( in nsichannel achannel, in nsisupports afile ); parameters achannel the nsichannel to save to a file. afile target local file. this may be a nsilocalfile object or an nsiuri object with a file scheme. savedocument() save the
specified dom document to file and optionally all linked files (for example images, css, js & subframes). do not call this method until the document has finished loading! void savedocument( in nsidomdocument adocument, in nsisupports afile, in nsisupports adatapath, in string aoutputcontenttype, in unsigned long aencodingflags, in unsigned long awrapcolumn ); parameters adocument documen...
...And 3 more matches
Int64
s important to note that the 64-bit integer objects created by int64 are not int64 objects; rather, they're opaque objects whose values you manipulate through the other methods on the int64 object. see 64-bit integers for details. syntax creates and returns a new 64-bit signed integer. int64 int64( value ); parameters value the value to assign the new 64-bit integer object. this may be
specified as an integer (if the value can be represented as a 32-bit value), another 64-bit integer object (either signed or unsigned), or as a string, which may consist of an optional minus sign, followed by either a decimal number or "0x" or "0x" followed by a hexadecimal number. the string is then converted into the corresponding 64-bit integer value. you can therefore use a string to represent a 64-bit...
... unsigned), or as a string, which may consist of an optional minus sign, followed by either a decimal number or "0x" or "0x" followed by a hexadecimal number. the string is then converted into the corresponding 64-bit integer value. you can therefore use a string to represent a 64-bit value that is too large to represent as a 32-bit javascript number. return value a new object representing the
specified value. exceptions thrown typeerror the
specified value cannot be converted into a 64-bit integer. either it's not a number, string, or 64-bit integer object, or it's a string that is incorrectly formatted or contains a value outside the range that can be represented in 64 bits. this will also be thrown if the source value is a floating-point number that can't be precisely represented as a 64...
...w); number lo(a); string tosource(); string tostring([radix]); methods compare() compares two 64-bit integer values. number compare( a, b ); parameters a the first value to compare. b the second value to compare. return value the returned value is: -1 if a < b, 0 if a == b, and 1 if a > b. exceptions thrown typeerror one or both of the
specified values is not a 64-bit integer (either signed or unsigned). hi() returns the high 32 bits of the
specified value. number hi( num ); parameters num the value whose high 32 bits are to be returned. return value the high 32 bits of num are returned. this is essentially num >> 32. exceptions thrown typeerror num is not a 64-bit integer object. lo() returns the low 32 bits of th...
...And 3 more matches
UInt64
ote that the 64-bit integer objects created by uint64 are not uint64 objects; rather, they're opaque objects whose values you manipulate through the other methods on the uint64 object. see 64-bit integers for details. syntax creates and returns a new 64-bit unsigned integer. uint64 uint64( value ); parameters value the value to assign the new 64-bit unsigned integer object. this may be
specified as an integer (if the value can be represented as a 32-bit value), another 64-bit integer object (either signed or unsigned), or as a string, which may consist of an optional minus sign, followed by either a decimal number or "0x" or "0x" followed by a hexadecimal number. the string is then converted into the corresponding 64-bit integer value. you can therefore use a string to represent a 64-bit...
... unsigned), or as a string, which may consist of an optional minus sign, followed by either a decimal number or "0x" or "0x" followed by a hexadecimal number. the string is then converted into the corresponding 64-bit integer value. you can therefore use a string to represent a 64-bit value that is too large to represent as a 32-bit javascript number. return value a new object representing the
specified value. exceptions thrown typeerror the
specified value cannot be converted into a 64-bit integer. either it's not a number, string, or 64-bit integer object, or it's a string that is incorrectly formatted or contains a value outside the range that can be represented in 64 bits. this will also be thrown if the source value is a floating-point number that can't be precisely represented as a 64...
...gh, low); number lo(a); string tosource(); string tostring([radix]); methods compare() compares two 64-bit integer values. number compare( a, b ); parameters a the first value to compare. b the second value to compare. return value the returned value is -1 if a < b, 0 if a == b, and 1 if a > b. exceptions thrown typeerror one or both of the
specified values is not a 64-bit integer (either signed or unsigned). hi() returns the high 32 bits of the
specified value. number hi( num ); parameters num the value whose high 32 bits are to be returned. return value the high 32 bits of num are returned. this is essentially num >> 32. exceptions thrown typeerror num is not a 64-bit integer object. lo() returns the low 32 bits o...
...And 3 more matches
Drawing and Event Handling - Plugins
or window->window is null, the plug-in must not perform any additional graphics operations on the window and should free any associated resources. nperror npp_setwindow(npp instance, npwindow *window); the instance parameter represents the current plug-in. the window parameter is a pointer to the drawing target for the plug-in. for windowless plug-ins, the platform-specific window information
specified in window->window is a platform-specific handle to a drawable. ms windows and unix for windowed plug-ins on ms windows and unix, the window->window field is a handle to a subwindow of the netscape window hierarchy. mac os the window->window field points to an np_port structure. getting information to receive information from the browser, the plug-in calls the npn_getvalue method. nperror n...
...setwindow passes the instance an npwindow object containing the native window handle. on windows and unix, each instance receives its own child window within the browser window hierarchy, and imaging and event processing are relative to this window. mac os does not support child windows. the native window is shared between the instance and the browser. the instance must restrict its drawing to a
specified area of the shared window, and it must always save the current settings, set up the drawing environment, and restore the shared drawing environment to the previous settings. on mac os, events are explicitly provided to the instance by npp_handleevent. windowless plug-ins a windowless plug-in does not require a native window to draw into. instead it draws into a drawable (hdc on windows or cgraf...
...npsaveddata *saved) { ... nperror result = npn_setvalue(instance, nppvpluginwindowbool, (void*)false); } invalidating the drawing area before it can repaint or refresh part of its drawing area, a windowless plug-in must first invalidate the area with either of these browser methods: npn_invalidaterect or npn_invalidateregion. both methods perform the same operations: they invalidate the
specified drawing area prior to repainting or refreshing. they pass an update event or a paint message to the plug-in. the browser redraws invalid areas of the document and windowless plug-ins at regularly timed intervals. to force a paint message, the plug-in can call npn_forceredraw after calling one of the invalidate methods. if a plug-in calls one of these methods, it receives a paint message asynch...
...And 3 more matches
DOMMatrix - Web APIs
e m41 f m42 methods this interface includes the following methods, as well as the methods it inherits from dommatrixreadonly. dommatrix.invertself() modifies the matrix by inverting it. if the matrix can't be inverted, its components are all set to nan, and is2d returns false. dommatrix.multiplyself() modifies the matrix by post-multiplying it with the
specified dommatrix. this is equivalent to the dot product a⋅b, where matrix a is the source matrix and b is the matrix given as an input to the method. returns itself. dommatrix.premultiplyself() modifies the matrix by pre-multiplying it with the
specified dommatrix. this is equivalent to the dot product b⋅a, where matrix a is the source matrix and b is the matrix given as an input to the method. re...
... source matrix and b is the matrix given as an input to the method. returns itself. dommatrix.premultiplyself() modifies the matrix by pre-multiplying it with the
specified dommatrix. this is equivalent to the dot product b⋅a, where matrix a is the source matrix and b is the matrix given as an input to the method. returns itself. dommatrix.translateself() modifies the matrix by applying the
specified vector. the default vector is [0, 0, 0]. returns itself. dommatrix.scalenonuniformself() modifies the matrix by applying the
specified scaling on the x, y, and z axes, centered at the given origin. by default, the y and z axes' scaling factors are both 1, but the scaling factor for x must be
specified. the default origin is (0, 0, 0). returns itself. dommatrix.scaleself() modifies the matri...
...lt vector is [0, 0, 0]. returns itself. dommatrix.scalenonuniformself() modifies the matrix by applying the
specified scaling on the x, y, and z axes, centered at the given origin. by default, the y and z axes' scaling factors are both 1, but the scaling factor for x must be
specified. the default origin is (0, 0, 0). returns itself. dommatrix.scaleself() modifies the matrix by applying the
specified scaling factors, with the center located at the
specified origin. also returns itself. by default, the scaling factor is 1 for all three axes, and the origin is (0, 0, 0). returns itself. dommatrix.scale3dself() modifies the matrix by applying the
specified scaling factor to all three axes, centered on the given origin. returns itself. dommatrix.rotateself() modifies the matrix by rotating it...
...And 3 more matches
HTMLButtonElement - Web APIs
ent. htmlbuttonelement.accesskey is a domstring indicating the single-character keyboard key to give access to the button. htmlbuttonelement.autofocus is a boolean indicating whether or not the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. only one form-associated element in a document can have this attribute
specified. htmlbuttonelement.disabled is a boolean indicating whether or not the control is disabled, meaning that it does not accept any clicks. htmlbuttonelement.form read only is a htmlformelement reflecting the form that this button is associated with. if the button is a descendant of a form element, then this attribute is the id of that form element. if the button is not a descendant of a form e...
... a descendant of a form element, then this attribute is the id of that form element. if the button is not a descendant of a form element, then the attribute can be the id of any form element in the same document it is related to, or the null value if none matches. htmlbuttonelement.formaction is a domstring reflecting the uri of a resource that processes information submitted by the button. if
specified, this attribute overrides the action attribute of the <form> element that owns this element. htmlbuttonelement.formenctype is a domstring reflecting the type of content that is used to submit the form to the server. if
specified, this attribute overrides the enctype attribute of the <form> element that owns this element. htmlbuttonelement.formmethod is a domstring reflecting the http method t...
...ute of the <form> element that owns this element. htmlbuttonelement.formenctype is a domstring reflecting the type of content that is used to submit the form to the server. if
specified, this attribute overrides the enctype attribute of the <form> element that owns this element. htmlbuttonelement.formmethod is a domstring reflecting the http method that the browser uses to submit the form. if
specified, this attribute overrides the method attribute of the <form> element that owns this element. htmlbuttonelement.formnovalidate is a boolean indicating that the form is not to be validated when it is submitted. if
specified, this attribute overrides the novalidate attribute of the <form> element that owns this element. htmlbuttonelement.formtarget is a domstring reflecting a name or keyword ind...
...And 3 more matches
TextRange - Web APIs
nge.text gets or sets the plaintext content within the textrange. methods textrange.collapse() move the caret to the beginning or end of the current range. textrange.duplicate() returns a copy of textrange. textrange.execcommand() executes a command on the current document, the current selection, or the given scope. textrange.expand() expand the range to include the full range of
specified units. for example, expanding a "word" means that the words at both ends of the range will completely included in the range. xpand to wor may become expand to words, etc. textrange.findtext() searches the
specified text in the original range and adjusts the range to include the first match. textrange.inrange() returns whether the current range contains the
specified range. textrange.isequal(...
...e words at both ends of the range will completely included in the range. xpand to wor may become expand to words, etc. textrange.findtext() searches the
specified text in the original range and adjusts the range to include the first match. textrange.inrange() returns whether the current range contains the
specified range. textrange.isequal() returns whether the current range is equal to the
specified range. textrange.move() collapses the range and moves the blank range by a
specified number of units. such as, move("character",-1) means to move one character to the left. textrange.moveend() moves the end of the range by a
specified number of units. textrange.movestart() moves the start of the range by a
specified number of units. textrange.movetoelementtext() causes the range to contai...
...can only be used on element objects. textrange.parentelement() returns the parent element of the range, which is the smallest element that contains the range completely. ...
...And 3 more matches
Window.open() - Web APIs
the window interface's open() method loads the
specified resource into the new or existing browsing context (window, <iframe> or tab) with the
specified name. if the name doesn't exist, then a new browsing context is opened in a new tab or a new window, and the
specified resource is loaded into it. syntax var window = window.open(url, windowname, [windowfeatures]); parameters url a domstring indicating the url of the resource to be loaded. this can be a path or url to an html page, image file, or any other resource that is supported by the browser. if the empty string ("") is
specified as url, a blank page is opened into the targeted browsing context. ...
...mstring indicating the url of the resource to be loaded. this can be a path or url to an html page, image file, or any other resource that is supported by the browser. if the empty string ("") is
specified as url, a blank page is opened into the targeted browsing context. windowname optional a domstring specifying the name of the browsing context (window, <iframe> or tab) into which to load the
specified resource; if the name doesn't indicate an existing context, a new window is created and is given the name
specified by windowname. this name can be used as the target for the target attribute of <a> or <form> elements. the name should not contain whitespace. keep in mind that this will not be used as the window's title. windowfeatures optional a domstring containing a comma-separated list of...
...wfeatures optional a domstring containing a comma-separated list of window features given with their corresponding values in the form "name=value". these features include options such as the window's default size and position, whether or not to include toolbar, and so forth. there must be no whitespace in the string. see window features below for documentation of each of the features that can be
specified. return value a windowproxy object, which is basically a thin wrapper for the window object representing the newly created window, and has all its features available. if the window couldn't be opened, the returned value is instead null. the returned reference can be used to access properties and methods of the new window as long as it complies with same-origin policy security requirements. de...
...And 3 more matches
border-image-width - CSS: Cascading Style Sheets
whe...
...2em 3em; /* top | horizontal | bottom */ border-image-width: 5% 15% 10%; /* top | right | bottom | left */ border-image-width: 5% 2em 10% auto; /* global values */ border-image-width: inherit; border-image-width: initial; border-image-width: unset; the border-image-width property may be
specified using one, two, three, or four values chosen from the list of values below. when one value is
specified, it applies the same width to all four sides. ...
... top | right | bottom | left */ border-image-width: 5% 2em 10% auto; /* global values */ border-image-width: inherit; border-image-width: initial; border-image-width: unset; the border-image-width property may be
specified using one, two, three, or four values chosen from the list of values below. 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. ...
...And 3 more matches
border-image - CSS: Cascading Style Sheets
syntax /* source | slice */ border-image: linear-gradient(red, blue) 27; /* source | slice | repeat */ border-image: url("/images/border.png") 27 space; /* source | slice | width */ border-image: linear-gradient(red, blue) 27 / 35px; /* source | slice | width | outset | repeat */ border-image: url("/images/border.png") 27 23 / 50px 30px / 1rem round space; the border-image property may be
specified with anywhere from one to five of the values listed below. note: if the computed value of border-image-source is none, or if the image cannot be displayed, the border-style will be displayed instead. values <'border-image-source'> the source image. see border-image-source. <'border-image-slice'> the dimensions for slicing the source image into regions. up to four values may be
specified...
...ource is none, or if the image cannot be displayed, the border-style will be displayed instead. values <'border-image-source'> the source image. see border-image-source. <'border-image-slice'> the dimensions for slicing the source image into regions. up to four values may be
specified. see border-image-slice. <'border-image-width'> the width of the border image. up to four values may be
specified. see border-image-width. <'border-image-outset'> the distance of the border image from the element's outside edge. up to four values may be
specified. see border-image-outset. <'border-image-repeat'> defines how the edge regions of the source image are adjusted to fit the dimensions of the border image. up to two values may be
specified. see border-image-repeat. accessibility concerns assi...
...happlies toall elements, except internal table elements when border-collapse is collapse. ...
...And 3 more matches
box-shadow - CSS: Cascading Style Sheets
ve to the element, blur and spread radius, and color. 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 box-shadow property enables you to cast a drop shadow from the frame of almost any element. if a border-radius is
specified on the element with a box shadow, the box shadow takes on the same rounded corners. the z-ordering of multiple box shadows is the same as multiple text shadows (the first
specified shadow is on top). box-shadow generator is an interactive tool allowing you to generate a box-shadow. syntax /* keyword values */ box-shadow: none; /* offset-x | offset-y | color */ box-shadow: 60px -16px teal; /*...
...ues. 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. to specify multiple shadows, provide a comma-separated list of shadows. values inset if not
specified (default), the shadow is assumed to be a drop shadow (as if the box were raised above the content). the presence of the inset keyword changes the shadow to one inside the frame (as if the content was depressed inside the box). inset shadows are drawn inside the border (even transparent ones), above the background, but below content. <offset-x> <offset-y> these are two <length> values to set th...
...ative values place the shadow above the element. see <length> for possible units. if both values are 0, the shadow is placed behind the element (and may generate a blur effect if <blur-radius> and/or <spread-radius> is set). <blur-radius> this is a third <length> value. the larger this value, the bigger the blur, so the shadow becomes bigger and lighter. negative values are not allowed. if not
specified, it will be 0 (the shadow's edge is sharp). the specification does not include an exact algorithm for how the blur radius should be calculated, however, it does elaborate as follows: …for a long, straight shadow edge, this should create a color transition the length of the blur distance that is perpendicular to and centered on the shadow’s edge, and that ranges from the full shadow color a...
...And 3 more matches
clip-path - CSS: Cascading Style Sheets
clip-path: circle(50px at 0 100px); clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); clip-path: path('m0.5,1 c0.5,1,0,0.7,0,0.3 a0.25,0.25,1,1,1,0.5,0.3 a0.25,0.25,1,1,1,1,0.3 c1,0.7,0.5,1,0.5,1 z'); /* box and shape values combined */ clip-path: padding-box circle(50px at 0 100px); /* global values */ clip-path: inherit; clip-path: initial; clip-path: unset; the clip-path property is
specified as one or a combination of the values listed below. 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 combination with a <basic-shape>, this value defines the reference box...
...of the values listed below. 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 combination with a <basic-shape>, this value defines the reference box for the basic shape. if
specified by itself, it causes the edges of the
specified box, including any corner shaping (such as a border-radius), to be the clipping path. the geometry box can be one of the following values: margin-box uses the margin box as the reference box. border-box uses the border box as the reference box. padding-box uses the padding box as the reference box. content-box uses the content bo...
...ox. border-box uses the border box as the reference box. padding-box uses the padding box as the reference box. content-box uses the content box as the reference box. fill-box uses the object bounding box as the reference box. stroke-box uses the stroke bounding box as the reference box. view-box uses the nearest svg viewport as the reference box. 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 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 t...
...And 3 more matches
grid-area - CSS: Cascading Style Sheets
n within a grid by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the edges of its grid area. 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. if four <grid-line> values are
specified, grid-row-start is set to the first value, grid-column-start is set to the second value, grid-row-end is set to the third value, and grid-column-end is set to the fourth value. when grid-column-end is omitted, if grid-column-start is a <custom-ident>, grid-column-end is set to that <custom-ident>; otherwise, it is set to auto. when grid-row-end is omitted, if grid-row-start is a <custom-ident>,...
...f 1. <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 implicit named lines of this form, so specifying grid-area: foo; will choose the start/end edge of that named grid area (unless another line named foo-start/foo-end was explicitly
specified before it). otherwise, this is treated as if the integer 1 had been
specified along with the <custom-ident>. <integer> && <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if...
...d, it defaults to 1. negative integers or 0 are invalid. ...
...And 3 more matches
margin - CSS: Cascading Style Sheets
d 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 bottom, the second to the left and right. when three values ...
...ng 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 bottom, the second to the left and right. when three values are
specified, the first margin applies to the top, the second to the right and left, the third to the bottom. when four values are
specified, the margins apply to the top, right, bottom, and left in that order (clockwise). 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 sele...
...ties 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. ...
...And 3 more matches
mask-border-width - CSS: Cascading Style Sheets
whe...
...idth: 2em 3em; /* top | horizontal | bottom */ mask-border-width: 5% 15% 10%; /* top | right | bottom | left */ mask-border-width: 5% 2em 10% auto; /* global values */ mask-border-width: inherit; mask-border-width: initial; mask-border-width: unset; the mask-border-width property may be
specified using one, two, three, or four values chosen from the list of values below. when one value is
specified, it applies the same width to all four sides. ...
...; /* top | right | bottom | left */ mask-border-width: 5% 2em 10% auto; /* global values */ mask-border-width: inherit; mask-border-width: initial; mask-border-width: unset; the mask-border-width property may be
specified using one, two, three, or four values chosen from the list of values below. 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. ...
...And 3 more matches
mask-size - CSS: Cascading Style Sheets
contain; /* global values */ mask-size: inherit; mask-size: initial; mask-size: unset; note: if the value of this property is not set in a mask shorthand property that is applied to the element after the mask-size css property, the value of this property is then reset to its initial value by the shorthand property. 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 using the keyword cover using width and height values to specify a size using width and height, you can supply one or two values: if only one value is given it sets the width, with the height set to auto. if two values are given, the first sets width and the second sets height. each value can be a <length>, a <percentage>, or auto. val...
...keyword cover using width and height values to specify a size using width and height, you can supply one or two values: if only one value is given it sets the width, with the height set to auto. if two values are given, the first sets width and the second sets height. each value can be a <length>, a <percentage>, or auto. values <length> a <length> value scales the mask image to the
specified length in the corresponding dimension. negative lengths are not allowed. <percentage> a <percentage> value scales the mask image in the corresponding dimension to the
specified percentage of the mask positioning area, which is determined by the value of mask-origin. the mask positioning area is, by default, the area containing the content of the box and its padding; the area may also be changed...
...tor image may have both intrinsic dimensions and thus it has an intrinsic proportion too. it also may have one or no intrinsic dimensions and in either case it might or might not have an intrinsic proportion. gradients are treated as images with no intrinsic dimensions or intrinsic proportion. the rendered size of the mask image is then computed as follows: if both components of mask-size are
specified and are not auto: the mask image renders at the
specified size. if the mask-size is contain or cover: the image is rendered by preserving its intrinsic proportion at the largest size contained within or covering the mask positioning area. if the image has no intrinsic proportion, then it is rendered at the size of the mask positioning area. if the mask-size is auto or auto auto: if the image...
...And 3 more matches
padding - CSS: Cascading Style Sheets
lowing css properties: padding-bottom padding-left padding-right padding-top syntax /* apply to all four sides */ padding: 1em; /* vertical | horizontal */ padding: 5% 10%; /* top | horizontal | bottom */ padding: 1em 2em 2em; /* top | right | bottom | left */ padding: 5px 1em 0 2em; /* global values */ padding: inherit; padding: initial; padding: unset; the padding property may be
specified using one, two, three, or four values. 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, the first padding applies to the top, the second to the rig...
... 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. ...
...ing-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. ...
...And 3 more matches
position - CSS: Cascading Style Sheets
n element is positioned in a document. the top, right, bottom, and left properties determine the final location of positioned elements. 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 the position property is
specified as a single keyword chosen from the list of values below. values static the element is positioned according to the normal flow of the document. the top, right, bottom, left, and z-index properties have no effect. this is the default value. relative the element is positioned according to the normal flow of the document, and then offset relative to itself based on the values of top, right, b...
...containing block. (the containing block is the ancestor relative to which the element is positioned.) if the element has margins, they are added to the offset. the element establishes a new block formatting context (bfc) for its contents. a stickily positioned element is an element whose computed position value is sticky. it's treated as relatively positioned until its containing block crosses a
specified threshold (such as setting top to value other than auto) within its flow root (or the container it scrolls within), at which point it is treated as "stuck" until meeting the opposite edge of its containing block. most of the time, absolutely positioned elements that have height and width set to auto are sized so as to fit their contents. however, non-replaced, absolutely positioned elements can...
...crolls within), at which point it is treated as "stuck" until meeting the opposite edge of its containing block. most of the time, absolutely positioned elements that have height and width set to auto are sized so as to fit their contents. ...
...And 3 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
mal string notation hexadecimal string notation represents a color using hexadecimal digits to represent each of the color components (red, green, and blue). it may also include a fourth component: the alpha channel (or opacity). each color component can be represented as a number between 0 and 255 (0x00 and 0xff) or, optionally, as a number between 0 and 15 (0x0 and 0xf). all components must be
specified using the same number of digits. if you use the single-digit notation, the final color is computed by using each component's digit twice; that is, "#d" becomes "#dd" when drawing. a color in hexadecimal string notation always begins with the character "#". after that come the hexadecimal digits of the color code. the string is case-insensitive. "#rrggbb" specifies a fully-opaque color whose ...
.... after that come the hexadecimal digits of the color code. the string is case-insensitive. "#rrggbb" specifies a fully-opaque color whose red component is the hexadecimal number 0xrr, green component is 0xgg, and blue component is 0xbb. "#rrggbbaa" specifies a color whose red component is the hexadecimal number 0xrr, green component is 0xgg, and blue component is 0xbb. ...
... as an example, you can represent the opaque color bright blue as "#0000ff" or "#00f". to make it 25% opaque, you can use "#0000ff44" or "#00f4". ...
...And 3 more matches
<img>: The Image Embed element - HTML: Hypertext Markup Language
hat event handler will get called. this can happen in a number of situations, including: the src attribute is empty ("") or null. the src url is the same as the url of the page the user is currently on. the image is corrupted in some way that prevents it from being loaded. the image's metadata is corrupted in such a way that it's impossible to retrieve its dimensions, and no dimensions were
specified in the <img> element's attributes. the image is in a format not supported by the user agent. attributes this element includes the global attributes. alt defines an alternative text description of the image. note: browsers do not always display images. there are a number of situations in which a browser might not display images, such as: non-visual browsers (such as those used by p...
... failed to display. this attribute is also used when copying and pasting the image to text, or saving a linked image to a bookmark. crossorigin indicates if the fetching of the image must be done using a cors request. image data from a cors-enabled image returned from a cors request can be reused in the <canvas> element without being marked "tainted". ...
...m a cors-enabled image returned from a cors request can be reused in the <canvas> element without being marked "tainted". if the crossorigin attribute is not
specified, then a non-cors request is sent (without the origin request header), and the browser marks the image as tainted and restricts access to its image data, preventing its usage in <canvas> elements. ...
...And 3 more matches
<video>: The Video Embed element - HTML: Hypertext Markup Language
on such as video width and height, whether we want it to autoplay and loop, whether we want to show the browser's default video controls, etc. the content inside the opening and closing <video></video> tags is shown as a fallback in browsers that don't support the element. attributes like all other html elements, this element supports the global attributes. autoplay a boolean attribute; if
specified, the video automatically begins to play back as soon as it can do so without stopping to finish loading the data. note: sites that automatically play audio (or videos with an audio track) can be an unpleasant experience for users, so should be avoided when possible. if you must offer autoplay functionality, you should make it opt-in (requiring a user to specifically enable it). however, this can...
...cument and another document or application. buffered an attribute you can read to determine the time ranges of the buffered media. this attribute contains a timeranges object. controls if this attribute is present, the browser will offer controls to allow the user to control video playback, including volume, seeking, and pause/resume playback. controlslist the controlslist attribute, when
specified, helps the browser select what controls to show on the media element whenever the browser shows its own set of controls (e.g. when the controls attribute is
specified). the allowed values are nodownload, nofullscreen and noremoteplayback. use the disablepictureinpicture attribute if you want to disable the picture-in-picture mode (and the control). crossorigin this enumerated attribute i...
...ched without a cors request (i.e. without sending the origin: http header), preventing its non-tainted used in <canvas> elements. if invalid, it is handled as if the enumerated keyword anonymous was used. see cors settings attributes for additional information. currenttime reading currenttime returns a double-precision floating-point value indicating the current playback position of the media
specified in seconds. if the media has not started playing yet, the time offset at which it will begin is returned. setting currenttime sets the current playback position to the given time and seeks the media to that position if the media is currently loaded. if the media is being streamed, it's possible that the user agent may not be able to obtain some parts of the resource if that data has expired fro...
...And 3 more matches
Expressions and operators - JavaScript
direction of the shift operation is controlled by the operator used. shift operators convert their operands to thirty-two-bit integers and return a result of the same type as the left operand. the shift operators are listed in the following table. bitwise shift operators operator description example left shift (<<) this operator shifts the first operand the
specified number of bits to the left. excess bits shifted off to the left are discarded. zero bits are shifted in from the right. 9<<2 yields 36, because 1001 shifted 2 bits to the left becomes 100100, which is 36. sign-propagating right shift (>>) this operator shifts the first operand the
specified number of bits to the right. excess bits shifted off to the right are discarded. copies of t...
...excess bits shifted off to the right are discarded. zero bits are shifted in from the left. 19>>>2 yields 4, because 10011 shifted 2 bits to the right becomes 100, which is 4. for non-negative numbers, zero-fill right shift and sign-propagating right shift yield the same result. ...
... 19>>>2 yields 4, because 10011 shifted 2 bits to the right becomes 100, which is 4. for non-negative numbers, zero-fill right shift and sign-propagating right shift yield the same result. logical operators logical operators are typically used with boolean (logical) values; when they are, they return a boolean value. however, the && and || operators actually return the value of one of the
specified operands, so if these operators are used with non-boolean values, they may return a non-boolean value. the logical operators are described in the following table. logical operators operator usage description logical and (&&) expr1 && expr2 returns expr1 if it can be converted to false; otherwise, returns expr2. thus, when used with boolean values, && returns tr...
...And 3 more matches
String - JavaScript
ing literals, or as objects, using the string() constructor: const string1 = "a string primitive"; const string2 = 'also a string primitive'; const string3 = `yet another string primitive`; const string4 = new string("a string object"); string primitives and string objects can be used interchangeably in most situations. see "string primitives and string objects" below. string literals can be
specified using single or double quotes, which are treated identically, or using the backtick character `. this last form specifies a template literal: with this form you can interpolate expressions. character access there are two ways to access an individual character in a string. the first is the charat() method: return 'cat'.charat(1) // returns "a" the other way (introduced in ecmascript 5) is to ...
... wrap across multiple lines because \ otherwise my code is unreadable." both of the above methods result in identical strings. constructor string() creates a new string object. it performs type conversion when called as a function, rather than as a constructor, which is usually more useful. static methods string.fromcharcode(num1 [, ...[, numn]]) returns a string created by using the
specified sequence of unicode values. string.fromcodepoint(num1 [, ...[, numn) returns a string created by using the
specified sequence of code points. string.raw() returns a string created from a raw template string. instance properties string.prototype.length reflects the length of the string. read-only. instance methods string.prototype.charat(index) returns the character (exactly one ut...
...lues. string.fromcodepoint(num1 [, ...[, numn) returns a string created by using the
specified sequence of code points. string.raw() returns a string created from a raw template string. instance properties string.prototype.length reflects the length of the string. read-only. instance methods string.prototype.charat(index) returns the character (exactly one utf-16 code unit) at the
specified index. string.prototype.charcodeat(index) returns a number that is the utf-16 code unit value at the given index. string.prototype.codepointat(pos) returns a nonnegative integer number that is the code point value of the utf-16 encoded code point starting at the
specified pos. string.prototype.concat(str [, ...strn ]) combines the text of two (or more) strings and returns a new string. str...
...And 3 more matches
kernelUnitLength - SVG: Scalable Vector Graphics
feconvolvematrix for the <feconvolvematrix>, kernelunitlength indicates the intended distance in current filter units (i.e., units as determined by the value of primitiveunits attribute) between successive columns and rows, respectively, in the kernelmatrix. by specifying value(s) for kernelunitlength, the kernel becomes defined in a scalable, abstract coordinate system. if the attribute is not
specified, the default value is one pixel in the offscreen bitmap, 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. value <number-optional-number> default value pixel in offscreen bitmap animatable yes <number-optional-number> the first number is the x...
...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. value <number-optional-number> default value pixel in offscreen bitmap animatable yes <number-optional-number> the first number is the x value. the second number is the y value. if the x value is not
specified, it defaults to the same value as x. fediffuselighting for the <fediffuselighting>, kernelunitlength indicates the intended distance in current filter units (i.e., units as determined by the value of attribute primitiveunits) for the x and y coordinate, respectively, in the surface normal calculation formulas. the first number is the x value. the second number is the y value. if the y value i...
...efaults to the same value as x. fediffuselighting for the <fediffuselighting>, kernelunitlength indicates the intended distance in current filter units (i.e., units as determined by the value of attribute primitiveunits) for the x and y coordinate, respectively, in the surface normal calculation formulas. the first number is the x value. the second number is the y value. ...
...And 3 more matches
Introduction to using XPath in JavaScript - XPath
sult type to be returned as a result of the evaluation. the most commonly passed constant is xpathresult.any_type which will return the results of the xpath expression as the most natural type. there is a section in the appendix which contains a full list of the available constants. they are explained below in the section "specifying the return type." result: if an existing xpathresult object is
specified, it will be reused to return the results. specifying null will create a new xpathresult object. return value returns xpathresult, which is an xpathresult object of the type
specified in the resulttype parameter. the xpathresult interface is defined here. implementing a default namespace resolver we create a namespace resolver using the creatensresolver method of the document object. var nsr...
...g the current information available in the node's hierarchy at the time lookupnamespaceuri is called. also correctly resolves the implicit xml prefix. specifying the return type the returned variable xpathresult from document.evaluate can either be composed of individual nodes (simple types), or a collection of nodes (node-set types). simple types when the desired result type in resulttype is
specified as either: number_type - a double string_type - a string boolean_type - a boolean we obtain the returned value of the expression by accessing the following properties respectively of the xpathresult object. numbervalue stringvalue booleanvalue example the following uses the xpath expression count(//p) to obtain the number of <p> elements in an html document: var paragraphcount = d...
...ument.evaluate('count(//p)', document, null, xpathresult.any_type, null ); alert( 'this document contains ' + paragraphcount.stringvalue + ' paragraph elements' ); instead, it will return an exception with the code ns_dom_type_error. node-set types the xpathresult object allows node-sets to be returned in 3 principal different types: iterators snapshots first nodes iterators when the
specified result type in the resulttype parameter is either: unordered_node_iterator_type ordered_node_iterator_type the xpathresult object returned is a node-set of matched nodes which will behave as an iterator, allowing us to access the individual nodes contained by using the iteratenext() method of the xpathresult. once we have iterated over all of the individual matched nodes, iteratenext() wil...
...And 3 more matches
Running Tamarin performance tests - Archive of obsolete content
-1.3 sunspider/access-nbody.as 176.0 178.0 -1.1 sunspider/access-nsieve.as 65.0 68.0 -4.4 sunspider/bitops-3bit-bits-in-byte.as 12.0 13.0 -7.7 sunspider/bitops-bits-in-byte.as 36.0 36.0 0.0 by default tests sunspider and sunspider-as3 (optimized for as3) and run. other tests may be
specified by selecting ./runtests.py -c [misc,scimark,jsbench]. also for better accuracy tests may be run multiple times. specifying ./runtests.py -i 10 will run each tests 10 time and use the fastest result. if more than 2 repetitions are
specified the 95% percentile confidence rating is calculated. the confidence rating measures the percentage of the mean 95% of the results were within the range. perform...
...compile tests to standalone executables. --aotout where the resulting binaries should be put (defaults to the location of the as file). --aotargs any extra arguments to pass to compile.py. --vmversion specify vmversion e.g. ...
... specifying both --index and --sav...
...And 2 more matches
Anonymous Content - Archive of obsolete content
erits list can either simply list an attribute (such as value in the example above), or it can specify an = separated pair consisting of the attribute on the anonymous content that should be tied to the attribute on the bound element. the anonymous content attribute is listed first. the special value xbl:text can be used in an = separated pair, where the prefix defined is the xbl namespace. when
specified on the left-hand side of the pair it indicates that the attribute on the right-hand side should be stored as text nodes underneath the anonymous element. when used on the right-hand side, it indicates that any raw text nodes that are explicit children of the bound element should be coalesced and the resulting value should be stored as the attribute on the left-hand side. the xbl:text value canno...
...found on the primary generating binding. explicit insertion points on other bindings are ignored. inherited insertion points are used to place the anonymous content generated by the next binding in the chain that contributes anonymous content. that binding can define inherited insertion points for its base binding as well. this pattern continues all the way up the binding chain. xpath selectors
specified using the includes attribute determine which insertion point a given child should be placed under. [actually, only tag names may be
specified; see the includes attribute description in <children> element reference, bug 174614 and bug 51527.] if no attribute is
specified, an insertion point is considered generic and will match on all content. the insertion point used for a given piece of content ...
...the two events. anonymous content can receive focus when the user tabs through the document. the same rules apply. if the anonymous content is focusable, it can be tabbed into, but if the bound element is not focusable, the event will be stopped before it reaches the bound element. in html4 the tabindex attribute can be used to specify the tab order for focusable elements. ...
...And 2 more matches
Binding Implementations - Archive of obsolete content
indings can define methods and properties on a bound element using the implementation tag. a binding implementation provides a new set of methods and properties that can be invoked directly from the bound element. the methods and properties of an implementation can be defined declaratively using method and property tags in xml, or an external implementation (e.g., a binary implementation) can be
specified using the src attribute. when the src attribute is
specified, any children of the implementation element are ignored. methods methods are defined using the method element. the name given on the tag using the name attribute is the name that can be used to invoke the method on the element. a method with parameters specifies those parameters and their names with parameter elements declared underne...
... ignored. methods methods are defined using the method element. the name given on the tag using the name attribute is the name that can be used to invoke the method on the element. a method with parameters specifies those parameters and their names with parameter elements declared underneath the method element. the implementation of the method is contained inside a body element. the parameters
specified are bound to their names in the method body. <method name="scrolltoindex"> <parameter name="index"/> <body> <![cdata[ if (index < 0) return; ... ]]> </body> </method> properties properties can 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...
... 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. 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 e...
...And 2 more matches
Elements - Archive of obsolete content
at content will become the default content. if the element the binding is attached to contains content, the default content will be ignored. if the element does not contain content, the default content will be added. id - the id attribute is a document-unique identifier. includes - the includes attribute can be used to indicate that only certain content should be placed at the insertion point
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 definition <bin...
...rom the bound element. id - the id attribute is a document-unique identifier. name - the name attribute can be used to provide a specific name for an implementation. this name can then be used to reference the implementation. for example, in javascript the value of this attribute represents the name of the corresponding class that is constructed for the implementation. if no name attribute is
specified then the binding's document uri and id are used to uniquely reference the binding's implementation. implements - the implements attribute can be used to describe the set of interfaces that are implemented by the binding. its value is a comma-separated list of named interfaces. if supported, in strongly typed languages the bound element can be referenced not only as any of the interfaces that the...
...ute 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. ...
...And 2 more matches
Positioning - Archive of obsolete content
er of the document, or underneath the currently selected item if a list is focused. context menus will always appear in this location, and not respect any position attribute value. tooltips will always appear near the current mouse position, offset vertically by a small amount. the position attribute the position of all types of popups can be controlled in two ways. first, the position can be
specified when using the popup's openpopup method. this is used when a popup is opened by a script. second, the position can be
specified using several attributes placed on the menupopup, panel or tooltip element. these attributes are described below and function the same for all three elements. the position attribute specifies the alignment of the popup with respect to the element that the popup is attac...
...gned along the top edge. there are several possible values for the position attribute, described here, along with images which show how a popup would be aligned in each case. the following assumes a left to right user interface. for right to left user interfaces, the same values should be used, but will cause the popup to appear and be aligned on the opposite side. the position attribute can be
specified either as a single word offering pre-defined alignment positions, or as 2 words specifying exactly which part of the popup and associated element should be aligned. explicit alignment values if
specified as 2 words there must be exactly 1 space between the 2 words and indicates which corner or edge of the anchor is aligned with which corner of the popup. the first word specifies the anchor cor...
... topcenter the popup will be aligned with the center of the top edge the anchor. bottomcenter the popup will be aligned with the center of the bottom edge the anchor. valid values for the popup alignment (ie, the second word) are shown below popup alignment values topleft the top-left corner of the popup will be aligned with the
specified corner or edge of the anchor element. topright the top-right corner of the popup will be aligned with the
specified corner or edge of the anchor element. bottomleft the bottom-left corner of the popup will be aligned with the
specified corner or edge of the anchor element. bottomright the bottom-right corner of the popup will be aligned with the spe...
...And 2 more matches
XUL element attributes - Archive of obsolete content
re passed to the element only. allownegativeassertions type: boolean valid on any element that has a datasources attribute. when multiple datasources are used, one may override an assertion from another. this attribute, if true, which is the default, allows a datasource to negate an earlier assertion. class type: string the style class of the element. multiple classes may be
specified by separating them with spaces. coalesceduplicatearcs type: boolean valid on any element that has a datasources attribute. when multiple datasources are used, one may override an assertion from another. this attribute, if true, which is the default, allows a datasource to negate an earlier assertion. collapsed type: boolean if true, then the element is collapsed and does not app...
...t of datasource uris a space-separated list of datasources that an element's template will use for content generation. these can be either internal datasources such as rdf:bookmarks or a url. the datasources attribute may be placed on most elements, although it will usually be found on trees and menu related elements. the element should have a template element as a child. for rdf templates, the
specified datasources are combined into a single composite datasource which holds the data from all of the datasources. this composite datasource is accesssible via a script through the database property. for xml datasources, only one source is used, either the url of an xml file or an anchor reference to another element within the same document. for instance, the reference '#data' refers to an element wi...
...es below this attribute can be used to make the children of the element equal in size. always for a horizontally oriented element, this will make all of its children have the width of the widest child. for a vertically oriented element, this will make its children all have the height of the tallest child. never all of the children are displayed at the size required by the content or as
specified by the width and height attributes or the css width and height properties. flags type: space-separated list of the values below a set of flags used for miscellaneous purposes. two flags are defined, which may be the value of this attribute. dont-test-empty: for template generated content, the builder will not check that a container is empty. dont-build-content: this flag may be...
...And 2 more matches
Gecko Compatibility Handbook - Archive of obsolete content
rds conformant features of css. use consistent case when writing html id and class name attributes and css styles for those ids and classes. do not specify heights or widths on inline elements such as spans. use only cross-browser box specifications for margins, padding and borders. (more about css) content differs in gecko browsers and internet explorer incorrect layout mode
specified by doctype. if pages should be displayed by legacy browsers such as netscape navigator 4 or internet explorer 4 and 5, be sure to specify quirks mode layout via the doctype. images are laid out without intervening blank areas in interent explorer but display blank areas between the images in gecko browsers. incorrect layout mode
specified by doctype. ...
...s should be displayed by legacy browsers such as netscape navigator 4 or internet explorer 4 and 5, be sure to specify quirks mode layout via the doctype. images are laid out without intervening blank areas in interent explorer but display blank areas between the images in gecko browsers. incorrect layout mode
specified by doctype. standards mode layout has been
specified by the doctype. change the doctype to request quirks mode layout instead. more info clicking a link results in a 404-page not found but works in internet explorer the link may use an invalid form of a relative url. change relative urls from http://directory/... to directory/.... or use absolute paths in urls such as http://example.com/directory/... verify t...
... change relative urls from http://directory/... to directory/.... or use absolute paths in urls such as http://example.com/directory/... verify that all hyperlinks use forward slashes (/) clicking on a link displays a "download" or displays html code instead of rendering the page correctly, but works as expected in internet explorer the web server has incorrectly
specified the mime type for the content. internet explorer tries to guess the mime type of documents while gecko browsers relies upon the web server to specify the correct mime type. gecko does not try to 'sniff' the mime type for a document in order to reduce the possibility of unsecure, dangerous content masquerading as as a safe mime type. use perl's head utitility to determine the actual ...
...And 2 more matches
Drawing graphics - Learn web development
angle height, as we know the top of the triangle is 50 pixels from the top of the canvas. the next line draws a line back to the starting point of the triangle. last of all, we run ctx.fill() to end the path and fill in the shape. drawing circles now let's look at how to draw a circle in canvas. this is accomplished using the arc() method, which draws all or part of a circle at a
specified point. let's add an arc to our canvas — add the following to the bottom of your code: ctx.fillstyle = 'rgb(0, 0, 255)'; ctx.beginpath(); ctx.arc(150, 106, 50, degtorad(0), degtorad(360), false); ctx.fill(); arc() takes six parameters. the first two specify the position of the arc's center (x and y, respectively). the third is the circle's radius, the fourth and fifth are the start a...
...y to the right. let's try adding another arc: ctx.fillstyle = 'yellow'; ctx.beginpath(); ctx.arc(200, 106, 50, degtorad(-45), degtorad(45), true); ctx.lineto(200, 106); ctx.fill(); the pattern here is very similar, but with two differences: we have set the last parameter of arc() to true, meaning that the arc is drawn counterclockwise, which means that even though the arc is
specified as starting at -45 degrees and ending at 45 degrees, we draw the arc around the 270 degrees not inside this portion. if you were to change true to false and then re-run the code, only the 90 degree slice of the circle would be drawn. before calling fill(), we draw a line to the center of the circle. this means that we get the rather nice pac-man-style cutout rendered. if you removed this line ...
... parameters 4 and 5 define the width and height of the area we want to cut out from the original image we loaded. parameters 6 and 7 define the coordinates at which you want to draw the top-left corner of the cut-out portion of the image, relative to the top-left corner of the canvas. parameters 8 and 9 define the width and height to draw the cut-out area of the image. in this case, we have
specified the same dimensions as the original slice, but you could resize it by specifying different values. the final example should look like so: note: the finished code is available on github as 5_canvas_images.html. loops and animations we have so far covered some very basic uses of 2d canvas, but really you won't experience the full power of canvas unless you update or animate it in some...
...And 2 more matches
XPCOMUtils.jsm
n. _xpcom_categories: [{ // each object in the array specifies the parameters to pass to // nsicategorymanager.addcategoryentry(). 'true' is passed for // both apersist and areplace params. category: "some-category", // optional, defaults to the object's classdescription entry: "entry name", // optional, defaults to the object's contractid (unless // 'service' is
specified) value: "...", // optional, defaults to false. when set to true, and only if 'value' // is not
specified, the concatenation of the string "service," and the // object's contractid is passed as avalue parameter of addcategoryentry. service: true, // optional array of applications' ids in the form: // [ "{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}", ... ] // if this is de...
... apps: [ ... ] }], // queryinterface implementation, e.g. using the generateqi helper queryinterface: xpcomutils.generateqi( [components.interfaces.nsiobserver, components.interfaces.nsimyinterface, "nsifoo", "nsibar" ]), // [optional] classinfo implementation, e.g. using the generateci helper. ...
...azygetter( aobject, aname, alambda ); parameters aobject the object into which to add the new lazy getter function. aname the name of the getter function to create. alambda a function that returns the value the getter should return. this function is called exactly once. this will reference aobject during execution of the function. definelazymodulegetter() defines a getter on a
specified object for a module. the module will not be imported until first use. function definelazymodulegetter( aobject, aname, aresource, asymbol ); parameters aobject the object to define the lazy getter on. aname the name of the getter to define on aobject for the module. aresource the url used to obtain the module. asymbol the name of the symbol exported by the module. this parame...
...And 2 more matches
nss tech note1
r templates : the sec_asn1template structure tells the decoder what to do with the input data. this structure contains four fields : kind . this 32-bit field tells the decoder what to do with a particular component within the input data. it is made of two parts : the lower byte, which can contain asn.1 tags, and the upper 3 bytes, which can contain decoder modifiers. if only an asn.1 tag is
specified without a modifier, then the decoder will enforce the presence of a component of that type, and fail if it does not match. if kind is an asn.1 sequence tag (sec_asn1_sequence), then you must specify additional templates in a null-terminated array to define the content of the of the asn.1 sequence. if kind is the sec_asn1_choice modifier, you must also specify additional templates in a null termin...
... types. it is only required for dynamically allocating memory for the structure if the template is being included from an asn.1 sequence or sequence of, or if dynamic allocation was requested from the parent template using the sec_asn1_pointer modifier here is a description of the various tags and modifiers that apply to the <tt style="color: rgb(0,0,0);">kind field. asn.1 tags asn.1 tags are
specified in the lower byte of the kind field of the template, as noted above. the following is not an attempt to explain asn.1 tags or their purposes. rather, the goal here is to explain what type of tags the decoder supports and which macros should be used when defining tags in decoder templates. it should be noted that we only support an older specification of asn.1; multibyte tags are not currently su...
...n.1 tags or their purposes. rather, the goal here is to explain what type of tags the decoder supports and which macros should be used when defining tags in decoder templates. it should be noted that we only support an older specification of asn.1; multibyte tags are not currently supported. the 8-bit asn.1 tags that we support are made of three parts : the asn.1 component class type. it is
specified in the upper 2 tag bits (number 6 and 7). there are four classes of asn.1 tags : universal, application-specific, context-specific, and private. you can specify the class of the tag using the macros sec_asn1_universal, sec_asn1_application, sec_asn1_context_specific and sec_asn1_private. universal is the default tag class and does not have to be
specified, as the value of the class type is zero. ...
...And 2 more matches
NSS PKCS11 Functions
ul, null. description secmod_loadusermodule loads a new pkcs #11 module into nss and connects it to the current nss trust infrastructure. once the the module has been successfully loaded, other nss calls will use it in the normal course of searching. modulespec specifies how the module should be loaded. more information about module spec is available at pkcs11_module_specs. nss parameters may be
specified in module specs used by secmod_loadusermodule. module will continue to function in the nss infrastructure until unloaded with secmod_unloadusermodule. secmod_unloadusermodule unload a pkcs #11 module. syntax #include "secmod.h" extern secstatus secmod_unloadusermodule(secmodmodule *module); parameters this function has the following parameters: module is the module to be unloaded. returns th...
...oftoken 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 parameters here are configdir, tokendescription and flags. a full list is below: configdir the location of the databases for this token. if configdir is not
specified, and nocertdb and nokeydb is not
specified, the load will fail. certprefix cert prefix for this token. keyprefix prefix for the key database for this token. (if not
specified, certprefix will be used). tokendescription the label value for this token returned in the ck_token_info structure with an internationalize string (utf8). this value will be truncated at 32 bytes (no null, partial utf8 chara...
...ly - 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 to a slot. the caller is responsible for freeing the slot reference when it is through. freeing the slot reference will not unload the slot. that happens with the corresponding secmod_closeuserdb() function. until the secmod_closeuserdb fu...
...And 2 more matches
NSS Tools crlutil
-g create new certificate revocation list(crl). -d delete certificate revocation list from cert database. -i import a crl to the cert database -e erase all crls of
specified type from the cert database -l list existing crl located in cert database file. -m modify existing crl which can be located in cert db or in arbitrary file. if located in file it should be encoded in asn.1 encode format. arguments ...
... -a use ascii format or allow the use of ascii format for input and output. this formatting follows rfc #1113. -c crl-gen-file specify script file that will be used to control crl generation/modification. see crl-cript-file format below. if options -m|-g is used and -c crl-script-file is not
specified, crlutil will read script data from standard input. -d directory specify the database directory containing the certificate and key database files. on unix the certificate database tool defaults to $home/.netscape (that is, ~/.netscape). on windows nt the default is the current directory. the nss database files must reside ...
...ion reason code extension: the reasoncode is a non-critical crl entry extension that identifies the reason for the certificate revocation. ...
...And 2 more matches
JS_GetPropertyAttributes
obsolete since jsapi 26this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. get the attributes of a
specified property. syntax jsbool js_getpropertyattributes(jscontext *cx, jsobject *obj, const char *name, unsigned int *attrsp, jsbool *foundp); jsbool js_getucpropertyattributes(jscontext *cx, jsobject *obj, const jschar *name, size_t namelen, unsigned int *attrsp, jsbool *foundp); name type description cx jscontext * the context in which to look up property attributes. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the object that has the property to be queried. ...
... obj jsobject * the object that has the property to be queried. name const char * or const jschar * name of the property from which to retrieve attributes. namelen size_t (only in js_getucpropertyattributes) the length of name in characters; or (size_t) -1 to indicate that name is null-terminated. attrsp unsigned int * out parameter. if the
specified property is found on obj, *attrsp receives its attributes. foundp jsbool * out parameter. if no error occurs, *foundp receives js_true if the
specified property is found and js_false if it is not found. if an error occurs, the value left in *foundp is un
specified. description js_getpropertyattributes retrieves the property attributes of the property with the given name on a...
...the return value is js_true (to indicate that no error occurred). ...
...And 2 more matches
Mork
be released open source. starting with mozilla 1.9, it was phased out in favor of sqlite, a more widely-supported file format. the information on this page was constructed by reading the source code of the mork database in mozilla and attempting to codify what it parses as faithfully as possible. in a few cases, constructs that the parser supported but were never used in mozilla's code are left un
specified. mork structure mork is a schema-less database format. at its core, it can be viewed as a set of rows, collections of name-value pairs, which can be organized into various tables. rows need not be in a table, nor need they be in only one table. values are merely an opaque sequence of bytes, so their actual content is dependent on the mork consumer. except when parsing values, whitespace ('\b', '\...
... to establish which dictionary the aliases are added to. most files will have just two dictionaries: the column scope dictionary ('c') and the value scope dictionary ('v', the default). the keys are hexadecimal numbers starting at 0x80, because the values less than 0x80 are theoretically their representative ascii values. tables a table is set of rows, potentially with a meta-row. the table id is
specified using the mid at the beginning of the table. furthermore, the scope of the mid also serves as the default scope of rows defined within the table. the meta-row of the table (different from the meta-row of a row) contains a few things you might care about. the first is the kind column (k), where the mid is typically column-scoped (:c). next is the status column (s), which is defined as a single dig...
...e a row or rowreference indicates that said row should be removed from the table. rows for the most part, a row should not be seen outside of a table; the only time i have seen one outside a table is for table meta-rows. the first mid, as you should expect by now, 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...
...And 2 more matches
Places Developer Guide
lder's contents, and how to access the properties of the items themselves. var history = cc["@mozilla.org/browser/nav-history-service;1"] .getservice(ci.nsinavhistoryservice); var query = history.getnewquery(); query.setfolders([myfolderid], 1); var result = history.executequery(query, history.getnewqueryoptions()); // the root property of a query result is an object representing the folder you
specified above. var foldernode = result.root; // open the folder, and iterate over its contents. foldernode.containeropen = true; for (var i=0; i < foldernode.childcount; ++i) { var childnode = foldernode.getchild(i); // some item properties. var title = childnode.title; var id = childnode.itemid; var type = childnode.type; // some type-specific actions. if (type == ci.nsinavhistoryresultnode.res...
...var resultcontainernode = result.root; // open the folder, and iterate over its contents. resultcontainernode.containeropen = true; for (var i=0; i < resultcontainernode.childcount; ++i) { var childnode = resultcontainernode.getchild(i); // accessing properties of matching bookmarks var title = childnode.title; var uri = childnode.uri; } updating bookmark items for all items: ...
.... bmsvc.removeobserver(observer); html import/export the nsiplacesimportexportservice service is used for import and export of bookmarks in the netscape bookmarks html format. note that this service is only currently available for firefox, not other toolkit-based applications. importing: importhtmlfromfile (nsilocalfile afile, boolean aisinitialimport) - this imports all the bookmarks in the
specified file into the current bookmarks collection. if aisinitialimport 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) - this exports all bookmarks in the toolbar, menu and unfiled b...
...And 2 more matches
IAccessibleAction
return value e_invalidarg if bad [in] passed, [out] value is n...
...hresult doaction( [in] long actionindex ); parameters actionindex 0 based index specifying the action to perform. ...
...cription ); parameters actionindex 0 based index specifying which action's description to return. if it lies outside the valid range an empty string is returned. description the returned value is a localized string of the
specified action. return value e_invalidarg if bad [in] passed, [out] value is null. s_false if there is nothing to return, [out] value is null. s_ok. doaction() performs the
specified action on the object. hresult doaction( [in] long actionindex ); parameters actionindex 0 based index specifying the action to perform. if it lies outside the valid range no action is performed. return value e_invalidarg if bad [in] passed. s_ok. keybinding() returns an array of bstrs describing one or more key bindings, if there are any, associated with the
specified action. the returned st...
...And 2 more matches
IAccessibleEditableText
herits from: iunknown last changed in gecko 1.9 (firefox 3) this interface is typically used in conjunction with the iaccessibletext interface and complements that interface with the additional capability of clipboard operations. note that even a read only text object can support the copy capability so this interface is not limited to editable objects. the substrings used with this interface are
specified as follows: if startoffset is less than endoffset, the substring starts with the character at startoffset and ends with the character just before endoffset. if endoffset is lower than startoffset, the result is the same as a call with the two arguments exchanged. the whole text can be defined by passing the indices zero and iaccessibletext.ncharacters(). if both indices have the same value, an em...
...t deletetext([in] long startoffset, [in] long endoffset ); hresult inserttext([in] long offset, [in] bstr text ); hresult pastetext([in] long offset ); hresult replacetext([in] long startoffset, [in] long endoffset, [in] bstr text ); hresult setattributes([in] long startoffset, [in] long endoffset, [in] bstr attributes ); methods copytext() copies the text range into the clipboard. the
specified text between the two given indices is copied into the system clipboard. hresult copytext( [in] long startoffset, [in] long endoffset ); parameters startoffset start index of the text to moved into the clipboard. the valid range is 0..length. endoffset end index of the text to moved into the clipboard. the valid range is 0..length. return value e_invalidarg if bad [in] passed. s_ok. cuttext...
...e two given indices is deleted from the text represented by this object. hresult deletetext( [in] long startoffset, [in] long endoffset ); parameters startoffset start index of the text to be deleted. the valid range is 0..length. endoffset end index of the text to be deleted. the valid range is 0..length. return value e_invalidarg if bad [in] passed. s_ok. inserttext() inserts text at the
specified position. the
specified string is inserted at the given index into the text represented by this object. hresult inserttext( [in] long offset, [in] bstr text ); parameters offset index at which to insert the text. the valid range is 0..length. text text that is inserted. return value e_invalidarg if bad [in] passed. s_ok. pastetext() pastes text from the clipboard. the text in the system cl...
...And 2 more matches
mozIStorageValueArray
arameters aindex the zero-based numerical index for the column to get the data from. return value one of the constants mozistoragevaluearray.value_type_null, mozistoragevaluearray.value_type_integer, mozistoragevaluearray.value_type_float, mozistoragevaluearray.value_type_text, or mozistoragevaluearray.value_type_blob describing the type aindex is. getint32() obtains a int32 from the
specified index. long getint32( in unsigned long aindex ); parameters aindex the zero-based numerical index for the column to get the data from. return value the int32 for the
specified entry. getint64() obtains a int64 from the
specified index. long long getint64( in unsigned long aindex ); parameters aindex the zero-based numerical index for the column to get the data from. ...
...signed long aindex ); parameters aindex the zero-based numerical index for the column to get the data from. return value the int32 for the
specified entry. getint64() obtains a int64 from the
specified index. long long getint64( in unsigned long aindex ); parameters aindex the zero-based numerical index for the column to get the data from. return value the int64 for the
specified entry. getdouble() obtains a double from the
specified index. double getdouble( in unsigned long aindex ); parameters aindex the zero-based numerical index for the column to get the data from. return value the double for the
specified entry. getutf8string() obtains a utf8string from the
specified index. note: c++ callers should be aware that a string value for a null column ha...
...pecified entry. getutf8string() obtains a utf8string from the
specified index. note: c++ callers should be aware that a string value for a null column has isvoid set to distinguish it from an empty string. autf8string getutf8string( in unsigned long aindex ); parameters aindex the zero-based numerical index for the column to get the data from. return value the utf8string for the
specified entry. getstring() obtains a string from the
specified index. note: c++ callers should be aware that a string value for a null column has isvoid set to distinguish it from an empty string. astring getstring( in unsigned long aindex ); parameters aindex the zero-based numerical index for the column to get the data from. return value the string for the
specified entry. getblob() ...
...And 2 more matches
URLs - Plugins
uniform resource locator (url) protocols provide a means for locating and accessing resources that are available on the internet and on intranets. plug-ins can request and receive the data associated with urls of any type that the browser can handle, including http, ftp, news, mailto, and gopher. the table below summarizes urls supported by gecko. in addition, gecko may support urls not listed on this table. url scheme description about locates browser information or "fun" pages. ...
...rls not listed on this table. url scheme description about locates browser information or "fun" pages. file (host-specific filenames) locates files on a specific host computer rather than an internet resource. ftp (file transfer protocol) locates files and directories on internet hosts for file download. gopher (gopher protocol) locates
specified items on a gopher server. obsolete since gecko 2.0 http (hypertext transfer protocol) locates resources on the internet. javascript executes javascript code that follows the url. netscape-specific. mailto (electronic mail address) locates the internet mailing address of an individual or service. nethelp displays a nethelp topic in a nethelp window. ...
...de area information servers) locates wais databases and their documents. wysiwyg placed before another url; displays a page that javascript has updated using document.write. for more information, see rfc 3986, "uniform resource identifier (uri): generic syntax", and the iana uri scheme registry. getting urls posting urls getting urls to retrieve a url and display it on a
specified target page, use the npn_geturl, npn_geturlnotify, and npp_urlnotify functions. this section describes the methods and procedures used for getting the url and displaying the page. the plug-in uses the npn_geturl function to ask the browser to display data retrieved from a url in a
specified target window or frame, or deliver it to the plug-in instance in a new stream. this is the way that plug-i...
...And 2 more matches
Network request list - Firefox Developer Tools
out a resource (e.g., if it were blocked by the browser or an extension), you can block requests matching patterns you specify. click the request blocking icon in the toolbar. this opens the blocking sidebar. (click the icon again when you want to close the sidebar.) enter a string in the field with the placeholder text block resource when url contains. reload the page to test it with the
specified url blocked. other actions you can take with request blocking: to turn all request blocking off or on: toggle the checkbox next to enable request blocking. to turn a specific block off or on: toggle the checkbox next to that item. to delete a blocked item, click the x icon that appears when you focus the item. (starting with firefox 77) right-click any item in the list and choose from the...
... keyword meaning examples status-code shows resources that have the specific http status code. status-code:304 method shows resources that have were requested via the specific http request method. method:post domain shows resources coming from a specifc domain. domain:mozilla.org remote-ip shows resources coming from a server with the
specified ip. remote-ip:63.245.215.53 remote-ip:[2400:cb00:2048:1::6810:2802] cause shows resources matching a specific cause type. the types can be found in the description of the cause column. cause:js cause:stylesheet cause:img transferred shows resources having a specific transferred size or a transferred size close to the one
specified. k can be used as suffi...
...mn. cause:js cause:stylesheet cause:img transferred shows resources having a specific transferred size or a transferred size close to the one
specified. k can be used as suffix for kilobytes and m for megabytes, e.g. the value 1k is equivalent to 1024. transferred:1k size shows resources having a specific size (after decompression) or a size close to the one
specified. k can be used as suffix for kilobytes and m for megabytes, e.g. the value 1k is equivalent to 1024. size:2m larger-than shows resources that are larger than the
specified size in bytes. k can be used as suffix for kilobytes and m for megabytes, e.g. the value 1k is equivalent to 1024. larger-than:2000 -larger-than:4k mime-type shows resources that match the spec...
...And 2 more matches
AudioParam.setValueCurveAtTime() - Web APIs
r interpolation between the sequence of values defined in an array of floating-point values, which are scaled to fit into the given interval starting at starttime and a specific duration. syntax var paramref = param.setvaluecurveattime(values, starttime, duration); parameters values an array of floating-point numbers representing the value curve the audioparam will change through along the
specified duration. every value in the array must be a finite number; if any value is nan, infinity, or -infinity, a typeerror exception is thrown. starttime a double representing the time (in seconds) after the audiocontext was first created that the change in value will happen. if this value is lower than audiocontext.currenttime, it is clamped to currenttime. duration a double representing the total...
...an, infinity, or -infinity, a typeerror exception is thrown. starttime a double representing the time (in seconds) after the audiocontext was first created that the change in value will happen. if this value is lower than audiocontext.currenttime, it is clamped to currenttime. ...
...inity, a typeerror exception is thrown. starttime a double representing the time (in seconds) after the audiocontext was first created that the change in value will happen. if this value is lower than audiocontext.currenttime, it is clamped to currenttime. duration a double representing the total time (in seconds) over which the parameter's value will change following the
specified curve. ...
...And 2 more matches
CSSCounterStyleRule - Web APIs
all;} properties this interface also inherits properties from its parent cssrule. csscounterstylerule.name is a domstring object that contains the serialization of the <counter-style-name> defined for the associated rule. csscounterstylerule.system is a domstring object that contains the serialization of the system descriptor defined for the associated rule. if the descriptor was not
specified in the associated rule, the attribute returns an empty string. csscounterstylerule.symbols is a domstring object that contains the serialization of the symbols descriptor defined for the associated rule. if the descriptor was not
specified in the associated rule, the attribute returns an empty string. csscounterstylerule.additivesymbols is a domstring object that contains the serialization of...
... is a domstring object that contains the serialization of the symbols descriptor defined for the associated rule. if the descriptor was not
specified in the associated rule, the attribute returns an empty string. csscounterstylerule.additivesymbols is a domstring object that contains the serialization of the additive-symbols descriptor defined for the associated rule. if the descriptor was not
specified in the associated rule, the attribute returns an empty string. csscounterstylerule.negative is a domstring object that contains the serialization of the negative descriptor defined for the associated rule. if the descriptor was not
specified in the associated rule, the attribute returns an empty string. csscounterstylerule.prefix is a domstring object that contains the serialization of the pr...
...stylerule.negative is a domstring object that contains the serialization of the negative descriptor defined for the associated rule. if the descriptor was not
specified in the associated rule, the attribute returns an empty string. csscounterstylerule.prefix is a domstring object that contains the serialization of the prefix descriptor defined for the associated rule. if the descriptor was not
specified in the associated rule, the attribute returns an empty string. csscounterstylerule.suffix is a domstring object that contains the serialization of the suffix descriptor defined for the associated rule. if the descriptor was not
specified in the associated rule, the attribute returns an empty string. csscounterstylerule.range is a domstring object that contains the serialization of the range d...
...And 2 more matches
CanvasRenderingContext2D - Web APIs
k). gradients and patterns canvasrenderingcontext2d.createlineargradient() creates a linear gradient along the line given by the coordinates represented by the parameters. canvasrenderingcontext2d.createradialgradient() creates a radial gradient given by the coordinates of the two circles represented by the parameters. canvasrenderingcontext2d.createpattern() creates a pattern using the
specified image (a canvasimagesource). it repeats the source in the directions
specified by the repetition argument. this method returns a canvaspattern. shadows canvasrenderingcontext2d.shadowblur specifies the blurring effect. default: 0 canvasrenderingcontext2d.shadowcolor color of the shadow. default: fully-transparent black. canvasrenderingcontext2d.shadowoffsetx horizontal distance the shad...
...e back to the start of the current sub-path. it tries to draw a straight line from the current point to the start. if the shape has already been closed or has only one point, this function does nothing. canvasrenderingcontext2d.moveto() moves the starting point of a new sub-path to the (x, y) coordinates. canvasrenderingcontext2d.lineto() connects the last point in the current sub-path to the
specified (x, y) coordinates with a straight line. canvasrenderingcontext2d.beziercurveto() adds a cubic bézier curve to the current path. canvasrenderingcontext2d.quadraticcurveto() adds a quadratic bézier curve to the current path. canvasrenderingcontext2d.arc() adds a circular arc to the current path. canvasrenderingcontext2d.arcto() adds an arc to the current path with the given control point...
.... canvasrenderingcontext2d.scrollpathintoview() scrolls the current path or a given path into the view. canvasrenderingcontext2d.clip() creates a clipping path from the current sub-paths. everything drawn after clip() is called appears inside the clipping path only. for an example, see clipping paths in the canvas tutorial. canvasrenderingcontext2d.ispointinpath() reports whether or not the
specified point is contained in the current path. canvasrenderingcontext2d.ispointinstroke() reports whether or not the
specified point is inside the area contained by the stroking of a path. transformations objects in the canvasrenderingcontext2d rendering context have a current transformation matrix and methods to manipulate it. the transformation matrix is applied when creating the current default ...
...And 2 more matches
Drawing shapes with canvas - Web APIs
ing one or more paths. luckily, we have an assortment of path drawing functions which make it possible to compose very complex shapes. first let's look at the rectangle. there are three functions that draw rectangles on the canvas: fillrect(x, y, width, height) draws a filled rectangle. strokerect(x, y, width, height) draws a rectangular outline. clearrect(x, y, width, height) clears the
specified rectangular area, making it fully transparent. each of these three functions takes the same parameters. x and y specify the position on the canvas (relative to the origin) of the top-left corner of the rectangle. width and height provide the rectangle's size. below is the draw() function from the previous page, but now it is making use of these three functions. rectangular shape example <ht...
....fill(); } } the result looks like this: 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 onloa...
...; // right eye ctx.stroke(); } } the result looks like this: screenshotlive sample if you'd like to see the connecting lines, you can remove the lines that call moveto(). note: to learn more about the arc() function, see the arcs section below. lines for drawing straight lines, use the lineto() method. lineto(x, y) draws a line from the current drawing position to the position
specified by x and y. this method takes two arguments, x and y, which are the coordinates of the line's end point. the starting point is dependent on previously drawn paths, where the end point of the previous path is the starting point for the following, etc. the starting point can also be changed by using the moveto() method. the example below draws two triangles, one filled and one outlined. <html>...
...And 2 more matches
Element.getAttributeNS() - Web APIs
if the attribute doesn't exist, the result is null. ...
...if the attribute doesn't exist, the result is null. ...
...if the attribute doesn't exist, the result is null. note: earlier versions of the dom specification had this method described as returning an empty string for non-existent attributes, but it was not typically implemented this way since null makes more sense. the dom4 specification now says this method should return null for non-existent attributes. ...
...And 2 more matches
HTMLImageElement.sizes - Web APIs
the htmlimageelement property sizes allows you to specify the layout width of the image for each of a list of media conditions. this provides the ability to automatically select among different images—even images of different orientations or aspect ratios—as the document state changes to match different media conditions. each condition is
specified using the same conditional format used by media queries. syntax let sizes = htmlimageelement.sizes; htmlimageelement.sizes = sizes; value a usvstring containing a comma-separated list of source size descriptors followed by an optional fallback size. each source size descriptor is comprised of a media condition, then at least one whitespace character, then the source size value to use for the image when the media condition evaluates to true. me...
... as defined by the media queries standard. because a source size descriptor is used to specify the width to use for the image during layout of the page, the media condition is typically (but not necessarily) based entirely on width information. see syntax in using media queries for details on how to construct a media condition. source size values the source size value is a css length. ...
... using media queries for details on how to construct a media condition. source size values the source size value is a css length. it may be
specified using font-relative units (such as em or ex), absolute units (such as px or cm), or the vw unit, which lets you specify the width as a percentage of the viewport width (1vw being 1% of the viewport width). note: the source size value must not be
specified as a percentage of the container size; that is, lengths such as 50% or 100% are not allowed, as there would be uncertainty as to what the
specified value is a percentage of. example in this example, a blog-like layout is created, displaying some text and an image which for which three size points are
specified, depending on the width of the window. three versions of the image are also availabl...
...And 2 more matches
Using IndexedDB - Web APIs
oing to make changes to the database or if you just need to read from it. transactions have three available modes: readonly, readwrite, and versionchange. to change the "schema" or structure of the database—which involves creating or deleting object stores or indexes—the transaction must be in versionchange mode. this transaction is opened by calling the idbfactory.open method with a version
specified. (in webkit browsers, which have not implemented the latest specification, the idbfactory.open method takes only one parameter, the name of the database; then you must call idbversionchangerequest.setversion to establish the versionchange transaction.) to read the records of an existing object store, the transaction can either be in readonly or readwrite mode. to make changes to an existing obje...
... you open such transactions with idbdatabase.transaction. the method accepts two parameters: the storenames (the scope, defined as an array of object stores that you want to access) and the mode (readonly or readwrite) for the transaction. the method returns a transaction object containing the idbindex.objectstore method, which you can use to access your object store. by default, where no mode is
specified, transactions open in readonly mode. note: as of firefox 40, indexeddb transactions have relaxed durability guarantees to increase performance (see bug 1112702.) previously in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk. in firefox 40+ the complete event is fired after the os has been told to write the data but poten...
...an abort event is fired on the transaction. otherwise, after all pending requests have completed, you'll get a complete event. if you're doing lots of database operations, then tracking the transaction rather than individual requests can certainly aid your sanity. now that you have a transaction, you'll need to get the object store from it. transactions only let you have an object store that you
specified when creating the transaction. then you can add all the data you need. // do something when all the data is added to the database. transaction.oncomplete = function(event) { console.log("all done!"); }; transaction.onerror = function(event) { // don't forget to handle errors! }; var objectstore = transaction.objectstore("customers"); customerdata.foreach(function(customer) { var request ...
...And 2 more matches
Capabilities, constraints, and settings - Web APIs
.getelementbyid("framerateslider").disabled = !supported["framerate"]; in this example, the supported constraints are fetched, and a control that lets the user configure the frame rate is disabled if the framerate constraint isn't supported. how constraints are defined a single constraint is an object whose name matches the constrainable property whose desired value or range of values is being
specified. this object contains zero or more individual constraints, as well as an optional sub-object named advanced, which contains another set of zero or more constraints which the user agent must satisfy if at all possible. the user agent attempts to satisfy constraints in the order
specified in the constraint set. the most important thing to understand is that most constraints aren't requirements; i...
...not a requirement. specifying a range of values sometimes, any value within a range is acceptable for a property's value. you can specify ranges with either or both minimum and maximum values, and you can even specify an ideal value within the range, if you choose. if you provide an ideal value, the browser will try to get as close as possible to matching that value, given the other constraints
specified. let supports = navigator.mediadevices.getsupportedconstraints(); if (!supports["width"] || !supports["height"] || !supports["framerate"] || !supports["facingmode"]) { // we're missing needed properties, so handle that error. } else { let constraints = { width: { min: 640, ideal: 1920, max: 1920 }, height: { min: 400, ideal: 1080 }, aspectratio: 1.777777778, framerate: { max...
...1920), a height no smaller than 400 (but ideally 1080), an aspect ratio of 16:9 (1.777777778), and a frame rate no greater than 30 frames per second. in addition, the only acceptable input device is a camera facing the user (a "selfie cam"). if the width, height, framerate, or facingmode constraints can't be met, the promise returned by applyconstraints() will be rejected. constraints which are
specified using any or all of max, min, or exact are always treated as mandatory. if any constraint which uses one or more of those can't be met when calling applyconstraints(), the promise will be rejected. advanced constraints so-called advanced constraints are created by adding an advanced property to the constraint set; this property's value is an array of additional constraint sets which are consid...
...And 2 more matches
RTCPeerConnection.addIceCandidate() - Web APIs
gent by calling rtcpeerconnection.addicecandidate(). this adds this new remote candidate to the rtcpeerconnection's remote description, which describes the state of the remote end of the connection. if the candidate parameter is missing or a value of null is given when calling addicecandidate(), the added ice candidate is an "end-of-candidates" indicator. the same is the case if the value of the
specified object's candidate is either missing or an empty string (""), it signals that all remote candidates have been delivered. the end-of-candidates notification is transmitted to the remote peer using a candidate with an a-line value of end-of-candidates. during negotiation, your app will likely receive many candidates which you'll deliver to the ice agent in this way, allowing it to build up a list...
...candidate, successcallback, failurecallback); parameters candidate optional an object conforming to the rtcicecandidateinit 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 simply like this: a=end-of-candidates deprecated parameters in older code and documentation, you may see a callback-based version of this function. this has been deprecated and its use is strongly discouraged. you should update any existing code to use the promise-bas...
...ailure occurred. return value a promise which is fulfilled when the candidate has been successfully added to the remote peer's description by the ice agent. the promise does not receive any input parameters. ...
...And 2 more matches
SVGAngle - Web APIs
is not associated with any element. every svgangle object operates in one of two modes: reflect the base value of a reflected animatable attribute (being exposed through the baseval member of an svganimatedangle), be detached, which is the case for svgangle objects created with svgsvgelement.createsvgangle(). constants svg_angletype_unknown some unknown type of value. svg_angletype_un
specified a unitless <number> interpreted as a value in degrees. svg_angletype_deg an <angle> with a deg unit. svg_angletype_rad an <angle> with a rad unit. svg_angletype_grad an <angle> with a grad unit. properties unittype the type of the value as
specified by one of the svg_angletype_* constants defined on this interface. value the value as a floating point value, in user units. setting...
...as a value in degrees. svg_angletype_deg an <angle> with a deg unit. svg_angletype_rad an <angle> with a rad unit. svg_angletype_grad an <angle> with a grad unit. properties unittype the type of the value as
specified by one of the svg_angletype_* constants defined on this interface. value the value as a floating point value, in user units. setting this attribute will cause valuein
specifiedunits and valueasstring to be updated automatically to reflect this setting. exceptions on setting: a domexception with code no_modification_allowed_err is raised when the length corresponds to a read-only attribute, or when the object itself is read-only. valuein
specifiedunits the value as a floating point value, in the units expressed by unittype. setting this attribute will cause value ...
...ause value and valueasstring to be updated automatically to reflect this setting. exceptions on setting: a domexception with code no_modification_allowed_err is raised when the length corresponds to a read-only attribute, or when the object itself is read-only. valueasstring the value as a domstring value, in the units expressed by unittype. ...
...And 2 more matches
Using writable streams - Web APIs
rs, all of which are optional: start(controller) — a method that is called once, immediately after the writablestream is constructed. inside this method, you should include code that sets up the stream functionality, e.g. getting access to the underlying sink. write(chunk,controller) — a method that is called repeatedly every time a new chunk is ready to be written to the underlying sink (
specified in the chunk parameter). close(controller) — a method that is called if the app signals that it has finished writing chunks to the stream. it should do whatever is necessary to finalize writes to the underlying sink, and release access to it. abort(reason) — a method that will be called if the app signals that it wishes to abruptly close the stream and put it in an errored state. the cons...
...unks encoded, we then call array/foreach on the resulting array. inside this block we use writablestreamdefaultwriter.ready to check whether the writer is ready to have another chunk written to it. ready returns a promise that fulfills when this is the case, inside of which we call writablestreamdefaultwriter.write() to actually write the chunk to the stream. ...
... controllers as you'll have noticed when studying the writablestream() syntax skeleton, the start(), write(), and close() methods can optionally have a controller parameter passed to them. ...
...And 2 more matches
ValidityState - Web APIs
the validitystate interface represents the validity states that an element can be in, with respect to constraint validation. together, they help explain why an element's value fails to validate, if it's not valid. properties for each of these boolean properties, a value of true indicates that the
specified reason validation may have failed is true, with the exception of the valid property, which is true if the element's value obeys all constraints. badinput read only a boolean that is true if the user has provided input that the browser is unable to convert. customerror read only a boolean indicating whether the element's custom validity message has been set to a non-empty string by calling the element's setcustomvalidity() method. patternmismatch read only a boolean that is true if t...
...s all constraints. badinput read only a boolean that is true if the user has provided input that the browser is unable to convert. customerror read only a boolean indicating whether the element's custom validity message has been set to a non-empty string by calling the element's setcustomvalidity() method. patternmismatch read only a boolean that is true if the value does not match the
specified pattern, and false if it does match. if true, the element matches the :invalid css pseudo-class. rangeoverflow read only a boolean that is true if the value is greater than the maximum
specified by the max attribute, or false if it is less than or equal to the maximum. if true, the element matches the :invalid and :out-of-range and css pseudo-classes. rangeunderflow read only a boolean that...
...if true, the element matches the :invalid and :out-of-range css pseudo-classes. ...
...And 2 more matches
WebGLRenderingContext.bufferData() - Web APIs
srcdata optional an arraybuffer, sharedarraybuffer or one of the arraybufferview typed array types that will be copied into the data store. if null, a data store is still created, but the content is uninitialized and undefined. usage a glenum specifying the intended usage pattern of the data store for optimization purposes. ...
...created, but the content is uninitialized and undefined. usage a glenum specifying the intended usage pattern of the data store for optimization purposes. possible values: gl.static_draw: the contents are intended to be
specified once by the application, and used many times as the source for webgl drawing and image specification commands. gl.dynamic_draw: the contents are intended to be re
specified repeatedly by the application, and used many times as the source for webgl drawing and image specification commands. gl.stream_draw: the contents are intended to be
specified once by the application, and used at most a few times as the source for webgl drawing and image specification commands. when using a webgl 2 context, the following values are available additionally: gl.static_read:...
...nd used many times as the source for webgl drawing and image specification commands. gl.stream_draw: the contents are intended to be
specified once by the application, and used at most a few times as the source for webgl drawing and image specification commands. when using a webgl 2 context, the following values are available additionally: gl.static_read: the contents are intended to be
specified once by reading data from webgl, and queried many times by the application. gl.dynamic_read: the contents are intended to be re
specified repeatedly by reading data from webgl, and queried many times by the application. ...
...And 2 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
d any arguments, and no return value is expected. code an optional syntax allows you to include a string instead of a function, which is compiled and executed every delay milliseconds. this syntax is not recommended for the same reasons that make using eval() a security risk. delayoptional the time, in milliseconds (thousandths of a second), the timer should delay in between executions of the
specified function or code. see delay restrictions below for details on the permitted range of delay values. arg1, ..., argn optional additional arguments which are passed through to the function
specified by func once the timer expires. note: passing additional arguments to setinterval() in the first syntax does not work in internet explorer 9 and earlier. if you want to enable this functionality on ...
...helpful to be aware that setinterval() and settimeout() share the same pool of ids, and that clearinterval() and cleartimeout() can technically be used interchangeably. for clarity, however, you should try to always match them to avoid confusion when maintaining your code. note: the delay argument is converted to a signed 32-bit integer. this effectively limits delay to 2147483647 ms, since it's
specified as a signed integer in the idl. examples example 1: basic syntax the following example demonstrates setinterval()'s basic syntax. var intervalid = window.setinterval(mycallback, 500, 'parameter 1', 'parameter 2'); function mycallback(a, b) { // your code here // parameters are purely optional. console.log(a); console.log(b); } example 2: alternating two colors the following example ca...
... <!doctype html> <html> <head> <meta charset="utf-8" /> <title>javascript typewriter - mdn example</title> <script> function typewriter (sselector, nrate) { function clean () { clearinterval(nintervid); btyping = false; bstart = true; ocurrent = null; asheets.length = nidx = 0; } function scroll (osheet, npos, beraseandstop) { if (!osheet.haso...
...And 2 more matches
XMLSerializer.serializeToString() - Web APIs
the root node must be either node or attr. invalidstateerror the tree could not be successfully serialized, probably due to issues with the content's compatibility with xml serialization. ...
...the root node must be either node or attr. invalidstateerror the tree could not be successfully serialized, probably due to issues with the content's compatibility with xml serialization. ...
...serializetostring() constructs a string representing the
specified dom tree in xml form. syntax xmlstring = anxmlserializer.serializetostring(rootnode); parameters rootnode the node to use as the root of the dom tree or subtree for which to construct an xml representation. return value a domstring containing the xml representation of the
specified dom tree. exceptions typeerror the
specified rootnode is not a compatible node type. the root node must be either node or attr. invalidstateerror the tree could not be successfully serialized, probably due to issues with the content's compatibility with xml serialization. ...
...And 2 more matches
XRRigidTransform.matrix - Web APIs
syntax let matrix = xrrigidtransform.matrix; value a float32array containing 16 entries which represents the 4x4 transform matrix which is described by the position and orientation properties. usage notes matrix format all 4x4 transform matrices used in webgl are stored in 16-element float32arrays. ...
...a[4] & a[8] & a[12]\\ a[1] & a[5] & a[9] & a[13]\\ a[2] & a[6] & a[10] & a[14]\\ a[3] & a[7] & a[11] & a[15]\\ \end{bmatrix} the first time matrix is requested, it gets computed; after that, it's should be cached to avoid slowing down to compute it every time you need it. creating the matrix in this section, intended for more advanced readers, we cover how the api calculates the matrix for the
specified transform. it begins by allocating a new matrix and writing a 4x4 identity matrix into it: [1000010000100001]\begin{bmatrix} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 1 \end{bmatrix} this is a transform that will not change either the orientation or position of any point, vector, or object to which it's applied. next, the position is placed into the right-hand column, like th...
...to it: [1000010000100001]\begin{bmatrix} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 1 \end{bmatrix} this is a transform that will not change either the orientation or position of any point, vector, or object to which it's applied. ...
...And 2 more matches
Shorthand properties - CSS: Cascading Style Sheets
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 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 val...
... border properties with borders, the width, color, and style can be simplified into one declaration. for example, the following css ... border-width: 1px; border-style: solid; border-color: #000; ... can be simplified as: border: 1px solid #000; margin and padding properties shorthand versions of margin and padding values work similarly; the margin property allows for shorthand values to be
specified using one, two, three, or four values. the following css declarations ... margin-top: 10px; margin-right: 5px; margin-bottom: 10px; margin-left: 5px; ... are the same as the following declaration using the four value shorthand. note that the values are in clockwise order, beginning at the top: top, right, bottom, then left (trbl, the consonants in "trouble"). margin: 10px 5px 10px 5px; margin...
...x; margin-right: 5px; margin-bottom: 10px; margin-left: 5px; ... are the same as the following declaration using the four value shorthand. note that the values are in clockwise order, beginning at the top: top, right, bottom, then left (trbl, the consonants in "trouble"). ...
...And 2 more matches
animation-timing-function - CSS: Cascading Style Sheets
none); animation-timing-function: steps(5, jump-both); animation-timing-function: steps(6, start); animation-timing-function: steps(8, end); /* multiple animations */ animation-timing-function: ease, step-start, cubic-bezier(0.1, 0.7, 1.0, 0.1); /* global values */ animation-timing-function: inherit; animation-timing-function: initial; animation-timing-function: unset; timing functions may be
specified on individual keyframes in a @keyframes rule. 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 keyframe on which it is
specified until the next keyframe specifying that proper...
... values <timing-function> the timing function that corresponds to a given animation, as determined by animation-name. ...
...never be used. values <timing-function> the timing function that corresponds to a given animation, as determined by animation-name. 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-predefined value. the step timing functions divides the input time into a
specified number of intervals that are equal in length. it is defined by a number of steps and a step position. ease equal to cubic-bezier(0.25, 0.1, 0.25, 1.0), the default value, increases in velocity towards the middle of the animation, slowing back down at the end. linear equal to cubic-bezier(0.0, 0.0, 1.0, 1.0), animates at an even speed. ease-in equal to cubic-bezier(0.42, 0, 1.0, 1.0), star...
...And 2 more matches
background-image - CSS: Cascading Style Sheets
round-image css property sets one or more background images on 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. the background images are drawn on stacking context layers on top of each other. ...
... note: even if the images are opaque and the color won't be displayed in normal circumstances, web developers should always specify a background-color. ...
...ach other. the first layer
specified is drawn as if it is closest to the user. the borders of the element are then drawn on top of them, and the background-color is drawn beneath them. how the images are drawn relative to the box and its borders is defined by the background-clip and background-origin css properties. if a
specified image cannot be drawn (for example, when the file denoted by the
specified uri cannot be loaded), browsers handle it as they would a none value. note: even if the images are opaque and the color won't be displayed in normal circumstances, web developers should always specify a background-color. if the images cannot be loaded—for instance, when the network is down—the background color will be used as a fallback. ...
...And 2 more matches
grid-column - CSS: Cascading Style Sheets
e of its grid area. 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. ...
...roperty is a shorthand for the following css properties: grid-column-end grid-column-start syntax this property is
specified as one or two <grid-line> values. if two <grid-line> values are given they are separated by "/". the grid-column-start longhand is set to the value before the slash, and the grid-column-end longhand is set to the value after the slash. each <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 property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default spa...
...1. <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 implicit named lines of this form, so specifying grid-column: foo; will choose the start/end edge of that named grid area (unless another line named foo-start/foo-end was explicitly
specified before it). otherwise, this is treated as if the integer 1 had been
specified along with the <custom-ident>. <integer> && <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if...
...And 2 more matches
grid-template - CSS: Cascading Style Sheets
te: unset; values none is a keyword that sets all three longhand properties to none, meaning there is no explicit grid. 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-columns to the
specified values, and sets grid-template-areas to none. [ <line-names>? <string> <track-size>? <line-names>? ]+ [ / <explicit-track-list> ]? sets grid-template-areas to the strings listed, grid-template-rows to the track sizes following each string (filling in auto for any missing sizes), and splicing in the named lines defined before/after each size, and grid-template-columns to the track listing specif...
... to none. [ <line-names>? <string> <track-size>? <line-names>? ]+ [ / <explicit-track-list> ]? sets grid-template-areas to the strings listed, grid-template-rows to the track sizes following each string (filling in auto for any missing sizes), and splicing in the named lines defined before/after 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”. 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. fo...
...<string> <track-size>? <line-names>? ]+ [ / <explicit-track-list> ]?where <line-names> = '[' <cust...
...And 2 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 float area is computed according to the shape of a float element's edges (as defined by the css...
...shape> the float area is computed based on the shape created by of one of inset(), circle(), ellipse(), polygon(), or as added in the level 2 specification path(). if a <shape-box> is also supplied, it defines the reference box for the <basic-shape> function. otherwise, the reference box defaults to margin-box. <image> the float area is extracted and computed based on the alpha channel of the
specified <image> as defined by shape-image-threshold. note: user agents must use the potentially cors-enabled fetch method defined by the html5 specification for all urls in a shape-outside value. when fetching, user agents must use "anonymous" mode, set the referrer source to the stylesheet's url, and set the origin to the url of the containing document. if this results in network errors such that the...
... the potentially cors-enabled fetch method defined by the html5 specification for all urls in a shape-outside value. when fetching, user agents must use "anonymous" mode, set the referrer source to the stylesheet's url, and set the origin to the url of the containing document. if this results in network errors such that there is no valid fallback image, the effect is as if the value none had been
specified. interpolation when animating between one <basic-shape> and a second, the rules below are applied. the values in the shape functions interpolate as a simple list. the list values interpolate as <length>, <percentage>, or calc() where possible. if list values are not one of those types but are identical (such as finding nonzero in the same list position in both lists), those values do interpo...
...And 2 more matches
text-decoration - CSS: Cascading Style Sheets
e; the entire paragraph would still be underlined. however, the rule em { text-decoration: overline; } would cause a second decoration to appear on "some emphasized words". constituent properties this property is a shorthand for the following css properties: text-decoration-color text-decoration-line text-decoration-style text-decoration-thickness syntax the text-decoration property is
specified as one or more space-separated values representing the various longhand 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 set...
...hickness sets the thickness of the line used for the decoration. formal definition initial valueas each of the properties of the shorthand:text-decoration-color: currentcolortext-decoration-style: solidtext-decoration-line: noneapplies toall elements. ...
... line used for the decoration. formal definition initial valueas each of the properties of the shorthand:text-decoration-color: currentcolortext-decoration-style: solidtext-decoration-line: noneapplies toall elements. ...
...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 keyword none the keyword all a <custom-ident> naming a c...
...ptions beyond the number of properties actually being animated are ignored. ...
...rties actually being animated are ignored. ...
...And 2 more matches
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
lude other attributes to specify information such as whether we want it to autoplay and loop, whether we want to show the browser's default audio controls, etc. the content inside the opening and closing <audio></audio> tags is shown as a fallback in browsers that don't support the element. attributes this element's attributes include the global attributes. autoplay a boolean attribute: if
specified, the audio will automatically begin playback as soon as it can do so, without waiting for the entire audio file to finish downloading. note: sites that automatically play audio (or videos with an audio track) can be an unpleasant experience for users, so should be avoided when possible. if you must offer autoplay functionality, you should make it opt-in (requiring a user to specifically enable i...
...sion 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 +infinity. 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 experience. it may have one of the following valu...
...ta: indicates that only audio metadata (e.g. length) is fetched. auto: indicates that the whole audio file can be downloaded, even if the user is not expected to use it. empty string: a synonym of the auto value. the default value is different for each browser. the spec advises it to be set to metadata. usage notes: the autoplay attribute has precedence over preload. if autoplay is
specified, the browser would obviously need to start downloading the audio for playback. the browser is not forced by the specification to follow the value of this attribute; it is a mere hint. src the url of the audio to embed. this is subject to http access controls. this is optional; you may instead use the <source> element within the audio block to specify the audio to embed. events ...
...And 2 more matches
<input type="month"> - HTML: Hypertext Markup Language
rent value. max the latest year and month, in the string format discussed in the value section above, to accept. if the value entered into the element exceeds this, the element fails constraint validation. if the value of the max attribute isn't a valid string in "yyyy-mm" format, then the element has no maximum value. ...
... the max attribute isn't a valid string in "yyyy-mm" format, then the element has no maximum value. this value must specify a year-month pairing later than or equal to the one
specified by the min attribute. min the latest year and month to accept, in the same "yyyy-mm" format described above. if the value of the element is less than this, the element fails constraint validation. if a value is
specified for min that isn't a valid year and month string, the input has no minimum value. this value must be a year-month pairing which is earlier than or equal to the one
specified by the max attribute. readonly a boolean attribute which, if present, means this field cannot be edited by the user. its value can, however, still be changed from javascript code that directly sets the value of the htmlinp...
...the one
specified by the max attribute. readonly a boolean attribute which, if present, means this field cannot be edited by the user. its value can, however, still be changed from javascript code that directly sets the value of the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effect on inputs with the readonly attribute also
specified. step the step attribute is a number that specifies the granularity that the value must adhere to, or the special value any, which is described below. only values which are equal to the basis for stepping (min if
specified, value otherwise, and an appropriate default value if neither of those is provided) are valid. a string value of any means that no stepping is implied, and any value is all...
...And 2 more matches
<meter>: The HTML Meter element - HTML: Hypertext Markup Language
parents any element that accepts phrasing content. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlmeterelement attributes this element includes the global attributes. value the current numeric value. this must be between the minimum and maximum values (min attribute and max attribute) if they are
specified. if un
specified or malformed, the value is 0. if
specified, but not within the range given by the min attribute and max attribute, the value is equal to the nearest end of the range. note: unless the value attribute is between 0 and 1 (inclusive), the min and max attributes should define the range so that the value attribute's value is within it. min the lower numeric bound of the measured r...
...t within the range given by the min attribute and max attribute, the value is equal to the nearest end of the range. note: unless the value attribute is between 0 and 1 (inclusive), the min and max attributes should define the range so that the value attribute's value is within it. min the lower numeric bound of the measured range. this must be less than the maximum value (max attribute), if
specified. if un
specified, the minimum value is 0. max the upper numeric bound of the measured range. this must be greater than the minimum value (min attribute), if
specified. if un
specified, the maximum value is 1. low the upper numeric bound of the low end of the measured range. this must be greater than the minimum value (min attribute), and it also must be less than the high value and maximum valu...
...ic bound of the measured range. this must be greater than the minimum value (min attribute), if
specified. if un
specified, the maximum value is 1. low the upper numeric bound of the low end of the measured range. this must be greater than the minimum value (min attribute), and it also must be less than the high value and maximum value (high attribute and max attribute, respectively), if any are
specified. if un
specified, or if less than the minimum value, the low value is equal to the minimum value. high the lower numeric bound of the high end of the measured range. ...
...And 2 more matches
<textarea> - HTML: Hypertext Markup Language
y completed by the browser. possible values are: off: the user must explicitly enter a value into this field for every use, or the document provides its own auto-completion method; the browser does not automatically complete the entry. on: the browser can automatically complete the value based on values that the user has entered during previous uses. if the autocomplete attribute is not
specified on a <textarea> element, then the browser uses the autocomplete attribute value of the <textarea> element's form owner. the form owner is either the <form> element that this <textarea> element is a descendant of or the form element whose id is
specified by the form attribute of the input element. for more information, see the autocomplete attribute in <form>. autofocus this boolean attribute ...
...rm> element that this <textarea> element is a descendant of or the form element whose id is
specified by the form attribute of the input element. for more information, see the autocomplete attribute in <form>. autofocus this boolean attribute lets you specify that a form control should have input focus when the page loads. only one form-associated element in a document can have this attribute
specified. cols the visible width of the text control, in average character widths. if it is
specified, it must be a positive integer. if it is not
specified, the default value is 20. disabled this boolean attribute indicates that the user cannot interact with the control. ...
...cus when the page loads. only one form-associated element in a document can have this attribute
specified. cols the visible width of the text control, in average character widths. if it is
specified, it must be a positive integer. if it is not
specified, the default value is 20. disabled this boolean attribute indicates that the user cannot interact with the control. if this attribute is not
specified, the control inherits its setting from the containing element, for example <fieldset>; if there is no containing element when the disabled attribute is set, the control is enabled. form the form element that the <textarea> element is associated with (its "form owner"). ...
...And 2 more matches
Loops and iteration - JavaScript
ways to determine the start and end points of the loop. there are various situations that are more easily served by one type of loop over the others. 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, bu...
... a do...while statement looks as follows: do statement while (condition); statement is always executed once before the condition is checked. (to execute multiple statements, use a block statement ({ ... }) to group those statements.) if condition is true, the statement executes again. at the end of every execution, the condition is checked. when the condition i...
...ery execution, the condition is checked. when the condition is false, execution stops, and control passes to the statement following do...while. example in the following example, the do loop iterates at least once and reiterates until i is no longer less than 5. let i = 0; do { i += 1; console.log(i); } while (i < 5); while statement a while statement executes its statements as long as a
specified condition evaluates to true. a while statement looks as follows: while (condition) statement if the condition becomes false, statement within the loop stops executing and control passes to the statement following the loop. the condition test occurs before statement in the loop is executed. if the condition returns true, statement is executed and the condition is tested again. if the conditi...
...And 2 more matches
Atomics - JavaScript
tions are finished before the next operation starts and that operations are not interrupted. wait and notify the wait() and notify() methods are modeled on linux futexes ("fast user-space mutex") and provide ways for waiting until a certain condition becomes true and are typically used as blocking constructs. ...
...notify() methods are modeled on linux futexes ("fast user-space mutex") and provide ways for waiting until a certain condition becomes true and are typically used as blocking constructs. static methods atomics.add() adds the provided value to the existing value at the
specified index of the array. returns the old value at that index. atomics.and() computes a bitwise and on the value at the
specified index of the array with the provided value. returns the old value at that index. atomics.compareexchange() stores a value at the
specified index of the array, if it equals a value. returns the old value. atomics.exchange() stores a value at the
specified index of the array. returns the old value. atomics.islockfree(size) an optimization primitive that can be used to determine whether to use...
...a value at the
specified index of the array. returns the old value. atomics.islockfree(size) an optimization primitive that can be used to determine whether to use locks or atomic operations. returns true if an atomic operation on arrays of the given element size will be implemented using a hardware atomic operation (as opposed to a lock). experts only. atomics.load() returns the value at the
specified index of the array. atomics.notify() notifies agents that are waiting on the
specified index of the array. returns the number of agents that were notified. atomics.or() computes a bitwise or on the value at the
specified index of the array with the provided value. returns the old value at that index. atomics.store() stores a value at the
specified index of the array. returns the value. ato...
...And 2 more matches
Object - JavaScript
bject 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 one or more source objects to a target object. object.create() creates a new object with the
specified prototype object and properties. object.defineproperty() adds the named property described by a given descriptor to an object. object.defineproperties() adds the named properties described by the given descriptors to an object. object.entries() returns an array containing all of the [key, value] pairs of a given object's own enumerable string properties. object.freeze() freezes an object.
... containing all own property descriptors for an object. object.getownpropertynames() returns an array containing the names of all of the given object's own enumerable and non-enumerable properties. object.getownpropertysymbols() returns an array of all symbol properties found directly upon a given object. object.getprototypeof() returns the prototype (internal [[prototype]] property) of the
specified object. object.is() compares if two values are the same value. equates all nan values (which differs from both abstract equality comparison and strict equality comparison). object.isextensible() determines if extending of an object is allowed. object.isfrozen() determines if an object was frozen. object.issealed() determines if an object is sealed. object.keys() returns an array contain...
...thod. instance methods object.prototype.__definegetter__() associates a function with a property that, when accessed, executes that function and returns its return value. object.prototype.__definesetter__() associates a function with a property that, when set, executes that function which modifies the property. object.prototype.__lookupgetter__() returns the function associated with the
specified property by the __definegetter__() method. object.prototype.__lookupsetter__() returns the function associated with the
specified property by the __definesetter__() method. object.prototype.hasownproperty() returns a boolean indicating whether an object contains the
specified property as a direct property of that object and not inherited through the prototype chain. object.prototype.isprotot...
...And 2 more matches
parseInt() - 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 parseint(string [, radix]) parameters string the value to parse. if this argument is not a string, then it is converted to one using the tostring abstract operation. leading whitespace in this argument is ignored. radix optional an integer between 2 and 36 that represents the radix (the base in mathematical numeral systems) of the string. ...
...er parsed from the given string. or nan when the radix is smaller than 2 or bigger than 36, or the first non-whitespace character cannot be converted to a number. description the parseint function converts its first argument to a string, parses that string, then returns an integer or nan. ...
...parseint truncates numbers to integer values. leading and trailing spaces are allowed. because some numbers use the e character in their string representation (e.g. ...
...And 2 more matches
Web video codec guide - Web media technologies
cifically for internet video. it achieves higher data compression rates than vp9 and h.265/hevc, and as much as 50% higher rates than avc. av1 is fully royalty-free and is designed for use by both the <video> element and by webrtc. av1 currently offers three profiles: main, high, and professional with increasing support for color depths and chroma subsampling. in addition, a series of levels are
specified, each defining limits on a range of attributes of the video. these attributes include frame dimensions, image area in pixels, display and decode rates, average and maximum bit rates, and limits on the number of tiles and tile columns used in the encoding/decoding process. for example, level av1 level 2.0 offers a maximum frame width of 2048 pixels and a maximum height of 1152 pixels, but its max...
...ion alliance for open media specification https://aomediacodec.github.io/av1-spec/av1-spec.pdf licensing royalty-free, open standard [1] iso base media file format [2] see the av1 specification's tables of levels, which describe the maximum resolutions and rates at each level. avc (h.264) the mpeg-4 specification suite's advanced video coding (avc) standard is
specified by the identical itu h.264 specification and the mpeg-4 part 10 specification. it's a motion compensation based codec that is 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 designe...
... that it is not supported by safari, leaving theora unavailable not only on macos but on all those millions and millions of iphones and ipads. the theora cookbook offers additional details about theora as well as the ogg container format it is used within. supported bit rates up to 2 gbps supported frame rates arbitrary; any non-zero value is supported. the frame rate is
specified as a 32-bit numerator and a 32-bit denominator, to allow for non-integer frame rates. compression lossy dct-based algorithm supported frame sizes any combination of width and height up to 1,048,560 x 1,048,560 pixels supported color modes y'cbcr with 4:2:0, 4:2:2, and 4:4:4 chroma subsampling at 8 bits per component hdr support no variable ...
...And 2 more matches
The "codecs" parameter in common media types - Web media technologies
(note the asterisk character, *) if any of the properties of the codec use special characters which must be percent-encoded per rfc 2231, section 4: mime parameter value and encoded word extensions. you can use the javascript encodeuri() function to encode the parameter list; similarly, you can use decodeuri() to decode a previously encoded parameter list. when the codecs parameter is used, the
specified list of codecs must include every codec used for the contents of the file. the list may also contain codecs not present in the file.= codec options by container the containers below support extended codec options in their codecs parameters: 3gp av1 iso bmff mpeg-4 quicktime webm several of the links above go to the same section; that's because those media types are all based on iso...
... used to convert the red, blue, and green channels into luma and chroma signals. for example, the standard coefficients used for bt.709 are indicated using the value 01. the default value is 01 (itu-r bt.709). f a one-digit flag indicating whether the color should be allowed to use the full range of possible values (1), or should be constrained to those values considered legal for the
specified color configuration (that is, the studio swing representation). the default is 0 (use the studio swing representation). all fields from m (monochrome flag) onward are optional; you may stop including fields at any point (but can't arbitrarily leave out fields). the default values are included in the table above. some example av1 codec strings: av01.2.15m.10.0.100.09.16.09.0 av1 profess...
...each entry in the codec list may contain some number of components, separated by periods (.). the syntax for the value of codecs varies by codec; however, it always starts with the codec's four-character identifier, a period separator (...
...And 2 more matches
gradientUnits - SVG: Scalable Vector Graphics
two elements are using this attribute: <lineargradient> and <radialgradient> lineargradient for <lineargradient>, gradientunits defines the coordinate system used for the attributes x1, y1, x2, and y2. ...
... percentages represent values relative to the b...
... percentages represent values relative to the bounding box for the object. ...
...And 2 more matches
ui/button/action - Archive of obsolete content
ton appears in the firefox toolbar: however, users can move it to the firefox menu panel using the toolbar customization feature: badged buttons new in firefox 36. you can add a "badge" to a button using its badge property. this can be a number or a string, and you can update it at any time. ...
...ick handler for the button. badge number or string new in firefox 36. badge to attach to the button. the badge can contain as many characters (or digits) as you like, but only the first four will be displayed. badgecolor css <color> value new in firefox 36. color for the badge. if badgecolor is omitted and badge is
specified, then the badge is red. actionbutton methods click() click the button. this will cause the button to generate the click event: var { actionbutton } = require('sdk/ui/button/action'); var button = actionbutton({ id: "my-button", label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onclick: function(state) { console.log("you click...
...ining all the properties you wish to set. for example: button.state("tab", { "label" : "tab-specific label", "icon": "./tab-specific-icon.ico" }); to reset state, pass null: button.state("tab", null); returns state : if you have passed the second state argument to make this function a setter, it returns undefined. otherwise, it functions as a getter and returns the button's state for the
specified object. this logs the state for the button associated with the currently active tab: console.log(button.state("tab")); this object represents a snapshot of the state at the time state() is called. it is not kept up to date with changes made to the button: button.label = "foo"; var state = button.state(button); button.label = "bar"; console.log(state.label) // foo on() add a listener to an ev...
...e path, or object containing a set of key-value pairs. disabled boolean property indicating whether or not the button is disabled. 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 will be displayed. badgecolor new in firefox 36. color for the badge,
specified as a css <color> value. events click this event is emitted when a user clicks the button or your add-on calls the button's click() method. arguments state : the button's state. this contains all the button's properties. ...
ui/button/toggle - Archive of obsolete content
); } }); by default, the button appears in the firefox toolbar: however, users can move it to the firefox menu panel: badged buttons new in firefox 36. you can add a "badge" to a button using its badge property. this can contain a number or a string, and you can update it at any time. ...
...ick handler for the button. badge number or string new in firefox 36. badge to attach to the button. the badge can contain as many characters (or digits) as you like, but only the first four will be displayed. badgecolor css <color> value new in firefox 36. color for the badge. if badgecolor is omitted and badge is
specified, then the badge is red. togglebutton methods click() click the button. this will cause the button to generate the click event: var { togglebutton } = require('sdk/ui/button/toggle'); var button = togglebutton({ id: "my-button", label: "my button", icon: { "16": "./firefox-16.png", "32": "./firefox-32.png" }, onclick: function(state) { console.log("you click...
...ining all the properties you wish to set. for example: button.state("tab", { "label" : "tab-specific label", "icon": "./tab-specific-icon.ico" }); to reset state, pass null: button.state("tab", null); returns state : if you have passed the second state argument to make this function a setter, it returns undefined. otherwise, it functions as a getter and returns the button's state for the
specified object. this logs the state for the button associated with the currently active tab: console.log(button.state("tab")); this object represents a snapshot of the state at the time state() is called. it is not kept up to date with changes made to the button: button.label = "foo"; var state = button.state(button); button.label = "bar"; console.log(state.label) // foo on() add a listener to an ev...
...uctor. 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 will be displayed. badgecolor new in firefox 36. color for the badge,
specified as a css <color> value. events click this event is emitted when a user clicks the button or your add-on calls the button's click() method. arguments state : the button's state. this includes all the button's properties. change this event is emitted when a user clicks the button or your add-on calls the button's click() method. this event is emitted at the same time as click and its listene...
package.json - Archive of obsolete content
bedded webextension. homepage the url of the add-on's website. this value will be used as the add-on's em:homepageurl element in its install.rdf. icon the path to an image file containing the icon for the add-on. optional: you can have no icon field in package.json and put your icon named "icon.png" in the root directory of your add-on. if no icon is
specified, the standard add-on icon will be used by default. when using jpm, using a relative path to the data directory (to make it re-usable for add-on html content) does not work. you can generate the url to your add-on icon in the data directory using the url format below, where "your-addon-name" is the value in the name field of package.json. resource://@your-addon-name/data/your-i...
...is can also be an object with the image size as key and the (absolute) location of the image as value. jpm looks for the sizes 64, 48 and 32. icon64 note: this is deprecated along with cfx; it's not available when using jpm. the path to an image containing the large icon for the add-on. defaults to icon64.png. if you don't provide an icon here, the same icon as
specified by icon will be used. this value will be used as the add-on's em:icon64url element in its install.rdf. the icon may be up to 64x64 pixels in size. id a globally unique identifier for the add-on. this value will be used as the add-on's em:id element in its install.rdf. see the program id documentation. lib string representing the top-le...
...ced by a locale name that use the following keys: title, description and homepage. these json objects will be used to localizations for the add-on's meta data shown within the add-ons manager. see the documentation for how to localize the add-on's meta data. main a string representing the name of a program module that is located in one of the top-level module directories
specified by lib. defaults to "index.js". name the add-on's name. this name cannot contain spaces or periods, and defaults to the name of the parent directory. when the add-on is built as an xpi, if the fullname and title keys are not present, name is used as the add-on's em:name element in its install.rdf. packages note: this is deprecated along with cfx...
...dd-on is, or is not, compatible with multiprocess firefox. note the multiprocess permission is not supported by cfx. preferences an array of json objects that use the following keys: name,type, value, title, and description. these json objects will be used to create a preferences interface for the add-on in the add-ons manager unless the preferencesurl field is
specified. see the documentation for the simple-prefs module. preferencesurl the url where the "preferences" button of your add-on in the add-ons manager will point to. use this to specify a custom preferences page instead of the built-in ui provided by the add-on manager. preferences-branch use this to specify an alternative branch for your add-on's simple-prefs. see "simp...
Enhanced Extension Installation - Archive of obsolete content
the system also writes a .autoreg file to the profile folder which tells the startup system that something has changed on the next restart. a copy of the xpi file the item was installed from is set aside since the xpinstall system cleans up the temporary file it hands to the extension system. if the item is not compatible, the extension system asks the appropriate update service (either the one
specified by the item, or the default one) if there is remote compatibility information that supercedes the compatibility information held by the item. if there is, and this remote information makes it so that the item is now compatible with the running version of the application, the item is configured in the manner described above (metadata written, added to container). finalization for themes, the ite...
...l metadata into the appropriate datasource. at this time a new extensions.ini file is written locating the extension so that the component manager, preferences system and chrome registry can locate additional files on the next start. the finalization process then notifies the startup process that finalization has changed this manifest, and that the application must be restarted to pick up changes
specified therein. the startup process receives this "needsrestart" bit when the extension manager's startup completes, shuts down xpcom and relaunches the application. on the next restart, the xredirprovider now supplies a list of directories to requesting systems listing the new item's components, defaults and chrome manifests. uninstallation, disabling, enabling these functions work on the same princ...
...ninstall case) and write a new extensions.ini file listing the directories for the currently "active" items. ("active" items are items that are enabled.) a whole new world install locations we have several targets for where items can be installed. these include: the application profile directory <profile>/extensions/ the application install directory <application>/extensions/ any location
specified in a text file with a {guid} name placed in one of the above locations, useful for developing extensions at another location, e.g. a nfs home directory and simply placing a text "link" file in the applicable directory above that links to the location of the extension in its installed state at the other location. any location
specified in a guid-to-path registry key mapping, e.g. [hklm|hkcu]\soft...
...ble. by default, the application knows about and maintains three install locations: app-profile a directory-based install location for items living in the application profile extensions directory. app-global a directory-based install location for items living in the application global extensions directory. app-registry a registry-key based install location for items living at locations
specified by a guid-to-path value set within the registry at a predefined location. to implement this, we create an interface that the extension manager can ask for information about the location, such as what its name is, where its located on disk (if anywhere, in the case of registry based locations which have no root directory), for a list of item directories, for a directory of a particular item, for...
Extension Versioning, Update and Compatibility - Archive of obsolete content
ring the automatic update checks, applications look for both new versions and updated compatibility information about the currently installed version of an add-on. this means that if your update manifest contains an entry for the currently installed version of the add-on, and the entry's targetapplication entry specifies a larger maxversion then the application will use this value instead of that
specified in the add-on's install.rdf. this can cause add-ons that are disabled for being incompatible to become enabled and add-ons that would normally not install to be installed. update rdf format if you host your add-on's updateurl yourself then you will need to return the add-on version information in an rdf format. below is an example update manifest. it lists information about 2 different versions...
...cases where adding the mime type to the server didnt help either. so the solution i did, and which worked, was just to give the file a "xml" extension instead of "xhtml". securing updates gecko 1.9 has added additional requirements designed to protect users from man-in-the-middle attacks and the like during add-on updates. in the install.rdf of the already installed add-on updateurl must be
specified in one of the following ways: the updateurl uses https, or there is no updateurl at all (which defaults to addons.mozilla.org which is https) the updateurl uses http and the updatekey entry is
specified which will be used to verify the data in the update manifest. when you specify an updatekey in the install.rdf, you must include a digital signature in the update manifest or the information...
...ich defaults to addons.mozilla.org which is https) the updateurl uses http and the updatekey entry is
specified which will be used to verify the data in the update manifest. when you specify an updatekey in the install.rdf, you must include a digital signature in the update manifest or the information will be rejected. in the update manifest delivered from the updateurl the updatelink must be
specified in one of the following ways: the updatelink to the xpi file must use https the updatelink can use http and you must include an updatehash for the xpi file using sha1, sha256, sha384 or sha512 hash algorithms. any entries in the update manifest that do not meet one of those two requirements will be ignored when checking for new versions. note that https links to sites with invalid certific...
...g and separated from the hash by a :. <em:updatehash>sha256:78fc1d2887eda35b4ad2e3a0b60120ca271ce6e64ad2e3a0b60120ca271ce6e6</em:updatehash> note: the value of updatehash, must start with the string of hashing algorithm, it is a common error to delete this prefix, when setting new value to updatehash:sha256:78fc1d2887eda35b4ad2e3a0b60120ca271ce6e64ad2e3a0b60120ca271ce6e6 when a hash is
specified the downloaded file is compared with the hash and an error shown if it does not match. there are quite a few tools you may use to generate hashes: various unix flavors include sha1sum, sha256sum and so on. windows users should consider hashtab for interactive (non-build-script) use. there are also gnu ports for win (besides usual suspects like cygwin), which are good for non-interactive use: s...
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
to get a summary of all browser windows in firefox and then close them. listing 5: closing all browser windows var browsers = windowmediator.getenumerator('navigator:browser'); var browser; while (browsers.hasmoreelements()) { browser = browsers.getnext().queryinterface(components.interfaces.nsidomwindowinternal); browser.browsertrytoclosewindow(); } this method returns an overview of the
specified window type in the form of an iterator pattern object called nsisimpleenumerator. after getting an element with the nsisimpleenumerator.getnext() method, use the queryinterface method to get the interface, which allows you to handle each element as a window object. like the getmostrecentwindow() method, passing null as the parameter for the getenumerator() method enables you to get all windows i...
...ns 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 require no special handling. listing 6: creating an xpcom object representing a file var file = components.classes['@mozilla.org/file/local;1'] .createinstance(components.i...
...ocalfile.issymlink() determines whether or not the reference is to a symlink. traversing directories moving into a directory use the nsilocalfile.append() method to drill down into a directory (or file). see listing 8. listing 8: traversing directories file.initwithpath('c:\\'); file.append('documents and settings'); file.append('all users'); file.append('documents'); list files in
specified directory use the directoryentries property to perform operations on all the files or folders in a given folder. this property returns a nsisimpleenumerator-type object similar to the window overview, so you can get each element using similar techniques. listing 9 shows how to list the contents of a folder. listing 9: listing the contents of a specific directory file.initwithpath('c:\\'); var ...
...ean getboolpref(prefname) setboolpref(prefname) integer getintpref(prefname) setintpref(prefname) text string getcharpref(prefname) setcharpref(prefname) using methods from xul elements xpcom gives you access to sophisticated functions in xul elements. for example, using the loaduri() method on the browser element introduced in chapter 3 can open a page
specified using http_referer, as shown in listing 21; listing 22 shows how to open a page using the loaduriwithflags() method, with data transmitted via the post method. listing 21: loading a page by setting a referrer var browser = document.getelementbyid('browser'); var ioservice = components.classes['@mozilla.org/network/io-service;1'] .getservice(components.interfaces.nsiioservice); v...
Appendix D: Loading Scripts - Archive of obsolete content
work to a dynamically added onload hander. (a standalone xul window can use an onload attribute.) example the following overlay will load the script “overlay.js” from the same directory as the overlay file into the window which it overlays. the script will be read with the utf-8 encoding, based on the encoding of the overlay, and will execute as javascript version 1.8, based on the version
specified in the script tag. <?xml version="1.0" encoding="utf-8"?> <!doctype overlay> <overlay id="script-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript;version=1.8" src="overlay.js"/> </overlay> evalinsandbox the components.utils.evalinsandbox method may be used to load arbitrary code into components.utils.sandbox o...
...a defined namespace, global namespace contamination and the resultant extension compatibility issues are not usually a problem. flexibility: the evalinsandbox method accepts several parameters, including the url, line number, and javascript version of the file from which the code being evaluated was extracted. this information 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 w...
...er 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 sandboxes are wrapped in xraywrapper objects, which means that only native properties of these objects are directly exposed to privileged code. this behavior can be reversed by se...
...cting script tags into their documents. advantages namespacing: global namespace contamination and the resultant extension compatibility issues can often be avoided by loading sub-scripts into private namespaces. flexibility: the sub-script loader can load scripts into a variety of different namespaces for a wide variety of uses, and as of gecko 2 allows the character set of the script to be
specified. performance: as of gecko 8.0, scripts loaded via mozijssubscriptloader.loadsubscript() are loaded from a cache. unlike modules, however, scripts are still executed each time they are loaded and therefore still suffer performance and memory disadvantages over that method. when loading into a sandbox object, the same advantages apply as above. disadvantages performance: prior to gecko 8.0, ...
Supporting search suggestions in search plugins - Archive of obsolete content
once the list has been retrieved, it's displayed in a popup box that appears under the search bar, which lets the user select a suggested search term. if the user continues to type, a new set of suggestions is requested from the search engine, and the displayed list is refreshed. implementing suggestion support in the search plugin to support search suggestions, a search plugin needs to define an extra <url> element with its type attribute set to "application/x-suggestions+json". ...
... majority of the work in handling search suggestions is actually implemented on the server side. if you're a web site designer, and want to support search suggestions, you need to implement support for returning the suggestions in javascript object notation (json) given a search term. when the browser wants to fetch possible matches for a search term, it then sends an http get request to the url
specified by the <url> element. your server should then decide upon the suggestions to offer using whatever means it sees fit, and return a json array of results: query string the first element in the array is the original query string. this allows firefox to verify that the suggestions match the current search term. completion list an array of suggested search terms. the array should be enclosed...
..."term 1", "term 2", "term 3", "term 4"] descriptions this optional element is an array of descriptions for each of the suggestions in thecompletion list . these can be any additional information the search engine might want to return to be displayed by the browser, such as the number of results available for that search. descriptions are not supported in firefox, and are ignored if any are
specified. query urls this optional element is an array of alternate urls for each of the suggestions in thecompletion list . for example, if you want to offer a map link instead of just a search result page for a given suggestion, you can return an url to a map in this array. if you don't specify a query url, the default query is used based on the search described by the <url> element in the searc...
...st a search result page for a given suggestion, you can return an url to a map in this array. if you don't specify a query url, the default query is used based on the search described by the <url> element in the search plugin's xml description. query urls are not supported in firefox, and are ignored. this enhancement request - the handling of a selected suggestion, namely calling of a full
specified url as proposed in the opensearch standard - is tracked in bug 386591. for example, if the search term is "fir", and you don't need to return descriptions or alternate query urls, you might return the following json: ["fir", ["firefox", "first choice", "mozilla firefox"]] note that in this example, only the query string and completion array are
specified, leaving out the optional elements. y...
DOM Interfaces - Archive of obsolete content
parameters elt - the element to retrieve anonymous children for. return value nodelist - the return value of getanonymousnodes is a nodelist that represents the children of an element after insertion points from its own binding have been applied. this means that, depending on the details regarding the insertion points of the binding, it's possible that some non-anon...
...rom its own binding have been applied. this means that, depending on the details regarding the insertion points of the binding, it's possible that some non-anonymous nodes appear in the list. see "not so anonymous nodes" on mozilla.dev.platform for some discussion about this. getanonymouselementbyattribute the getanonymouselementbyattribute methods retrieves an anonymous descendant with a
specified attribute value. typically used with an (arbitrary) anonid attribute to retrieve a specific anonymous child in an xbl binding. parameters elt - the element to retrieve anonymous children for. attrname - the attribute name to look up. attrvalue - the attribute value to match. return value element - the return value of getanonymouselementbyattribute is an anonymous desce...
...te name to look up. attrvalue - the attribute value to match. return value element - the return value of getanonymouselementbyattribute is an anonymous descendant of the given element with matching attribute name and value. getbindingparent the getbindingparent method is used to obtain the bound element with the binding attached that is responsible for the generation of the
specified anonymous node. this method enables an author to determine the scope of any content node. when content at the document-level scope is passed in as an argument, the property's value is null. parameters node - the node for which the bound element responsible for generation is desired. return value element - the return value of getbindingparent is the element responsible for th...
...el scope is passed in as an argument, the property's value is null. parameters node - the node for which the bound element responsible for generation is desired. return value element - the return value of getbindingparent is the element responsible for the given anonymous node. loadbindingdocument the loadbindingdocument method can be used to synchronously obtain the
specified binding document for use within a particular document (the one on which the loadbindingdocument method was invoked). the binding document can then be modified programmatically using the dom. any subsequent bindings that are attached to elements within the document will be constructed from the modified binding document. parameters documenturl of type domstring - the url of a binding doc...
Complete - Archive of obsolete content
inside the jar there are three directories: content xul, javascript and other content that does not depend on the locale or theme locale files for each locale skin files for each theme version checks firefox etc. check extensions for compatibility before installing them. these version checks depend on the version numbers
specified in the install.rdf file. there are two approaches: pessimistic and optimistic. the approach that is normally recommended is pessimistic. the extension is assumed to fail in any future version of the application. to adopt this approach, set the maxversion to the latest actual version where you have tested your extension. the problem with this approach is that you have to release a new xpi every ti...
...lve the differences, the extension uses firefox etc. and seamonkey's different registration mechanisms to register different files where this is needed. toolbar conflicts there are some conflicts between toolbars in firefox etc. and toolbars in seamonkey. to avoid these conflicts, this extension uses a separate xul file for seamonkey. firefox etc. use: content/allcustom/allcustom.xul this file is
specified in chrome.manifest, which only firefox etc. use. seamonkey uses: content/allcustom/seamonkey/allcustom.xul this file is
specified in content/allcustom/contents.rdf, which only seamonkey uses. theme conflicts the classic theme for firefox etc. is different from the classic theme for seamonkey, but the internal name classic/1.0 is the same. to resolve the conflict, this extension registers seamonke...
...a similar structure is used for modern, even though there is no conflict. package structure here is the complete package structure for this extension. ...
... for firefox etc. is different from the classic theme for seamonkey, but the internal name classic/1.0 is the same. to resolve the conflict, this extension registers seamonkey's skins in a seamonkey subdirectory. firefox etc. use: skin/classic/allcustom/ this directory is
specified in chrome.manifest, which only firefox etc. use. seamonkey uses: skin/classic/allcustom/seamonkey/ this directory is
specified in install.js, which only seamonkey uses. a similar structure is used for modern, even though there is no conflict. package structure here is the complete package structure for this extension. this diagram shows all the directories but only a few of the files. you can see all the files if you unpack the xpi and the jar. ...
Numeric Controls - Archive of obsolete content
ter. number fields a textbox may be used for entering numbers by setting the value of the type attribute to the value number. this type of textbox may only be used to enter numbers. other characters are not allowed and are just ignored if typed. in addition, arrow buttons appear beside the textbox to allow the user to cycle through the values. as with other textboxes, the default value can be
specified with the value attribute. naturally, this value should be a number. however, the minimum and maximum values can also be
specified using the min and max attributes. if these are set, you can control the range of values that the textbox may be set to. if the user enters a value less or greater than this value, it will be reset to the minimum or maximum value as necessary. for instance, the followin...
...the maximum value defaults to the special value infinity which means that there is no limit. ...
...the maximum value defaults to the special value infinity which means that there is no limit. ...
...ment 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 textbox steps in multiples of 10 from 0 to 100. since the min attribute was not
specified, it defaults to 0. note that the user can still enter other values if they are typed in. the increment attribute only affects the arrow buttons. the user may also increment or decrement the value using this increment by using the up and down cursor keys while the textbox is focused. the decimalplaces attribute indicates how many decimal places to show. the default value is 0, which means show int...
The Implementation of the Application Object Model - Archive of obsolete content
local source, it can take the remote data and combine it with local data. you'll often hear people refer to this as rdf's local/remote merging capability. this capability is desirable for two reasons. what is local/remote merging good for? the first reason to have local/remote merging is that a remote file must be able to reference local data and have it merged in with the information that it
specified. ...
...it
specified. an example of this feature is a downloadable file that describes the user's main bookmarks folder. because the file lives remotely, it can be updated whenever the owner of the web site sees fit. a site admin could add new bookmarks to the file, and then the user would pick them up. however, in order for this to work, the local bookmarks have to be merged in with the remote bookmarks
specified by the site. the second reason to have local/remote merging is to save state and/or to record customizations that the user has made to his or her user interface. imagine a remote file that describes the user's personal toolbar. the downloaded file contains an aol instant messenger button, and the user really doesn't want that on the toolbar. ...
...what the user needs to be able to do is make a local annotation to the remote file, e.g., to save somewhere on the local hard drive the fact that the aol instant messenger button shouldn't be on the toolbar. ...
... thus allowing the xul writer to specify a default for the whole window, but to still selectively override it for certain subtrees. note that even if the persistent attribute is set to false, that changes can still be made to a window's content tree. they simply won't be remembered across sessions. preventing the persistence of attributes: the discardable attribute individual attributes can be
specified as non-persistent (i.e.,discardable) through the use of the discardable attribute. for example, the open attribute used to indicate whether a node is expanded or collapsed in a tree view is something that is sometimes persistent (in the case of bookmarks) and sometimes not (in the case of mail folders). in both cases, the overall tree structure needs to be persistent, but this particular attribut...
calICalendarViewController - Archive of obsolete content
the calievent should have its enddate set t...
...in calidatetime astarttime, in calidatetime aendtime); the createnewevent method is used for creating a new calievent in the calicalendar
specified by the acalendar parameter. in many cases, acalendar will be the defaultcalendar of the displaycalendar of the calicalendarview. the calidatetime parameters are optional, but aendtime cannot be included without astarttime. if astarttime is
specified, then the calievent is meant to be created 'silently', that is, without a more detailed dialog appearing. the calievent should have its enddate set to aendtime, if this parameter is
specified. otherwise, it should be set to a default value, as determined by the application. the other values of the calievent (title, summary, alarm, etc) should likewise be set to defaults. if no astarttime is speci...
...otherwise, a dialog should be display allowing the user to modify the fields. ...
...otherwise, a dialog should be display allowing the user to modify the fields. implementations of calicalendarviewcontroller should be careful to provide clearly defined behavior to the user regarding the modification of recurring caliitems. ...
What is CSS? - Learn web development
l be readable in a web browser. headings will look larger than regular text, paragraphs break onto a new line and have space between them. links are colored and underlined to distinguish them from the rest of the text. what you are seeing is the browser's default styles — very basic styles that the browser applies to html to make sure it will be basically readable even if no explicit styling is
specified by the author of the page. however, the web would be a boring place if all websites looked like that. using css you can control exactly how html elements look in the browser, presenting your markup using whatever design you like. for more on browser/default styles, check out the following video: what is css for? as we have mentioned before, css is a language for specifying how documents a...
...e a set of curly braces { }. inside those will be one or more declarations, which take the form of property and value pairs. each pair specifies a property of the element(s) we are selecting, then a value that we'd like to give the property. before the colon, we have the property, and after the colon, the value. css properties have different allowable values, depending on which property is being
specified. in our example, we have the color property, which can take various color values. we also have the font-size property. this property can take various size units as a value. a css stylesheet will contain many such rules, written one after the other. h1 { color: red; font-size: 5em; } p { color: black; } you will find that you quickly learn some values, whereas others you will need ...
...gies are supposed to behave. css is no different — it is developed by a group within the w3c called the css working group. this group is made of representatives of browser vendors and other companies who have an interest in css. there are also other people, known as invited experts, who act as independent voices; they are not linked to a member organization. new css features are developed, or
specified, by the css working group. sometimes because a particular browser is interested in having some capability, other times because web designers and developers are asking for a feature, and sometimes because the working group itself has identified a requirement. css is constantly developing, with new features coming available. however, a key thing about css is that everyone works very hard to never c...
...ngineers to use to implement support for the features in user agents, not for web developers to read to understand css. many experienced developers would much rather refer to mdn documentation or other tutorials. it is however worth knowing that they exist, understanding the relationship between the css you are using, browser support (see below), and the specs. browser support once css has been
specified then it is only useful for us in developing web pages if one or more browsers have implemented it. this means that the code has been written to turn the instruction in our css file into something that can be output to the screen. we'll look at this process more in the lesson how css works. it is unusual for all browsers to implement a feature at the same time, and so there is usually a gap where ...
Client-side form validation - Learn web development
um and maximum length of textual data (strings) min and max: specifies the minimum and maximum values of numerical input types type: specifies whether the data needs to be a number, an email address, or some other specific preset type. pattern: specifies a regular expression that defines a pattern the entered data needs to follow. if the data entered in a form field follows all of the rules
specified by the above attributes, it is considered valid. if not, it is considered invalid. when an element is valid, the following things are true: the element matches the :valid css pseudo-class, which lets you apply a specific style to valid elements. if the user tries to send the data, the browser will submit the form, provided there is nothing else stopping it from doing so (e.g., javascript). ...
...isfies its constraints (is valid), this will return an empty string. validity: returns a validitystate object that contains several properties describing the validity state of the element. you can find full details of all the available properties in the validitystate reference page; below is listed a few of the more common ones: patternmismatch: returns true if the value does not match the
specified pattern, and false if it does match. if true, the element matches the :invalid css pseudo-class. toolong: returns true if the value is longer than the maximum length
specified by the maxlength attribute, or false if it is shorter than or equal to the maximum. if true, the element matches the :invalid css pseudo-class. tooshort: returns true if the value is shorter than the minimum length sp...
...s shorter than or equal to the maximum. if true, the element matches the :invalid css pseudo-class. tooshort: returns true if the value is shorter than the minimum length
specified by the minlength attribute, or false if it is greater than or equal to the minimum. if true, the element matches the :invalid css pseudo-class. rangeoverflow: returns true if the value is greater than the maximum
specified by the max attribute, or false if it is less than or equal to the maximum. if true, the element matches the :invalid and :out-of-range css pseudo-classes. rangeunderflow: returns true if the value is less than the minimum
specified by the min attribute, or false if it is greater than or equal to the minimum. if true, the element matches the :invalid and :out-of-range css pseudo-classes. typ...
...makes the following methods available on the above elements. checkvalidity(): returns true if the element's value has no validity problems; false otherwise. if the element is invalid, this method also fires an invalid event on the element. setcustomvalidity(message): adds a custom error message to the element; if you set a custom error message, the element is considered to be invalid, and the
specified error is displayed. this lets you use javascript code to establish a validation failure other than those offered by the standard html5 validation constraints. the message is shown to the user when reporting the problem. implementing a customized error message as you saw in the html5 validation constraint examples earlier, each time a user tries to submit an invalid form, the browser displays a...
Other form controls - Learn web development
i-line text fields, to other useful form features such as the <output> element (which we saw in action in the previous article), and progress bars. prerequisites: basic computer literacy, and a basic understanding of html. objective: to understand the non-<input> form features, and how to implement them using html. multi-line text fields a multi-line text field is
specified using a <textarea> element, rather than using the <input> element. <textarea cols="30" rows="8"></textarea> this renders like so: the main difference between a <textarea> and a regular single line text field is that users are allowed to include hard line breaks (i.e. pressing return) that will be included when the data is submitted. <textarea> also takes a closing tag, and any default text ...
...ies (see the source code also). controlling multi-line rendering <textarea> accepts three attributes to control its rendering across several lines: cols specifies the visible width (columns) of the text control, measured in average character widths. this is effectively the starting width, as it can be changed by resizing the <textarea>, and overriden using css. the default value if none is
specified is 20. rows specifies the number of visible text rows for the control. this is effectively the starting height, as it can be changed by resizing the <textarea>, and overriden using css. the default value if none is
specified is 2. wrap specifies how the control wraps text. the values are soft (the default value), which means the text submitted is not wrapped but the text rendered by the brows...
...ext rows for the control. this is effectively the starting height, as it can be changed by resizing the <textarea>, and overriden using css. the default value if none is
specified is 2. wrap specifies how the control wraps text. the values are soft (the default value), which means the text submitted is not wrapped but the text rendered by the browser is wrapped; hard (the cols attribute must be
specified when using this value), which means both the submitted and rendered texts are wrapped, and off, which stops wrapping. controlling textarea resizability the ability to resize a <textarea> is controlled with the css resize property. its possible values are: both: the default — allows resizing horizontally and vertically. horizontal: allows resizing only horizontally. vertical: allows resi...
...tioned, but still useful in some situations, so we thought it would be worth giving them a brief mention. note: you can find the examples from this section on github as other-examples.html (see it live also). meters and progress bars meters and progress bars are visual representations of numeric values. progress a progress bar represents a value that changes over time up to a maximum value
specified by the max attribute. such a bar is created using a <progress> element. <progress max="100" value="75">75/100</progress> this is for implementing anything requiring progress reporting, such as the percentage of total files downloaded, or the number of questions filled in on a questionnaire. the content inside the <progress> element is a fallback for browsers that don't support the element an...
CSS basics - Learn web development
lectors there are many different types of selectors. the examples above use element selectors, which select all elements of a given type. but we can make more specific selections as well. here are some of the more common types of selectors: selector name what does it select example element selector (sometimes called a tag or type selector) all html elements of the
specified type. p selects <p> id selector the element on the page with the
specified id. on a given html page, each id value should be unique. #my-id selects <p id="my-id"> or <a id="my-id"> class selector the element(s) on the page with the
specified class. multiple instances of the same class can appear on a page. .my-class selects <p class="my-class"> and <a ...
...(for example, when a cursor hovers over a link.) a:hover selects <a>, but only when the mouse pointer is hovering over the link. there are many more selectors to discover. ...
...(for example, when a cursor hovers over a link.) a:hover selects <a>, but only when the mouse pointer is hovering over the link. there are many more selectors to discover. to learn more, see the mdn selectors guide. ...
...(for example, when a cursor hovers over a link.) a:hover selects <a>, but only when the mouse pointer is hovering over the link. there are many more selectors to discover. to learn more, see the mdn selectors guide. ...
Third-party APIs - Learn web development
n calls fetchresults(). this first calls preventdefault() on the event object, to stop the form actually submitting (which would break the example). next, we use some string manipulation to assemble the full url that we will make the request to. we start off by assembling the parts we deem as mandatory for this demo: the base url (taken from the baseurl variable). ...
...which would break the example). next, we use some string manipulation to assemble the full url that we will make the request to. we start off by assembling the parts we deem as mandatory for this demo: the base url (taken from the baseurl variable). the api key, which has to be
specified in the api-key url parameter (the value is taken from the key variable). the page number, which has to be
specified in the page url parameter (the value is taken from the pagenumber variable). the search term, which has to be
specified in the q url parameter (the value is taken from the value of the searchterm text <input>). the document type to return results for, as
specified in an expression passed in via the fq url parameter. in this case, we want to return articles. next, we use a couple of if() state...
...eter (the value is taken from the value of the searchterm text <input>). the document type to return results for, as
specified in an expression passed in via the fq url parameter. in this case, we want to return articles. next, we use a couple of if() statements to check whether the startdate and enddate <input>s have had values filled in on them. if they do, we append their values to the url,
specified in begin_date and end_date url parameters respectively. so, a complete url would end up looking something like this: https://api.nytimes.com/svc/search/v2/articlesearch.json?api-key=your-api-key-here&page=0&q=cats &fq=document_type:("article")&begin_date=20170301&end_date=20170312 note: you can find more details of what url parameters can be included at the nytimes developer docs. note: th...
...=cats &fq=document_type:("article")&begin_date=20170301&end_date=20170312 note: you can find more details of what url parameters can be included at the nytimes developer docs. note: the example has rudimentary form data validation — the search term field has to be filled in before the form can be submitted (achieved using the required attribute), and the date fields have pattern attributes
specified, which means they won't submit unless their values consist of 8 numbers (pattern="[0-9]{8}"). see form data validation for more details on how these work. requesting data from the api now we've constructed our url, let's make a request to it. we'll do this using the fetch api. add the following code block inside the fetchresults() function, just above the closing curly brace: // use fetch() ...
IME handling guide
cess has focus, it notifies the remote process of "menu keyboard listener installed". then, tabchild calls imestatemanager::oninstalledmenukeyboardlistener() in the remote process. style of each clause the style of each ime selection is managed by lookandfeel class per platform. therefore, it can be overridden by prefs. background color, foreground color (text color) and underline color can be
specified with following prefs. the values must be string of "#rrggbb" format. ui.imerawinputbackground ui.imerawinputforeground ui.imerawinputunderline ui.imeselectedrawtextbackground ui.imeselectedrawtextforeground ui.imeselectedrawtextunderline ui.imeconvertedtextbackground ui.imeconvertedtextforeground ui.imeconvertedtextunderline ui.imeselectedconvertedtextbackground ui.imeselectedconvert...
...awinputbackground ui.imerawinputforeground ui.imerawinputunderline ui.imeselectedrawtextbackground ui.imeselectedrawtextforeground ui.imeselectedrawtextunderline ui.imeconvertedtextbackground ui.imeconvertedtextforeground ui.imeconvertedtextunderline ui.imeselectedconvertedtextbackground ui.imeselectedconvertedtextforeground ui.imeselectedconvertedtextunderline underline style can be
specified with the following prefs. the values are integer, 0: none, 1: dotted, 2: dashed, 3: solid, 4: double, 5: wavy (the values same as ns_style_text_decoration_style_* defined in nsstyleconsts.h. ui.imerawinputunderlinestyle ui.imeselectedrawtextunderlinestyle ui.imeconvertedtextunderlinestyle ui.imeselectedconvertedtextunderlinestyle underline width can be
specified with "ui.imeunderlinerela...
...tcompositionevent. therefore, editorbase requests to commit composition when the following cases occur: the editor loses focus the caret is moved by mouse or javascript value of the editor is changed by javascript node of the editor is removed from dom tree somethings object is modified in an html editor, e.g., resizing an image composition string is moved to a different position which is
specified by native ime (e.g., only a part of composition is committed) in the future, we should fix this limitation. if we make editorbase not touch undo stack until composition is committed, some of the cases must be fixed. notifications to ime xp part of gecko uses nsiwidget::notifyime() for notifying widget of something useful to handle ime. note that some of them are notified only when nsiwidget::...
...dowless plugin has focus. be careful, even if a password field has focus, mimestate may be enabled. when you need to check if a password field has focus for security reasons, you should use inputcontext::ispasswordeditor(). the other is ime open state: dont_change_open_state the open state of ime shouldn't be changed. i.e., gecko should keep the last ime open state. open open ime. this is
specified only when ime-mode of the new focused element is active. close close ime. this is
specified only when ime-mode of the new focused element is inactive. e.g., on linux, applications cannot manage ime open state. on such platforms, this is ignored. ime open state should be changed only when nsiwidget::setinputcontext() is called at dom focus change because changing ime open state while an edi...
NSPR Error Handling
es error codes defined in prerror.h: pr_out_of_memory_error insufficient memory to perform request. pr_bad_descriptor_error the file descriptor used as an argument in the preceding function is invalid. pr_would_block_error the operation would have blocked, which conflicts with the semantics that have been established. pr_access_fault_error one of the arguments of the preceding function
specified an invalid memory address. pr_invalid_method_error the preceding function is invalid for the type of file descriptor used. pr_illegal_access_error one of the arguments of the preceding function
specified an invalid memory address. pr_unknown_error some unknown error has occurred. pr_pending_interrupt_error the operation terminated because another thread has interrupted it with pr_interrup...
...r some unknown error has occurred. pr_pending_interrupt_error the operation terminated because another thread has interrupted it with pr_interrupt. pr_not_implemented_error the preceding function has not been implemented. pr_io_error the preceding i/o function encountered some sort of an error, perhaps an invalid device. pr_io_timeout_error the i/o operation has not completed in the time
specified for the preceding function. pr_io_pending_error an i/o operation has been attempted on a file descriptor that is currently busy with another operation. pr_directory_open_error the directory could not be opened. pr_invalid_argument_error one or more of the arguments to the function is invalid. pr_address_not_available_error the network address (prnetaddr) is not available (probably in use)...
...tion has been attempted on a file descriptor that is currently busy with another operation. pr_directory_open_error the directory could not be opened. pr_invalid_argument_error one or more of the arguments to the function is invalid. pr_address_not_available_error the network address (prnetaddr) is not available (probably in use). pr_address_not_supported_error the type of network address
specified is not supported. pr_is_connected_error an attempt to connect on an already connected network file descriptor. pr_bad_address_error the network address
specified is invalid (as reported by the network). pr_address_in_use_error network address
specified (prnetaddr) is in use. pr_connect_refused_error the peer has refused to allow the connection to be established. pr_network_unreachable_er...
...eout_error the connection attempt did not complete in a reasonable period of time. pr_not_connected_error the preceding function attempted to use connected semantics on a network file descriptor that was not connected. pr_load_library_error failure to load a dynamic library. pr_unload_library_error failure to unload a dynamic library. pr_find_symbol_error symbol could not be found in the
specified library. pr_insufficient_resources_error there are insufficient system resources to process the request. pr_directory_lookup_error a directory lookup on a network address has failed. pr_tpd_range_error attempt to access a thread-private data index that is out of range of any index that has been allocated to the process. pr_proc_desc_table_full_error the process' table for holding open fil...
PL_HashTableLookup
this means that one cannot tell whether a null return value means the entry does not exist or the value of the entry is null. ...
...this means that one cannot tell whether a null return value means the entry does not exist or the value of the entry is null. ...
...this means that one cannot tell whether a null return value means the entry does not exist or the value of the entry is null. ...
....h> void *pl_hashtablelookup( plhashtable *ht, const void *key); parameters the function has the following parameters: ht a pointer to the hash table in which to look up the entry
specified by key. key a pointer to the key for the entry to look up. returns the value of the entry with the
specified key, or null if there is no such entry. description if there is no entry with the
specified key, pl_hashtablelookup returns null. this means that one cannot tell whether a null return value means the entry does not exist or the value of the entry is null. keep this ambiguity in mind if you want to store null values in a hash table. ...
PRIOMethods
n recvfrom; prsendtofn sendto; prpollfn poll; pracceptreadfn acceptread; prtransmitfilefn transmitfile; prgetsocknamefn getsockname; prgetpeernamefn getpeername; prgetsockoptfn getsockopt; prsetsockoptfn setsockopt; }; typedef struct priomethods priomethods; parameters file_type type of file represented (tos). close close file and destroy descriptor. read read up to the
specified number of bytes into buffer. write write
specified number of bytes from buffer. available determine number of bytes available for reading. available64 same as previous field, except 64-bit. fsync flush all in-memory buffers of file to permanent store. seek position the file pointer to the desired place. seek64 same as previous field, except 64-bit. fileinfo get information about an ...
...e for reading. available64 same as previous field, except 64-bit. fsync flush all in-memory buffers of file to permanent store. seek position the file pointer to the desired place. seek64 same as previous field, except 64-bit. fileinfo get information about an open file. fileinfo64 same as previous field, except 64-bit. writev write from a vector of buffers. connect connect to the
specified network address. accept accept a connection from a network peer. bind associate a network address with the file descriptor. listen prepare to listen for network connections. shutdown shut down a network connection. recv receive up to the
specified number of bytes. send send all the bytes
specified. recvfrom receive up to the
specified number of bytes and report network source. send...
... accept accept a connection from a network peer. bind associate a network address with the file descriptor. listen prepare to listen for network connections. shutdown shut down a network connection. recv receive up to the
specified number of bytes. send send all the bytes
specified. recvfrom receive up to the
specified number of bytes and report network source. sendto send bytes to
specified network address. poll test the file descriptor to see if it is ready for i/o. acceptread accept and read from a new network file descriptor. transmitfile transmit an entire file to the
specified socket. getsockname get network address associated with a file descriptor. getpeername get peer's network address. getsockopt get current setting of
specified socket option. setsockopt set v...
... description you don't need to know the type declaration for each function listed in the method table unless you are implementing a layer. ...
JS_DeleteProperty2
renamed to js_deleteproperty from jsapi 39. ...
...s::handleid name of the property to delete. namelen size_t (only in js_deleteucproperty2) the length of name in characters; or -1 to indicate that name is null-terminated. succeeded bool * out parameter. on success, *succeeded receives false if the property was not deleted because it is permanent and true otherwise. description js_deleteproperty2 removes a
specified property, name, from an object, obj, and stores true or false in *succeeded. it behaves like the javascript expression delete obj[name]. js_deleteucproperty2 is the unicode version of the function. js_deletepropertybyid2 is the same but takes a js::handleid for the property name. first, a property lookup is performed. then one of the following cases applies: if obj has no property with the gi...
...nd stores true or false in *succeeded. it behaves like the javascript expression delete obj[name]. js_deleteucproperty2 is the unicode version of the function. js_deletepropertybyid2 is the same but takes a js::handleid for the property name. first, a property lookup is performed. then one of the following cases applies: if obj has no property with the given name or id, or if obj inherits the
specified property from its prototype, then *succeeded is set to true and obj's jsclass.delproperty hook is called (which may change *succeeded). no property is deleted, but this is not an error. if obj has the
specified property but it is permanent, then *succeeded receives false. no property is deleted, but this is not an error. otherwise obj has a non-permanent own property with the given name or id. ...
... called (which may change *succeeded). if the hook returns false, the error is propagated. otherwise, if obj is not configurable, an error is raised. otherwise, *succeeded receives true and the property is removed. these functions return true on success, regardless of whether a property was actually deleted. on error or exception, the return value is false, and the value left in *succeeded is un
specified. jsobjectops.deleteproperty implements this behavior. (in javascript 1.2 and earlier, attempting to delete a permanent property caused an error. there is no longer any way to get this behavior.) to remove all properties from an object, call js_clearscope. see also mxr id search for js_deleteproperty2 mxr id search for js_deleteucproperty2 mxr id search for js_deletepropertybyid2 bug 461...
TPS Bookmark Lists
for example: var bookmarks_after_second_modify = { "menu": [ { uri: "http://www.getfirefox.com/", title: "get firefox" } ], "menu/foldera": [ { uri: "http://mozilla.com", title: "mozilla" }, ] }; this describes two bookmarks, one in the "menu" folder, and the other in the "folder1" subfolder of "menu". ...
...that is, the first item is appended to its parent folder, then the second, and so forth. after and before properties are ignored. bookmarks.verify - the bookmark items in the list are verified to be present. within each folder, the second item in the list is assumed to be immediately after the first item, and so forth. if the second item in a given folder is not directly after the first it...
...then the second, and so forth. after and before properties are ignored. bookmarks.verify - the bookmark items in the list are verified to be present. within each folder, the second item in the list is assumed to be immediately after the first item, and so forth. if the second item in a given folder is not directly after the first item in that folder, it's an error. after and before properties, if
specified, are also used to verify an item's position. however, because crossweave verifies that bookmark items appear in the order that they are given in the asset list, after and before are not very useful except in verifying the position of the first item in the list. bookmarks.verifynot - the bookmark items in the list are verified not to be present. bookmarks.modify - the changes properties of the boo...
... very useful except in verifying the position of the first item in the list. bookmarks.verifynot - the bookmark items in the list are verified not to be present. bookmarks.modify - the changes properties of the bookmark items are applied, after the items have been verified to exist. if a location property exists inside the changes object, it is applied before the position property. if location is
specified without position, then the bookmark is moved to the end of the
specified folder. if position is
specified without location, then the bookmark is moved to the
specified position within the current folder. bookmarks.delete - the bookmarks in this list are deleted from the browser. ...
Animated PNG graphics
mage that is displayed by decoders that do not support apng. the canvas is the area on the output device on which the frames are to be displayed. the contents of the canvas are not necessarily available to the decoder. as per the png specification, if a 'bkgd' chunk exists it may be used to fill the canvas if there is no preferrable background. the output buffer is a pixel array with dimensions
specified by the width and height parameters of the png 'ihdr' chunk. conceptually, each frame is constructed in the output buffer before being composited onto the canvas. the contents of the output buffer are available to the decoder. the corners of the output buffer are mapped to the corners of the canvas. fully transparent black means red, green, blue and alpha components are all set to zero. for purp...
...fore '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 preceded by a sequence number. information for each frame about placement and rendering is stored in 'fctl' chunks. the full layout of 'fdat' and 'fctl' chunks is described below. the boundaries of the entire animation are
specified by the width and height parameters of the png 'ihdr' chunk, regardless of whether the default image is part of the animation. the default image should be appropriately padded with fully transparent pixels if extra space will be needed for later frames. each frame is identical for each play, therefore it is safe for applications to cache the frames. chunk sequence numbers the 'fctl' and 'fdat' ...
... 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' chunk. position relative to the 'actl' chunk is not
specified. for the first frame excluding the default image (which may be either the first or second frame), the 'fctl' chunk must appear after all 'idat' chunks and before the 'fdat' chunks for the frame. for all subsequent frames, the 'fctl' chunk for frame n must appear after the 'fdat' chunks from frame n-1 and before the 'fdat' chunks for frame n. other ancillary chunks are allowed to appear among t...
...e bit depth, color type, compression method, filter method, interlace method, and palette (if any) as the default image. byte offset field name field type description 0 sequence_number unsigned int sequence number of the animation chunk, starting from 0. 4 frame_data x bytes frame data for this frame. each frame inherits every property
specified by any critical or ancillary chunks before the first 'idat' in the file, except the width and height, which come from the 'fctl' chunk. if the png 'phys' chunk is present, the apng images and their x_offset and y_offset values must be scaled in the same way as the main image. conceptually, such scaling occurs while mapping the output buffer onto the canvas. revisions to this specification from...
Components.utils.createObjectIn
this function is made available as a global in sandboxes which have the wantexporthelpers option set in the sandbox() constructor. note that this function is now mostly obsolete when you are using sandbox, because you can create an object in a different compartment using new. for example, to create a new object in the compartment identified by contentwindow: var newobject = new contentwindow.object(); but it is really needeed from firefox 30 onwards when trying to manipulate the dom window. ...
... var newobject = components.utils.createobjectin(obj, options); parameters obj an object indicating the compartment in which the new object should be created; the new object will be created in the scope of this object's compartment. options an object containing a single option defineas, which determines the name of the object in the target compartment. ...
...arameters obj an object indicating the compartment in which the new object should be created; the new object will be created in the scope of this object's compartment. options an object containing a single option defineas, which determines the name of the object in the target compartment. return value a new object in the
specified scope. ...
... ...
IAccessibleTableCell
hresult rowextent([out] long nrowsspanned ); [propget] hresult rowheadercells([out, size_is(, nrowheadercells,)] iunknown cellaccessibles, [out] long nrowheadercells ); [propget] hresult rowindex([out] long rowindex ); [propget] hresult table([out] iunknown table ); methods columnextent() returns the number of columns occupied by this cell accessible. the result is greater than 1 if the
specified cell spans multiple columns. [propget] hresult columnextent( [out] long ncolumnsspanned ); parameters ncolumnsspanned returns the 1 based column extent of the
specified cell. return value s_ok. columnheadercells() returns the column headers as an array of cell accessibles. [propget] hresult columnheadercells( [out, size_is(, ncolumnheadercells,)] iunknown cellaccessibles, [out] long ncol...
... ncolumnheadercells the number of accessibles returned; the size of the returned array. return value s_false if there is no header, [out] values are null and 0 respectively. s_ok. columnindex() translates this cell accessible into the corresponding column index. [propget] hresult columnindex( [out] long columnindex ); parameters columnindex returns the 0 based column index of the cell of the
specified cell or the index of the first column if the cell spans multiple columns. return value s_ok. isselected() returns a boolean value indicating whether this cell is selected. [propget] hresult isselected( [out] boolean isselected ); parameters isselected returns true if the
specified cell is selected and false otherwise. return value s_ok. rowcolumnextents() gets the row and column indexes and...
...ory to implement it. [propget] hresult rowcolumnextents( [out] long row, [out] long column, [out] long rowextents, [out] long columnextents, [out] boolean isselected ); parameters row 0 based row index. column 0 based column index. rowextents number of cells spanned by this cell in this row. columnextents number of cells spanned by this cell in this column. isselected indicates if the
specified cell is selected. return value s_ok. rowextent() returns the number of rows occupied by this cell accessible. [propget] hresult rowextent( [out] long nrowsspanned ); parameters nrowsspanned returns the row extent of the
specified cell. return value s_ok. rowheadercells() returns the row headers as an array of cell accessibles. [propget] hresult rowheadercells( [out, size_is(, nrowheaderce...
...rver. free it with cotaskmemfree. nrowheadercells the number of accessibles returned; the size of the returned array. return value s_false if there is no header, [out] values are null and 0 respectively. s_ok. rowindex() translates this cell accessible into the corresponding row index. [propget] hresult rowindex( [out] long rowindex ); parameters rowindex returns the 0 based row index of the
specified cell or the index of the first row if the cell spans multiple rows. return value s_ok. table() returns a reference to the accessbile of the containing table. [propget] hresult table( [out] iunknown table ); parameters table returns a reference to the iunknown of the containing table. return value s_ok. see also iaccessibletable2 ...
mozIStorageConnection
expression may use "?#" to indicate sequentially numbered parameters (?1, ?2, etc) or ":name" to indicate named parameters. javascript callers should use named parameters. mozistorageasyncstatement createasyncstatement( in autf8string asqlstatement ); parameters asqlstatement the sql statement to execute. return value returns a new mozistorageasyncstatement to be used to execute the
specified statement. createfunction() creates a new function that can be used in sql. see mozistoragefunction for sample code and more details. if you use your connection on multiple threads, your function needs to be threadsafe, or it should only be called on one thread. void createfunction( in autf8string afunctionname, in long anumarguments, in mozistoragefunction afunction ); parameter...
...pression. the expression may use "?#" to indicate sequentially numbered parameters (?1, ?2, etc) or ":name" to indicate named parameters. javascript callers should use named parameters. mozistoragestatement createstatement( in autf8string asqlstatement ); parameters asqlstatement the sql statement to execute. return value returns a new mozistoragestatement to be used to execute the
specified statement. note if the statement is meant to be executed asynchronously, you should rather create it with createasyncstatement. the resulting statement will be faster to execute. additionally, the system will be able to inform you if you erroneously attempt to execute it synchronously. createtable() this method creates a table with the given table name and schema. void createtable( in ...
...this method creates a table with the given table name and schema. void createtable( in string atablename, in string atableschema ); parameters atablename the name of the table to create; table names may consist of the letters a-z in either upper or lower case, the underscore, and the digits 0-9. the first character must be a letter. atableschema the table's schema. this should be
specified using the same syntax the create table statement uses. for example: "foo integer, bar string". exceptions thrown ns_error_failure table already exists or the requested table couldn't be created. executeasync() asynchronously executes an array of queries created with this connection, using any currently bound parameters. the statements are run wrapped in a transaction. note: the statemen...
...nes whether or not the given index exists. boolean indexexists( in autf8string aindexname ); parameters aindexname the index to check. return value true if the index exists, false otherwise. preload() obsolete since gecko 1.9 (firefox 3) this is used to preload the database cache. it loads pages from the start of the database file until the memory cache (
specified by "pragma cache_size=") is full or the entire file is read. the cache must be active on the database for this to work. this means that you must have a transaction open on the connection, or have a transaction open on another connection that shares the same pager cache. this cached data will go away when the transaction is closed. this preload operation can dramatically speed up read operations...
nsIApplicationCacheService
note: this method should propagate the entry to other application caches with the same opportunistic namespace; however, this is not currently implemented. void cacheopportunistically( in nsiapplicationcache cache, in acstring key ); parameters cache the cache in which the entry is currently cached. key the cache entry's key. chooseapplic...
...ethod should propagate the entry to other application caches with the same opportunistic namespace; however, this is not currently implemented. void cacheopportunistically( in nsiapplicationcache cache, in acstring key ); parameters cache the cache in which the entry is currently cached. key the cache entry's key. chooseapplicationcache() tries to find the best application cache to serve a
specified resource. nsiapplicationcache chooseapplicationcache( in acstring key ); parameters key the cache entry key for which to select an application cache. return value the nsiapplicationcache best able to serve the resource indicated by the key parameter. createapplicationcache() creates a new, empty application cache for the
specified cache group. nsiapplicationcache createapplicationcache( in...
...void deactivategroup( in acstring group ); parameters group the cache group to deactivate. getactivecache() returns the currently active cache object for a cache group. ...
...rameters group the cache group to deactivate. getactivecache() returns the currently active cache object for a cache group. nsiapplicationcache getactivecache( in acstring group ); parameters group the cache group for which to return an application cache. return value the currently active cache object for the cache group. getapplicationcache() returns the nsiapplicationcache object for the
specified client id. nsiapplicationcache getapplicationcache( in acstring clientid ); parameters clientid the client id for which to return the application cache object. return value the application cache object for the
specified client id. getgroups() returns the list of application cache groups. void getgroups( out unsigned long count, optional [array, size_is(count), retval] out string groupids...
nsINavBookmarksService
ead only. note: renamed from toolbarroot in gecko 1.9 unfiledbookmarksfolder long long the item id of the unfiled bookmarks folder. read only. constants constant value description default_index -1 this is the default index; this value should be used for apis that allow passing in an index where the index is not known or is not required to be
specified, such as when appending an item to a folder. type_bookmark 1 this is an index for type "bookmark". type_folder 2 this is an index for type "folder". type_separator 3 this is an index for type "separator". type_dynamic_container 4 this is an index for type "dynamic container". dynamic containers were removed in gecko 11, but the type inde...
...given id. getfolderuri() obsolete since gecko 1.9 (firefox 3) note: getbookmarkuri() provides an alternative for this method. get the url for a bookmark folder. nsiuri getfolderuri( in print64 folder ); parameters folder the folder whose uri should be retrieved. return value the uri of the folder. getidforitemat() returns the item id for the item at the
specified index within a particular folder. long long getidforitemat( in long long aparentid, in long aindex ); parameters aparentid the id of the direct parent folder of the item whose id is to be obtained. aindex the index of the item within the folder
specified by aparentid for the item whose id is to be returned. specify default_index to return the last item in the folder. return value ...
... getitemdateadded() this method retrieves the date added time for an item. ...
...1.9 (firefox 3) note: bug 1187119 provides an alternative for this method. associates the given keyword with the given uri. use an empty keyword to clear the keyword associated with the uri. use an empty uri to clear the uri associated with that keyword. in both of these cases, succeeds but does nothing if the url/keyword is not found. when setting a keyword (both uri and keyword are
specified), the uri must be bookmarked for the keyword to be persistent. void setkeywordforuri( in nsiuri uri, in astring keyword ); parameters uri the uri of the bookmark. keyword the keyword that needs to be associated with the uri. see also places manipulating bookmarks using places nsitransaction nsinavbookmarkobserver nsinavhistorybatchcallback ...
nsINavHistoryContainerResultNode
short the current state of the container. this is one of the state constants. constants state constants constant value description state_closed 0 the container is closed. state_loading 1 the container has been opened asynchronously, but is still loading and is not all the way opened yet. state_opened 2 the container is open. methods findnodebydetails() returns a node matching
specified details. nsinavhistoryresultnode findnodebydetails( in autf8string auristring, in prtime atime, in long long aitemid, in boolean recursive ); parameters auristring the uri attribute value to match on. atime the time attribute to match on. aitemid the item id to match on. arecursive if true, the search will recurse through all child containers of the current container; if false, only dir...
...ng long aitemid, in boolean recursive ); parameters auristring the uri attribute value to match on. atime the time attribute to match on. aitemid the item id to match on. arecursive if true, the search will recurse through all child containers of the current container; if false, only direct children of the container are searched. return value an nsinavhistoryresultnode of a node matching the
specified details or null if no match is found. exceptions thrown ns_error_not_available the container is not open. getchild() returns the child node at the
specified index. nsinavhistoryresultnode getchild( in unsigned long aindex ); parameters aindex the index into the child list of the node to fetch. returns the node located at the
specified index. exceptions thrown ns_error_not_available the...
... remarks there are a number of untested methods on this interface that are not documented at present, and are disabled in the idl file. ...
...the index of a direct child of this container. unsigned long getchildindex( in nsinavhistoryresultnode anode ); parameters anode the node whose index is to be returned. return value the index of the
specified node into the list of immediate children of the container. exceptions thrown ns_error_not_available the container isn't open (that is, containeropen is false). ns_error_invalid_arg the
specified node isn't a direct child of this container. remarks there are a number of untested methods on this interface that are not documented at present, and are disabled in the idl file. see also nsinavhistoryresultnode, nsinavhistoryservice ...
nsINavHistoryObserver
ong atransitiontype, in acstring aguid, out unsigned long aadded); constants constant value description attribute_favicon 3 the page's favicon changed. methods onbeforedeleteuri() obsolete since gecko 21.0 (firefox 21.0 / thunderbird 21.0 / seamonkey 2.18) note: this method was removed in gecko 21.0 as part of bug 826409. the
specified page and all its visits are about to be deleted. note: the page does not necessarily have to have ever existed for this function to be called. delete notifications aren't quite 100% accurate. batch delete operations take place in two steps; the notifications come first, followed by a bulk delete. if an error occurs in between these two steps (for example, an out of memory error), then you may g...
...deleted. aguid the unique id associated with the page. onbeginupdatebatch() notifies you that a batch of things are about to change. you should avoid doing any heavy-duty processing until onendupdatebatch() is called. void onbeginupdatebatch(); parameters none. onclearhistory() called just prior to all of history being cleared. void onclearhistory(); parameters none. ondeleteuri() the
specified page and all its visits has been deleted. delete notifications are not quite 100% accurate. batch delete operations take place in two steps; the notifications come first, followed by a bulk delete. if an error occurs in between these two steps (for example, an out of memory error), then you may get a notification even though the page doesn't wind up getting deleted. note: the page does not nece...
...e that we do not have any visit older than this date. aguid the unique id associated with the page. onendupdatebatch() called once a batch of updates is completed. once this has been called, you can perform processing, user interface updates, and so forth. this is called sometime after onbeginupdatebatch(). void onendupdatebatch(); parameters none. onpagechanged() some attribute on the
specified page has changed. note that for typed and hidden pages, the page might not actually have been added yet. this needs to be clarified; what are typed and hidden? void onpagechanged( in nsiuri auri, in unsigned long awhat, in astring avalue ); parameters auri the uri of the page on which an attribute changed. awhat the attribute whose value changed. avalue the attribu...
...pageexpired( in nsiuri auri, in prtime avisittime, in boolean awholeentry ); parameters auri the uri of the page that expired. avisittime the visit time that expired; this may (or may not) be 0 if a bookmark with no visits is deleted. awholeentry true if this expiration will result in the entire history entry being deleted from the history store; if false, only the
specified visit is being deleted. ontitlechanged() called whenever either the real title or the custom title of the page changes. both titles are always included in this notification, even though only one is changed each time it is called, since often consumers will want to display the user title if available, falling back to the title
specified by the page's <title> element if there is no user title. it'...
nsINavHistoryQuery
ffset resolve to. absoluteendtime prtime read only: retrieves the end time value that the currently loaded reference points + offset resolve to. annotation autf8string the annotation name. annotationisnot boolean test for existance or non-existance of a given annotation. we don't currently support >1 annotation name per query. if annotationisnot is true, we test for the non-existance of the
specified annotation. testing for not annotation will do the same thing as a normal query and remove everything that doesn't have that annotation. asking for things that do have a given annotation is a little different. it also includes things that have never been visited. this allows place queries to be returned (which might include bookmark folders -- use the bookmark service's getfolderuri) as well as a...
...matched regardless of their visit count. onlybookmarked boolean when set, returns only bookmarked items, when unset, returns anything. setting this is equivalent to listing all bookmark folders in the folders parameter. searchterms astring text search terms. tags nsivariant a list of tags to use for filtering query results. this attribute must be an array of strings. duplicate tags may be
specified, but when reading the list, only unique tags are returned. when called as a getter, this returns an array of strings sorted in ascending lexicographical (alphabetical) order. this array may be empty, in which case no filtering by tags is performed. to search for items that are tagged with any given tags instead of all, multiple queries may be passed to the nsinavhistoryservice method nsinavhistor...
...orted in ascending lexicographical (alphabetical) order. this array may be empty, in which case no filtering by tags is performed. to search for items that are tagged with any given tags instead of all, multiple queries may be passed to the nsinavhistoryservice method nsinavhistoryservice.executequeries(). tagsarenot boolean if true, the results include only items that are not tagged with the
specified tags. if false, only tags in the tags list are included in the results. uri nsiuri this is a uri to match, to, for example, find out every time you visited a given uri. use uriisprefix to control whether this is an exact match. uriisprefix boolean controls the interpretation of uri. when unset (default), the uri will request an exact match of the
specified uri. when set, any history entry beg...
...et for this query. void gettransitions( out unsigned long count, optional [retval,array,size_is(count)] out unsigned long transitions ); parameters count optional the number of transitions transitions missing description settransitions() when the set of transitions is nonempty, results are limited to pages which have at least one visit for each of the transition types. limit results to the
specified list of transition types. void settransitions( [const,array, size_is(count)] in unsigned long transitions, in unsigned long count ); parameters transitions missing description. count the number of transitions. see also places using the places history service querying places nsinavhistoryservice ...
nsISelection
iscollapsed boolean indicates if the selection is collapsed() or not. read only. rangecount long returns the number of ranges in the selection. read only. methods addrange() adds a nsidomrange to the current selection. void addrange( in nsidomrange range ); parameters range the nsidomrange to add collapse() collapses the selection to a single point, at the
specified offset in the given nsidomnode. when the selection is collapsed(), and the content is focused and editable, the caret will blink there. void collapse( in nsidomnode parentnode, in long offset ); parameters parentnode the given nsidomnode where the selection will be set. offset where in the given dom node to place the selection (the offset into the given node). collapsed() [...
...de to look for partlycontained if partlycontained is set to pr_false, the function only returns true when the entire node is part of the selection. return value whether or not the range contains the requested noe. deletefromdocument() deletes this selection from the document the nodes belong to. void deletefromdocument(); extend() extends the selection by moving the selection end to the
specified nsidomnode and offset, preserving the selection begin position. the new selection end result will always be from the anchornode to the new focusnode, regardless of direction. void extend( in nsidomnode parentnode, in long offset ); parameters parentnode the node where the selection will be extended to. offset where in the node to place the offset in the new selection end. n...
...id extend( in nsidomnode parentnode, in long offset ); parameters parentnode the node where the selection will be extended to. offset where in the node to place the offset in the new selection end. native code only!extendnative void extendnative( in nsinode parentnode, in long offset ); parameters parentnode offset getrangeat() returns the nsidomrange at the
specified index. nsidomrange getrangeat( in long index ); parameters index return value the nsidomrange requested modify() modifies the selection. note that the parameters are case-insensitive. void modify( in domstring alter, in domstring direction, in domstring granularity ); parameters alter can be one of { "move", "extend()" } "move" collapses the selection to the end of ...
...d", "backward", "left", "right" } granularity can be one of { "character", "word", "line", "lineboundary" } removeallranges() removes all nsidomranges from the current selection. void removeallranges(); parameters none removerange() removes a range from the current selection. void removerange( in nsidomrange range ); parameters range selectallchildren() adds all children of the
specified node to the selection. void selectallchildren( in nsidomnode parentnode ); parameters parentnode the parent of the children to be added to the selection. selectionlanguagechange() modifies the cursor bidi level after a change in keyboard direction. void selectionlanguagechange( in boolean langrtl ); parameters langrtl is pr_true if the new language is right-to-left or pr_...
nsIWindowWatcher
in nsisupports aarguments ); parameters aparent the parent window, if any. null if no parent. if it is impossible to get to an nsiwebbrowserchrome from aparent, this method will effectively act as if aparent were null. aurl the url to open in the new window. must already be escaped, if applicable. can be null. aname a window name assigned using window interface's open() method loads the
specified resource into the browsing context (window, <iframe> or tab) with the
specified name. if the name doesn't exist, then a new window is opened and the
specified resource is loaded into its browsing context.">window.open. can be null. if a window with this name already exists, the openwindow call may just load aurl in it (if aurl is not null) and return it. afeatures window features. see window in...
...can be null. ...
...can be null. list of feature options aarguments extra argument(s) to be attached to the new window as the window.arguments property. ...
...can be null. ...
nsIXSLTProcessor
id setparameter(in domstring namespaceuri, in domstring localname, in nsivariant value); nsidomdocument transformtodocument(in nsidomnode source); nsidomdocumentfragment transformtofragment(in nsidomnode source, in nsidomdocument output); methods clearparameters() removes all set parameters from this nsixsltprocessor. this will make the processor use the default-value for all parameters as
specified in the stylesheet. void clearparameters(); parameters none. getparameter() gets a parameter if previously set by setparameter(). returns null otherwise. nsivariant getparameter( in domstring namespaceuri, in domstring localname ); parameters namespaceuri the namespaceuri of the xslt parameter. localname the local name of the xslt parameter. return value an nsivariant containing the value ...
...meters none. getparameter() gets a parameter if previously set by setparameter(). returns null otherwise. nsivariant getparameter( in domstring namespaceuri, in domstring localname ); parameters namespaceuri the namespaceuri of the xslt parameter. localname the local name of the xslt parameter. return value an nsivariant containing the value of the parameter. importstylesheet() imports the
specified stylesheet into this xsltprocessor for transformations. void importstylesheet( in nsidomnode style ); parameters style the root-node of a xslt stylesheet. this can be either a document node or an element node. if a document node then the document can contain either a xslt stylesheet or a lre stylesheet. if the argument is an element node it must be the xsl:stylesheet (or xsl:transform) elemen...
...lt stylesheet. this can be either a document node or an element node. if a document node then the document can contain either a xslt stylesheet or a lre stylesheet. if the argument is an element node it must be the xsl:stylesheet (or xsl:transform) element of an xslt stylesheet. removeparameter() removes a parameter, if set. this will make the processor use the default-value for the parameter as
specified in the stylesheet. void removeparameter( in domstring namespaceuri, in domstring localname ); parameters namespaceuri the namespaceuri of the xslt parameter. localname the local name of the xslt parameter. reset() remove all parameters and stylesheets from this nsixsltprocessor. void reset(); parameters none. setparameter() sets a parameter to be used in subsequent transformations with th...
...the node source applying the stylesheet imported by importstylesheet(). nsidomdocument transformtodocument( in nsidomnode source ); parameters source the node to be transformed. return value an document containing the result of the transformation. transformtofragment() transforms the node source applying the stylesheet imported by importstylesheet(). the created fragment will be owned by the
specified output document. nsidomdocumentfragment transformtofragment( in nsidomnode source, in nsidomdocument output ); parameters source the node to be transformed. output the document to own the returned document fragment. return value a documentfragment containing the resulting transform. ...
nsIXULTemplateBuilder
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 builder that a new result is available. the builder will add this result to the set of results. the query node that the new result applies to must be
specified using the aquerynode parameter. the builder will apply the rules associated with the query to the new result, unless a result with the same id from an earlier query supersedes it, and the result's rulematched() method will be called if it matches. void addresult( in nsixultemplateresult aresult, in nsidomnode aquerynode ); parameters aresult the result to add. aquerynode the query to which t...
... builder. void removeresult( in nsixultemplateresult aresult ); parameters aresult the result to remove errors throws ns_error_null_pointer if aresult is null replaceresult() inform the template builder that one result should be replaced with another. both the old result (aoldresult) and the new result (anewresult) must have the same id. the query node that the new result applies to must be
specified using the aquerynode parameter. this method is expected to have the same effect as calling both removeresult for the old result and addresult for the new result. void replaceresult( in nsixultemplateresult aoldresult, in nsixultemplateresult anewresult, in nsidomnode aquerynode ); parameters aoldresult the old result. anewresult the new result. aquerynode the query that the new result appl...
...sult getresultforid( in astring aid ); parameters aid the id to return the result for return value the result for the given id. getresultforcontent() retrieves the result corresponding to a generated element, or null is there isn't one. nsixultemplateresult getresultforcontent( in nsidomelement aelement ); parameters acontent element to result the result of return value the result for the
specified element. hasgeneratedcontent() determines whether or not the node has content generated for it. this method is intended to be called only by the rdf query processor. if atag is set, the content must have a tag name that matches atag. atag may be ignored for builders that don't generate real dom content. boolean hasgeneratedcontent( in nsirdfresource anode, in nsiatom atag ); parameters anode...
...boolean hasgeneratedcontent( in nsirdfresource anode, in nsiatom atag ); parameters anode node to check. atag tag that must match. return value returns true if the node has content generated for it; otherwise returns false. addrulefilter() adds a rule filter for a given rule, which may be used for specialized rule filtering. any existing filter on the rule is removed. the default 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...
nsIXULTemplateQueryProcessor
iffer. for instance, when examining an xml source, an xml query processor might begin at the node referred by the reference variable and end at a list of that node's children. some queries may not need the reference variable if the syntax or the form of the data implies the value. for instance, a datasource that holds a table that can only produce one set of results. ...
...nd at a list of that node's children. some queries may not need the reference variable if the syntax or the form of the data implies the value. for instance, a datasource that holds a table that can only produce one set of results. the reference variable may be
specified in a template by setting the "container" attribute on the <template> element to the variable to use. the member variable may be
specified in a similar way using the "member" attribute, or it may be
specified in the first <action> body in the template as the value of a uri attribute on an element. a breadth-first search of the first action is performed to find this element. if un
specified, the default value of the reference variable is ?uri. for example, a query might have the following syntax: (?id, ?name, ?url) from bookmarks wher...
...e the value to assign. exceptions thrown ns_error_unexpected if generateresults() has already been called. compareresults() compare two results to determine their order, used when sorting results. this method should return -1 when the left result is less than the right, 0 if both are equivalent, and 1 if the left is greater than the right. the comparison should only consider the values for the
specified variable. if the comparison variable is null, the results may be sorted in a natural order, for instance, based on the order the data in stored in the datasource. this method must only be called with results that were created by this query processor. print32 compareresults( in nsixultemplateresult aleft, in nsixultemplateresult aright, in nsiatom avar, in unsigned long asorthints ); para...
...tasource datasource for the data. aref context reference value used as a starting point. aquery the compiled query returned from query compilation. return value an enumerator of nsixultemplateresult objects as the results. exceptions thrown ns_error_invalid_arg if aquery is invalid. getdatasource() retrieve the datasource to use for the query processor. the list of datasources in a template is
specified using the datasources attribute as a space separated list of uris. this list is processed by the builder and supplied to the query processor in the adatasources array as a list of nsiuri objects or nsidomnode objects. this method may return an object corresponding to these uris and the builder will supply this object to other query processor methods. for example, for an xml source, the datasource...
Mail composition back end
ered either via smtp or nntp services. you also have the ability to save rfc822 files to disk, should you need this data for some reason. included in this functionality is the code to copy the messages to the appropriate locations after delivery (i.e. a "sent" folder) as well as the ability to store messages for features like "drafts" and "templates". several (but not all) of these interfaces are
specified in idl. this will change in the coming weeks and allow for developers to write javascript to take advantage of the back end services. also, i will talk about some features though they may not be complete as of yet. i will try to make comments for these exceptions. sending messages the primary responsibility of the back end is for the creation and sending of rfc822 messages.
...s document) nsimsgsend the following describes the methods of the nsimsgsend interface. all of these methods are asynchronous operations. createandsendmessage the createandsendmessage method will create an rfc822 message and send it all in one operation as well as providing the ability to save disk files for later use. the mode of delivery can also be
specified for the "send later", "drafts" and "templates" operations. (note: this method could easily be broken in to a few different calls. currently, this method does several functions depending on the arguments passed in, but this could easily lead to confusion. this is something that very well may change as time allows). ns_imethod createandsendmessage( nsieditorshell ...
...ttachments are provided externally. const struct nsmsgattachmentdata *attachments, - subsequent attachments are provided as urls to load, described in the nsmsgattachmentdata structures. const struct nsmsgattachedfile *preloaded_attachments, - attachments that are already locally stored on disk (note: both attachments and preloaded_attachments cannot be
specified on a single call void *relatedpart /* nsmsgsendpart */, - a related part for multipart related operations nsimsgsendlistener **alistenerarray) = 0; - an array of listeners for the send operation. this can be nsnull if you want to do the delivery operation "blind" sendmessagefile the sendmes...
... the setting for getfcc() is set to true, the copy operation is automatically performed after a successful send operation. drafts saving a message as a draft is controlled by the "nsmsgdelivermode mode" argument of the createandsendmessage and sendmessagefile methods. if the caller passes in nsmsgsaveasdraft, the file created or passed in will be stored as a draft in the user
specified "drafts" folder. templates like drafts, saving a message as a template is controlled by the "nsmsgdelivermode mode" argument of the createandsendmessage and sendmessagefile methods. if the caller passes in nsmsgsaveastemplate, the file created or passed in will be stored as a draft in the user
specified "templates" folder. send later developers also hav...
ArrayType
returns a new ctype representing an array data type. ctype arraytype() type[ length] ); parameters type: it represents the type of the elements or variable which is going to be present in an array length optional it denotes the number of entries present in an array or the number of elements that an array should contain. if you don't specify this parameter, the array's length is un
specified. return value a ctype represents the newly declared array type. exceptions thrown typeerror type is not a ctype, or type.size is undefined.if the length is specifed but if it is not a valid one,then it is also thrown rangeerror the size of the resulting array can't be represented as both a size_t and as a javascript number. properties property type description ...
...d one,then it is also thrown rangeerror the size of the resulting array can't be represented as both a size_t and as a javascript number. properties property type description elementtype ctype the data type of the elements in an array type. read only. length number the number of elements in the array, or undefined if the array type doesn't have a
specified length. read only. properties inherited from ctype these properties are available on all ctype objects. property type description name string the type's name. read only. for primitive types, this is just the name of the corresponding c type. for structure and opaque pointer types, this is simply the string that was passed to the constructor. for ot...
... length of the array. read only. in addition, each element in the array can be referenced by index using standard bracket notation, such as myarray[index]. properties inherited from cdata property type description constructor ctype the data type of the cdata object, as a ctype. read only. note: this is never ctypes.void_t or an array type with an un
specified length. value object the javascript equivalent of the cdata object's value. this will throw a typeerror exception if the value can't be converted. arraytype cdata method_overview cdata addressofelement(idx) methods inherited from cdata cdata address() string tosource() string tostring() arraytype cdata methods addresso...
...is will throw a typeerror exception if the value can't be converted. arraytype cdata method_overview cdata addressofelement(idx) methods inherited from cdata cdata address() string tosource() string tostring() arraytype cdata methods addressofelement() returns a new cdata object of the appropriate pointer type, whose value points to the
specified array element on which the method was called. cdata addressofelement( idx ); parameters idx a numeric value indicating the offset into the array of the element just to return a pointer. if this value isn't a valid javascript number that's also a valid index into the array, a typeerror exception is thrown. return value a new cdata object pointing to the
specified element. the type of ...
Background Tasks API - Web APIs
ee that every pass through the event loop (or even every screen update cycle) will include any idle callbacks being executed; if the event loop uses all available time, you're out of luck (again, unless you've used a timeout). idle callbacks should do their best not to overrun the time allotted. while the browser, your code, and the web in general will continue to run normally if you go over the
specified time limit (even if you go way over it), the time restriction is intended to ensure that you leave the system enough time to finish the current pass through the event loop and get on to the next one without causing other code to stutter or animation effects to lag. currently, timeremaining() has an upper limit of 50 milliseconds, but in reality you will often have less time than that, since the e...
...urrent event loop pass like the true requestidlecallback(), it does at least limit the callback to no more than 50 milliseconds of run time per pass. the implementation of our shim for cancelidlecallback() is much simpler: window.cancelidlecallback = window.cancelidlecallback || function(id) { cleartimeout(id); } if cancelidlecallback() isn't defined, this creates one which simply passes the
specified callback id through to cleartimeout(). now your code will work even on browsers that don't support the background tasks api, albeit not as efficiently. interfaces the background tasks api adds only one new interface: idledeadline an object of this type is passed to the idle callback to provide an estimate of how long the idle period is expected to last, as well as whether or not the callba...
... logfragment isn't null), we append it to the log element using element.appendchild() and set logfragment to null so we don't add it again. if the log was scrolled to the end when we started, we make sure it still is. then we set statusrefreshscheduled to false to indicate that we've handled the refresh and that it's safe to request a new one. adding text to the log the log() function adds the
specified text to the log. since we don't know at the time log() is called whether or not it's safe to immediately touch the dom, we will cache the log text until it's safe to update. above, in the code for updatedisplay(), you can find the code that actually adds the logged text to the log element when the animation frame is being updated. function log(text) { if (!logfragment) { logfragment = do...
...e getrandomintinclusive() function that's provided as an example in the documentation for math.random() to get the number of tasks to create. then we start a loop to create the actual tasks. for each task, we create an object, taskdata, which includes two properties: count is the number of strings to output into the log from the task. text is the text to output to the log the number of times
specified by count. each task is then enqueued by calling enqueuetask(), passing in logtaskhandler() as the handler function and the taskdata object as the object to pass into the function when it's called. result below is the actual functioning result of the code above. try it out, play with it in your browser's developer tools, and experiment with using it in your own code. specifications ...
DocumentOrShadowRoot.elementFromPoint() - Web APIs
if the element at the given point is anonymous or xbl generated content, such as a textbox's scroll bars, then the first non-anonymous ancestor element (for example, the textbox) is returned. elements with pointer-events set to none will be ignored, and the element below it will be returned. ...
...erated content, such as a textbox's scroll bars, then the first non-anonymous ancestor element (for example, the textbox) is returned. elements with pointer-events set to none will be ignored, and the element below it will be returned. if the method is run on another document (like an <iframe>'s subdocument), the coordinates are relative to the document where the method is being called. if the
specified point is outside the visible bounds of the document or either coordinate is negative, the result is null. if you need to find the specific position inside the element, use document.caretpositionfrompoint(). syntax const element = document.elementfrompoint(x, y) parameters x the horizontal coordinate of a point, relative to the left edge of the current viewport. y the vertical coordinate...
...o find the specific position inside the element, use document.caretpositionfrompoint(). syntax const element = document.elementfrompoint(x, y) parameters x the horizontal coordinate of a point, relative to the left edge of the current viewport. y the vertical coordinate of a point, relative to the top edge of the current viewport. ...
...ue the topmost element object located at the
specified coordinates. example this example creates two buttons which let you set the current color of the paragraph element located under the coordinates (2, 2). javascript function changecolor(newcolor) { elem = document.elementfrompoint(2, 2); elem.style.color = newcolor; } the changecolor() method simply obtains the element located at the
specified point, then sets that element's current foreground color property to the color
specified by the newcolor parameter. html <p id="para1">some text here</p> <button onclick="changecolor('blue');">blue</button> <button onclick="changecolor('red');">red</button> the html provides the paragraph whose color will be affected, as well as two buttons: one to change the color to blue, and another to cha...
EffectTiming.fill - Web APIs
the web animations api's effecttiming dictionary's fill property specifies a fill mode, which defines how the element to which the animation is applied should look when the animation sequence is not actively running, such as before the time
specified by iterationstart or after animation's end time. for example, setting fill to "none" means the animation's effects are not applied to the element if the current time is outside the range of times during which the animation is running, while "forwards" ensures that once the animation's end time has been passed, the element will continue to be drawn in the state it was in at its last rendered frame. note that authors are discouraged from using fill modes to persist the effect of an animation indefinitely. see the alternatives to fill modes s...
...ument.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 indefinitely, 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 indefinitely 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 overlap, the browser is required to remove overlapped animations which can lead to surprising results in some cases. rather than using fill modes to persist an animation, it is often simpler...
...is is because animations take priority in the css cascade over normal author styles. in order to avoid leaking memory when many filling animations overlap, the browser is required to remove overlapped animations which can lead to surprising results in some cases. rather than using fill modes to persist an animation, it is often simpler to set the final value of the animation effect directly in
specified style: elem.animate({ transform: 'translatey(100px)' }, 200).finished.then(() => { elem.style.transform = 'translatey(100px)'; }); alternatively, it may be simpler still to set the final value in
specified style before triggering the animation and then animate from the start value. this is the approach used in flip animation. elem.style.transform = 'translatey(100px)'; elem.animate({ transf...
...mode temporarily to capture the final value of an animation before canceling it. elem.addeventlistener('click', async evt => { const animation = elem.animate( { transform: `translate(${evt.clientx}px, ${evt.clienty}px)` }, { duration: 800, fill: 'forwards' } ); await animation.finished; // commitstyles will record the style up to and including `animation` and // update elem’s
specified style with the result. animation.commitstyles(); animation.cancel(); }); specifications specification status comment web animationsthe definition of 'fill' in that specification. working draft editor's draft. ...
Element.msZoomTo() - 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 mszoomto method scrolls and/or zooms an element to its
specified coordinate with animation. ...
...ion. zoomed elements can expose their zoom level through mscontentzoom (ie. scrolltop/left). the zoom level can be reset with mszoomto. this proprietary method is specific to internet explorer and microsoft edge. syntax element.mszoomto(arguments); parameters args[in] type: mszoomtooptions contentx[in]: the x-coordinate of the content that is the target of the scroll/zoom. if no value is
specified, defaults to the current centerpoint of visible content, horizontally. contenty[in]: the y-coordinate of the content that is the target of the scroll/zoom. if no value is
specified, defaults to the current centerpoint of visible content, vertically. viewportx[in]: the alignment point of the viewport. the scroll/zoom operation attempts to align this point with the contentx point. center: defa...
...alignment point of the viewport. the scroll/zoom operation attempts to align this point with the contentx point. center: default. aligns the horizontal center of the viewport to the element's contentx value. left: aligns the left-most point of the viewport to the element's contentx value. right: aligns the right-most point of the viewport to the element's contentx value. integer: aligns the
specified x-coordinate of the viewport to the element's contentx value. viewporty[in]: the alignment point of the viewport. the scroll/zoom operation attempts to align this point with the contenty point. middle: default. aligns the vertical center of the viewport to the element's contenty value. top: aligns the top-most point of the viewport to the element's contenty value. bottom: aligns the bott...
...e alignment point of the viewport. the scroll/zoom operation attempts to align this point with the contenty point. middle: default. aligns the vertical center of the viewport to the element's contenty value. top: aligns the top-most point of the viewport to the element's contenty value. bottom: aligns the bottom-most point of the viewport to the element's contenty value. integer: aligns the
specified y-coordinate of the viewport to the element's contenty value. scalefactor[in]: floating-point. the scale factor (mscontentzoomfactor) to zoom to. if no value is
specified, defaults to the current zoom level (no additional zoom occurs).this argument is ignored if the element is not zoomable. animate[in]: the type of animation to use. default: uses the default animation. none: no animation...
Element.querySelector() - Web APIs
the queryselector() method of the element interface returns the first element that is a descendant of the element on which it is invoked that matches the
specified group of selectors. syntax element = baseelement.queryselector(selectors); parameters selectors a group of selectors to match the descendant elements of the element baseelement against; this must be valid css syntax, or a syntaxerror exception will occur. the first element found which matches 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 th...
... 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 specific values of an attribute in this first example, the first <style> element which either has no type or has type "text/css" in the html document body is returned: var el = document.body.queryselector("style[type='text/css'], style:not([type])"); the entire hierarchy counts this example demons...
... html <div> <h5>original content</h5> <p> inside paragraph <span>inside span</span> inside paragraph </p> </div> <div> <h5>output</h5> <div id="output"></div> </div> javascript var baseelement = document.queryselector("p"); document.getelementbyid("output").innerhtml = (baseelement.queryselector("div span").innerht...
... more examples see document.queryselector() for additional examples of the proper format for the selectors. specifications specification status comment domthe definition of 'queryselector()' in that specification. living standard selectors api level 2the definition of 'queryselectorall()' in that specification. obsolete s...
FeaturePolicy.allowsFeature() - Web APIs
origin name optional an origin url to check the feature on. ...
... origin name optional an origin url to check the feature on. ...
... origin name optional an origin url to check the feature on. ...
... origin name optional an origin url to check the feature on. if it is omitted the default origin is used. return value a boolean that is true if and only if the feature is allowed. ...
FileSystemDirectoryEntry.getDirectory() - Web APIs
filesystemdirectoryentry has been created. the method receives a single parameter: the filesystemdirectoryentry object representing the directory in question. errorcallback optional a method to be called if an error occurs. receives as its sole input parameter a fileerror object describing the error which occurred. return value undefined. errors if an error occurs and an errorcallback was
specified, it gets called with a single parameter: a fileerror object describing the error. the fileerror.code specifies what type of error occurred, as follows: fileerror.not_found_err the create option was not
specified (or was
specified as false), and the directory doesn't exist. fileerror.path_exists_err the create and exclusive options were both true, indicating that the directory should be crea...
... filesystemflags the options parameter is an object which is based on the filesystemflags dictionary; it provides flags which make it possible to adjust the behavior of the getdirectory() method. ...
...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. example in this example, a function is presented whose job it is to locate within a user's app data directory a json file containing a user dictionary for a
specified language, then load that dictionary. let dictionary = null; function loaddictionaryforlanguage(appdatadirentry, lang) { dictionary = null; appdatadirentry.getdirectory("dictionaries", {}, function(direntry) { direntry.getfile(lang + "-dict.json", {}, function(fileentry) { fileentry.file(function(dictfile)) { let reader = new filereader(); reader.addeventlistener(...
...the success callback for this takes the resulting directory entry object and calls getfile() to get a filesystemfileentry object representing the dictionary 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 pass...
FileSystemDirectoryEntry.getFile() - Web APIs
called once the filesystemfileentry has been created. the method receives a single parameter: the filesystemfileentry object representing the file in question. errorcallback optional a method to be called if an error occurs. receives as its sole input parameter a fileerror object describing the error which occurred. return value undefined. errors if an error occurs and an errorcallback was
specified, it gets called with a single parameter: a fileerror object describing the error. the {domxref("fileerror.code")}} specifies what type of error occurred, as follows: fileerror.not_found_err the create option was not
specified (or was
specified as false), and the file doesn't exist. fileerror.path_exists_err the create and exclusive options were both true, indicating that the file should be ...
... filesystemflags the options parameter is an object which is based on the filesystemflags dictionary; it provides flags which make it possible to adjust the behavior of the getfile() method. ...
...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. example in this example, a function is presented whose job it is to locate within a user's app data directory a json file containing a user dictionary for a
specified language, then load that dictionary. let dictionary = null; function loaddictionaryforlanguage(appdatadirentry, lang) { dictionary = null; appdatadirentry.getdirectory("dictionaries", {}, function(direntry) { direntry.getfile(lang + "-dict.json", {}, function(fileentry) { fileentry.file(function(dictfile)) { let reader = new filereader(); reader.addeventlistener(...
...the success callback for this takes the resulting directory entry object and calls getfile() to get a filesystemfileentry object representing the dictionary 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 pass...
HTMLCanvasElement - Web APIs
line="middle">htmlcanvaselement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlcanvaselement.height the height html attribute of the <canvas> element is a positive integer reflecting the number of logical pixels (or rgba values) going down one column of the canvas. when the attribute is not
specified, or if it is set to an invalid value, like a negative, the default value of 150 is used. if no [separate] css height is assigned to the <canvas>, then this value will also be used as the height of the canvas in the length-unit css pixel. htmlcanvaselement.width the width html attribute of the <canvas> element is a positive integer reflecting the number of logical pixels (or rgba values) going a...
... the default value of 150 is used. if no [separate] css height is assigned to the <canvas>, then this value will also be used as the height of the canvas in the length-unit css pixel. htmlcanvaselement.width the width html attribute of the <canvas> element is a positive integer reflecting the number of logical pixels (or rgba values) going across one row of the canvas. when the attribute is not
specified, or if it is set to an invalid value, like a negative, the default value of 300 is used. if no [separate] css width is assigned to the <canvas>, then this value will also be used as the width of the canvas in the length-unit css pixel. htmlcanvaselement.mozopaque is a boolean reflecting the moz-opaque html attribute of the <canvas> element. it lets the canvas know whether or not translucenc...
... supported. a drawing context lets you draw on the canvas. calling getcontext with "2d" returns a canvasrenderingcontext2d object, whereas calling it with "webgl" (or "experimental-webgl") returns a webglrenderingcontext object. this context is only available on browsers that implement webgl. htmlcanvaselement.todataurl() returns a data-url containing a representation of the image in the format
specified by the type parameter (defaults to png). the returned image is in a resolution of 96dpi. htmlcanvaselement.toblob() creates a blob object representing the image contained in the canvas; this file may be cached on the disk or stored in memory at the discretion of the user agent. htmlcanvaselement.transfercontroltooffscreen() transfers control to an offscreencanvas object, either on the main ...
...le may be cached on the disk or stored in memory at the discretion of the user agent. htmlcanvaselement.transfercontroltooffscreen() transfers control to an offscreencanvas object, either on the main thread or on a worker. obsolete methods htmlcanvaselement.mozgetasfile() returns a file object representing the image contained in the canvas; this file is a memory-based file, with the
specified name. if type is not
specified, the image type is image/png. events listen to these events using addeventlistener(). webglcontextcreationerror fired if the user agent is unable to create a webglrenderingcontext or webgl2renderingcontext context. webglcontextlost fired if the user agent detects that the drawing buffer associated with a webglrenderingcontext or webgl2renderingcontext objec...
HTMLFormElement - Web APIs
ls belonging to this form element. htmlformelement.lengthread only a long reflecting the number of controls in the form. htmlformelement.name a domstring reflecting the value of the form's name html attribute, containing the name of the form. htmlformelement.method a domstring reflecting the value of the form's method html attribute, indicating the http method used to submit the form. only
specified values can be set. htmlformelement.target a domstring reflecting the value of the form's target html attribute, indicating where to display the results received from submitting the form. htmlformelement.action a domstring reflecting the value of the form's action html attribute, containing the uri of a program that processes the information submitted by the form. htmlformelement.encoding or ...
...he form. htmlformelement.action a domstring reflecting the value of the form's action html attribute, containing the uri of a program that processes the information submitted by the form. htmlformelement.encoding or htmlformelement.enctype a domstring reflecting the value of the form's enctype html attribute, indicating the type of content that is used to transmit the form to the server. only
specified values can be set. the two properties are synonyms. htmlformelement.acceptcharset a domstring reflecting the value of the form's accept-charset html attribute, representing the character encoding that the server accepts. htmlformelement.autocomplete a domstring reflecting the value of the form's autocomplete html attribute, indicating whether the controls in this form can have their values au...
... invalid if the event is not canceled. it is up to the programmer to decide how to respond to 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 ...
...bject to obtain an htmlformelement object, you can use a css selector with queryselector(), or you can get a list of all of the forms in the document using its forms property. document.forms returns an array of htmlformelement objects listing each of the forms on the page. you can then use any of the following syntaxes to get an individual form: document.forms[index] returns the form at the
specified index into the array of forms. document.forms[id] returns the form whose id is id. document.forms[name] returns the form whose name attribute's value is name. accessing the form's elements you can access the list of the form's data-containing elements by examining the form's elements property. this returns an htmlformcontrolscollection listing all of the form's user data entry elements, bo...
HTMLImageElement.srcset - Web APIs
the htmlimageelement property srcset is a string which identifies one or more image candidate strings, separated using commas (,) each specifying image resources to use under given circumstances. each image candidate string contains an image url and an optional width or pixel density descriptor that indicates the conditions under which that candidate should be used instead of the image
specified by the src property. the srcset property, along with the sizes property, are a crucial component in designing responsive web sites, as they can be used together to make pages that use appropriate images for the rendering situation. syntax htmlimageelement.srcset = imagecandidatestrings; let srcset = htmlimageelement.srcset; value a usvstring containing a comma-separated list of one or more image cand...
...descriptor, are ignored; this includes both leading and trailing space, as well as space before or after each comma. if the condition descriptor is not provided (in other words, the image candidate provides only a url), the candidate is used as the fallback if none of the other candidates match. ...
... alternatively, you can use a pixel density descriptor, which specifies the condition in which the corresponding image resource should be used as the display's pixel density. ...
...le that should be used in all other cases. notice that the candidates may use different image types. for more information on what image formats are available for use in the <img> element, see image file type and format guide. example html the html below indicates that the default image is the 200 pixel wide version of the clock image we use in several places throughout our documentation. also
specified by the srcset attribute is that the 200-pixel version should be used for 1x displays while the 400-pixel version should be used for 2x displays. <div class="box"> <img src="/files/16797/clock-demo-200px.png" alt="clock" srcset="/files/16864/clock-demo-200px.png 1x, /files/16797/clock-demo-400px.png 2x"> </div> css the css simply specifies that the image and its surrounding box...
Timing element visibility with the Intersection Observer API - Web APIs
, our needs are simple: each ad is represented by an object with three properties: a background color (bgcolor), a title (title), and a body text string (body). then we define several variables: adbox this will be set to the element that represents the ad. for new ads being appended to the page, this is created using document.createelement(). when replacing an existing ad, this is set to the
specified ad element (replacebox). title will hold the <h2> element representing the ad's title. body will hold the <p> representing the ad's body text. timerelem will hold the <div> element which contains the time the ad has been visible so far. a random ad is selected by computing math.floor(math.random() * ads.length); the result is a value between 0 and one less than the number of ads. the corr...
...> element representing the ad's title. body will hold the <p> representing the ad's body text. timerelem will hold the <div> element which contains the time the ad has been visible so far. a random ad is selected by computing math.floor(math.random() * ads.length); the result is a value between 0 and one less than the number of ads. the corresponding ad is now known as adbox. ...
...the ad's new <div> element is created and its properties established by setting its class name to "ad". next, the ad title element is created, along with the body and the visibility timer; these are an <h2>, a <p>, and a <div> element, respectively. these elements are appended to the adbox element. ...
...ent. the ad's new <div> element is created and its properties established by setting its class name to "ad". next, the ad title element is created, along with the body and the visibility timer; these are an <h2>, a <p>, and a <div> element, respectively. these elements are appended to the adbox element. after that, the code paths converge once again. the ad's background color is set to the value
specified in the new ad's record, and elements' classes and contents are set appropriately as well. next, it's time to set up the custom data properties to track the ad's visibility data by setting adbox.dataset.totalviewtime and adbox.dataset.lastviewstarted to 0. finally, we set the id of the <div> which will show the timer we'll present in the ad to show how long it's been visible, giving it the class...
MediaDevices.getDisplayMedia() - Web APIs
rowsing instance is not permitted access to screen sharing. notfounderror no sources of screen video are available for capture. notreadableerror the user selected a screen, window, tab, or other source of screen data, but a hardware or operating system level error or lockout occurred, preventing the sharing of the selected source. overconstrainederror after creating the stream, applying the
specified constraints fails because no compatible stream could be generated. typeerror the
specified constraints include constraints which are not permitted when calling getdisplaymedia(). these unsupported constraints are advanced and any constraints which in turn have a member named min or exact. usage notes privacy and security because getdisplaymedia() could be used in nefarious ways, it can be a...
...unsupported constraints are advanced and any constraints which in turn have a member named min or exact. usage notes privacy and security because getdisplaymedia() could be used in nefarious ways, it can be a source of significant privacy and security concerns. for that reason, the specification details measures browsers are required to take in order to fully support getdisplaymedia(). the
specified constraints can't be used to limit the options available to the user. instead, they must be applied after the user chooses a source, in order to generate output that matches the constraints. the go-ahead permission to use getdisplaymedia() cannot be persisted for reuse. the user must be prompted for permission every time. the call to getdisplaymedia() must be made from code which is running in ...
... running in response to a user action, such as in an event handler. browsers are encouraged to provide a warning to users about sharing displays or windows that contain browsers, and to keep a close eye on what other content might be getting captured and shown to other users. example in the example below, a startcapture() method is created which initiates screen capture given a set of options
specified by the displaymediaoptions parameter. the options are
specified in the form of a mediastreamconstraints object which specifies the preferred stream configuration and the display surface from which video is to be captured. async function startcapture(displaymediaoptions) { let capturestream = null; try { capturestream = await navigator.mediadevices.getdisplaymedia(displaymediaoptions); ...
...the stream is then returned to the caller for use, perhaps for adding to a webrtc call using rtcpeerconnection.addtrack() to add the video track from the stream. specifications specification status comment screen capturethe definition of 'mediadevices.getdisplaymedia()' in that specification. working draft initial definition ...
MediaDevices.getUserMedia() - Web APIs
ng getusermedia(). syntax var promise = navigator.mediadevices.getusermedia(constraints); parameters constraints a mediastreamconstraints object specifying the types of media to request, along with any requirements for each type. the constraints parameter is a mediastreamconstraints object with two members: video and audio, describing the media types requested. either or both must be
specified. if the browser cannot find all media tracks with the
specified types that meet the constraints given, then the returned promise is rejected with notfounderror. the following requests both audio and video without any specific requirements: { audio: true, video: true } if true is
specified for a media type, the resulting stream is required to have that type of track in it. if one cannot be i...
...ess to the hardware device, and no hardware issues occurred that would cause a notreadableerror, some problem occurred which prevented the device from being used. notallowederror one or more of the requested source devices cannot be used at this time. this will happen if the browsing context is insecure (that is, the page was loaded using http rather than https). it also happens if the user has
specified that the current browsing instance is not permitted access to the device, the user has denied access for the current session, or the user has denied all access to user media devices globally. on browsers that support managing media permissions with feature policy, this error is returned if feature policy is not configured to allow access to the input source(s). older versions of the specificatio...
...or the user has denied all access to user media devices globally. on browsers that support managing media permissions with feature policy, this error is returned if feature policy is not configured to allow access to the input source(s). older versions of the specification used securityerror for this instead; securityerror has taken on a new meaning. notfounderror no media tracks of the type
specified were found that satisfy the given constraints. notreadableerror although the user granted permission to use the matching devices, a hardware error occurred at the operating system, browser, or web page level which prevented access to the device. overconstrainederror the
specified constraints resulted in no candidate devices which met the criteria requested. the error is an object of type over...
...his error can occur even when the user has not yet granted permission to use the underlying device, it can potentially be used as a fingerprinting surface. securityerror user media support is disabled on the document on which getusermedia() was called. the mechanism by which user media support is enabled and disabled is left up to the individual user agent. typeerror the list of constraints
specified is empty, or has all constraints set to false. this can also happen if you try to call getusermedia() in an insecure context, since navigator.mediadevices is undefined in an insecure context. privacy and security as an api that may involve significant privacy concerns, getusermedia()'s specification lays out a wide array of privacy and security requirements that browsers are obligated to meet.
Recording a media element - Web APIs
iew" width="160" height="120" autoplay muted></video> </div> we present our main interface in two columns. on the left is a start button and a <video> element which displays the video preview; this is the video the user's camera sees. note that the autoplay attribute is used so that as soon as the stream starts to arrive from the camera, it immediately gets displayed, and the muted attribute is
specified to ensure that the sound from the user's microphone isn't output to their speakers, causing an ugly feedback loop. <div class="right"> <div id="stopbutton" class="button"> stop </div> <h2>recording</h2> <video id="recording" width="160" height="120" controls></video> <a id="downloadbutton" class="button"> download </a> </div> on the right we see a stop button and the <video...
...sed later. function log(msg) { logelement.innerhtml += msg + "\n"; } the log() function is used to output text strings to a <div> so we can share information with the user. not very pretty but it gets the job done for our purposes. function wait(delayinms) { return new promise(resolve => settimeout(resolve, delayinms)); } the wait() function returns a new promise which resolves once the
specified number of milliseconds have elapsed. it works by using an arrow function which calls window.settimeout(), specifying the promise's resolution handler as the timeout handler function. that lets us use promise syntax when using timeouts, which can be very handy when chaining promises, as we'll see later. starting media recording the startrecording() function handles starting the recording process...
...rder.onerror = event => reject(event.name); }); let recorded = wait(lengthinms).then( () => recorder.state == "recording" && recorder.stop() ); return promise.all([ stopped, recorded ]) .then(() => data); } startrecording() takes two input parameters: a mediastream to record from and the length in milliseconds of the recording to make. we always record no more than the
specified number of milliseconds of media, although if the media stops before that time is reached, mediarecorder automatically stops recording as well. line 2 creates the mediarecorder that will handle recording the input stream. line 3 creates an empty array, data, which will be used to hold the blobs of media data provided to our ondataavailable event handler. line 5 sets up the handler for the ...
...the recorder and the number of seconds it will be recording. lines 9-12 creates a new promise, named stopped, which is resolved when the mediarecorder's onstop event handler is called, and is rejected if its onerror event handler is called. the rejection handler receives as input the name of the error that occurred. lines 14-16 creates a new promise, named recorded, which is resolved when the
specified number of milliseconds have elapsed. upon resolution, it stops the mediarecorder if it's recording. lines 18-22 these lines create a new promise which is fulfilled when both of the two promises (stopped and recorded) have resolved. once that resolves, the array data is returned by startrecording() to its caller. stopping the input stream the stop() function simply stops the input media: fun...
Notification - Web APIs
ons displayed. granted — the user accepts having notifications displayed. default — the user choice is unknown and therefore the browser will act as if the value were denied. notification.maxactions read only instance properties these properties are available only on instances of the notification object. notification.actions read only the actions array of the notification as
specified in the constructor's options parameter. notification.badge read only the url of the image used to represent the notification when there is not enough space to display the notification itself. notification.body read only the body string of the notification as
specified in the constructor's options parameter. notification.data read only returns a structured clone of the notification’s da...
... url of the image used to represent the notification when there is not enough space to display the notification itself. notification.body read only the body string of the notification as
specified in the constructor's options parameter. notification.data read only returns a structured clone of the notification’s data. notification.dir read only the text direction of the notification as
specified in the constructor's options parameter. notification.lang read only the language code of the notification as
specified in the constructor's options parameter. ...
...notification.data read only returns a structured clone of the notification’s data. notification.dir read only the text direction of the notification as
specified in the constructor's options parameter. notification.lang read only the language code of the notification as
specified in the constructor's options parameter. notification.tag read only the id of the notification (if any) as
specified in the constructor's options parameter. notification.icon read only the url of the image used as an icon of the notification as
specified in the constructor's options parameter. notification.image read only the url of an image to be displayed as part of the notification, as
specified in the constructor's options parameter. notification.renotify read only specifies whether the user should...
...er than closing automatically. notification.silent read only specifies whether the notification should be silent — i.e., no sounds or vibrations should be issued, regardless of the device settings. notification.timestamp read only specifies the time at which a notification is created or applicable (past, present, or future). notification.title read only the title of the notification as
specified in the first parameter of the constructor. notification.vibrate read only specifies a vibration pattern for devices with vibration hardware to emit. event handlers notification.onclick a handler for the click event. it is triggered each time the user clicks on the notification. notification.onclose a handler for the close event. it is triggered when the user closes the notification. n...
ParentNode.querySelector() - Web APIs
if you need all the elements matching the selector list, use queryselectorall() instead. note: this method is implemented as document.queryselector(), documentfragment.queryselector() and element.queryselector(). syntax element = parentnode.queryselector(selectors); parameters selectors a domstring containing one or more selectors to match against. ...
...tax element = parentnode.queryselector(selectors); parameters selectors a domstring containing one or more selectors to match against. this string must be a valid compound selector list supported by the browser; if it's not, a syntaxerror exception is thrown. see locating dom elements using selectors for more information about using selectors to identify elements. ...
... specifications specification status comment domthe definition of 'parentnode.queryselector()' in that specification. ...
...re not part of standard css syntax must be escaped using a backslash character. since javascript also uses backspace escaping, special care must be taken when writing string literals using these characters. see escaping special characters for more information. 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. specifications specification status comment domthe definition of 'parentnode.queryselector()' in that specification. living standard living standard selectors api level 2the definition of 'p...
RTCPeerConnection() - Web APIs
nal specifies how to handle negotiation of candidates when the remote peer is not compatible with the sdp bundle standard. this must be one of the values from the enum rtcbundlepolicy. if this value isn't included in the dictionary, "balanced" is assumed. certificates optional an array of objects of type rtccertificate which are used by the connection for authentication. ...
... icecandidatepoolsize optional an unsigned 16-bit integer value which specifies the size of the prefetched ice candidate pool. the default value is 0 (meaning no candidate prefetching will occur). ...
...start trying to connect, so that they're already available for inspection when rtcpeerconnection.setlocaldescription() is called. changing the size of the ice candidate pool may trigger the beginning of ice gathering. iceservers optional an array of rtciceserver objects, each describing one server which may be used by the ice agent; these are typically stun and/or turn servers. if this isn't
specified, the connection attempt will be made with no stun or turn server available, which limits the connection to local peers. icetransportpolicy optional the current ice transport policy; this must be one of the values from the rtcicetransportpolicy enum. if this isn't
specified, "all" is assumed. peeridentity optional a domstring which specifies the target peer identity for the rtcpeerconnection. ...
...nect to a remote peer unless it can successfully authenticate with the given name. rtcpmuxpolicy optional the rtcp mux policy to use when gathering ice candidates, in order to support non-multiplexed rtcp. the value must be one of those from the rtcrtcpmuxpolicy enum. the default is "require". return value a newly-created rtcpeerconnection object, configured as described by configuration, if
specified; otherwise, configured to appropriate basic defaults. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection()' in that specification. candidate recommendation initial definition. ...
RTCRtpSender.setStreams() - Web APIs
return value none. exceptions invalidstateerror the sender's connection is closed. description setstreams() is purely additive. it doesn't remove the track from any streams; it simply adds it to new ones. ...
... return value none. exceptions invalidstateerror the sender's connection is closed. description setstreams() is purely additive. it doesn't remove the track from any streams; it simply adds it to new ones. if you specify streams to which the track already belongs, that stream is unaffected. ...
...ams; it simply adds it to new ones. if you specify streams to which the track already belongs, that stream is unaffected. once the track has been added to all of the streams, renegotiation of the connection will be triggered by the negotiationneeded event being dispatched to the rtcpeerconnection to which the sender belongs. example this example adds all of an rtcpeerconnection's tracks to the
specified stream. function addtrackstostream(stream) { let senders = pc.getsenders(); senders.foreach((sender) => { if (sender.track && (sender.transport.state === connected)) { sender.setstreams(stream); } }); } after calling the rtcpeerconnection method getsenders() to get the list of the connection's senders, the addtrackstostream() function iterates over the list. for each sende...
... specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpsender.setstreams()' in that specification. candidate recommendation ...
WebGLRenderingContext.getUniformLocation() - Web APIs
n opaque identifier used to specify where in the gpu's memory that uniform variable is located. once you have the uniform's location, you can access the uniform itself using one of the other uniform access methods, passing in the uniform location as one of the inputs: getuniform() returns the value of the uniform at the given location. uniform[1234][fi][v]() sets the uniform's value to the
specified value, which may be a single floating point or integer number, or a 2-4 component vector
specified either as a list of values or as a float32array or int32array. uniformmatrix[234][fv]() sets the uniform's value to the
specified matrix, possibly with transposition. the value is represented as a sequence of glfloat values or as a float32array. the uniform itself is declared in the shader progr...
... name a domstring specifying the name of the uniform variable whose location is to be returned. the name can't have any whitespace in it, and you can't use this function to get the location of any uniforms starting with the reserved string "gl_", since those are internal to the webgl layer. ...
...orm name without the [0] suffix. e.g. the location returned for arrayuniform is equivalent to the one for arrayuniform[0]. the uniform name indexed with an integer. e.g. the location returned for arrayuniform[2] would point directly to the third entry of the arrayuniform uniform. return value a webgluniformlocation value indicating the location of the named variable, if it exists. if the
specified variable doesn't exist, null is returned instead. the webgluniformlocation is an opaque value used to uniquely identify the location in the gpu's memory at which the uniform variable is located. with this value in hand, you can call other webgl methods to access the value of the uniform variable. the webgluniformlocation type is compatible with the glint type when specifying the index or locat...
...tible with the glint type when specifying the index or location of a uniform attribute. errors the following errors may occur; to check for errors after getuniformlocation() returns, call geterror(). gl_invalid_value the program parameter is not a value or object generated by webgl. gl_invalid_operation the program parameter doesn't correspond to a glsl program generated by webgl, or the
specified program hasn't been linked successfully. example in this example, taken from the animatescene() method in the article a basic 2d webgl animation example, obtains the locations of three uniforms from the shading program, then sets the value of each of the three uniforms. gl.useprogram(shaderprogram); uscalingfactor = gl.getuniformlocation(shaderprogram, "uscalingfactor"); uglobalcolor = ...
A basic 2D WebGL animation example - Web APIs
square will get stretched out in one direction or the other. so we need to normalize these values. once the vertex array has been created, we create a new gl buffer to contain them by calling gl.createbuffer(). we bind the standard webgl array buffer reference to that by calling gl.bindbuffer() and then copy the vertex data into the buffer using gl.bufferdata(). the usage hint gl.static_draw is
specified, telling webgl that the data will be set only one time and never modified, but will be used repeatedly. this lets webgl consider any optimizations it can apply that may improve performance based on that information. with the vertex data now provided to webgl, we set vertexnumcomponents to the number of components in each vertex (2, since they're 2d vertexes) and vertexcount to the number of vert...
...d, desc.type); if (shader) { gl.attachshader(program, shader); } }); gl.linkprogram(program) if (!gl.getprogramparameter(program, gl.link_status)) { console.log("error linking shader program:"); console.log(gl.getprograminfolog(program)); } return program; } first, gl.createprogram() is called to create a new, empty, glsl program. then, for each shader in the
specified list of shaders, we call a compileshader() function to compile it, passing into it the id and type of the shader function to build. each of those objects includes, as mentioned before, the id of the <script> element the shader code is found in and the type of shader it is. the compiled shader is attached to the shader program by passing it into gl.attachshader(). we could go a step farther here...
... the source code is sent into the new shader by passing it into gl.shadersource(), and then the shader is compiled using gl.compileshader() compile errors are logged to the console. note the use of a template literal string to insert the correct shader type string into the message that gets generated. the actual erro...
...r); if (!gl.getshaderparameter(shader, gl.compile_status)) { console.log(`error compiling ${type === gl.vertex_shader ? "vertex" : "fragment"} shader:`); console.log(gl.getshaderinfolog(shader)); } return shader; } the code is fetched from the html document by obtaining the value of the text node contained within the <script> element with the
specified id. then a new shader of the
specified type is created using gl.createshader(). the source code is sent into the new shader by passing it into gl.shadersource(), and then the shader is compiled using gl.compileshader() compile errors are logged to the console. note the use of a template literal string to insert the correct shader type string into the message that gets generated. the actual error details are obtained by calling gl.ge...
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
the settimeout() method of the windoworworkerglobalscope mixin (and successor to window.settimeout()) sets a timer which executes a function or
specified piece of code once the timer expires. syntax var timeoutid = scope.settimeout(function[, delay, arg1, arg2, ...]); var timeoutid = scope.settimeout(function[, delay]); var timeoutid = scope.settimeout(code[, delay]); parameters function a function to be executed after the timer expires. code an alternative syntax that allows you to include a string instead of a function, which is compiled and executed when the timer expires. ...
... function a function to be executed after the timer expires. code an alternative syntax that allows you to include a string instead of a function, which is compiled and executed when the timer expires. this syntax is not recommended for the same reasons that make using eval() a security risk. delay optional the time, in milliseconds (thousandths of a second), the timer should wait before the
specified function or code is executed. if this parameter is omitted, a value of 0 is used, meaning execute "immediately", or more accurately, the next event cycle. note that in either case, the actual delay may be longer than intended; see reasons for delays longer than
specified below. arg1, ..., argn optional additional arguments which are passed through to the function
specified by function. note:...
...d problems as using eval. // recommended window.settimeout(function() { alert('hello world!'); }, 500); // not recommended window.settimeout("alert('hello world!');", 500); a string passed to settimeout is evaluated in the global context, so local symbols in the context where settimeout() was called will not be available when the string is evaluated as code. reasons for delays longer than
specified there are a number of reasons why a timeout may take longer to fire than anticipated. this section describes the most common reasons. timeouts throttled to ≥ 4ms in modern browsers, settimeout()/setinterval() calls are throttled to a minimum of once every 4 ms when successive calls are triggered due to callback nesting (where the nesting level is at least a certain depth), or after certain n...
...alls made from anywhere, or when a nested settimeout() is called where the nesting level is at least a certain depth. to implement a 0 ms timeout in a modern browser, you can use window.postmessage() as described here. note: the minimum delay, dom_min_timeout_value, is 4 ms (stored in a preference in firefox: dom.min_timeout_value), with a dom_clamp_timeout_nesting_level of 5. note: 4 ms is
specified by the html5 spec and is consistent across browsers released in 2010 and onward. prior to (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2), the minimum timeout value for nested timeouts was 10 ms. timeouts in inactive tabs throttled to ≥ 1000ms to reduce the load (and associated battery usage) from background tabs, timeouts are throttled to firing no more often than once per second (1,000 ms)...
XRSession.updateRenderState() - Web APIs
he updaterenderstate() method of the xrsession interface of webxr api schedules changes to be applied to the active render state prior to rendering of the next frame. syntax xrsession.updaterenderstate(newstate) parameters newstate an object conforming to the xrrenderstateinit dictionary specifying the properties of the session's renderstate to update before rendering the next frame. the
specified object may have any combination of the following fields. 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. all ren...
...wing fields. 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. all rendering will take place between the distances
specified by depthnear and depthfar. this is 1000 meters (1 kilometer) by default. depthnear optional a floating-point value indicating the distance in meters from the viewer to a plane parallel to the display surface to be the near clip plane. no part of the scene on the viewer's side of this plane will be rendered. this is 0.1 meters (10 centimeters) by default. inlineverticalfieldofview optional a f...
... the viewer's side of this plane will be rendered. this is 0.1 meters (10 centimeters) by default. inlineverticalfieldofview optional a floating-point value indicating the default field of view, in radians, to be used when 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). return value none. exceptions this method may throw any of the following exceptions. these are true exceptions, since this method does not return a promise. invalidstateerror this may occur for one of the following reasons: the xrsessio...
...ons. the default value is otherwise π * 0.5 (half of the value of pi). return value none. exceptions this method may throw any of the following exceptions. these are true exceptions, since this method does not return a promise. invalidstateerror this may occur for one of the following reasons: the xrsession has already ended, so you cannot change its render state. the baselayer
specified in newstate was created by an xrsession other than the one on which updaterenderstate() was called. the inlineverticalfieldofview property was set, but the session is immersive and therefore does not allow this property to be used. examples this example creates a webgl context that is compatible with an immersive xr device and then uses it to create an xrwebgllayer. updaterenderstate() i...
-webkit-border-before - CSS: Cascading Style Sheets
if it isn't, it will be the rgb() corresponding one. the transparent keyword maps to rgba(0,0,0,0).animation typediscrete formal syntax <'border-width'> | <'border-style'> | <'color'>where <color> = <rgb()> | <rg...
...if it isn't, it will be the rgb() corresponding one. the transparent keyword maps to rgba(0,0,0,0).animation typediscrete formal syntax <'border-width'> | <'border-style'> | <'color'>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <h...
...if it isn't, it will be the rgb() corresponding one. the transparent keyword maps to rgba(0,0,0,0).animation typediscrete formal syntax <'border-width'> | <'border-style'> | <'color'>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | curr...
...he absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hiddenborder-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-style: as each of the properties of the shorthand:border-bottom-style: as
specifiedborder-left-style: as
specifiedborder-right-style: as
specifiedborder-top-style: as
specifiedcolor: 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 typediscrete formal syntax <'border-width'> | <'border-style'> | <'color'>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-...
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: infinite 10; range: 6 infinite; range: infinite infinite; /* multiple range values */ range: 2 5, 8 10; range: infinite 6, 10 infinite; values auto the range depends on the counter system: for cyclic, numeric, and fixed systems, the range is negative infinity to positive infinity. for alphabetic and symbolic systems, the range is 1 to positive infinity. for additive systems, the range is 0 to positive infinity. for extends system...
...infinity; if it is used as the second value, it represents positive infinity. the range of the counter style is the union of all the ranges defined in the list. if the lower bound of any range is higher than the upper bound, the entire descriptor is invalid and will be ignored. description the value of the range descriptor can be either auto or a comma separated list of lower and upper bounds
specified as integers. if value is auto, then for cyclic, numeric, and fixed system, the range will be from negative infinity to positive infinity. for alphabetic and symbolic systems, range will be from 1 to positive infinity. for additive systems, auto will result in the range 0 to positive infinity. for extends systems, the range is whatever auto will produce for the extended system. when range is spe...
... will be from negative infinity to positive infinity. for alphabetic and symbolic systems, range will be from 1 to positive infinity. for additive systems, auto will result in the range 0 to positive infinity. for extends systems, the range is whatever auto will produce for the extended system. when range is
specified as integers, the value infinite can be used to denote infinity. if infinite is
specified as the first value in a range, then it is interpreted as negative infinity. ...
...ms, the range is whatever auto will produce for the extended system. when range is
specified as integers, the value infinite can be used to denote infinity. if infinite is
specified as the first value in a range, then it is interpreted as negative infinity. if used as upper bound, it is taken as positive infinity. ...
height - CSS: Cascading Style Sheets
l and vertical lengths respectively. must be non-negative. formal definition related at-rule@viewportinitial 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. ...
...ct 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 value is treated as 0.max-height: the percentage is calculated with respect to the height of the generated box's containing block. ...
...treated as 0.max-height: the percentage is calculated with respect to the height of the generated box's containing block. ...
...pect to the height of the generated box's containing block. ...
Using CSS gradients - CSS: Cascading Style Sheets
their default positions. to fine-tune their locations, you can give each one zero, one, or two percentage or, for radial and linear gradients, absolute length values. if you specify the location as a percentage, 0% represents the starting point, while 100% represents the ending point; however, you can use values outside that range if necessary to get the effect you want. if you leave a location un
specified, the position of that particular color stop will be automatically calculated for you, with the first color stop being at 0% and the last color stop being at 100%, and any other color stops being half way between their adjacent color stops. <div class="multicolor-linear"></div> div { width: 120px; height: 120px; } .multicolor-linear { background: linear-gradient(to left, lime 28px, re...
...in-right: 10px; box-sizing: border-box; } .colorhint-gradient { background: linear-gradient(to top, black, 20%, cyan); } .regular-progression { background: linear-gradient(to top, black, cyan); } overlaying gradients gradients support transparency, so you can stack multiple backgrounds to achieve some pretty fancy effects. the backgrounds are stacked from top to bottom, with the first
specified being on top. <div class="layered-image"></div> div { width: 300px; height: 150px; } .layered-image { background: linear-gradient(to right, transparent, mistyrose), url("https://mdn.mozillademos.org/files/15525/critters.png"); } stacked gradients you can even stack gradients with other gradients. as long as the top gradients aren't entirely opaque, the gradients below will ...
... from the starting point (the center) to the closest side of the enclosing box. <div class="radial-ellipse-side"></div> div { width: 240px; height: 100px; } .radial-ellipse-side { background: radial-gradient(ellipse closest-side, red, yellow 10%, #1e90ff 50%, beige); } example: farthest-corner for ellipses this example is similar to the previous one, except that its size is
specified as farthest-corner, which sets the size of the gradient by the distance from the starting point to the farthest corner of the enclosing box from the starting point. <div class="radial-ellipse-far"></div> div { width: 240px; height: 100px; } .radial-ellipse-far { background: radial-gradient(ellipse farthest-corner at 90% 90%, red, yellow 10%, #1e90ff 50%, beige); } example: c...
...est to the bottom, since the height in this case is narrower than the width. <div class="radial-circle-close"></div> div { width: 240px; height: 120px; } .radial-circle-close { background: radial-gradient(circle closest-side at 25% 75%, red, yellow 10%, #1e90ff 50%, beige); } stacked radial gradients just like linear gradients, you can also stack radial gradients. the first
specified is on top, the last on the bottom. <div class="stacked-radial"></div> div { width: 200px; height: 200px; } .stacked-radial { background: radial-gradient(circle at 50% 0, rgba(255,0,0,.5), rgba(255,0,0,0) 70.71%), radial-gradient(circle at 6.7% 75%, rgba(0,0,255,.5), rgba(0,0,255,0) 70.71%), radial-gradient(circle at 93.3% 75%, ...
animation-iteration-count - 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. it is often convenient to use the shorthand property animation to set all animation properties at once. ...
...amples 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: infinite; /* <number> values */ animation-iteration-count: 3; animation-iteration-count: 2.4; /* multiple values */ animation-iteration-count: 2, 0, infinite; the animation-iteration-count property is
specified as one or more comma-separated values. values infinite the animation will repeat forever. <number> the number of times the animation will repeat; this is 1 by default. you may specify non-integer values to play 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...
...alues infinite the animation will repeat forever. <number> the number of times the animation will repeat; this is 1 by default. you may specify non-integer values to play part of an animation cycle: for example, 0.5 will play half of the animation cycle. negative values are invalid. ...
...lid. 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. formal definition initial value1applies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas
specifiedanimation typediscrete formal syntax <single-animation-iteration-count>#where <single-animation-iteration-count> = infinite | <number> examples see css animations for examples. specifications specification status comment css animationsthe definition of 'animation-iteration-count' in that specification. working draft initial definition. ...
attr() - CSS: Cascading Style Sheets
e length, attr() computes it to an absolute length. leading and trailing spaces are stripped. 0, or, if 0 is not a valid value for the property, the property's minimum value. em, ex, px, rem, vw, vh, vmin, vmax, mm, cm, in, pt, or pc <length> the attribute value is parsed as a css <number>, that is without the unit (e.g. 12.5), and interpreted as a <length> with the
specified unit. if it is not valid, that is not a number or out of the range accepted by the css property, the default value is used. if the given unit is a relative length, attr() computes it to an absolute length. leading and trailing spaces are stripped. 0, or, if 0 is not a valid value for the property, the property's minimum value. angle <angle> the attribute value ...
... not an angle or out of the range accepted by the css property, the default value is used. leading and trailing spaces are stripped. 0deg, or, if 0deg is not a valid value for the property, the property's minimum value. deg, grad, rad <angle> the attribute value is parsed as a css <number>, that is without the unit (e.g. 12.5), and interpreted as an <angle> with the
specified unit. if it is not valid, that is not a number or out of the range accepted by the css property, the default value is used. leading and trailing spaces are stripped. 0deg, or, if 0deg is not a valid value for the property, the property's minimum value. time <time> the attribute value is parsed as a css <time> dimension, that is including the unit (e.g. 30.5ms). if i...
...not valid, that is not a time or out of the range accepted by the css property, the default value is used. leading and trailing spaces are stripped. 0s, or, if 0s is not a valid value for the property, the property's minimum value. s, ms <time> the attribute value is parsed as a css <number>, that is without the unit (e.g. 12.5), and interpreted as an<time> with the
specified unit. if it is not valid, that is not a number or out of the range accepted by the css property, the default value is used. leading and trailing spaces are stripped. 0s, or, if 0s is not a valid value for the property, the property's minimum value. frequency <frequency> the attribute value is parsed as a css <frequency> dimension, that is including the unit (e.g. 30...
...it (e.g. 30.5khz). if it is not valid, that is not a frequency or out of the range accepted by the css property, the default value is used. 0hz, or, if 0hz is not a valid value for the property, the property's minimum value. hz, khz <frequency> the attribute value is parsed as a css <number>, that is without the unit (e.g. 12.5), and interpreted as a <frequency> with the
specified unit. if it is not valid, that is not a number or out of the range accepted by the css property, the default value is used. leading and trailing spaces are stripped. 0hz, or, if 0hz is not a valid value for the property, the property's minimum value. % <percentage> the attribute value is parsed as a css <number>, that is without the unit (e.g. 12.5), and interpreted...
background-position - CSS: Cascading Style Sheets
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 position and the second represents the vertical position. if only one value is specifie...
...pecified as one or more <position> values, separated by commas. 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 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). 1-value syntax: the value may be: the keyword value center, which centers the image. one of the keyword values top, left, bottom, right. this specifies an edge against which to place the item. the other dimension is then set to 50%, so...
... three or four values are used, the length-percentage values are offsets for the preceding keyword value(s). 1-value syntax: the value may be: the keyword value center, which centers the image. one of the keyword values top, left, bottom, right. this specifies an edge against which to place the item. the other dimension is then set to 50%, so the item is placed in the middle of the edge
specified. a <length> or <percentage>. this specifies the x coordinate relative to the left edge, with the y coordinate set to 50%. 2-value syntax: one value defines x and the other defines y. each value may be: one of the keyword values top, left, bottom, right. if left or right are given here, then this defines x and the other given value defines y. if top or bottom are given, then this define...
...*/ .examplethree { background-image: url("https://mdn.mozillademos.org/files/11987/startransparent.gif"), url("https://mdn.mozillademos.org/files/7693/catfront.png"); background-position: 0px 0px, right 3em bottom 2em; } result specifications specification status comment css backgrounds and borders modu...
background - CSS: Cascading Style Sheets
the syntax of each layer is as follows: each layer may include zero or one occurrences of any of the following values: <attachment> <bg-image> <position> <bg-size> <repeat-style> the <bg-size> value may only be included immediately after <position>, separated with the '/' character, like this: "center/80%". the <b...
...cluded immediately after <position>, separated with the '/' character, like this: "center/80%". the <box> value may be included zero, one, or two times. if included once, it sets both background-origin and background-clip. if it is included twice, the first occurrence sets background-origin, and the second sets background-clip. the <background-color> value may only be included in the last layer
specified. values <attachment> see background-attachment <box> see background-clip and background-origin <background-color> see background-color <bg-image> see background-image <position> see background-position <repeat-style> see background-repeat <bg-size> see background-size. accessibility concerns browsers do not provide any special information on background images to assistive tec...
...line.inheritednopercentagesas each of the properties of the shorthand:background-position: refer 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 offsetsbackground-size: relative to the background positioning areacomputed valueas each of the properties of the shorthand:background-image: as
specified, but with <url> values made absolutebackground-position: a list, each item consisting of two keywords representing the origin and two offsets from that origin, each given as an absolute length (if given a <length>), otherwise as a percentagebackground-size: as
specified, but with relative lengths converted into absolute lengthsbackground-repeat: a list, each item consisting of two keywords, one p...
...utebackground-position: a list, each item consisting of two keywords representing the origin and two offsets from that origin, each given as an absolute length (if given a <length>), otherwise as a percentagebackground-size: as
specified, but with relative lengths converted into absolute lengthsbackground-repeat: a list, each item consisting of two keywords, one per dimensionbackground-origin: as
specifiedbackground-clip: as
specifiedbackground-attachment: as
specifiedbackground-color: computed coloranimation typeas each of the properties of the shorthand:background-color: a colorbackground-image: discretebackground-clip: discretebackground-position: repeatable list of simple list of length, percentage, or calcbackground-size: repeatable list of simple list of length, percentage, or calcbackground-...
border-image-slice - CSS: Cascading Style Sheets
these regions form the components of an element's border 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. the slicing process creates nine regions in total: four corners, four edges, and a middle region. four slice lines, set a given distance from their respective sides, control the size of the regions. the above diagram illustrates the location of each region. zones 1-4 are corner regions. ...
...* 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 positions are
specified, the first value creates slices measured from the top and bot...
.... 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 positions are
specified, the first value creates slices measured from the top and bottom, the second creates slices measured from the left and right. when three positions are
specified, the first value creates a slice measured from the top, the second creates slices measured from the left and right, the third creates a slice measured from the bottom. when four positions are
specified, they create slices measured from the top, right, bottom, and left in that order (clockwise). the optional fill value, if used, can be placed anywhere in the declaration. values <number> re...
...d image, but stacked above the actual background. its width and height are sized to match the top and left image regions, respectively. formal definition 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} && fill?where <number-percentage> = <number> | <percentage> examples adjustable border width and slice the folowing example shows a simple <div> with a border image set on it. the source image for the borders is as follows: the diamonds are 30px across, the...
border-style - CSS: Cascading Style Sheets
le: groove; border-style: ridge; border-style: inset; border-style: outset; /* vertical | horizontal */ border-style: dotted solid; /* top | horizontal | bottom */ border-style: hidden double dashed; /* top | right | bottom | left */ border-style: none solid dotted dashed; /* global values */ border-style: inherit; border-style: initial; border-style: unset; the border-style property may be
specified using one, two, three, or four values. 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 right, the third to the bottom. when four values are
specified, the styl...
... the top, right, bottom, and left in that order (clockwise). each value is a keyword chosen from the list below. values <line-style> describes the style of the border. it can have the following values: none like the hidden keyword, displays no border. ...
...in the case of table cell and border collapsing, the hidden value has the highest priority: if any other conflicting border is set, it won't be displayed. dotted displays a series of rounded dots. the spacing of the dots is not defined by the specification and is implementation-specific. ...
...rder-collapse set to collapsed, this value behaves like ridge. formal definition 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
specifiedanimation typediscrete formal syntax <line-style>{1,4}where <line-style> = none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset examples table with all property values here is an example of all the property values. html <table> <tr> <td class="b1">none</td> <t...
box-align - CSS: Cascading Style Sheets
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 end. end the box aligns contents at the end, leaving any extra space at the start. baseline the box aligns the baselines of the contents (lining up the t...
... 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. ...
...le is ignored. ...
...ied */ display: -moz-box; /* mozilla */ display: -webkit-box; /* webkit */ /* make this box taller than the children, so there is room for the box-pack */ height: 400px; /* make this box wider than the children so there is room for the box-align */ width: 300px; /* children should be oriented vertically */ box-orient: vertical; /* as
specified */ -moz-box-orient: vertical; /* mozilla */ -webkit-box-orient: vertical; /* webkit */ /* align children to the horizontal center of this box */ box-align: center; /* as
specified */ -moz-box-align: center; /* mozilla */ -webkit-box-align: center; /* webkit */ /* pack children to the bottom of this box */ box-pack: end; /* as sp...
box-decoration-break - CSS: Cascading Style Sheets
the box-decoration-break css property specifies how an element's fragments should be rendered when broken across multiple lines, columns, or pages. 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 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. ...
...er 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 each fragment since it uses its own height if the break occurs in the inline direction, and its own width if the break occurs in the block direction. see the css specification for details. 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. formal definition initial valuesliceapplies toall elementsinheritednocomputed va...
...r, 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. ...
box-lines - CSS: Cascading Style Sheets
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 of multiple is
specified, however, then the box is allowed to expand to multiple lines (that is, multiple rows or columns) in order to accommodate all of its children. the box must attempt to fit its children on as few lines as possible by shrinking all elements down to their minimum widths or heights if necessary. if the children in a horizontal box still do not fit on a line after being reduced to their minimum widths...
...ines and to the left in reverse direction boxes. once the number of lines has been determined, elements with a computed value for box-flex other than 0 stretch as necessary in an attempt to fill the remaining space on the lines. each line computes flexes independently, so only elements on that line are considered when evaluating box-flex and box-flex-groups. ...
...ted value for box-flex other than 0 stretch as necessary in an attempt to fill the remaining space on the lines. each line computes flexes independently, so only elements on that line are considered when evaluating box-flex and box-flex-groups. the packing of elements in a line, as
specified by the box-pack property, is also computed independently for each line. syntax the box-lines property is
specified as one of the keyword values listed below. values single box elements lay out in a single row or column. ...
...this was only supported in webkit-based browsers, with a prefix. ...
Computed value - CSS: Cascading Style Sheets
the computed value of a css property is the value that is transferred from parent to child during inheritance. it is calculated from the
specified value by: handling the special values inherit, initial, unset, and revert. doing the computation needed to reach the value described in the "computed value" line in the property's definition table. 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. for example, if an element has
specified values font-size: 16px and padding-top: 2em, then the computed value of padding-top is 32px (double the font size). however, for some properties (those where percentages are relative to something that may require layout to determine, such as widt...
...the relative values that remain in the computed value become absolute when the used value is determined. ...
...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. ...
...the relative values that remain in the computed value become absolute when the used value is determined. ...
filter - CSS: Cascading Style Sheets
orter list using their lacuna values, then all filter functions are interpolated according to their specific rules. if one filter is none, it is replaced with the filter functions list of the other one using the filter function default values, then all filter functions are interpolated according to their specific rules. otherwise, discrete interpolation is used. functions the filter property is
specified as none or one or more of the functions listed below. if the parameter for any function is invalid, the function returns none. except where noted, the functions that take a value expressed with a percent sign (as in 34%) also accept the value expressed as decimal (as in 0.34). when a single filter property has two or more functions it's results will be different from when two or more filter prop...
...bedded in an external xml file. filter: url(resources.svg#c1) filter functions blur() the blur() fucntion applies a gaussian blur to the input image. the value of radius defines the value of the standard deviation to the gaussian function, or how many pixels on the screen blend into each other, so a larger value will create more blur. the lacuna value for interpolation is 0. the parameter is
specified as a css length, but does not accept percentage values. filter: blur(5px) <table class="standard-table"> <thead> <tr> <th style="text-align: left;" scope="col">original image</th> <th style="text-align: left;" scope="col">live example</th> <th style="text-align: left;" scope="col">svg equivalent</th> <th style="text-align: left;" scope="col">static example</th>...
...s place the shadow above the element. see <length> for possible units. if both values are 0, the shadow is placed behind the element (and may generate a blur effect if <blur-radius> and/or <spread-radius> is set). <blur-radius> (optional) this is a third <length> value. the larger this value, the bigger the blur, so the shadow becomes bigger and lighter. negative values are not allowed. if not
specified, it will be 0 (the shadow's edge is sharp). <color> (optional) see <color> values for possible keywords and notations. if not
specified, the color used depends on the browser - it is usually the value of the <color> property, but note that safari currently paints a transparent shadow in this case. filter: drop-shadow(16px 16px 10px black) <svg style="position: absolute; top: -999999px" xmlns...
...ign: 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 definition 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()> | <grayscale()> | <hue-rotate()> | <invert()> | <opacity()> | <saturate()> | <sepia()>where <blur()> = blur( <length> )<brightness()> = brightness( <number-percentage> )<co...
flex - CSS: Cascading Style Sheets
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 <number> and it is interpreted as <flex-grow>. the second ...
...{ flex: 1; } by default flex items don't shrink below their minimum content size. to change this, set the item's min-width or min-height. ...
...ault flex items don't shrink below their minimum content size. to change this, set the item's min-width or min-height. ...
...rink below their minimum content size. to change this, set the item's min-width or min-height. ...
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 font)...
...ned 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 font). to use this property in a way that is compatible with browsers that do not support font-size-adjust, it is
specified as a number that the font-size property is multiplied by. this means the value
specified for the property should generally be the aspect ratio of the first choice font. for example, a style sheet that specifies: font-size: 14px; font-size-adjust: 0.5; ... is really specifying that the lowercase letters of the font should be 7px high (0.5 × 14px). this will still produce reasonable results in...
...case letters of the font should be 7px high (0.5 × 14px). this will still produce reasonable results in browsers that do not support font-size-adjust, where a 14px font will be used. syntax values none choose the size of the font based only on the font-size property. <number> choose the size of the font so that its lowercase letters (as determined 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 definition initial valuenoneapplies toall elemen...
...atio (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 definition initial valuenoneapplies toall elements. ...
font-style - 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. italic font faces are generally cursive in nature, usually using less horizontal space than their unstyled counterparts, while oblique faces are usually just sloped versions of the regular face. ...
... 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 used instead. ...
...assified as oblique. if no oblique version of the face is available, one classified as italic is used instead. if neither is available, the style is artificially simulated. oblique <angle> selects a font classified as oblique, and additionally specifies an angle for the slant of the text. if one or more oblique faces are available in the chosen font family, the one that most closely matches the
specified angle is chosen. if no oblique faces are available, the browser will synthesize an oblique version of the font by slanting a normal face by the
specified amount. valid values are degree values of -90deg to 90deg inclusive. if an angle is not
specified, an angle of 14 degrees is used. positive values are slanted to the end of the line, while negative values are slanted towards the beginning. in...
...date(); 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 definition initial valuenormalapplies toall elements. ...
gap (grid-gap) - CSS: Cascading Style Sheets
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 di...
... values <length> is the width of the gutter separating the grid lines. ...
...gutter separating the grid lines. <percentage> is the width of the gutter separating the grid lines, relative to the dimension of the element. ...
...he dimension of the element. ...
grid-column-start - CSS: Cascading Style Sheets
values auto a keyword indicating that the property contributes nothing to the grid item’s placemen...
...grid-column-start: 2; grid-column-start: somegridarea 4; /* span + <integer> + <custom-ident> values */ grid-column-start: span 3; grid-column-start: span somegridarea; grid-column-start: span somegridarea 5; /* global values */ grid-column-start: inherit; grid-column-start: initial; grid-column-start: unset; this property is
specified as a single <grid-line> value. 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 property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default span o...
...c span, or a default span of 1. <custom-ident> if there is a named line with the name <custom-ident>-start, it contributes the first such line to the grid item’s placement. note: named grid areas automatically generate implicit named lines of this form, so specifying grid-column-start: foo; will choose the start edge of that named grid area (unless another line named foo-start was explicitly
specified before it). otherwise, this is treated as if the integer 1 had been
specified along with the <custom-ident>. <integer> && <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if not eno...
...sponding 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. ...
grid-row-start - CSS: Cascading Style Sheets
values auto is a keyword indicating that the property contributes nothing to the grid item’s place...
...custom-ident> values */ grid-row-start: 2; grid-row-start: somegridarea 4; /* span + <integer> + <custom-ident> values */ grid-row-start: span 3; grid-row-start: span somegridarea; grid-row-start: 5 somegridarea span; /* global values */ grid-row-start: inherit; grid-row-start: initial; grid-row-start: unset; this property is
specified as a single <grid-line> value. 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 property contributes nothing to the grid item’s placement, indicating auto-placement, an automatic span, or a default spa...
... span, or a default span of 1. <custom-ident> if there is a named line with the name '<custom-ident>-start', it contributes the first such line to the grid item’s placement. note: named grid areas automatically generate implicit named lines of this form, so specifying grid-row-start: foo; will choose the start edge of that named grid area (unless another line named foo-start was explicitly
specified before it). otherwise, this is treated as if the integer 1 had been
specified along with the <custom-ident>. <integer> && <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if...
...sponding 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. ...
grid-row - CSS: Cascading Style Sheets
uting a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start and inline-end edge of its grid area. 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. if two <grid-line> values are
specified, the grid-row-start longhand is set to the value before the slash, and the grid-row-end longhand is set to the value after the slash. constituent properties this property is a shorthand for the following css properties: grid-row-end grid-row-start syntax /* keyword values */ grid-row: auto; grid-row: auto / auto; /* <custom-ident> values */ grid-row: somegridarea; grid-row: somegridarea...
...of 1. <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 implicit named lines of this form, so specifying grid-row: foo; will choose the start/end edge of that named grid area (unless another line named foo-start/foo-end was explicitly
specified before it). otherwise, this is treated as if the integer 1 had been
specified along with the <custom-ident>. <integer> && <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if...
...mn and -ms-grid-row. one can use a little javascript to enable automatic annotation: source repository. ...
...an use a little javascript to enable automatic annotation: source repository. ...
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-negative <percentage> value, relative to the block size of the grid c...
...tation that defines a size range, greater than or equal to min, and less than or equal to max. if max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value sets the track’s flex factor. it is invalid as a 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 stretched by the align-content and justify-content properties. fit-content( [ <length> | <percentage> ] ) represents the formula min(max-content, max(auto, argument)), which is calculated similar to auto (i.e. minmax(auto, max-content)), except that the track size ...
...if it is greater than the auto minimum. repeat( [ <positive-integer> | auto-fill | auto-fit ] , <track-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. ...
...han being
specified explicitly, the sizes of the grid rows/columns will be taken from the parent grid’s definition. the subgrid value is from level 2 of the grid specification and currently only has implementation in firefox 71 and onwards. ...
grid - CSS: Cascading Style Sheets
<'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-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). g...
... [ 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 if it’s
specified. all other grid sub-properties are reset to their initial values. formal definition initial valueas each of the properties of the shorthand:grid-template-rows: nonegrid-template-columns: nonegrid-template-areas: nonegrid-auto-rows: autogrid-auto-columns: autogrid-auto-flow: rowgrid-column-gap: 0grid-row-gap: 0column-gap: normalrow-gap: normalapplies togrid containersinheritednopercentagesas...
...f the properties of the shorthand:grid-template-rows: refer to corresponding dimension of the content areagrid-template-columns: refer to corresponding dimension of the content areagrid-auto-rows: refer to corresponding dimension of the content areagrid-auto-columns: refer to corresponding dimension of the content areacomputed valueas each of the properties of the shorthand:grid-template-rows: as
specified, but with relative lengths converted into absolute lengthsgrid-template-columns: as
specified, but with relative lengths converted into absolute lengthsgrid-template-areas: as
specifiedgrid-auto-rows: the percentage as
specified or the absolute lengthgrid-auto-columns: the percentage as
specified or the absolute lengthgrid-auto-flow: as
specifiedgrid-column-gap: the percentage as
specified or the...
...ute lengthsgrid-template-columns: as
specified, but with relative lengths converted into absolute lengthsgrid-template-areas: as
specifiedgrid-auto-rows: the percentage as
specified or the absolute lengthgrid-auto-columns: the percentage as
specified or the absolute lengthgrid-auto-flow: as
specifiedgrid-column-gap: the percentage as
specified or the absolute lengthgrid-row-gap: the percentage as
specified or the absolute lengthcolumn-gap: as
specified, with <length>s made absolute, and normal computing to zero except on multi-column elementsrow-gap: as
specified, with <length>s made absolute, and normal computing to zero except on multi-column elementsanimation typediscrete formal syntax <'grid-template'> | <'grid-template-rows'> / [ auto-flow && dense? ] <'grid-auto-columns'>? | [ auto-flow && ...
<image> - CSS: Cascading Style Sheets
image largest in area and the aspect ratio most similar to the containing box.) images with no intrinsic dimensions but with an intrinsic aspect ratio between its width and height, like an svg or other vector format. images with neither intrinsic dimensions, nor an intrinsic aspect ratio, like a css gradient. ...
...mask-image ? shape-outside ? mask-border-source ? symbols for @counter-style at risk feature. ...
... at risk feature. if supported, the browser-defined size matching the usual cursor size on the client's system content for a pseudo-element (::after/::before) a 300px × 150px rectangle the concrete object size is calculated using the following algorithm: if the
specified size defines both the width and the height, these values are used as the concrete object size. ...
...re) a 300px × 150px rectangle the concrete object size is calculated using the following algorithm: if the
specified size defines both the width and the height, these values are used as the concrete object size. if the
specified size defines only the width or only the height, the missing value is determined using the intrinsic ratio, if there is any, the intrinsic dimensions if the
specified value matches, or the default object size for that missing value. if the
specified size defines neither the width nor the height, the concrete object size is calculated so that it matches the intrinsic aspect ratio of the image but without exceeding the default object size in any dimension. if the image has no intrinsic aspect ratio, the intrinsic aspect ratio of the object it applies to is used...
Inheritance - CSS: Cascading Style Sheets
only the root element of the document gets the initial value given in the property's summary. ...
...wo 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 definition 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. given the style rules: p { color: green; } ... and the markup: <p>this paragraph has <em>emphasized text</em> in it.</p> ... the words "emphasi...
...ph has <em>emphasized text</em> in it.</p> ... 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 ...
...es 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. definitions of value syntax, shorthand properties and replaced elements. ...
left - CSS: Cascading Style Sheets
from its normal position. when position is set to sticky, the left property is used to compute the sticky-constraint rectangle. when position is set to static, the left property 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 over
specified. ...
... if the element cannot stretch to satisfy both, the position of the element is over
specified. 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. ...
...of the element is over
specified. 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. ...
.... 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. ...
line-height - CSS: Cascading Style Sheets
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 element's own font size. the computed value is the same as the spe...
...values given in em units may produce unexpected results (see example below). ...
...d to increase the text size, using a unitless value ensures that the line height will scale proportionately. w3c understanding wcag 2.1 formal definition initial valuenormalapplies toall elements. ...
... prefer unitless numbers for line-height values this example shows why it is better to use <number> values instead of <length> values. we will use two <div> elements. the first, with the green border, uses a unitless line-height value. the second, with the red border, uses a line-height value defined in ems. html <div class="box green"> <h1>avoid unexpected results by using unitless ...
margin-inline - CSS: Cascading Style Sheets
ed 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. ...
...tuent 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. ...
... 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. ...
...rtical-rl; margin-inline: 20px 40px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition of 'margin-inline' in that specification. editor's draft initial definition. 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 ...
max-height - 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. max-height overrides height, but min-height overrides max-height. ...
...x-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. 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)). accessibility concerns ensure that elements set with a max-height are no...
...tanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 formal definition 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. ...
...replaced inline elements, table columns, and column groupsinheritednopercentagesthe percentage is calculated with respect to the height of the generated box's containing block. ...
min-height - 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. the element's height is set to the value of min-height whenever min-height is larger than max-height or height. ...
...yword 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. 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 definition initial valueautoapplies toall elements but non-replace...
...h the available space replaced by the
specified argument, i.e. min(max-content, max(min-content, argument)). formal definition 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. ...
...on-replaced inline elements, table columns, and column groupsinheritednopercentagesthe percentage is calculated with respect to the height of the generated box's containing block. ...
pointer-events - CSS: Cascading Style Sheets
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 its descendant elements if those descendants have pointer-events set t...
...in svg content, this value and the value visiblepainted have the same effect. ...
...lues of the stroke and visibility properties do not affect event processing. all svg only (experimental for html). the element can only be the target of a pointer event when the pointer is over the interior (i.e., fill) or the perimeter (i.e., stroke) of the element. the values of the fill, stroke, and visibility properties do not affect event processing. description when this property is un
specified, the same characteristics of the visiblepainted value apply to svg content. in addition to indicating that the element is not the target of pointer events, the value none instructs the pointer event to go "through" the element and target whatever is "underneath" that element instead. note that preventing an element from being the target of pointer events by using pointer-events does not necessa...
... 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 definition 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: none; } disabling pointer events on a single link this example disables pointer eve...
right - CSS: Cascading Style Sheets
oth -- 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. ...
... 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. ...
...d. 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. ...
...olute { width: 100px; height: 100px; background-color: #ffd7c2; position: absolute; bottom: 10px; right: 20px; } result declaring both left and right when both left and right are declared, the element will stretch to meet both, unless other constraints prevent it from doing so. if the element will not stretch or shrink to meet meet both. when the position of the element is over
specified, the precende is based on the container's direction: the left will take precendence if the container's direction is left-to-right. the right will take precedence if the container's direction is right-to-left. html <div id="parent">parent <div id="nowidth">no width</div> <div id="width">width: 100px</div> </div> css div { outline: 1px solid #cccccc; } #parent { width: 200px; hei...
text-shadow - CSS: Cascading Style Sheets
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, shadows are applied front-to-back, with the first-speci...
...1px 0 10px; /* offset-x | offset-y | color */ text-shadow: 5px 5px #558abb; /* color | offset-x | offset-y */ text-shadow: white 2px 5px; /* offset-x | offset-y /* use defaults for color and blur-radius */ text-shadow: 5px 10px; /* global values */ text-shadow: inherit; text-shadow: initial; text-shadow: unset; this property is
specified as a comma-separated list of shadows. 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, shadows are applied front-to-back, with the first-
specified shadow on top. this property applies to both ::first-line ...
...es 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, shadows are applied front-to-back, with the first-
specified shadow on top. this property applies to both ::first-line and ::first-letter pseudo-elements. values <color> optional. the color of the shadow. it can be
specified either before or after the offset values. if un
specified, the color's value is left up to the user agent, so when consistency across browsers is desired you should define it explicitly. <offset-x> <offset-y> required. these <length> values specify the shadow's distance from the text. <offset-x> specifies the horizontal distance; a negative value places the shadow to the left of the text. <offse...
... to the left of the text. <offset-y> specifies 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 definition 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> | currentc...
top - CSS: Cascading Style Sheets
en the element's top edge and the top edge of its containing block. when position is set to relative, the top property specifies the distance the element's top edge is moved below its normal position. when position is set to sticky, the top property is used to compute the sticky-constraint rectangle. when position is set to static, the top property has no effect. when both top and bottom are
specified, position is set to absolute or fixed, and height is un
specified (either auto or 100%) both the 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 containi...
...cally 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. ...
...ame 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. ...
...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. ...
Date and time formats used in HTML - HTML: Hypertext Markup Language
62 time strings a time string can specify a time with precision to the minute, second, or to the millisecond. specifying only the hour or minute isn't permitted. a valid time string minimally consists of a two-digit hour followed by a colon (":", u+003a), then a two-digit minute. the minute may optionally be followed by another colon and a two-digit number of seconds. milliseconds may be
specified, optionally, by adding a decimal point character (".", u+002e) followed by one, two, or three digits. there are some additional basic rules: the hour is always
specified using the 24-hour clock, with 00 being midnight and 11 pm being 23. no values outside the range 00–23 are permitted. the minute must be a two-digit number between 00 and 59. no values outside that range are allowed. if th...
... if a fraction of a second is included, it may be from one to three digits long, indicating the number of milliseconds. ...
... must be a two-digit number between 00 and 59. no values outside that range are allowed. if the number of seconds is omitted (to specify a time accurate only to the minute), no colon should follow the number of minutes. if
specified, the integer portion of the number of seconds must be between 00 and 59. you cannot specify leap seconds by using values like 60 or 61. if the number of seconds is
specified and is an integer, it must not be followed by a decimal point. if a fraction of a second is included, it may be from one to three digits long, indicating the number of milliseconds. it follows the decimal point placed after the seconds component of the time string. examples of valid time strings time string time 00:00:30.75 12:00:30.75 am (30.75 seconds after midni...
...gitude (which passes through the royal observatory at greenwich, england). for dates prior to utc, the time base is instead expressed in terms of ut1, which is the contemporary earth solar time at the prime meridian. the time zone string is appended immediately following the time in the date and time string. you can specify simply "z" as the time zone offset string to indicate that the time is
specified in utc. otherwise, the time zone string is constructed as follows: a character indicating the sign of the offset: the plus character ("+", or u+002b) for time zones to the east of the prime meridian or the minus character ("-", or u+002d) for time zones to the west of the prime meridian. a two-digit number of hours that the time zone is offset from the prime meridian. this value must be betwe...
<button>: The Button element - HTML: Hypertext Markup Language
form owner. formenctype html5 if the button is a submit button (it's inside/associated with a <form> and doesn't have type="button"), specifies how to encode the form data that is submitted. possible values: application/x-www-form-urlencoded: the default if the attribute is not used. multipart/form-data: use to submit <input> elements with their type attributes set to file. text/plain:
specified as a debugging aid; shouldn’t be used for real form submission. if this attribute is
specified, it overrides the enctype attribute of the button's form owner. formmethod html5 if the button is a submit button (it's inside/associated with a <form> and doesn't have type="button"), this attribute specifies the http method used to submit the form. possible values: post: the data from th...
... post: the data from the form are included in the body of the http request when sent to the server. use when the form contains information that shouldn’t be public, like login credentials. get: the form data are appended to the form's action url, with a ? as a separator, and the resulting url is sent to the server. use this method when the form has no side effects, like search forms. if
specified, this attribute overrides the method attribute of the button's form owner. formnovalidate html5 if the button is a submit button, this boolean attribute specifies that the form is not to be validated when it is submitted. if this attribute is
specified, it overrides the novalidate attribute of the button's form owner. this attribute is also available on <input type="image"> and <input type="...
...attribute is also available on <input type="image"> and <input type="submit"> elements. formtarget html5 if the button is a submit button, this attribute is a author-defined name or standardized, underscore-prefixed keyword indicating where to display the response from submitting the form. this is the name of, or keyword for, a browsing context (a tab, window, or <iframe>). if this attribute is
specified, it overrides the target attribute of the button's form owner. the following keywords have special meanings: _self: load the response into the same browsing context as the current one. this is the default if the attribute is not
specified. _blank: load the response into a new unnamed browsing context — usually a new tab or window, depending on the user’s browser settings. _parent: loa...
...hat is an ancestor of the current one, and has no parent). if there is no parent, this option behaves the same way as _self. name the name of the 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 ...
<input type="file"> - HTML: Hypertext Markup Language
isn't available, the user agent may fall back to its preferred default mode. note: capture was previously a boolean attribute which, if present, requested that the device's media capture device(s) such as camera or microphone be used instead of requesting a file input. files a filelist object that lists every selected file. this list has no more than one member unless the multiple attribute is
specified. multiple when the multiple boolean attribute is
specified, the file input allows the user to select more than one file. non-standard attributes in addition to the attributes listed above, the following non-standard attributes are available on some browsers. you should try to avoid using them when possible, since doing so will limit the ability of your code to function in browsers that don't ...
... in version 57 (see bug 1384030). limiting accepted file types often you won't want the user to be able to pick any arbitrary type of file; instead, you often want them to select files of a specific type or types. for example, if your file input lets users upload a profile picture, you probably want them to select web-compatible image formats, such as jpeg or png. acceptable file types can be
specified with the accept attribute, which takes a comma-separated list of allowed file extensions or mime types. some examples: accept="image/png" or accept=".png" — accepts png files. accept="image/png, image/jpeg" or accept=".png, .jpg, .jpeg" — accept png or jpeg files. accept="image/*" — accept any file with an image/* mime type. (many mobile devices also let the user take a picture with th...
...v> <div> <button>submit</button> </div> </form> div { margin-bottom: 10px; } this produces a similar-looking output to the previous example: note: you can find this example on github too — see the source code, and also see it running live. it may look similar, but if you try selecting a file with this input, you'll see that the file picker only lets you select the file types
specified in the accept value (the exact nature differs across browsers and operating systems). the accept attribute doesn't validate the types of the selected files; it simply provides hints for browsers to guide users towards selecting the correct file types. it is still possible (in most cases) for users to toggle an option in the file chooser that makes it possible to override this and select any fi...
...iles were selected, by checking if curfiles.length is equal to 0. if so, print a message into the preview <div> stating that no files have been selected. if files have been selected, we loop through each one, printing information about it into the preview <div>. things to note here: we use the custom validfiletype() function to check whether the file is of the correct type (e.g. the image types
specified in the accept attribute). if it is, we: print out its name and file size into a list item inside the previous <div> (obtained from file.name and file.size). the custom returnfilesize() function returns a nicely-formatted version of the size in bytes/kb/mb (by default the browser reports the size in absolute bytes). generate a thumbnail preview of the image by calling url.createobjecturl...
<input type="submit"> - HTML: Hypertext Markup Language
coding the text using an algorithm such as encodeuri(). multipart/form-data uses the formdata api to manage the data, allowing for files to be submitted to the server. you must use this encoding type if your form includes any <input> elements of type file (<input type="file">). text/plain plain text; mostly useful only for debugging, so you can easily see the data that's to be submitted. if
specified, the value of the formenctype attribute overrides the owning form's action attribute. this attribute is also available on <input type="image"> and <button> elements. formmethod a string indicating the http method to use when submitting the form's data; this value overrides any method attribute given on the owning form. permitted values are: get a url is constructed by starting with the url...
...r. this overrides the value of the novalidate attribute on the element's owning form. this attribute is also available on <input type="image"> and <button> elements. formtarget a string which specifies a name or keyword that indicates where to display the response received after submitting the form. the string must be the name of a browsing context (that is, a tab, window, or <iframe>. a value
specified here overrides any target given by the target attribute on the <form> that owns this input. in addition to the actual names of tabs, windows, or inline frames, there are a few special keywords that can be used: _self loads the response into the same browsing context as the one that contains the form. this will replace the current document with the received data. this is the default value use...
...es any target given by the target attribute on the <form> that owns this input. in addition to the actual names of tabs, windows, or inline frames, there are a few special keywords that can be used: _self loads the response into the same browsing context as the one that contains the form. this will replace the current document with the received data. this is the default value used if none is
specified. _blank loads the response into a new, unnamed, browsing context. this is typically a new tab in the same window as the current document, but may differ depending on the configuration of the user agent. _parent loads the response into the parent browsing context of the current one. if there is no parent context, this behaves the same as _self. _top loads the response into the top-level brow...
...ding form data for more details. adding a submit keyboard shortcut keyboard shortcuts, also known as access keys and keyboard equivalents, let the user trigger a button using a key or combination of keys on the keyboard. to add a keyboard shortcut to a submit button — just as you would with any <input> for which it makes sense — you use the accesskey global attribute. in this example, s is
specified as the access key (you'll need to press s plus the particular modifier keys for your browser/os combination. in order to avoid conflicts with the user agent's own keyboard shortcuts, different modifier keys are used for access keys than for other shortcuts on the host computer. see accesskey for further details. here's the previous example with the s access key added: <form> <div> <label ...
Using the application cache - HTML: Hypertext Markup Language
up the document load time. the browser then checks to see if the cache manifest has been updated on the server. if the cache manifest has been updated, the browser downloads a new version of the manifest and the resources listed in the manifest. this is done in the background and does not affect performance significantly. ...
...in addition, the browser also sends a checking event to the window.applicationcache object, and fetches the manifest file, following the appropriate http caching rules. ...
...ex.html http://www.example.com/header.png http://www.example.com/blah/blah a cache manifest file can include three sections (cache, network, and fallback, discussed below). in the example above, there is no section header, so all data lines are assumed to be in the explicit (cache) section, meaning that the browser should cache all the listed resources in the application cache. resources can be
specified using either absolute or relative urls (e.g., index.html). the "v1" comment in the example above is there for a good reason. browsers only update an application cache when the manifest file changes, byte for byte. if you change a cached resource (for example, you update the header.png image with new content), you must also change the content of the manifest file in order to let browsers know tha...
...to be added to the application cache as a master entry. explicit entries explicit entries are resources that are explicitly listed in the cache section of a cache manifest file. network entries the network section of a cache manifest file specifies resources for which a web application requires online access. network entries in an application cache are essentially an "online whitelist"—uris
specified in the network section are loaded from the server instead of the cache. this lets the browser's security model protect the user from potential security breaches by limiting access to approved resources. as an example, you can use network entries to load and execute scripts and other code from the server instead of the cache: cache manifest network: /api the cache manifest section listed above...
HTTP headers - HTTP
client hints are a work in progress. actual documentation can be found on the website of the http working group. accept-ch servers can advertise support for client hints using the accept-ch header field or an equivalent html <meta> element with http-equiv attribute ([html5]). accept-ch-lifetime servers can ask the client to remember the set of client hints that the server supports for a
specified period of time, to enable delivery of client hints on subsequent requests to the server’s origin ([rfc6454]). early-data indicates that the request has been conveyed in early data. content-dpr a number that indicates the ratio between physical pixels over css pixels of the selected image response. dpr a number that indicates the client’s current device pixel ratio (dpr), which is ...
...m reading the response of the resources to which this header is applied. content-security-policy (csp) controls resources the user agent is allowed to load for a given page. content-security-policy-report-only allows web developers to experiment with policies by monitoring, but not enforcing, their effects. these violation reports consist of json documents sent via an http post request to the
specified uri. expect-ct allows sites to opt in to reporting and/or enforcement of certificate transparency requirements, which prevents the use of misissued certificates for that site from going unnoticed. when a site enables the expect-ct header, they are requesting that chrome check that any certificate for that site appears in public ct logs. feature-policy provides a mechanism to allow and deny th...
...enables cross-site scripting filtering. http public key pinning (hpkp) http public key pinning has been deprecated and removed in favor of certificate transparency and expect-ct. public-key-pins associates a specific cryptographic 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-mo...
...e header field is rfc 7230, section 6.7. the standard establishes rules for upgrading or changing to a different protocol on the current client, server, transport protocol connection. for example, this header standard allows a client to change from http 1.1 to http 2.0, assuming the server decides to acknowledge and implement the upgrade header field. neither party is required to accept the terms
specified in the upgrade header field. it can be used in both client and server headers. if the upgrade header field is
specified, then the sender must also send the connection header field with the upgrade option
specified. for details on the connection header field please see section 6.1 of the aforementioned rfc. x-dns-prefetch-control controls dns prefetching, a feature by which browsers proactively ...
Grammar and types - JavaScript
below.) you can also simply assign a value to a variable for example, x = 42. this form creates an undeclared global variable. it also generates a strict javascript warning. undeclared global variables can often lead to unexpected behavior. thus, it is discouraged to use undeclared global variables. evaluating variables a variable declared using the var or let statement with no assigned value
specified has the value of undefined. an attempt to access an undeclared variable results in a referenceerror exception being thrown: var a; console.log('the value of a is ' + a); // the value of a is undefined console.log('the value of b is ' + b); // the value of b is undefined var b; // this one may puzzle you until you read 'variable hoisting' below console.log('the value of c is ' + c); // uncaugh...
...describes the following types of literals: array literals boolean literals floating-point literals numeric literals object literals regexp literals string literals array literals an array literal is a list of zero or more expressions, each of which represents an array element, enclosed in square brackets ([]). when you create an array using an array literal, it is initialized with the
specified values as its elements, and its length is set to the number of arguments
specified. the following example creates the coffees array with three elements and a length of three: let coffees = ['french roast', 'colombian', 'kona']; note : an array literal is a type of object initializer. see using object initializers. if an array is created using a literal in a top-level script, javascript int...
...aining the array literal. in addition, a literal used in a function is created each time the function is called. note: array literals are also array objects. see array and indexed collections for details on array objects. extra commas in array literals you do not have to specify all elements in an array literal. if you put two commas in a row, the array fills in the value undefined for the un
specified elements. the following example creates the fish array: let fish = ['lion', , 'angel']; this array has two elements with values and one empty element: fish[0] is "lion" fish[1] is undefined fish[2] is "angel" if you include a trailing comma at the end of the list of elements, the comma is ignored. in the following example, the length of the array is three. there is no mylist[3]. all ot...
...vascript special characters character meaning \0 null byte \b backspace \f form feed \n new line \r carriage return \t tab \v vertical tab \' apostrophe or single quote \" double quote \\ backslash character \xxx the character with the latin-1 encoding
specified by up to three octal digits xxx between 0 and 377. for example, \251 is the octal sequence for the copyright symbol. \xxx the character with the latin-1 encoding
specified by the two hexadecimal digits xx between 00 and ff. for example, \xa9 is the hexadecimal sequence for the copyright symbol. \uxxxx the unicode character
specified by the fou...
JavaScript modules - JavaScript
odules) we have a file structure as follows: index.html main.js modules/ canvas.js square.js note: all of the examples in this guide have basically the same structure; the above should start getting pretty familiar. the modules directory's two modules are described below: canvas.js — contains functions related to setting up the canvas: create() — creates a canvas with a
specified width and height inside a wrapper <div> with a
specified id, which is itself appended inside a
specified parent element. returns an object containing the canvas's 2d context and the wrapper's id. createreportlist() — creates an unordered list appended inside a
specified wrapper element, which can be used to output report data into. returns the list's id. square.js — contains: n...
...returns an object containing the square's size, position, and color. reportarea() — writes a square's area to a specific report list, given its length. reportperimeter() — writes a square's perimeter to a specific report list, given its length. ...
...returns an object containing the square's size, position, and color. reportarea() — writes a square's area to a specific report list, given its length. ...
... modules and classes as we hinted at earlier, you can also export ...
Function.prototype.bind() - JavaScript
imeout, any primitive value 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 wrap...
... the partial implementation creates functions that do not have immutable "poison pill" caller and arguments properties that throw a typeerror upon get, set, or deletion. (this could be ad...
...nd __definesetter__ extensions.) the partial implementation creates functions that have a prototype property. (proper bound functions have none.) the partial implementation creates bound functions whose length property does not agree with that mandated by ecma-262: it creates functions with length of 0. a full implementation—depending on the length of the target function and the number of pre-
specified arguments—may return a non-zero length. the partial implementation creates bound functions whose name property is not derived from the original function name. according to ecma-262, name of the returned bound function should be "bound " + name of target function (note the space character). if you choose to use this partial implementation, you must not rely on those cases where behavior devia...
... 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)...
TypedArray - JavaScript
before being copied into the new array. the length of the new typed array will be same as the length of the typedarray argument. object when called with an object argument, a new typed array is created as if by the typedarray.from() method. buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the
specified arraybuffer. the byteoffset and length 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. static properties typedarray.bytes_per_element returns a number value of the element size for the different typedarray objects. typedarray.name returns the strin...
.... typedarray.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). typedarray.prototype.includes() determines whether a typed array includes a certain element, returning true or false as appropriate. see also array.prototype.includes(). typedarray.prototype.indexof() returns the first (least) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.indexof(). typedarray.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). typedarray.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). typedarray.prototype.lastindexof() returns the last (greatest) index of an el...
...also array.prototype.indexof(). typedarray.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). typedarray.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). typedarray.prototype.lastindexof() returns the last (greatest) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.lastindexof(). typedarray.prototype.map() creates a new array with the results of calling a provided function on every element in this array. see also array.prototype.map(). typedarray.prototype.reduce() apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value. see also ar...
...each value of the array (from right-to-left) as to reduce it to a single value. see also array.prototype.reduceright(). typedarray.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first. see also array.prototype.reverse(). typedarray.prototype.set() stores multiple values in the typed array, reading input values from a
specified array. typedarray.prototype.slice() extracts a section of an array and returns a new array. see also array.prototype.slice(). typedarray.prototype.some() returns true if at least one element in this array satisfies the provided testing function. see also array.prototype.some(). typedarray.prototype.sort() sorts the elements of an array in place and returns the array. see also array.prototyp...
Uint8ClampedArray - JavaScript
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). constructor uint8clampedarray() creates a new uint8clampedarray object. static properties uint8clampedarray.bytes_per_element returns a number value of the element size. 1 in the case of an uint8clampedarray. ...
...prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). uint8clampedarray.prototype.includes() determines whether a typed array includes a certain element, returning true or false as appropriate. see also array.prototype.includes(). uint8clampedarray.prototype.indexof() returns the first (least) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.indexof(). uint8clampedarray.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). uint8clampedarray.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). uint8clampedarray.prototype.lastindexof() returns the last (gre...
...indexof(). uint8clampedarray.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). uint8clampedarray.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). uint8clampedarray.prototype.lastindexof() returns the last (greatest) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.lastindexof(). uint8clampedarray.prototype.map() creates a new array with the results of calling a provided function on every element in this array. see also array.prototype.map(). uint8clampedarray.prototype.reduce() apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single valu...
...the array (from right-to-left) as to reduce it to a single value. see also array.prototype.reduceright(). uint8clampedarray.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first. see also array.prototype.reverse(). uint8clampedarray.prototype.set() stores multiple values in the typed array, reading input values from a
specified array. uint8clampedarray.prototype.slice() extracts a section of an array and returns a new array. see also array.prototype.slice(). uint8clampedarray.prototype.some() returns true if at least one element in this array satisfies the provided testing function. see also array.prototype.some(). uint8clampedarray.prototype.sort() sorts the elements of an array in place and returns the array. se...
Statements and declarations - JavaScript
t and transfers program control to the statement following the terminated statement. continue terminates execution of the statements in the current iteration of the current or labeled loop, and continues execution of the loop with the next iteration. empty an empty statement is used to provide no statement, although the javascript syntax would expect one. if...else executes a statement if a
specified condition is true. 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 v...
...ned 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 specifies the value to be returned by a function. class declares a class. iterations do...while creates a loop that executes a
specified statement until the test condition evaluates to false. the condition is evaluated after ...
...ns enable writing iterators more easily. async function declares an async function with the
specified parameters. return specifies the value to be returned by a function. class declares a class. iterations do...while creates a loop that executes a
specified statement until the test condition evaluates to false. the condition is evaluated after executing the statement, resulting in the
specified statement executing at least once. for creates a loop that consists of three optional expressions, enclosed in parentheses and separated by semicolons, followed by a statement executed in the loop. for each...in iterates a
specified variable over all values of object's properties. for each distinct property, a
specified statement is executed. for...in iterates over the enumerable properti...
...s, array-like objects, iterators and generators), invoking a custom iteration hook with statements to be executed for the value of each distinct property. for await...of iterates over async iterable objects, array-like objects, iterators and generators, invoking a custom iteration hook with statements to be executed for the value of each distinct property. while creates a loop that executes a
specified statement as long as the test condition evaluates to true. the condition is evaluated before executing the statement. others debugger invokes any available debugging functionality. if no debugging functionality is available, this statement has no effect. export used to export functions to make them available for imports in external modules, and other scripts. import used to import funct...
simple-prefs - Archive of obsolete content
ct a file" } directory displayed as a "browse" button that opens a directory picker and stores the full path and name of the directory selected. { "type": "directory", "name": "mydirectory", "title": "select a directory" } menulist displayed as a drop-down list. the type of the stored value depends on the default value. the options are
specified by a mandatory "options" attribute, that is an array of objects with mandatory attributes "label" and "value" the values of the "value" attributes must be supplied as strings. the values of the "label" attributes prefixed with "{name}_options.", where {name} is the name of the preference, are used as localization keys. if no matching entries are found, the value of the "label" attribu...
...": 0, "options": [ { "value": "0", "label": "fire" }, { "value": "1", "label": "cold" }, { "value": "2", "label": "disintegration" } ] } radio displayed as radio buttons. the type of the stored value depends on the default value. the options are
specified by a mandatory "options" attribute, that is an array of objects with mandatory attributes "label" and "value" the values of the "value" attributes must be supplied as strings. the values of the "label" attributes prefixed with "{name}_options.", where {name} is the name of the preference, are used as localization keys. if no matching entries are found, the value of the "label" attribu...
...uire("sdk/simple-prefs").on("someotherpreference", onprefchange); // `""` listens to all changes in the extension's branch require("sdk/simple-prefs").on("", onprefchange); parameters prefname : string the name of the preference to watch for changes. listener : function the listener function that processes the event. removelistener(prefname, listener) unregisters an event listener for the
specified preference. parameters prefname : string the name of the preference to watch for changes. listener : function the listener function that processes the event. properties prefs this property is an object containing the simple-prefs you have defined for your add-on. you can use it to access preference values and to change them. suppose you've defined a preference like this: "preferences":...
widget - Archive of obsolete content
lement the main user interface as a widget hosting an array of buttons to control play/pause/stop functions. we can then use a content script to listen for clicks on those buttons. but because content scripts can't use the sdk's apis, we'll want the content script to send messages to the main add-on code, which can then implement the media player functions using the sdk. the widget's content is
specified using html like this: <html> <body> <img src="play.png" id="play-button"> <img src="pause.png" id="pause-button"> <img src="stop.png" id="stop-button"> </body> </html> we just include three icons, and assign an id to each one. this html file, and the icon files it references, are saved in the add-on's data directory. next, we write a content script that listens for click events...
...contenturl = "http://www.yahoo.com/favicon.ico"; } }); // a widget that updates content on a timer. widgets.widget({ id: "auto-update-widget", label: "widget that updates content on a timer", content: "0", contentscript: 'settimeout(function() {' + ' document.body.innerhtml++;' + '}, 2000)', contentscriptwhen: "ready" }); // a widget created with a
specified width, that grows. var mywidget = widgets.widget({ id: "widget-effect", label: "wide widget that grows wider on a timer", content: "i'm getting longer.", width: 50, }); require("sdk/timers").setinterval(function() { mywidget.width += 10; }, 1000); // a widget communicating bi-directionally with a content script. var widget = widgets.widget({ id: "message-test", label: "bi-direction...
... allow object an optional object describing permissions for the content. it should contain a single key named script whose value is a boolean that indicates whether or not to execute script in the content. script defaults to true. contentscriptfile string,array a local file url or an array of local file urls of content scripts to load. content scripts
specified by this property are loaded before those
specified by the contentscript property. contentscript string,array a string or an array of strings containing the texts of content scripts to load. content scripts
specified by this property are loaded after those
specified by the contentscriptfile property. contentscriptwhen string when to load the content ...
event/target - Archive of obsolete content
n onmessage(message) { // note: `this` pseudo variable is an event `target` unless // intentionally overridden via `.bind()`. console.log(message); }); sometimes event listener may care only about very first event of specific type. eventtarget interface defines convenience method for adding one shot event listeners via method once. such listeners are called only once next time event of the
specified type is emitted: target.once('ready', function onready() { // do the thing once ready! }); removing listeners eventtarget interface defines api for unregistering event listeners, via removelistener method: target.removelistener('message', onmessage); emitting events eventtarget interface intentionally does not define an api for emitting events. in majority of cases party emitting events i...
... 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. ...
... parameters type : string the type of event. listener : function the listener function that processes the event. returns eventtarget : returns the eventtarget instance removelistener(type, listener) removes an event listener for the given event type. parameters type : string the type of event. listener : function the listener function that processes the event. ...
stylesheet/style - Archive of obsolete content
ose functions are part of content/mod module. parameters options : object required options: name type uri string,array a string, or an array of strings, that represents local uri to stylesheet. source string,array a string, or an array of strings, that contains css rules. ...
...this property is read-only. type the type of the sheet. ...
...the sheet. it accepts the following values: "agent", "user" and "author". if not provided, the default value is "author". style properties source an array of strings that contains the css rule(s)
specified in the constructor's option; null if no source option was given to the constructor. this property is read-only. uri an array of strings that contains the stylesheet local uri(s)
specified in the constructor's option; null if no uri option was given to the constructor. this property is read-only. type the type of the sheet. if no type is provided in constructor's option, it returns the default value, "author". this property is read-only. ...
ui/sidebar - Archive of obsolete content
ar by calling the sidebar's show() method. if a new window is opened from a window that has a sidebar visible, the new window gets a sidebar, too. you can hide the sidebar by calling its hide() method. called with no arguments, show() and hide() will operate on the currently active window. from firefox 33 onwards you can pass a browserwindow into these methods, and they will then operate on the
specified window. alternatively, the view->sidebar submenu in firefox will contain a new item which the user can use to show or hide the sidebar: the sidebar generates a show event when it is shown and a hide event when it is hidden. once you've finished using the sidebar you can destroy it by calling its dispose() method. to show what a sidebar looks like, here's a sidebar that displays the results of...
...e to show or hide the sidebar: the sidebar generates a show event when it is shown and a hide event when it is hidden. once you've finished using the sidebar you can destroy it by calling its dispose() method. to show what a sidebar looks like, here's a sidebar that displays the results of running the w3c validator on the current page: specifying sidebar content the content of a sidebar is
specified using html, which is loaded from the url supplied in the url option to the sidebar's constructor. unlike modules such as panel, the content must be local, typically loaded from the add-on's data directory via a url constructed using self.data.url(): var sidebar = require("sdk/ui/sidebar").sidebar({ id: 'my-sidebar', title: 'my sidebar', url: require("sdk/self").data.url("sidebar.html") });...
.... once a sidebar has been created it can be shown and hidden in the active window using its show() and hide() methods. once a sidebar is no longer needed it can be destroyed using dispose(). methods dispose() destroys the sidebar. once destroyed, the sidebar can no longer be used. show(window) displays the sidebar. parameters window : browserwindow the window in which to show the sidebar,
specified as a browserwindow. this parameter is optional. if it is omitted, then the sidebar will be shown in the currently active window. this parameter is new in firefox 33. hide(window) hides the sidebar. parameters window : browserwindow the window for which to hide the sidebar,
specified as a browserwindow. this parameter is optional. if it is omitted, then the sidebar will be hidden for the curr...
StringView - Archive of obsolete content
d length arguments passed). a new arraybufferview of stringview.buffer will be created. encoding optional a string expressing the encoding type. possible values are: utf-8 (default) utf-16 utf-32 another custom string. in this case it will be treated as ascii iso/iec 8859-15 during conversion to and/or from string. however it is usable also for binary strings. if not
specified (or
specified as null) it will default to utf-8. startoffset optional a number expressing: the start offset of the new stringview in bytes if the input argument is an arraybuffer the start offset of the new stringview in raw elements if the input argument is a typed array or other ordered object the start offset of the new stringview in codepoints if the input argument is a stringview o...
...l) it will default to utf-8. startoffset optional a number expressing: the start offset of the new stringview in bytes if the input argument is an arraybuffer the start offset of the new stringview in raw elements if the input argument is a typed array or other ordered object the start offset of the new stringview in codepoints if the input argument is a stringview or a string if not
specified (or
specified as null) it will default to 0. length optional a number expressing in codepoints the length of the new stringview if the input argument is a string or a stringview, or in raw elements if the input is a typed array, an arraybuffer or any other kind of ordered object (like array, collections, etc.). if not
specified it will take the length of the input. it never can be more than th...
...e of stringview constructed decoding a given base64-encoded string. arguments base64string (required) a base64-encoded string which will be decoded and copied into the new stringview object. encoding optional a string expressing the encoding type. for possible values see here. byteoffset optional a number expressing the start offset in bytes of the new stringview. if not
specified (or
specified as null) it will be considered as 0. length optional a number expressing the length in codepoints of the new stringview. if not
specified it will take the length of the input. examples var mystringview = stringview.makefrombase64("sgvsbg8gd29ybgqh"); alert(mystringview) // "hello world!" this function is useful in order to pass binary data containing string...
Style System Overview - Archive of obsolete content
hich the rules have no declarations. in this case: inherited structs: same value as parent style context (optimization breaks when property has non-inherit value) reset structs: same struct for every style context using rule node (optimization breaks when a value is explicit inherit) reset structs: rule nodes have the same shared struct as their parent (optimization breaks when a property is
specified with a different value or when there is an explicit inherit value). inherited structs act like reset ones in the descendants of any rule node for which the data are fully
specified. style data cached in style context tree if a style struct for a context depends on the data in the parent context, we will cache that struct in the style context tree. this happens when properties are inherited ...
...y nothing non-inherited for the struct. style data cached in rule tree if the data struct doesn't depend on the parent style context in any ways (inheritance, perhaps by omission; percentages and ems when computed), we can cache it in the rule tree. when we compute a data struct, we cache it as high as possible in the rule tree -- on the lowest of the rule nodes on the path to the root that
specified something for that struct. a rule node that uses the same struct as its parent is marked with a “dependent bit” for that struct, which tells nsrulenode::getstyledata to just get the struct from the parent. style data computation all the style struct computation described in the previous few slides happens lazily. first, nsstylecontext::getstyledata checks for a cached struct on the sty...
...ns must check that the property is not filled in before filling it in. walkruletree stops walking up when it finds either a none bit, a cached struct, a dependent bit, or all the properties have been filled in. walkruletree also remembers the first rule that contributed non-empty data. style data computation after walkruletree stops walking up, it calls nsrulenode::compute*data to turn the
specified values into the mostly-computed style data in the style struct. compute*data use either a default or a start struct as the basis for the computation. a start struct is a cached struct in the rule tree that we can just copy and add to. if the computation in compute*data used any data from the parent style context, we cache the struct on the style context. otherwise, we cache the struct in the r...
Using cross commit - Archive of obsolete content
x-enabled emacs on linux.) also note that if you don't specify any branches to commit on, cross-commit will commit to the trunk and the mozilla_1_8_branch by default. details cross-commit accepts the following options: all cvs options (those to the left of the specific cvs command) and cvs commit options (those to the right of a commit command), although the -r and -f cvs options need to be
specified as --cvs-r and --cvs-f to avoid conflict with the similarly named (but different in meaning) cvs commit options. you can list the files/directories you want it to commit on the command line or leave them out and let it recursively troll the current directory. --verbose=[0|1] makes the script output more text as it runs. this defaults to 1. --trunk makes cross-commit land the patch on head in ad...
...oid conflict with the similarly named (but different in meaning) cvs commit options. you can list the files/directories you want it to commit on the command line or leave them out and let it recursively troll the current directory. --verbose=[0|1] makes the script output more text as it runs. this defaults to 1. --trunk makes cross-commit land the patch on head in addition to any other branches
specified. this is equivalent to --branch head. --moz18 makes cross-commit land the patch on mozilla_1_8_branch in addition to any other branches
specified. this is equivalent to --branch mozilla_1_8_branch. --branch=branch-tag adds a branch to the list of branches to land the patch on. this may be
specified multiple times, each time with a different branch name. this may also be used in combination with...
...oz18 makes cross-commit land the patch on mozilla_1_8_branch in addition to any other branches
specified. this is equivalent to --branch mozilla_1_8_branch. --branch=branch-tag adds a branch to the list of branches to land the patch on. this may be
specified multiple times, each time with a different branch name. this may also be used in combination with --trunk and --moz18. if no branches are
specified, cross-commit will default to landing on head and mozilla_1_8_branch. ...
addDirectory - Archive of obsolete content
string relativelocalpath, boolean forceupdate); parameters the adddirectory method has the following parameters: 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. ...
...thod has the following parameters: 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...
...ing a directory. the file is installed under this directory on the user's computer. you create this object by passing a string representing the directory to the getfolder method. subdir the name of a directory to append to localdirspec, using '/' as the path separator regardless of the platform.if subdir is missing, null, or "", the filenames are appended directly to the folder name
specified by localdirspec. flags an optional field; reserved for future use. pass 0 as the default value. returns an integer error code. for a list of possible values, see return codes. in some situations, adddirectory may return other errors. description the adddirectory method puts the files in the
specified directory in a temporary location. to move the files and all other subcomponents ...
Return Codes - Archive of obsolete content
e path user_cancelled -210 user clicked cancel on install dialog install_not_started -211 a problem occurred with the parameters to initinstall, or initinstall was not called first silent_mode_denied -212 the silent installation privilege has not been granted. ...
...t_started -211 a problem occurred with the parameters to initinstall, or initinstall was not called first silent_mode_denied -212 the silent installation privilege has not been granted. 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. ...
...lled first silent_mode_denied -212 the silent installation privilege has not been granted. 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 -215 the
specified file cannot be deleted because its permissions are set to read only. is_directory -216 the
specified file cannot be deleted because it is a directory. network_file_is_in_use -217 the
specified file cannot be deleted because it is in use. apple_single_err -218 an error occurred when unpacking a file in applesingle ...
loadOneTab - Archive of obsolete content
« xul reference home loadonetab( url, referreruri, charset, postdata, loadinbackground, allowthirdpartyfixup ) loadonetab( url, { referreruri: ..., charset: ..., postdata: ..., inbackground: ..., allowthirdpartyfixup: ..., relatedtocurrent: ... }) return type: tab element opens a new tab that loads a page with the
specified url. the rest of the parameters are optional. ...
...: ..., allowthirdpartyfixup: ..., relatedtocurrent: ... }) return type: tab element opens a new tab that loads a page with the
specified url. the rest of the parameters are optional. this method works the same as addtab except for the loadinbackground parameter which allows you to choose whether to open the new tab in foreground or background. there's also no owner parameter as the owner tab is
specified automatically. parameters inbackground if true the tab will be loaded in the background, if false the tab will be the newly selected tab. and if null or not
specified, this parameter will default to the browser.tabs.loadinbackground preference. firefox 3.6 note the second form of this method was added in firefox 3.6; it adds the relatedtocurrent parameter, and allows the para...
...y. parameters inbackground if true the tab will be loaded in the background, if false the tab will be the newly selected tab. and if null or not
specified, this parameter will default to the browser.tabs.loadinbackground preference. firefox 3.6 note the second form of this method was added in firefox 3.6; it adds the relatedtocurrent parameter, and allows the parameters to be
specified by name, in any order. ...
Template Logging - Archive of obsolete content
oo.com/birds new active result for query 2 matching rule 1: http://www.some-fictitious-zoo.com/birds/emperorpenguin in the example above, a new result has been added. for references, the value of the template's id and ref attributes are provided in each logged message. this is useful if multiple templates are being used. the second line gives details about the new result. the id of the result is
specified at the end, in this case 'http://www.some-fictitious-zoo.com/b...emperorpenguin'. this corresponds to the id attribute set on a generated row. for an rdf datasource, this will be the result's resource. for other datasources, this may be a somewhat random value. however, calling getelementbyid using this id will retrieve the generated content for that result if you want to further study the conten...
...the log would say 'new inactive query'. in template with id root using ref http://www.some-fictitious-zoo.com/birds removed inactive result for query 2 (active query is 1): http://www.some-fictitious-zoo.com/birds/barnowl in this example, a result with the id 'http://www.some-fictitious-zoo.com/birds/barnowl' has been removed. again, it was a result from query 2. however, note that the result is
specified as being 'inactive'. this is because the result is also supplied by the first query which overrides it. the template's generated content will not change in this example as an active result is not changing. in other words, the generated content will only change when active results are involved. in template with id root using ref http://www.some-fictitious-zoo.com/birds removed active result for qu...
...has to be set to a resource predicate. <triple> requires a variable for its object attribute the object attribute on a <triple> element has to be variable (a value beginning with a question mark). this error can also occur if the object attribute was not set. neither container or child variables of <member> has a value this indicates that a <member> was being checked and yet neither the variables
specified for the container or the child have a value for a result. this error will occur while processing a result and will often repeat for each result. this error generally indicates an error in the logic of the template. common errors are misspelled variable names or <member> and <triple> elements placed in the wrong order. note that this error does not occur simply because, for example, a particular c...
Advanced Rules - Archive of obsolete content
ated. content element the conditions element can contain three elements. the first is the content element, which should always exist once and only once. it serves as a placeholder as the template builder iterates through the resources. it specifies the name of a variable in which is placed a reference to the root resource while the conditions are analyzed for a match. the root resource is the one
specified by the ref attribute on the element containing the template. the syntax of the content element is as follows: <content uri="?var"/> the question mark indicates that the text following it is a variable. you can then use the variable 'var' within the remainder of the conditions. of course, you can name the variable whatever you want. member element the next element is the member element, which is ...
...net.com/rdf/weather/cities"> <template> <rule> <conditions> <content uri="?list"/> <member container="?list" child="?city"/> </conditions> <rule> <template> </tree> the template builder starts by grabbing the value of the ref attribute, which in this case is http://www.xulplanet.com/rdf/weather/cities. this resource will be placed in the 'list' variable as
specified by the content tag. we can then get related resources to the root resource by using the 'list' variable. the template builder then sees the member element. it causes the builder to iterate over the children of an element. the parent is
specified by the container attribute and the children are
specified by the child attribute. in the example above, the value of the container attribute is the varia...
...this should be the content for the rows of the tree, menu items, or whatever content you want to generate. within the content, you can refer to variables that were defined in the conditions. thus, in the weather example above, you could use the variables 'name' or 'pred' to display the city or prediction. you can use the 'list' or 'city' variables also, but they hold re...
Manifest Files - Archive of obsolete content
nt/browser/ xpcnativewrappers=yes overlay chrome://global/content/viewsource.xul chrome://browser/content/viewsourceoverlay.xul overlay chrome://global/content/viewpartialsource.xul chrome://browser/content/viewsourceoverlay.xul overlay chrome://browser/content/pageinfo.xul chrome://pippki/content/pageinfooverlay.xul two packages are listed here, 'branding' and 'browser'. three overlays are also
specified, which allow content from different packages to combine together. extensions will make the most use of overlays, since they merge their ui with the browser ui. the file paths for the branding and browser packages use jar urls as the content is packaged up into an archive. a jar archive can be created with a zip utility. for a jar file located in the chrome directory, the syntax is fairly simple: ...
...ou change them. however, when distributing an application or extension, you will want to package them into an archive to avoid having to install lots of smaller files. the xpcnativewrappers=yes part at the end of the manifest line is a flag that may optionally be used. in javascript, it is possible for a web page to override built-in functions with their own code. if the xpcnativewrappers flag is
specified, it indicates that scripts running in a privileged context don't call these overridden versions, but the original built-in versions instead. otherwise, if an extension attempted to call the modified versions, it would likely not work properly, or worse, create a security hole. this flag was added to prevent this problem and should always be used for newer extensions, but is left out for older ext...
...were distributing the package, we would want to package them up into a jar file, and modify the paths. in this case, we are just creating to demonstrate a manifest file and to prepare directories for examples which will see in the later sections. note how the second field of the skin and locale lines specifies 'findfile'. this means that the skin and locale modify the findfile package, which was
specified on the first line.the three paths above specify subdirectories for each part. you will want to create these subdirectories to keep each part's files separate. installing a package for an application to be installed, you will need to create an installer for it, or include it as part of another application. the method used depends on what kind of application you are creating. for extensions, you w...
Trees - Archive of obsolete content
e view <tree flex="1"> <treecols> <treecol id="namecolumn" label="name" flex="1"/> <treecol id="addresscolumn" label="address" flex="2"/> </treecols> <treechildren/> </tree> first, the entire table is surrounded with a tree element. this declares an element that is used as a table or tree. as with html tables, the data in a tree is always organized into rows. the columns are
specified using the treecols tag. you may place as many columns as you wish in a tree. as with listboxes, a header row will appear with column labels. a drop-down menu will appear in the upper-right corner of the tree, which the user may use to show and hide individual columns. each column is created with a treecol element. you can set the header label using the label attribute. you may also want to make ...
... is created with a treecol element. you can set the header label using the label attribute. you may also want to make the columns flexible if your tree is flexible, so that the columns stretch as the tree does. in this example, the second column will be approximately twice as wide as the first column. all of the columns should be placed directly inside a treecols element. in this case we haven't
specified a view to supply the tree's data, so we'll only see column headers and an empty tree body. you may have to resize the window to see anything since there isn't any data to display. since the tree has been marked as flexible, the body will stretch to fit the available space. making a tree flexible is quite commonly done, as it is often the case that the data in the tree is the most significant info...
...ould be placed inside a treeitem tag. treecell a single cell in a tree. this element would go inside a treerow element. conveniently, these tags may be placed directly inside the treechildren tag, nested in the order above. the tags define the data to be displayed in the tree body. in this case, the tree uses the built-in tree view, called a content tree view, which uses the labels and values
specified on these elements as the data for the tree. when the tree needs to display a row, the tree asks the content tree view for a cell's label by calling the view's getcelltext function, which in turn gets the data from the label of the appropriate treecell. however, the three elements listed above are not displayed directly. they are used only as the source for the data for the view. thus, only a han...
menu - Archive of obsolete content
should be one of the characters that appears in the label attribute for the element. allowevents type: boolean if true, events are passed to children of the element. otherwise, events are passed to the element only. crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side
specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales. end the text will be cropped on its right side in left-to-right text ...
...tattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata appenditem( label, value ) return type: element creates a new item and adds it to the end of the existing list of items. you may optionally set a value. the function returns the newly created element. getindexofitem( item ) return type: integer returns the zero-based position of the
specified item. items are numbered starting at the first item displayed in the list. getitematindex( index ) return type: element returns the element that is at the
specified index. insertitemat( index, label, value ) return type: element this method creates a new item and inserts it at the
specified position. you may optionally set a value. the new item element is returned. ...
...the method returns the removed item. style classes menu-iconic use this class to have an image appear on the menu. specify the image using the image attribute. ...
menulist - Archive of obsolete content
</menupopup> </menulist> attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the label attribute for the element. crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side
specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales. end the text will be cropped on its right side in left-to-right text ...
...(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata appenditem( label, value, description ) return type: element creates a new menuitem element and adds it to the end of the menulist. you may optionally set a value and description. the function returns the new item. contains( item ) return type: boolean returns true if the menulist contains the
specified menuitem as one of its items. getindexofitem( item ) return type: integer returns the zero-based position of the
specified item. items are numbered starting at the first item displayed in the list. getitematindex( index ) return type: element returns the element that is at the
specified index. insertitemat( index, label, value ) return type: element this method creat...
...indexofitem( item ) return type: integer returns the zero-based position of the
specified item. items are numbered starting at the first item displayed in the list. getitematindex( index ) return type: element returns the element that is at the
specified index. insertitemat( index, label, value ) return type: element this method creates a new item and inserts it at the
specified position. you may optionally set a value. the new item element is returned. removeallitems() return type: no return value removes all of the items in the menu. removeitemat( index ) return type: element removes the child item in the element at the
specified index. the method returns the removed item. select() return type: no return value select all the text in the me...
textbox - Archive of obsolete content
more information is available in the xul tutorial. ...
... the enter key. otherwise, the command event is fired whenever the user modifies the value. this attribute only applies to textboxes with the type search. size type: integer the number of characters that can be displayed in the textbox. spellcheck type: boolean if true, spell checking is enabled by default for the text box; if false, spell checking is disabled by default. ...
...ntered in a textbox. the attribute only holds the default value and is never modified when the user enters text. to get the updated value, use the value property. for number boxes, the default is 0 or the minimum value returned 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 infinity. properties accessibletype type: integer a value indicating the type of accessibility object for the element. clickselectsall type: bool...
NPClass - Archive of obsolete content
ct's reference count reaches zero. if this field is null, free() is called isntead. invalidate called on live objects that belong to a plugin instance that is being destroyed. this call is always followed by a call to the deallocate function, or free(). any attempt to use an invalidated object will result in undefined behavior. hasmethod called by npn_hasmethod() to determine whether or not a
specified method exists on a given npobject. returns true if the method exists, otherwise returns false. invoke called by npn_invoke() to invoke a specific method on a given npobject. returns true if invocation succeeded or false if an error occurred. invokedefault called by npn_invokedefault() to invoke the default method (if available) on a given npobject. returns true if invocation succeeded or fals...
... method on a given npobject. returns true if invocation succeeded or false if an error occurred. invokedefault called by npn_invokedefault() to invoke the default method (if available) on a given npobject. returns true if invocation succeeded or false if an error occurred. hasproperty called by npn_hasproperty() to check whether a given property exists on a given npobject. returns true if the
specified property exists, otherwise returns false. getproperty called by npn_getproperty() to get the value of the
specified property on a given npobject. returns true if the value was successfully retrieved, otherwise returns false. setproperty called by npn_setproperty() to set the value of the
specified property on a given npobject. returns true if the value was successfully set, otherwise returns ...
...returns true if the property was successfully removed, otherwise returns false. enumerate called by npn_enumerate. this field is available only if structversion is np_class_struct_version_enum (2) or greater. construct called by npn_construct. this field is available only if structversion is np_class_struct_version_ctor (3) or greater. ...
Introduction to SSL - Archive of obsolete content
er's certificate as a valid "letter of introduction" from that ca and proceeds. at this point, the client has determined that the server certificate is valid. it is the client's responsibility to take step 4 before step 5. does the domain name in the server's certificate match the domain name of the server itself? this step confirms that the server is actually located at the same network address
specified by the domain name in the server certificate. although step 4 is not technically part of the ssl protocol, it provides the only protection against a form of security attack known as "man in the middle." clients must perform this step and must refuse to authenticate the server or establish a connection if the domain names don't match. if the server's actual domain name matches the domain name in t...
... premaster secret the client sends in step 4 of "the ssl handshake." otherwise, the ssl session will be terminated. this provides additional assurance that the identity associated with the public key in the server's certificate is in fact the server with which the client is connected. man-in-the-middle attack as suggested in step 4 above, the client application must check the server domain name
specified in the server certificate against the actual domain name of the server with which the client is attempting to communicate. this step is necessary to protect against a man-in-the-middle attack, which works as follows. the "man in the middle" is a rogue program that intercepts all communication between the client and a server with which the client is attempting to communicate via ssl. the rogue pr...
...al signature? the server checks that the user's digital signature can be validated with the public key in the certificate. if so, the server has established that the public key asserted to belong to john doe matches the private key used to create the signature and that the data has not been tampered with since it was signed. at this point, however, the binding between the public key and the dn
specified in the certificate has not yet been established. the certificate might have been created by someone attempting to impersonate the user. to validate the binding between the public key and the dn, the server must also complete step 3 and step 4. is today's date within the validity period? the server checks the certificate's validity period. if the current date and time are outside of that range,...
-ms-filter - Archive of obsolete content
hat sets or retrieves the filter or collection of filters applied to an object. warning: not to be confused with the standard filter property, as the two are fundamentally incompatible with each other. important: as of windows internet explorer 9 this feature was deprecated. as of internet explorer 10 this feature was removed and should no longer be used. ...
...ght, #ffffff 0%, #000000 100%); } .gradient.vertical { -ms-filter: 'progid:dximagetransform.microsoft.gradient(startcolorstr="#ffffff", endcolorstr="#000000", gradienttype=0)'; background-image: linear-gradient(to bottom, #ffffff 0%, #000000 100%); } result specifications not part of any specification. ...
...explorer 8, the -ms-filter attribute is an extension to css, and can be used as a synonym for filter in ie8 standards mode. when you use -ms-filter, enclose the progid in single quotes (') or double quotes ("). use commas (,) to separate multiple values, as shown in the examples section. an object must have layout for the filter to render. a simple way to accomplish this is to give the element a
specified height and width, or both. the shadow filter can be applied to the <img> object by setting the filter on the image's parent container. the filter mechanism is extensible and enables you to develop and add filters later. for more information about filters, see introduction to filters and transitions. ...
Archived JavaScript Reference - Archive of obsolete content
.transfer() method returns a new arraybuffer whose contents have been taken from the oldbuffer's data and then is either truncated or zero-extended by newbytelength. if newbytelength is undefined, the bytelength of the oldbuffer is used. ...
...s a date to a string using the
specified formatting. intl.datetimeformat is an alternative to format dates in a standards-compliant way. see also the newer version of date.prototype.tolocaledatestring().ecmascript 2016 to es.next support in mozillaexpression closuresexpression closures are a shorthand function syntax for writing simple functions.for each...inthe for each...in statement iterates a
specified variable over all values of object's properties. for each distinct property, a
specified statement is executed.function.aritynot part of any standard.function.prototype.isgenerator()the non-standard isgenerator() method used to determine whether or not a function is a generator. it has been removed from firefox starting with version 58.generator comprehensionsthe generator comprehension syntax wa...
...rable object. however, it has been removed from the standard and the firefox implementation. do not use it!handler.enumerate()the handler.enumerate() method used to be a trap for for...in statements, but has been removed from the ecmascript standard in es2016 and is deprecated in browsers.legacy generator functionthe legacy generator function statement declares legacy generator functions with the
specified parameters.legacy generator function expressionthe function keyword can be used to define a legacy generator function inside an expression. to make the function a legacy generator, the function body should contain at least one yield expression.microsoft javascript extensionsmicrosoft browsers (internet explorer, and in a few cases, microsoft edge) support a number of special microsoft extensions ...
Describing microformats in JavaScript - Archive of obsolete content
ries: mfversion specifies the version number of the microformat api to which the definition was written. 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"). required an array indicating the names of any properties that must be
specified. this may be left out if all properties are optional. properties a structure describing the properties of the microformat. property specifications each property in the properties structure is
specified by its name, and may include additional attributes if the property so requires. standard attributes are: plural a boolean value indicating that, if true indicates that the property can hav...
...ies; to do so, include them in a subproperties structure within the property. datatype the type of data contained by the property. possible values are: datetime an iso date anyuri a uri email an email address tel a telephone 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. the adr microformat is defined as follows: var adr_definition = { mfversion: 0.8, mfobject: adr, classname: "adr", properties: { "type" : { plural: true, types: ["work", "home", "pref", "postal", "dom", "int...
... "street-address" : { plural: true }, "extended-address" : { }, "locality" : { }, "region" : { }, "postal-code" : { }, "country-name" : { } } }; the properties are quite simple here. the type property indicates the type of address represented by the object (work, home, and so forth). since the plural property is true, multiple 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_definition); note: to be clea...
Parsing microformats in JavaScript - Archive of obsolete content
if it is a subproperty, this is the parent property node. otherwise this is the microformat node. datatype "html" if the search should be done using innerhtml(), or "text" to use innertext(). the default is "text". return value a string containing the property's value. emailgetter() specifically retrieves an email address from a microformat node. this removes the subject if one is
specified, as well as the mailto: prefix. email = microformats.parser.emailgetter(propnode, parentnode); parameters propnode the dom node to check. parentnode the property's parent node. if it is a subproperty, this is the parent property node. otherwise this is the microformat node. return value a string containing the email address. htmlgetter() retrieves all the html from ...
...w functions you can call to retrieve the html and do other tasks. the functions you can call on the returned object are: string = html.tostring(); returns a string using innertext(). string = html.tohtml(); returns the node's html using innerhtml(). string = html.replace(a, b); returns a string in which all occurrences of a in the html are replaced with b. string = html.match(a); performs the
specified matching operation on the html and returns the result. iso8601fromdate converts a javascript date object into an iso 8601 formatted date. isodate = microformats.parser.iso8601fromdate(date, punctuation) parameters date the javascript date object to convert. punctuation true if the date should have "-" and "/" in it. return value a string containing the iso 8601 formatted date. textge...
...r dom node, including all tags. this calls defaultgetter() internally. text = microformats.parser.textgetter(propnode, parentnode); parameters propnode the dom node to check. parentnode the property's parent node. if it is a subproperty, this is the parent property node. otherwise this is the microformat node. return value a string containing all the text from the
specified microformat node, including the tags. telgetter() specifically retrieves a telephone number from a microformat node. this handles the fact that telephone numbers use "value" as the name of one of their subproperties, but "value" is also used for value excerpting. tel = microformats.parser.telgetter(propnode, parentnode); parameters propnode the dom node to check. parentnode the proper...
XUL Parser in Python - Archive of obsolete content
e_dir = 'd:\src\mozilla\xpfe' >>> res = myxp.parsexul(chrome_dir, 'window', 'id') where something like the above would write out all the xul window ids in the build. something like that, anyway. results the results from the script are written to a file called res.html. this is another hard-coded thing i have to open up. if you want to test this script you should change the filename "res.html"
specified in the fourth line and compare different results files. note also that i wrote the build number into the header myself, and haven't figured out yet how to get that written automatically. i guess you could get a modify date from the files as you open them. how the script works as i said before, there isn't too much to explain in this script, particularly if you have used python's xmllib parser b...
...he middle of it is a subclass of the xmllib parser that overrides that parser's unknown_starttag method and asks it to do all the work. the unknown_starttag handler is fed the tag name, the attributes of that tag, and the attributes' values, so all you have to do as you hit each xul element is build up a nested dictionary of elements and their associated attributes. after all the xul files in the
specified directory and its subdirectories are fed to the parser and parsed (using the win32 system's <tt>dir /s /b *.xul</tt> command), the dictionary of dictionaries is sorted and written into an html table. the xml namespace support in xmllib was resolving the xul and html namespaces in a very annoying way, so i have an additional function, strip(), that takes off the whole namespace that xmllib is try...
...o tack onto the front of each item it finds in the xml. some modifications to this script may suggest other uses. the parser provides the tag name itself as a string and the attributes and their values in a dictionary, "a". if you want to look for certain widgets within the xul files, you can get the filename from the calling method p.feed(data) and create a condition that only gets the elements
specified in sys.argv[1]. or, since the dictionary is already storing the values of all the attributes it finds, you can write the values of a particular attribute (e.g., id) to the results file by checking the attribute in sys.argv[1]: for attr in a.keys(): if strip(attr) == sys.argv[1]: el_list[name][strip(attr)] = strip(a[attr]) and writing thevalues to the html results file instead of thekey...
Graceful asynchronous programming with Promises - Learn web development
ation for resource "${url}": ` + e.message); }); } this looks a bit complex, so let's run through it step by step: first of all, we define the function, passing it a url and a string representing the type of resource it is fetching. inside the function body, we have a similar structure to what we saw in the first example — we call the fetch() function to fetch the resource at the
specified url, then chain it onto another promise that returns the decoded (or "read") response body. this was always the blob() method in the previous example. however, two things are different here: first of all, the second promise we return is different depending on what the type value is. inside the executor function, we include a simple if ... else if statement to return a different promi...
...assed a string of "success!". in the below code we simply alert that message: timeoutpromise .then((message) => { alert(message); }) or even just timeoutpromise.then(alert); try running this live to see the result (also see the source code). the above example is not very flexible — the promise can only ever fulfil with a single string, and it doesn't have any kind of reject() condition
specified (admittedly, settimeout() doesn't really have a fail condition, so it doesn't matter for this simple example). note: why resolve(), and not fulfill()? the answer we'll give you, for now, is it's complicated. rejecting a custom promise we can create a promise that rejects using the reject() method — just like resolve(), this takes a single value, but in this case, it is the reason to reject...
... check to see if the message is appropriate for being alerted. if it is an empty string or not a string at all, we reject the promise with a suitable error message. next, we check to see if the interval is an appropriate interval value. if it is negative or not a number, we reject the promise with a suitable error message. finally, if the parameters both look ok, we resolve the promise with the
specified message after the
specified interval has passed using settimeout(). since the timeoutpromise() function returns a promise, we can chain .then(), .catch(), etc. onto it to make use of its functionality. let's use it now — replace the previous timeoutpromise usage with this one: timeoutpromise('hello there!', 1000) .then(message => { alert(message); }) .catch(e => { console.log('error: ' ...
Introduction to events - Learn web development
uld also experiment with these, and try to use them where possible. the main advantages of the third mechanism are that you can remove event handler code if needed, using removeeventlistener(), and you can add multiple listeners of the same type to elements if required. for example, you can call addeventlistener('click', function() { ... }) on an element multiple times, with different functions
specified in the second argument. this is impossible with event handler properties because any subsequent attempts to set a property will overwrite earlier ones, e.g.: element.onclick = function1; element.onclick = function2; etc. note: if you are called on to support browsers older than internet explorer 8, you may run into difficulties, as such ancient browsers use different event models from newer br...
...bout this too much at this stage in your learning journey. other event concepts in this section, we briefly cover some advanced concepts that are relevant to events. it is not important to understand these concepts fully at this point, but they might serve to explain some code patterns you'll likely come across. event objects sometimes inside an event handler function, you'll see a parameter
specified with a name such as event, evt, or simply e. this is called the event object, and it is automatically passed to event handlers to provide extra features and information. for example, let's rewrite our random color example again slightly: function bgchange(e) { const rndcol = 'rgb(' + random(255) + ',' + random(255) + ',' + random(255) + ')'; e.target.style.backgroundcolor = rndcol; console...
...to allow you to access it and do something with it. preventing default behavior sometimes, you'll come across a situation where you want to prevent an event from doing what it does by default. the most common example is that of a web form, for example, a custom registration form. when you fill in the details and select the submit button, the natural behavior is for the data to be submitted to a
specified page on the server for processing, and the browser to be redirected to a "success message" page of some kind (or the same page, if another is not
specified.) the trouble comes when the user has not submitted the data correctly — as a developer, you want to prevent the submission to the server and give an error message saying what's wrong and what needs to be done to put things right. some brow...
Client-Server Overview - Learn web development
e). head: get the metadata information about a specific resource without getting the body like get would. you might for example use a head request to find out the last time a resource was updated, and then only use the (more "expensive") get request to download the resource if it has changed. put: update an existing resource (or create a new one if it doesn't exist). delete: delete the
specified resource. trace, options, connect, patch: these verbs are for less common/advanced tasks, so we won't cover them here. additional information can be encoded with the request (for example, html form data). information can be encoded as: url parameters: get requests encode data in the url sent to the server by adding name/value pairs onto the end of it — for example http://mysite.c...
...ase the cookie includes an id for managing sessions (cookie: sessionid=6ynxs23n521lu21b1t136rhbv7ezngie; ...). the remaining lines contain information about the browser used and the sort of responses it can handle. for example, you can see here that: my browser (user-agent) is mozilla firefox (mozilla/5.0). it can accept gzip compressed information (accept-encoding: gzip). it can accept the
specified set of characters (accept-charset: iso-8859-1,utf-8;q=0.7,*;q=0.7) and languages (accept-language: de,en;q=0.7,en-us;q=0.3). the referer line indicates the address of the web page that contained the link to this resource (i.e. the origin of the request, https://developer.mozilla.org/). http requests can also have a body, but it is empty in this case. the response the first part of the respon...
... the url doesn't have any parameters. as you can see, the information from the form is encoded in the body of the request (for example, the new user fullname is set using: &user-fullname=hamish+willee). the response the response from the request is shown below. the status code of "302 found" tells the browser that the post succeeded, and that it must issue a second http request to load the page
specified in the location field. the information is otherwise similar to that for the response to a get request. http/1.1 302 found server: apache x-backend-server: developer3.webapp.scl3.mozilla.com vary: cookie vary: accept-encoding content-type: text/html; charset=utf-8 date: wed, 07 sep 2016 00:38:13 gmt location: https://developer.mozilla.org/profiles/hamishwillee keep-alive: timeout=5, max=1000 conn...
Command line crash course - Learn web development
mpty (and also remove everything it contains), then you can use the -r option (recursive), but this is dangerous. make sure there is nothing you might need inside the directory later on, as it will be gone forever. touch — creates a new empty file, inside the current directory. for example, touch mdn-example.md creates a new empty file called mdn-example.md. mv — moves a file from the first
specified file location to the second
specified file location, for example mv mdn-example.md mdn-example.txt (the locations are written as file paths). this command moves a file called mdn-example.md in the current directory to a file called mdn-example.txt in the current directory. technically the file is being moved, but from a practical perspective, this command is actually renaming the file. cp — si...
...xample.md mdn-example.txt (the locations are written as file paths). this command moves a file called mdn-example.md in the current directory to a file called mdn-example.txt in the current directory. technically the file is being moved, but from a practical perspective, this command is actually renaming the file. cp — similar in usage to mv, cp creates a copy of the file in the first location
specified, in the second location
specified. for example, cp mdn-example.txt mdn-example.txt.bak creates a copy of mdn-example.txt called mdn-example.txt.bak (you can of course call it something else if you wish). rm — removes the
specified file. for example, rm mdn-example.txt deletes a single file called mdn-example.txt. note that this delete is permanent and can’t be undone via the recycle bin that...
...ingle file called mdn-example.txt. note that this delete is permanent and can’t be undone via the recycle bin that you might have on your desktop user interface. note: many terminal commands allow you to use asterisks as "wild card" characters, meaning "any sequence of characters". this allows you to run an operation against a potentially large number of files at once, all of which match the
specified pattern. as an example, rm mdn-* would delete all files beginning with mdn-. rm mdn-*.bak would delete all files that start with mdn- and end with .bak. terminal — considered harmful? we’ve alluded to this before, but to be clear — you need to be careful with the terminal. simple commands do not carry too much danger, but as you start putting together more complex commands, you need to t...
Package management basics - Learn web development
. press return one more time to accept these settings. go into your parcel-experiment directory and you should now find you've got a package.json file. open it up and it should look something like this: { "name": "parcel-experiment", "version": "1.0.0", "description": "a simple npm package to learn about using npm", "main": "index.js", "scripts": { "test": "echo \"error: no test
specified\" && exit 1" }, "author": "chris mills", "license": "isc" } so this is the config file that defines your package. this is good for now, so let's move on. installing parcel run the following command to install parcel locally: npm install parcel-bundler once that's done all the things, we're now ready for some "modern client-side development" (which really means using build tools to make...
...rol this too. you can ask for date-fns@1, which gives you the latest 1.x version (which is 1.30.1). or you could try date-fns@^2.3.0, which means the latest version after or including 2.3.0 (2.8.1 at the time of writing). updating dependencies npm update yarn upgrade this will look at the currently installed dependencies and update them, if there is an update available, within the range that's
specified in the package. the range is
specified in the version of the dependency in your package.json, such as date-fns@^2.0.1 — in this case the caret character ^ means all minor and patch releases after and including 2.0.1, up to but excluding 3.0.0. this is determined using a system called semver, which might look a bit complicated from the documentation but can be simplified by considering only th...
...d parcel server filename.html, and we’d like to use that often during our development. so let’s create a custom shorthand command — “dev” — in our package.json. if you followed the tutorial from earlier, you should have a package.json file inside your parcel-experiment directory. open it up, and its scripts member should look like this: "scripts": { "test": "echo \"error: no test
specified\" && exit 1", }, update it so that it looks like this, and save the file: "scripts": { "test": "echo \"error: no test
specified\" && exit 1", "dev": "parcel serve index.html" }, we’ve added a custom dev command as an npm script. now try running the following in your terminal, making sure you are inside the parcel-experiment directory: npm run dev this should start parcel and serve up...
HTTP logging
s the exact same format as the moz_log environment variable (see below). generally the default list is ok, unless a mozilla developer has told you to modify it. click on start logging. reproduce the bug (i.e. go to the web site that is broken for you and make the bug happen in the browser) make a note of the value of "current log file". click on stop logging. go to the folder containing the
specified log file, and gather all the log files. you will see several files that look like: log.txt-main.1806, log.txt-child.1954, log.txt-child.1970, etc. this is because firefox now uses multiple processes, and each process gets its own log file. for many bugs, the "log.txt-main" file is the only thing you need to upload as a file attachment to your bugzilla bug (this is assuming you're logging to hel...
...ze. (unknown modules are ignored, so it's ok to use 'rotate' in your environment even if you're running firefox <= 50: it will do nothing). this is accomplished by splitting the log into up to 4 separate files (their filenames have a numbered extension, .0, .1, .2, .3) the logging back end cycles the files it writes to, while ensuring that the sum of these files’ sizes will never go over the
specified limit. note 1: the file with the largest number is not guarantied to be the last file written! we don’t move the files, we only cycle. using the rotate module automatically adds timestamps to the log, so it’s always easy to recognize which file keeps the most recent data. note 2: rotate doesn’t support append. when you specify rotate, on every start all the files (including any previo...
...ten! we don’t move the files, we only cycle. using the rotate module automatically adds timestamps to the log, so it’s always easy to recognize which file keeps the most recent data. note 2: rotate doesn’t support append. when you specify rotate, on every start all the files (including any previous non-rotated log file) are deleted to avoid any mixture of information. the append module
specified is then ignored. use 'sync' if your browser crashes or hangs by default, http logging buffers messages and only periodically writes them to disk (this is more efficient and also makes logging less likely to interfere with race conditions, etc). however, if you are seeing your browser crash (or hang) you should add ",sync" to the list of logging modules in your moz_log environment variable. th...
Displaying Places information using views
sultnode property icon. you may specify as few or as many of these magic columns as you want, and your tree may of course contain other columns as well. in lieu of setting an id on a treecol, you may specify an anonid attribute. this is useful when you need the id for another purpose or when a treecol is contained in anonymous content, as in xbl. if both an id attribute and anonid attribute are
specified, the anonid is used. the built-in tree view is provided as a general-purpose convenience. if you need to display additional data or otherwise require more control over your view, you may need to write your own. see creating custom views below. using the tree view so you've got a built-in tree view. how do you ask it about the data it displays? first, see nsiplacesview. like all places views,...
...also searched. they are not searched otherwise. optional. selectnode() causes a particular node to be selected in the tree, resulting in all containers above the node in the hierarchy to be opened so that the node is visible. void selectnode( nsinavhistorynode node ); parameters node the nsinavhistoryresultnode to select. selectplaceuri() causes a particular node represented by the
specified placeuri to be selected in the tree. all containers above the node in the hierarchy will be opened so that the node is visible. void selectplaceuri( string placeuri ); parameters placeuri the uri (as a string) of the nsinavhistoryresultnode to select. convenience properties in addition to the methods above, some properties of convenience are implemented directly on the built-in tree...
...reeview note: this section describes the implementation of the places tree view. the built-in tree view is backed by an instance of placestreeview, a prototype defined in browser/components/places/content/treeview.js. placestreeview performs double duty for the built-in tree view: it implements both nsitreeview and much of the functionality required of a places view. the latter functionality is
specified specifically by interface nsinavhistoryresulttreeviewer, which inherits from the more general nsinavhistoryresultobserver . because of placestreeview's double duty, you can use it to bridge a query result and a tree element: var result = historyservice.executequery(query, opts); // your places query result var tree = document.getelementbyid("mytree"); // your tree element var showroot...
Firefox UI considerations for web developers
by trying a series of methods until it obtains an icon to use: a global "top sites" list is checked. this list is created by a mozilla service called tippy top. the data store provided by tippy top includes an optimized icon for each of the sites in the list; if the site is on this list, that icon is used. if tippy top doesn't include the site, firefox looks in its places data store for icons
specified in the page's <head> element; if an svg icon is available, that icon is selected. otherwise, bitmapped icons which are at least 96 pixels wide are considered. if one is found to have a width of exactly 96 pixels, it is used. otherwise, the smallest image larger than 96 pixels wide is selected. if no high-resolution icon is found, a screenshot is taken of the site; this screenshot is t...
...wide is selected. if no high-resolution icon is found, a screenshot is taken of the site; this screenshot is then scaled and cropped to fit in the space allotted to the icon. if the site also has a favicon, it may be overlaid in the corner of the image. the selected image is then presented within the top sites list. rich icons the high resolution icons—also known as rich icons—are
specified by setting the rel attribute to one of: apple-touch-icon apple-touch-icon-precomposed fluid-icon the size of each icon is taken from the size attribute
specified on the <link>, if it's provided. apple-touch-icon and apple-touch-icon-precomposed icons with no size attribute are assumed to be the standard classic iphone size of 57x57 pixels. the icon closest in size to 96 pixels is selected...
...ist/images/icons/apple-touch-icon.png"> <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/dist/images/icons/apple-touch-icon_72.png"> <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/dist/images/icons/apple-touch-icon@2x.png"> firefox starts by looking for an svg icon; there is none. so it then goes on to look through the rich icons. here, there are three of them, each
specified as apple-touch-icon-precomposed. since none of them are 96 pixels wide, the smallest icon which is at least 96 pixels wide is chosen; that's the 114x114 pixel apple-touch-icon@2x.png file. that image is then scaled down to be 96 pixels wide and is used in the user interface as seen in the example. ...
AddonManager
lled somewhere specific to the current user (all profiles of the logged-in user). note: the extensions.enabledscopes preference lets you configure which of these scopes are enabled; however, you can't turn off the profile scope. starting in firefox 8, you can also set the value of the preference extensions.autodisabledscopes to prevent firefox from automatically installing add-ons from the
specified scopes. addontype viewtypes constant description view_type_list the type should be displayed in a regular list view in the ui. addontype flags constant description type_ui_hide_empty the type should be hidden from the ui if no add-ons of that type are currently installed. startup change types these constants represent the lists of ...
...to build the lists of changed add-ons reported by the getstartupchanges() method. note: calling this method more than once for the same add-on will replace the last change that was recorded with the new one; an add-on can only appear once across all change types. void addstartupchange( in string changetype, in string id ); parameters changetype the type of change that occurred for the
specified add-on. this can be one of the startup change types or a custom value defined by your own provider. id the add-on id to add to the change list. removestartupchange() removes an add-on from the add-on changes list. void addstartupchange( in string changetype, in string id ); parameters changetype the type of change to remove for the
specified add-on. this can be one of the startup ...
...ges() returns an array of add-on ids that changed for a given startup change type. string[] getstartupchanges( in string changetype ); parameters changetype the change type for which to retrieve a list of changed add-ons. this can be one of the startup change types or a custom value defined by your own provider. return value an array of add-on ids indicating the add-ons for which the
specified change type applies. getinstallforurl() asynchronously gets an addoninstall for a url. promise? getinstallforurl( in string url, in installcallback? callback, in string mimetype, in string hash, in string name, in string iconurl, in string version, in nsiloadgroup loadgroup ) parameters url the url the add-on is located at callback a callback to pass the addoninstall to...
FileUtils.jsm
reate_file parameter to pr_open mode_append 0x10 corresponds to the pr_append parameter to pr_open mode_truncate 0x20 corresponds to the pr_truncate parameter to pr_open perms_file 0644 default permissions when creating files. perms_directory 0755 default permissions when creating directories methods getfile() gets a file at the
specified hierarchy under a nsidirectoryservice key. nsifile getfile( string key, array patharray, bool followlinks ); parameters key the nsidirectoryservice key to start from (see getting special files for more info) patharray an array of path components to locate beneath the directory
specified by key. the last item in this array must be the leaf name of a file. followlinks optional true...
... followlinks ); parameters key the nsidirectoryservice key to start from (see getting special files for more info) patharray an array of path components to locate beneath the directory
specified by key. the last item in this array must be the leaf name of a file. followlinks optional true if links should be followed, false otherwise. return value returns a nsifile object for the file
specified. the file is not created if it does not exist, however all required directories along the way are. getdir() gets a directory at the
specified hierarchy under a nsidirectoryservice key. nsifile getdir( string key, array patharray, bool shouldcreate, bool followlinks ); parameters key the nsidirectoryservice key to start from (see getting special files for more info) patharray an...
...l required directories along the way are. getdir() gets a directory at the
specified hierarchy under a nsidirectoryservice key. nsifile getdir( string key, array patharray, bool shouldcreate, bool followlinks ); parameters key the nsidirectoryservice key to start from (see getting special files for more info) patharray an array of path components to locate beneath the directory
specified by key. shouldcreate optional true if the directory hierarchy
specified in patharray should be created if it does not exist, false otherwise. followlinks optional true if links should be followed, false otherwise location
specified. return value returns a nsifile object for the location
specified. if the directory requested does not exist, it is created, along with any parent directories t...
PerfMeasurement.jsm
the number of times the profiled thread migrated from one cpu core to another. event types measured constant the eventsmeasured constant provides a mask indicating which event types were recorded. variable type description eventsmeasured eventmask a bit mask of the event types recorded; this can differ from the events requested if the platform doesn't support all of the event types you
specified when creating the perfmeasurement object. constants event mask constants these constants are used to construct the mask indicating which events you want to monitor. constant value description cpu_cycles 0x00000001 measure cpu cycles elapsed. instructions 0x00000002 measure the number of instructions executed. cache_references 0x00000004 measure the number of cache references. cache_...
...e number of context switches that occurred. all 0x000007ff measure all available events. number of available event types the num_measurable_events constant tells you how many types of events can be measured. constant value description num_measurable_events 11 the number of types of events that can be measured. constructor creates a new perfmeasurement object, configured to record the
specified event types. perfmeasurement( eventmask tomeasure ); parameters tomeasure a mask of all of the event types you want to record; see event mask constants for a list of values. or together all the event types you want to record, and pass that value here. pass perfmeasurement.all to record all event types. return value a new perfmeasurement object configured to record the
specified event types. ...
...cates whether or not the platform on which your code is running supports this code module. static bool canmeasuresomething(); parameters none. return value if even one of the event types can be recorded, this will return true. otherwise, it returns false. reset() resets all the enabled counters to zero. void reset(); parameters none. start() starts measuring the performance indicators that were
specified when the perfmeasurement object was created. void start(); parameters none. stop() stops measuring performance data. for each enabled counter, the number of measured events of that type that occurred are added to the appropriate visible variable. void stop(); parameters none. ...
PopupNotifications.jsm
. notification getnotification( string id xulelement browser ); parameters id the notification id to search for. browser the xul <xul:browser> element whose notifications should be searched. if null, the currently selected <xul:browser>'s notifications will be searched. return value the corresponding notification object, or null if no such notification exists. remove() removes the
specified notification. void remove( notification notification ); parameters notification the notification object representing the notification to remove. show() adds a new popup notification, displaying it to the user. notification show( browser, id, message, anchorid, mainaction, secondaryactions, options ); parameters browser the xul <xul:browser> element with which the ...
...:browser> element with which the notification is associated. this must not be null; you can, however, simply specify gbrowser.selectedbrowser to associate it with the current tab. id a unique id string for the type of notification being displayed. for example, geolocation related notifications have the id "geolocation". only one notification for each id can be visible at a time; if one with the
specified id already exists, it will be replaced with the newer notification. message a string to display in the notification panel. anchorid the id of the element that should serve as the anchor for the notification popup (that is, the element the arrow on the popup should point to). if you specify null, the notification will be anchored to the popupnotification object's icon box. this anchorid must p...
... they would have otherwise been dismissed (i.e. any time the popup is closed due to user interaction). removeondismissal notifications with this parameter set to true will be removed when they would have otherwise been dismissed (that is, any time the popup is closed due to user interaction). popupiconurl a string specifying the url of the image to be displayed in the popup. this is normally
specified in css using list-style-image and the .popup-notification-icon[popupid=...] selector. learnmoreurl a string url. setting this property will make the prompt display a "learn more" link that, when clicked, opens the url in a new tab. notification events if you specify an event callback using the options parameter when calling show(), the callback function gets invoked when the state of the not...
Promise
s generally an error object, like in exception handling. note: you should always handle, forward, or report errors (rejection reasons). if you see the message "a promise chain failed to handle a rejection", there is likely something to be fixed in the code. see handling errors and common pitfalls below. documentation conventions in documentation, the type of the fulfillment value is usually
specified between angular brackets. for example, the os.file.exists function returns a promise that will eventually fulfill with a 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, [option...
...tor(resolve, reject); the constructor will not return until the executor has completed. the resolving functions can be used at any time, before or after the executor has completed, to control the final state of the promise. if the executor throws an exception, its value will be passed to the reject resolving function. resolving functions 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: calling this method with a pending promise as the avalue argument, and then calling it again with another value before the promise is fulfilled or rejected, will have no effect the second time, as the assoc...
...oid resolve( avalue ); parameters avalue optional if this value is not a promise, including undefined, it becomes the fulfillment value of the associated promise. if this value is a promise, then the associated promise will be resolved to the passed promise, and follow the state as the provided promise (including any future transitions). reject() rejects the associated promise with the
specified reason. if the promise has already been resolved, either to a value, a rejection, or another promise, this method does nothing. void reject( areason ); parameters areason optional the rejection reason for the associated promise. although the reason can be undefined, it is generally an error object, like in exception handling. note: this argument should not be a promise. specifying a ...
Mozilla Quirks Mode Behavior
s, and applets (etc.?) to "work" (the way they did in netscape navigator 4), even though css says that percentage heights should behave like 'auto' heights when the parent element doesn't have a fixed height. see bug 33443#c9. see also bug 41656 and its duplicates. some of these quirks may cause other effects (see bug 54119). in quirks mode, the font element changes the color of text decorations
specified on ancestor elements. proposed to apply in all modes: bug 747517. in quirks mode, text-decoration is propagated into floating and absolutely positioned elements. (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in quirks mode, text-decoration is not propagated into tables (bug 572713). maybe (firefox 3) when computing the minimum intrinsic width of an inline flow directly in a table cell (no...
...ter an image (when otherwise it would be). obsolete since gecko 8.0 prior to gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) text-decoration in quirks mode had line thickness and position adjusted on descendant text to match the descendant. tables td, th, tr, thead, tbody, and tfoot elements have the document background (and color?) applied to them (when the document background is
specified in certain ways?) (see also bug 70831). [this may have been an accurate description when written in june 2001, but no longer appears accurate. should look into tablequirkcolorrule, re-describe, and figure out when it changed.] obsolete since gecko 37 the empty-cells property defaulted to hide in quirks mode but show (according to css2.1) in standards mode (see bug 33244) (though the correct fix ...
...irks mode, when tables have a border style of inset or outset, the border color is based on the background color of the table or of the nearest ancestor with non-transparent background. [this may have been an accurate description when written in june 2001, but it no longer appears correct. i don't follow the code in nscssrenderingborders well enough to tell, though.] in quirks mode a fixed width
specified on a table cell resets the nowrap attribute. if the nowrap attribute is present the cell width will never be smaller than the
specified fixed width (bug 277232). in quirks mode, tables with no rows/rowgroups have zero height even when a height is
specified (bug 241161). something about the overhanging border (i.e., the half of the border that's outside the border-box) in border-collapse tables ...
Mozilla Style System
the style system is the module of mozilla's code responsible for the loading and parsing of css style sheets, and the computation of computed values for all css properties. the handling of those computed values is the responsibility of other parts of the code. architecture the style system is split in half rather neatly. in one half (the backend) are the sources of
specified style data, and in the other half (the frontend) is the code that turns the
specified values into computed values. the barrier between these two halves consists of three abstract interfaces, plus some smaller structures associated with some methods on each: nsistylesheet nsistylesheet represents what one would think of as a style sheet: the in-memory representation of a css file or other source of style data. som...
... then provide the api for computed style data by allowing retrieval of a set of style structs, each of which contains the computed values of a set of css properties. style structs the style structs are a set of structs, each of which holds computed values a group of properties. ...
...however, the second of these rules is the key to many of the performance and memory-use optimizations in the style system. most callers who interact with the style system do so using the style structs. ...
PR_CWait
timeout the amount of time (in printervaltime units) that the thread is willing to wait for an explicit notification before being rescheduled. if you specify pr_interval_no_timeout, the function returns if and only if the object is notified. ...
...urns one of the following values: pr_success indicates either that the monitored object has been notified or that the interval
specified in the timeout parameter has been exceeded. pr_failure indicates either that the monitor could not be located in the cache or that the monitor was located and the calling thread was not the thread that held the monitor's mutex. description using the value
specified in the address parameter to find a monitor in the monitor cache, pr_cwait waits for a notification that the monitor's state has changed. while the thread is waiting, it exits the monitor (just as if it had called pr_cexitmonitor as many times as it had called pr_centermonitor). when the wait has finished, the thread regains control of the monitor's lock with the same entry count as before the wai...
...the monitor (just as if it had called pr_cexitmonitor as many times as it had called pr_centermonitor). when the wait has finished, the thread regains control of the monitor's lock with the same entry count as before the wait began. the thread waiting on the monitor resumes execution when the monitor is notified (assuming the thread is the next in line to receive the notify) or when the interval
specified in the timeout parameter has been exceeded. when the thread resumes execution, it is the caller's responsibility to test the state of the monitored data to determine the appropriate action. ...
PR_GMTParameters
description this is a frequently-used time parameter callback function. you don't normally call it directly; instead, you pass it as a parameter to pr_explodetime() or pr_normalizetime(). ...
... description this is a frequently-used time parameter callback function. you don't normally call it directly; instead, you pass it as a parameter to pr_explodetime() or pr_normalizetime(). ...
...input, its primary use is as "filler" for cases in which you need a do-nothing callback. syntax #include <prtime.h> prtimeparameters pr_gmtparameters ( const prexplodedtime *gmt); parameter gmt a pointer to the clock/calendar time whose offsets are to be determined. this time should be
specified in gmt. returns a time parameters structure that expresses the time zone offsets at the
specified time. description this is a frequently-used time parameter callback function. you don't normally call it directly; instead, you pass it as a parameter to pr_explodetime() or pr_normalizetime(). this is a trivial function; for any input, it returns a prtimeparameters structure with both fields set to zero. ...
PR_LocalTimeParameters
description this is a frequently-used time parameter callback function. ...
... description this is a frequently-used time parameter callback function. ...
... description this is a frequently-used time parameter callback function. ...
PR_Sleep
if you set ticks to pr_interval_no_wait, the thread yields. if ticks is not pr_interval_no_wait, pr_sleep uses an existing lock, but has to create a new condition for this purpose. if you have already created such structures, it is more efficient to use them directly. ...
...clude <prthread.h> prstatus pr_sleep(printervaltime ticks); parameter pr_sleep has the following parameter: ticks the number of ticks you want the thread to sleep for (see printervaltime). returns calling pr_sleep with a parameter equivalent to pr_interval_no_timeout is an error and results in a pr_failure error. description pr_sleep simply waits on a condition for the amount of time
specified. if you set ticks to pr_interval_no_wait, the thread yields. if ticks is not pr_interval_no_wait, pr_sleep uses an existing lock, but has to create a new condition for this purpose. if you have already created such structures, it is more efficient to use them directly. calling pr_sleep with the value of ticks set to pr_interval_no_wait simply surrenders the processor to ready threads of the sam...
... threads blocked in pr_sleep are interruptible. ...
PR_Wait
t be one for which the calling thread currently holds the lock. ticks the amount of time (in printervaltime units) that the thread is willing to wait for an explicit notification before being rescheduled. returns the function returns one of the following values: pr_success means the thread is being resumed from the pr_wait call either because it was explicitly notified or because the time
specified by the parameter ticks has expired. pr_failure means pr_wait encountered a system error (such as an invalid monitor reference) or the thread was interrupted by another thread. description a call to pr_wait causes the thread to release the monitor's lock, just as if it had called pr_exitmonitor as many times as it had called pr_entermonitor. this has the effect of making the monitor available ...
...ase the monitor's lock, just as if it had called pr_exitmonitor as many times as it had called pr_entermonitor. this has the effect of making the monitor available to other threads. when the wait is over, the thread regains control of the monitor's lock with the same entry count it had before the wait began. a thread waiting on the monitor resumes when the monitor is notified or when the timeout
specified by the ticks parameter elapses. the resumption from the wait is merely a hint that a change of state has occurred. it is the responsibility of the programmer to evaluate the data and act accordingly. this is usually done by evaluating a boolean expression involving the monitored data. while the boolean expression is false, the thread should wait. the thread should act on the data only when the ex...
... in the monitor and within a loop. in pseudo-code, the sequence is as follows: pr_entermonitor(&ml); while (!expression) wait; ... act on the state change ... pr_exitmonitor(&ml); a thread can be resumed from a wait for a variety of reasons. the most obvious is that it was notified by another thread. if the value of timeout is not pr_interval_no_timeout, pr_wait resumes execution after the
specified interval has expired. if a timeout value is used, the boolean expression must include elapsed time as part of the monitored data. resuming from the wait is merely an opportunity to evaluate the expression, not an assertion that the expression is true. ...
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
ificate to the nss database */ secstatus addcert(pk11slotinfo *slot, certcertdbhandle *handle, const char *name, char *trusts, char *infilename, prbool ascii, prbool emailcert, void *pwdata) { secitem certder; secstatus rv; certcerttrust *trust = null; certcertificate *cert = null; certder.data = null; /* read in the entire file
specified with the -i argument */ rv = readderfromfile(&certder, infilename, ascii); if (rv != secsuccess) { pr_fprintf(pr_stderr, "unable to read input file %s : %s\n", infilename, port_errortostring(rv)); goto cleanup; } /* read in an ascii cert and return a certcertificate */ cert = cert_decodecertfrompackage((char *)certder.data, certder.le...
...nknown) { pr_fprintf(pr_stderr, "unknown key or hash type\n"); rv = secfailure; goto cleanup; } rv = sec_dersigndata(arena, &result, encoding->data, encoding->len, privk, signalgtag); if (rv) { pr_fprintf(pr_stderr, "signing of data failed\n"); rv = secfailure; goto cleanup; } /* encode request in
specified format */ if (ascii) { char *obuf; char *name, *email, *org, *state, *country; secitem *it; int total; it = &result; obuf = btoa_convertitemtoascii(it); total = pl_strlen(obuf); name = cert_getcommonname(subject); if (!name) { name = strdup("(not
specified)"); } email = cert_getcer...
...*org, *state, *country; secitem *it; int total; it = &result; obuf = btoa_convertitemtoascii(it); total = pl_strlen(obuf); name = cert_getcommonname(subject); if (!name) { name = strdup("(not
specified)"); } email = cert_getcertemailaddress(subject); if (!email) email = strdup("(not
specified)"); org = cert_getorgname(subject); if (!org) org = strdup("(not
specified)"); state = cert_getstatename(subject); if (!state) state = strdup("(not
specified)"); country = cert_getcountryname(subject); if (!country) country = strdup("(not
specified)"); pr_fprintf(outfile, "\nc...
sample2
ert_destroycertificate (issuercert); } return cert; } /* * add a certificate to the nss database */ secstatus addcert(pk11slotinfo *slot, certcertdbhandle *handle, const char *name, char *trusts, char *infilename, prbool ascii, prbool emailcert, void *pwdata) { secitem certder; secstatus rv; certcerttrust *trust = null; certcertificate *cert = null; certder.data = null; /* read in the entire file
specified with the -i argument */ rv = readderfromfile(&certder, infilename, ascii); if (rv != secsuccess) { pr_fprintf(pr_stderr, "unable to read input file %s : %s\n", infilename, port_errortostring(rv)); goto cleanup; } /* read in an ascii cert and return a certcertificate */ cert = cert_decodecertfrompackage((char *)certder.data, certder.len); if (!cert) { pr_fprintf(pr_stderr, "could not obtain certif...
...est */ signalgtag = sec_getsignaturealgorithmoidtag(keytype, hashalgtag); if (signalgtag == sec_oid_unknown) { pr_fprintf(pr_stderr, "unknown key or hash type\n"); rv = secfailure; goto cleanup; } rv = sec_dersigndata(arena, &result, encoding->data, encoding->len, privk, signalgtag); if (rv) { pr_fprintf(pr_stderr, "signing of data failed\n"); rv = secfailure; goto cleanup; } /* encode request in
specified format */ if (ascii) { char *obuf; char *name, *email, *org, *state, *country; secitem *it; int total; it = &result; obuf = btoa_convertitemtoascii(it); total = pl_strlen(obuf); name = cert_getcommonname(subject); if (!name) { name = strdup("(not
specified)"); } email = cert_getcertemailaddress(subject); if (!email) email = strdup("(not
specified)"); org = cert_getorgname(subject); if (!org) org ...
...ascii) { char *obuf; char *name, *email, *org, *state, *country; secitem *it; int total; it = &result; obuf = btoa_convertitemtoascii(it); total = pl_strlen(obuf); name = cert_getcommonname(subject); if (!name) { name = strdup("(not
specified)"); } email = cert_getcertemailaddress(subject); if (!email) email = strdup("(not
specified)"); org = cert_getorgname(subject); if (!org) org = strdup("(not
specified)"); state = cert_getstatename(subject); if (!state) state = strdup("(not
specified)"); country = cert_getcountryname(subject); if (!country) country = strdup("(not
specified)"); pr_fprintf(outfile, "\ncertificate request generated by netscape certutil\n"); pr_fprintf(outfile, "common name: %s\n", name); pr_fprintf(outfile, "email: %s\n", email); pr_fprintf(outfile, "organization: %s\n", org); pr_...
PKCS11 FAQ
manager to install a pkcs #11 cryptographic module. can mozilla provide a list of all pkcs #11 functions that nss will use? your token should expect to implement all the pkcs #11 functions that make sense for your token. nss continues to evolve, and periodically enhances it's functionality by using a more complete list of pkcs #11 functions. you should have implementations for all the functions
specified in the version of the pkcs #11 spec your token implements. if you do not actually do the operation
specified by that function, you can return ckr_function_not_supported. will nss get the user's ca certificate via pkcs #11 and push it into the ca certificate database or is the ca certificate database expected to obtain the ca certificate by some other means? pkcs #11 certificates that have priva...
...xing nss's non-complient uses of pkcs #11 or adding new features to nss. if multiple pkcs #11 modules are loaded, how does nss determine which ones to use for the mechanisms required by ssl? nss uses the first slot it finds that can perform all the required operations. on servers, it's almost always the slot that contains the server's private key. does nss support the use of pkcs #11 callbacks
specified in the pnotify and papplication parameters for c_opensession? nss does not currently use any of the callbacks. nss applications detect card insertion and deletion by means of polling to determine whether the card is still in the slot and whether the open session associated with that card is still valid, or by waiting on the c_waitforslotevent call. what must an x.509 certificate include to all...
...generation, will nss do the key generation automatically? yes. if your token can do ckm_rsa_pkcs, and is writable, nss displays it as one of the options to do key generation with. if the token cannot do ckm_rsa_pkcs_gen_keypair, nss uses its software key generation code and writes the private and public keys into the token using c_createobject. the rsa private key will contain all the attributes
specified by pkcs #11 version 2.0. this is also true for ckm_dsa and ckm_dsa_gen_keypair. what is the c_generatekeypair process? for example, what happens when an application in the a server asks an nss based client to do a keypair generation while a smartcard is attached? how is the private key stored to the smartcard, and how is the public key sent to the server (with wrapping?). the private key is c...
NSS tools : crlutil
sue the command without options, or with the -h option. options and arguments options options specify an action. option arguments modify an action. the options and arguments for the crlutil command are defined as follows: -g create new certificate revocation list(crl).- -d delete certificate revocation list from cert database. -i import a crl to the cert database -e erase all crls of
specified type from the cert database -l list existing crl located in cert database file. -m modify existing crl which can be located in cert db or in arbitrary file. if located in file it should be encoded in asn.1 encode format. -g arguments option arguments modify an action and are lowercase. -b bypass ca signature checks. -p dbprefix specify the prefix used on the nss security database fil...
...ded as a special case. changing the names of the certificate and key databases is not recommended. -a use ascii format or allow the use of ascii format for input and output. this formatting follows rfc #1113. -c crl-gen-file specify script file that will be used to control crl generation/modification. see crl-cript-file format below. if options -m|-g is used and -c crl-script-file is not
specified, crlutil will read script data from standard input. -d directory specify the database directory containing the certificate and key database files. on unix the certificate database tool defaults to $home/.netscape (that is, ~/.netscape). on windows nt the default is the current directory. the nss database files must reside in the same directory. -i crl-import-file specify the file which c...
...dentifies the sequential number of a crl. * add revocation reason code extension: the reasoncode is a non-critical crl entry extension that identifies the reason for the certificate revocation. ...
sslintro.html
ady been established. in this case, initial configuration takes place in the same way: pass the existing nspr file descriptor to ssl_importfd and perform any additional configuration that has not already been determined by the model file descriptor. configuration functions control the configuration of an individual socket. pr_getsocketoption. retrieves the socket options currently set for a
specified socket. optional. pr_setsocketoption. sets the socket options for a
specified socket., including making it blocking or nonblocking. optional. ssl_optionset. sets a single configuration parameter of a
specified socket. this function must be called once for each parameter whose settings you want to change from those established with ssl_optionsetdefault. optional. ssl_configsecureserver. f...
...ified socket. this function must be called once for each parameter whose settings you want to change from those established with ssl_optionsetdefault. optional. ssl_configsecureserver. for servers only. configures the socket with the information needed to handshake as an ssl server. required for servers. ssl_seturl. for clients only. records the target server url for comparison with the url
specified by the server certificate. required for clients. callbacks and helper functions allow you to specify such things as how authentication is accomplished and what happens if it fails. ssl_setpkcs11pinarg. sets the argument passed to the pkcs #11 password callback function. required. ssl_authcertificatehook. specifies a callback function used to authenticate an incoming certificate (optional...
... to specify such things as how authentication is accomplished and what happens if it fails. ssl_setpkcs11pinarg. sets the argument passed to the pkcs #11 password callback function. required. ssl_authcertificatehook. specifies a callback function used to authenticate an incoming certificate (optional for servers, necessary for clients to avoid "man-in-the-middle" attacks). optional. if not
specified, ssl uses the default callback function, ssl_authcertificate. ssl_badcerthook. specifies a callback function to deal with a situation where authentication has failed. optional. ssl_getclientauthdatahook. specifies a callback function for ssl to use when the server asks for client authentication information. this callback is required if you want to do client authentication. you can set the c...
NSS Tools pk12util
ments. to see a usage string, issue the pkcs12util command without any options. options and arguments options specify an action. option arguments modify an action. the options and arguments for the pk12util command are defined as follows: options -i p12file import a certificate and private key from from the p12file into the database. ...
... -p prefix specify the prefix used on the cert8.db and key3.db files (for example, my_cert8.db and my_key3.db). this option is provided as a special case. ...
...ength of the symmetric key to be used to encrypt the top level protocol data unit password based encryption pkcs #12 provides for not only the protection of the private keys but also the certificate and meta-data associated with the keys. password based encryption is used to protect private keys on export to a pkcs #12 file and also the entire package when allowed. if no algorithm is
specified, the tool defaults to using "pkcs12 v2 pbe with sha1 and 3key triple des-cbc" for private key encryption. for historical export control reasons "pkcs12 v2 pbe with sha1 and 40 bit rc4" is the default for the overall package encryption when not in fips mode and no package encryption when in fips mode. the private key is always protected with strong encryption by default. a list of ciphers follows.
NSS tools : crlutil
ns and arguments options options specify an action. option arguments modify an action. the options and arguments for the crlutil command are defined as follows: -g create new certificate revocation list(crl). -d delete certificate revocation list from cert database. -i import a crl to the cert database -e erase all crls of
specified type from the cert database -l list existing crl located in cert database file. -m modify existing crl which can be located in cert db or in arbitrary file. if located in file it should be encoded in asn.1 encode format. -g arguments option arguments modify an action and are lowercase. -b bypass ca signature checks.
...y databases is not recommended. -a use ascii format or allow the use of ascii format for input and output. this formatting follows rfc #1113. -c crl-gen-file specify script file that will be used to control crl generation/modification. see crl-cript-file format below. if options -m|-g is used and -c crl-script-file is not
specified, crlutil will read script data from standard input. -d directory specify the database directory containing the certificate and key database files. on unix the certificate database tool defaults to $home/.netscape (that is, ~/.netscape). on windows nt the default is the current directory. the nss database files must reside in ...
... number of a crl. * add revocation reason code extension: the reasoncode is a non-critical crl entry extension that identifies the reason for the certificate revocation. ...
Bytecode Descriptions
refers to the global this. newtarget stack: ⇒ new.target push the value of new.target. the result is a constructor or undefined. this must be used only in scripts where new.target is allowed: non-arrow function scripts 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. objects creating objects newinit stack: ⇒ obj create and push a new object with no properties. format: jof_ic newobject, newobjectwithgroup operands: (uint32_t baseobjindex) stack: ⇒ obj create and push a new ob...
..." part happens before evaluating the right-hand side of the assignment, and the "setting" part after. optimized cases don't need a bind instruction because the "finding" is done statically. format: jof_atom, jof_name, jof_propset, jof_checksloppy, jof_ic strictsetname operands: (uint32_t nameindex) stack: env, val ⇒ val like jsop::setname, but throw a typeerror if there is no binding for the
specified name in env, or if the binding is immutable (a const or read-only property). implements: putvalue steps 5 and 7 for strict mode code. format: jof_atom, jof_name, jof_propset, jof_checkstrict, jof_ic setgname operands: (uint32_t nameindex) stack: env, val ⇒ val like jsop::setname, but for assigning to globals. env must be an environment pushed by jsop::bindgname. format: jof_atom, jof_name, j...
...opvarenv operation, because a varenvironmentobject is never popped from the environment chain. implements: places in the spec where the variableenvironment is set: the bit in performeval where, in strict direct eval, the new eval scope is taken as varenv and becomes "runningcontext's variableenvironment". the weird scoping rules for functions with default parameter expressions, as
specified in functiondeclarationinstantiation step 28 ("note: a separate environment record is needed..."). note: the spec also pushes a new variableenvironment on entry to every function, but the vm takes care of that as part of pushing the stack frame, before the function script starts to run, so jsop::pushvarenv is not needed. format: jof_scope enterwith operands: (uint32_t staticwithindex) sta...
JS::Call
this article covers features introduced in spidermonkey 17 call a
specified js function. syntax bool js::call(jscontext *cx, js::handleobject thisobj, js::handlefunction fun, const js::handlevaluearray &args, js::mutablehandlevalue rval); bool js::call(jscontext *cx, js::handleobject thisobj, const char *name, const js::handlevaluearray& args, js::mutablehandlevalue rval); bool js::call(jscontext *cx, js::handleobject thisobj, js::handlevalue fun, const js::handlevaluearray& args, js::mutablehandlevalue rval); bool js::call(jscontext *cx, js::handlevalue thisv, js::handlevalue fun, const js::handlevaluearray& args, js::mutablehandlevalue rval); bool js::call(jscontext *cx, js::handlevalue thisv, js::handleobject funobj, const js::handleva...
...valuearray& args, js::mutablehandlevalue rval); 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. thisobj js::handleobject / js::handlevalue the "current" object on which the function operates; the object
specified here is "this" when the function executes. fun / funobj js::handlefunction / js::handlevalue / js::handleobject pointer to the function to call. should be a native function or jsapi-compiled function. name const char * pointer to the function name to call. args js::handlevaluearray & arguments to pass to the function. rval js::mutableha...
...er to the function to call. should be a native function or jsapi-compiled function. name const char * pointer to the function name to call. args js::handlevaluearray & arguments to pass to the function. rval js::mutablehandlevalue out parameter. on success, *rval receives the return value from the function call. description js::call calls a
specified function, fun, on an object, thisobj. in terms of function execution, the object is treated as this. for more detail, see js_callfunction, js_callfunctionname, and js_callfunctionvalue. see also mxr id search for js::call js_callfunction js_callfunctionname js_callfunctionvalue bug 601168 ...
JSClass.flags
ned (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 un
specified 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 specifies a single global obje...
...2 specifies "the original function prototype"), and objects created by many standard constructors (ecma 262-3 §15.4.2.1 and others). mxr id search for jsclass_global_flags jsclass_foreground_finalize objects of this class must be finalized on the main thread. if this class has a finalizer that makes use of state shared with the main thread then this option must be
specified. it is always safe to specify this option. one of jsclass_foreground_finalize and jsclass_background_finalize must be
specified. jsclass_background_finalize it is safe to finalize objects of this class on a background thread. if this class has a finalizer that can be safely run concurrently with the main thread then this option can be
specified. it results in fina...
... jsclass_implements_barriers obsolete since jsapi 43 correctly implements gc read and write barriers. ...
JS_CallFunction
calls a
specified js function. syntax /* added in spidermonkey 31 */ bool js_callfunction(jscontext *cx, js::handleobject obj, js::handlefunction fun, const js::handlevaluearray& args, js::mutablehandlevalue rval); bool js_callfunctionname(jscontext *cx, js::handleobject obj, const char *name, const js::handlevaluearray& args, js::mutablehandlevalue rval); bool js_callfunctionvalue(jscontext *cx, js::handleobject obj, js::handlevalue fval, const js::handlevaluearray& args, js::mutablehandlevalue rval); /* obsolete since jsapi 30 */ bool js_callfunction(jscontext *cx, jsobject *obj, jsfunction *fun, unsigned argc, jsval *argv, jsval *rval); bool js_callfunctionname(jscontext *cx, jsobject *obj, const cha...
... fval, unsigned argc, jsval *argv, jsval *rval); 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 the "current" object on which the function operates; the object
specified here is "this" when the function executes. fun js::handlefunction pointer to the function to call. fun should be a native function or jsapi-compiled function. see below. name const char * pointer to the name of function to call. fval js::handlevalue pointer to the function value to call. args const js::handlevaluearray & reference to...
...key 31 argc unsigned number of arguments you are passing to the function. obsolete since jsapi 30 argv jsval * pointer to the array of argument values to pass to the function. obsolete since jsapi 30 rval js::mutablehandlevalue out parameter. on success, *rval receives the return value from the function call. description js_callfunction calls a
specified function, fun, on an object, obj. in terms of function execution, the object is treated as this. js_callfunctionname calls a function with
specified name, name on an object obj. if js engine fails to get the function, it returns false. js_callfunctionvalue calls a
specified function, fval on an object obj. js_callfunctionvalue(cx, obj, fval, args, rval) is analogous to the javascript statement ...
JS_DeleteProperty
removes a
specified property from an object. syntax bool js_deleteproperty(jscontext *cx, js::handleobject obj, const char *name); bool js_deletepropertybyid(jscontext *cx, js::handleobject obj, jsid id); // added in spidermonkey 1.8.1 // added in spidermonkey 45 bool js_deleteproperty(jscontext *cx, js::handleobject obj, const char *name, js::objectopresult &result); bool js_deletepropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, js::objectopresult &result); bool js_deleteucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, js::objectopresult &result); name type description cx jscontext * pointer to a js context from which to derive runtime inform...
...roperty. name or id const char * or jsid or const char16_t * name of the property to delete. namelen size_t (only in js_deleteucproperty) the length of name in characters; or -1 to indicate that name is null-terminated. result js::objectopresult & (out parameter) receives the result of the operation. description js_deleteproperty removes a
specified property, name, from an object, obj. js_deletepropertybyid is the same but takes a jsid for the property name. these functions are identical to js_deleteproperty2 and js_deletepropertybyid2 except that they do not have an out parameter. first, a property lookup is performed. then one of the following cases applies: if obj has no property with the given name or id, or if obj inherits the speci...
...no property is deleted, but this is not an error. ...
JS_IsNativeFunction
if so, js_isnativefunction returns true. ...
...if so, js_isnativefunction returns true. otherwise it returns false. ...
...if so, js_isnativefunction returns true. otherwise it returns false. ...
JS_NewArrayObject
amp; 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_newarrayobject defines an enumerable array element with the value contents[i] on the new array. js_newarrayobject with length parameter creates a new array object with the
specified length; the result is like the javascript expression new array(length). the new array has the
specified length, but it doesn't have any elements. on success, js_newarrayobject returns the new a...
...ength; the result is like the javascript expression new array(length). the new array has the
specified length, but it doesn't have any elements. on success, js_newarrayobject returns the new array object. otherwise it reports an error as though by calling js_reportoutofmemory and returns null. obsolete since jsapi 30. js_newarrayobject with length parameter creates a new array object with the
specified length. if vector is non-null, then for each index i from 0 to length - 1, js_newarrayobject defines an enumerable array element with the value vector[i] on the new array. (this means that if length is nonzero and vector is null, the result is like the javascript expression new array(length). ...
..._newarrayobject with length parameter creates a new array object with the
specified length. if vector is non-null, then for each index i from 0 to length - 1, js_newarrayobject defines an enumerable array element with the value vector[i] on the new array. (this means that if length is nonzero and vector is null, the result is like the javascript expression new array(length). the new array has the
specified length, but it doesn't have any elements.) it is often better to call js_newarrayobject(cx, 0, null), store the returned object in a gc root, and then populate its elements with js_setelement or js_defineelement. this avoids unrooted jsvals in vector from being subject to garbage collection until the new object has been populated. see also mxr id search for js_newarrayobject bug 969812 - c...
JS_SetPropertyAttributes
obsolete since jsapi 26this 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. set the attributes for a
specified property. syntax jsbool js_setpropertyattributes(jscontext *cx, jsobject *obj, const char *name, unsigned int attrs, jsbool *foundp); jsbool js_setucpropertyattributes(jscontext *cx, jsobject *obj, const jschar *name, size_t namelen, unsigned int attrs, jsbool *foundp); name type description cx jscontext * the context in which to set the property attributes. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * object for which to set property attributes. na...
...object * object for which to set property attributes. name const char * or const jschar * name of the property for which to set attributes. namelen size_t (in js_setucpropertyattributes only) the length of name, in characters. attrs unsigned int attribute values to set. foundp jsbool * out parameter. flag indicating whether or not the
specified property was located. description js_setpropertyattributes sets the attributes for a
specified property, name of an object obj. js_setucpropertyattributes is the unicode version of the function. attrs is an unsigned integer containing the attribute value to set. it is the bitwise or of zero or more of the following values: flag purpose jsprop_enumerate property i...
...perty is visible in for and in loops. jsprop_readonly property is read only. jsprop_permanent property cannot be deleted. jsprop_exported property can be imported by other objects. jsprop_index property is actually an index into an array of properties, and is cast to a const char *. if js_setpropertyattributes cannot locate an object with the
specified property, it returns js_false, and the value left in *foundp is undefined. if the
specified property or the
specified object does not exist, foundp is set to js_false. then, if the property exists, but is associated with a different object, js_setpropertyattributes returns js_true. otherwise, it sets foundp to js_true, and attempts to set the attributes as
specified. if the attributes can be set...
TPS Tests
of a firefox extension of the same name, along with a python test runner, both of which live inside mozilla-central. the python test runner will read a test file (in javascript format), setup one or more firefox profiles with the necessary extensions and preferences, then launch firefox and pass the test file to the extension. the extension will read the test file and perform a series of actions
specified therein, such as populating a set of bookmarks, syncing to the sync server, making bookmark modifications, etc. a test file may contain an arbitrary number of sections, each involving the same or different profiles, so that one test file may be used to test the effect of syncing and modifying a common set of data (from a single sync account) over a series of different events and clients. set up...
...ry tabs form data prefs test phases the phase blocks are where the action happens! they tell tps what to do. each phase block contains the name of a phase, and a list of actions. tps iterates through the phase blocks in alphanumeric order, and for each phase, it does the following: launches firefox 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...
...the sync_wipe_server argument causes tps to set the firstsync="wipeserver" pref before syncing, in case the sync account already contains data (this is typically unnecessary, and done largely as an example). firefox closes. firefox is launched with profile2, and all data is synced from the sync server. the tps extension ver...
Signing Mozilla apps for Mac OS X
le. the man page for codesign is available online, or you can simply type "man codesign" in a terminal window. the main options of note are: -s your-signing-identity lets you specify the signing certificate you want to sign the application with your-signing-identity is the name of your certificate. --keychain /path/to/keychain lets you specify which keychain contains the signing certificate
specified by your-signing-identity, rather than allowing the codesign to search the keychain list. the path
specified must be a full path; it's usually something similar to /users/username/library/keychains/keychain-name.keychain. --resource-rules /path/to/coderesources specifies a file to use when generating the rules to be applied to the code signing. when you're signing mozilla applications with v1 si...
...note that you cannot specify an identifier requirement if you do this, or otherwise you need to sign the outer application again with the identifier requirement. --requirement 'designated requirement' adds additional requirements for verifying the signature and application metadata. at a minimum you'll need to provide: identifier: this must be the same as the value of the cfbundleidentifier
specified in your application's info.plist file. leaf[subject.ou]: this needs to be the subject ou of your developer id. you can find it by running this command in the terminal: openssl x509 -text -noout -inform der -in devloperid_application.cer | grep subject putting it all together, you'll wind up using a command similar to the one below to sign your app. you'll of course need to change the signing...
...once the application has been signed, the signature of an application bundle can be validated by calling: codesign -vvvv application.app where application.app is the application bundle you wish to validate. the folder will fail to validate if any of these cases occur (there may be other cases not listed here): if any files that were included in the signature have been removed or m...
Gecko object attributes
xml-roles if a dynamic content accessibility role string is used, it is exposed here. this may provide more information than the mapped role, which is best-fit. the role string may be a space-delimited list of roles. applied to: any role group attributes level for headings, the heading level. for outline items, the indentation level. for diagrams with levels, each item can have its level
specified. the level value is 1-based. applied to: grid, heading, listitem, row, tablist exposed in aria: aria-level posinset if this item is in a group, what is the item number within the group, where the size is defined by the setsize attribute. the first item should have posinset="1", and the last item should have a posinset value equal to the setsize. applied to: listitem, option exposed in aria:...
...pting the user for changes to this region. please see the aria states and properties module for more information. additional information may be provide by the object attributes atomic and relevant. applied to: any role exposed in aria: aria-live relevant space delimited string with keywords describing what kinds of changes in the subtree are informational, as opposed to presentational. if not
specified, the default should be considered "additions text", which indicates that newly created objects and changes to text and text equivalents should be considered relevant, and that the hiding or removal of items is not. please see the aria states and properties module for more information. exposed in aria: aria-relevant container-atomic is this change inside a region that should always be presented...
...kable true when the widget is known to behave like a checkbox. note some widgets which appear to be checkboxes might in fact be cyclers (see "cycles" below). action 0 is named either "check" or "uncheck". applied to: state_checkable state datatype warning: obsolete, do not use! a qname that refers to an xsd (schema) defined type. for example, a datatype may be xsd:integer. when this is not
specified, the default is string, unless the value interface is exposed, which indicates the type is numeric. for more information please read about schema datatypes. applied to: any widget that accepts input exposed via aria: aria-datatype exposed in xforms: from boud instance node datatype draggable true when the accessible object can be grabbed. dropeffect indicates what functions can be performe...
Accessing the Windows Registry Using XPCOM
wrk.access_read); var id = wrk.readstringvalue("productid"); wrk.close(); this example, while simple, shows several important things about using the interface. first, you must use createinstance() to get an object implementing this interface, not getservice(). second, you must call open() on the key before attempting to read a value. ...
...this can be very important when dealing with non-administrator accounts with restricted privileges. the value is read using readstringvalue(). you have to specify what type of data you expect to read, which we will expand on later. ...
...classes_root — corresponds to hkey_classes_root root_key_current_user — corresponds to hkey_current_user root_key_local_machine — corresponds to hkey_local_machine the second parameter for open() and create() is the path to the key. as noted in the example above, you will need to escape backslashes within the string. the third parameter for open() and create() is the access mode. it is
specified as a bitwise combination of flags defined on the interface. you can read the interface documentation for a full explanation, but we will show only the three most commonly used modes here: access_read — for reading values, enumerating keys, and receiving notifications access_write — for setting values and creating sub keys access_all — access for all operations in addition to open() a...
Components.utils
ed at js/xpconnect/idl/xpccomponents.idl. the object currently has the following members: editors! please keep this list in sync with the components object page methods method description cloneinto() create a structured clone of an object in a different javascript context. createarrayin() removed in gecko 31 returns an array created in
specified compartment. createobjectin() creates a new object, created in the scope of the
specified object's compartment. dispatch() dispatches a runnable to the current/main thread. if the parameter is passed, the runnable will be dispatch in the compartment of the parameter, which affects which error reporter gets called. evalinsandbox() runs javascript code in a...
...not. unload() unloads a js module loaded with import(). isdeadwrapper() determines whether this object is backed by a deadobjectproxy. lookupmethod() looks up a native (i.e. declared in the interface) method or property of an xpcom object. serves the same purpose as xpcnativewrapper. makeobjectpropsnormal() ensures that all functions come from the
specified object's scope, and aren't cross-compartment wrappers. may only be called from javascript code. nondeterministicgetweakmapkeys() return the keys in a weak map. this operation is non-deterministic because it is affected by the scheduling of the garbage collector and the cycle collector. this should only be used to write tests of the interaction of the gc and cc with weak maps. ...
...precisegc() schedules a garbage collection cycle for some time in the future at which no javascript code is running. this lets you specify a callback so you can be notified once the garbage collection cycle has been performed. setgczeal() sets the level of garbage collection level for full garbage collection. see js_setgczeal for details; this method calls through to that with the
specified value as the zeal value. unwaivexrays() undoes waivexrays(): reapplies the xray filtering protection. waivexrays() removes the filtering provided by an xray. properties property type description sandbox nsixpccomponents_utils_sandbox creates sandbox objects for use with evalinsandbox(). ion boolean read only. ...
mozIStorageService
the database should not be open, or you should ensure that no database activity is happening when you call this method. the filename provided is only used as a suggestion. if the filename is already taken, attempts will be made to ensure that it is unique. the actual backup file is returned, and the resulting filename can be obtained from that. nsifile backupdatabasefile( in nsifile adbfi...
...ename can be obtained from that. nsifile backupdatabasefile( in nsifile adbfile, in astring abackupfilename, in nsifile abackupparentdirectory optional ); parameters adbfile the database file to back up. abackupfilename the filename to give to the new backup file. abackupparentdirectory optional the directory to put the backup into. if this is not
specified, the backup is placed in the same directory as the original file. return value an nsifile object representing the newly-created backup file. opendatabase() opens a database connection to the
specified file. the
specified file is created if it does not already exist. if this method throws ns_error_file_corrupted, it's recommended that you call mozistorageservice.backupdatabasefile() to back up th...
...ldatabase( in string astoragekey ); parameters astoragekey a string key identifying the type of storage requested. valid values are "profile" and "memory". return value a new mozistorageconnection providing access to the requested database. exceptions thrown ns_error_invalid_arg if astoragekey is invalid. openunshareddatabase() opens a database connection to the
specified file without using a shared cache. if this method throws ns_error_file_corrupted, it's recommended that you call mozistorageservice.backupdatabasefile() to back up the database so that user data is not lost (although we have no way of recovering this data yet). each connection uses its own sqlite cache, which is inefficient, so you should use opendatabase() instead of this method unless you need ...
nsIAccessibleEditableText
accessible/public/nsiaccessibleeditabletext.idlscriptable an interface for editing text of an accessible object. the operations it supports includes setting text attributes and text contents while also replacing old text of an object with new text. it also includes and support basic operations such as, inserting text, copying text, cutting text, pasting text and deleting text at the
specified position. inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void copytext(in long startpos, in long endpos); void cuttext(in long startpos, in long endpos); void deletetext(in long startpos, in long endpos); void inserttext(in astring text, in long position); void pastetext(in long position); void setattribute...
...lure indicates the text cannot be deleted or copied into the clipboard. deletetext() deletes a range of text. void deletetext( in long startpos, in long endpos ); parameters startpos start offset of the text to be deleted. endpos end offset of the text to be deleted. exceptions thrown ns_error_failure indicates the text cannot be deleted. inserttext() inserts text at the
specified position. void inserttext( in astring text, in long position ); parameters text text to be inserted. position the offset at which to insert the text. exceptions thrown ns_error_failure indicates the text cannot be inserted. pastetext() pastes text from the clipboard. void pastetext( in long position ); parameters position the offset at which to insert the text from ...
...attributes. for example, sets font styles, such as italic, bold, and so on. void setattributes( in long startpos, in long endpos, in nsisupports attributes ); parameters startpos the start index of the text whose attributes are modified. endpos the end index of the text whose attributes are modified. attributes the set of attributes that replaces the old list of attributes of the
specified text portion. exceptions thrown ns_error_not_implemented always. the method is not implemented. settextcontents() replaces the text represented by this object with the given text. void settextcontents( in astring text ); parameters text the text that will replace the old text. exceptions thrown ns_error_failure indicates the text cannot be replaced. ...
nsIAccessibleSelectable
le refselection(in long index); void removechildfromselection(in long index); boolean selectallselection(); attributes attribute type description selectioncount long the number of accessible children currently selected. read only. constants constant value description eselection_add 0 eselection_remove 1 eselection_getstate 2 methods addchildtoselection() adds the
specified accessible child of the object to the object's selection. if the
specified object is already selected, then it does nothing. void addchildtoselection( in long index ); parameters index the zero-based accessible child index. exceptions thrown ns_error_failure if the
specified object is not selectable. clearselection() clears the selection in the object so that no children in the object are ...
...ildren. nsiarray getselectedchildren(); parameters none. return value an nsiarray. ischildselected() determines if the current child of this object is selected. boolean ischildselected( in long index ); parameters index the zero-based accessible child index. return value true if the child is selected, false if not. refselection() returns a reference to the accessible object representing the
specified selected child of the object. nsiaccessible refselection( in long index ); parameters index zero-based selected accessible child index. return value the selected accessible child. removechildfromselection() removes the
specified child of the object from the object's selection. if the
specified object was not selected, then it does nothing. void removechildfromselection( in long index ); p...
... selectallselection() select all children. boolean selectallselection(); parameters none. ...
nsIAuthPrompt
ealm. for example, ldap://localhost/dc=test. savepassword saving password option. one of the save_password_* constants defaulttext the default text for the text input dialog box. result the result of the dialog box, ok or cancel buttons. return value true for ok, false for cancel. promptpassword() this method puts up a password dialog with ok and cancel buttons. ...
... savepassword saving password option. one of the save_password_* constants pwd the password entered by the user if ok was selected. return value true for ok, false for cancel. ...
... savepassword saving password option. ...
nsIBrowserSearchService
l] in nsisearchinstallcallback callback ); parameters engineurl the url to the search engine's description file. datatype an integer representing the plugin file format. must be one of the supported search engine data types defined above. iconurl a url string to an icon file to be used as the search engine's icon. this value may be overridden by an icon
specified in the engine description file. confirm a boolean value indicating whether the user should be asked for confirmation before this engine is added to the list. if this value is false, the engine will be added to the list upon successful load, but it will not be selected as the current engine. callback a nsisearchinstallcallback that will be notified when the addition is ...
...es that aren't in the user's profile directory (ns_app_user_search_dir). void getdefaultengines( [optional] out unsigned long enginecount, [retval, array, size_is(enginecount)] out nsisearchengine engines ); parameters enginecount the number of default search engines. engines an array of the default nsisearchengines. getenginebyalias() returns an engine with the
specified alias. nsisearchengine getenginebyalias( in astring alias ); parameters alias the search engine's alias. return value an nsisearchengine getenginebyname() returns an engine with the
specified name. nsisearchengine getenginebyname( in astring aenginename ); parameters aenginename the name of the engine. return value the
specified nsisearchengine. getengines() ...
...any method of this interface before init() has completed will force the service to fall back to a slower, synchronous, initialization. if your code requires nsibrowsersearchservice and is executed during startup, you should make sure that this code is executed from the callback to init(). void init( [optional] in nsibrowsersearchinitobserver observer ); parameters observer if
specified, a callback called once initialization is complete, or immediately, if the service has already been initialized. in javascript, this observer can be a regular function. moveengine() moves a visible search engine. void moveengine( in nsisearchengine engine, in long newindex ); parameters engine the engine to move. newindex the engine's new index in the set of vis...
nsIChannel
te: as of gecko 19.0, this parameter changed from long to int64_t. in earlier versions callers could get the "content-length" property as 64-bit value by queryinterfacing the channel to nsipropertybag2, if that interface is exposed by the channel. contenttype acstring the mime type of the channel's content if available. note: the content type can often be wrongly
specified (for example wrong file extension, wrong mime type, wrong document type stored on a server and so on.), and the caller most likely wants to verify with the actual data. setting contenttype before the channel has been opened provides a hint to the channel as to what the mime type is. the channel may ignore this hint in deciding on the actual mime type that it will report. setting content...
...t ns_content_sniffer_category. see nsicontentsniffer [en-us] note: channels may ignore this flag; however, new channel implementations should only do so with good reason. load_classify_uri 22 this flag tells the channel to use uri classifier service to check the uri when opening the channel. methods asyncopen() asynchronously open this channel. data is fed to the
specified stream listener as it becomes available. the stream listener's methods are called on the thread that calls asyncopen and are not called until after asyncopen returns. if asyncopen returns successfully, the channel promises to call at least onstartrequest and onstoprequest. if the nsirequest object passed to the stream listener's methods is not this channel, an appropriate onchannelredirect notif...
...d to synchronously add themselves to the associated load group (if any). void asyncopen( in nsistreamlistener alistener, in nsisupports acontext ); parameters alistener the nsistreamlistener implementation. acontext an opaque parameter forwarded to alistener's methods. exceptions thrown ns_error_already_opened if the channel is reopened ns_error_port_access_not_allowed if the
specified port is in the nsioservice forbidden port list. open() synchronously open the channel. note: extensions should not call this method, because it tends to fail when a request is redirected, rather than redirecting transparentlynote: nsichannel implementations are not required to implement this method. moreover, since this method may block the calling thread, it should not be called on a thread ...
nsIChromeRegistry
methods canonify() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) note: this method is obsolete; use convertchromeurl() instead. converts a chrome url into a canonical representation by ensuring that the filename portion of the url is included, as in chrome://package/provider/file. this is useful because chrome urls are allowed to be
specified in "shorthand", leaving the "file" portion off. in that case, the url is expanded to chrome://package/provider/package.ext. the extension, ext, is one of: xul for a "content" package. css for a "skin" package. dtd for a "locale" package. void canonify( in nsiuri achromeurl ); parameters achromeurl the url that is to be canonified. checkfornewchrome() refre...
...ckages and so forth. void checkfornewchrome(); parameters none. convertchromeurl() resolves a chrome url to an loadable uri using the information in the registry. a new nsiuri is returned; the original is left unmodified. this lets you take a non-canonical chrome uri, such as chrome://package/provider/file, and convert it into a canonical one. this is useful because chrome urls are allowed to be
specified in "shorthand", leaving the "file" portion off. in that case, the url is expanded to chrome://package/provider/package.ext. the extension, ext, is one of: xul for a "content" package. css for a "skin" package. dtd for a "locale" package. nsiuri convertchromeurl( in nsiuri achromeurl ); parameters achromeurl the url that is to be converted. return value a n...
...hat case, the url is expanded to chrome://package/provider/package.ext. the extension, ext, is one of: xul for a "content" package. css for a "skin" package. dtd for a "locale" package. nsiuri convertchromeurl( in nsiuri achromeurl ); parameters achromeurl the url that is to be converted. return value a new nsiuri object containing the loadable uri for the
specified chrome url. violates the xpcom interface guidelines wrappersenabled() returns whether xpcnativewrappers are enabled for the
specified uri. boolean wrappersenabled( in nsiuri auri ); parameters auri the uri for which to determine if xpcnativewrappers are enabled. return value true if xpcnativewrappers are enabled for the
specified uri; otherwise false. see also chrome regist...
nsIController
mented to receive and process commands and events. ...
...bled(in string command); void onevent(in string eventname); boolean supportscommand(in string command); methods docommand() when this method is called, your implementation should execute the command with the
specified name. void docommand( in string command ); parameters command the name of the command to execute. iscommandenabled() implement this method to indicate whether or not the
specified command is enabled. boolean iscommandenabled( in string command ); parameters command the name of the command whose availability is to be checked. return value return true if the
specified command is currently available to be used; otherwise, it should return false. onevent() implement this method to process the event with the
specified name. void onevent( in string eventname ); parameter...
...is to be checked. return value return true if the
specified command is currently available to be used; otherwise, it should return false. onevent() implement this method to process the event with the
specified name. void onevent( in string eventname ); parameters eventname the name of the event to process. supportscommand() implement this method to report whether or not the command with the
specified name is supported. boolean supportscommand( in string command ); parameters command the name of the command to determine whether or not it is supported. return value true if the
specified command is supported; otherwise false. see also nsicommandcontroller nsicontrollers xul tutorial/commands ...
nsIDNSService
myhostname autf8string read only. constants resolve flag constants various flags that may be ored together to form the aflags parameter passed to asyncresolve() and resolve(). constant value description resolve_bypass_cache (1 << 0) this flag suppresses the internal dns lookup cache. resolve_canonical_name (1 << 1) the canonical name of the
specified host will be queried. resolve_priority_medium (1 << 2) the query is given medium priority. if used with low, medium takes precedence. resolve_priority_low (1 << 3) the query is given lower priority. if used with medium, medium takes precedence. resolve_speculate (1 << 4) indicates request is speculative. speculative requests return errors if prefetch...
... medium, medium takes precedence. resolve_speculate (1 << 4) indicates request is speculative. speculative requests return errors if prefetching is disabled by configuration. resolve_disable_ipv6 (1 << 5) if this flag is set, only ipv4 addresses will be returned by asyncresolve() and resolve(). methods asyncresolve() begins off an asynchronous host lookup. a
specified nsidnslistener is invoked when the resolution process is completed. nsicancelable asyncresolve( in autf8string ahostname, in unsigned long aflags, in nsidnslistener alistener, in nsieventtarget alistenertarget ); parameters ahostname the host name or ip-address-literal to resolve. aflags a bitwise or of the resolve flag constants. alistener the listener to be not...
...lve. aflags a bitwise or of the resolve flag constants. alistener the listener to be notified when the 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 un
specified 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 ...
nsIDOMHTMLAudioElement
teaudio(in jsval data); methods mozcurrentsampleoffset() 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. returns the current offset of the audio stream,
specified as the number of samples that have played since the beginning of the stream. unsigned long long mozcurrentsampleoffset(); parameters none. return value an unsigned 64-bit value indicating how many audio samples have been played since the stream began playing. mozsetup() non-standard this feature is non-standard and is not on a standards track. do not use it on production sites fac...
...t32 rate ); parameters channels the number of audio channels the audio stream should use. specify 1 for mono or 2 for stereo. rate the sampling rate to use on the stream, in samples per second. for example, 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 sam...
...er 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. ...
nsIDOMSerializer
void serializetostream( in nsidomnode root, in nsioutputstream stream, in autf8string charset ); parameters root the root of the subtree to be serialized. this could be any node, including a document. stream the byte stream to which the subtree is serialized. charset the name of the character set to use for the enco...
.../xmlextras/xmlserializer;1"] .createinstance(components.interfaces.nsidomserializer); method overview void serializetostream(in nsidomnode root, in nsioutputstream stream, in autf8string charset); astring serializetostring(in nsidomnode root); methods serializetostream() the subtree rooted by the
specified element is serialized to a byte stream using the character set
specified. void serializetostream( in nsidomnode root, in nsioutputstream stream, in autf8string charset ); parameters root the root of the subtree to be serialized. this could be any node, including a document. stream the byte stream to which the subtree is serialized. charset the name of the character set to use for the encoding to a byte stream. if this string is empty and root is a document, th...
...tring charset ); parameters root the root of the subtree to be serialized. this could be any node, including a document. stream the byte stream to which the subtree is serialized. charset the name of the character set to use for the encoding to a byte stream. if this string is empty and root is a document, the document's character set will be used. serializetostring() the subtree rooted by the
specified element is serialized to a string. astring serializetostring( in nsidomnode root ); parameters root the root of the subtree to be serialized. this could be any node, including a document. return value the serialized subtree in the form of a unicode string. ...
nsIDOMStorage
void removeitem(in domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in the session store. read only. methods clear() clear the content of this storage bound to a domain or an origin. void clear(); parameters none. getitem() returns from session storage the data corresponding to the
specified key. domstring getitem( in domstring key ); parameters key the key for which data should be returned. return value an nsidomstorageitem object describing the data corresponding to the
specified key, or null if no data exists for the given key. key() returns the key for the item stored at the
specified index in the data store. domstring key( in unsigned long index ); parameters index the ...
... corresponding to the
specified key, or null if no data exists for the given key. key() returns the key for the item stored at the
specified index in the data store. domstring key( in unsigned long index ); parameters index the index for which the corresponding key should be returned. return value a string containing the requested key. exceptions thrown index_size_err there is no key at the
specified index. removeitem() given a key, removes the corresponding entry from the session store. void removeitem( in domstring key ); parameters key the key for which data should be removed from storage. setitem() sets the value corresponding to a given key. if the key does not already exist, a new key is added, associated with the
specified value. if the key already exists, the existing value is r...
...em() given a key, removes the corresponding entry from the session store. void removeitem( in domstring key ); parameters key the key for which data should be removed from storage. setitem() sets the value corresponding to a given key. if the key does not already exist, a new key is added, associated with the
specified value. if the key already exists, the existing value is replaced with the
specified value. void setitem( in domstring key, in domstring data ); parameters key the key for which data should be set. data the data to associate with the
specified key. see also dom storage structured client-side storage (html 5 specification) nsidomstorageitem ...
nsIDOMStorage2
domstring key); void setitem(in domstring key, in domstring data); attributes attribute type description length unsigned long the number of keys stored in local storage. methods clear() clears the contents of this storage context; this removes all values bound to the domain or origin. void clear(); parameters none. getitem() returns from local storage the data corresponding to the
specified key. domstring getitem( in domstring key ); parameters key the key for which data should be returned. return value a string containing the data corresponding to the
specified key, or null if no data exists for the given key. key() returns the key for the item stored at the
specified index in the data store. domstring key( in unsigned long index ); parameters index the index for which the c...
...ata corresponding to the
specified key, or null if no data exists for the given key. key() returns the key for the item stored at the
specified index in the data store. domstring key( in unsigned long index ); parameters index the index for which the corresponding key should be returned. return value a string containing the requested key. exceptions thrown index_size_errthere is no key at the
specified index. removeitem() given a key, removes the corresponding entry from local storage. void removeitem( in domstring key ); parameters key the key for which data should be removed from storage. setitem() sets the value corresponding to a given key. if the key does not already exist, a new key is added, associated with the
specified value. if the key already exists, the existing value is repl...
...eitem() given a key, removes the corresponding entry from local storage. void removeitem( in domstring key ); parameters key the key for which data should be removed from storage. setitem() sets the value corresponding to a given key. if the key does not already exist, a new key is added, associated with the
specified value. if the key already exists, the existing value is replaced with the
specified value. void setitem( in domstring key, in domstring data ); parameters key the key for which data should be set. data the data to associate with the
specified key. ...
nsIDeviceMotion
/ seamonkey 2.3). method overview void addlistener(in nsidevicemotionlistener alistener); void addwindowlistener(in nsidomwindow awindow); native code only! void removelistener(in nsidevicemotionlistener alistener); void removewindowlistener(in nsidomwindow awindow); native code only! methods addlistener() when called, the accelerometer support implementation must begin to notify the
specified nsidevicemotionlistener by calling its nsidevicemotionlistener.onaccelerationchange() method as appropriate to share updated acceleration data. void addlistener( in nsidevicemotionlistener alistener ); parameters alistener the nsidevicemotionlistener object whose nsidevicemotionlistener.onaccelerationchange() method should be called with updated acceleration data. native code only!addwindowl...
...nge() method as appropriate to share updated acceleration data. void addlistener( in nsidevicemotionlistener alistener ); parameters alistener the nsidevicemotionlistener object whose nsidevicemotionlistener.onaccelerationchange() method should be called with updated acceleration data. native code only!addwindowlistener sets the nsiaccelerometer as the source for mozorientation events on the
specified dom window. void addwindowlistener( in nsidomwindow awindow ); parameters awindow the dom window that the accelerometer should begin sending mozorientation events to. removelistener() tells the accelerometer to stop sending updates to the
specified nsidevicemotionlistener. void removelistener( in nsidevicemotionlistener alistener ); parameters alistener the nsidevicemotionlistener object...
...void removewindowlistener( in nsidomwindow awindow ); parameters awindow the dom window that the accelerometer should stop sending mozorientation events to. ...
nsIDragService
bles void invokedragsession( in nsidomnode adomnode, in nsisupportsarray atransferables, in nsiscriptableregion aregion, in unsigned long aactiontype ); parameters 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. invokedragsessionwithimage() starts a modal drag session using an image. a custom image may be
specified using the aimage argument. if this is supplied, 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 ...
...nsigned long aactiontype, in nsidomnode aimage, in long aimagex, in long aimagey, in nsidomdragevent adragevent, in nsidomdatatransfer adatatransfer ); parameters 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 supp...
...re needed to calculate the image location. void invokedragsessionwithselection( in nsiselection 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. t...
nsIEditorSpellCheck
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. return value returns true if spell checking can be enabled. if there are no available dictionaries, the return value...
...ameters none. checkcurrentword() checks a given word. in spite of the name, this function checks the word you give it, returning true if the word is misspelled. if the word is misspelled, it will compute the suggestions which you can get from getsuggestedword(). boolean checkcurrentword( in wstring suggestedword ); parameters suggestedword missing description return value true if the
specified word is misspelled; otherwise false. checkcurrentwordnosuggest() like checkcurrentword(), checks the word you give it, returning true if it is misspelled. this is faster than checkcurrentword() because it does not compute any suggestions. note: this does not clear any suggestions left over from previous calls to checkcurrentword(), so there may be suggestions, but they will be invalid. boolean ...
...s, allowing you to build a list. when there are no more suggestions, an empty string (not a null pointer) is returned. wstring getsuggestedword(); parameters none. return value the next best suggestion for the last word that was checked and was misspelled, or an empty string if there are no remaining suggestions. ignorewordalloccurrences() tells the spell checker to ignore all occurrences of the
specified word when spell checking the document. void ignorewordalloccurrences( in wstring word ); parameters word the word to ignore when spell checking. initspellchecker() turns on the spell checker for the given editor. void initspellchecker( in nsieditor editor, in boolean enableselectionchecking ); parameters editor the nsieditor on which to enable spell checking. enable...
nsIFile
number of bytes corresponding to the data represented by the file. on the mac, getting/setting the file size with nsifile only deals with the size of the data fork. if you need to know the size of the combined data and resource forks use nsilocalfilemac.getfilesizewithresfork(). changing the size of a nsifile operates on the underlying filesystem, possibly truncating the existing file to
specified size. filesizeoflink print64 this attribute exposes the size of the symbolic link referenced by this nsifile. unlike filesize, this attribute corresponds to the size of the symbolic link referenced by this nsifile. if this nsifile does not reference a symbolic link, then the value of this attribute is undefined. the value of this attribute is the number of bytes corre...
... indicates that anode incorrectly contains a path separator character. clone() this method creates a clone of the nsifile. (it does not clone the file itself; see the copy methods.) nsifile clone(); parameters none. return value a new nsifile instance that corresponds to the same file or directory as this nsifile. contains() this method tests whether or not the path represented by the
specified nsifile instance is a descendant of the path represented by this nsifile. this nsifile should point to a directory, while the
specified argument can point to a file or directory. boolean contains( in nsifile infile ); parameters infile the nsifile to test. return value true if infile is a descendant of this nsifile. infile does not need to be a direct child of this nsifile to be consi...
... is determined using platform specific methods. as of gecko 1.7, it is utf-8 on mac os x. on linux and other unix platforms, it is the value returned from nl_langinfo (codeset), which usually corresponds to the value of the lc_all, lc_ctype and lang environment variables (with the precedence the same as the order they're enumerated). on win32 platforms, it is the currently selected ansi codepage (
specified by cp_acp). the word "native" appears in the name of methods that operate on or return strings encoded in the native character set. a string containing characters encoded in the native character set cannot be safely passed to javascript via xpconnect. therefore, the "native" methods and attributes are not scriptable. xpcom provides the string conversion functions ns_cstringtoutf16 and ns_utf16...
nsINavBookmarkObserver
ou should not attempt to get any properties, since this will result in the automatic regeneration of properties that will then be leaked into the database, causing trouble later. aisannotationproperty indicates whether or not aproperty is the name of an item annotation. if this is true, anewvalue is always an empty string. anewvalue the items new value, if required by the property
specified by aproperty. alastmodified the value to set the items last modified time to, or 0 if the value should remain unchanged. aitemtype the type of the item that has been changed. this should be one of the nsinavbookmarksservice.type constants. aparentid the id of the folder containing the item. aguid the unique id associated with the item. aparentguid the ...
...unchanged. aitemtype the type of the item that has been changed. this should be one of the nsinavbookmarksservice.type constants. aparentid the id of the folder containing the item. aguid the unique id associated with the item. aparentguid the unique id associated with the item's parent. notes this table indicates what anewvalue should be depending on property
specified by aproperty: property string value "cleartime" empty string; this property means the history was deleted, so there's no last visit date. "title" the new title for the item "favicon" the "moz-anno" url for the new favicon image. "uri" the new uri for the item. "tags" empty string; this property indicates that the set of tags ...
...nd normally the time will be a new visit that will be more recent, but this is not guaranteed. you should check to see if it is actually more recent before using this new time. see onitemchanged() method property = "cleartime" for when all visit dates are deleted for the uri. note: the reported time is the time of the visit that was added, which may be well in the past since the visit time can be
specified. this means that the visit the observer is told about may not be the most recent visit for that page. void onitemvisited( in long long aitemid, in long long avisitid, in prtime atime, in unsigned long atransitiontype, in nsiuri auri, in long long aparentid, in acstring aguid, in acstring aparentguid ); parameters aitemid the id of the bookmark that was visited. avisi...
nsINavHistoryResultViewObserver
efore -1 the drag operation wishes to insert the dragged item before the indicated row. drop_on 0 the drag operation wishes to drop the dragged item onto the indicated row. drop_after 1 the drag operation wishes to insert the dragged item after the indicated row. methods candrop() implement this method to report whether or not a drop is permitted onto the
specified location. to provide behavior similar to the folder pane in thunderbird, where drops are only permitted on items themselves instead of on the pane as a whole, always return false when the orientation isn't drop_on. warning: do not change the content of the observer list. boolean candrop( in long index, in long orientation ); parameters index the item over which the drag is cur...
...tion. the tree automatically invokes this method when certain keys are pressed. for example, when the delete key is pressed, this method is called with the string "delete". void onperformaction( in wstring action ); parameters action a string identifying the action to be performed. onperformactiononrow() this method provides a command api that can be used to invoke commands on the
specified row. the tree automatically invokes this method when certain keys are pressed. for example, when the delete key is pressed, this method is called with the string "delete". void onperformactiononrow( in wstring action, in long row ); parameters action a string identifying the action to be performed. row the row on which to perform the action. onperformactiononcell() this...
...ressed. for example, when the delete key is pressed, this method is called with the string "delete". void onperformactiononrow( in wstring action, in long row ); parameters action a string identifying the action to be performed. row the row on which to perform the action. onperformactiononcell() this method provides a command api that can be used to invoke commands on a
specified cell. the tree automatically invokes this method when certain keys are pressed. for example, when the delete key is pressed, this method is called with the string "delete". void onperformactiononcell( in wstring action, in long row, in nsitreecolumn column ); parameters action a string identifying the action to be performed. row the row in which the cell to perform th...
nsISecurityCheckedComponent
e ui for the <video> tag, etc.). method overview string cancallmethod(in nsiidptr iid, in wstring methodname); string cancreatewrapper(in nsiidptr iid); string cangetproperty(in nsiidptr iid, in wstring propertyname); string cansetproperty(in nsiidptr iid, in wstring propertyname); methods cancallmethod() returns a capability string indicating what permissions are required to call the
specified method on the given interface. string cancallmethod( in nsiidptr iid, in wstring methodname ); parameters iid the iid of the interface this method exists on. methodname the name of the method to be called on the interface. return value the capability required to call this method. see capability strings for details. cancreatewrapper() returns a string indicating what permissions are require...
...he capability required to reflect this interface. note that if wrapper creation is prevented, the properties and methods will not be defined on the javascript object, whereas if wrapper creation succeeds but methods/properties are prevented, the properties and methods will be visible, not not usable. see capability strings for details. cangetproperty() returns the permissions required to get the
specified property on the given interface. string cangetproperty( in nsiidptr iid, in wstring propertyname ); parameters iid the interface that the property to get exists on. propertyname the name of the property to be retrieved on this interface. return value the capability required to get the property. see capability strings for details. cansetproperty() returns the permissions required to set ...
...perty on the given interface. string cangetproperty( in nsiidptr iid, in wstring propertyname ); parameters iid the interface that the property to get exists on. propertyname the name of the property to be retrieved on this interface. return value the capability required to get the property. see capability strings for details. cansetproperty() returns the permissions required to set the
specified property on the given interface. string cansetproperty( in nsiidptr iid, in wstring propertyname ); parameters iid the interface that the property to set exists on. propertyname the name of the property to be set on this interface. return value the capability required to set the property. see capability strings for details. ...
nsITreeSelection
== max. getrangecount() returns a count of selection ranges. long getrangecount(); parameters none. return value long - number of selection ranges invalidateselection() can be used to invalidate the selection. void invalidateselection(); parameters none. invertselection() inverts the selection. void invertselection(); parameters none. isselected() indicates whether or not the row at the
specified index is part of the selection. boolean isselected( in long index ); parameters index index of the row to check. return value rangedselect() select the range
specified by the indices. void rangedselect( in long startindex, in long endindex, in boolean augment ); parameters startindex index to start selecting at. endindex index to stop selecting at. this param...
...elect( in long startindex, in long endindex, in boolean augment ); parameters startindex index to start selecting at. endindex index to stop selecting at. this parameter is inclusive; to select one item, set endindex == startindex. augment if true, the range is added to the selection without clearing out anything else. if false, everything is cleared except for the
specified range. select() deselect all rows and select the row at the
specified index. void select( in long index ); parameters index index of the row to select. selectall() selects all rows. void selectall(); parameters none. timedselect() perform a timed select. void timedselect( in long index, in long delay ); parameters index index of the row to select. delay time i...
...n long index ); parameters index index of the row to select. selectall() selects all rows. void selectall(); parameters none. timedselect() perform a timed select. void timedselect( in long index, in long delay ); parameters index index of the row to select. delay time in miliseconds to delay selection. toggleselect() toggle the selection state of the row at the
specified index. void toggleselect( in long index ); parameters index row to toggle. ...
nsIWebBrowser
implementation should get the nsiweakreference and hold that. otherwise, the implementation should not refcount this interface; it should assume that a non null value is always valid. in that case, the embedder should explicitly set this value back to null if the parent content listener is destroyed before the browser object. methods addwebbrowserlistener() registers a listener of the type
specified by the iid to receive callbacks. the browser stores a weak reference to the listener to avoid any circular dependencies. typically this method will be called to register an object to receive nsiwebprogresslistener or nsishistorylistener notifications in which case the the iid is that of the interface. void addwebbrowserlistener( in nsiweakreference alistener, in nsiidref aiid ); parameters ...
...void addwebbrowserlistener( in nsiweakreference alistener, in nsiidref aiid ); parameters alistener the listener to be added. aiid the iid of the interface that will be called on the listener as appropriate. return value ns_ok listener was successfully added. ns_error_invalid_arg one of the arguments was invalid or the object did not implement the interface
specified by the iid. removewebbrowserlistener() removes a previously registered listener. void removewebbrowserlistener( in nsiweakreference alistener, in nsiidref aiid ); parameters alistener the listener to be removed. aiid the iid of the interface on the listener that will no longer be called. return value ns_ok listener was successfully added. ns_error_invalid_arg ...
...void removewebbrowserlistener( in nsiweakreference alistener, in nsiidref aiid ); parameters alistener the listener to be removed. aiid the iid of the interface on the listener that will no longer be called. return value ns_ok listener was successfully added. ns_error_invalid_arg one of the arguments was invalid or the object did not implement the interface
specified by the iid. see also nsibasewindow nsicontextmenulistener nsidomwindow nsiembeddingsitewindow nsiinterfacerequestor nsishistorylistener nsitooltiplistener nsiuricontentlistener nsiweakreference nsiwebbrowserchrome nsiwebbrowserchromefocus nsiwebprogresslistener ...
MailNews fakeserver
getarticle message id newsarticle object pretty self-explanatory ...
... getarticle message id newsarticle object pretty self-explanatory newsarticle api name ...
...wsarticle object, group (string), integral key for group nothing adds the message to the
specified group with the
specified key getgroup group name group object group is a map key->article, 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 ...
Add to iPhoto
// input: string length ctypes.bool) // input: isdirectory this method is used to convert a unix pathname into an url. the interesting things to note about the declaration of corefoundation.cfurlcreatefromfilesystemrepresentation() are: it returns a cfurlref, which is an opaque pointer similar to the cfstringref we noted above. the pathname is
specified as a value of type ctypes.unsigned_char.ptr, which is a pointer to an unsigned character. "file system representation" strings on mac os x are in utf-8 format. we use our cfindex type here to specify the length of the string. this.cfurlgetfsref = this.lib.declare("cfurlgetfsref", ctypes.default_abi, ctypes.bool, /...
...ameter; we aren't using this, so i'm just using a voidptr_t here. a pointer to an lsapplicationparameters structure that describes what application to launch a pointer to the first element of an array to receive the serial numbers of the launched applications; we're not using this field, but if you do, you'll probably have to declare this differently. a cfindex indicating the size of the array
specified by the previous parameter. the lsapplicationparameters structure is declared like this: this.struct_lsapplicationparameters = new ctypes.structtype('lsapplicationparameters', [ {'version': cfindex}, {'flags': optionbits}, {'application': ctypes.voidp...
...aracterset, gbrowser.selectedbrowser.contentdocument.documenturiobject); wbp.persistflags &= ~components.interfaces.nsiwebbrowserpersist.persist_flags_no_conversion; // don't save gzipped wbp.saveuri(uri, null, null, null, null, dest); return dest.path; } this is pretty straightforward, typical mozilla code. it gets the filename of the file being download by slicing it off the end of the
specified image url, then obtains the path to the temporary items folder and appends the image file's name to that path. then we call createunique() to create a unique file by that name (or a derivative thereof if the name is already in use), and download the contents of the image file to that local file. closing remarks this is a fairly simple example of how to use js-ctypes, but it actually does someth...
StructType
s the ability to define and manipulate values of the c struct type. note: at this time, there isn't a way to denote a packed structure (that is, one created in c using #pragma pack). ctype structtype( name[, fields] ); parameters name the name of the structure. must be a string. fields optional an array of field descriptors, describing all the entries in the structure. if this isn't
specified, the structure is considered opaque and you can't access its contents directly. you can call the resulting type's define() method to assign it a non-opaque type later. see opaque structures for further explanation and an example. return value a ctype object describing the newly created struct data type. exceptions thrown typeerror the name is not a string, or one or more of the fields doe...
... thrown error fields are not yet defined. structtype cdata properties every struct object has a getter and a setter for each member field of the structure. properties inherited from cdata property type description constructor ctype the data type of the cdata object, as a ctype. read only. note: this is never ctypes.void_t or an array type with an un
specified length. value object the javascript equivalent of the cdata object's value. this will throw a typeerror exception if the value can't be converted. structtype cdata method_overview cdata addressoffield(name) methods inherited from cdata cdata address() string tosource() string tostring() structtype cdata methods address...
...his will throw a typeerror exception if the value can't be converted. structtype cdata method_overview cdata addressoffield(name) methods inherited from cdata cdata address() string tosource() string tostring() structtype cdata methods addressoffield() returns a new cdata object of the appropriate pointer type, whose value points to the
specified field of the structure on which the method was called. see working with strings for more information on how to convert strings. cdata addressoffield( name ); parameters name the name of the field whose address is to be returned. return value a new cdata object of the appropriate pointer type, whose value points to the contents of the
specified field. exceptions thrown typeerror n...
ctypes
nate type of data. large integer types because javascript doesn't support large (64-bit) integers, js-ctypes provides two data types allowing access to 64-bit integer data. type description int64 a javascript object representing a 64-bit signed integer. uint64 a javascript object representing a 64-bit unsigned integer. methods cast() casts the
specified cdata object to a new type, returning a new cdata object representing the value in the new type. see type casting for details. cdata cast( data, type ); parameters data the cdata object to type cast. type the type to which to cast the value. this can be one of the predefined data types, or any user-defined types. return value a new cdata object representing the same data, but with ...
...ta object to a new type, returning a new cdata object representing the value in the new type. see type casting for details. cdata cast( data, type ); parameters data the cdata object to type cast. type the type to which to cast the value. this can be one of the predefined data types, or any user-defined types. ...
...turn value a new cdata object representing the same data, but with the
specified type. libraryname() returns the correct platform-specific filename for a given library name (e.g. libnss3.dylib for nss3 on os x.) string libraryname( name ); parameters name the name of the library. return value string containing the platform-specific filename of the library. open() opens a library,
specified by a pathname. the library is loaded from the
specified full path, or, if a partial path is
specified, from the appropriate library directory based on the platform on which the application is running. see library search paths for more details. library open( libspec ); parameters libspec the native library to open,
specified as a pathname string. return value a library object represent...
Browser Side Plug-in API - Plugins
ed and may have unpredictable results. netscape plug-in method summary « previousnext » npn_destroystream closes and deletes a stream. npn_forceredraw forces a paint message for a windowless plug-in. npn_getauthenticationinfo this function is called by plug-ins to get http authentication information from the browser. ...
...ext » npn_destroystream closes and deletes a stream. npn_forceredraw forces a paint message for a windowless plug-in. npn_getauthenticationinfo this function is called by plug-ins to get http authentication information from the browser. npn_geturl asks the browser to create a stream for the
specified url. npn_geturlnotify requests creation of a new stream with the contents of the
specified url; gets notification of the result. npn_getvalue allows the plug-in to query the browser for information. npn_getvalueforurl provides information to a plug-in which is associated with a given url, for example the cookies or preferred proxy. npn_invalidaterect invalidates
specified drawing area prior to repainting or refreshing a windowless plug-in. npn_invalidateregion invalidates spec...
... 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. ...
Memory - Plugins
mory functions, and can give the browser flexibility in the way it manages memory. in addition, the plug-in usually has the option of using its own memory functions. the methods that handle memory belong to the browser group of methods. npn_memalloc allocates memory from the browser's memory space. use this function to allocate memory dynamically. ...
...ng its own memory functions. the methods that handle memory belong to the browser group of methods. npn_memalloc allocates memory from the browser's memory space. use this function to allocate memory dynamically. npn_memfree requests that the browser free a
specified block of memory. use this function to free memory allocated with npn_memalloc. npn_memflush requests the browser to free up a
specified amount of memory if not enough is currently available for the plug-in's requirements. allocating and freeing memory to allocate memory and free memory, use these paired functions: npn_memalloc allocates a
specified amount of memory in the browser's memory space. npn_memfree deallocates a block of memory allocated using npn_memalloc. the plug-in can call the plug-in api npn_memalloc funct...
...located memory or null if not enough memory is available. the npn_memfree method deallocates a block of memory that was allocated using npn_memalloc only. npn_memfree does not free memory allocated by other means. void npn_memfree (void *ptr); the ptr parameter represents a block of memory previously allocated using npn_memalloc. flushing memory (mac os only) the npn_memflush method frees a
specified amount of memory. normally, plug-ins should use npn_memalloc, which automatically frees nonessential memory if necessary to fulfill the request. for communicator 4.0 and later versions, this function is not necessary for the mac os platform; npn_memalloc now performs memory flushing internally. you need to use npn_memflush only when it is not possible to call npn_memalloc, for example, when calli...
Gecko Plugin API Reference - Plugins
m the main thread; calling them from other threads is not supported and may have unpredictable results. npn_destroystream closes and deletes a stream. npn_forceredraw forces a paint message for a windowless plug-in. npn_getauthenticationinfo this function is called by plug-ins to get http authentication information from the browser. ...
...e results. npn_destroystream closes and deletes a stream. npn_forceredraw forces a paint message for a windowless plug-in. npn_getauthenticationinfo this function is called by plug-ins to get http authentication information from the browser. npn_geturl asks the browser to create a stream for the
specified url. npn_geturlnotify requests creation of a new stream with the contents of the
specified url; gets notification of the result. npn_getvalue allows the plug-in to query the browser for information. npn_getvalueforurl provides information to a plug-in which is associated with a given url, for example the cookies or preferred proxy. npn_invalidaterect invalidates
specified drawing area prior to repainting or refreshing a windowless plug-in. npn_invalidateregion invalidates speci...
... 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. ...
DevTools API - Firefox Developer Tools
given theme. parameters: theme {themedefinition|string} - the theme definition object or the theme identifier. showtoolbox(target [, toolid [, hosttype [, hostoptions]]]) opens a toolbox for given target either by creating a new one or activating an existing one. parameters: target {target} - the target the toolbox will debug. toolid {string} - the tool that should be activated. if un
specified the previously active tool is shown. hosttype {string} - the position the toolbox will be placed. one of bottom, side, window, custom. see hosttype for details. hostoptions {object} - an options object passed to the selected host. see hosttype for details. return value: a promise that is fulfilled with the toolbox instance once it has been initialized and the selected tool is loaded. getto...
...registered. the parameter is a tooldefinition object. theme-registered(themeid) a new theme has been registered. theme-unregistered(theme) a theme has been unregistered. the parameter is a themedefinition object. toolbox-ready(toolbox) a new toolbox has been created and is ready to use. the parameter is a toolbox object instance. toolbox-destroy(target) the toolbox for the
specified target is about to be destroyed. toolbox-destoyed(target) the toolbox for the
specified target has been destroyed. {toolid}-init(toolbox, iframe) a tool with the given id has began to load in the given toolbox to the given frame. {toolid}-build(toolbox, panel) a tool with the given id has began to initialize in the given toolbox. the panel is the object returned by the tooldefin...
...on object can contain following properties. most of them are optional and can be used to customize the presense of the tool in the browser and the toolbox. id string, required. an unique identifier for the tool. it must be a valid id for an html element. url string, required. an url of the panel document. label string, optional. the tool's name. if undefined the icon should be
specified. tooltip string, optional. the tooltip for the tool's tab. panellabel string, optional. an accessibility label for the panel. ordinal integer, optional. the position of the tool's tab within the toolbox. default: 99 visibilityswitch string, optional. a preference name that controls the visiblity of the tool. default: devtools.{id}.enabled icon string, optional. an ur...
Web Console Helpers - Firefox Developer Tools
the commands the javascript command line provided by the web console offers a few built-in helper functions that make certain tasks easier. $(selector, element) looks up a css selector string selector , returning the first node descended from element that matches. if un
specified, element defaults to document. equivalent to document.queryselector() or calls the $ function in the page, if it exists. see the queryselector code snippet. $$(selector, element) looks up a css selector string selector, returning an array of dom nodes descended from element that match. if un
specified, element defaults to document. this is like for document.queryselectorall(), but returns an array instead of a nodelist. $0 the currently-inspected element in the page. $_ stores the result of the last express...
...turns an array instead of a nodelist. $0 the currently-inspected element in the page. $_ stores the result of the last expression executed in the console's command line. for example, if you type "2+2 <enter>", then "$_ <enter>", the console will print 4. $x(xpath, element, resulttype) evaluates the xpath xpath expression in the context of element and returns an array of matching nodes. if un
specified, element defaults to document. the resulttype parameter specifies the type of result to return; it can be an xpathresult constant, or a corresponding string: "number", "string", "bool", "node", or "nodes"; if not provided, any_type is used. :block (starting in firefox 80) followed by an unquoted string, blocks requests where the url contains that string. in the network monitor, the string now a...
... delightful example of recursion, it brings you to this page. inspect() given an object, generates rich output for that object. once you select the object in the output area, you can use the arrow keys to navigate the object. keys() given an object, returns a list of the keys (or property names) on that object. this is a shortcut for object.keys. pprint() obsolete since gecko 74 formats the
specified value in a readable way; this is useful for dumping the contents of objects and arrays. :screenshot creates a screenshot of the current page with the supplied filename. if you don't supply a filename, the image file will be named with the following format: screen shot yyy-mm-dd at hh.mm.ss.png the command has the following optional parameters: command type descript...
The JavaScript input interpreter - Firefox Developer Tools
ow you'll see that the global window's document is the iframe: and you can call the function defined in the iframe: helper commands the javascript command line provided by the web console offers a few built-in helper functions that make certain tasks easier. $(selector, element) looks up a css selector string selector , returning the first node descended from element that matches. if un
specified, element defaults to document. equivalent to document.queryselector() or calls the $ function in the page, if it exists. see the queryselector code snippet. $$(selector, element) looks up a css selector string selector, returning an array of dom nodes descended from element that match. if un
specified, element defaults to document. this is like for document.queryselectorall(), but returns an...
...turns an array instead of a nodelist. $0 the currently-inspected element in the page. $_ stores the result of the last expression executed in the console's command line. for example, if you type "2+2 <enter>", then "$_ <enter>", the console will print 4. $x(xpath, element, resulttype) evaluates the xpath xpath expression in the context of element and returns an array of matching nodes. if un
specified, element defaults to document. the resulttype parameter specifies the type of result to return; it can be an xpathresult constant, or a corresponding string: "number", "string", "bool", "node", or "nodes"; if not provided, any_type is used. keys() given an object, returns a list of the keys (or property names) on that object. this is a shortcut for object.keys. values() given an object, retur...
... used. keys() given an object, returns a list of the keys (or property names) on that object. this is a shortcut for object.keys. values() given an object, returns a list of the values on that object; serves as a companion to keys(). clear() clears the console output area. inspect() given an object, opens the object inspector for that object. pprint() obsolete since gecko 74 formats the
specified value in a readable way; this is useful for dumping the contents of objects and arrays. help()deprecated since gecko 62 :help displays help text. actually, in a delightful example of recursion, it will bring you to this page. cd() switch javascript evaluation context to a different iframe in the page. this helper accepts multiple different ways of identifying the frame to switch to. you ca...
AbstractRange - Web APIs
seline="middle">abstractrange</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties collapsed read only a boolean value which is true if the range is collapsed. a collapsed range is one whose start position and end position are the same, resulting in a zero-character-long range. ...
... startoffset read only an integer value indicating the offset, in characters, from the beginning of the node's contents to the last character of the contents referred to by the range object. this value must be less than the length of the node indicated in startcontainer. methods the abstractrange interface offers no methods. ...
...fortunately addresses this exact issue. for example, in this case, we're calling clonecontents() on the range to create a new documentfragment object providing a dom subtree which replicates the contents of the specfied range. to do this, clonecontents() constructs all the nodes needed to preserve the structure of the indicated range, but no more than necessary. in this example, the start of the
specified range is found within the text node below the section's heading, which means that the new documentfragment will need to contain an <h2> and, below it, a text node. the range's end is located below the p element, so that will be needed within the new fragment. so will the text node containing the word "a", since that's included in the range. finally, an <em> and a text node below it will be added...
Attr - Web APIs
omplete list. properties name read only the attribute's name. namespaceuri read only a domstring representing the namespace uri of the attribute, or null if there is no namespace. localname read only a domstring representing the local part of the qualified name of the attribute. prefix read only a domstring representing the namespace prefix of the attribute, or null if no prefix is
specified. ownerelement read only the element holding the attribute. note: dom level 4 removed this property. the assumption was that since you get an attr object from an element, you should already know the associated element. as that doesn't hold true in cases like attr objects being returned by document.evaluate, the dom living standard reintroduced the property. gecko outputs a deprecation...
..., you should already know the associated element. as that doesn't hold true in cases like attr objects being returned by document.evaluate, the dom living standard reintroduced the property. gecko outputs a deprecation note starting from gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4). this note was removed again in gecko 49.0 (firefox 49.0 / thunderbird 49.0 / seamonkey 2.46).
specified read only this property always returns true. originally, it returned true if the attribute was explicitly
specified in the source code or by a script, and false if its value came from the default one defined in the document's dtd. value the attribute's value. note: dom level 3 defined namespaceuri, localname and prefix on the node interface. in dom4 they were moved to attr. this change is...
... parentnode this property now always returns null. previoussibling this property now always returns null. schematypeinfo read only the type information associated with this attribute. while the type information contained in this attribute is guaranteed to be correct after loading the document or invoking document.normalizedocument, this property may not be reliable if the node was moved.
specified this property now always returns true. textcontent use attr.value instead. the following methods have been deprecated: appendchild() obsolete since gecko 14 modify the value of attr.value instead. clonenode() you shouldn't have been using this in the first place, so you probably don't care that this is going away. createattribute() use element.setattribute() instead. createattribute...
AudioBuffer.copyFromChannel() - Web APIs
return value undefined. ...
... return value undefined. ...
... return value undefined. exceptions indexsizeerror one of the input parameters has a value that is outside the accepted range: the value of channelnumber specifies a channel number which doesn't exist (that is, it's greater than or equal to the value of numberofchannels on the channel). ...
AudioNode.connect() - Web APIs
syntax var destinationnode = audionode.connect(destination, outputindex, inputindex); audionode.connect(destination, outputindex); parameters destination the audionode or audioparam to which to connect. ...
...er is not allowed if the destination is an audioparam. return value if the destination is a node, connect() returns a reference to the destination audionode object, allowing you to chain multiple connect() calls. in some browsers, older implementations of this interface return undefined. if the destination is an audioparam, connect() returns undefined. ...
.... in some browsers, older implementations of this interface return undefined. if the destination is an audioparam, connect() returns undefined. exceptions indexsizeerror the value
specified as outputindex or inputindex doesn't correspond 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 indefinitely. 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 anot...
AudioParam.value - Web APIs
time. initially, the value is set to audioparam.defaultvalue. 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. usage notes value precision and variation the data type used internally to store value is a single-precision (32-bit) floating point number, while javascript uses 64-bit double-precision floating point numbers. as a result, the value you read from the value property may not always exactly equal what you set it to. consider this example: const source =...
...rate = 5.3; source.playbackrate.value = rate; console.log(source.playbackrate.value === rate); the log output will be false, because the playback rate parameter, rate, was converted to the 32-bit floating-point number closest to 5.3, which yields 5.300000190734863. one solution is to use the math.fround() method, which returns the single-precision value equivalent to the 64-bit javascript value
specified—when setting value, like this: const source = new audiobuffersourcenode(...); const rate = math.fround(5.3); source.playbackrate.value = rate; console.log(source.playbackrate.value === rate); in this case, the log output will be true. value of a property which is changing over time the value of an audioparam can either be fixed or can vary over time. this is reflected by the value getter, w...
...the parameter's value at a time of 0.0 seconds, and will remain the parameter's value until the first render quantum in which the value is altered. during each render quantum, the browser does the following things related to managing the value of a parameter: if the value setter has been used, the parameter's value is changed to the value given. if the current time equals or exceeds the time
specified by a previous call to setvalueattime(), the value is changed to the value passed into setvalueattime(). if any gradiated or ramped value changing methods have been called and the current time is within the time range over which the graduated change should occur, the value is updated based on the appropriate algorithm. these ramped or gradiated value-changing methods include linearramptovalueatti...
AudioScheduledSourceNode.start() - Web APIs
a value of 0 (or omitting the when parameter entirely) causes the sound to start playback immediately. offset optional a floating-point number indicating the offset, in seconds, into the audio buffer where playback should begin. ...
...a value of 0 (or omitting the when parameter entirely) causes the sound to start playback immediately. offset optional a floating-point number indicating the offset, in seconds, into the audio buffer where playback should begin. ...
...onal a floating-point number indicating the duration, in seconds, to be played. if no value is passed then the duration will be equal to the length of the audio buffer minus the offset value return value undefined exceptions invalidstatenode the node has already been started. this error occurs even if the node is no longer running because of a prior call to stop(). rangeerror the value
specified for when is negative. example this example demonstrates how to create an oscillatornode which is scheduled to start playing in 2 seconds and stop playing 1 second after that. the times are calculated by adding the desired number of seconds to the context's current time stamp returned by audiocontext.currenttime. context = new audiocontext(); osc = context.createoscillator(); osc.connect(conte...
AudioTrackList.getTrackById() - Web APIs
if no match is found, this method returns null. ...
...if no match is found, this method returns null. ...
...if no match is found, this method returns null. the tracks are searched in their natural order; that is, in the order defined by the media resource itself, or, if the resource doesn't define an order, the relative order in which the tracks are declared by the media resource. ...
CSSPrimitiveValue - Web APIs
d by using the getstringvalue() method. methods cssprimitivevalue.getcountervalue() this method is used to get the counter value. if this css value doesn't contain a counter value, a domexception is raised. modification to the corresponding style property can be achieved using the counter interface. cssprimitivevalue.getfloatvalue() this method is used to get a float value in a
specified unit. if this css value doesn't contain a float value or can't be converted into the
specified unit, a domexception is raised. cssprimitivevalue.getrgbcolorvalue() this method is used to get the rgb color. if this css value doesn't contain a rgb color value, a domexception is raised. modification to the corresponding style property can be achieved using the rgbcolor interface. cssprimitivevalu...
...e. if this css value doesn't contain a rect value, a domexception is raised. modification to the corresponding style property can be achieved using the rect interface. cssprimitivevalue.getstringvalue() this method is used to get the string value. if the css value doesn't contain a string value, a domexception is raised. ...
... modification to the corresponding style property can be achieved using the rect interface. cssprimitivevalue.getstringvalue() this method is used to get the string value. if the css value doesn't contain a string value, a domexception is raised. cssprimitivevalue.setfloatvalue() a method to set the float value with a
specified unit. if the property attached with this value can not accept the
specified unit or the float value, the value will be unchanged and a domexception will be raised. cssprimitivevalue.setstringvalue() a method to set the string value with the
specified unit. if the property attached to this value can't accept the
specified unit or the string value, the value will be unchanged and a domexception will be raised. specifications specification status comment...
CanvasRenderingContext2D.arcTo() - Web APIs
the canvasrenderingcontext2d.arcto() method of the canvas 2d api adds a circular arc to the current sub-path, using the given control points and radius. the arc is automatically connected to the path's latest point with a straight line, if necessary for the
specified parameters. this method is commonly used for making rounded corners. note: be aware that you may get unexpected results when using a relatively large radius: the arc's connecting line will go in whatever direction it must to meet the
specified radius. syntax void ctx.arcto(x1, y1, x2, y2, radius); parameters x1 the x-axis coordinate of the first control point. y1 the y-axis coordinate of the first control point. x2 the x-axis coordinate of the second control point. y2 the y-axis coordinate of the second control point...
...pi); // control point two ctx.fill(); result in this example, the path created by arcto() is thick and black. tangent lines are gray, control points are red, and the start point is blue. creating a rounded corner this example creates a rounded corner using arcto(). this is one of the method's most common uses. html <canvas id="canvas"></canvas> javascript the arc begins at the point
specified by moveto(): (230, 20). it is shaped to fit control points at (90, 130) and (20, 20), and has a radius of 50. the lineto() method connects the arc to (20, 20) with a straight line. note that the arc's second control point and the point
specified by lineto() are the same, which produces a totally smooth corner. const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d');...
...p.y + offset); } ctx.beginpath(); ctx.moveto(p0.x, p0.y); ctx.arcto(p1.x, p1.y, p2.x, p2.y, 50); ctx.lineto(p2.x, p2.y); labelpoint(p0); labelpoint(p1); labelpoint(p2); ctx.stroke(); result result of a large radius if you use a relatively large radius, the arc may appear in a place you didn't expect. in this example, the arc's connecting line goes above, instead of below, the coordinate
specified by moveto(). this happens because the radius is too large for the arc to fit entirely below the starting point. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.moveto(180, 90); ctx.arcto(180,130, 110,130, 130); ctx.lineto(110, 130); ctx.stroke(); result live demo more sophisticate...
CanvasRenderingContext2D.fillText() - Web APIs
an optional parameter allows specifying a maximum width for the rendered text, which the user agent will achieve by condensing the text or by using a lower font size. this method draws directly to the canvas without modifying the current path, so any subsequent fill() or stroke() calls will have no effect on it. the text is rendered using the font and text layout configuration as defined by the font, textalign, textbaseline, and direction properties. ...
...t and text layout configuration as defined by the font, textalign, textbaseline, and direction properties. to draw the outlines of the characters in a string, call the context's stroketext() method. syntax canvasrenderingcontext2d.filltext(text, x, y [, maxwidth]); parameters text a domstring specifying the text string to render into the context. the text is rendered using the settings
specified by font, textalign, textbaseline, and direction. x the x-axis coordinate of the point at which to begin drawing the text, in pixels. y the y-axis coordinate of the point at which to begin drawing the text, in pixels. maxwidth optional the maximum number of pixels wide the text may be once rendered. if not
specified, there is no limit to the width of the text. however, if this value is provi...
... return value undefined. examples drawing filled text this example writes the words "hello world" using the filltext() method. html first, we need a canvas to draw into. this code creates a context 400 pixels wide and 150 pixels across. ...
CanvasRenderingContext2D.getImageData() - Web APIs
note: image data can be painted onto a canvas using the putimagedata() method. you can find more information about getimagedata() and general manipulation of canvas contents in pixel manipulation with canvas. ...
... note: image data can be painted onto a canvas using the putimagedata() method. you can find more information about getimagedata() and general manipulation of canvas contents in pixel manipulation with canvas. ...
...e from which the imagedata will be extracted. sw the width of the rectangle from which the imagedata will be extracted. positive values are to the right, and negative to the left. sh the height of the rectangle from which the imagedata will be extracted. positive values are down, and negative are up. return value an imagedata object containing the image data for the rectangle of the canvas
specified. the coordinates of the rectangle's top-left corner are (sx, sy), while the coordinates of the bottom corner are (sx + sw, sy + sh). exceptions indexsizeerror thrown if either sw or sh are zero. securityerror the canvas contains or may contain pixels which were loaded from an origin other than the one from which the document itself was loaded. to avoid securityerror being thrown in this si...
CanvasRenderingContext2D.isPointInPath() - Web APIs
the canvasrenderingcontext2d.ispointinpath() method of the canvas 2d api reports whether or not the
specified point is contained in the current path. syntax ctx.ispointinpath(x, y [, fillrule]); ctx.ispointinpath(path, x, y [, fillrule]); parameters x the x-axis coordinate of the point to check, unaffected by the current transformation of the context. y the y-axis coordinate of the point to check, unaffected by the current transformation of the context. fillrule the algorithm by which to determine if a point is inside or outside the path. possible values: "nonzero": the non-zero winding rule. default rule. "evenodd": the even-odd winding rule. path a path2d path to check against. if un
specified, the current path is used. return value boolean a boolean, which is true ...
...fected by the current transformation of the context. fillrule the algorithm by which to determine if a point is inside or outside the path. possible values: "nonzero": the non-zero winding rule. default rule. "evenodd": the even-odd winding rule. path a path2d path to check against. if un
specified, the current path is used. return value boolean a boolean, which is true if the
specified point is contained in the current or
specified path, otherwise false. examples checking a point in the current path this example uses the ispointinpath() method to check if a point is within the current path. html <canvas id="canvas"></canvas> <p>in path: <code id="result">false</code></p> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); c...
...ck if a point is within the current path. html <canvas id="canvas"></canvas> <p>in path: <code id="result">false</code></p> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const result = document.getelementbyid('result'); ctx.rect(10, 10, 100, 100); ctx.fill(); result.innertext = ctx.ispointinpath(30, 70); result checking a point in the
specified path whenever you move the mouse, this example checks whether the cursor is in a circular path2d path. if yes, the circle becomes green, otherwise it is red. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // create circle const circle = new path2d(); circle.arc(150, 75, 50, 0, 2 * math.pi); ctx.fillstyle ...
CanvasRenderingContext2D.isPointInStroke() - Web APIs
return value boolean a boolean, which is true if the point is inside the area contained by the stroking of a path, otherwise false. ...
... return value boolean a boolean, which is true if the point is inside the area contained by the stroking of a path, otherwise false. ...
... area of the current path's stroke. html <canvas id="canvas"></canvas> <p>in stroke: <code id="result">false</code></p> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const result = document.getelementbyid('result'); ctx.rect(10, 10, 100, 100); ctx.stroke(); result.innertext = ctx.ispointinstroke(50, 10); result checking a point in the
specified path whenever you move the mouse, this example checks whether the cursor is in the stroke of an elliptical path2d path. if yes, the ellipse's stroke becomes green, otherwise it is red. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // create ellipse const ellipse = new path2d(); ellipse.ellipse(150, 75, 4...
CanvasRenderingContext2D.strokeText() - Web APIs
an optional parameter allows specifying a maximum width for the rendered text, which the user agent will achieve by condensing the text or by using a lower font size. this method draws directly to the canvas without modifying the current path, so any subsequent fill() or stroke() calls will have no effect on it. use the filltext() method to fill the text characters rather than having just their outlines drawn. ...
...odifying the current path, so any subsequent fill() or stroke() calls will have no effect on it. use the filltext() method to fill the text characters rather than having just their outlines drawn. syntax canvasrenderingcontext2d.stroketext(text, x, y [, maxwidth]); parameters text a domstring specifying the text string to render into the context. the text is rendered using the settings
specified by font, textalign, textbaseline, and direction. x the x-axis coordinate of the point at which to begin drawing the text. y the y-axis coordinate of the point at which to begin drawing the text. maxwidth optional the maximum width the text may be once rendered. if not
specified, there is no limit to the width of the text. however, if this value is provided, the user agent will adjust the k...
... return value undefined. examples drawing text outlines this example writes the words "hello world" using the stroketext() method. html first, we need a canvas to draw into. this code creates a context 400 pixels wide and 150 pixels high. ...
Applying styles and colors - Web APIs
idth="150" height="150"></canvas> draw(); the result looks like this: screenshotlive sample transparency in addition to drawing opaque shapes to the canvas, we can also draw semi-transparent (or translucent) shapes. this is done by either setting the globalalpha property or by assigning a semi-transparent color to the stroke and/or fill style. globalalpha = transparencyvalue applies the
specified transparency value to all future shapes drawn on the canvas. the value must be between 0.0 (fully transparent) to 1.0 (fully opaque). this value is 1.0 (fully opaque) by default. the globalalpha property can be useful if you want to draw a lot of shapes on the canvas with similar transparency, but otherwise it's generally more useful to set the transparency on individual shapes when setting the...
... there are three possible values for this property: round, bevel and miter. by default this property is set to miter. note that the linejoin setting has no effect if the two connected segments have the same direction, because no joining area will be added in this case. round rounds off the corners of a shape by fil...
...so the miterlimit can be set independently from the current display scale or any affine transforms of paths: it only influences the effectively rendered shape of line edges. more exactly, the miter limit is the maximum allowed ratio of the extension length (in the html canvas, it is measured between the outside corner of the joined edges of the line and the common endpoint of connecting segments
specified in the path) to half the line width. it can equivalently be defined as the maximum allowed ratio of the distance between the inside and outside points of jonction of edges, to the total line width. it is then equal to the cosecant of half the minimum inner angle of connecting segments below which no miter join will be rendered, but only a bevel join: miterlimit = max miterlength / linewidth = ...
Pixel manipulation with canvas - Web APIs
e size of the pixel array in bytes by reading the uint8clampedarray.length attribute: var numbytes = imagedata.data.length; creating an imagedata object to create a new, blank imagedata object, you should use the createimagedata() method. there are two versions of the createimagedata() method: var myimagedata = ctx.createimagedata(width, height); this creates a new imagedata object with the
specified dimensions. all pixels are preset to transparent black (all zeroes i.e rgba(0,0,0,0)). you can also create a new imagedata object with the same dimensions as the object
specified by anotherimagedata. the new object's pixels are all preset to transparent black. this does not copy the image data! var myimagedata = ctx.createimagedata(anotherimagedata); getting the pixel data for a context to ob...
...ontaining a copy of the pixel data for a canvas context, you can use the getimagedata() method: var myimagedata = ctx.getimagedata(left, top, width, height); this method returns an imagedata object representing the pixel data for the area of the canvas whose corners are represented by the points (left,top), (left+width, top), (left, top+height), and (left+width, top+height). the coordinates are
specified in canvas coordinate space units. note: any pixels outside the canvas are returned as transparent black in the resulting imagedata object. this method is also demonstrated in the article manipulating video using canvas. a color picker in this example we are using the getimagedata() method to display the color under the mouse cursor. for this, we need the current position of the mouse with l...
..., math.min(math.max(0, y - 5), img.height - 10), 10, 10, 0, 0, 200, 200); }; canvas.addeventlistener('mousemove', zoom); } saving images the htmlcanvaselement provides a todataurl() method, which is useful when saving images. it returns a data uri containing a representation of the image in the format
specified by the type parameter (defaults to png). the returned image is in a resolution of 96 dpi. note: be aware that if the canvas contains any pixels that were obtained from another origin without using cors, the canvas is tainted and its contents can no longer be read and saved. see security and tainted canvases in allowing cross-origin use of images and canvas canvas.todataurl('image/png') defau...
CharacterData - Web APIs
node, and implements the childnode and nondocumenttypechildnode interface. characterdata.data is a domstring representing the textual data contained in this object. characterdata.length read only returns an unsigned long representing the size of the string contained in characterdata.data. nondocumenttypechildnode.nextelementsibling read only returns the element immediately following the
specified one in its parent's children list, or null if the
specified element is the last one in the list. nondocumenttypechildnode.previouselementsibling read only returns the element immediately prior to the
specified one in its parent's children list, or null if the
specified element is the first one in the list. methods inherits methods from its parent, node, and implements the childnode and nond...
...children list, or null if the
specified element is the first one in the list. methods inherits methods from its parent, node, and implements the childnode and nondocumenttypechildnode interface. characterdata.appenddata() appends the given domstring to the characterdata.data string; when this method returns, data contains the concatenated domstring. characterdata.deletedata() removes the
specified amount of characters, starting at the
specified offset, from the characterdata.data string; when this method returns, data contains the shortened domstring. characterdata.insertdata() inserts the
specified characters, at the
specified offset, in the characterdata.data string; when this method returns, data contains the modified domstring. childnode.remove() removes the object from its paren...
...m the characterdata.data string; when this method returns, data contains the shortened domstring. characterdata.insertdata() inserts the
specified characters, at the
specified offset, in the characterdata.data string; when this method returns, data contains the modified domstring. childnode.remove() removes the object from its parent children list. characterdata.replacedata() replaces the
specified amount of characters, starting at the
specified offset, with the
specified domstring; when this method returns, data contains the modified domstring. characterdata.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 definition of '...
console - Web APIs
how it works varies from browser to browser, but there is a de facto set of features that are typically provided. the console object can be accessed from any global object. window on browsing scopes and workerglobalscope as specific variants in workers via the property console. it's exposed as window.console, and can be referenced as simply console. for example: console.log("failed to open the
specified link") this page documents the methods available on the console object and gives a few usage examples. note: this feature is available in web workers. note: the actual console interface is defined as all lower case (i.e. not console), for historical reasons. methods console.assert() log a message and stack trace to console if the first argument is false. console.clear() clear the cons...
...race to console if the first argument is false. console.clear() clear the console. console.count() log the number of times this line has been called with the given label. console.countreset() resets the value of the counter with the given label. console.debug() outputs a message to the console with the log level debug. console.dir() displays an interactive listing of the properties of a
specified javascript object. this listing lets you use disclosure triangles to examine the contents of child objects. console.dirxml() displays an xml/html element representation of the
specified object if possible or the javascript object view if it is not possible. console.error() outputs an error message. you may use string substitution and additional arguments with this method. console.exception()...
...rofile() starts the browser's built-in profiler (for example, the firefox performance tool). you can specify an optional name for the profile. console.profileend() stops the profiler. you can see the resulting profile in the browser's performance tool (for example, the firefox performance tool). console.table() displays tabular data as a table. console.time() starts a timer with a name
specified as an input parameter. up to 10,000 simultaneous timers can run on a given page. console.timeend() stops the
specified timer and logs the elapsed time in seconds since it started. console.timelog() logs the value of the
specified timer to the console. console.timestamp() adds a marker to the browser's timeline or waterfall tool. console.trace() outputs a stack trace. console.warn() ou...
DataTransfer.getData() - Web APIs
caveats data availability the html5 drag and drop specification dictates a drag data store mode. ...
... caveats data availability the html5 drag and drop specification dictates a drag data store mode. this may result in unexpected behavior, being datatransfer.getdata() not returning an expected value. ...
...ion does not include data, this method returns an empty string. example data types are text/plain and text/uri-list. syntax datatransfer.getdata(format); arguments format a domstring representing the type of data to retrieve. return value domstring a domstring representing the drag data for the
specified format. if the drag operation has no data or the operation has no data for the
specified format, this method returns an empty string. caveats data availability the html5 drag and drop specification dictates a drag data store mode. this may result in unexpected behavior, being datatransfer.getdata() not returning an expected value. example this example shows the use of the datatransfer object's getdata() and setdata() methods. html content <div id="div1" ondrop="drop(event)...
DataTransfer - Web APIs
ding if the drag failed for any other reason, for instance due to a drop over an invalid location. deprecated properties datatransfer.mozitemcount read only gives the number of items in the drag operation. removed in firefox 71. methods standard methods datatransfer.cleardata() remove the data associated with a given type. the type argument is optional. if the type is empty or not
specified, the data associated with all types is removed. if data for the
specified type does not exist, or the data transfer contains no data, this method will have no effect. datatransfer.getdata() retrieves the data for a given type, or an empty string if data for that type does not exist or the data transfer contains no data. datatransfer.setdata() set the data for a given type. if data for the typ...
...d in the same position. datatransfer.setdragimage() set the image to be used for dragging if a custom one is desired. gecko methods note: all of the methods in this section are gecko-specific. datatransfer.addelement() sets the drag source to the given element. deprecated methods datatransfer.mozcleardataat() removes the data associated with the given format for an item at the
specified index. the index is in the range from zero to the number of items minus one. removed in firefox 71. datatransfer.mozgetdataat() retrieves the data associated with the given format for an item at the
specified index, or null if it does not exist. the index should be in the range from zero to the number of items minus one. removed in firefox 71. datatransfer.mozsetdataat() a data transfer m...
...tems, each at a given zero-based index. mozsetdataat() may only be called with an index argument less than mozitemcount in which case an existing item is modified, or equal to mozitemcount in which case a new item is added, and the mozitemcount is incremented by one. removed in firefox 71. datatransfer.moztypesat() holds a list of the format types of the data that is stored for an item at the
specified index. if the index is not in 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 ...
Document.cookie - Web APIs
t.cookie = newcookie; in the code above, newcookie is a string of form key=value. note that you can only set/update a single cookie at a time using this method. ...
... note: the domain must match the domain of the javascript origin. ...
...as if they were delimiters surrounding the actual path string. this has been fixed. ;domain=domain (e.g., 'example.com' or 'subdomain.example.com'). if not
specified, this defaults to the host portion of the current document location. contrary to earlier specifications, leading dots in domain names are ignored, but browsers may decline to set the cookie containing such dots. if a domain is
specified, subdomains are always included. note: the domain must match the domain of the javascript origin. setting cookies to foreign domains will be silently ignored. ;max-age=max-age-in-seconds (e.g., 60*60*24*365 or 31536000 for a year) ;expires=date-in-gmtstring-format if neither expires nor max-age
specified it will expire at the end of session. when user privacy is a concern, ...
Document.querySelector() - Web APIs
if no matches are found, null is returned. note: the matching is done using depth-first pre-order traversal of the document's nodes starting with the first element in the document's markup and iterating through sequential nodes by order of the number of child nodes. syntax element = document.queryselector(selectors); parameters selectors a domstring containing one or more selectors to match. this string must be a valid css selector string; if it isn't, a syntax_err exception is thrown. ...
...to manage them. note: characters that are not part of standard css syntax must be escaped using a backslash character. since javascript also uses backslash escaping, be especially careful when writing string literals using these characters. see escaping special characters for more information. ...
...e javascript also uses backslash escaping, be especially careful when writing string literals using these characters. see escaping special characters for more information. return value an htmlelement object representing the first element in the document that matches the
specified set of css selectors, or null is returned if there are no matches. if you need a list of all elements matching the
specified selectors, you should use queryselectorall() instead. exceptions syntax_err the syntax of the
specified selectors is invalid. usage notes if the
specified selector matches an id that is incorrectly used more than once in the document, the first element with that id is returned. css pseudo-elements will never return any elements, as
specified in the selectors api. escaping special charac...
Element.getAttribute() - Web APIs
if the given attribute does not exist, the value returned will either be null or "" (the empty string); see non-existing attributes for details. syntax let attribute = element.getattribute(attributename); where attribute is a string containing the value of attributename. attributename is the name of the attribute whose value you want to get. ...
.../ shows the value of align for the element with id="div1" description lower casing when called on an html element in a dom flagged as an html document, getattribute() lower-cases its argument before proceeding. non-existing attributes essentially all web browsers (firefox, internet explorer, recent versions of opera, safari, konqueror, and icab, as a non-exhaustive list) return null when the
specified attribute does not exist on the
specified element; this is what the current dom specification draft specifies. the old dom 3 core specification, on the other hand, says that the correct return value in this case is actually the empty string, and some dom implementations implement this behavior. the implementation of getattribute() in xul (gecko) actually follows the dom 3 core specification and r...
... actually the empty string, and some dom implementations implement this behavior. the implementation of getattribute() in xul (gecko) actually follows the dom 3 core specification and returns an empty string. consequently, you should use element.hasattribute() to check for an attribute's existence prior to calling getattribute() if it is possible that the requested attribute does not exist on the
specified element. retrieving nonce values for security reasons, csp nonces from non-script sources, such as css selectors, and .getattribute("nonce") calls are hidden. let nonce = script.getattribute('nonce'); // returns empty string instead of retrieving the nonce from the content attribute, use the nonce property: let nonce = script.nonce; specifications specification status co...
Element.setAttribute() - Web APIs
sets the value of an attribute on the
specified element. if the attribute already exists, the value is updated; otherwise a new attribute is added with the
specified name and value. to get the current value of an attribute, use getattribute(); to remove an attribute, call removeattribute(). syntax element.setattribute(name, value); parameters name a domstring specifying the name of the attribute whose value is to be set. the attribute name is automatically converted to all lower-case when setattribute() is called on an html element in an html document. value a domstring containing the value to assign to the attribute. any non-string value
specified is converted automatically into a string. boolean attributes are considered to be true if they're present on the element at all, regardles...
...ibute. any non-string value
specified is converted automatically into a string. boolean attributes are considered to be true if they're present on the element at all, regardless of their actual value; as a rule, you should specify the empty string ("") in value (some people use the attribute's name; this works but is non-standard). see the example below for a practical demonstration. since the
specified value gets converted into a string, specifying null doesn't necessarily do what you expect. instead of removing the attribute or setting its value to be null, it instead sets the attribute's value to the string "null". if you wish to remove an attribute, call removeattribute(). return value undefined. ...
... example in the following example, setattribute() is used to set attributes on a <button>. ...
Event.msConvertURL() - Web APIs
ise inaccessible files to be converted to blob or data uris. this proprietary method is specific to internet explorer and the microsoft edge browser. syntax var retval = dragevent.msconverturl(file, targettype, targeturl); parameters file [in] type: file the file object to be converted. targettype [in] type: domstring one of the following values indicating the desired conversion type: "
specified", "base64", or "unchanged". targeturl [in, optional] type: url the target url. return value this method does not return a value. example var bloblist = []; document.getelementbyid("pastezone").addeventlistener('paste', handlepaste, false); function handlepaste(evt) { var filelist = window.clipboarddata.files; // note that window.datatransfer.files is not applicable. ...
... = window.clipboarddata.files; // note that window.datatransfer.files is not applicable. ...
... is not applicable. if (!filelist) { console.log("filelist is null."); return; } for (var i = 0; i < filelist.length; i++) { var file = filelist[i]; var url = url.createobjecturl(file); if (evt.converturl) { // use standard if available. ...
FileReader - Web APIs
ader.onprogress a handler for the progress event. this event is triggered while reading a blob content. as filereader inherits from eventtarget, all those events can also be listened for by using the addeventlistener method. methods filereader.abort() aborts the read operation. upon return, the readystate will be done. ...
...be listened for by using the addeventlistener method. methods filereader.abort() aborts the read operation. upon return, the readystate will be done. filereader.readasarraybuffer() starts reading the contents of the
specified blob, once finished, the result attribute contains an arraybuffer representing the file's data. filereader.readasbinarystring() starts reading the contents of the
specified blob, once finished, the result attribute contains the raw binary data from the file as a string. ...
...asarraybuffer() starts reading the contents of the
specified blob, once finished, the result attribute contains an arraybuffer representing the file's data. filereader.readasbinarystring() starts reading the contents of the
specified blob, once finished, the result attribute contains the raw binary data from the file as a string. filereader.readasdataurl() starts reading the contents of the
specified blob, once finished, the result attribute contains a data: url representing the file's data. filereader.readastext() starts reading the contents of the
specified blob, once finished, the result attribute contains the contents of the file as a text string. an optional encoding name can be
specified. events listen to these events using addeventlistener() or by assigning an event listener to th...
HTMLImageElement - Web APIs
ecoding page for details on the implications of this property's values. htmlimageelement.height an integer value that reflects the height html attribute, indicating the rendered height of the image in css pixels. htmlimageelement.ismap a boolean that reflects the ismap html attribute, indicating that the image is part of a server-side image map. this is different from a client-side image map,
specified using an <img> element and a corresponding <map> which contains <area> elements indicating the clickable areas in the image. the image must be contained within an <a> element; see the ismap page for details. htmlimageelement.loading a domstring providing a hint to the browser used to optimize loading the document by determining whether to load the image immediately (eager) or on an as-needed ba...
...se uri. you can load a different image into the element by changing the url in the src attribute. htmlimageelement.srcset a usvstring reflecting the srcset html attribute. this specifies a list of candidate images, separated by commas (',', u+002c comma). each candidate image is a url followed by a space, followed by a specially-formatted string indicating the size of the image. the size may be
specified either the width or a size multiple. read the srcset page for specifics on the format of the size substring. htmlimageelement.usemap a domstring reflecting the usemap html attribute, containing the page-local url of the <map> element describing the image map to use. the page-local url is a pound (hash) symbol (#) followed by the id of the <map> element, such as #my-map-element. the <map> in tur...
... the next frame from having to pause to decode the image, as would happen if an undecoded image were added to the dom. errors if an error occurs while trying to load or render the image, and an onerror event handler has been configured to handle the error event, that event handler will get called. this can happen in a number of situations, including: the src attribute is empty or null. the
specified src url is the same as the url of the page the user is currently on. the
specified image is corrupted in some way that prevents it from being loaded. the
specified image's metadata is corrupted in such a way that it's impossible to retrieve its dimensions, and no dimensions were
specified in the <img> element's attributes. the
specified image is in a format not supported by the user agent. e...
HTMLInputElement - Web APIs
ding: its type is hidden, reset, or button; it has a <datalist> ancestor; its disabled property is true. properties that apply only to elements of type checkbox or radio checked boolean: returns / sets the current state of the element when type is checkbox or radio. defaultchecked boolean: returns / sets the default state of a radio button or checkbox as originally
specified in html that created this object. indeterminate boolean: returns whether the checkbox or radio button is in indeterminate state. for checkboxes, the effect is that the appearance of the checkbox is obscured/greyed in some way as to indicate its state is indeterminate (not checked but not unchecked). does not affect the value of the checked attribute, and clicking the checkbox will set...
...size attribute, containing visual size of the control. this value is in pixels unless the value of type is text or password, in which case, it is an integer number of characters. applies only when type is set to text, search, tel, url, email, or password; otherwise it is ignored. properties not yet categorized defaultvalue string: returns / sets the default value as originally
specified in the html that created this object. dirname string: returns / sets the directionality of the element. accesskey string: returns a string containing a single character that switches input focus to the control when pressed. list read only htmlelement object: returns the element pointed by the list attribute. the property may be null if no html element found in...
...aint validation, or if it satisfies its constraints. reportvalidity() runs the checkvalidity() method, and if it returns false (for an invalid input or no pattern attribute provided), then it reports to the user that the input is invalid in the same manner as if you submitted a form. htmlinputelement.stepdown() decrements the value by (step * n), where n defaults to 1 if not
specified. throws an invalid_state_err exception: if the method is not applicable to for the current type value, if the element has no step value, if the value cannot be converted to a number, if the resulting value is above the max or below the min. htmlinputelement.stepup() increments the value by (step * n), where n defaults to 1 if not
specified. throws an invalid_state_err exception: ...
HTMLSelectElement - Web APIs
perties this interface inherits the properties of htmlelement, and of element and node. htmlselectelement.autofocus a boolean reflecting the autofocus html attribute, which indicates whether the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. only one form-associated element in a document can have this attribute
specified. htmlselectelement.disabled a boolean reflecting the disabled html attribute, which indicates whether the control is disabled. if it is disabled, it does not accept clicks. htmlselectelement.formread only an htmlformelement referencing the form that this element is associated with. if the element is not associated with of a <form> element, then it returns null. htmlselectelement.labelsread...
...focus() gives input focus to this element. this method is now implemented on htmlelement. htmlselectelement.item() gets an item from the options collection for this <select> element. you can also access an item by specifying the index in array-style brackets or parentheses, without calling this method explicitly. htmlselectelement.nameditem() gets the item in the options collection with the
specified name. the name string can match either the id or the name attribute of an option node. you can also access an item by specifying the name in array-style brackets or parentheses, without calling this method explicitly. htmlselectelement.remove() removes the element at the
specified index from the options collection for this select element. htmlselectelement.reportvalidity() this method reports...
...ion for this select element. htmlselectelement.reportvalidity() this method reports the problems with the constraints on the element, if any, to the user. if there are problems, it fires a cancelable invalid event at the element, and returns false; if there are no problems, it returns true. htmlselectelement.setcustomvalidity() 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. events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface: input event fires when the value of an <input>, <select>, or <textarea> element has been changed. example get information about the selected option /* ass...
Drag Operations - Web APIs
if you attempt to add data twice with the same format, the new data will replace the old data, but in the same position within the list of types as the old data. you can clear the data using the cleardata() method, which takes one argument: the type of the data to remove. event.datatransfer.cleardata("text/uri-list"); the type argument to the cleardata() method is optional. if the type is not
specified, the data associated with all types is removed. if the drag contains no drag data items, or all of the items have been subsequently cleared, then no drag will occur. setting the drag feedback image when a drag occurs, a translucent image is generated from the drag target (the element the "dragstart" event is fired at), and follows the user's pointer during the drag. this image is created automa...
...dragover event as well. you can use the event's clientx and clienty properties as with other mouse events to determine the location of the mouse pointer. finally, the dragleave event will fire at an element when the drag leaves the element. this is the time when you should remove any insertion markers or highlighting. you do not need to cancel this event. any highlighting or other visual effects
specified using the :-moz-drag-over pseudoclass will be removed automatically. the dragleave event will always fire, even if the drag is cancelled, so you can always ensure that any insertion point cleanup can be done during this event. performing a drop when the user releases the mouse, the drag and drop operation ends. if the mouse is released over an element that is a valid drop target, that is, one ...
...you can use the special type url just to retrieve the first valid url in the list. for example: const link = event.datatransfer.getdata("url"); this eliminates the need to check for comments or iterate through lines yourself. however, it is limited to only the first url in the list. the url type is a special type. it is used only as a shorthand, and it does not appear within the list of types
specified in the types property. sometimes you may support some different formats, and you want to retrieve the data that is most specific that is supported. in the following example, three formats are supported by a drop target. the following example returns the data associated with the best-supported format: function dodrop(event) { const supportedtypes = ["application/x-moz-file", "text/uri-list", ...
Headers.append() - Web APIs
for security reasons, some headers can only be controlled by the user agent. these headers include the forbidden header names and forbidden response header names. ...
...name of the http header you want to add to the headers object. value the value of the http header you want to add. returns void. ...
...the value of the http header you want to add. returns void. example creating an empty headers object is simple: var myheaders = new headers(); // currently empty you could add a header to this using append(): myheaders.append('content-type', 'image/jpeg'); myheaders.get('content-type'); // returns 'image/jpeg' if the
specified header already exists, append() will change its value to the
specified value. if the
specified header already exists and accepts multiple values, append() will append the new value to the end of the value set: myheaders.append('accept-encoding', 'deflate'); myheaders.append('accept-encoding', 'gzip'); myheaders.get('accept-encoding'); // returns 'deflate, gzip' to overwrite the old value with a new one, use headers.set. specifications specification s...
Headers.set() - Web APIs
for security reasons, some headers can only be controller by the user agent. these headers include the forbidden header names and forbidden response header names. ...
... this method throws a typeerror. value the new value you want to set. returns void. ...
.... example creating an empty headers object is simple: var myheaders = new headers(); // currently empty you could add a header to this using headers.append, then set a new value for this header using set(): myheaders.append('content-type', 'image/jpeg'); myheaders.set('content-type', 'text/html'); if the
specified header does not already exist, set() will create it and set its value to the
specified value. if the
specified header does already exist and does accept multiple values, set() will overwrite the existing value with the new one: myheaders.set('accept-encoding', 'deflate'); myheaders.set('accept-encoding', 'gzip'); myheaders.get('accept-encoding'); // returns 'gzip' you'd need headers.append to append the new value onto the values, not overwrite it. specifications specif...
IDBDatabaseSync - Web APIs
methods createobjectstore() creates and returns a new object store with the given name in the connected database. idbobjectstoresync createobjectstore( in domstring name, in domstring keypath, in optional boolean autoincrement ) raises (idbdatabaseexception); parameters name the name of a new object store. keypath the key path used by the new object store. if a null path is
specified, then the object store does not have a key path, and uses out-of-line keys. autoincrement if true, the object store uses a key generator; if false, it does not use one. returns idbobjectstoresync an object to access the newly created object store. exceptions this method can raise an idbdatabaseexception with the following code: constraint_err if an object store with the same name (...
...rns idbobjectstoresync an object to access the newly created object store. exceptions this method can raise an idbdatabaseexception with the following code: constraint_err if an object store with the same name (based on case-sensitive comparison) already exists in the connected database. openobjectstore() opens the object store with the given name in the connected database using the
specified mode. idbobjectstoresync openobjectstore ( in domstring name, in optional unsigned short mode ) raises (idbdatabaseexception); parameters name the name of the object store to open. mode the mode that is used to access the object store. returns idbobjectstoresync an object to access the opened object store. exceptions this method can raise an idbdatabaseexception with the fol...
...t store with the given name (based on case-sensitive comparison) does not exist in the connected database. setversion() sets the version of the connected database. void setversion ( in domstring version ); parameters returns void version the version to store in the database. transaction() creates and returns a transaction, acquiring locks on the given database objects, within the
specified timeout duration, if possible. idbtransactionsync transaction ( in optional domstringlist storenames, in optional unsigned int timeout ) raises (idbdatabaseexception); parameters storenames the names of object stores and indexes in the scope of the new transaction. timeout the interval that this operation is allowed to take to acquire locks on all the objects stores and indexes ident...
IDBIndex.openKeyCursor() - Web APIs
a success event is always fired on the result object. ...
... a success event is always fired on the result object. ...
... a success event is always fired on the result object. ...
IDBIndexSync - Web APIs
his index is not auto-populated. name readonly domstring the name of this index. storename readonly domstring this index's referenced object store. unique readonly boolean if true, a key can have only one value within the index; if false, a key can have duplicate values. methods add() stores the given value into this index, optionally with the
specified key. if a record already exists with the given key, an exception is raised. any add( in any value, in optional any key ) raises (idbdatabaseexception); parameters returns exceptions this method can raise a idbdatabaseexception with the following code: value the value to store into the index. key a key to use for identifying the record. any the key for the stored record. constra...
...ameters key the key that identifies the record to be retrieved. returns any the retrieved value from the referenced object store. exceptions this method can raise a idbdatabaseexception with the following code: not_found_err if no record exists in this index for the given key. opencursor() creates a cursor over the records of this index. the range of the new cursor matches the
specified key range; if the key range is not
specified or is null, then the range includes all the records. void opencursor ( in optional idbkeyrange range, in optional unsigned short direction ) raises (idbdatabaseexception); parameters range the key range to use as the cursor's range. direction the cursor's required direction. returns void exceptions this method can raise an idbdatabase...
...'s range. direction the cursor's required direction. returns void exceptions this method can raise an idbdatabaseexception with the following code: not_found_err if no records exist in this index for the requested key range. openobjectcursor() creates a cursor over the records of this index's referenced object store, as arranged by this index. the range of the new cursor matches the
specified key range; if the key range is not
specified or is null, then the range includes all the records. void openobjectcursor ( in optional idbkeyrange range, in optional unsigned short direction ) raises (idbdatabaseexception); parameters range the key range to use as the cursor's range. direction the cursor's required direction. returns void exceptions this method can raise an idbda...
IDBObjectStore - Web APIs
r of records that match the provided key or idbkeyrange. if no arguments are provided, it returns the total number of records in the store. idbobjectstore.createindex() creates a new index during a version upgrade, returning a new idbindex object in the connected database. idbobjectstore.delete() returns an idbrequest object, and, in a separate thread, deletes the store object selected by the
specified key. this is for deleting individual records out of an object store. idbobjectstore.deleteindex() destroys the
specified index in the connected database, used during a version upgrade. idbobjectstore.get() returns an idbrequest object, and, in a separate thread, returns the store object store selected by the
specified key. this is for retrieving specific records from an object store. idbobje...
...d during a version upgrade. idbobjectstore.get() returns an idbrequest object, and, in a separate thread, returns the store object store selected by the
specified key. this is for retrieving specific records from an object store. idbobjectstore.getkey() returns an idbrequest object, and, in a separate thread retrieves and returns the record key for the object in the object stored matching the
specified parameter. idbobjectstore.getall() returns an idbrequest object retrieves all objects in the object store matching the
specified parameter or all objects in the store if no parameters are given. ...
... idbobjectstore.index() opens an index from this object store after which it can, for example, be used to return a sequence of records sorted by that index using a cursor. ...
ImageData() - Web APIs
width an unsigned long representing the width of the image. height an unsigned long representing the height of the image. ...
...y given and having the
specified width and height. this constructor is the preferred way of creating such an object in a worker. syntax new imagedata(array, width [, height]); new imagedata(width, height); parameters array optional a uint8clampedarray containing the underlying pixel representation of the image. if no such array is given, an image with a transparent black rectangle of the
specified width and height will be created. width an unsigned long representing the width of the image. height an unsigned long representing the height of the image. this value is optional if an array is given: the height will be inferred from the array's size and the given width. return value a new imagedata object. ...
... 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. ...
IntersectionObserver.IntersectionObserver() - Web APIs
the intersectionobserver() constructor creates and returns a new intersectionobserver object. the rootmargin, if
specified, is checked to ensure it's syntactically correct, the thresholds are checked to ensure that they're all in the range 0.0 and 1.0 inclusive, and the threshold list is sorted in ascending numeric order. if the threshold list is empty, it's set to the array [0.0]. syntax var observer = new intersectionobserver(callback[, options]); parameters callback a function which is called when the percentage of the target element is visible crosses a threshold. ...
...observer = new intersectionobserver(callback[, options]); parameters callback a function which is called when the percentage of the target element is visible crosses a threshold. the callback receives as input two parameters: entries an array of intersectionobserverentry objects, each representing one threshold which was crossed, either becoming more or less visible than the percentage
specified by that threshold. observer the intersectionobserver for which the callback is being invoked. options optional an optional object which customizes the observer. if options isn't
specified, the observer uses the document's viewport as the root, with no margin, and a 0% threshold (meaning that even a one-pixel change is enough to trigger a callback). you can provide any combination of the...
...e of 0.0 means that even a single visible pixel counts as the target being visible. 1.0 means that the entire target element is visible. see thresholds in intersection observer api for a more in-depth description of how thresholds are used. the default is a threshold of 0.0. return value a new intersectionobserver which can be used to watch for the visibility of a target element within the
specified root crossing through any of the
specified visibility thresholds. call its observe() method to begin watching for the visibility changes on a given target. exceptions syntaxerror the
specified rootmargin is invalid. rangeerror one or more of the values in threshold is outside the range 0.0 to 1.0. example this example creates a new intersection observer which calls the function myobserv...
MediaRecorder() - Web APIs
the object can optionally be configured to record using a specific media container (file type), and, further, can specify the exact codec and codec configuration(s) to use by specifying the codecs parameter. syntax var mediarecorder = new mediarecorder(stream[, options]); parameters stream the mediastream that will be recorded. this source media can come from a stream created using navigator.mediadevices.getusermedia() or from an <audio>, <video> or <canvas> element. ...
...ow to configure them. applications can check in advance if a mimetype is supported by the user agent by calling mediarecorder.istypesupported(). audiobitspersecond: the chosen bitrate for the audio component of the media. videobitspersecond: the chosen bitrate for the video component of the media. bitspersecond: the chosen bitrate for the audio and video components of the media. this can be
specified instead of the above two properties. if this is
specified along with one or the other of the above properties, this will be used for the one that isn't
specified. if bits per second values are not
specified for video and/or audio, the default adopted for video is 2.5mbps, while the audio default is adaptive, depending upon the sample rate and the number of channels. exceptions nots...
...ve two properties. if this is
specified along with one or the other of the above properties, this will be used for the one that isn't
specified. if bits per second values are not
specified for video and/or audio, the default adopted for video is 2.5mbps, while the audio default is adaptive, depending upon the sample rate and the number of channels. exceptions notsupportederror the
specified mime type is not supported by the user agent. example this example shows how to create a media recorder for a
specified stream, whose audio bit rate is set to 128 kbit/sec and whose video bit rate is set to 2.5 mbit/sec. the recorded media data will be stored in an mp4 wrapper (so if you gather the chunks of media data and save them to disk, they will be in an mp4 file). ... if (navigator.med...
MediaRecorder - Web APIs
er was created. mediarecorder.ignoremutedmedia indicates whether the mediarecorder instance will record input when the input mediastreamtrack is muted. if this attribute is false, mediarecorder will record silence for audio and black frames for video. the default is false. mediarecorder.videobitspersecond read only returns the video encoding bit rate in use. this may differ from the bit rate
specified in the constructor (if it was provided). mediarecorder.audiobitspersecond read only returns the audio encoding bit rate in use. this may differ from the bit rate
specified in the constructor (if it was provided). methods mediarecorder.pause() pauses the recording of media. mediarecorder.requestdata() requests a blob containing the saved data received thus far (or since the last time re...
...quests a blob containing the saved data received thus far (or since the last time requestdata() was called. after calling this method, recording continues, but in a new blob. mediarecorder.resume() resumes recording of media after having been paused. mediarecorder.start() begins recording media; this method can optionally be passed a timeslice argument with a value in milliseconds. if this is
specified, the media will be captured in separate chunks of that duration, rather than the default behavior of recording the media in a single large chunk. mediarecorder.stop() stops recording, at which point a dataavailable event containing the final blob of saved data is fired. no more recording occurs. static methods mediarecorder.istypesupported() a static method which returns a boolean value i...
...er.istypesupported() a static method which returns a boolean value indicating if the given mime media type is supported by the current user agent. event handlers mediarecorder.ondataavailable called to handle the dataavailable event, which is periodically triggered each time timeslice milliseconds of media have been recorded (or when the entire media has been recorded, if timeslice wasn't
specified). the event, of type blobevent, contains the recorded media in its data property. you can then collect and act upon that recorded media data using this event handler. mediarecorder.onerror an eventhandler called to handle the error event, including reporting errors that arise with media recording. these are fatal errors that stop recording. the received event is based on the mediarecordererrore...
MediaSession.setActionHandler() - Web APIs
h as play, stop, or seek buttons. syntax navigator.mediasession.setactionhandler(type, callback) parameters type a domstring representing an action type to listen for. it will be one of play, pause, seekbackward, seekforward, seekto, skipad,previoustrack, or nexttrack. further details on the action types can be found below under media session actions. callback a function to call when the
specified action type is invoked. the callback receives no input parameters, and should not return a value. return value undefined. description to remove a previously-established action handler, call setactionhandler() again, specifying null as the callback. the action handler receives as input a single parameter: an object conforming to the mediasessionactiondetails dictionary, which provides both t...
...ndler, call setactionhandler() again, specifying null as the callback. the action handler receives as input a single parameter: an object conforming to the mediasessionactiondetails dictionary, which provides both the action type (so the same function can handle multiple action types), as well as data needed in order to perform the action. media session actions a media session action's type is
specified using a string from the mediasessionaction enumerated type. values each of the actions is a common media session control request. implement support for each of these in order to allow that type of action to be performed. the following strings identify the currently available types of media session action: nexttrack advances playback to the next track. pause pauses playback of the media. ...
...a session action: nexttrack advances playback to the next track. pause pauses playback of the media. play begins (or resumes) playback of the media. previoustrack moves back to the previous track. seekbackward seeks backward through the media from the current position. seekforward seeks forward from the current position through the media. seekto moves the playback position to the
specified time within the media. skipad skips past the currently playing advertisement or commercial. this action may or may not be available, depending on the platform and user agent, or may be disabled due to subscription level or other circumstances. stop halts playback entirely. examples adding action handlers this example implements seek forward and backward actions for an audio player by sett...
MutationObserver.MutationObserver() - Web APIs
dom observation does not begin immediately; the observe() method must be called first to establish which portion of the dom to watch and what kinds of changes to watch for. syntax const observer = new mutationobserver(callback) parameters callback a function which will be called on each dom change that qualifies given the observed node or subtree and options. ...
...alled on each dom change that qualifies given the observed node or subtree and options. the callback function takes as input two parameters: an array of mutationrecord objects, describing each change that occurred; and the mutationobserver which invoked the callback. see the example below for more details. return value a new mutationobserver object, configured to call the
specified callback when dom mutations occur. example this example simply creates a new mutationobserver configured to watch a node and all of its children for additions and removals of elements to the tree, as well as any changes to attributes on any of the elements in the tree. the callback function function callback(mutationlist, observer) { mutationlist.foreach( (mutation) => { switch(mutation...
...*/ break; case 'attributes': /* an attribute value changed on the element in mutation.target. the attribute name is in mutation.attributename, and its previous value is in mutation.oldvalue. */ break; } }); } the callback() function is invoked when the observer sees changes matching the configuration of the observation request
specified when calling observe() to begin watching the dom. the kind of change that took place (either a change to the list of children, or a change to an attribute) is detected by looking at the mutation.type property. creating and starting the observer this code actually sets up the observation process. const targetnode = document.queryselector("#someelement"); const observeroptions = { childlist: ...
Node - Web APIs
pace. note: in firefox 3.5 and earlier, html elements are in no namespace. in later versions, html elements are in the http://www.w3.org/1999/xhtml/ namespace in both html and xml trees. node.nodeprincipal obsolete since gecko 46 a nsiprincipal representing the node principal. node.prefix read only is a domstring representing the namespace prefix of the node, or null if no prefix is
specified. ...
... if the argument referenced an existing node on the dom tree, the node will be detached from its current position and attached at the new position. node.clonenode() clone a node, and optionally, all of its contents. by default, it clones the content of the node. ...
... calling node. node.getboxquads() returns a list of the node's css boxes relative to another node. node.getrootnode() returns the context object's root which optionally includes the shadow root if it is available. node.haschildnodes() returns a boolean indicating whether or not the element has any child nodes. node.insertbefore() inserts a node before the reference node as a child of a
specified parent node. node.isdefaultnamespace() accepts a namespace uri as an argument and returns a boolean with a value of true if the namespace is the default namespace on the given node or false if not. node.isequalnode() returns a boolean which indicates whether or not two nodes are of the same type and all their defining data points match. node.issamenode() returns a boolean value indicating w...
ParentNode.querySelectorAll() - Web APIs
if you need only a single result, consider the queryselector() method instead. note: this method is implemented as element.queryselectorall(), document.queryselectorall(), and documentfragment.queryselectorall() syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against. ...
...ryselectorall() syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against. this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown. see locating dom elements using selectors for more information about using selectors to identify elements. multiple selectors may be
specified by separating them using commas. note: characters which are not part of standard css syntax must be escaped using a backslash character. since javascript also uses backslash escaping, special care must be taken when writing string literals using these characters. see escaping special characters for more information. return value a non-live nodelist containing one element object for each des...
...racters which are not part of standard css syntax must be escaped using a backslash character. since javascript also uses backslash escaping, special care must be taken when writing string literals using these characters. see escaping special characters for more information. return value a non-live nodelist containing one element object for each descendant node that matches at least one of the
specified selectors. note: if the
specified selectors include a css pseudo-element, the returned list is always empty. exceptions syntaxerror the syntax of the
specified selectors string is not valid. examples to obtain a nodelist of all of the <p> elements in the document: var matches = document.queryselectorall("p"); this example returns a list of all <div> elements within the document with ...
PaymentDetailsUpdate.error - Web APIs
this happens if both of the following are true: the paymentrequest specifies using its requestshipping property that shipping information is required. ...
...this happens if both of the following are true: the paymentrequest specifies using its requestshipping property that shipping information is required. ...
...ate doesn't provide any valid shipping options. this happens if both of the following are true: the paymentrequest specifies using its requestshipping property that shipping information is required. the paymentdetailsupdate object specifies no valid shipping options in its shippingoptions list. this message can be used to explain to the user why they cannot submit their payment as currently
specified—whether that's because the selected products cannot be shipped to their region or because their address is not served by any of the shipping companies you use. specifications specification status comment payment request apithe definition of 'paymentdetailsupdate.error' in that specification. candidate recommendation initial definition. ...
Using Performance Timeline - Web APIs
d also includes interfaces that allow an application to be notified when specific performance events occur. together, these interfaces can be used to help identify an application's performance bottlenecks. performance extensions performance timeline extends the performance object with three methods that provide different mechanisms to get a set of performance records (metrics), depending on the
specified filter criteria. the following example show the usage of these methods getentries(), getentriesbyname() and getentriesbytype(). function log(s) { var o = document.getelementsbytagname("output")[0]; o.innerhtml += s + " <br>"; } function do_work (n) { for (var i=0 ; i < n; i++) { var m = math.random(); } } function print_perf_entry(pe) { log("..name: " + pe.name + ...
... the following example shows how to register two observers: the first on...
... the following example shows how to register two observers: the first one registers for several event types and the second observer only registers for one event type. ...
Performance Timeline - Web APIs
e browser's performance timeline. this document provides an overview of the standard's interfaces. for more details about the interfaces, see the reference pages and using performance timeline. 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 ...
... performanceentry interface the performanceentry interface encapsulates a single performance entry — that is, a single data point or metric in the performance timeline. ...
...eturns the serialization of the performanceentry object. the serialization is specific to the performance entry's type. performance observers the performance observer interfaces allow an application to register an observer for specific performance event types, and when one of those event types is recorded, the application is notified of the event via the observer's callback function that was
specified when the observer was created. when the observer (callback) is invoked, the callback's parameters include a performance observer entry list that contains only observed performance entries. that is, the list contains entries only for the event types that were
specified when the observer's observe() method was invoked. the performance observer entry list interface has the same three getentries*() ...
RTCConfiguration - Web APIs
nal specifies how to handle negotiation of candidates when the remote peer is not compatible with the sdp bundle standard. this must be one of the values from the enum rtcbundlepolicy. if this value isn't included in the dictionary, "balanced" is assumed. certificates optional an array of objects of type rtccertificate which are used by the connection for authentication. ...
... icecandidatepoolsize optional an unsigned 16-bit integer value which specifies the size of the prefetched ice candidate pool. the default value is 0 (meaning no candidate prefetching will occur). ...
...start trying to connect, so that they're already available for inspection when rtcpeerconnection.setlocaldescription() is called. changing the size of the ice candidate pool may trigger the beginning of ice gathering. iceservers optional an array of rtciceserver objects, each describing one server which may be used by the ice agent; these are typically stun and/or turn servers. if this isn't
specified, the connection attempt will be made with no stun or turn server available, which limits the connection to local peers. icetransportpolicy optional the current ice transport policy; this must be one of the values from the rtcicetransportpolicy enumeration. if the policy isn't
specified, all is assumed by default, allowing all candidates to be considered. a value of relay limits the candidates t...
RTCDataChannel - Web APIs
brtc layer (false).ordered read only the read-only rtcdatachannel property ordered indicates whether or not the data channel guarantees in-order delivery of messages; the default is true, which indicates that the data channel is indeed ordered.protocol read only the read-only rtcdatachannel property protocol returns a domstring containing the name of the subprotocol in use. ...
...event handlersalso inherits event handlers from: eventtargetonbufferedamountlow the rtcdatachannel.onbufferedamountlow property is an eventhandler which specifies a function the browser calls when the bufferedamountlow event is sent to the rtcdatachannel. this event, which is represented by a simple event object, is sent when the amount of data buffered to be sent falls to or below the threshold
specified by the channel's bufferedamountlowthreshold.onclose the rtcdatachannel.onclose property is an eventhandler which specifies a function to be called by the browser when the close event is received by the rtcdatachannel. this is a simple event which indicates that the data channel has closed down.onclosing the rtcdatachannel.onclosing property is an eventhandler which specifies a function to be ca...
...ose() method closes the rtcdatachannel. either peer is permitted to call this method to initiate closure of the channel.send()the send() method of the rtcdatachannel interface sends data across the data channel to the remote peer. events bufferedamountlow sent to the channel's onbufferedamountlow event handler when the number of bytes of data in the outgoing data buffer falls below the value
specified by bufferedamountlowthreshold. close sent to the onclose event handler when the underlying data transport closes. error sent to the onerror event handler when an error occurs on the data channel. message sent to the onmessage event handler when a message has been received from the remote peer. the message contents can be found in the event's data property. open sent to the onopen event ha...
SVGLengthList - Web APIs
rom 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. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object...
...re it is inserted into this list. the inserted item is the item itself and not a copy. the return value is the item inserted into the list. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. getitem(in unsigned long index) svglength returns the
specified item from the list. the returned item is the item itself and not a copy. any changes made to the item are immediately reflected in the list. the first item is number 0. 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. insertitembefore(in svglength newi...
...e to the item are immediately reflected in the list. the first item is number 0. 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. insertitembefore(in svglength newitem, in unsigned long index) svglength inserts a new item into the list at the
specified position. the first item is number 0. if newitem is already in a list, it is removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. if the item is already in this list, note that the index of the item to insert before is before the removal of the item. if the index is equal to 0, then the new item is inserted at the front of the l...
SVGNumberList - Web APIs
he 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. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object it...
... is inserted into this list. the inserted item is the item itself and not a copy. the return value is the item inserted into the list. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. getitem(in unsigned long index) svgnumber returns the
specified item from the list. the returned item is the item itself and not a copy. any changes made to the item are immediately reflected in the list. the first item is number 0. 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. insertitembefore(in svgnumber ...
...the item are immediately reflected in the list. the first item is number 0. 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. insertitembefore(in svgnumber newitem, in unsigned long index) svgnumber inserts a new item into the list at the
specified position. the first item is number 0. if newitem is already in a list, it is removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. if the item is already in this list, note that the index of the item to insert before is before the removal of the item. if the index is equal to 0, then the new item is inserted at the fron...
SVGPathSegList - Web APIs
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 value is the item inserted into the list. exceptions: a domexception with code no_modification_allowed_err is raised when the list cannot be modified. ...
...ed item is the item itself and not a copy. the return value is the item inserted into the list. exceptions: a domexception with code no_modification_allowed_err is raised when the list cannot be modified. getitem(in unsigned long index) svgpathseg returns the
specified item from the list. the returned item is the item itself and not a copy. any changes made to the item are immediately reflected in the list. the first item is number 0. exceptions: a domexception with code no_modification_allowed_err is raised when the list cannot be modified. insertitembefore(in svgpathseg ne...
...e list. the first item is number 0. exceptions: a domexception with code no_modification_allowed_err is raised when the list cannot be modified. insertitembefore(in svgpathseg newitem, in unsigned long index) svgpathseg inserts a new item into the list at the
specified position. the first item is number 0. if newitem is already in a list, it is removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. if the item is already in this list, note that the index of the item to insert before is before the removal of the item. if the index is equal to 0, then the new item is insert...
SVGPointList - Web APIs
eptions: 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 inserted into the list. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute ...
...tself and not a copy. the return value is the item inserted into the list. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. getitem(in unsigned long index) svgpoint returns the
specified item from the list. the returned item is the item itself and not a copy. any changes made to the item are immediately reflected in the list. the first item is number 0. 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. ...
...tem is number 0. 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. insertitembefore(in svgpoint newitem, in unsigned long index) svgpoint inserts a new item into the list at the
specified position. the first item is number 0. if newitem is already in a list, it is removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. if the item is already in this list, note that the index of the item to insert before is before the removal of the item. if the index is equal to 0, then the new item is inserted at the front of the l...
SVGStringList - Web APIs
he 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. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the obj...
... is inserted into this list. the inserted item is the item itself and not a copy. the return value is the item inserted into the list. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. getitem(in unsigned long index) domstring returns the
specified item from the list. the returned item is the item itself and not a copy. any changes made to the item are immediately reflected in the list. the first item is number 0. 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. insertitembefore(in domstring ...
...the item are immediately reflected in the list. the first item is number 0. 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. insertitembefore(in domstring newitem, in unsigned long index) domstring inserts a new item into the list at the
specified position. the first item is number 0. if newitem is already in a list, it is removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. if the item is already in this list, note that the index of the item to insert before is before the removal of the item. if the index is equal to 0, then the new item is inserted at the front of the l...
SVGTransformList - Web APIs
t, 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 the list. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the obj...
... inserted into this list. the inserted item is the item itself and not a copy. the return value is the item inserted into the list. exceptions: a domexception with code no_modification_allowed_err is raised when the list corresponds to a read only attribute or when the object itself is read only. getitem(in unsigned long index) svgtransform returns the
specified item from the list. the returned item is the item itself and not a copy. any changes made to the item are immediately reflected in the list. the first item is number 0. 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. insertitembefore(in svgtransfo...
...em are immediately reflected in the list. the first item is number 0. 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. insertitembefore(in svgtransform newitem, in unsigned long index) svgtransform inserts a new item into the list at the
specified position. the first item is number 0. if newitem is already in a list, it is removed from its previous list before it is inserted into this list. the inserted item is the item itself and not a copy. if the item is already in this list, note that the index of the item to insert before is before the removal of the item. if the index is equal to 0, then the new item is inserted at the front of the l...
Using server-sent events - Web APIs
ly to keep the connection alive. each message consists of one or more lines of text listing the fields for that message. each field is represented by the field name, followed by a colon, followed by the text data for that field's value. fields each message received has some combination of the following fields, one per line: event a string identifying the type of event described. if this is
specified, an event will be dispatched on the browser to the listener for the
specified event name; the website source code should use addeventlistener() to listen for named events. the onmessage handler is called if no event name is
specified for a message. data the data field for the message. when the eventsource receives multiple consecutive lines that begin with data:, it concatenates them, inserting...
...ives multiple consecutive lines that begin with data:, it concatenates them, inserting a newline character between each one. trailing newlines are removed. id the event id to set the eventsource object's last event id value. retry the reconnection time to use when attempting to send the event. this must be an integer, specifying the reconnection time in milliseconds. if a non-integer value is
specified, the field is ignored. all other field names are ignored. note: if a line doesn't contain a colon, the entire line is treated as the field name with an empty value string. examples data-only messages in the following example, there are three messages sent. the first is just a comment, since it starts with a colon character. as mentioned previously, this can be useful as a keep-alive mechani...
...ges might not be sent regularly. the second message contains a data field with the value "some text". the third message contains a data field with the value "another message\nwith two lines". note the newline special character in the value. : this is a test stream data: some text data: another message data: with two lines named events this example sends named events. each has an event name
specified by the event field, and a data field whose value is an appropriate json string with the data needed for the client to act on the event. the data field could, of course, have any string data; it doesn't have to be json. event: userconnect data: {"username": "bobby", "time": "02:33:48"} event: usermessage data: {"username": "bobby", "time": "02:34:11", "text": "hi everyone."} event: userdisconne...
TextTrack - Web APIs
text track's label, if one is present; otherwise, this is an empty string (""), in which case a custom label may need to be generated by your code using other attributes of the track, if the track's label needs to be exposed to the user. texttrack.language read only a domstring which specifies the text language in which the text track's contents is written. the value must adhere to the format
specified in the tags for identifying languages (bcp 47) document from the ietf, just like the html lang attribute. for example, this can be "en-us" for united states english or "pt-br" for brazilian portuguese. texttrack.mode a domstring specifying the track's current mode. changing this property's value changes the track's current mode to match. permitted values are listed under text track mode constan...
...tml lang attribute. for example, this can be "en-us" for united states english or "pt-br" for brazilian portuguese. texttrack.mode a domstring specifying the track's current mode. changing this property's value changes the track's current mode to match. permitted values are listed under text track mode constants. ...
... <track> element's default boolean attribute is
specified, in which case the default mode is started. events cuechange fired when cues are entered and exited. a given text cue appears when the cue is entered and disappears when the cue is exited. also available via the oncuechange property. methods this interface also inherits methods from eventtarget. texttrack.addcue() adds a cue (
specified as a texttrackcue object to the track's list of cues. texttrack.removecue() removes a cue (
specified as a texttrackcue object from the track's list of cues. example tbd specifications specification status comment html living standardthe definition of 'texttrack' in that specification. living standard ...
getTrackById() - Web APIs
if no match is found, this method returns null. ...
...if no match is found, this method returns null. ...
...if no match is found, this method returns null. the tracks are searched in their natural order; that is, in the order defined by the media resource itself, or, if the resource doesn't define an order, the relative order in which the tracks are declared by the media resource. ...
URL - Web APIs
d components of the url or make changes to the url. if a browser doesn't yet support the url() constructor, you can access a url object using the window interface's window.url property. be sure to check to see if any of your target browsers require this to be prefixed. note: this feature is available in web workers. constructor new url() creates and returns a url object referencing the url
specified using an absolute url string, or a relative url string and a base url string. properties hash a usvstring containing a '#' followed by the fragment identifier of the url. host a usvstring containing the domain (that is the hostname) followed by (if a port was
specified) a ':' and the port of the url. hostname a usvstring containing the domain of the url. href a stringifier that return...
... 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 ':'. ...
...g 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 object which can be used to access the individual query parameters found in search. username a usvstring containing the username
specified before the domain name. methods tostring() returns a usvstring containing the whole url. it is a synonym for url.href, though it can't be used to modify the value. tojson() returns a usvstring containing the whole url. it returns the same string as the href property. static methods createobjecturl() returns a domstring containing a unique blob url, that is a url with blob: as its sc...
getTrackById - Web APIs
if no match is found, this method returns null. ...
...if no match is found, this method returns null. ...
...if no match is found, this method returns null. the tracks are searched in their natural order; that is, in the order defined by the media resource itself, or, if the resource doesn't define an order, the relative order in which the tracks are declared by the media resource. ...
WebGLRenderingContext.pixelStorei() - Web APIs
s. syntax void gl.pixelstorei(pname, param); parameters pname a glenum specifying which parameter to set. see below for possible values. param a glint specifying a value to set the pname parameter to. see below for possible values. return value none. pixel storage parameters parameter name (for pname) description type default value allowed values (for param)
specified in gl.pack_alignment packing of pixel data into memory glint 4 1, 2, 4, 8 opengl es 2.0 gl.unpack_alignment unpacking of pixel data from memory. glint 4 1, 2, 4, 8 opengl es 2.0 gl.unpack_flip_y_webgl flips the source data along its vertical axis if true. glboolean false true, false webgl gl.unpack_premultiply_al...
...se true, false webgl gl.unpack_colorspace_conversion_webgl default color space conversion 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. glint 0 0 to infinity 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 infinity opengl es 3.0 gl.pack_skip_rows number of rows of pixel locations skipped before the first pixel is written into memory glin...
...(gl.pack_alignment); gl.getparameter(gl.unpack_alignment); specifications specification status comment webgl 1.0the definition of 'pixelstorei' in that specification. recommendation initial definition for webgl. webgl 1.0the definition of 'pixel storage parameters' in that specification. recommendation additional pixel storage parameters that aren't
specified in opengl. opengl es 2.0the definition of 'glpixelstorei' in that specification. standard man page of the opengl es 2.0 api. webgl 2.0the definition of 'pixelstorei' in that specification. editor's draft updated definition for webgl 2. opengl es 3.0the definition of 'glpixelstorei' in that specification. standard man page of the opengl es 3.0 api. ...
Signaling and video calling - Web APIs
gests, this sends a stringified json message to a particular username. function sendtooneuser(target, msgstring) { var isunique = true; var i; for (i=0; i<connectionarray.length; i++) { if (connectionarray[i].username === target) { connectionarray[i].send(msgstring); break; } } } this function iterates over the list of connected users until it finds one matching the
specified username, then sends the message to that user. the parameter msgstring is a stringified json object. we could have made it receive our original message object, but in this example it's more efficient this way. since the message has already been stringified, we can send it with no further processing. each entry in connectionarray is a websocket object, so we can just call its send() method directl...
...message to this user only. candidate the sdp candidate string, describing the proposed connection method. you typically don't need to look at the contents of this string. all your code needs to do is route it through to the remote peer using the signaling server. each ice message suggests a communication protocol (tcp or udp), ip address, port number, connection type (for example, whether the
specified ip is the peer itself or a relay server), along with other information needed to link the two computers together. this includes nat or other networking complexity. note: the important thing to note is this: the only thing your code is responsible for during ice negotiation is accepting outgoing candidates from the ice layer and sending them across the signaling connection to the other peer when...
...he best route and protocols to use when communicating between the peers, even if they're behind a firewall or using nat. note: you should always use stun/turn servers which you own, or which you have specific authorization to use. this example is using a known public stun server but abusing these is bad form. each object in iceservers contains at least a urls field providing urls at which the
specified server can be reached. it may also provide username and credential values to allow authentication to take place, if needed. after creating the rtcpeerconnection, we set up handlers for the events that matter to us. the first three of these event handlers are required; you have to handle them to do anything involving streamed media with webrtc. the rest aren't strictly required but can be useful...
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
ov of about 180° (π or around 3.142 radians). making the camera's fov smaller reduces the arc that will be included in the viewport, thus enlarging that content when rendered to the view. there are differences between this and an optical zoom effect, but the result is generally close enough to get the job done. ...
... the perspective matrix encapsulates the field of view (technically, this is the vertical field of view), aspect ratio, and the near and far clipping planes within the 4x4 matrix transform, which is then returned to the caller. the near clipping plane is the distanc...
...estaldistance, 0]); mat4.translate(viewmatrix, viewmatrix, [0, 0, dollyydistance]); the solution here is obvious. since the translation is expressed as a vector providing the distance to move along each axis, we can combine them like this: mat4.translate(viewmatrix, viewmatrix, [-trackdistance, -pedestaldistance, dollydistance]); this will shift the origin of the matrix viewmatrix by the
specified amount along each axis. rotating around multiple axes you can also combine rotations around multiple axes into a single rotation around a quaternion representing a shared axis for the rotations. to perform the rotations separately, you use euler angles (separate angles around each axis) to apply pitch, yaw, and roll like this: mat4.rotatex(viewmatrix, viewmatrix, pitchangle); mat4.rotatey(view...
Fundamentals of WebXR - Web APIs
technology, from old film cameras to modern digital video cameras, including the cameras in computers and mobile devices. what is field of view? the field of view is, at its essence, the extent of the environment you are able to see at any one time. the width of the field of view is measured as the angle defining the arc from the far left edge of your field of view to the far right edge, and is
specified in either degrees or radians. a human eye is typically able to take in a fov of around 135°. assuming a person has two healthy eyes, their total field of view is about 200° to 220° wide. why is the fov wider with two eyes, but not double the single-eye fov? it's because the two eyes fovs overlap a lot. that overlap is what gives us depth perception; within the overlap area — which is around...
...ovide at least minimal support for translational movement detection, but to capture more substantial movement through the space, external sensors are usually required, such as cameras (either using visible light or infrared). webxr session modes webxr offers support for both augmented reality (ar) and virtual reality (vr) sessions, using the same api. which type of session you want to create is
specified when creating the session. this is done by specifying the appropriate session mode string for the kind of session you want to create. virtual reality in a vr environment, the entire image is digitally created by your app or site, from foreground objects all the way to the background or skybox. your frame drawing code will have to redraw every pixel of each view during each frame in order to avo...
...ave to redraw every pixel of each view during each frame in order to avoid the potential of artifacts being left behind. some platforms may provide previously-cleared frames to you, while others may optimize performance by not erasing the framebuffers in order to avoid having to touch each pixel twice per frame. there are two vr session modes available in webxr: inline and immersive. the former,
specified by the session mode string inline, presents the rendered scene within the context of a document in a web browser, and doesn't require special xr hardware to view. the immersive session mode is indicated using the session mode immersive-vr. this session mode requires an xr device such as a headset, and replaces the entire world with the rendered scene using the displays shown to each of the user's...
Rendering and the WebXR frame animation callback - Web APIs
o repaint your app or site window. in this context, "repaint" simply means the process of ensuring that the screen's displayed content matches what the dom and the elements within are trying to present at the moment. hardare vertical refresh rate when the browser is ready to refresh the <canvas> within which your webxr content is displayed, it calls your frame rendering callback, which uses the
specified timestamp and any other relevant data, such as models and textures, as well as application state, to render the scene—as it should appear at the
specified time—into the webgl backbuffer. when your callback returns, the browser transfers that backbuffer to the display or xr device, along with anything else that's changed since the last time the screen was refreshed. historically, displays hav...
...frametime = time; // now call the scene rendering code once for each of // the session's views. for (let view of viewerpose.views) { let viewport = gllayer.getviewport(view); gl.viewport(viewport.x, viewport.y, viewport.width, viewport.height); mydrawsceneintoview(view, deltatime); } } } the mydrawframe() function grabs the xrsession from the xrframe object
specified by the frame parameter, then calls the session's requestanimationframe() method to immediately schedule the rendering of the next frame. this ensures we get into the queue right away, allowing the rest of the time spent in this iteration of the mydrawframe() function to count toward the timing of drawing the next frame. we then get the xrviewerpose object that describes the viewer's pose—their...
...re set. since webxr uses a single framebuffer for every view, with viewports upon the view being used to separate each eye's viewpoint within the framebuffer, we only need to clear a single framebuffer rather than cleaning it for each eye (or other viewpoints, if any) individually. next, the time elapsed since the previous frame was rendered is calculated by subtracting from the current time as
specified by the currentframetime parameter the saved time at which the last frame was rendered, lastframetime. the result is a domhighrestimestamp value indicating the number of milliseconds that have elapsed since the last frame was rendered. we can use this value while drawing the scene to ensure we move everything the appopriate distance given the true elapsed time, rather than assuming that the callba...
XRRigidTransform() - Web APIs
entation 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 dompointinit which specifies the coordinates at which the point or object is located. ...
...bject is located. these dimensions are
specified in meters. if this parameter is left out or is not compatible with dompointinit, 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 dompointinit which specifies the direction in which the object is facing. the default value for orientation is {x: 0, y: 0, z: 0, w: 1}. the
specified orientation gets normalized if it's not already. return value a new xrrigidtransform object which has been initialized to represent a transform matrix that would adjust the position and orientation of an object from the origin to the
specified position and facing in the direction indicated by orientation. ...
... examples in this example, the beginning of the animation of a scene is shown, starting with a request for a reference space of a given type, then shifting the coordinate system based on a transform before requesting the first animation frame. ...
XRSession - Web APIs
nterface, eventtarget. cancelanimationframe() removes a callback from the animation frame painting callback from xrsession's set of animation frame rendering callbacks, given the identifying handle returned by a previous call to requestanimationframe(). end() ends the webxr session. returns a promise which resolves when the session has been shut down. requestanimationframe() schedules the
specified method to be called the next time the user agent is working on rendering an animation frame for the webxr device. returns an integer value which can be used to identify the request for the purposes of canceling the callback using cancelanimationframe(). this method is comparable to the window.requestanimationframe() method. requestreferencespace() requests that a new xrreferencespace of the spe...
...any properties not included in the given dictionary are left unchanged from their current values. events the following events are delivered to xrsession objects. ...
...any properties not included in the given dictionary are left unchanged from their current values. events the following events are delivered to xrsession objects. ...
XRView - Web APIs
y the projection matrix that will transform the scene to appear correctly given the point-of-view indicated by eye. this matrix should be used directly in order to avoid presentation distortions that may lead to potentially serious user discomfort. transform read only an xrrigidtransform which describes the current position and orientation of the viewpoint in relation to the xrreferencespace
specified when getviewerpose() was called on the xrframe being rendered. usage notes positions and number of xrviews per frame while rendering a scene, the set of views that are used to render the scene for the viewer as of the current frame are obtained by calling the xrframe object's getviewerpose() method to get the xrviewerpose representing (in essence) the position of the viewer's head. that obje...
...ght also be views representing observers watching the action, or other viewspoints not direclty associated with a player's eye. in addition, the number of views can change at any time, depending on the needs of the time. so you should process the view list every time without making assumptions based on previous frames. all positions and orientations within the views for a given xrviewerpose are
specified in the reference space that was passed to xrframe.getviewerpose(); this is called the viewer reference space. the transform property describes the position and orientation of the eye or camera represented by the xrview, given in that reference space. the destination rendering layer to render a frame, you just iterate over the xrviewerpose's views, rendering each of them into the appropriate vie...
...he pitch and yaw. quat.identity(inverseorientation); quat.rotatex(inverseorientation, inverseorientation, -mousepitch); quat.rotatey(inverseorientation, inverseorientation, -mouseyaw); // compute the true "up" vector for our object. vec3.cross(vecx, vecy, cubeorientation); vec3.cross(vecy, cubeorientation, vecx); // now compute the transform that teleports the object to the //
specified point and save a copy of it to display to the user // later; otherwise we probably wouldn't need to save mousematrix // at all. let newtransform = new xrrigidtransform({x: transversedistance, y: verticaldistance, z: axialdistance}, {x: inverseorientation[0], y: inverseorientation[...
XRWebGLLayer() - Web APIs
webxr device and the webgl graphics layer used to render the 3d scene. syntax let gllayer = new xrwebgllayer(session, context, layerinit); 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. layerinit optional an object conforming to the xrwebgllayerinit 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 alpha channel if the alpha boolean property is true. otherwise, the color buffer will not have an alpha channel. the default value is true. ...
...gnoredepthvalues optional a boolean value which indicates whether or not to ignore the contents of the depth buffer while compositing the scene. 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 layerinit 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 specifi...
... operationerror the resources (including memory buffers) needed for the layer to operate could not be allocated. specifications specification status comment webxr device apithe definition of 'xrwebgllayer()' in that specification. ...
XRWebGLLayer - Web APIs
access to the webgl framebuffer and viewport to ease access to the context. although xrwebgllayer is currently the only type of framebuffer layer supported by webgl, it's entirely possible that future updates to the webxr specification may allow for other layer types and corresponding image sources. constructor new xrwebgllayer() creates and returns a new xrwebgllayer object for use by the
specified xrsession, using a particular webglrenderingcontext or webgl2renderingcontext as the destination context. properties antialias read only a boolean value indicating whether or not the webgl context's framebuffer supports anti-aliasing. the specific type of anti-aliasing is determined by the user agent. framebuffer read only returns a webglframebuffer suitable for passing into the bindfra...
...epthvalues read only a boolean which indicates whether or not the webxr compositor should make use of the contents of the layer's depth buffer while compositing the scene. methods getviewport() returns a new xrviewport instance representing the position, width, and height to which the webgl context's viewport must be set to contain drawing to the area of the framebuffer designated for the
specified view's contents. in this way, for example, the rendering of the left eye's point of view and of the right eye's point of view are each placed into the correct parts of the framebuffer. static methods getnativeframebufferscalefactor() returns the scaling factor that can be used to scale the resolution of the recommended webgl framebuffer resolution to the rendering device's native resolution...
...ed from the xrsession object's rendering state and is then bound as the current rendering webgl framebuffer by calling the webgl bindframebuffer() function. let gllayer = xrsession.renderstate.baselayer; gl.bindframebuffer(gl.framebuffer, gllayer.framebuffer); rendering every view in a frame each time the gpu is ready to render the scene to the xr device, the xr runtime calls the function you
specified when you called the xrsession method requestanimationframe() to ask to render the frame. that function receives as input an xrframe which encapsulates the data needed to render the frame. this information includes the pose (an xrviewerpose object) that describes the position and facing direction of the viewer within the scene as well as a list of xrview objects, each representing one perspective...
-moz-context-properties - CSS: Cascading Style Sheets
if you reference an svg image in a webpage (such as with the <img> element or as a background image), the svg image can coordinate with the embedding element (its context) to have the image adopt property values set on the embedding element. ...
... 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 definition 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. you first need to specify on the embedding element the properties whose values you wish to expose to the embedded svg, using the -moz-context-properties property. for example: .i...
... note: you can find a working example on github. specifications not part of any standard. ...
-moz-outline-radius-bottomleft - CSS: Cascading Style Sheets
radius-bottomleft css property can be used to round the bottom-left corner of an element's outline. syntax the value of -moz-outline-radius-bottomleft is either a css <length> or a percentage of the corresponding dimensions of the border box. the calc() function may be used as well. ...
...e-radius-bottomleft is either a css <length> or a percentage of the corresponding 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 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 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. formal definition 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 rounding a outline since this is a firefox-only property, this example will not display the desired effect if you are viewing this in a browser other than firefox. html <p>look at this paragraph's bottom-left corner.</p> css p { margin: 10px; border: so...
-moz-outline-radius-bottomright - CSS: Cascading Style Sheets
us-bottomright css property can be used to round the bottom-right corner of an element's outline. syntax the value of -moz-outline-radius-bottomright is either a css <length> or a percentage of the corresponding dimensions of the border box. the calc() function may be used as well. ...
...adius-bottomright is either a css <length> or a percentage of the corresponding 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 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. ...
...ottom 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-topleft - CSS: Cascading Style Sheets
moz-outline-radius-topleft css property can be used to round the top-left corner of an element's outline. syntax the value of -moz-outline-radius-topleft is either a css <length> or a percentage of the corresponding dimensions of the border box. the calc() function may be used as well. ...
...oz-outline-radius-topleft is either a css <length> or a percentage of the corresponding 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. ...
...ure 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 definition 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 <p>look at this paragraph's top-left corner.</p> css p { margin: 5px; border: solid cyan; outline: dotted red; -moz-outline-radius-top...
-moz-outline-radius-topright - CSS: Cascading Style Sheets
outline-radius-topright css property can be used to round the top-right corner of an element's outline. syntax the value of -moz-outline-radius-topright is either a css <length> or a percentage of the corresponding dimensions of the border box. the calc() function may be used as well. ...
...outline-radius-topright is either a css <length> or a percentage of the corresponding 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 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 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. ...
-webkit-line-clamp - CSS: Cascading Style Sheets
when applied to anchor elements, the truncating can happen in the middle of the text, not necessarily at the end. note: this property was originally implemented in webkit and has some issues. it got standardized for legacy support. ...
... when applied to anchor elements, the truncating can happen in the middle of the text, not necessarily at the end. note: this property was originally implemented in webkit and has some issues. it got standardized for legacy support. ...
...t-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 definition 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 clamped. </p> css p { width: 300px; display: -webkit-box; -webkit-box-orient: ...
-webkit-mask-attachment - CSS: Cascading Style Sheets
if a -webkit-mask-image is
specified, -webkit-mask-attachment determines whether the mask image's position is fixed within the viewport, or scrolls along with its containing block. /* keyword values */ -webkit-mask-attachment: scroll; -webkit-mask-attachment: fixed; -webkit-mask-attachment: local; /* multiple values */ -webkit-mask-attachment: scroll, local; -webkit-mask-attachment: fixed, local, scroll; /* global values */ -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. ...
...l; /* multiple values */ -webkit-mask-attachment: scroll, local; -webkit-mask-attachment: fixed, local, scroll; /* global values */ -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. ...
...ask-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 definition 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. ...
speak-as - CSS: Cascading Style Sheets
represented in the spoken form. for example, an author can specify a counter symbol to be either spoken as its numerical value or just represented with an audio cue. syntax /* keyword values */ speak-as: auto; speak-as: bullets; speak-as: numbers; speak-as: words; speak-as: spell-out; /* @counter-style name value */ speak-as: <counter-style-name>; values auto if the value of speak-as is
specified as auto, then the effective value of speak-as will be determined based on the value of the system descriptor: if the value of system is alphabetic, the effective value of speak-as will be spell-out. if system is cyclic, the effective value of speak-as will be bullets. if system is extends, the value of speak-as will be the same as if speak-as: auto is
specified on the extended style. fo...
... counter value as normal and read it out as a word in the document language. spell-out the user agent will generate a counter representation as normal and would read it out letter by letter. if the user agent doesn't know how to read out a partiular counter symbol, the user agent might read it out as if the value of speak-as was numbers. <counter-style-name> the name of another counter style,
specified as a <custom-ident>. if included, the counter will be spoken out 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'...
...he 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. ...
symbols - CSS: Cascading Style Sheets
values <symbol> represents a symbol used within the counter system. this must be one of the following data types: <string> <image> (note: this value is "at risk" and may be removed from the specification. it is not yet implemented.) <custom-ident> description a symbol can be a string, image, or identifier. it is used within the @counter-style at-rule. ...
...he specification. it is not yet implemented.) <custom-ident> description a symbol can be a string, image, or identifier. it is used within the @counter-style at-rule. ...
...ls: 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. ...
@counter-style - CSS: Cascading Style Sheets
style is applicable. if a counter style is used to represent a counter value outside of its ranges, the counter style will drop back to its fallback style. pad is used when you need the marker representations to be of a minimum length. for example if you want the counters to start at 01 and go through 02, 03, 04 etc, then the pad descriptor is to be used. for representations larger than the
specified pad value, the marker is constructed as normal. fallback specifies a system to fall back into if either the
specified system is unable to construct the representation of a counter value or if the counter value outside the
specified range. if the
specified fallback also fails to represent the value, then the fallback style's fallback is used, if one is
specified. if there are either no fallba...
...ther no fallback systems described or if the chain of fallback systems are unable to represent a counter value, then it will ultimately fall back to the decimal style. symbols specifies the symbols that are to be used for the marker representations. symbols can contain string, images or custom identifiers. how the symbols are used to construct the marker representation is up to the algorithm
specified in the system descriptor. for example, if the system
specified is fixed, then each of the n symbols
specified in the descriptor will be used to represent the first n counter symbols. once the
specified set of symbols have exhausted, the fallback style will be used for the rest of the list. the below @counter-style rule uses images instead of character symbols. image values for symbols is curre...
...yle will be used for the rest of the list. the below @counter-style rule uses images instead of character symbols. image values for symbols is currently an 'at risk' feature, and is not implemented in any browser. @counter-style winners-list { system: fixed; symbols: url(gold-medal.svg) url(silver-medal.svg) url(bronze-medal.svg); suffix: " "; } additive-symbols while the symbols
specified in the symbols descriptor is used for constructing marker representation by most algorithms, some systems such as 'additive' rely on additive tuples described in this descriptor. each additive tuple consists of a counter symbol and a non negative integer weight. the additive tuples must be
specified in the descending order of their weights. speak-as describes how to read out the counter styl...
@keyframes - CSS: Cascading Style Sheets
nsitions. syntax @keyframes slidein { from { transform: translatex(0%); } to { transform: translatex(100%); } } values <custom-ident> a name identifying the keyframe list. this must match the identifier production in css syntax. from a starting offset of 0%. to an ending offset of 100%. <percentage> a percentage of the time through the animation sequence at which the
specified keyframe should occur. description javascript can access the @keyframes at-rule with the css object model interface csskeyframesrule. to use keyframes, create a @keyframes rule with a name that is then used by the animation-name property to match an animation to its keyframe declaration. each @keyframes rule contains a style list of keyframe selectors, which specify percentages along the anim...
...yframes rules don't cascade, so animations never derive keyframes from more than one rule set. if a given animation time offset is duplicated, all keyframes in the @keyframes rule for that percentage are used for that frame. there is cascading within a @keyframes rule if multiple keyframes specify the same percentage values. when properties are left out of some keyframes properties that aren't
specified in every keyframe are interpolated if possible — properties that can't be interpolated are dropped from the animation. for example: @keyframes identifier { 0% { top: 0; left: 0; } 30% { top: 50px; } 68%, 72% { left: 50px; } 100% { top: 100px; left: 100%; } } here, the top property animates using the 0%, 30%, and 100% keyframes, and left animates using the 0%, 68%, 72% and 100% keyfra...
...ier { 0% { top: 0; left: 0; } 30% { top: 50px; } 68%, 72% { left: 50px; } 100% { top: 100px; left: 100%; } } here, the top property animates using the 0%, 30%, and 100% keyframes, and left animates using the 0%, 68%, 72% and 100% keyframes. when a keyframe is defined multiple times if a keyframe is defined multiple times but not all affected properties are in each keyframe, all values
specified in these keyframes are considered. for example: @keyframes identifier { 0% { top: 0; } 50% { top: 30px; left: 20px; } 50% { top: 10px; } 100% { top: 0; } } in this example, at the 50% keyframe, the values used are top: 10px and left: 20px. cascading keyframes are supported starting in firefox 14. !important in a keyframe declarations in a keyframe qualified with !important are igno...
max-height - CSS: Cascading Style Sheets
he 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. ...
...alues. <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. ...
...e 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. ...
max-width - CSS: Cascading Style Sheets
he 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. ...
...alues. <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. ...
...e 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. ...
min-height - CSS: Cascading Style Sheets
he 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. ...
...alues. <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. ...
...e 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. ...
min-width - CSS: Cascading Style Sheets
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. ...
...lute 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. ...
...entage> 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. ...
Alternative style sheets - CSS: Cascading Style Sheets
e stylesheet using the view > page style submenu. internet explorer also supports this feature (beginning with ie 8), also accessed from view > page style. chrome requires an extension to use the feature (as of version 48). the web page can also provide its own user interface to let the user switch styles. an example: specifying the alternative stylesheets the alternate stylesheets are commonly
specified using a <link> element with rel="alternate stylesheet" and title="..." attributes. for example: <link href="reset.css" rel="stylesheet" type="text/css"> <link href="default.css" rel="stylesheet" type="text/css" title="default style"> <link href="fancy.css" rel="alternate stylesheet" type="text/css" title="fancy"> <link href="basic.css" rel="alternate stylesheet" type="text/css" title="basic"> ...
... using that style sheet. no matter what style is selected, the rules from the reset.css stylesheet will always be applied. try it out click here for a working example you can try out. details any stylesheet in a document falls into one of the following categories: persistent (no rel="alternate", no title=""): always applies to the document. ...
... when style sheets are referenced with a title attribute on the <link rel="stylesheeet"> or <style> element, the title becomes one of the choices offered to the user. style sheets linked with the same title are part of the same choice. style sheets linked without a title attribute are always applied. ...
Coordinate systems - CSS: Cascading Style Sheets
this guide describes the standard coordinate systems used by the css object model. these are generally only different in terms of where their origin is located. ...
...sitive and toward the viewer if negative. it's actually possible to change the definitions and orientations of these coordinate systems using css properties such as transform. however, we'll only talk about the standard coordinate system for now. standard cssom coordinate systems there are four standard coordinate systems used by the css object model, as described below. ...
...ly talk about the standard coordinate system for now. standard cssom coordinate systems there are four standard coordinate systems used by the css object model, as described below. offset coordinates
specified using the "offset" model use the top-left corner of the element being examined, or on which an event has occurred. for example, when a mouse event occurs, the position of the mouse as
specified in the event's offsetx and offsety properties are given relative to the top-left corner of the node to which the event has been delivered. the origin is inset by the distances
specified by padding-left and padding-top. client the "client" coordinate system uses as its origin the top-left corner of the viewport or browsing context in which the event occurred. this is the entire viewing area in w...
Using media queries - CSS: Cascading Style Sheets
this page use css's @media for illustrative purposes, but the basic syntax remains the same for all types of media queries. syntax a media query is composed of an optional media type and any number of media feature expressions. multiple queries can be combined in various ways by using logical operators. media queries are case-insensitive. a media query computes to true when the media type (if
specified) matches the device on which a document is being displayed and all media feature expressions compute as true. queries involving unknown media types are always false. note: a style sheet with a media query attached to its <link> tag will still download even if the query returns false. nevertheless, its contents will not apply unless and until the result of the query changes to true. media type...
... width-to-height aspect ratio of the output device deprecated in media queries level 4. device-height height of the rendering surface of the output device deprecated in media queries level 4. device-width width of the rendering surface of the output device deprecated in media queries level 4. display-mode the display mode of the application, as
specified in the web app manifest's display member defined in the web app manifest spec. forced-colors detect whether user agent restricts color palette added in media queries level 5. grid does the device use a grid or bitmap screen? height height of the viewport hover does the primary input mechanism allow the user to hover over elements? a...
... seen the and operator used to group a media type with a media feature. the and operator can also combine multiple media features into a single media query. the not operator, meanwhile, negates a media query, basically reversing its normal meaning. the only operator prevents older browsers from applying the styles. note: in most cases, the all media type is used by default when no other type is
specified. however, if you use the not or only operators, you must explicitly specify a media type. combining multiple types or features the and keyword combines a media feature with a media type or other media features. this example combines two media features to restrict styles to landscape-oriented devices with a width of at least 30 ems: @media (min-width: 30em) and (orientation: landscape) { ... }...
CSS reference - CSS: Cascading Style Sheets
a brief dom-css / cssom reference. basic rule syntax style rule syntax style-rule ::= selectors-list { properties-list } ... where : selectors-list ::= selector[:pseudo-class] [::pseudo-element] [, selectors-list] properties-list ::= [property : value] [; properties-list] see the 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 definition invalidates the entire rule. invalid rules are ignored by the browser. note that css r...
...e element selected by b. child combinator a > b specifies that the element selected by b is the direct child of the element selected by a. descendant combinator a b specifies that the element selected by b is a descendant of the element selected by a, but is not necessarily a direct child. column combinator a || b specifies that the element selected by b is located within the table column
specified by a. elements which span multiple columns are considered to be 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. concepts syntax and semantics css syntax at-rules cascade comments descr...
...(s). pseudo elements :: represents entities that are not included in html. see also: selectors in the selectors level 4 specification. ...
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. 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 pr...
...r inherited values. unset specifies that all the element's properties should be changed to their inherited values if they inherit by default, or to their initial values if not. revert specifies behavior that depends on the stylesheet origin to which the declaration belongs: user-agent origin equivalent to unset. user origin rolls back the cascade to the user-agent level, so that the
specified values are calculated as if no author-level or user-level rules were
specified for the element. author origin rolls back the cascade to the user level, so that the
specified values are calculated as if no author-level rules were
specified for the element. for purposes of revert, the author origin includes the override and animation origins. formal definition initial valuethere is no pr...
... the element. author origin rolls back the cascade to the user level, so that the
specified values are calculated as if no author-level rules were
specified for the element. for purposes of revert, the author origin includes the override and animation origins. formal definition initial valuethere is no practical initial value for it.applies toall elementsinheritednocomputed valueas the
specified value applies to each property this is a shorthand for.animation typeas each of the properties of the shorthand (all properties but unicode-bidi and direction) formal syntax initial | inherit | unset | revert examples html <blockquote id="quote"> lorem ipsum dolor sit amet, consectetur adipiscing elit. </blockquote> phasellus eget velit sagittis. css body { font-size: small; backgrou...
animation - CSS: Cascading Style Sheets
re animatable is available; it's worth noting that this description is also valid for css transitions. ...
...itions. constituent properties this property is a shorthand for the following css properties: animation-delay animation-direction animation-duration animation-fill-mode animation-iteration-count animation-name animation-play-state animation-timing-function syntax the animation property is
specified as one or more single animations, separated by commas. ...
...ial valueas each of the properties of the shorthand:animation-name: noneanimation-duration: 0sanimation-timing-function: easeanimation-delay: 0sanimation-iteration-count: 1animation-direction: normalanimation-fill-mode: noneanimation-play-state: runningapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas each of the properties of the shorthand:animation-name: as
specifiedanimation-duration: as
specifiedanimation-timing-function: as
specifiedanimation-delay: as
specifiedanimation-direction: as
specifiedanimation-iteration-count: as
specifiedanimation-fill-mode: as
specifiedanimation-play-state: as
specifiedanimation typediscrete formal syntax <single-animation>#where <single-animation> = <time> | <timing-function> | <time> | <single-animation-iteration-count> | <...
aspect-ratio - CSS: Cascading Style Sheets
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. ...
... <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 work with the dimensions of the box
specified by box-sizing. ...
...c 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. formal definition initial valueautoapplies toall elements except inline boxes and internal ruby or table boxesinheritednocomputed valueas
specifiedanimation typediscrete formal syntax auto | <ratio> examples mapping width and height to aspect-ratio firefox has added an internal aspect-ratio property (in version 69 onwards) that applies to replaced elements and other related elements that accept width and height attributes. this appears in the browser's internal ua stylesheet. chrome is also shipping this feature. in firefox, the inter...
background-attachment - 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 */ 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 element's contents. if the element has a scrolling mechanism, the background scrolls wit...
...ing 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 definition 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 other, trying every door, she walked sadly down the middle, wondering how she was ever to get out again. </p> css p { background-im...
... to get out again. </p> css p { background-image: url("https://mdn.mozillademos.org/files/12057/starsolid.gif"); background-attachment: fixed; } result multiple background images this property supports multiple background images. you can specify a different <attachment> for each background, separated by commas. each image is matched with the corresponding attachment type, from first
specified to last. 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 other, trying every door, she walked sadly down the middle, wondering how she was ever to get out again. suddenly she came upon a little three-legged table, all made of solid glass; there was nothing on it except a tiny golden key, and alice'...
background-clip - CSS: Cascading Style Sheets
us a pull request. if the element has no background-image or background-color, this property will only have a visual effect when the border has transparent regions or partially opaque regions (due to border-style or border-image); otherwise, the border masks the difference. note: because the root element has a different background painting area, the background-clip property has no effect when
specified on it. see "the backgrounds of special 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> elemen...
...ent: 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 */ background-clip: inherit; background-clip: initial; background-clip: unset; valu...
...e 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 definition initial valueborder-boxapplies toall elements. ...
border-bottom - CSS: Cascading Style Sheets
bottom-style and border-bottom-color. 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 all shorthand properties, border-bottom always sets the values of all of the properties that it can set, even if they are not
specified. it sets those that are not
specified to their default values. this means that ... border-bottom-style: dotted; border-bottom: thick green; ... is actually the same as ... border-bottom-style: dotted; border-bottom: none thick green; ... and the value of border-bottom-style given before border-bottom is ignored. since the default value of border-bottom-style is none, not specifying the bord...
...fault value of border-bottom-style is none, not specifying the border-style part results in no border. constituent properties this property is a shorthand for the following css properties: border-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 definition 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.inher...
.... formal definition initial valueas each of the properties of the shorthand:border-bottom-width: mediumborder-bottom-style: noneborder-bottom-color: currentcolorapplies toall elements. ...
border-image-outset - CSS: Cascading Style Sheets
; /* <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 the left and right. if three values are
specified, the first applies to the top, t...
... 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. ...
...ultiple 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 definition initial value0applies toall elements, except internal table elements when border-collapse is collapse. ...
border-left - CSS: Cascading Style Sheets
property set an element's left border. 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 all shorthand properties, border-left always sets the values of all of the properties that it can set, even if they are not
specified. it sets those that are not
specified to their default values. this means that ... border-left-style: dotted; border-left: thick green; ... is actually the same as ... border-left-style: dotted; border-left: none thick green; ... and the value of border-left-style given before border-left is ignored. since the default value of border-left-style is none, not specifying the border-style part ...
... since the default value of border-left-style is none, not specifying the border-style part results in no border. constituent properties this property is a shorthand for the following css 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 definition 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.inheritednocomput...
...r-left-color. formal definition initial valueas each of the properties of the shorthand:border-left-width: mediumborder-left-style: noneborder-left-color: currentcolorapplies toall elements. ...
border-right - CSS: Cascading Style Sheets
operties of an element's right border. 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 all shorthand properties, border-right always sets the values of all of the properties that it can set, even if they are not
specified. it sets those that are not
specified to their default values. this means that ... border-right-style: dotted; border-right: thick green; ... is actually the same as ... border-right-style: dotted; border-right: none thick green; ... and the value of border-right-style given before border-right is ignored. since the default value of border-right-style is none, not specifying the border-styl...
...the default value of border-right-style is none, not specifying the border-style part results in no border. constituent properties this property is a shorthand for the following css properties: 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 definition 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.inheritedno...
...-color. formal definition initial valueas each of the properties of the shorthand:border-right-width: mediumborder-right-style: noneborder-right-color: currentcolorapplies toall elements. ...
border-top - CSS: Cascading Style Sheets
e properties of an element's top border. 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 all shorthand properties, border-top always sets the values of all of the properties that it can set, even if they are not
specified. it sets those that are not
specified to their default values. this means that ... border-top-style: dotted; border-top: thick green; ... is actually the same as ... border-top-style: dotted; border-top: none thick green; ... and the value of border-top-style given before border-top is ignored. since the default value of border-top-style is none, not specifying the border-style part results...
...gnored. since the default value of border-top-style is none, not specifying the border-style part results in no border. constituent properties this property is a shorthand for the following 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 definition 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 val...
...e border-top-color. formal definition initial valueas each of the properties of the shorthand:border-top-width: mediumborder-top-style: noneborder-top-color: currentcolorapplies toall elements. ...
box-orient - CSS: Cascading Style Sheets
rd. 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 block axes are the writing-mode dependent keywords which, in english, map...
...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 definition 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. html <div class="example"> <p>i will be to the left of my sibling.</p> <p>i will be to the right of my sibling.</p> </div> css div.example...
... here, he box-orient property will cause the two <p> sections in the example to display in the same line. html <div class="example"> <p>i will be to the left of my sibling.</p> <p>i will be to the right of my sibling.</p> </div> css div.example { display: -moz-box; /* mozilla */ display: -webkit-box; /* webkit */ display: box; /* as
specified */ /* children should be oriented vertically */ -moz-box-orient: horizontal; /* mozilla */ -webkit-box-orient: horizontal; /* webkit */ box-orient: horizontal; /* as
specified */ } result specifications not part of any standard. ...
column-gap (grid-column-gap) - CSS: Cascading Style Sheets
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 definition 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 property. syntax /* keyword value */ column-gap: normal; ...
...r, 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 size of the gap between columns, defined as a <percentage>. th...
...ed 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. ...
column-rule - 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. 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. ...
... 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. ...
...see border-style for possible values and details. <'column-rule-color'> is a <color> value. ...
content - CSS: Cascading Style Sheets
t() function, denoting the content to display. <counter>() the value of a css counter, generally a number. it can be displayed using either the counter() or counters() function. the counter() function has two forms: 'counter(name)' or 'counter(name, style)'. the generated text is the value of the innermost counter of the given name in scope at the given pseudo-element. it is formatted in the
specified style (decimal by default). the counters() function also has two forms: 'counters(name, string)' or 'counters(name, string, style)'. the generated text is the value of all counters with 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 indicated style (decimal by default). attr(x) the value o...
...er 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 definition initial valuenormalapplies to::before and ::after pseudo-elementsinheritednocomputed valueon elements, always computes to normal. ...
... mdn understanding success criterion 1.3.1 | w3c understanding wcag 2.0 formal definition 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. ...
counter-increment - CSS: Cascading Style Sheets
none ...
...erty 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 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. ...
...parated 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. ...
counter-reset - CSS: Cascading Style Sheets
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 to reset the counter to on each occurrence of the element. defaults t...
...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 to reset the counter to on each occurrence of the element. defaults to 0 if not
specified. ...
...rd 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. formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas
specifiedanimation typediscrete formal syntax [ <custom-ident> <integer>? ]+ | none examples resetting named counters h1 { counter-reset: chapter section 1 page; /* sets the chapter and page counters to 0, and the section counter to 1 */ } specifications specification status comment css lists module level 3the definition of 'counter-reset' in that specification. ...
counter-set - CSS: Cascading Style Sheets
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 the counter to on each occurrence of the element. defaults to 0 ...
...her 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 the counter to on each occurrence of the element. defaults to 0 if not
specified. if there isn't currently a counter of the given name on the element, the element will create a new counter of the given name with a starting value of 0 (though it may then immediately set or 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. formal definition initial valuenoneappli...
...iven 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. formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas
specifiedanimation typediscrete formal syntax [ <custom-ident> <integer>? ]+ | none examples setting named counters h1 { counter-set: chapter section 1 page; /* sets the chapter and page counters to 0, and the section counter to 1 */ } specifications specification status comment css lists module level 3the definition of 'counter-set' in that specification. wo...
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
are described in the specification as legacy values, and currently you gain no benefit from using the two-value versions, as there is a direct mapping for each two-value version to a legacy version, as demonstrated in the table above. ...
...if a <display-outside> value is
specified but <display-inside> is omitted, the element’s inner display type defaults to flow." this means that the behavior is exactly as it is in a single value world. if you specify display: block or display: inline, that changes the outer display value of the box but any children continue in normal flow. ...
... flow." this means that the behavior is exactly as it is in a single value world. if you specify display: block or display: inline, that changes the outer display value of the box but any children continue in normal flow. ...
flex-wrap - CSS: Cascading Style Sheets
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 flex items break into multiple lines. the cross-start is eit...
...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 flex items break into multiple lines. ...
... 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. ...
float - CSS: Cascading Style Sheets
ractive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. a floating element is one where the computed value of float is not none. ...
...ase 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 side with ltr scripts, and the right side with rtl ...
...ide 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 definition initial valuenoneapplies toall elements, but has no effect if the value of display is none.inheritednocomputed valueas
specifiedanimation typediscrete formal syntax left | right | none | inline-start | inline-end examples how floated elements are positioned as mentioned above, when an element is floated, it is taken out of the normal flow of the document (though still remaining part of it). it is shifted to the left, or right, until it touches the edge of its containing box, or another floated element. in this example...
font-family - CSS: Cascading Style Sheets
e; font-family: fantasy; font-family: system-ui; font-family: ui-serif; font-family: ui-sans-serif; font-family: ui-monospace; font-family: ui-rounded; font-family: emoji; font-family: math; font-family: fangsong; /* global values */ font-family: inherit; font-family: initial; font-family: unset; the font-family property lists one or more font families, separated by commas. 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. for example, "times" and "helvetica" are font families. font family names containing whitespace should be quoted. <generic-name> ...
...> and the second with a <generic-name>: font-family: gill sans extrabold, sans-serif; values <family-name> the name of a font family. for example, "times" and "helvetica" are font families. font family names containing whitespace should be quoted. <generic-name> generic font families are a fallback mechanism, a means of preserving some of the style sheet author's intent when none of the
specified fonts are available. generic family names are keywords and must not be quoted. a generic font family should be the last item in the list of font family names. the following keywords are defined: serif glyphs have finishing strokes, flared or tapering ends, or have actual serifed endings. e.g. lucida bright, lucida fax, palatino, "palatino linotype", palladio, "urw palladio", serif. san...
...okletter 1911, sans-serif; font-family: red/black, sans-serif; font-family: "lucida" grande, sans-serif; font-family: ahem!, sans-serif; font-family: test@foo, sans-serif; font-family: #pound, sans-serif; font-family: hawaii 5-0, sans-serif; formal definition initial valuedepends on user agentapplies toall elements. ...
font-size - CSS: Cascading Style Sheets
larger, smaller relative-size keywords. the font will be larger or sm...
...ing everywhere else on the page, giving you the ability to easily scale the font up or down on the entire page accordingly. pixels setting the font size in pixel values (px) is a good choice when you need pixel accuracy. a px value is static. this is an os-independent and cross-browser way of literally telling the browsers to render the letters at exactly the number of pixels in height that you
specified. the results may vary slightly across browsers, as they may use different algorithms to achieve a similar effect. font sizing settings can also be used in combination. for example, if a parent element is set to 16px and its child element is set to larger, the child element displays larger than the parent element in the page. note: defining font sizes in px is not accessible, because the user ca...
...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 definition initial valuemediumapplies toall elements. ...
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. bolder one relative font weight heavier than the parent element. ...
...s less than the target, in descending order. if no match is found, look for available weights greater than the target, in ascending order. if a weight greater than 500 is given, look for available weights greater than the target, in ascending order. if no match is found, look for available weights less than the target, in descending order. meaning of relative weights when lighter or bolder is
specified, the below chart shows how the absolute font weight of the element is determined. note that when using relative weights, only four font weights are considered — thin (100), normal (400), bold (700), and heavy (900). if a font-family has more weights available, they are ignored for the purposes of relative weight calculation. inherited value bolder lighter 100 40...
...f 100 (thin/hairline) or 200 (extra light), 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 definition initial valuenormalapplies toall elements. ...
grid-template-columns - CSS: Cascading Style Sheets
notation that defines a size range greater than or equal to min and less than or equal to max. if max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value sets the track’s flex factor. it is invalid as a 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 stretched by the align-content and justify-content properties. fit-content( [ <length> | <percentage> ] ) represents the formula min(max-content, max(auto, argument)), which is calculated similar to auto (i.e. minmax(auto, max-content)), except that the track size ...
...it is greater than the auto minimum. repeat( [ <positive-integer> | auto-fill | auto-fit ] , <track-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. ...
...than being
specified explicitly, the sizes of the grid rows/columns will be taken from the parent grid’s definition. the subgrid value is from level 2 of the grid specification and currently only has implementation in firefox 71 and onwards. ...
hyphens - 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. hyphenation rules are language-specific. ...
...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 break opportunities below for details. auto the browse...
...l 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 definition initial valuemanualapplies toall elementsinheritedyescomputed valueas
specifiedanimation typediscrete formal syntax none | manual | auto examples specifying text hyphenation this example uses three classes, one for each possible configuration of the hyphens property. html <dl> <dt><code>none</code>: no hyphen; overflow if needed</dt> <dd lang="en" class="none">an extreme­ly long english word</dd> <dt><code>manual</code>: hyphen only at &hyphen; or &s...
margin-block-end - CSS: Cascading Style Sheets
lues 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. ...
...n. 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. ...
...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. ...
margin-block-start - CSS: Cascading Style Sheets
lues 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. ...
...n. 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. ...
...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. ...
margin-block - CSS: Cascading Style Sheets
fined 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. ...
...stituent 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. ...
...rty 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. ...
margin-inline-end - CSS: Cascading Style Sheets
nherit; 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. ...
... 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. ...
...tart, 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. ...
margin-inline-start - CSS: Cascading Style Sheets
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; 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. ...
...-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. ...
margin-left - CSS: Cascading Style Sheets
s://github.com/mdn/interactive-examples and send us a pull request. the vertical margins of two adjacent boxes may fuse. this is called margin collapsing. in the rare cases where width is overconstrained (i.e., when all of width, margin-left, border, padding, the content area, and margin-right are defined), margin-left is ignored, and will have the same calculated value as if the auto value was
specified. ...
...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. ...
...this case, it is evenly distributed to all horizontal auto margins. flexbox layout mode formal definition 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 setting left margin using pixels and percentages .content { margin-left: 5%; } .sidebox { margin-left: 10px; } .logo { margin-left: -5px; } specifications specification status comment css basic box modelthe definition of 'margin-left' in that specification. ...
mask-border-outset - CSS: Cascading Style Sheets
et: 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
specified, the first outset applies to the top, the second to the left and right,...
... 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. ...
... 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 definition 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 eventually starts to be supported, it will serve to move the mask away from the inner edge of the element's border box — you can use it to make the mask start from part way across ...
mask-border-slice - CSS: Cascading Style Sheets
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 positions are
specified, the first value creates slices measured from the top and bot...
.... 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 positions are
specified, the first value creates slices measured from the top and bottom, the second creates slices measured from the left and right. when three positions are
specified, the first value creates a slice measured from the top, the second creates slices measured from the left and right, the third creates a slice measured from the bottom. when four positions are
specified, they create slices measured from the top, right, bottom, and left in that order (clockwise). the optional fill value, if used, can be placed anywhere in the declaration. values <number> re...
...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. formal definition initial value0applies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednopercentagesrefer to size of the mask border imagecomputed valueas
specifiedanimation typediscrete formal syntax <number-percentage>{1,4} fill?where <number-percentage> = <number> | <percentage> examples basic usage this property doesn't appear to be supported anywhere yet. when it eventually starts to be supported, it will serve to define the size of the slices taken from the source image, and used to create the border mask. mask-border-slice: 30 fill; chromium-ba...
mask-border - CSS: Cascading Style Sheets
.png') 25 space; /* source | slice | width */ mask-border: url('border-mask.png') 25 / 35px; /* source | slice | width | outset | repeat | mode */ mask-border: url('border-mask.png') 25 / 35px / 12px space alpha; values <'mask-border-source'> the source image. see mask-border-source. <'mask-border-slice'> the dimensions for slicing the source image into regions. up to four values may be
specified. see mask-border-slice. <'mask-border-width'> the width of the border mask. up to four values may be
specified. see mask-border-width. <'mask-border-outset'> the distance of the border mask from the element'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 ...
...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. ...
...idth: autoapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednopercentagesas each of the properties of the shorthand:mask-border-slice: refer to size of the mask border imagemask-border-width: relative to width/height of the mask border image areacomputed valueas each of the properties of the shorthand:mask-border-mode: as
specifiedmask-border-outset: as
specified, but with relative lengths converted into absolute lengthsmask-border-repeat: as
specifiedmask-border-slice: as
specifiedmask-border-source: as
specified, but with <url> values made absolutemask-border-width: as
specified, but with relative lengths converted into absolute lengthsanimation typeas each of the properties of the shorthand:mask-border-mode: discretemask...
mask-origin - CSS: Cascading Style Sheets
box, fill-box, border-box; /* non-standard keyword values */ -webkit-mask-origin: content; -webkit-mask-origin: padding; -webkit-mask-origin: border; /* global values */ mask-origin: inherit; mask-origin: initial; mask-origin: unset; for elements rendered as a single box, this property specifies the mask positioning area. 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 determine the mask positioning area. syntax one or more of the keyword values listed below, separated by commas. values content-box the position is relative to the content box. padding-box ...
... left corner of the padding edge, 100% 100% is the lower right corner. border-box the position is relative to the border box. margin-box the position is relative to the margin box. fill-box the position is relative to the object bounding box. stroke-box the position is relative to the stroke bounding box. view-box uses the nearest svg viewport as reference box. 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. formal definition initial valueborder-boxappl...
... 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. ...
max-width - 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. max-width overrides width, but min-width overrides max-width. ...
...alues */ 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-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)). accessibility concerns ensure that elements set with a max-width are not tr...
...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 definition initial valuenoneapplies toall elements but non-replaced inline elements, table rows, and row groupsinheritednopercentagesrefer to the width of the containing blockcomputed valuethe percentage as
specified or the absolute length or noneanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content(<length-percentage>)where <length-percentage> = <length> | <percentage> examples setting max width in pixels in this example, the "child" will be either 150 pixels wide or the width of the "parent," whichever is smaller. html <d...
min-width - 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. the element's width is set to the value of min-width whenever min-width is larger than max-width or width. ...
...0%; /* 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-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 definition initial valueautoapplies toall elements but non-replaced ...
...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)). ...
object-fit - CSS: Cascading Style Sheets
iner. you can alter the alignment of the replaced element's content object within the element's box using the object-position 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. syntax the object-fit property is
specified as a single keyword chosen from the list of values below. values contain the replaced content is scaled to maintain its aspect ratio while fitting within the element’s content box. the entire object is made to fill the box, while preserving its aspect ratio, so the object will be "letterboxed" if its aspect ratio does not match the aspect ratio of the box. cover the replaced content is s...
...ratio of its box, then the object will be clipped to fit. fill the replaced content 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. ...
...ely 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. ...
offset-path - CSS: Cascading Style Sheets
url() references the id of an svg shape -- circle, ellipse, line, path, polygon, polyline, or rect -- using the shape's geometry as the path. ...
...pse, line, path, polygon, polyline, or rect -- using the shape's geometry as the path. <basic-shape> specifies a css shape including circle(), ellipse(), inset(), polygon(), or path(). path() a path string defined 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. each shape or path must define an initial position for the computed value of 0 for offset-distance and an initial direction which specifies the rotation of the object to the initial position. early versions of the spec c...
...position for the computed value of 0 for offset-distance and an initial direction which specifies the rotation of the object to the initial position. early versions of the spec called this property motion-path. it was changed to offset-path because the property describes static positions, not motion. ...
outline - CSS: Cascading Style Sheets
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'> sets the color of the outline. defaults to currentcolor if ab...
...nheritednocomputed 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 value will be the rgba() corresponding one. if it isn't, it will be the rgb() corresponding one. ...
... the shorthand:outline-color: for 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. ...
overflow-block - CSS: Cascading Style Sheets
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 necessary to fit in the block dimension in the padding box. browsers dis...
...anges.) 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. ...
...lock: visible; margin-bottom: 120px;} #div4 { overflow-block: auto; margin-bottom: 120px;} result specifications specification status comment css overflow module level 3the definition 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-wrap - CSS: Cascading Style Sheets
d 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-acceptable break points in the line. no hyphenation character is inserted...
...d 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 definition 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="normal">chargoggagoggmanchauggagoggchaubunagungamaugg</em>, though i've never been there myself.
...verflow-wrap: break-word; } .word-break { word-break: break-all; } .hyphens { hyphens: auto; } result specifications specification status comment css text module level 3the definition of 'overflow-wrap' in that specification. working draft initial definition initial valuenormalapplies tonon-replaced inline elementsinheritedyescomputed valueas
specifiedanimation typediscrete ...
overflow - CSS: Cascading Style Sheets
e-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 necessary to fit the padding box. no scrollbars are provi...
...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. ...
...o scroll an html element even when overflow is set to hidden. ...
paint-order - CSS: Cascading Style Sheets
note: in the case of this property, markers are only appropriate when drawing svg shapes invol...
...the stroke first, then fill and markers */ paint-order: markers; /* draw the markers first, then fill and stroke */ /* multiple values */ paint-order: stroke fill; /* draw the stroke first, then the fill, then the markers */ paint-order: markers stroke fill; /* draw markers, then stroke, then fill */ if no value is
specified, the default paint order is fill, stroke, markers. when one value is
specified, that one is painted first, followed by the other two in their default order relative to one another. when two values are
specified, they will be painted in the order they are
specified in, followed by the un
specified one. note: in the case of this property, markers are only appropriate when drawing svg shapes involving the use of the marker-* properties (e.g. marker-start) and <marker> element...
...-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. ...
repeat() - CSS: Cascading Style Sheets
>-sized track takes a share of the remaining space in proportion to its flex factor. max-content represents the largest max-content contribution of the grid items occupying the grid track. min-content represents the largest min-content contribution of the grid items occupying the grid track. auto as a maximum, identical to max-content. as a minimum it represents the largest minimum size (as
specified by min-width/min-height) of the grid items occupying the grid track. auto-fill if the grid container has a definite 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-...
...template-columns), if that is definite. otherwise, as its minimum track sizing function, and taking grid-gap into account. if any number of repetitions would overflow, then the repetition is 1. otherwise, if the grid container has a definite minimal size in the relevant axis, the number of repetitions is the smallest possible positive integer that fulfills that minimum requirement. otherwise, the
specified track list repeats only once. auto-fit behaves the same as auto-fill, except that after placing the grid items any empty repeated tracks are collapsed. an empty track is one with no in-flow grid items placed into or spanning across it. (this can result in all tracks being collapsed, if they’re all empty.) a collapsed track is treated as having a single fixed track sizing function of 0px, ...
... track is one with no in-flow grid items placed into or spanning across it. (this can result in all tracks being collapsed, if they’re all empty.) a collapsed track is treated as having a single fixed track sizing function of 0px, and the gutters on either side of it collapse. for the purpose of finding the number of auto-repeated tracks, the user agent floors the track size to a user agent
specified value (e.g., 1px), to avoid division by zero. examples specifying grid columns using repeat() html <div id="container"> <div> this item is 50 pixels wide. </div> <div> item with flexible width. </div> <div> this item is 50 pixels wide. </div> <div> item with flexible width. </div> <div> inflexible item of 100 pixels width. </div> </div> css #contai...
text-decoration-style - CSS: Cascading Style Sheets
as browsers can disable styling in some cases, the semantic meaning won't disappear in such a situation. ...
...as browsers can disable styling in some cases, the semantic meaning won't disappear in such a situation. ...
...al; 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 definition initial valuesolidapplies toall elements. ...
text-indent - CSS: Cascading Style Sheets
ontent 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 soft wrap break. hanging inverts which lines are indented. all lines ...
... 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. ...
...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. ...
text-overflow - CSS: Cascading Style Sheets
ow to occur. to make text overflow its container you have to set other css properties: overflow and white-space. for example: overflow: hidden; white-space: nowrap; the text-overflow property only affects content that is overflowing a block container element in its inline progression direction (not text overflowing at the bottom of a box, for example). ...
... values clip the default for this property. ...
...mplete 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. ...
text-rendering - CSS: Cascading Style Sheets
cision. this enables kerning and optional ligatures. geometricprecision the browser emphasizes geometric precision over rendering speed and legibility. certain aspects of fonts — such as kerning — don't scale linearly. so this value can make text using those fonts look good. in svg, when text is scaled up or down, browsers calculate the final size of the text (which is determined by the
specified font size and the applied scale) and request a font of that computed size from the platform's font system. but if you request a font size of, say, 9 with a scale of 140%, the resulting font size of 12.6 doesn't explicitly exist in the font system, so the browser rounds the font size to 12 instead. this results in stair-step scaling of text. but the geometricprecision property — when fully sup...
...results in stair-step scaling of text. but the geometricprecision property — when fully 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. ...
...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 definition 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 ffl</p> <p class="big">lyowat - ff fi fl ffl</p> css .small { font: 19.9px "consta...
transform-box - CSS: Cascading Style Sheets
e 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 bounding box i...
...x, 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 bounding box is used as the reference box. stroke-box the stroke bounding box is used as the reference box. view-box the nearest svg viewport is used as the reference box. ...
...rence 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. ...
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 composite transforms are effectively applied in order from right to ...
...atic for accessibility, as they are a common trigger for certain types of migraine. if you need to include such animations on your website, you should provide a control to allow users to turn off animations, preferrably site-wide. ...
...te a media query that will turn off animations if the user has reduced animation
specified in their system preferences. ...
transition-timing-function - CSS: Cascading Style Sheets
https://github.com/mdn/interactive-examples and send us a pull request. this, in essence, lets you establish an acceleration curve so that the speed of the transition can vary over its duration. this acceleration curve is defined using one <timing-function> for each property to be transitioned. you may specify multiple timing functions; each one will be applied to the corresponding property as
specified by the transition-property property, which acts as a transition-property list. if there are fewer timing functions
specified than in the transition-property list, the user agent must calculate which value is used by repeating the list of values until there is one for each transition property. if there are more timing functions, the list is simply truncated to the right size. in both cases, the cs...
...ch <timing-function> represents the timing function to link to the corresponding property to transition, as defined in transition-property. 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-predefined value. the step timing functions divides the input time into a
specified number of intervals that are equal in length. it is defined by a number of steps and a step position. ease equal to cubic-bezier(0.25, 0.1, 0.25, 1.0), the default value, increases in velocity towards the middle of the transition, slowing back down at the end. linear equal to cubic-bezier(0.0, 0.0, 1.0, 1.0), transitions at an even speed. ease-in equal to cubic-bezier(0.42, 0, 1.0,...
..., 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. ...
translate - CSS: Cascading Style Sheets
/* single values */ translate: 100px; translate: 50%; /* two values */ translate: 100px 200px; translate: 50% 105px; /* three values */ translate: 50% 105px 5rem; values single <length-percentage> value a <length> or <percentage> that specifies a 2d translation, with the same translation along both the x and y axes. equivalent to a translate() (2d translation) function with a single value
specified. two <length-percentage> values two <length> or <percentage> that specify the x and y axis translation values (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...
...ues 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. ...
...e 1s; } div:hover .translate { translate: 200px 50px; } result specifications specification status comment css transforms level 2the definition of 'individual transforms' in that specification. editor's draft initial definition. initial valuenoneapplies totransformable elementsinheritednopercentagesrefer to the size of bounding boxcomputed valueas
specified, but with relative lengths converted into absolute lengthsanimation typea transformcreates stacking contextyes ...
visibility - CSS: Cascading Style Sheets
ps://github.com/mdn/interactive-examples and send us a pull request. to both hide an element and remove it from the document layout, set the display property to none instead of using visibility. syntax /* keyword values */ visibility: visible; visibility: hidden; visibility: collapse; /* global values */ visibility: inherit; visibility: initial; visibility: unset; the visibility property is
specified as one of the keyword values listed below. values visible the element box is visible. hidden the element box is invisible (not drawn), but still affects layout as normal. descendants of the element will be visible if they have visibility set to visible. the element cannot receive focus (such as when navigating through tab indexes). collapse for <table> rows, columns, column groups, an...
...de of [0, 1]) map to the closer endpoint. notes 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. ...
...rn 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 definition 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 occupying space.</p> css .visible { visibility: visible; } .not-visible { visibili...
Cross-browser audio basics - Developer guides
d then <audio> and <source> will be ignored. however any supported text or elements that you define within <audio> will be displayed or acted upon. so the ideal place to create a fallback or inform of incompatibility is before the closing </audio> tag. in this case, we've provided a simple paragraph including a link to download the audio directly. the controls attribute on the <audio> element is
specified when we require the browser to provide us with default playback controls. if you don't specify this attribute, no controls will appear — and you will instead have to create your own controls and program their functionality using the media api (see below). however, that can be a good approach, because the default controls look different among various browsers. so creating your own controls ensur...
...playback controls. <audio controls> ... </audio> src as mentioned above, you can use the <source> element to specify one or more source audio files. alternatively, you can include the src attribute directly on the <audio> element to specify a single source file. <audio src="audiofile.mp3"> ... </audio> type as mentioned above, to be sure that the browser knows what type of file is being
specified, it's good practice to specify a type attribute alongside the src attribute. the type attribute specifies the mime type or internet media type of the file. <audio src="audiofile.mp3" type="audio/mpeg"> ... </audio> fallbacks although the vast majority of browsers now support the <audio> element, you may want to cater for those that don't, such as ie<9. such browsers can be covered using a si...
...whether a certain audio file type is supported. it takes the mime type of the type to check as a parameter. if (myaudio.canplaytype('audio/mpeg')) { // it's supported. // do something here! } canplaytype() returns one of three values: probably maybe "" (an empty string) in practice, we usually check if the result is true or false. non-empty strings are true. note: a very early spec
specified that the browser should return no instead of an empty string, but thankfully the number of people using older browsers that implement this version of the spec are few and far between. currenttime the currenttime property gets or sets the current time the audio should play at. this is useful in many ways, for example since play() does not take a parameter we need to set the point to play from s...
disabled - HTML: Hypertext Markup Language
the boolean disabled attribute, when present, makes the element not mutable, focusable, or even submitted with the form. the user can neither edit nor focus on the control, nor it's form control descendants. if the disabled attribute is
specified on a form control, the element and its form control descendants do not participate in constraint validation. often browsers grey out such controls and it won't receive any browsing events, like mouse clicks or focus-related ones. ...
...n browsers grey out such controls and it won't receive any browsing events, like mouse clicks or focus-related ones. the disabled attribute is supported by <button>, <command>, <fieldset>, <keygen>, <optgroup>, <option>, <select>, <textarea> and <input>. this boolean disabled attribute indicates that the user cannot interact with the control or it's descendant controls. if this attribute is not
specified, the control inherits its setting from the containing element, for example fieldset; if there is no containing element with the disabled attribute set, and the control itself does not have the attribute, then the control is enabled. if declared on an <optgroup>, the select is still interactive (unless otherwise disabled), but none of the items in the option group are selectable. note: if a <fie...
...he difference between disabled and readonly is that read-only controls can still function and are still focusable, whereas disabled controls can not receive focus and are not submitted with the form and generally do not function as controls until they are enabled. because a disabled field cannot have it's value changed, required does not have any effect on inputs with the disabled attribute also
specified. additionally, since the elements become immutable, most other attributes, such as pattern, have no effect, until the control is enabled. note: the required attribute is not permitted on inputs with the disabled attribute
specified. usability browsers display disabled form controls greyed as disabled form controls are immutable, won't receive focus or any browsing events, like mouse clicks o...
HTML attribute: min - HTML: Hypertext Markup Language
the min attribute defines the minimum value that is acceptable and valid for the input containing the attribute. if the value of the element is less than this, the element fails constraint validation. this value must be less than or equal to the value of the max attribute. if a value is
specified for min that isn't a valid number, the input has no minimum value. valid for the numeric input types, including the date, month, week, time, datetime-local, number and range types, and the <meter> element, the min attribute is a number that specifies the most negative value a form control to be considered valid. syntax if any is not explicity set, valid values for the number, date/time input types, and range input types are equal to the basis for stepping - the min value and increments of the ...
...me, datetime-local, number and range types, and the <meter> element, the min attribute is a number that specifies the most negative value a form control to be considered valid. syntax if any is not explicity set, valid values for the number, date/time input types, and range input types are equal to the basis for stepping - the min value and increments of the step value, up to the max value, if
specified. for example, if we have <input type="number" min="10" step="2"> any even integer, 10 or great, is valid. if omitted, <input type="number">, any integer is valid, but floats, like 4.2, are not valid, as step defaults to 1. for 4.2 to be valid, step would have had to be set to any, 0.1, 0.2, or any the min value would have had to be a number ending in .2, such as <input type="number" min="-5.2"> ...
... when the data entered by the user doesn't adhere to the min value set, the value is considered invalid in contraint validation and will match the :invalid pseudoclass see client-side validation and rangeunderflow for more information. for the <meter> element, the min attribute defines the lower numeric bound of the measured range. this must be less than the minimum value (max attribute), if
specified. in both cases, if omitted, the value defaults to 1. syntax for min values for other elements input type syntax example <meter> <number> <meter id="fuel" min="0" max="100" low="33" high="66" optimum="80" value="40"> at 40/100</meter> impact on step the value of min and step define what are valid values, even if the step attribute is not included, as ste...
HTML attribute: multiple - HTML: Hypertext Markup Language
input displays the same, but will match the :invalid pseudo-class if more than one comma-separated email address is included if the attribute is not present. when multiple is set on the email input type, the user can inlclude zero (if not also required), one or more comma-separated email addresses. <input type="email" multiple name="emails" id="emails"> if and only if the multiple attribute is
specified, the value can be a list of properly-formed comma-separated e-mail addresses. any trailing and leading whitespace is removed from each address in the list. when multiple is set on the file input type, the user can select one or more files. the user can choose multiple files from the file picker in any way that their chosen platform allows (e.g. by holding down shift or control, and then clicking...
...ore options from the list of options. otherwise, the <select> element represents a control for selecting a single <option> from the list of options. <select multiple name="drawfs" id="drawfs"> <option>grumpy</option> <option>happy</option> <option>sleepy</option> <option>bashful</option> <option>sneezy</option> <option>dopey</option> <option>doc</option> </select> when multiple is
specified, most browsers will show a scrolling list box instead of a single line dropdown. examples email input <label for="emails">who do you want to email?</label> <input type="email" multiple name="emails" id="emails" list="drawfemails" required size="64"> <datalist id="drawfemails"> <option value="grumpy@woodworkers.com">grumpy</option> <option value="happy@woodworkers.com">happy</option> <op...
...any trailing and leading whitespace is removed from each address in the list. if the required attribute is present, at least one email address is required. some browsers support the appearance of the list of options from the associated <datalist> for subsequent email addresses when multiple is present. others do not. ...
<input type="datetime-local"> - HTML: Hypertext Markup Language
r controls or performing validation max the latest date and time to accept. if the value entered into the element is later than this timestamp, the element fails constraint validation. if the value of the max attribute isn't a valid string which follows the format yyyy-mm-ddthh:mm, then the element has no maximum value. this value must specify a date string later than or equal to the one
specified by the min attribute. min the earliest date and time to accept; timestamps earlier than this will cause the element to fail constraint validation. if the value of the min attribute isn't a valid string which follows the format yyyy-mm-ddthh:mm, then the element has no minimum value. this value must specify a date string earlier than or equal to the one
specified by the max attribute. step th...
... a string value of any means that no stepping is implied, and any value is allowed (barring other constraints, such as min and max). ...
... <input id="party" type="datetime-local" name="partydate" min="2017-06-01t08:30" max="2017-06-30t16:30"> </form> the result here is that: only days in june 2017 can be selected — only the "days" part of the date value will be editable, and dates outside june can't be scrolled to in the datepicker widget. depending on what browser you are using, you might find that times outside the
specified values might not be selectable in the time picker (e.g. edge), or invalid (see validation) but still available (e.g. chrome). note: you should be able to use the step attribute to vary the number of days jumped each time the date is incremented (e.g. maybe you only want to make saturdays selectable). however, this does not seem to work effectively in any implementation at the time of writing. ...
<input type="number"> - HTML: Hypertext Markup Language
e entered into the element exceeds this, the element fails constraint validation. if the value of the max attribute isn't a number, then the element has no maximum value. this value must be greater than or equal to the value of the min attribute. min the minimum value to accept for this input. if the value of the element is less than this, the element fails constraint validation. if a value is
specified for min that isn't a valid number, the input has no minimum value. this value must be less than or equal to the value of the max attribute. placeholder the placeholder attribute is a string that provides a brief hint to the user as to what kind of information is expected in the field. it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory me...
...>: the input (form input) element for more information. readonly a boolean attribute which, if present, means this field cannot be edited by the user. its value can, however, still be changed by javascript code directly setting the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effect on inputs with the readonly attribute also
specified. step the step attribute is a number that specifies the granularity that the value must adhere to, or the special value any, which is described below. only values which are equal to the basis for stepping (min if
specified, value otherwise, and an appropriate default value if neither of those is provided) are valid. a string value of any means that no stepping is implied, and any value is al...
...922"> </datalist> use of the list attribute with number inputs is not supported in all browsers. it works in chrome and opera, for example, but not in firefox. validation we have already mentioned a number of validation features of number inputs, but let's review them now: <input type="number"> elements automatically invalidate any entry that isn't a number (or empty, unless required is
specified). you can use the required attribute to make an empty entry invalid. (in other words, the input must be filled in.) you can use the step attribute to constrain valid values to a certain set of steps (e.g., multiples of 10). you can use the min and max attributes to constrain valid values to lower and upper bounds. the following example exhibits all of the above features, as well as using som...
<input type="range"> - HTML: Hypertext Markup Language
input is suffering from a bad input. the value won't be less than min. the default is 0. the value won't be greater than max. the default is 100. the value will be a multiple of step. the default is 1. value the value attribute contains a domstring which contains a string representation of the selected number. the value is never an empty string (""). the default value is halfway between the
specified minimum and maximum—unless the maximum is actually less than the minimum, in which case the default is set to the value of the min attribute. the algorithm for determining the default value is: defaultvalue = (rangeelem.max < rangeelem.min) ? rangeelem.min : rangeelem.min + (rangeelem.max - rangeelem.min)/2; if an attempt is made to set the value lower than the minimum, it is s...
...this, the element fails constraint validation. if the value of the max attribute isn't a number, then the element has no maximum value. this value must be greater than or equal to the value of the min attribute. see the html max attribute. min the lowest value in the range of permitted values. if the value of the element is less than this, the element fails constraint validation. ...
... a string value of any means that no stepping is implied, and any value is allowed (barring other constraints, such as min and max). ...
<input type="time"> - HTML: Hypertext Markup Language
d in the same document. the <datalist> provides a list of predefined values to suggest to the user for this input. any values in the list that are not compatible with the type are not included in the suggested options. the values provided are suggestions, not requirements: users can select from this predefined list or provide a different value. max a string indicating the latest time to accept,
specified in the same time value format as described above. if the
specified string isn't a valid time, no maximum value is set. min a string specifying the earliest time to accept, given in the time value format described previously. if the value
specified isn't a valid time string, no minimum value is set. readonly a boolean attribute which, if present, means this field cannot be edited by the user. ...
...fied isn't a valid time string, no minimum value is set. readonly a boolean attribute which, if present, means this field cannot be edited by the user. its value can, however, still be changed by javascript code directly setting the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effect on inputs with the readonly attribute also
specified. step the step attribute is a number that specifies the granularity that the value must adhere to, or the special value any, which is described below. only values which are equal to the basis for stepping (min if
specified, value otherwise, and an appropriate default value if neither of those is provided) are valid. a string value of any means that no stepping is implied, and any value is all...
... input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } the result here is that: only times between 12:00 and 18:00 will be seen as valid; times outside that range will be denoted as invalid. depending on what browser you're using, you might find that times outside the
specified range might not even be selectable in the time picker (e.g. edge). making min and max cross midnight by setting a min attribute greater than the max attribute, the valid time range will wrap around midnight to produce a valid time range which crosses midnight. this functionality is not supported by any other input types. while this feature is in the html spec, it is not yet universally support...
<keygen> - HTML: Hypertext Markup Language
butes. autofocus this boolean attribute lets you specify that the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control. only one form element in a document can have the autofocus attribute, which is a boolean. challenge a challenge string that is submitted along with the public key. defaults to an empty string if not
specified. disabled this boolean attribute indicates that the form control is not available for interaction. form the form element that this element is associated with (its form owner). the value of the attribute must be an id of a <form> element in the same document. if this attribute is not
specified, this element must be a descendant of a <form> element. this attribute enables you to place <keygen> ...
...eter is not used (ignored if present). the user may be given a choice of rsa key strengths. currently, the user is given a choice between "high" strength (2048 bits) and "medium" strength (1024 bits). for dsa keys, the keyparams parameter specifies the dsa pqg parameters which are to be used in the keygen process. the value of the pqg parameter is the the base64 encoded, der encoded dss-parms as
specified in ietf rfc 3279. the user may be given a choice of dsa key sizes, allowing the user to choose one of the sizes defined in the dsa standard. for ec keys, the keyparams parameter specifies the name of the elliptic curve on which the key will be generated. it is normally a string from the table in nskeygenhandler.cpp. (note that only a subset of the curves named there may actually be supported in ...
...urealgorithm algorithmidentifier, signature bit string } the public key and challenge string are der encoded as publickeyandchallenge, and then digitally signed with the private key to produce a signedpublickeyandchallenge. the signedpublickeyandchallenge is base64 encoded, and the ascii data is finally submitted to the server as the value of a form name/value pair, where the name is name as
specified by the name attribute of the keygen element. if no challenge string is provided, then it will be encoded as an ia5string of length zero. here is an example form submission as it would be delivered to a cgi program by the http server: commonname=john+doe&email=doe@foo.com&org=foobar+computing+corp.& orgunit=bureau+of+bureaucracy&locality=anytown&state=california&country=us& key=mihfmhew...
<link>: The External Resource Link element - HTML: Hypertext Markup Language
uest (i.e. without sending the origin http header), preventing its non-tainted usage. if invalid, it is handled as if the enumerated keyword anonymous was used. see cors settings attributes for additional information. disabled for rel="stylesheet" only, the disabled boolean attribute indicates whether or not the described stylesheet should be loaded and applied to the document. if disabled is
specified in the html when it is loaded, the stylesheet will not be loaded during page load. instead, the stylesheet will be loaded on-demand, if and when the disabled attribute is changed to false or removed. setting the disabled property in the dom causes the stylesheet to be removed from the document's document.stylesheets list. href this attribute specifies the url of the linked resource. a url c...
...restricted set of media queries defined in html 4. referrerpolicy a string indicating which referrer to use when fetching the resource: no-referrer means that the referer header will not be sent. no-referrer-when-downgrade means that no referer header will be sent when navigating to an origin without tls (https). this is a user agent’s default behavior, if no policy is otherwise
specified. origin means that the referrer will be the origin of the page, which is roughly the scheme, the host, and the port. origin-when-cross-origin means that navigating to other origins will be limited to the scheme, the host, and the port, while navigating on the same origin will include the referrer's path. unsafe-url means that the referrer will include the origin and the path (but not the fr...
... value of this attribute provides information about the functions that might be performed on an object. the values generally are given by the http protocol when it is used, but it might (for similar reasons as for the title attribute) be useful to include advisory information in advance in the link. for example, the browser might choose a different rendering of a link as a function of the methods
specified; something that is searchable might get a different icon, or an outside link might render with an indication of leaving the current site. this attribute is not well understood nor supported, even by the defining browser, internet explorer 4. prefetch secure context this attribute identifies a resource that might be required by the next navigation and that the user agent should retrieve it. th...
<select>: The HTML Select element - HTML: Hypertext Markup Language
ml autocomplete attribute for a complete list of values and details on how to use autocomplete. autofocus this boolean attribute lets you specify that a form control should have input focus when the page loads. only one form element in a document can have the autofocus attribute. disabled this boolean attribute indicates that the user cannot interact with the control. if this attribute is not
specified, the control inherits its setting from the containing element, for example <fieldset>; if there is no containing element with the disabled attribute set, then the control is enabled. form the <form> element to associate the <select> with (its form owner). the value of this attribute must be the id of a <form> in the same document. (if this attribute is not set, the <select> is associated with i...
...rm> in the same document. (if this attribute is not set, the <select> is associated with its ancestor <form> element, if any.) this attribute lets you associate <select> elements to <form>s anywhere in the document, not just inside a <form>. it can also override an ancestor <form> element. multiple this boolean attribute indicates that multiple options can be selected in the list. if it is not
specified, then only one option can be selected at a time. when multiple is
specified, most browsers will show a scrolling list box instead of a single line dropdown. name this attribute is used to specify the name of the control. required a boolean attribute indicating that an option with a non-empty string value must be selected. size if the control is presented as a scrolling list box (e.g. when...
...browsers are not required to present a select element as a scrolled list box. the default value is 0. ...
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
be only one string containing the same tuple of width descriptor and pixel density descriptor. the browser chooses the most adequate image to display at a given point of time. the srcset attribute has an effect only when the <source> element is the direct child of a <picture> element. type the mime media type of the resource, optionally with a codecs parameter. if the type attribute isn't
specified, the media's type is retrieved from the server and checked to see if the user agent can handle it; if it can't be rendered, the next <source> is checked. if the type attribute is
specified, it's compared against the types the user agent can present, and if it's not recognized, the server doesn't even get queried; instead, the next <source> element is checked at once. when used in the context of ...
... usage notes the <source> element is an empty element (or void element), which means that it not only has no content but also has no closing tag. ...
... media types formats used on the web. examples video example this example demonstrates how to offer a video in ogg format for users whose browsers support ogg format, and a quicktime format video for users whose browsers support that. if the audio or video element is not supported by the browser, a notice is displayed instead. if the browser supports the element but does not support any of the
specified formats, an error event is raised and the default media controls (if enabled) will indicate an error. be sure to reference our guide to media types and formats on the web for details on what media file formats you can use and how well they're supported by browsers. <video controls> <source src="foo.webm" type="video/webm"> <source src="foo.ogg" type="video/ogg"> <source src="foo.mov" type=...
<th> - HTML: Hypertext Markup Language
der relates to all cells of the column it belongs to. rowgroup: the header belongs to a rowgroup and relates to all of its cells. these cells can be placed to the right or the left of the header, depending on the value of the dir attribute in the <table> element. colgroup: the header belongs to a colgroup and relates to all of its cells. auto the default value when this attribute is not
specified is auto. deprecated attributes align obsolete since html5 this enumerated attribute specifies how the cell content's horizontal alignment will be handled. possible values are: left: the content is aligned to the left of the cell. center: the content is centered in the cell. right: the content is aligned to the right of the cell. justify (with text only): the content is stretched...
... in the cell. right: the content is aligned to the right of the cell. justify (with text only): the content is stretched out inside the cell so that it covers its entire width. char (with text only): the content is aligned to a character inside the <th> element with minimal offset. this character is defined by the char and charoff attributes. the default value when this attribute is not
specified is left. note: do not use this attribute as it is obsolete in the latest standard. to achieve the same effect as the left, center, right or justify values, apply the css text-align property to the element. to achieve the same effect as the char value, give the text-align property the same value you would use for the char. unimplemented in css3. axis obsolete since html5 this attr...
...align numbers or monetary values. if align is not set to char, this attribute is ignored. note: do not use this attribute as it is obsolete in the latest standard. to achieve the same effect, you can specify the character as the first value of the text-align property, unimplemented in css3. charoff obsolete since html5 this attribute is used to shift column data to the right of the character
specified by the char attribute. its value specifies the length of this shift. note: do not use this attribute as it is obsolete in the latest standard. height deprecated since html4, obsolete since html5 this attribute is used to define a recommended cell height. note: do not use this attribute as it is obsolete in the latest standard: use the css height property instead. valign obsolete since ht...
<tr>: The Table Row element - HTML: Hypertext Markup Language
e is not only obsolete, but was rarely implemented anyway. to achieve the same effect as the char attribute, set the css text-align property to the same string you would specify for the char property, such as text-align: ".". charoffobsolete since html5 a domstring indicating the number of characters on the tail end of the column's data should be displayed after the alignment character
specified by the char attribute. for example, when displaying money values for currencies that use hundredths of a unit (such as the dollar, which is divided into 100 cents), you would typically specify a value of 2, so that in tandem with char being set to ".", the values in a column would be cleanly aligned on the decimal points, with the number of cents properly displayed to the right of the decimal poi...
...that way, both header and data cells are easily demarcated. table { border: 1px solid black; } th, td { border: 1px solid black; } result row and column spanning now, let's introduce another column that shows the date the user's membership ended, along with a super-heading above the "joined" and "canceled" dates called "membership dates". this involves adding ...
... } and here are the default styles for all table cells. now let's customize! the top header: overall we're going to look at the top header in two pieces. first, the overall styling of the header: thead > tr { background-color: rgb(228, 240, 245); } thead > tr:nth-of-type(2) { border-bottom: 2px solid black; } this sets the background color of all <tr> elements in the table's heading (as
specified using <thead>). then we set the bottom border of the top header to be a two-pixel wide line. notice, however, that we're using the :nth-of-type selector to apply border-bottom to the second row in the heading. why? because the heading is made of two rows that are spanned by some of the cells. that means there are actually two rows there; applying the style to the first row would not give us the e...
HTML elements reference - HTML: Hypertext Markup Language
t provides the description, definition, 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) 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 definition list, and as such must be used inside a <dl> element. <figcaption> the html <figcaption> or figure caption element re...
...efinition 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
specified using the (<figcaption>) element. <hr> the html <hr> element represents a thematic break between paragraph-level elements: for example, a change of scene in a story, or a shift of topic within a section. <li> the html <li> element is used to represent an item in a list. <main> the html <main> element represents the dominant content of the <body> of a docu...
...nt. you can use <video> for audio content as well, but the <audio> element may provide a more appropriate user experience. embedded content in addition to regular multimedia content, html can include a variety of other content, even if it's not always easy to interact with. element description <embed> the html <embed> element embeds external content at the
specified point in the document. this content is provided by an external application or other source of interactive content such as a browser plug-in. <iframe> the html inline frame element (<iframe>) represents a nested browsing context, embedding another html page into the current one. <object> the html <object> element represents an external resource, which can be treated as ...
itemid - HTML: Hypertext Markup Language
the vocabulary defines whether several items with the same global identifier can coexist and, if so, how items with the same identifier are handled. ...
...the vocabulary defines whether several items with the same global identifier can coexist and, if so, how items with the same identifier are handled. ...
...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 definition specifies that an itemid must be a url. however, the following example correctly illustrates that a urn may also be used. ...
Content Security Policy (CSP) - HTTP
ngle origin onlinebanking.jumbobank.com. example 5 a web site administrator of a web mail site wants to allow html in email, as well as images loaded from anywhere, but not javascript or other potentially dangerous content. content-security-policy: default-src 'self' *.mailsite.com; img-src * note that this example doesn't specify a script-src; with the example csp, this site uses the setting
specified by the default-src directive, which means that scripts can be loaded only from the originating server. testing your policy to ease deployment, csp can be deployed in report-only mode. the policy is not enforced, but any violations are reported to a provided uri. additionally, a report-only header can be used to test a future revision to a policy without actually deploying it. you can use the c...
...ly header can be used to test a future revision to a policy without actually deploying it. you can use the content-security-policy-report-only http header to specify your policy, like this: content-security-policy-report-only: policy if both a content-security-policy-report-only header and a content-security-policy header are present in the same response, both policies are honored. the policy
specified in content-security-policy headers is enforced while the content-security-policy-report-only policy generates reports but is not enforced. enabling reporting by default, violation reports aren't sent. to enable violation reporting, you need to specify the report-uri policy directive, providing at least one uri to which to deliver the reports: content-security-policy: default-src 'self'; report...
...cated to contain just the scheme, host, and port. disposition either "enforce" or "report" depending on whether the content-security-policy-report-only header or the content-security-policy header is used. document-uri the uri of the document in which the violation occurred. effective-directive the directive whose enforcement caused the violation. original-policy the original policy as
specified by the content-security-policy http header. referrer the referrer of the document in which the violation occurred. script-sample the first 40 characters of the inline script, event handler, or style that caused the violation. status-code the http status code of the resource on which the global object was instantiated. violated-directive the name of the policy section that was violated. ...
Using HTTP cookies - HTTP
), you can enable the storage inspector in developer tools and select cookies from the storage tree. creating cookies after receiving an http request, a server can send one or more set-cookie headers with the response. the cookie is usually stored by the browser, and then the cookie is sent with requests made to the same server inside a cookie http header. an expiration date or duration can be
specified, after which the cookie is no longer sent. additional restrictions to a specific domain and path can be set, limiting where the cookie is sent. for details about the header attributes mentioned below, refer to the set-cookie reference article. the set-cookie and cookie headers the set-cookie http response header sends cookies from the server to the user agent. a simple cookie is set like this: ...
... 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 indefinitely 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 regenerate and resend session cookies, even ones that alrea...
...precaution helps mitigate cross-site scripting (xss) attacks. here is an example: set-cookie: id=a3fwa; expires=wed, 21 oct 2021 07:28:00 gmt; secure; httponly define where cookies are sent the domain and path attributes define the scope of the cookie: what urls the cookies should be sent to. domain attribute the domain attribute specifies which hosts are allowed to receive the cookie. if un
specified, it defaults to the same origin that set the cookie, excluding subdomains. if domain is
specified, then subdomains are always included. therefore, specifying domain is less restrictive than omitting it. however, it can be helpful when subdomains need to share information about a user. for example, if domain=mozilla.org is set, then cookies are available on subdomains like developer.mozilla.org. ...
Index - HTTP
r links away from a page. this api is deprecated and removed from browsers. 44 csp: report-uri csp, directive, http, reference, security the deprecated http content-security-policy (csp) report-uri directive instructs the user agent to report attempts to violate the content security policy. these violation reports consist of json documents sent via an http post request to the
specified uri. 45 csp: require-sri-for csp, directive, http, reference, security the http content-security-policy require-sri-for directive instructs the client to require the use of subresource integrity for scripts or styles on the page. 46 csp: sandbox csp, directive, http, security the http content-security-policy (csp) sandbox directive enables a sandbox for t...
...nt to store reporting endpoints for an origin. 52 content-security-policy-report-only csp, http, https, reference, security, header the http content-security-policy-report-only response header allows web developers to experiment with policies by monitoring (but not enforcing) their effects. these violation reports consist of json documents sent via an http post request to the
specified uri. 53 content-type content-type, http, reference, request header, header the content-type entity header is used to indicate the media type of the resource. 54 cookie cookies, http, reference, header, request the cookie http request header contains stored http cookies previously sent by the server with the set-cookie header. 55 cookie2 htt...
...rease the risk of mitm attacks with forged certificates. if one or several keys are pinned and none of them are used by the server, the browser will not accept the response as legitimate, and will not display it. 92 public-key-pins-report-only hpkp, http, security, header the http public-key-pins-report-only response header sends reports of pinning violation to the report-uri
specified in the header but, unlike public-key-pins still allows browsers to connect to the server if the pinning is violated. 93 range http, http header, range requests, reference, request header the range http request header indicates the part of a document that the server should return. several parts can be requested with one range header at once, and the server may send back these ...
A re-introduction to JavaScript (JS tutorial) - JavaScript
however the "+" operator simply converts the string to nan if there is an invalid character contained within it. just try parsing the string "10.2abc" with each method by yourself in the console and you'll understand the differences better. strings strings in javascript are sequences of unicode characters. this should be welcome new...
... fullname: function() { return this.first + ' ' + this.last; }, fullnamereversed: function() { return this.last + ', ' + this.first; } }; } var s = makeperson('simon', 'willison'); s.fullname(); // "simon willison" s.fullnamereversed(); // "willison, simon" note on the this keyword. used inside a function, this refers to the current object. what that actually means is
specified by the way in which you called that function. if you called it using dot notation or bracket notation on an object, that object becomes this. if dot notation wasn't used for the call, this refers to the global object. note that this is a frequent cause of mistakes. for example: var s = makeperson('simon', 'willison'); var fullname = s.fullname; fullname(); // undefined undefined when we call ...
...t, last) { this.first = first; this.last = last; this.fullname = function() { return this.first + ' ' + this.last; }; this.fullnamereversed = function() { return this.last + ', ' + this.first; }; } var s = new person('simon', 'willison'); we have introduced another keyword: new. new is strongly related to this. it creates a brand new empty object, and then calls the function
specified, with this set to that new object. notice though that the function
specified with this does not return a value but merely modifies the this object. it's new that returns the this object to the calling site. functions that are designed to be called by new are called constructor functions. common practice is to capitalize these functions as a reminder to call them with new. the improved function s...
Details of the object model - JavaScript
''; jane.dept == 'engineering'; jane.projects == []; jane.machine == 'belau'; notice that with these definitions, you cannot specify an initial value for an inherited property such as name. if you want to specify an initial value for inherited properties in javascript, you need to add more code to the constructor function. so far, the constructor function has created a generic object and then
specified local properties and values for the new object. you can have the constructor add more properties by directly calling the constructor function for an object higher in the prototype chain. the following figure shows these new definitions. specifying properties in a constructor, take 2 let's look at one of these definitions in detail. here's the new definition for the engineer constructor: func...
...ne property to "belau". upon return from the constructor, javascript assigns the new object to the jane variable. you might think that, having called the workerbee constructor from inside the engineer constructor, you have set up inheritance appropriately for engineer objects. this is not the case. calling the workerbee constructor ensures that an engineer object starts out with the properties
specified in all constructor functions that are called. however, if you later add properties to the employee or workerbee prototypes, those properties are not inherited by the engineer object. for example, assume you have the following statements: function engineer(name, projs, mach) { this.base = workerbee; this.base(name, 'engineering', projs); this.machine = mach || ''; } var jane = new engineer(...
... apparent in the earlier discussions. local versus inherited values when you access an object property, javascript performs these steps, as described earlier in this chapter: check to see if the value exists locally. if it does, return that value. if there is not a local value, check the prototype chain (using the __proto__ property). if an object in the prototype chain has a value for the
specified property, return that value. if no such property is found, the object does not have the property. the outcome of these steps depends on how you define things along the way. the original example had these definitions: function employee() { this.name = ''; this.dept = 'general'; } function workerbee() { this.projects = []; } workerbee.prototype = new employee; with these definitions, s...
Text formatting - JavaScript
odepoint() or string.prototype.codepointat(). a string object has a variety of methods: for example those that return a variation on the string itself, such as substring and touppercase. the following table summarizes the methods of string objects. methods of string method description charat, charcodeat, codepointat return the character or character code at the
specified position in string. indexof, lastindexof return the position of
specified substring in the string or last position of
specified substring, respectively. startswith, endswith, includes returns whether or not the string starts, ends or contains a
specified string. concat combines the text of two strings and returns a new string. fromcharcode, fromcodepoi...
...of, lastindexof return the position of
specified substring in the string or last position of
specified substring, respectively. startswith, endswith, includes returns whether or not the string starts, ends or contains a
specified string. concat combines the text of two strings and returns a new string. fromcharcode, fromcodepoint constructs a string from the
specified sequence of unicode values. this is a method of the string class, not a string instance. split splits a string object into an array of strings by separating the string into substrings. slice extracts a section of a string and returns a new string. ...
... match, matchall, replace, replaceall, search work with regular expressions. tolowercase, touppercase return the string in all lowercase or all uppercase, respectively. ...
BigInt.prototype.toString() - JavaScript
exceptions rangeerror if tostring() is given a radix less than 2 or greater than 36, a rangeerror is thrown. ...
...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 bigintobj.tostring([radix]) parameters radixoptional optional. an integer in the range 2 through 36 specifying the base to use for representing numeric values. return value a string representing the
specified bigint object. exceptions rangeerror if tostring() is given a radix less than 2 or greater than 36, a rangeerror is thrown. description the bigint object overrides the tostring() method of the object object; it does not inherit object.prototype.tostring(). for bigint objects, the tostring() method returns a string representation of the object in the
specified radix. the tostring() method...
...n 2 or greater than 36, a rangeerror is thrown. description the bigint object overrides the tostring() method of the object object; it does not inherit object.prototype.tostring(). for bigint objects, the tostring() method returns a string representation of the object in the
specified radix. the tostring() method parses its first argument, and attempts to return a string representation in the
specified radix (base). for radixes above 10, the letters of the alphabet indicate numerals greater than 9. for example, for hexadecimal numbers (base 16) a through f are used. if the radix is not
specified, the preferred radix is assumed to be 10. if the bigintobj is negative, the sign is preserved. this is the case even if the radix is 2; the string returned is the positive binary representation of the...
BigInt64Array - JavaScript
64array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). bigint64array.prototype.includes() determines whether a typed array includes a certain element, returning true or false as appropriate. see also array.prototype.includes(). bigint64array.prototype.indexof() returns the first (least) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.indexof(). bigint64array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). bigint64array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). bigint64array.prototype.lastindexof() returns the last (greatest) index...
...y.prototype.indexof(). bigint64array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). bigint64array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). bigint64array.prototype.lastindexof() returns the last (greatest) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.lastindexof(). bigint64array.prototype.map() creates a new array with the results of calling a provided function on every element in this array. see also array.prototype.map(). bigint64array.prototype.reduce() applies a function against an accumulator and each value of the array (from left-to-right) so as to reduce it to a single value. ...
...e of the array (from right-to-left) so as to reduce it to a single value. see also array.prototype.reduceright(). bigint64array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first. see also array.prototype.reverse(). bigint64array.prototype.set() stores multiple values in the typed array, reading input values from a
specified array. bigint64array.prototype.slice() extracts a section of an array and returns a new array. see also array.prototype.slice(). bigint64array.prototype.some() returns true if at least one element in this array satisfies the provided testing function. see also array.prototype.some(). bigint64array.prototype.sort() sorts the elements of an array in place and returns the array. see also array...
BigUint64Array - JavaScript
array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). biguint64array.prototype.includes() determines whether a typed array includes a certain element, returning true or false as appropriate. see also array.prototype.includes(). biguint64array.prototype.indexof() returns the first (least) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.indexof(). biguint64array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). biguint64array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). biguint64array.prototype.lastindexof() returns the last (greatest) in...
...rototype.indexof(). biguint64array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). biguint64array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). biguint64array.prototype.lastindexof() returns the last (greatest) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.lastindexof(). biguint64array.prototype.map() creates a new array with the results of calling a provided function on every element in this array. see also array.prototype.map(). biguint64array.prototype.reduce() apply a function against an accumulator and each value of the array (from left-to-right) so as to reduce it to a single value. ...
...of the array (from right-to-left) so as to reduce it to a single value. see also array.prototype.reduceright(). biguint64array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first. see also array.prototype.reverse(). biguint64array.prototype.set() stores multiple values in the typed array, reading input values from a
specified array. biguint64array.prototype.slice() extracts a section of an array and returns a new array. see also array.prototype.slice(). biguint64array.prototype.some() returns true if at least one element in this array satisfies the provided testing function. see also array.prototype.some(). biguint64array.prototype.sort() sorts the elements of an array in place and returns the array. see also ar...
Date.prototype.toString() - JavaScript
"sat" space month name: 3 letter english month name, e.g. ...
...ntribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.tostring() return value a string representing the given date. description date instances inherit their tostring() method from date.prototype, not object.prototype. date.prototype.tostring() returns a string representation of the date in the format
specified in ecma-262 which can be summarised as: week day: 3 letter english week day name, e.g. "sat" space month name: 3 letter english month name, e.g. "sep" space date: 2 digit day in month, e.g. "01" space year: 4 digit year, e.g. "2018" space hour: 2 digit hour of day, e.g. "14" colon minute: 2 digit minute of hour, e.g. "53" colon second: 2 digit second of minute, e.g. "26" space th...
...h might be an abbreviation or full name (there is no standard for names or abbreviations of timezones), e.g. "line islands time" or "lint" right bracket, i.e. ")" e.g. "sat sep 01 2018 14:53:26 gmt+1400 (lint)" until ecmascript 2018 (edition 9), the format of the string returned by date.prototype.tostring was implementation dependent. therefore it should not be relied upon to be in the
specified format. the tostring() method is automatically called when a date is to be represented as a text value, e.g. console.log(new date()), or when a date is used in a string concatenation, such as var today = 'today is ' + new date(). tostring() is a generic method, it does not require that its this is a date instance. however, it must have an internal [[timevalue]] property that can't be constructe...
Float32Array - JavaScript
at32array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). float32array.prototype.includes() determines whether a typed array includes a certain element, returning true or false as appropriate. see also array.prototype.includes(). float32array.prototype.indexof() returns the first (least) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.indexof(). float32array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). float32array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). float32array.prototype.lastindexof() returns the last (greatest) index of...
...rray.prototype.indexof(). float32array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). float32array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). float32array.prototype.lastindexof() returns the last (greatest) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.lastindexof(). float32array.prototype.map() creates a new array with the results of calling a provided function on every element in this array. see also array.prototype.map(). float32array.prototype.reduce() apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value. see als...
... value of the array (from right-to-left) as to reduce it to a single value. see also array.prototype.reduceright(). float32array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first. see also array.prototype.reverse(). float32array.prototype.set() stores multiple values in the typed array, reading input values from a
specified array. float32array.prototype.slice() extracts a section of an array and returns a new array. see also array.prototype.slice(). float32array.prototype.some() returns true if at least one element in this array satisfies the provided testing function. see also array.prototype.some(). float32array.prototype.sort() sorts the elements of an array in place and returns the array. see also array.pr...
Float64Array - JavaScript
at64array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). float64array.prototype.includes() determines whether a typed array includes a certain element, returning true or false as appropriate. see also array.prototype.includes(). float64array.prototype.indexof() returns the first (least) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.indexof(). float64array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). float64array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). float64array.prototype.lastindexof() returns the last (greatest) index of...
...rray.prototype.indexof(). float64array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). float64array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). float64array.prototype.lastindexof() returns the last (greatest) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.lastindexof(). float64array.prototype.map() creates a new array with the results of calling a provided function on every element in this array. see also array.prototype.map(). float64array.prototype.reduce() apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value. see als...
... value of the array (from right-to-left) as to reduce it to a single value. see also array.prototype.reduceright(). float64array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first. see also array.prototype.reverse(). float64array.prototype.set() stores multiple values in the typed array, reading input values from a
specified array. float64array.prototype.slice() extracts a section of an array and returns a new array. see also array.prototype.slice(). float64array.prototype.some() returns true if at least one element in this array satisfies the provided testing function. see also array.prototype.some(). float64array.prototype.sort() sorts the elements of an array in place and returns the array. see also array.pr...
Function.prototype.apply() - JavaScript
equired. argsarray optional an array-like object, specifying the arguments with which func should be called, or null or undefined if no arguments should be provided to the function. starting with ecmascript 5 these arguments can be a generic array-like object instead of an array. see below for browser compatibility information. return value the result of calling the function with the
specified this value and arguments. description note: while the syntax of this function is almost identical to that of call(), the fundamental difference is that call() accepts an argument list, while apply() accepts a single array of arguments. note: when the first argument is undefined or null a similar outcome can be achieved using the array spread syntax. you can assign a different this object ...
...arguments it supports. you use an arguments array instead of a list of arguments (parameters). with apply, you can also use an array literal, for example, func.apply(this, ['eat', 'bananas']), or an array object, for example, func.apply(this, new array('eat', 'bananas')). you can also use arguments for the argsarray parameter. arguments is a local variable of a function. it can be used for all un
specified arguments of the called object. thus, you do not have to know the arguments of the called object when you use the apply method. you can use arguments to pass all the arguments to the called object. the called object is then responsible for handling the arguments. since ecmascript 5th edition, you can also use any kind of object which is array-like. in practice, this means it's going to have a le...
...pply 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) varies across engines. (the javascriptcore engine has hard-coded argument limit of 65536. this is because the limit (and indeed, even the nature of any excessively-large-stack behavior) is un
specified. some engines will throw an exception. more perniciously, others will arbitrarily limit the number of arguments actually passed to the applied function. to illustrate this latter case: 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 ar...
Int16Array - JavaScript
. int16array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). int16array.prototype.includes() determines whether a typed array includes a certain element, returning true or false as appropriate. see also array.prototype.includes(). int16array.prototype.indexof() returns the first (least) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.indexof(). int16array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). int16array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). int16array.prototype.lastindexof() returns the last (greatest) index of an el...
...also array.prototype.indexof(). int16array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). int16array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). int16array.prototype.lastindexof() returns the last (greatest) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.lastindexof(). int16array.prototype.map() creates a new array with the results of calling a provided function on every element in this array. see also array.prototype.map(). int16array.prototype.reduce() apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value. see also ar...
...each value of the array (from right-to-left) as to reduce it to a single value. see also array.prototype.reduceright(). int16array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first. see also array.prototype.reverse(). int16array.prototype.set() stores multiple values in the typed array, reading input values from a
specified array. int16array.prototype.slice() extracts a section of an array and returns a new array. see also array.prototype.slice(). int16array.prototype.some() returns true if at least one element in this array satisfies the provided testing function. see also array.prototype.some(). int16array.prototype.sort() sorts the elements of an array in place and returns the array. see also array.prototyp...
Int32Array - JavaScript
. int32array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). int32array.prototype.includes() determines whether a typed array includes a certain element, returning true or false as appropriate. see also array.prototype.includes(). int32array.prototype.indexof() returns the first (least) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.indexof(). int32array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). int32array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). int32array.prototype.lastindexof() returns the last (greatest) index of an el...
...also array.prototype.indexof(). int32array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). int32array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). int32array.prototype.lastindexof() returns the last (greatest) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.lastindexof(). int32array.prototype.map() creates a new array with the results of calling a provided function on every element in this array. see also array.prototype.map(). int32array.prototype.reduce() apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value. see also ar...
...each value of the array (from right-to-left) as to reduce it to a single value. see also array.prototype.reduceright(). int32array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first. see also array.prototype.reverse(). int32array.prototype.set() stores multiple values in the typed array, reading input values from a
specified array. int32array.prototype.slice() extracts a section of an array and returns a new array. see also array.prototype.slice(). int32array.prototype.some() returns true if at least one element in this array satisfies the provided testing function. see also array.prototype.some(). int32array.prototype.sort() sorts the elements of an array in place and returns the array. see also array.prototyp...
Int8Array - JavaScript
x(). int8array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). int8array.prototype.includes() determines whether a typed array includes a certain element, returning true or false as appropriate. see also array.prototype.includes(). int8array.prototype.indexof() returns the first (least) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.indexof(). int8array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). int8array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). int8array.prototype.lastindexof() returns the last (greatest) index of an eleme...
...ee also array.prototype.indexof(). int8array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). int8array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). int8array.prototype.lastindexof() returns the last (greatest) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.lastindexof(). int8array.prototype.map() creates a new array with the results of calling a provided function on every element in this array. see also array.prototype.map(). int8array.prototype.reduce() apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value. see also arra...
...d each value of the array (from right-to-left) as to reduce it to a single value. see also array.prototype.reduceright(). int8array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first. see also array.prototype.reverse(). int8array.prototype.set() stores multiple values in the typed array, reading input values from a
specified array. int8array.prototype.slice() extracts a section of an array and returns a new array. see also array.prototype.slice(). int8array.prototype.some() returns true if at least one element in this array satisfies the provided testing function. see also array.prototype.some(). int8array.prototype.sort() sorts the elements of an array in place and returns the array. see also array.prototype.s...
Intl - JavaScript
locale identification and negotiation the internationalization constructors as well as several language sensitive methods of other constructors (listed under see also) use a common pattern for identifying locales and determining the one they will actually use: they all accept locales and options arguments, and negotiate the requested locale(s) against the locales they support using an algorithm
specified in the options.localematcher property. locales argument the locales argument requests that a particular locale (or a locale from a list of them) be considered for use in a given operation. a single locale may be
specified by either an intl.locale object or a string that is a unicode bcp 47 locale identifier. multiple locales may be
specified (and a best-supported locale determined by evaluati...
...er, 2017 is the hijri date 24 muharram, 1439. other bcp 47 extension tags can be found in the unicode cldr project. finally, an extension using the letter "x" may appear, followed by one or one- to eight-letter or digit tags. this extension allows applications to encode information for their own private use, that will be ignored by all intl operations. ...
...ignored by all intl operations. locale negotiation the list of locales
specified by the locales argument, after unicode extensions have been removed from them, is interpreted as a prioritized request from the application. the runtime compares it against the locales it has available and picks the best one available. two matching algorithms exist: the "lookup" matcher follows the lookup algorithm
specified in bcp 47; the "best fit" matcher lets the runtime provide a locale that's at least, but possibly more, suited for the request than the result of the lookup algorithm. if the application doesn't provide a locales argument, or the runtime doesn't have a locale that matches the request, then the runtime's default locale is used. the matcher can be selected using a property of the options argument (...
Number.prototype.toString() - JavaScript
exceptions rangeerror if tostring() is given a radix less than 2 or greater than 36, a rangeerror is thrown. description the number object overrides the tostring() method of the object object. ...
...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 numobj.tostring([radix]) parameters radix optional. an integer in the range 2 through 36 specifying the base to use for representing numeric values. return value a string representing the
specified number object. exceptions rangeerror if tostring() is given a radix less than 2 or greater than 36, a rangeerror is thrown. description the number object overrides the tostring() method of the object object. (it does not inherit object.prototype.tostring()). for number objects, the tostring() method returns a string representation of the object in the
specified radix. the tostring() meth...
...2 or greater than 36, a rangeerror is thrown. description the number object overrides the tostring() method of the object object. (it does not inherit object.prototype.tostring()). for number objects, the tostring() method returns a string representation of the object in the
specified radix. the tostring() method parses its first argument, and attempts to return a string representation in the
specified radix (base). for radices above 10, the letters of the alphabet indicate numerals greater than 9. for example, for hexadecimal numbers (base 16), a through f are used. if the radix is not
specified, the preferred radix is assumed to be 10. if the numobj is negative, the sign is preserved. this is the case even if the radix is 2; the string returned is the positive binary representation of the n...
Uint16Array - JavaScript
uint16array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). uint16array.prototype.includes() determines whether a typed array includes a certain element, returning true or false as appropriate. see also array.prototype.includes(). uint16array.prototype.indexof() returns the first (least) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.indexof(). uint16array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). uint16array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). uint16array.prototype.lastindexof() returns the last (greatest) index of an...
...o array.prototype.indexof(). uint16array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). uint16array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). uint16array.prototype.lastindexof() returns the last (greatest) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.lastindexof(). uint16array.prototype.map() creates a new array with the results of calling a provided function on every element in this array. see also array.prototype.map(). uint16array.prototype.reduce() apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value. see also ...
...ch value of the array (from right-to-left) as to reduce it to a single value. see also array.prototype.reduceright(). uint16array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first. see also array.prototype.reverse(). uint16array.prototype.set() stores multiple values in the typed array, reading input values from a
specified array. uint16array.prototype.slice() extracts a section of an array and returns a new array. see also array.prototype.slice(). uint16array.prototype.some() returns true if at least one element in this array satisfies the provided testing function. see also array.prototype.some(). uint16array.prototype.sort() sorts the elements of an array in place and returns the array. see also array.proto...
Uint32Array - JavaScript
uint32array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). uint32array.prototype.includes() determines whether a typed array includes a certain element, returning true or false as appropriate. see also array.prototype.includes(). uint32array.prototype.indexof() returns the first (least) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.indexof(). uint32array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). uint32array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). uint32array.prototype.lastindexof() returns the last (greatest) index of an...
...o array.prototype.indexof(). uint32array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). uint32array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). uint32array.prototype.lastindexof() returns the last (greatest) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.lastindexof(). uint32array.prototype.map() creates a new array with the results of calling a provided function on every element in this array. see also array.prototype.map(). uint32array.prototype.reduce() apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value. see also ...
...ch value of the array (from right-to-left) as to reduce it to a single value. see also array.prototype.reduceright(). uint32array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first. see also array.prototype.reverse(). uint32array.prototype.set() stores multiple values in the typed array, reading input values from a
specified array. uint32array.prototype.slice() extracts a section of an array and returns a new array. see also array.prototype.slice(). uint32array.prototype.some() returns true if at least one element in this array satisfies the provided testing function. see also array.prototype.some(). uint32array.prototype.sort() sorts the elements of an array in place and returns the array. see also array.proto...
Uint8Array - JavaScript
. uint8array.prototype.foreach() calls a function for each element in the array. see also array.prototype.foreach(). uint8array.prototype.includes() determines whether a typed array includes a certain element, returning true or false as appropriate. see also array.prototype.includes(). uint8array.prototype.indexof() returns the first (least) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.indexof(). uint8array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). uint8array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). uint8array.prototype.lastindexof() returns the last (greatest) index of an el...
...also array.prototype.indexof(). uint8array.prototype.join() joins all elements of an array into a string. see also array.prototype.join(). uint8array.prototype.keys() returns a new array iterator that contains the keys for each index in the array. see also array.prototype.keys(). uint8array.prototype.lastindexof() returns the last (greatest) index of an element within the array equal to the
specified value, or -1 if none is found. see also array.prototype.lastindexof(). uint8array.prototype.map() creates a new array with the results of calling a provided function on every element in this array. see also array.prototype.map(). uint8array.prototype.reduce() apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value. see also ar...
...each value of the array (from right-to-left) as to reduce it to a single value. see also array.prototype.reduceright(). uint8array.prototype.reverse() reverses the order of the elements of an array — the first becomes the last, and the last becomes the first. see also array.prototype.reverse(). uint8array.prototype.set() stores multiple values in the typed array, reading input values from a
specified array. uint8array.prototype.slice() extracts a section of an array and returns a new array. see also array.prototype.slice(). uint8array.prototype.some() returns true if at least one element in this array satisfies the provided testing function. see also array.prototype.some(). uint8array.prototype.sort() sorts the elements of an array in place and returns the array. see also array.prototyp...
Web audio codec guide - Web media technologies
however, in practice 64 kbps is always used g.722 annex b super wide-band: 64 kbps, 80 kbps, and 96 kbps g.722 annex d stereo wide-band: 64 kbps and 80 kbps g.722 annex d stereo super wide-band: 80 kbps, 96 kbps, 112 kbps, and 128 kbps variable bit rate (vbr) support no supported sample formats 14-bit integer supported sample rates 16 khz (adpcm is
specified to allow 8 khz, 11.025 khz, 22.05 khz, 44.1 khz, but g.722 uses 16 khz) recommended minimum bit rate for stereo sound 128 kbps at 44.1 khz sample rate compression lossy maximum audio channels 2 audio frequency bandwidth 50 hz - 7 khz latency 4 ms browser compatibility feature chrome edg...
...fari g.722 support yes[1] yes[1] yes[1] no yes[1] yes[1] container support 3gp, amr-wb rtp / webrtc compatible yes licensing all applicable patents have expired; g.722 is free to use without restriction [1] webrtc only. mp3 (mpeg-1 audio layer iii) of the audio formats
specified by the mpeg/mpeg-2 standards, mpeg-1 audio layer iii—otherwise known as mp3—is by far the most widely used and best-known. the mp3 codec is defined by mpeg-1 part 3 and mpeg-2 part 3, and was introduced in 1991 (and finalized in 1992). when mp3-format audio is stored inside an mpeg container, the resulting file is also referred to as just an "mp3 file" or simply "mp3." files with the ubiquit...
... opus support 33 14 15 no 20 11[2] this information refers to support for opus in html <audio> and <video> elements, and not to webrtc. container support ogg, webm, mpeg-ts, mp4 rtp / webrtc compatible yes licensing fully open and free of any licensing requirements [1] the
specified sample rates are effective sample rates. opus uses an algorithm based on audio bandwidths rather than sample rates. see rfc 6716, section 2 for details. in addition, there is an optional part of the opus specification (opus custom) that does allow for non-standard sample rates, but the use of this feature is discouraged. [2] safari supports opus in the <audio> element only when packaged in a caf...
Media container formats (file types) - Web media technologies
support is also implied only for the container itself, not for any specific codecs. [2] available only if available on the underlying operating system's media framework. [3] requires web media extensions to be installed. 3gp the 3gp or 3gpp media container is used to encapsulate audio and/or video that is s...
...,2 he-aac v2 yes1,2 mp3 yes1 [1] firefox only supports 3gp on openmax-based devices, which currently means the boot to gecko (b2g) platform. [2] firefox support for aac relies upon the operating system's media infrastructure, so it is available as long as the os supports it. adts audio data transport stream (adts) is a container format
specified by mpeg-4 part 3 for audio data, intended to be used for streamed audio, such as for internet radio. it is, essentially, an almost bare stream of aac audio data, comprised of adts frames with a minimal header. adts media mime types audio audio/aac[1] audio/mpeg[1] [1] the mime type used for adts depends on what kind of audio frames are contained within. if ...
...4. 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 video is offered first in webm format (with the type attribute set to video/webm). if the user agent can't play that, it moves on to the next option, whose type is
specified as video/mp4. if neither of those can be played, the text "this browser does not support the html5 video element." is presented. specifications specification comment etsi 3gpp defines the 3gp container format iso/iec 14496-3 (mpeg-4 part 3 audio) defines mp4 audio including adts flac format the flac format specification iso/iec 11172-...
begin - SVG: Scalable Vector Graphics
ither begin or end to identify whether to synchronize with the beginning or active end of the referenced animation element. an optional offset value as defined in <offset-value> can be appended. <event-value> this value defines an event and an optional offset that determines the time at which the element's animation should begin. the animation start time is defined relative to the time that the
specified event is fired. a valid event-value consists of an element id followed by a dot and one of the supported events for that element. all valid events (not necessarily supported by all elements) are defined by the dom and html specifications. those are: focus, blur, focusin, focusout, activate, auxclick, click, dblclick, mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup, whe...
... keydown, keyup, compositionstart, compositionupdate, compositionend, load, unload, abort, error, select, resize, scroll, beginevent, endevent, and repeatevent. an optional offset value as defined in <offset-value> can be appended. <repeat-value> this value defines a qualified repeat event. the element animation start time is defined relative to the time that the repeat event is raised with the
specified iteration value. a valid repeat value consists of an element id followed by a dot and the function repeat() with an integer value specifying the number of repetitions as parameter. an optional offset value as defined in <offset-value> can be appended. <accesskey-value> this value defines an access key that should trigger the animation. the element animation will begin when the user presses the...
...iteration value. a valid repeat value consists of an element id followed by a dot and the function repeat() with an integer value specifying the number of repetitions as parameter. an optional offset value as defined in <offset-value> can be appended. <accesskey-value> this value defines an access key that should trigger the animation. the element animation will begin when the user presses the
specified key. a valid accesskey-value consists of the 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 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 b...
end - SVG: Scalable Vector Graphics
nd either begin or end to identify whether to synchronize with the beginning or active end of the referenced animation element. an optional offset value as defined in <offset-value> can be appended. <event-value> this value defines an event and an optional offset that determines the time at which the element's animation should end. the animation end time is defined relative to the time that the
specified event is fired. a valid event-value consists of an element id followed by a dot and one of the supported events for that element. all valid events (not necessarily supported by all elements) are defined by the dom and html specifications. those are: focus, blur, focusin, focusout, activate, auxclick, click, dblclick, mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup, wh...
..., keydown, keyup, compositionstart, compositionupdate, compositionend, load, unload, abort, error, select, resize, scroll, beginevent, endevent, and repeatevent . an optional offset value as defined in <offset-value> can be appended. <repeat-value> this value defines a qualified repeat event. the element animation end time is defined relative to the time that the repeat event is raised with the
specified iteration value. a valid repeat value consists of an element id followed by a dot and the function repeat() with an integer value specifying the number of repetitions as parameter. an optional offset value as defined in <offset-value> can be appended. <accesskey-value> this value defines an access key that should trigger the end of the animation. the element animation will end when the user pr...
... value. a valid repeat value consists of an element id followed by a dot and the function repeat() with an integer value specifying the number of repetitions as parameter. an optional offset value as defined in <offset-value> can be appended. <accesskey-value> this value defines an access key that should trigger the end of the animation. the element animation will end when the user presses the
specified key. a valid accesskey-value consists of the 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 bas...
orient - SVG: Scalable Vector Graphics
umber> default value 0 animatable yes (non-additive) auto this value indicates that the marker is oriented such that its positive x-axis is pointing in a direction relative to the path at the position the marker is placed. auto-start-reverse if placed by marker-start, the marker is oriented 180° different from the orientation that would be used if auto where
specified. ...
...arker is oriented 180° different from the orientation that would be used if auto where
specified. for all other markers, auto-start-reverse means the same as auto. note: this allows a single arrowhead marker to be defined that can be used for both the start and end of a path, i.e. which points outwards from both ends. <angle> this value indicates that 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. note: for example, if a value of 45 is given, then the marker's positive x-axis would be pointing down and right in the shape's coordinate system. <number> this value indicates an angle in degrees. ...
... specifications specification status comment scalable vector graphics (svg) 2the definition of 'orient' in that specification. ...
textLength - SVG: Scalable Vector Graphics
by default, only the spacing between characters is adjusted, but the glyph size can also be adjusted if you change lengthadjust. ...
...these events will be sent any time the slider's value cha...
...t(new event("input")); after fetching the element references, an eventlistener is established by calling addeventlistener() on the slider control, to receive any input events which occur. these events will be sent any time the slider's value changes, even if the user hasn't stopped moving it, so we can responsively adjust the text width. when an "input" event occurs, we call svglength.newvalue
specifiedunits() to set the value of textlength to the slider's new value, using the svglength interface's svg_lengthtype_px unit type to indicate that the value represents pixels. note that we have to dive into textlength to get its baseval property; textlength is stored as an svglength object, so we can't treat it like a plain number. after updating the text width, the contents of the widthdisplay box a...
Content Scripts - Archive of obsolete content
object includes an attach() function to attach a content script to the tab. page-worker: lets you retrieve a web page without displaying it. you can attach content scripts to the page, to access and manipulate the page's dom. context-menu: use a content script to interact with the page in which the menu is invoked. additionally, some sdk user interface components - panel, sidebar, frame - are
specified using html, and use separate scripts to interact with this content. in many ways these are like content scripts, but they're not the focus of this article. to learn about how to interact with the content for a given user interface module, please see the module-specific documentation: panel, sidebar, frame. almost all the examples presented in this guide are available as complete, but minimal, ad...
...quire("sdk/self").data; var pagemod = require("sdk/page-mod"); pagemod.pagemod({ include: "*.mozilla.org", contentscriptfile: [data.url("jquery.min.js"), data.url("my-content-script.js")] }); if you do this, the scripts can interact directly with each other, just like scripts loaded by the same web page. you can also use contentscript and contentscriptfile together. if you do this, scripts
specified using contentscriptfile are loaded before those
specified using contentscript. this enables you to load a javascript library like jquery by url, then pass in a simple script inline that can use jquery: // main.js var data = require("sdk/self").data; var pagemod = require("sdk/page-mod"); var contentscriptstring = '$("body").html("<h1>page matches ruleset</h1>");'; pagemod.pagemod({ include:...
page-worker - Archive of obsolete content
tring or an array of match pattern strings. these define the documents to which the page-worker's content worker applies. at least one match pattern must be supplied. see the match-pattern module for a detailed description of match pattern syntax. contentscriptfile string,array a local file url or an array of local file urls of content scripts to load. content scripts
specified by this option are loaded before those
specified by the contentscript option. see working with content scripts for help on setting this property. contentscript string,array a string or an array of strings containing the texts of content scripts to load. content scripts
specified by this option are loaded after those
specified by the contentscriptfile option. c...
...s optional and defaults to "end". contentscriptoptions object read-only value exposed to content scripts under self.options property. any kind of jsonable value (object, array, string, etc.) can be used here. optional. onmessage function use this to add a listener to the page worker's message event. page a page object loads the page
specified by its contenturl option and executes any content scripts that have been supplied to it in the contentscript and contentscriptfile options. the page is not displayed to the user. the page worker is loaded as soon as the page object is created and stays loaded until its destroy method is called or the add-on is unloaded. methods destroy() unloads the page worker. after you destroy a page work...
selection - Archive of obsolete content
(var subselection in selection) { console.log(subselection.html); } } surround html selections with delimiters: var selection = require("sdk/selection"); selection.on('select', function () { selection.html = "\\\" + selection.html + "///"; }); globals properties text gets or sets the current selection as plain text. setting the selection removes all current selections, inserts the
specified text at the location of the first selection, and selects the new text. getting the selection when there is no current selection returns null. setting the selection when there is no current selection throws an exception. getting the selection when iscontiguous is true returns the text of the first selection. html gets or sets the current selection as html. setting the selection removes all curre...
...e first selection, and selects the new text. getting the selection when there is no current selection returns null. setting the selection when there is no current selection throws an exception. getting the selection when iscontiguous is true returns the text of the first selection. html gets or sets the current selection as html. setting the selection removes all current selections, inserts the
specified text at the location of the first selection, and selects the new text. getting the selection when there is no current selection returns null. setting the selection when there is no current selection throws an exception. getting the selection when iscontiguous is true returns the text of the first selection. iscontiguous true if the current selection is a single, contiguous selection, and false ...
content/mod - Archive of obsolete content
tyle = style({ source: "div { border: 4px solid gray }" }); // assuming window points to the content page we want to modify attachto(style, window); parameters modification : object the modification we want to apply to the target. window : nsidomwindow the window to be modified. detachfrom(modification, window) function removes attached modification from a given window. if window is not
specified, modification is removed from all the windows it's being attached to. for example, the following code applies and removes a style to a content window, adding a border to all divs in page: var { attachto, detachfrom } = require("sdk/content/mod"); var style = require("sdk/stylesheet/style").style; var style = style({ source: "div { border: 4px solid gray }" }); // assuming window points to t...
...ion to a given target representing a content to be modified. parameters modification : object the modification we want to apply to the target target : object target is a value that representing content to be modified. it is valid only when gettargetwindow(target) returns nsidomwindow of content it represents. detach(modification, target) function removes attached modification. if target is
specified modification is removed from that target only, otherwise modification is removed from all the targets it's being attached to. parameters modification : object the modification we want to remove from the target target : object target is a value that representing content to be modified. it is valid only when gettargetwindow(target) returns nsidomwindow of content it represents. if target is no...
content/symbiont - Archive of obsolete content
you map optionally pass a frame into the symbiont's constructor: if you don't, then a new hidden frame will be created to host the content. this trait is composed from the loader and worker traits. ...
...o execute script in the content. defaults to true. optional. optional. symbiont symbiont is composed from the worker trait, therefore instances of symbiont and their descendants expose all the public properties exposed by worker along with additional public properties that are listed below: properties contentscriptfile the local file urls of content scripts to load. content scripts
specified by this property are loaded before those
specified by the contentscript property. contentscript the texts of content scripts to load. content scripts
specified by this property are loaded after those
specified by the contentscriptfile property. contentscriptwhen when to load the content scripts. this may have one of the following values: "start": load content scripts immediately after the ...
io/file - Archive of obsolete content
if your add-on uses literal windows-style path specifications with this api, your add-on likely won't work when users run it on unix-like systems. likewise, if your add-on uses literal unix-style path specifications, it won't work for users on windows. ...
... if your add-on uses literal windows-style path specifications with this api, your add-on likely won't work when users run it on unix-like systems. likewise, if your add-on uses literal unix-style path specifications, it won't work for users on windows. ...
io/text-streams - Archive of obsolete content
(inputstream, charset) creates a buffered input stream that reads text from a backing stream using a given text encoding. you can also create textreader objects using io/file's open() function. parameters inputstream : stream the backing stream, an nsiinputstream. it must already be opened. charset : string inputstream is expected to be in the character encoding named by this value. if not
specified, "utf-8" is assumed. see nsicharsetconvertermanager.idl for documentation on how to determine other valid values for this. textwriter(outputstream, charset) creates a buffered output stream that writes text to a backing stream using a given text encoding. you can also create textwriter objects using io/file's open() function. parameters outputstream : stream the backing stream, an nsioutput...
..., charset) creates a buffered output stream that writes text to a backing stream using a given text encoding. you can also create textwriter objects using io/file's open() function. parameters outputstream : stream the backing stream, an nsioutputstream. it must already be opened. charset : string text will be written to outputstream using the character encoding named by this value. if not
specified, "utf-8" is assumed. see nsicharsetconvertermanager.idl for documentation on how to determine other valid values for this. textreader methods close() closes both the stream and its backing stream. read(numchars) reads and returns a string from the stream. if the stream is closed, an exception is thrown. parameters numchars : number the number of characters to read. if not given, the rema...
console - Archive of obsolete content
n exception occurred. userexception: thing could not be done! console.info(object[, object, ...]) a synonym for console.log(). console.log(object[, object, ...]) logs the arguments to the console, preceded by "info:" and the name of your add-on: console.log("this is an informational message"); info: my-addon: this is an informational message console.time(name) starts a timer with a name
specified as an input parameter. up to 10,000 simultaneous timers can run on a given page. console.timeend(name) stops the
specified timer and logs the elapsed time in seconds since its start. see timers. console.trace() logs a stack trace at the point the function is called. console.warn(object[, object, ...]) logs the arguments to the console, preceded by "warn:" and the name of your add-on: cons...
... the logging level the logging level defaults to "error". there are two system preferences that can be used to override this default: extensions.sdk.console.loglevel: if set, this determines the logging level for all installed sdk-based add-ons. extensions.extensionid.sdk.console.loglevel, where extensionid is an add-on's program id. if set, this determines the logging level for the
specified add-on. this overrides the global preference if both preferences are set. both these preferences can be set programmatically using the preferences/service api, or manually using about:config. the value for each preference is the desired logging level, given as a string. when you run your add-on using jpm run (without --profile set) or jpm test, the global extensions.sdk.console.loglevel pref...
jpm-mobile - Archive of obsolete content
launch an instance of firefox with your add-on installed. jpm-mobile test runs your add-on's unit tests. jpm-mobile run this command runs a new instance of firefox with the add-on installed: jpm-mobile run jpm-mobile run accepts the following options: --adb /path/to/adb provides the path to adb. -b --binary binary use the package name of firefox
specified in binary. jpm-mobile run -b fennec you can get the package name by following command. $ adb shell pm list packages | grep org.mozilla package:org.mozilla.firefox $ jpm-mobile run -b firefox # the package name is firefox -v --verbose verbose operation. jpm-mobile test jpm-mobile test see the tutorial on unit testing and the reference documentation for...
...e name is firefox -v --verbose verbose operation. jpm-mobile test jpm-mobile test see the tutorial on unit testing and the reference documentation for the assert module for more details on this. jpm-mobile test accepts the following options: --adb /path/to/adb provides the path to adb. -b --binary binary use the package name of firefox
specified in binary. jpm-mobile test -b fennec you can get the package name by following command. $ adb shell pm list packages | grep org.mozilla package:org.mozilla.firefox $ jpm-mobile run -b firefox # the package name is firefox -v --verbose verbose operation. ...
Bookmarks - Archive of obsolete content
t. specifying default_index as the index at which to insert the new folder places it at the end of the list. you can easily change this code to insert the new folder into the bookmarks toolbar by changing bookmarksmenufolder to another folder attribute. creating a new bookmark to create a new bookmark, use the nsinavbookmarksservice.insertbookmark() method. the uri for the bookmark needs to be
specified using an nsiuri object. var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("http://google.com/", null, null); var newbkmkid = bmsvc.insertbookmark(newfolderid, uri, bmsvc.default_index, ""); this example instantiates the nsiioservice and uses it to create an nsiuri referring to the google w...
...marksservice.getbookmarkidsforuri() method. var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("http://google.com/", null, null); var bookmarksarray = bmsvc.getbookmarkidsforuri(uri, {}); after executing this code, the array bookmarksarray contains the ids of all bookmarks that refer to the
specified uri (in this case, "http://google.com"). manipulating existing items there are a number of convenient methods you can use to make changes to existing bookmarks and bookmark folders. this section covers some of them. the item title to change the title of a bookmark or bookmark folder, you use the nsinavbookmarksservice.setitemtitle() method. bmsvc.setitemtitle(newbkmkid, "new title"); this ...
File I/O - Archive of obsolete content
ame 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(), moveto(), and so on. getting files in special directories components.utils.import("resource://gre/modules/fileutils.jsm"); // get the "data.txt" file in the profile directory var file = fileutils.getfile("profd", ["data.txt"]); or the...
...t("resource://gre/modules/fileutils.jsm"); var file = fileutils.getfile("tmpd", ["suggestedname.tmp"]); file.createunique(components.interfaces.nsifile.normal_file_type, fileutils.perms_file); // do whatever you need to the created file alert(file.path); user input via nsifilepicker the file picker component, nsifilepicker, can be used to open standard open / save dialogs. it returns the user-
specified file as nsifile. nsifile and path strings you can use nsifile.path to get a platform-specific path string, for example "c:\windows\system32" or "/usr/share". to get a url of a file, use nsiioservice.newfileuri(): // file is nsifile components.utils.import("resource://gre/modules/services.jsm"); var url = services.io.newfileuri(file); // url is a nsiuri; to get the string "file://...", see url...
JavaScript Daemons Management - Archive of obsolete content
art property. it will be called with three arguments: index (the iterative index of each invocation), length (the number of total invocations assigned to the daemon - finite or infinity), and backwards (a boolean expressing whether the process is going backwards or not). daemon global object properties daemon.context an empty object used as the default this object when the thisobject is not
specified during the construction of the daemon. if you want your callback function to be invoked with a null this object, you have to manually set the owner property to null. daemon global object methods daemon.forcecall(daemoninstance) forces a callback to the daemoninstance.task function regardless of whether or not the end has been reached. in any case the internal index property will be increase...
... happen. if the argument is true, the first callback will be synchronous. mydaemon.reverseplay([synchronous]) starts the daemon backwards. if the daemon was running in the same direction, nothing will happen. if the argument is true, the first callback will be synchronous. mydaemon.move([synchronous[, reversals[, backwards]]]) starts a daemon synchronously or not. if the reversals argument is
specified, the mydaemon.reversals property will be setted on it. if the backwards argument is
specified, the daemon will move forwards (false) or backwards (true). if it is not
specified the daemon will start in the same direction in which it has been left. if the daemon was running in the same direction, only the reversals property will be possibly updated. mydaemon.turn() inverts the direction of the d...
JavaScript timers - Archive of obsolete content
a block of javascript code is generally executed synchronously. but there are some javascript native functions (timers) which allow us to delay the execution of arbitrary instructions: settimeout() setinterval() setimmediate() requestanimationframe() the settimeout() function is commonly used if you wish to have your function called once after the
specified delay. the setinterval() function is commonly used to set a delay for functions that are executed again and again, such as animations. the setimmediate() function can be used instead of the settimeout(fn, 0) method to execute heavy operations in ie. the requestanimationframe() function tells the browser that you wish to perform an animation and requests that the browser schedule a repaint of the window for the next animation frame. doc...
...h as animations. the setimmediate() function can be used instead of the settimeout(fn, 0) method to execute heavy operations in ie. the requestanimationframe() function tells the browser that you wish to perform an animation and requests that the browser schedule a repaint of the window for the next animation frame. documentation settimeout() calls a function or executes a code snippet after
specified delay. setinterval() calls a function or executes a code snippet repeatedly, with a fixed time delay between each call to that function. setimmediate() calls a function immediately after the browser has completed other operations, such as events and display updates. cleartimeout() clears the delay set by settimeout(). clearinterval() cancels repeated action which was set up using setinter...
Multiple item extension packaging - Archive of obsolete content
manifest and the files with a jar and xpi file extension will be extracted or utilized. install.rdf a multiple item package does not have the same requirements as an extension for its install.rdf. the only required properties are em:id, em:targetapplication, and em:type. for the firefox and thunderbird 1.5 extension manager to determine that the package is a multiple item package, the em:type
specified in your install.rdf must be 32 and
specified as <em:type nc:parsetype="integer">32</em:type>. the xml namespace xmlns:nc="http://home.netscape.com/nc-rdf#" must also be declared in your install.rdf as shown below. ... <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:nc="http://home.netscape.com/nc-rdf#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about...
...extension manager you can use the above syntax or <em:type>32</em:type> as shown below. ... <rdf xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#"> <description about="urn:mozilla:install-manifest"> <!-- nsiupdateitem type for a multiple item package --> <em:type>32</em:type> ... when specifying em:targetapplication the minversion
specified should be the highest minversion and the maxversion
specified should be the lowest maxversion from all of the installable bundles contained by the multiple item package for the em:targetapplication. if this is not done, any items that are not compatible will not be installed unless a compatibility check discovers updated compatibility information. installation installation can be performed usin...
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
g elements. root elements use the windowtype attribute as an arbitrary identifier for the type of window. for example, firefox uses the windowtype navigator:browser for its browser window and browser:preferences for its options dialog. using methods we will cover in chapter 4, we will see how windows can be acquired using these values as keys. a window's dimensions and location on screen can be
specified using the attributes width, height, screenx, and screeny (all using pixels as units). with the previously discussed persist attribute, you can easily store a window's size and location. firefox uses this method to store its own window sizes and locations as well. general root elements window the window element that has appeared in examples so far is a root element used to define an ordinary wi...
...2 other xul functions overlays one of xul’s distinctive features is overlays. these give you the ability to combine multiple xul documents and process them as a single xul document. in firefox, this is used to modularize functions and implement extensions. by inserting an xul-overlay processing instruction between the xml declaration and the opening tag of the root element, the xul document
specified by the xul-overlay will be read in at the same time as the current xul document. the xul document that actually gets displayed will be a combination of the original xul document and the one
specified in xul-overlay. try typing up listing 23 and saving it as base.xul. take a look at the overlay example used by this xul document. <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet href="chrom...
Notes on HTML Reflow - Archive of obsolete content
ove several commands from the queue at once.) a path is built from the target frame to the root frame and stored in the reflow command. a reflow state object is created with a reflow reason of incremental, the reflow command is stored in the state, and the reflow method of the root frame is invoked. processing. the root frame notes the incremental reflow reason
specified in the reflow state, and inspects the path contained within the reflow command object. specifically, it extracts the next frame along the path from the reflow command object, creates its own reflow state, also with an incremental reason, and invokes the reflow method of the next frame. the incremental reflow proceeds recursively through the frame hierarchy. each frame along the increment...
...e, and inspects the path contained within the reflow command object. specifically, it extracts the next frame along the path from the reflow command object, creates its own reflow state, also with an incremental reason, and invokes the reflow method of the next frame. the incremental reflow proceeds recursively through the frame hierarchy. each frame along the incremental reflow path (as
specified in the reflow command object) extracts the next frame and dispatches the reflow downward. in order to correctly dispatch the reflow to the child frame, the frame may need to perform some state recovery ; for example, a block frame will traverse its line list to recover the space occupied by floated frames. at some point, the incremental reflow reaches the target frame ,...
Dehydra Function Reference - Archive of obsolete content
ample include("map.js") // includes map.js into toplevel var map = {} include("map.js", map) // includes map.js into the map object require({version:, strict:, werror:, gczeal:}) require is used to set runtime execution flags. it also returns the current values of these flags. require supports optional named arguments via javascript object where each parameter is a property. if a property is not
specified then it will not be passed to the runtime. version integer: this sets js version similar to version() in js 1.7. strict boolean: controls js strict mode werror boolean: turns js warnings into errors gczeal int: this is a write-only parameter to set turn on frequent garbage collection. it is a mainly useful for debugging dehydra for rooting bugs. gczeal is only enabled when spidermonkey and dehyd...
...ter to set turn on frequent garbage collection. it is a mainly useful for debugging dehydra for rooting bugs. gczeal is only enabled when spidermonkey and dehydra are compiled with debug macro defined. require() example require({strict:true, gczeal:2}) if (require().werror) print("werror is set") warning([code,] msg [, loc]) print a warning message using the gcc warning mechanism. if -werror is
specified this will cause compilation to fail. optional: code is an integer parameter that allows warnings to be enabled(-wfoo) and disabled(-wno-) on the gcc commandline. this parameter is used when the first argument to warning() is an integer. it is not possible to define new warnings in dehydra, thus one has to figure out a warning code from an existing warning and hijack it for ulterior purposes. msg...
Creating a Help Content Pack - Archive of obsolete content
y the file, and the help viewer searches for this element in order to query for further information (stored in child elements) about the content pack being parsed. nc:title is where you specify the title (e.g., "mozilla firefox help") for the help window. this attribute is required. nc:defaulttopic will hold the rdf:id of the topic you want displayed when the viewer first loads if none has been
specified. this attribute also specifies what topic is loaded when the user hits the home button in the viewer. we'll get to exactly how to fill in this attribute later. this attribute is optional, with fallback to the value welcome. nc:base contains the base url relative to which the help content referenced in the descriptor file is located. for example, if your glossary, index, and table of contents rdf...
...sary and index data sources will be hidden - information found only in them will not be displayed unless the user conducts a search of the help pack that would return glossary or index results.xxx this sentence is ugly - a little rewording help here would be nice a data source description is pretty much the same no matter which type you're defining, and the syntax is pretty simple. each panel is
specified by one rdf:description element with the following attributes: nc:panelid specifies the name of the panel, which may be any one of glossary, search, toc, or index. the data source
specified by toc will always be displayed, while the other data sources may only be available by searching through the loaded content pack. nc:datasources is a space-separated list of rdf datasources used in construc...
Microsummary XML grammar reference - Archive of obsolete content
pplies that element's interval and stops processing child elements. thus, the first matching <condition> determines the update interval. if there are no <condition> child elements, or if none of their expressions evaluate to true, firefox applies the value of the <update> element's interval attribute. ...
...x applies the value of the <update> element's interval attribute. if the <update> element does not include an interval attribute, firefox applies the interval
specified by the browser.microsummary.updateinterval preference. if that preference has not been set, firefox applies its default update interval, which is 30 minutes. ...
Plug-n-Hack Phase1 - Archive of obsolete content
so if you select the “zap scan” command then you will be prompted to select a site from the list of sites currently known to zap. pnh does not specify how tool commands should be displayed, so other browsers are free to disp...
...so if you select the “zap scan” command then you will be prompted to select a site from the list of sites currently known to zap. pnh does not specify how tool commands should be displayed, so other browsers are free to display them in different ways. ...
Table Layout Strategy - Archive of obsolete content
ollowing the basic table layout strategy is discussed. the functionality is distributed over a large number of subroutines as shown in the chart below. the words the table layout is width oriented and knows the following widths: minimum content width - min the minimum width that is required to layout the content, all linebreak possibilities will be used percent width - pct the cell width
specified in percent, fixed width - fix the cell width
specified as px, mm etc., proportional width - prop the cell width
specified via 1*, 2* etc. and the desired width - des the width the content could fill without any linebreaks. cells can be members of colspans. these colspans have to distribute their space to the columns they include. this information is hold in the adjusted width's. due to thi...
...dj), but use min_pro if present for a fixed width table, the column may get more space if the sum of the col allocations is insufficient column width info columns get their width information from style info <col width="200px"> and from the cells that belong into this column. these informations are very often conflicting. for instance one cell could have a large min width,the next could have a
specified fixed width and another a
specified pct width. for a given width type the maximum wins. special cases note: the following examples are not shown correctly due to technical constraints on wiki content. you can help by editing this page and adding screenshots or links to example pages. width = "0*" assume that you would like to give all the space to the second column in a table. poor mans c...
Actionscript Acceptance Tests - Archive of obsolete content
ses_swfversion is the equivalent of: -swfversion 9 -swfversion 10 -swfversion 11 -swfversion 12 ... any additional args on the uses_swfversion line will be passed to each run of the vm. (see bug 587093 for details.) specifying multiple .abcs: if you desire to run a test with multiple .abc files (e.g: avmshell a.abc b.abc testname.abc) there is a special avm_args directive called multiabc that is
specified surrounded by two pipe (|) symbols: |multiabc| $dir/testname_support/a.abc $dir/testname_support/b.abc the extra abc files will usually be placed in a _support dir (see additional files below). any avm arguments can be placed before the |multiabc| directive, or the line can start with the directive. any test arguments (--) must be placed after the multiabc file listings. here is a more complic...
...re complicated example that passes both avm args, multiple abcs and test args: -ojit |multiabc| $dir/testname_support/a.abc -- test_args a dir.avm_args file can also be created with the same contents that will apply to the entire directory. testname.as.avm_args files will take precedence over the dir.avm_args file testname.as.tz if a test is only valid for certain timezones, the timezones can be
specified in this support file. below is a sample file that covers the 4 main us timezones: # place all timezones that this file applies to. # these values correspond to the value returned by time.tzname tuple. # (see http://docs.python.org/library/time.html for details) # e.g.: eastern standard time/eastern daylight time = ('est','edt') # write timezones as tuples, one to each line. ('est', 'edt') ('cst...
The life of an HTML HTTP request - Archive of obsolete content
warning: the content of this article may be out of date. it was last updated in 1999. (1) the loading of the url is started in nswebshell::doloadurl (called from some loadurl or loaduri variant in the webshell). the webshell then tells its documentloader to load (command "view") the
specified url. [note: passes nswebshell.mobserver as nsistreamobserver and the webshell as nsicontentviewercontainer to the docloader.] (2) the document loader calls ns_openuri with the url to begin transfering the requested file. necko (the network library) checks the url scheme (the first part of the url, http: in this case) and locates the correct nsiprotocolhandler (in this case nshttphandler) and asks it for a nsichannel (nshttpchannel). the channel represents the connection to the server, and is ...
...y 8kb block of data (unless the parser is temporarily blocked). (7) since the presentation shell (nspresshell) has registred as an documentobserver with the nsidocument it also gets notified of changes in the document/content tree. this is used to create and update the nsiframe hierarchy. this is done by the nscssframeconstructor, which creates frames for each content node according 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 ...
Binding Attachment and Detachment - Archive of obsolete content
vent is fired, no assumptions can be made regarding order of binding attachment. when a binding is attached, 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 attac...
...re detached when the following conditions are met: mozbinding style rule is removed the element is destroyed (e.g., by closing the document) when a binding is detached, the following events occur: anonymous content generated by the binding is destroyed. methods and properties with getters/setters are no longer accessible from the binding, although properties with raw values remain. any
specified event handlers are unhooked from their respective targets. a binding can specify a <destructor> block within <implementation> section that executes prior to the binding detachment. using a <destructor> block, a binding can perform any necessary cleanup before it is torn down. bindings in an inheritance chain are always detached from the most derived binding to the base. therefore the <destruct...
Event Handlers - Archive of obsolete content
event handlers are defined using handler elements. a handler specifies what event it is listening for using the event attribute. the handler contains script that is executed when an event flows to the object the handler is attached to and if that event matches all of the criteria
specified by the handler. the most basic handler specifies the event to listen for and an action to take when the handler fires. this action can be
specified either using an action attribute or by specifying the script as a child of the handler element. if both are
specified, the attribute wins. in both cases the javascript body is compiled just before execution; code that does not depend on the context of the event should be factored into normal javascript file. (note that there is a possibility that this may change in ...
...handler then has a way of preventing the event from flowing to its base binding handlers. mouse and key handlers have certain additional properties that are supported by xbl. additional attributes can be used to impose a filter on the event handler. when a filter is imposed, additional conditions must be met before the event handler will fire. for both mouse and key events, modifier keys can be
specified using the modifiers attribute. this attribute is a comma-separated list of modifier keys that must be down at the time the key or mouse event occurs in order for the handler to execute. examples of common keys in the list are shift and control. for more details, see the xbl element reference for <handler>. in addition, mouse events can specify the button and the clickcount. this allows xbl auth...
XBL 1.0 Reference - Archive of obsolete content
bindings can be bound to elements using cascading style sheets (css) or dom. one element can be bound to several bindings at once. ...
...bindings can be bound to elements using cascading style sheets (css) or dom. one element can be bound to several bindings at once. ...
XBL - Archive of obsolete content
also: xbl removal design review packet, problems with xbl and the xbl and web components comparison. xml binding language (xbl, sometimes also called extensible bindings language) is a language for describing bindings that can be attached to elements in other documents. the element that the binding is attached to, called the bound element, acquires the new behavior
specified by the binding. bindings can contain event handlers that are registered on the bound element, an implementation of new methods and properties that become accessible from the bound element, and anonymous content that is inserted underneath the bound element. most xul widgets are at least partially implemented using xbl. you can build your own...
...ccessible from the bound element, and anonymous content that is inserted underneath the bound element. most xul widgets are at least partially implemented using xbl. you can build your own reusable widgets from existing xul, html, svg, and other primitives using xbl. specifications xbl 1.0 is
specified in xbl 1.0 reference. unfortunately, the actual implementation in mozilla is different from the specification, and there's no known document available describing the differences. hopefully, the reference will be updated to describe those differences. xbl 1.0 is a mozilla-specific technology, and not a w3c standard. at least two standards spawned from it ha...
Creating XPI Installer Modules - Archive of obsolete content
me a complete description of the new packaging scheme is beyond the scope of this article. the reader is referred to jar packaging, which describes the design, goals, and options available for jar packaging in some depth. what follows is a very brief overview of the design and a description of what mozilla expects in installable packages. resources are collected in jar archives whose contents are
specified in contents.rdf files at their own top level. the contents.rdf file explains the structure and contents of the archive to mozilla's chrome registry; as long as the explanation is accurate, the contents can be arranged in almost any way you want. in the package you create in this tutorial, for example, all of the resources are located under the content/ subdirectory, but they could just as easily ...
..."); // target subdir // registerchrome(type, location, source) registerchrome(package | delayed_chrome, getfolder("chrome","barley.jar"), "content/"); if (err==success) performinstall(); else cancelinstall(err); note that there is no version number on barley, and so the name + version parameter has a "v" and then nothing else. note also the use of resource attributes
specified in the contents.rdf file in the jar. it is the correspondence of this installation script, the resources themselves, and the contents.rdf file that registers the package and makes it available. creating a xpi the final step in the tutorial is to create a xpi archive in which the install.js script and the barley.jar can be redistributed. the archiving of an archive may seem a little redundant--and...
Methods - Archive of obsolete content
nsion, theme, and plug-in developers must switch away from install.js based packages to the new packaging scheme with an install.rdf manifest. in particular plugin developers should see how to package a plugin as an extension. methods dircreate creates a new directory. dirgetparent returns an object representing the parent directory. dirremove removes a directory. dirrename renames the
specified directory. copy makes a copy of the
specified file. diskspaceavailable returns the amount of disk space available in bytes. exists returns a boolean value indicating whether the
specified file exists or not. execute queues a file for executing as part of the installation process. isdirectory returns a boolean value indicating whether an object is a directory. isfile returns a boolean ...
...ot. execute queues a file for executing as part of the installation process. isdirectory returns a boolean value indicating whether an object is a directory. isfile returns a boolean value indicating whether an object is a file. moddate returns a number representing the last modified date of the given file. moddatechanged specifies whether the last modification on a file is older than a
specified date move moves a file from one location to another. remove removes a file. rename renames a file in place. size returns the size of the file in bytes. windowsshortcut creates a windows shortcut for a file. macalias creates a macintosh alias for a file. windowsgetshortname returns the windows shortname of the path. windowsregisterserver registers dlls with the registry. ...
confirm - Archive of obsolete content
button_pos_1_default: specifies button 1 as the default button. button_pos_2_default: specifies button 2 as the default button. button_delay_enable: specifies that the buttons sho...
... button_pos_1_default: specifies button 1 as the default button. ...
initInstall - Archive of obsolete content
method of install object syntax int initinstall ( string displayname, string package, installversion version, int flags); int initinstall ( string displayname, string package, string version, int flags); int initinstall ( string displayname, string package, string version); int initinstall ( string displayname, string package, installversion version); parameters the initinstall method has the following parameters: displayname a string that contains the name of the software being installed. the name of the software is displayed to the user. ...
...e version of the package being installed. when version is a string it should be up to four integer values delimited by periods, such as "1.17.1999.1517". flags an optional field; reserved for future use. pass 0 as the default value. returns an integer error code. for a list of possible values, see return codes. description the initinstall method initializes the installation of the
specified software. you must call this method immediately after the constructor. it is an error to call any other install methods before calling initinstall. after calling initinstall, your script must call performinstall or cancelinstall before it finishes. if your script does not call performinstall or cancelinstall, netscape 6 will not be able to clean up properly after your script finishes. example t...
Methods - Archive of obsolete content
ular plugin developers should see how to package a plugin as an extension. methods adddirectory unpacks an entire subdirectory. addfile unpacks a single file. alert displays an alert dialog box with a message and an ok button. cancelinstall aborts the installation of the software. confirm displays a confirm dialog box with the
specified message and ok and cancel buttons. also allows custom button labels and a checkbox. deleteregisteredfile deletes the
specified file and its entry in the client version registry. execute extracts a file from the xpi file to a temporary location and schedules it for later execution. gestalt retrieves information about the operating environment. (mac os only...
...he 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 software. refreshplugins refreshes the list of plug-ins registered for the browser. registerchrome registers chrome with the chrome registry. reseterro...
mousethrough - Archive of obsolete content
if no ancestor has the mousethrough attribute set, the default value is never. always mouse events are transparent to the element. this means that the element will not receive any mouse events due to either clicking or movement. child elements may override this if they specify mousethrough="never". never mouse events are passed to the element as normal. ...
...ents may override this if they specify mousethrough="never". never mouse events are passed to the element as normal. the mousethrough attribute is typically used in conjunction with a stack to allow elements to be stacked above other elements yet allow mouse events to be sent to lower elements. in the following example, the image appears above the button, yet the mousethrough attribute
specified on the image causes mouse events to be ignored on the image and instead fall through to the button. if the mousethrough attribute was not used, the image would receive all mouse events and the button could not be pressed with the mouse. <stack> <button label="below"/> <image src="happy.png" mousethrough="always"/> </stack> ...
popup.position - Archive of obsolete content
« xul reference home position type: string the position attribute determines where the popup appears relative to the element the user clicked to invoke the popup. this allows you to place the popup on one side of a button. note that a context menu will never respect this attribute, always appearing relative to the mouse cursor. this value can be
specified either as a single word offering pre-defined alignment positions, or as 2 words specifying exactly which part of the anchor and popup should be aligned. if
specified as 2 words, the value indicates which corner or edge of the anchor (the first word) is aligned which which corner of the popup (the second word). the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcent...
...rds, the value indicates which corner or edge of the anchor (the first word) is aligned which which corner of the popup (the second word). the anchor value (ie, the first word) can be one of topleft, topright, bottomleft, bottomright, leftcenter, rightcenter, topcenter or bottomcenter. the popup value (ie, the second word) can be one of topleft, topright, bottomleft or bottomright. positions
specified as a single word string are shortcuts for the values above. valid single-word values are after_start, after_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer. for more details, including examples, please see popup positioning see also position ...
Reading from Files - Archive of obsolete content
ors that might occur. the newinputstream method takes two arguments in this example. the first argument is the file to read from, and the second is a set of flags which control the reading. in this case, the 'text' flag is used which indicates that you expect this file to be text file. this method actually takes a number of additional arguments, however they are optional so they do not need to be
specified if they aren't needed. these extra arguments will be discussed later. you can also specify to read from a binary file by using the flag 'binary' instead of 'text'. the difference is that text streams process the bytes being read into characters in a particular character encoding whereas binary streams always read bytes. first, let's look at reading form text files. reading text files characters a...
...ll be discussed later. you can also specify to read from a binary file by using the flag 'binary' instead of 'text'. the difference is that text streams process the bytes being read into characters in a particular character encoding whereas binary streams always read bytes. first, let's look at reading form text files. reading text files characters are interpreted from a text input stream using a
specified character encoding. this means that if a character within the file occupies several bytes, it will converted into a single character when read. this is done automatically as long as you specify the 'text' flag to nsiscriptableio.newinputstream(). the default character encoding is utf-8 which means that characters below value 128 will occupy a single byte whereas characters above value 128 will oc...
International characters in XUL JavaScript - Archive of obsolete content
n both local and remote cases. unicode escapes, as discussed below, have always worked. how the character encoding is determined in gecko 1.8 and later when the javascript file is loaded from a chrome:// url, a byte order mark (fixme: )(bom) is used to determine the character encoding of the script. ...
... cross-version compatibility if you want the same code to work in both gecko 1.8 and earlier versions, you must limit yourself to ascii. ...
openPopup - Archive of obsolete content
anchor the popup may be either anchored to another node or opened freely. to anchor a popup to a node, supply an anchor node and set the position to a string indicating the manner in which the popup should be anchored. the anchor node does not need to be in the same document as the popup. unanchored popups may be created by supplying null as the anchor node. ...
..., after_end, start_before, start_after, end_before, end_after, overlap, and after_pointer. check positioning of the popup guide for a precise description of the effect of the different values. x, y for an anchored popup, the x and y arguments may be used to offset the popup from its anchored position by some number, measured in css pixels. an unanchored popup appears at the position
specified by x and y, relative to the viewport of the document containing the popup node. in this case, the position and attributesoverride arguments are ignored. iscontextmenu the iscontextmenu argument should be true for context menus and false for all other types of popups. it affects menu item highlighting; that is, while a context menu is open, menus opened earlier do not highlight or ex...
Introduction - Archive of obsolete content
as well as set attribute values from returned results. some other systems call this databinding. effectively, xul templates are the xul way of doing databinding. each template retrieves its data from a datasource. several types of datasources are supported by default, rdf, xml and sqlite databases, however, processors may be written to support other types of datasources. in xul, the datasource is
specified by placing the datasources attribute on an element. typically, the value will be a uri that identifies the location of the data. for example, for an xml datasource, the url of an xml file is
specified. when the xul parser sees an element with this attribute, it constructs a template builder for the element and attaches it to the element. it is expected that there will be a template inside the ele...
...the type affects how the datasource is used as well as the syntax for specifying queries. content generated by the template is inserted into the xul just as if you had placed it there yourself. ...
SQLite Templates - Archive of obsolete content
. (if you intend to set it by script, you must set datasources in the xul to rdf:null). the second method involves using a special url form: profile:filename.sqlite this form with the 'profile' prefix is used to refer to files in the profile directory. this is useful for user data, and is suitable as you do not need to calculate where this directory is located. the file within this directory is
specified after the colon, in this case 'filename.sqlite'. sqlite files typically have the 'sqlite' extension. as with xml datasources, the ref attribute isn't currently used for sqlite sources, so you should just set the ref attribute to a dummy value; '*' is typically used. the query for an sqlite datasource is just an sql select statement, as text inside the query element. this simple example shows how ...
...ge" name="maxage" type="integer">40</param> </query> <action> <listitem uri="?" label="?name"/> </action> </template> </listbox> here, the age is an integer number, so the type attribute is set to integer. integers are 32-bit values, but you can use the value int64 for 64-bit integers. you can also use the value double for double precision floating point values. if no type is
specified, a string is assumed. we could later change the age to use in the query with a short script: function adjustage(min, max) { document.getelementbyid("minage").textcontent = min; document.getelementbyid("maxage").textcontent = max; document.getelementbyid("friends").builder.rebuild(); } this function takes two arguments, the minimum and maximum values to use. we retrieve the param elements a...
Sorting Results - Archive of obsolete content
ify 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. the sortactive attribute may be set to true or false and specifies which column the tree is sorted by. only one column should have the sortactive attribute set to true at a time. the tree will change both attributes as necessary automatically when the column headers are clicked or the tree is sorted by other means. if you don't want to allow sorting by a certain column, you can leave out the sor...
...sort="http://purl.org/dc/elements/1.1/title" sortdirection="ascending" ref="http://www.xulplanet.com/rdf/myphotos"> <template> <vbox class="box-padded" uri="rdf:*"> <image src="rdf:*"/> <label value="rdf:http://purl.org/dc/elements/1.1/title"/> </vbox> </template> </hbox> in this example, the generated items will be sorted by title. when sorting, the predicate
specified in the sort attribute for the result is used to determine where in the content the generated output should be inserted. the is similar to using a variable but any predicate may be used, not just one that is used in the template. changing the sort to change the sorting for a template's generated contents, you can either change the sort related attributes and rebuild the template, or you can call t...
Accesskey display rules - Archive of obsolete content
xul elements display their accesskeys in their label automatically if it's necessary. this document describes the rules of generating a label text. xul elements don't display any accesskeys on mac xul elements don't display any accesskeys on mac. because macos x doesn't have the conception of accesskey function on its native widgets/applications. basic accesskey display rules on non-mac platforms, a character which is same as its accesskey is underlined. e.g., when an accesskey of "file" is 'f', the generated label will be "file". ...
... language doesn't use spaces as word separator. this is controled by "intl.menuitems.insertseparatorbeforeaccesskeys" pref value. if the value is "true" (string), a spece will be inserted before accesskey text. don't change the pref value from your xul applications too. don't include accesskey text in labels xul applications should use dtd for localizable ui resource. at that time, accesskeys are
specified by independent entity from their label. be aware, this is very important thing. when you cannot use dtd, e.g., when you need to generate some uis dynamically, you can use .properties file or something. then, you should provide a way for specifying accesskeys which are independent from their labels. note that using '&' in label text is bad way. because japanese localizers "&cancel" need to locali...
Anonymous Content - Archive of obsolete content
ent xbl can be used to automatically add a set of elements inside another element. the xul file only needs to specify the outer element while the inner elements are described in the xbl. this is useful for creating a single widget that is made up of a set of other widgets, but can be referred to as only a single widget. mechanisms are provided for adding attributes to the inner elements that were
specified on the outer element. declaring scrollbar example the example below shows how a scrollbar might be declared (it has been simplified a bit from the real thing): <bindings xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <binding id="scrollbarbinding"> <content> <xul:scrollbarbutton type="decrement"/> <xul:slid...
...up> </menu> css: menu.dropbox { -moz-binding: url('chrome://example/skin/example.xml#dropbox'); } xbl: <binding id="dropbox"> <content> <children/> <xul:textbox flex="1"/> <xul:button src="chrome://global/skin/images/dropbox.jpg"/> </content> </binding> this example creates an input field with a button beside it. the menupopup will be added to the content in the location
specified by the children element. note that to dom functions, the content will appear as it was in the xul file, so the menupopup will be a child of the menu. the xbl content is hidden away so the xul developer doesn't need to even know it is there. the resulting content would be: <menu class="dropbox"> <menupopup> <menuitem label="1000"/> <menuitem label="2000"/> </menupopup> <textbox flex=...
Box Objects - Archive of obsolete content
e box object dimensions will update accordingly. the following example shows this. example 1 : source view <button label="click me" oncommand="alert('the width is ' + this.boxobject.width);"/> you can use the width and height attributes of the element to specify the element's width and height, respectively. note that retrieving these values will return the size only if it was explicitly
specified. these properties will return an empty string if the width or height attributes or properties were not set already. that is, you cannot get the current size with these properties; instead you must use the box object properties. this may be a bit confusing, but, the key is to remember that the width and height properties on an element return the size that was set in the xul while the width and hei...
...nt may be used to specify the ordinal group of the element, or you can use the css property -moz-box-ordinal-group. elements with a lower ordinal value are placed in the box before elements with a higher ordinal value. for example, if one element has an ordinal of 2, it would be placed before an element with ordinal 3 or higher but after one with ordinal 1. the default value if the ordinal is not
specified is 1. this means that if you want to change the displayed order of elements, you will often need to adjust the ordinals of several elements. adjusting the ordinal of an element is not commonly done as you would usually just place the elements in a different order in the source. it might be used to rearrange items later without adjusting the dom. the following example demonstrates this. example 4 ...
Content Panels - Archive of obsolete content
rc="http://www.mozilla.org" flex="1" /> as with the iframe, you can specify the url in a browser using the src attribute. for a tabbrowser, you cannot set the url directly like this, as it doesn't display just one url. instead, you must use a script and call the loaduri function. there are three classes of browser, depending on the kind of content that you want to display inside. the type may be
specified using the type attribute. the first type is the default and is used if you don't specify a type. in this case, the content loaded inside the browser is treated as if it was part of the same application and has access to the outer window. that means that when a script loaded inside the browser tries to get the topmost window, it will get the outer xul window. this would be suitable for a child xul...
...loads a web page. instead, you would want to restrict the web page to only getting access to the web page content. you might note that a mozilla browser window has xul content for the toolbars and statusbar and so forth with a tabbrowser forming the main area. this inner area displays a web page, but the web page cannot access the xul around it. this is because it uses the second type of browser,
specified by setting the type attribute to the value content. this prevents the content from traversing up to the xul window. an example: <browser src="http://www.mozilla.org" type="content" flex="1" /> important: you must set the type attribute correctly if you are going to be displaying remote web sites inside the browser element. the tabbrowser sets the content type automatically on all tabbed brows...
Creating a Window - Archive of obsolete content
ces.xul", "bmarks", "chrome,width=600,height=300"); you can test lines of javascript like these in the error console. choose tools – error console, type a line of javascript, and press the evaluate button, or the return or enter key. the findfile.xul example let's begin by creating the basic file for the find file dialog. create a file called findfile.xul and put it in the content directory
specified in the findfile.manifest file (we've created in the previous section). add the xul template shown at the top of this page to the file and save it. you can use the command-line parameter '-chrome' to specify the xul file to open when mozilla starts. if this is not
specified, the default window will open. (usually the browser window.) for example, we could open the find files dialog with either o...
...w appear. we'll add some elements in the next section. to see the effect though, the following will open the bookmarks window: mozilla -chrome chrome://communicator/content/bookmarks/bookmarksmanager.xul if you are using firefox, try below. firefox -chrome chrome://browser/content/places/places.xul the '-chrome' argument doesn't give the file any additional privileges. instead, it causes the
specified file to open as a top-level window without any browser chrome, such as the address field or menu. only chrome urls have additional privileges. the extension developer's extension contains an xul editor that allows you to type in xul code and see the results in real-time from within mozilla! troubleshooting if the xul window fails to show up on the desktop but has an icon on the desktop tool ...
Features of a Window - Archive of obsolete content
« previousnext » we've already seen some features of windows. we'll look at some more in this section. creating another window you can create a second window for your application in the same manner as you would create the first one. just create a second xul file with the window code in it. as in html, you can use the window interface's open() method loads the
specified resource into the browsing context (window, <iframe> or tab) with the
specified name. if the name doesn't exist, then a new window is opened and the
specified resource is loaded into its browsing context.">window.open() function to open the second window. this function will return a reference to the newly opened window. you can use this reference to call functions of the other window. the open function takes three argument...
...that opened it. if the window that opened the new window is moved, the new window is moved relative to it. dialog the window is a dialog box, which may appear differently. modal the dialog is modal. the window that opened the modal window can't be interacted with until the modal window is closed. resizable the user can resize the window. see also window interface's open() method loads the
specified resource into the browsing context (window, <iframe> or tab) with the
specified name. if the name doesn't exist, then a new window is opened and the
specified resource is loaded into its browsing context.">window.open() next, we'll look at how to open secondary dialogs. « previousnext » ...
Keyboard Shortcuts - Archive of obsolete content
every platform. here are some additional examples: <keyset> <key id="copy-key" modifiers="control" key="c"/> <key id="explore-key" modifiers="control alt" key="e"/> <key id="paste-key" modifiers="accel" key="v"/> </keyset> keycode attribute the key attribute is used to specify the key that must be pressed. however, there will also be cases where you want to refer to keys that cannot be
specified with a character (such as the enter key or the function keys). the key attribute can only be used for printable characters. another attribute, keycode can be used for non-printable characters. the keycode attribute should be set to a special code which represents the key you want. a table of the keys is listed below. not all of the keys are available on all keyboards. vk_cancel vk_b...
...d out how we can use them. there are two ways. the first way is the simplest and just requires that you use the command event handler on the key element. when the user presses the key, the script will be invoked. an example is shown below: <keyset> <key id="copy-key" modifiers="accel" key="c" oncommand="docopy();"/> </keyset> the function docopy will be called when the user presses the keys
specified by the key element, which in this example, are the keys for copying to the clipboard (such as control + c). this will work as long as the window is open. the docopy function should check to see if text is selected and then copy the text to the clipboard. note that textboxes have the clipboard shortcuts built-in so you don't have to implement them yourself. assigning a keyboard shortcut on a menu...
Simple Menu Bars - Archive of obsolete content
s disabled. although you can, there's rarely a need to disable an entire menu. this attribute can be set to either true or false. of course, the latter is the default. accesskey this is the key that the user can press to activate the menu item. this letter is typically shown underlined on the menu title. mozilla will look at the label attribute and add an underline character to the character
specified here. for that reason, you should specify a character that exists in the text (although the key will still work if it doesn't). the menu element is normally placed on a menubar, although it does not have to be. however, it will be given a different look. the image here shows what the earlier example would look like without the menu bar. menupopup element the menupopup element creates the po...
.... disabled this boolean attribute determines whether the menu item is disabled. this attribute can be set to either true or false where the latter is the default. accesskey this is the key that the user can press to activate the menu item. this letter is typically shown underlined on the menu title. mozilla will look at the label attribute and add an underline character to the character
specified here. for that reason, you should specify a character that exists in the text. acceltext this specifies the shortcut key text to appear next to the menu command text. it does not associate a key action with the menuitem however. we'll look at how to do this later. menuseparator element the menuseparator has no special attributes. it just creates a horizontal bar between the menuitems next...
Skinning XUL Files by Hand - Archive of obsolete content
the different types of style definitions described above. each type uses a different grouping of elements. in the first definition, the selector "toolbar.nav-bar" is used to define style information for all xul toolbars of the class "nav-bar." unlike an id -- which is also often used as a selector but must be unique -- a class attribute can be used on multiple xul elements you want to pick up the
specified style information. a toolbar elements defined as: <toolbar class="nav-bar" id="nav3"> <toolbarbutton label="click me" /> <toolbarbutton label="don't click me" /> ... </toolbar> will be styled with the css rules that appear in the block after the toolbar.nav-bar selector in the css example above. similarly, the next item uses the id selector to apply style information to a single xul elem...
...cument, there can only be a single element with the id "navbar", and it will pick up the style information in the block. the third type of selector, thepseudo-class, is one you may have seen in the in-line style definitions for hyperlinks which commonly appear in html documents. the pseudo-class is connected to an element (or not: you can also define styles that apply to any element in the state
specified by a pseudo-class) with the ":" character. in this third type of style definition, the "a" element picks up the style information defined in the block only when it is, as a link, active. this last type is new to css2. to start creating the xul skin: add the stylesheet processing instruction to the top of your xul file. <?xml-stylesheet href="sample.css" type="text/css"?> create a new te...
Splitters - Archive of obsolete content
grippy is clicked on, the first frame would disappear and the splitter and the remaining frames would shuffle to the left. the splitter grippy is drawn centered inside the splitter. the splitter has been given a resizeafter value of farthest. this means that when the splitter is dragged, the farthest element after it will change size. in this case, frame 4 will change size. a value has not been
specified for resizebefore so it will default to a value of closest. in this case, there is only one frame before the splitter, so frame 1 will change size. frames 2 and 3 will only change size if you drag the splitter far enough to the right that frame 4 has reached its minimum size. this image shows the 4 panels with the splitter in a collapsed state. this image shows the 4 panels with the splitte...
...just see part of the fourth panel. if you continue to drag the splitter to the right, the other two panels will shrink. you can use the style properties such as min-width, max-height on the iframes to specify minimum or maximum widths or heights in the box. if you do, the splitter will detect this and not allow the user to drag the splitter past the minimum and maximum sizes. for example, if you
specified a minimum width of 30 pixels on panel 4 above, it would not shrink below that size. the other two panels would have to shrink. if you set the minimum width of panel 1 to 50 pixels, you would only be able to drag the splitter 10 pixels to the left (as it starts at 60 pixels wide). you can still collapse the splitter however. you can also place more than one splitter in a box if you want, in which...
The Chrome URL - Archive of obsolete content
at is part of a skin by replacing 'content' with 'skin' and changing the filename. similarly, you can point to a file that is part of a locale by using 'locale' instead of 'content'. when you open a chrome url, mozilla looks through its list of installed packages and tries to locate the jar file or directory that matches the package name and part. the mapping between chrome urls and jar files are
specified in the manifest files stored in the chrome directory. if you were to move the file messenger.jar somewhere else and update the manifest file accordingly, thunderbird will still work since it doesn't rely on its specific installed location. by using chrome urls we can leave details like this to mozilla. similarly, if the user changes their theme, the 'skin' part of the chrome url translates to a d...
...l bar in a firefox browser window. if you enter the url mentioned above into the browser's address bar, you should see that window appear like a web page might do and for the most part will function as if it was a separate window. some dialog boxes may not work right, however, as they may be expecting arguments to be supplied from the window that opened them. you will also see chrome urls without
specified filenames, such as: chrome://browser/content/ in this case, only the package name and part is
specified. this type of reference will automatically select an appropriate file from that right directory. for content, a file with the same name of the package and a xul extension is selected. in the above example, the file browser.xul is selected. for messenger, messenger.xul would be selected. when c...
XBL Example - Archive of obsolete content
ttons will display the current page. you could put anything within the pages, however, this widget might be useful for a set of images. we'll call this a slideshow element. content of the slideshow first, let's determine what elements need to go in the xbl content. because we want page flipping, a deck element would be the most suitable to hold the page content. the content of the pages will be
specified in the xul file, not in xbl, but we'll need to add it inside the deck. the children tag will need to be used. along the bottom, we'll need a button to go the previous page, a label to display the current page number, and a button to go to the next page. example 1 : source <binding id="slideshow"> <content> <xul:vbox flex="1"> <xul:deck xbl:inherits="selectedindex" selectedindex="0" ...
...lt 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 deck. the label widget has not appeared as no value has been
specified for it. we could set a value, but instead it will calculated later. page property next, a property that holds the current page will be added. when getting this custom property, it will need to retrieve the value of the selectedindex attribute of the deck, which holds the number of the currently displayed page. similarly, when setting this property, it will need to change the selectedindex attri...
XULBrowserWindow - Archive of obsolete content
hidechromeforlocation(in string alocation); attributes attribute type description incontentwhitelist string[] an array of url strings for which chrome is automatically hidden. defaults to about:addons but extensions can append specific urls to the array. methods hidechromeforlocation determines whether or not browser chrome should be hidden for the
specified location. by default, chrome is hidden for about:addons and any other pages in the in content whitelist. you can augment the functionality of this method using chaining in order to hide chrome for other locations. see hiding browser chrome for details and an example. boolean hidechromeforlocation( in string alocation ); parameters alocation the url to check to see if chrome should be hid...
... ...
checkbox - Archive of obsolete content
more information is available in the xul tutorial. ...
...t instead of getattribute(). for buttons, the type attribute must be set to checkbox or radio for this attribute to have any effect. command type: id set to the id of a command element that is being observed by the element. crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side
specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales. end the text will be cropped on its right side in left-to-right text ...
commandset - Archive of obsolete content
ally, this is used to update menu commands such as undo and cut based on when an event occurs. for example, since the cut command is only valid when something is selected, a command updater might be used when the select event occurs. events type: comma-separated list a comma-separated list of event names that the command updater will update upon. if this attribute is not
specified, or you set it to the value '*', all events are valid. valid events are listed below, or you can use your own events. you can send a custom event by calling the updatecommands method of the command dispatcher. focus: occurs when the focused element changes. select: occurs when the selected text changed. clipboard: occurs when the clipboard is changed. undo: occurs whe...
...o: occurs when the undo buffer is changed. oncommandupdate type: script code this event occurs when a command update occurs. you would use this to update the disabled status of items. targets type: comma-separated list of element ids a comma-separated list of element ids that the command updater will update upon. if this attribute is not
specified, or you set it to the value '*', all elements are valid. the command update will only occur when the event occurs to one of the
specified elements. properties inherited properties align, , allowevents, , boxobject, builder, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheig...
key - Archive of obsolete content
hift key. alt: the alt key. on the macintosh, this is the option key. on macintosh this can only be used in conjunction with another modifier, since alt+letter combinations are reserved for entering special characters in text. meta: the meta key. on the macintosh, this is the command key. control: the control key. os: windows logo key on windows, super or hyper key on linux. this shouldn't be
specified directly because it may conflict with system wide shortcut key. accel: the key used for keyboard shortcuts on the user's platform, which is control on windows and linux, and command on mac. usually, this would be the value you would use. access: the access key for activating menus and other elements. on windows, this is the alt key, used in conjuction with an element's accesskey. any: indicat...
...y be pressed, place the word 'any' after listing the optional modifier key. for example: <key key="r" modifiers="shift any control"/> in this example, the shift key may or may not be pressed, while the control key must be pressed. this allows keys to match more loosely for modifier keys that aren't relevant, yet still allows specific modifiers to be required. if the modifiers attribute is not
specified, then no modifiers may be pressed for the key to match. if neither the key or keycode attribute are used, the key element will handle all key events. however, if one of the attributes is set to an empty string, the element doesn't handle any key events. for example: <!-- this element handles all key events --> <key/> <!-- these elements don't handle any key events --> <key key="" modifiers="co...
label - Archive of obsolete content
more information is available in the xul tutorial. ...
...pears in the label attribute for the element. control type: id this attribute specifies the id of the element with which the label is associated. when the user clicks on the label, the associated element is given focus. crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side
specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales. end the text will be cropped on its right side in left-to-right text ...
listitem - Archive of obsolete content
by default it contains a single listcell element of type and class appropriate to that of the listitem. more information is available in the xul tutorial. ...
...set instead of getattribute(). for buttons, the type attribute must be set to checkbox or radio for this attribute to have any effect. command type: id set to the id of a command element that is being observed by the element. crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side
specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales. end the text will be cropped on its right side in left-to-right text ...
preference - Archive of obsolete content
the containing preferences element. readonly type: boolean if set to true, then the user cannot modify the value of the element. tabindex type: integer gets and sets the value of the tabindex attribute. type type: string gets and sets the value of the type attribute. value gets and sets the value of the user preference
specified in name. in pref dialogs with instantapply == true (default on mac os x) this value is kept in sync with the actual value stored in the preferences (see valuefrompreferences). when instantapply is off (default on windows), this gets and sets the current value of the preference in the currently open dialog. there's a special case of value === undefined, indicating that the preference does not h...
...s gets and sets the current value of the preference in the currently open dialog. there's a special case of value === undefined, indicating that the preference does not have a user-set value (hasuservalue == false). in this case the actual value to be displayed in the ui is obtained from the defaultvalue property. valuefrompreferences gets and sets the value stored in the user preference,
specified in name. (this always accesses the nsiprefbranch apis regardless of the instantapply mode in effect). methods reset() return type: no return value resets the preference to its default value. for a textbox it also clears the undo transaction list (gecko 1.9). type getelementvalue(in domelement element); retrieves the value that should be written to preferences ...
preferences - Archive of obsolete content
see also the description of change event of <preference>. void observe(in nsisupports asubject, in string atopic, in wstring adata); nsiobserver method used internally to react to changes to preferences listed as children of this element. inherited methods addeventlistener(), appendchild(), blur, clic...
... height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods void firechangedevent(in domelement preference); creates and dispatches a changed (non-bubbling) event to the
specified preference element. also executes code
specified in onchanged attribute of the element. see also the description of change event of <preference>. void observe(in nsisupports asubject, in string atopic, in wstring adata); nsiobserver method used internally to react to changes to preferences listed as children of this element. inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatch...
prefpane - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a single preference panel in a prefwindow. a prefpane is made up of two parts, the preferences descriptions, which specify the set of preferences that will be modified, and the user interface for adjusting those preferences. the former is
specified using a preferences element while the latter may be
specified using other xul elements. both may be
specified directly as children of the prefpane element, or the src attribute may be used to put a pane in a separate file. in this latter case, the separate file should use an overlay tag as its root tag since it will be loaded as an overlay to the main preferences window. more information is available in the preferences system article. attributes...
... code defined here is called when the pane has been loaded, much like the load event for a window. selected type: boolean this attribute will be set to true for the currently selected prefpane. to change the selected pane, use the prefwindow's showpane method. src type: uri the uri of the overlay contents of preference pane. if this is not
specified, the contents of the prefpane element is used. properties contentheight (readonly) the height (in pixels) of current pane's content. image type: image url gets and sets the value of the image attribute. label type: string gets and sets the value of the label attribute. loaded indicates whether the pane is fully load...
radio - Archive of obsolete content
examples | attributes | properties | methods | related ] an element that can be turned on and off. radio buttons are almost always listed together in groups. only one radio button within the same radiogroup may be selected at a time. the user can switch which radio button is turned on by selecting it with the mouse or keyboard. other radio buttons in the same group are turned off. a label,
specified with the label attribute may be added beside the radio button. more information is available in the xul tutorial. attributes accesskey, command, crop, disabled, focused, group, image, label, selected, tabindex, value properties accesskey, accessibletype, control, crop, disabled, image, label, radiogroup, selected, tabindex, value examples <radiogroup> <radio id="orange" label="re...
...cter that is used as a shortcut key. this should be one of the characters that appears in the label attribute for the element. command type: id set to the id of a command element that is being observed by the element. crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side
specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales. end the text will be cropped on its right side in left-to-right text ...
radiogroup - Archive of obsolete content
returns the newly created element. checkadjacentelement( dir ) return type: no return value deselects the currently selected radio button in the group and selects the one adjacent to it. if the argument dir is true, the next radio button is selected. if it is false, the previous radio button is selected. getindexofitem( item ) return type: integer returns the zero-based position of the
specified item. items are numbered starting at the first item displayed in the list. getitematindex( index ) return type: element returns the element that is at the
specified index. insertitemat( index, label, value ) return type: element this method creates a new item and inserts it at the
specified position. you may optionally set a value. the new item element is returned. ...
...the method returns the removed item. ...
rule - Archive of obsolete content
ings to be used. when no query element is used in a template, a default query is used and the simple query syntax may be used for rdf datasources. for more information about this, see the simple query syntax. attributes iscontainer, isempty, parent, parsetype examples (example needed) attributes iscontainer type: boolean indicates whether rules match based on containment. ...
... true: the rule will only match nodes that contain no child elements. false: the rule will only match nodes that contain one or more child elements. parent type: element tag name if set, the rule will only match the corresponding tag. ...
scale - Archive of obsolete content
ecify the orientation of the scale. the default value is horizontal which displays a horizontal scale. lower values are to the left and higher values are to the right. set the orient attribute to vertical to use a vertical scale. the user may use the arrow keys to increment and decrement the value by one unit, or the page up and page down keys to increment and decrement the value by one page, as
specified by the pageincrement attribute. the home and end keys set the scale's value to the minimum and maximum values, respectively. a scale will fire a change event whenever the scale's value is modified. attributes dir, disabled, increment, max, min, movetoclick, pageincrement, tabindex, value properties disabled, max, min, increment, pageincrement, tabindex, value, methods decrease, decr...
...lt 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 infinity 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 value attribute changes when the tray of the scroll bar (the area in which the scroll bar thumb moves) is clicked, or when the page up or page down keys are pressed. the default value is 10. tabindex type: integer the tab order of the element. th...
splitter - Archive of obsolete content
it. the vbox is used to hold the .png image that a user clicks on to resize the search bar.--> <splitter tooltiptext="resize the search box" oncommand="alert('the splitter was dragged')"> <vbox id="example_vbox" /> </splitter> attributes collapse type: one of the values below determines which side of the splitter is collapsed when its grippy is clicked. if this attribute is not
specified, the splitter will not cause a collapse. you should put a grippy element inside the splitter when it is used for collapsing. none no collapsing occurs. before when the grippy is clicked, the element immediately before the splitter in the same parent is collapsed so that its width or height is 0. after when the grippy is clicked, the element immediately after the splitter in the sa...
... for: <vbox></vbox> <splitter/> <vbox></vbox> ...the splitter will not move, unless there is a collapse attribute on the splitter, which will cause it to collapse as soon as it is dragged. for: <vbox/> <splitter/>...
tabs - Archive of obsolete content
rgument is true, the adjustment will wrap around when the first or last tab is reached. appenditem( label, value ) return type: element creates a new item and adds it to the end of the existing list of items. you may optionally set a value. the function returns the newly created element. getindexofitem( item ) return type: integer returns the zero-based position of the
specified item. items are numbered starting at the first item displayed in the list. getitematindex( index ) return type: element returns the element that is at the
specified index. insertitemat( index, label, value ) return type: element this method creates a new item and inserts it at the
specified position. you may optionally set a value. the new item element is returned. ...
...the method returns the removed item. related elements tabbox, tab, tabpanels, tabpanel. ...
tree - Archive of obsolete content
xul reference home [ examples | attributes | properties | methods | related ] a container which can be used to hold a tabular or hierarchical set of rows of elements. the tree may contain any number of rows and any number of columns. each row of the tree may contain child rows which are displayed indented from the parent. unlike other elements, the data to display inside the tree is not
specified using tags, but is determined from a view object. the view object implements the nsitreeview interface. the view is queried for the data to appear in the tree. there are several ways in which trees are used, as listed below. the second column lists the interfaces available via the tree's view property. the third column indicates whether treeitem element are used. if you would like to allow the t...
...the tree view's nsitreeview.getcelltext() method is called to obtain the cell contents. stopediting( shouldaccept ) return type: no return value stops editing the cell currently being edited. if the shouldaccept parameter is true, the cell's label is changed to the edited value (the tree view's nsitreeview.setcelltext() method...
treecol - Archive of obsolete content
kbox/cbox-check.gif"); } for example: create a css file. copy and paste the code above and link the css file to your xul file. reload the page to see the checkbox. if you want, you can also style the tree using css. attributes crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side
specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales. end the text will be cropped on its right side in left-to-right text ...
... the tree must also be marked as editable in order for this to work. individual treecell elements in the column may be marked editable="false" in order to disable editing. fixed type: boolean if true, the size of the column in the tree cannot be adjusted by the user. any splitter to either side will resize those columns while keeping the fixed column at a constant size. if false or not
specified, the user can adjust the size of the column, typically by dragging the column header with the mouse. hidden type: boolean if set to true, the element is not displayed. this is similar to setting the css display property to 'none'. hideheader type: boolean set this to true to indicate that the tree column header should be displayed without any column header styling. if you don't ...
XULRunner tips - Archive of obsolete content
lse); 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 -app path/to/application.ini on the mac: /applications/firefox.app/contents/macos/firefox-bin -app /path/to/application.ini note that at least on the mac, you need to use a full path. partial paths don't seem to work. troubleshooting window title missing if the...
...windows: firefox.exe -app path\to\application.ini on linux: firefox -app path/to/application.ini on the mac: /applications/firefox.app/contents/macos/firefox-bin -app /path/to/application.ini note that at least on the mac, you need to use a full path. partial paths don't seem to work. troubleshooting window title missing if the title of your xul <window> is blank, even though you
specified a title attribute, make sure the extension on your xul file is .xul rather than .xml default theme to create a default theme you need to create a folder in the extensions folder with an install.rdf in it. as of oct. 2008, the folder needs to have the same name as the one in firefox 3.0. \myapp\extensions{972ce4c6-7e08-4474-a285-3208198ce6fd}\install.rdf it should also have an <em:internalna...
toolkit.singletonWindowType - Archive of obsolete content
<window windowtype="xulmine"> in our example). if such a window is found, it will be re-used, otherwise a new window will be opened. more information on this can be found in bug 317811. ...
...<window windowtype="xulmine"> in our example). if such a window is found, it will be re-used, otherwise a new window will be opened. more information on this can be found in bug 317811. ...
NPByteRange - Archive of obsolete content
et = from the end */ uint32 length; struct _npbyterange* next; } npbyterange; fields the data structure has the following fields: offset offset in bytes to the start of the requested range. this value may be either positive or negative: positive value: offset from the beginning of the stream. negative value: offset from the end of the stream. ...
...the plug-in is responsible for deleting npbyterange objects when finished with them. the browser makes a copy if it needs to keep the objects beyond the call to npn_requestread(). ...
NPN_InvalidateRegion - Archive of obsolete content
description before a windowless plug-in can repaint or refresh part of its drawing area, the plug-in must first invalidate the area with either npn_invalidaterect() or npn_invalidateregion(). ...
... description before a windowless plug-in can repaint or refresh part of its drawing area, the plug-in must first invalidate the area with either npn_invalidaterect() or npn_invalidateregion(). ...
NPN_PostURL - Archive of obsolete content
ence « plug-in side plug-in api summary posts data to a url. syntax #include <npapi.h> nperror npn_posturl(npp instance, const char *url, const char *target, uint32 len, const char *buf, npbool file); parameters the function has the following parameters: instance pointer to the current plug-in instance. url url of the request,
specified by the plug-in. target display target,
specified by the plug-in. if null, pass the new stream back to the current plug-in instance regardless of mime type. for values, see npn_geturl. len length of the buffer buf. buf path to local temporary file or data buffer that contains the data to post. temporary file is deleted after use. data in buffer cannot be p...
...or values, see npn_geturl. len length of the buffer buf. buf path to local temporary file or data buffer that contains the data to post. temporary file is deleted after use. data in buffer cannot be posted for a protocol that requires a header. file a boolean value that specifies whether to post a file. values: true: post the file whose path is
specified in buf, then delete the file. false: post the raw data in buf. 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 npn_posturl works similarly to npn_geturl, but in reverse. npn_geturl reads data from the url and either displays it in...
NPN_PostURLNotify - Archive of obsolete content
for values, see npn_geturl. len length of the buffer buf. buf path to local temporary file or data buffer that contains the data to post. file whether to post a file. values: true: post the local fil...
... const char* target, uint32 len, const char* buf, npbool file, void* notifydata); parameters the function has the following parameters: instance current plug-in instance,
specified by the plug-in. url url of the post request,
specified by the plug-in. target target window,
specified by the plug-in. for values, see npn_geturl. len length of the buffer buf. buf path to local temporary file or data buffer that contains the data to post. file whether to post a file. values: true: post the local file whose path is
specified in buf, then delete the file. false: ...
NPP_Write - Archive of obsolete content
e instance). if the return value is smaller than the size of the buffer, the browser sends the remaining data to the plug-in through subsequent calls to npp_writeready and npp_write. if unsuccessful, the function signals an error by returning a negative value. the browser will destroy the stream by calling npp_destroystream. description the browser calls the npp_write function to deliver the data
specified in a previous npp_writeready call to the plug-in. a plug-in must consume at least as many bytes as indicated in the npp_writeready call. after a stream is created by a call to npp_newstream, the browser calls npp_write either: if the plug-in requested a normal-mode stream, the data in the stream is delivered to the plug-in instance in a series of calls to npp_writeready and npp_write. if the plu...
...as many bytes as indicated in the npp_writeready call. after a stream is created by a call to npp_newstream, the browser calls npp_write either: if the plug-in requested a normal-mode stream, the data in the stream is delivered to the plug-in instance in a series of calls to npp_writeready and npp_write. if the plug-in requested a seekable stream, the npn_requestread function requests reads of a
specified byte range that results in a series of calls to npp_writeready and npp_write. the plug-in can use the offset parameter to track the bytes that are written. this gives you different information depending in the type of stream. in a normal-mode stream., the parameter value increases as the each buffer is written. the buf parameter is not persistent, so the plug-in must process data immediately or ...
Using IO Timeout And Interrupt On NT - Archive of obsolete content
riptor must be closed before the thread exits. in this memo we explain the problem this guideline is trying to work around and discuss its limitations. nspr io on nt the io model of nspr 2.0 is synchronous and blocking. a thread calling an io function is blocked until the io operation finishes, either due to a successful io completion or an error. if the io operation cannot complete before the
specified timeout, the io function returns with <tt>pr_io_timeout_error</tt>. if the thread gets interrupted by another thread's <tt>pr_interrupt()</tt> call, the io function returns with <tt>pr_pending_interrupt_error</tt>. on windows nt, nspr io is implemented using nt's overlapped (also called asynchronous) io. when a thread calls an io function, the thread issues an overlapped io request using the over...
...toring the io completion port for completed io requests. if a completed io request appears at the io completion port, an idle thread fetches it and wakes up the thread that issued the io request earlier. this is the normal way the thread is awakened. io timeout and interrupt however, nspr may wake up the thread in two other situations: if the overlapped io request is not completed before the
specified timeout. (note that we can't specify timeout on overlapped io requests, so the timeouts are all handled at the nspr level.) in this case, the error is <tt>pr_io_timeout_error</tt>. if the thread gets interrupted by another thread's <tt>pr_interrupt()</tt> call. in this case, the error is <tt>pr_pending_interrupt_error</tt>. these two errors are generated by the nspr layer, so the os is obliviou...
-moz-border-bottom-colors - Archive of obsolete content
order. /* single <color> value */ -moz-border-bottom-colors: #f0f0f0; /* multiple <color> values */ -moz-border-bottom-colors: #f0f0f0 #a0a0a0 #505050 #000000; /* global values */ -moz-border-bottom-colors: inherit; -moz-border-bottom-colors: initial; -moz-border-bottom-colors: unset; when an element has a border that is larger than a single css pixel, each line of pixels uses the next color
specified in this property, from the outside in. this eliminates the need for nested boxes. if the border is wider than the number of
specified colors, the remaining part of the border is the innermost color
specified. initial valuenoneapplies toall elementsinheritednocomputed valueas
specifiedanimation typediscrete it does not apply if border-style is dashed or dotted. to tables with border-collapse...
...fiedanimation typediscrete it does not apply if border-style is dashed or dotted. 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. see <color> values for possible units. none default, no colors are drawn or border-color is used, if
specified. formal syntax <color>+ | nonewhere <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? )...
-moz-border-left-colors - Archive of obsolete content
the left border. /* single <color> value */ -moz-border-left-colors: #f0f0f0; /* multiple <color> values */ -moz-border-left-colors: #f0f0f0 #a0a0a0 #505050 #000000; /* global values */ -moz-border-left-colors: inherit; -moz-border-left-colors: initial; -moz-border-left-colors: unset; when an element has a border that is larger than a single css pixel, each line of pixels uses the next color
specified in this property, from the outside in. this eliminates the need for nested boxes. if the border is wider than the number of
specified colors, the remaining part of the border is the innermost color
specified. initial valuenoneapplies toall elementsinheritednocomputed valueas
specifiedanimation typediscrete it does not apply if border-style is dashed or dotted. to tables with border-collapse...
...cifiedanimation typediscrete it does not apply if border-style is dashed or dotted. 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. see <color> values for possible units. none default, no colors are drawn or border-color is used, if
specified. formal syntax <color>+ | nonewhere <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? )...
-moz-border-right-colors - Archive of obsolete content
ght border. /* single <color> value */ -moz-border-right-colors: #f0f0f0; /* multiple <color> values */ -moz-border-right-colors: #f0f0f0 #a0a0a0 #505050 #000000; /* global values */ -moz-border-right-colors: inherit; -moz-border-right-colors: initial; -moz-border-right-colors: unset; when an element has a border that is larger than a single css pixel, each line of pixels uses the next color
specified in this property, from the outside in. this eliminates the need for nested boxes. if the border is wider than the number of
specified colors, the remaining part of the border is the innermost color
specified. initial valuenoneapplies toall elementsinheritednocomputed valueas
specifiedanimation typediscrete it does not apply if border-style is dashed or dotted. to tables with border-collapse...
...ifiedanimation typediscrete it does not apply if border-style is dashed or dotted. 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. see <color> values for possible units. none default, no colors are drawn or border-color is used, if
specified. formal syntax <color>+ | nonewhere <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? )...
-moz-border-top-colors - Archive of obsolete content
s for the top border. /* single <color> value */ -moz-border-top-colors: #f0f0f0; /* multiple <color> values */ -moz-border-top-colors: #f0f0f0 #a0a0a0 #505050 #000000; /* global values */ -moz-border-top-colors: inherit; -moz-border-top-colors: initial; -moz-border-top-colors: unset; when an element has a border that is larger than a single css pixel, each line of pixels uses the next color
specified in this property, from the outside in. this eliminates the need for nested boxes. if the border is wider than the number of
specified colors, the remaining part of the border is the innermost color
specified. initial valuenoneapplies toall elementsinheritednocomputed valueas
specifiedanimation typediscrete it does not apply if border-style is dashed or dotted. to tables with border-collapse...
...ecifiedanimation typediscrete it does not apply if border-style is dashed or dotted. 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. see <color> values for possible units. none default, no colors are drawn or border-color is used, if
specified. formal syntax <color>+ | nonewhere <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? )...
-ms-content-zoom-snap-points - Archive of obsolete content
the first percentage specifies where the first snap-point will be placed. ...
... the first percentage specifies where the first snap-point will be placed. the second percentage specifies the distance between subsequent snap-points, both zoomed in and zoomed out from the initial snap-point. snaplist( <percentage># ) specifies the position of individual snap-points as a comma-separated list of percentages, each of which represents a zoom factor. if any value
specified is less than that
specified by the -ms-content-zoom-limit-min property, the value of -ms-content-zoom-limit-min is used. if any value
specified is greater than that
specified by the -ms-content-zoom-limit-max property, the value of -ms-content-zoom-limit-max is used. formal syntax snapinterval( <percentage>, <percentage> ) | snaplist( <percentage># ) examples this example demonstrat...
-ms-scroll-limit - Archive of obsolete content
-scroll-limit-x-max, and -ms-scroll-limit-y-max properties. initial valueas each of the properties of the shorthand:-ms-scroll-limit-x-min: 0-ms-scroll-limit-y-min: 0-ms-scroll-limit-x-max: auto-ms-scroll-limit-y-max: autoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas each of the properties of the shorthand:-ms-scroll-limit-x-min: as
specified-ms-scroll-limit-y-min: as
specified-ms-scroll-limit-x-max: as
specified-ms-scroll-limit-y-max: as
specifiedanimation typediscrete syntax the -ms-scroll-limit property is
specified as one or more of the following scroll limit values, in the order listed, separated by spaces. values -ms-scroll-limit-x-min the value of the -ms-scroll-limit-x-min property. -ms-scroll-limit-y-min the va...
...scroll-limit-x-max the value of the -ms-scroll-limit-x-max property. -ms-scroll-limit-y-max the value of the -ms-scroll-limit-y-max property. formal syntax <'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'> specifications not part of any specification. remarks this property has no effect on non-scrollable elements. the
specified behavior of the -ms-scroll-limit property is only applicable at a mscontentzoomfactor of 1; the behavior of this property is undefined at other zoom factors. this property requires windows 8 or later. ...
-ms-scroll-translation - Archive of obsolete content
none no scroll wheel translation takes place. inherit the initial value. the value is inherited from the element's parent element. ...
... none no scroll wheel translation takes place. inherit the initial value. the value is inherited from the element's parent element. ...
Processing XML with E4X - Archive of obsolete content
> </languages>; var lang = languages.lang; alert(lang.length()); // alerts 2 languages.lang += <lang>ruby</lang>; alert(lang.length()); // still alerts 2 lang = languages.lang; // re-create the xmllist alert(lang.length()); // alerts 3 searching and filtering e4x provides special operators for selecting nodes within a document that match specific criteria. ...
...lter operations are
specified using an expression contained in parentheses: var html = <html> <p id="p1">first paragraph</p> <p id="p2">second paragraph</p> </html>; alert(html.p.(@id == "p1")); // alerts "first paragraph" nodes matching the path before the expression (in this case the paragraph elements) are added to the scope chain before the expression is evaluated, as if they had been
specified using the with statement. consequently, filters can also run against the value of a single node contained within the current element: var people = <people> <person> <name>bob</name> <age>32</age> </person> <person> <name>joe</name> <age>46</age> </person> </people>; alert(people.person.(name == "joe").age); // alerts 46 filter expressions can even use javascript funct...
New in JavaScript 1.1 - Archive of obsolete content
s <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. constructor and prototype properties on objects added. ...
... built-in function); it evaluates a string of javascript code in the context of the
specified object. math.random() now works on every platform. tostring(): added radix parameter, which specifies the base to use for representing numeric values. isnan() now works on every platform (not only unix anymore) parsefloat() and parseint() now return nan on all platforms, if the first character of the
specified string cannot be converted to a number; in previous releases, it returned nan on solaris and irix and zero on all other platforms. ...
XForms Input Element - Archive of obsolete content
ox (see below) type restrictions the input element can be bound to a node containing simple content of any data type except xsd:base64binary, xsd:hexbinray or any data type derived from these. representations the xforms input element can be represented by the following widgets for the spcified data types (or types derived from these data types): text field - the default widget when no type is
specified or the data is of type xsd:string (xhtml/xul) checkbox - used for xsd:boolean instance data. (xhtml/xul) datepicker - used to represent data of type xsd:date (xhtml/xul) calendar - used to represent data of type xsd:date when appearance attribute also has the value 'full' (xhtml/xul) month list - used to represent data of type xsd:gmonth (xhtml only) days list - used to represent data of type xsd...
...etail about each of these widgets follows below. text field displaying a text field is the default presentation. xforms inputs are most often used when a form author needs to allow for the input/output of simple text into an instance node. allows for free-form data entry (xhtml/xul). characteristics a text field is presented to the user when there is no type given for the bound node or a type is
specified that is not handled by one of the other widgets (as documented below). analogous widgets are <xhtml:input type="text"/> and <xul:textbox/> specific handling of attributes incremental - if "true", the bound instance node will be updated on each character typed by the user. if "false", or the incremental attribute is omitted on this element then the bound instance node will be updated when the co...
XForms Message Element - Archive of obsolete content
attributes single-node binding linking src - url of a document whose contents will be retrieved by the message element and used to provide the message text for the message element. ...
... attributes single-node binding linking src - url of a document whose contents will be retrieved by the message element and used to provide the message text for the message element. ...
XForms Output Element - Archive of obsolete content
-node binding special value - xpath expression whose evaluation result is used as the output's value. if binding attributes are present on the control then the value attribute is is ignored. type restrictions the output element can be bound to a node containing simple content of any data type. representations the xforms output element can be represented by the following widgets for the
specified data types (or types derived from these data types): text - default representation for instance data of most types, especially static text (xhtml/xul). calendar - used to represent instance data of type date (xhtml/xul). 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 (fx 3.0 only, xhtml/xul). ...
...tput element can be used in combination with the mediatype element to display the image (fx 3.0 only, xhtml/xul). text displaying the data as text is the default presentation. xforms output is most often used when a form author needs to render simple text of an instance node (xhtml/xul). characteristics text is presented to the user when there is no type given for the bound node or a type is
specified that is not handled by one of the other widgets (as documented below). analogous widgets are <xhtml:span/> and <xul:description/> calendar a form author may notice a xforms output element represented by a calendar widget in the mozilla xforms processor if the control meets the following criteria (xhtml/xul). characteristics the bound instance node is of type xsd:date or a type derived from ...
XForms Select Element - Archive of obsolete content
you can visually group these pre-defined items by using the choices (see the spec) element to contain them. note, some representations of the select element do not support visual grouping. 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. ...
...h allows the available choices to be obtained from an xforms model. the relaxation happens when the itemset element specifies the item value using a copy (see spec) element. this is because a copy element can be used to add a subtree of nodes underneath the element that the select control is bound to. representations the xforms select element can be represented by the following widgets for the
specified appearance attribute values: list - default representation (xhtml/xul) check group- used when appearance = 'full' (xhtml/xul) list displaying a listbox is the default representation (xhtml/xul). characteristics analogous widgets are <html:select size="5" multiple="true"/> and <xul:listbox seltype="multiple"/> visual grouping by choices element isn't implemented if incremental attribute ...
XForms Select1 Element - Archive of obsolete content
you can visually group these pre-defined items by using the choices (see the spec) element to contain them. note, some representations of the select1 element do not support visual grouping. 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. ...
...allows the available choices to be obtained from an xforms model. the relaxation happens when the itemset element specifies the item value using a copy (see spec) element. this is because a copy element can be used to add a subtree of nodes underneath the element that the select1 control is bound to. representations the xforms select1 element can be represented by the following widgets for the
specified appearance attribute values: combobox - default representation (xhtml/xul) listbox - used when appearance = 'compact' (xhtml/xul) radio group - used when appearance = 'full' (xhtml/xul) combobox displaying a combobox is the default representation (xhtml/xul). xhtml widget characteristics analogous widgets is <html:select/> visual grouping by choices element is supported selection="open...
XForms Submit Element - Archive of obsolete content
introduction this form control initiates a submission. 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. type restrictions the submit element can be bound to a node con...
...ons the submit element can be bound to a node containing data of any type. actually, the submit element doesn't interact with the data in the bound node. however, the relevant model item property on the bound node has an effect on a submit. if the bound node is irrelevant, then the submit will be hidden. representations the xforms submit element can be represented by the following widgets for the
specified appearance attribute values: button - default representation (xhtml/xul) link/clickable text - used when appearance = 'minimal' (xhtml only) button displaying a button is the default presentation (xhtml/xul). characteristics analogous widgets are <html:input type="submit"/> and <xul:button/> link/clickable text xforms authors can use this representation if they want to have a widget lik...
RDF in Mozilla FAQ - Archive of obsolete content
resses. } note that the observer will remain attached to the rdf/xml datasource unless removexmlsinkobserver is called. how do i access the information in a datasource? the nsirdfdatasource interface is the means by which you access and manipulate the assertions in a datasource. boolean hasassertion(asource, aproperty, atarget, atruthvalue). this tests the datasource to see if it has the
specified tuple. nsirdfnode gettarget(asource, aproperty, atruthvalue). nsisimpleenumerator gettargets(asource, aproperty, atruthvalue). nsirdfresource getsource(aproperty, atarget, atruthvalue). nsisimpleenumerator getsources(aproperty, atarget, atruthvalue). nsisimpleenumerator arclabelsin(atarget). nsisimpleenumerator arclabelsout(asource). you can also use the rdf container interfaces to access...
...emotely-loaded xul and rdf, you might need to adjust mozilla's security restrictions (see belowfor example code). if xul isn't loading your rdf, and the mimetype is ok, this could well be your problem. you can use the rdfcat and rdfpoll utilities to verify that the rdf/xml is actually valid. both of these programs are built by default on windows, and on linux when the configure --enable-tests is
specified. rdfcat url takes as a parameter a url from which to read an rdf/xml file, and will "cat" the file back to the console. you can use it to verify that the rdf/xml that you've written is being properly parsed by mozilla. rdfpoll url [interval ] takes as a parameter a url from which to read an rdf/xml file. it also accepts an optional poll interval, where it will re-load the url. it outputs ...
Using the Right Markup to Invoke Plugins - Archive of obsolete content
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" value="java 2 sdk, standard edition v1.4" /> <p>you need the java plugin. get it fro...
...or a more streamlined download. for the embed element in particular, these attributes in netscape 7 and mozilla are governed by the plugin finder service preference. under edit | preferences | navigator | helper applications is a preference to use netscape's plugin finder service. if the user has checkedalways use the netscape plugin finder service to get plugins then whether these attributes are
specified or not makes no difference -- the browser willalways consult with the plugin finder service to determine if it has a plugin to handle the missing mime type. if the preference is unchecked, the plugin finder service will be consulted only if the web page authordoes not specify either of these attributes. original document information author(s): arun k. ranganathan, netscape communications las...
Building up a basic demo with Three.js - Game development
the default value is 1. the z position, with the value of 50 units, is the distance between the camera and the center of the scene on the z axis. here we're moving the camera back, so the objects in the scene can be viewed. 50 feels about right. it's not too near, or too far, and the sizes of the objects allow them to stay on the scene, within the given field of view. the x and y values, if not
specified, will default to 0. you should experiment with these values and see how they change what you see in the scene. note: the distance values (e.g. for the camera z position) are unitless, and can be anything you deem suitable for your scene: milimeters, meters, feet, or miles. it's up to you. rendering the scene everything is ready, but we still can't see anything. although we've set-up the re...
...mber of predefined materials which can be used: basic, phong, lambert. let's play with the last two later, but for now, the basic one should be enough: var basicmaterial = new three.meshbasicmaterial({color: 0x0095dd}); add this line below the previously added. our material is now ready, what next? mesh to apply the material to a geometry, a mesh is used. this takes on a shape, and adds the
specified material to every face: var cube = new three.mesh(boxgeometry, basicmaterial); again, add this line below the one you previously added. adding the cube to the scene we've now created a cube, using the geometry and material defined earlier. the last thing to do is to place the cube to our scene. add this line below the previous one: scene.add(cube); if you save, and refresh your web browse...
Canonical order - MDN Web Docs Glossary: Definitions of Web-related terms
in css, canonical order is used to refer to the order in which separate values need to be
specified (or parsed) or are to be serialized as part of a css property value. it is defined by the formal syntax of the property and normally refers to the order in which longhand values should be
specified as part of a single shorthand value. for example, background shorthand property values are made up of several background-* longhand properties. ...
...kground shorthand property values are made up of several background-* longhand properties. the canonical order of those longhand values is defined as background-image background-position background-size background-repeat background-attachment background-origin background-clip background-color furthermore, its syntax defines, that if a value for the background-size is given, it must be
specified after the value for the background-position, separated by a slash. other values may appear in any order. learn more what does “canonical order” mean with respect to css properties? on stack overflow provides useful further discussion. the description of the formal syntax used for css values on mdn ...
IDL - MDN Web Docs Glossary: Definitions of Web-related terms
content versus idl attributes in html, most attributes have two faces: the content attribute and the idl (interface definition 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 setattribute("maxlength", "42") on that element. ...
...he type idl attribute will return the string "text". idl attributes are not always strings; for example, input.maxlength is a number (a signed long). when using idl attributes, you read or set values of the desired type, so input.maxlength is always going to return a number and when you set input.maxlength ,it wants a number. if you pass another type, it is automatically converted to a number as
specified by the standard javascript rules for type conversion. idl attributes can reflect other types such as unsigned long, urls, booleans, etc. unfortunately, there are no clear rules and the way idl attributes behave in conjunction with their corresponding content attributes depends on the attribute. most of the time, it will follow the rules laid out in the specification, but sometimes it doesn't. ht...
Backgrounds and borders - Learn web development
, the background scrolls with it. the background-attachment property only has an effect when there is content to scroll, so we've made a demo to demonstrate the differences between the three values — have a look at background-attachment.html (also see the source code here). using the background shorthand property as i mentioned at the beginning of this lesson, you will often see backgrounds
specified using the background property. this shorthand lets you set all of the different properties at once. if using multiple backgrounds, you need to specify all of the properties for the first background, then add your next background after a comma. in the example below we have a gradient with a size and position, then an image background with no-repeat and a position, then a color. there are a few r...
...rounds, you need to specify all of the properties for the first background, then add your next background after a comma. in the example below we have a gradient with a size and position, then an image background with no-repeat and a position, then a color. there are a few rules that need to be followed when writing background image shorthand values, for example: a background-color may only be
specified after the final comma. the value of background-size may only be included immediately after background-position, separated with the '/' character, like this: center/80%. take a look at the mdn page for background to see all of the considerations. accessibility considerations with backgrounds when placing text on top of a background image or color, you should take care that you have enough c...
Cascade and inheritance - Learn web development
f winning too. since ids have an even higher specificity than classes (you can only have one element with each unique id on a page, but many elements with the same class — id selectors are very specific in what they target), the red background color and the 1 pixel black border should both be applied to the 2nd element, with the first element getting the gray background color, and no border, as
specified by the class. the 2nd element does get the red background color, but no border. why? because of the !important declaration in the second rule — including this after border: none means that this declaration will win over the border value in the previous rule, even though the id has higher specificity. note: the only way to override this !important declaration would be to include another !imp...
...ylesheet. one situation in which you may have to use it is when you are working on a cms where you can't edit the core css modules, and you really want to override a style that can't be overridden in any other way. but really, don't use it if you can avoid it. the effect of css location finally, it is also useful to note that the importance of a css declaration depends on what stylesheet it is
specified in — it is possible for users to set custom stylesheets to override the developer's styles, for example the user might be visually impaired, and want to set the font size on all web pages they visit to be double the normal size to allow for easier reading. to summarize conflicting declarations will be applied in the following order, with later ones overriding earlier ones: declarations in ...
Flexbox - Learn web development
rence in how the space is shared out. the real value of flexbox can be seen in its flexibility/responsiveness — if you resize the browser window, or add another <article> element, the layout continues to work just fine. flex: shorthand versus longhand flex is a shorthand property that can specify up to three different values: the unitless proportion value we discussed above. this can be
specified individually using the flex-grow longhand property. a second unitless proportion value — flex-shrink — that comes into play when the flex items are overflowing their container. this specifies how much of the overflowing amount is taken away from each flex item's size, to stop them overflowing their container. this is quite an advanced flexbox feature, and we won't be covering it any further ...
...roportion value — flex-shrink — that comes into play when the flex items are overflowing their container. this specifies how much of the overflowing amount is taken away from each flex item's size, to stop them overflowing their container. this is quite an advanced flexbox feature, and we won't be covering it any further in this article. the minimum size value we discussed above. this can be
specified individually using the flex-basis longhand value. we'd advise against using the longhand flex properties unless you really have to (for example, to override something previously set). they lead to a lot of extra code being written, and they can be somewhat confusing. horizontal and vertical alignment you can also use flexbox features to align flex items along the main or cross axis. let's exp...
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 poin...
... 1px solid black; } .positioned { position: relative; background: yellow; top: 30px; left: 30px; } cool, huh? ok, so this probably wasn't what you were expecting — why has it moved to the bottom and right if we
specified top and left? illogical as it may initially sound, this is just the way that relative positioning works — you need to think of an invisible force that pushes the
specified side of the positioned box, moving it in the opposite direction. 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 (see source code). absolute positioning absolute positioning brings very different results. let's try changing the position declarati...
CSS FAQ - Learn web development
mpatibility mess. for example, many developers only using the -webkit- prefixed version of a property when the non-prefixed version is supported across all browsers meant that a feature relying on that property would break in non-webkit-based browsers, completely needlessly. this problem got so bad that other browsers started to implement -webkit- prefixed aliases to improve web compatibility, as
specified in the compatibility living standard. in fact most browsers now do not use css prefixes when implementing experimental features, instead implementing those features only on nightly browser versions or similar. if you need to use prefixes in your work, you are advised to write your code in a way that uses the prefixed versions first, but then includes a non-prefixed standard version afterwards s...
...module. note: see the mozilla css extensions page for more information on the mozilla-prefixed css properties. how does z-index relate to positioning? the z-index property specifies the stack order of elements. an element with a higher z-index/stack order is always rendered in front of an element with a lower z-index/stack order on the screen. z-index will only work on elements that have a
specified position (position:absolute, position:relative, or position:fixed). note: for more information, see our positioning learning article, and in particular the introducing z-index section. ...
Using CSS generated content - Learn web development
tent or images. one of the important advantages of css is that it helps you to separate a document's style from its content. however, there are situations where it makes sense to specify certain content as part of the stylesheet, not as part of the document. you can specify text or image content within a stylesheet when that content is closely linked to the document's structure. note: content
specified in a stylesheet does not become part of the dom. specifying content in a stylesheet can cause complications. for example, you might have different language versions of your document that share a stylesheet. if you specify content in your stylesheet that requires translation, you have to put those parts of your stylesheet in different files and arrange for them to be linked with the appropriate ...
...ment. to specify this, make a rule and add ::before or ::after to the selector. in the declaration, specify the content property with the text content as its value. html a text where i need to <span class="ref">something</span> css .ref::before { font-weight: bold; color: navy; content: "reference "; } output the character set of a stylesheet is utf-8 by default, but it can also be
specified in the link, in the stylesheet itself, or in other ways. for details, see 4.4 css style sheet representation in the css specification. individual characters can also be
specified by an escape mechanism that uses backslash as the escape character. for example, "\265b" is the chess symbol for a black queen ♛. for details, see referring to characters not represented in a character encoding and ch...
Web fonts - Learn web development
essed, meaning that any browser that supports web fonts can have exactly the fonts you specify available to it. amazing! the syntax required looks something like this: first of all, you have a @font-face block at the start of the css, which specifies the font file(s) to download: @font-face { font-family: "myfont"; src: url("myfont.woff"); } below this you can then use the font family name
specified inside @font-face to apply your custom font to anything you like, as normal: html { font-family: "myfont", "bitstream vera serif", serif; } the syntax does get a bit more complex than this; we'll go into more detail below. there are two important things to bear in mind about web fonts: browsers support different font formats, so you'll need multiple font formats for decent cross-browser s...
...@font-face tip: define font-weight and font-style to keep your css simple by roger johansson shows what to do in more detail. note: you can also specify particular font-variant and font-stretch values for your web fonts. in newer browsers, you can also specify a unicode-range value, which is a specific range of characters you want to use out of the web font — in supporting browsers, only the
specified characters will be downloaded, saving unnecessary downloading. creating custom font stacks with unicode-range by drew mclellan provides some useful ideas on how to make use of this. variable fonts there is a newer font technology available in browsers called variable fonts — these are fonts that allow many different variations of a typeface to be incorporated into a single file, rather than ...
UI pseudo-classes - Learn web development
uired set on them that have no value are counted as invalid — they will be matched with :invalid and :required. controls with built-in validation, such as <input type="email"> or <input type="url"> are (matched with) :invalid when the data entered into them does not match the pattern they are looking for (but they are valid when empty). controls whose current value is outside the range limits
specified by the min and max attributes are (matched with) :invalid, but also matched by :out-of-range, as you'll see later on. there are some other ways to make an element matched by :valid/:invalid, as you'll see in the client-side form validation article. but we'll keep things simple for now. let's go in and look at a simple example of :valid/:invalid (see valid-invalid.html for the live version, and...
...empty, but valid when they have something filled in. the email input on the other hand is valid when empty, as it is not required, but invalid when it contains something that is not a proper email address. in-range and out-of-range data as we hinted at above, there are two other related pseudo-classes to consider — :in-range and :out-of-range. these match numeric inputs where range limits are
specified by the min and max, when their data is inside or outside the
specified range, respectvely. note: numeric input types are date, month, week, time, datetime-local, number, and range. it is worth noting that inputs whose data is in-range will also be matched by the :valid pseudo-class and inputs whose data is out-of-range will also be matched by the :invalid pseudo-class. so why have both? the i...
Tips for authoring fast-loading HTML pages - Learn web development
ess jpeg or tiny png,. specify sizes for images and tables if the browser can immediately determine the height and/or width of your images and tables, it will be able to display a web page without having to reflow the content. this not only speeds the display of the page but prevents annoying changes in a page's layout when the page completes loading. for this reason, height and width should be
specified for images, whenever possible. tables should use the css selector: property combination: table-layout: fixed; and should specify widths of columns using the <col> and the <colgroup> elements. use lazy loading for images by default, imags are loaded eagerly; that is, the image is fetched and rendered as soon as it's processed in the html. all eagerly loaded images are rendered before the d...
...ref="./images/footerlogo.jpg" loading="lazy"> note that lazily-loaded images may not be available when the load event is fired. you can determine if a given image is loaded by checking to see if the value of its boolean complete property is true. choose your user-agent requirements wisely to achieve the greatest improvements in page design, make sure that reasonable user-agent requirements are
specified for projects. do not require your content to appear pixel-perfect in all browsers, especially not in down-version browsers. ideally, your basic minimum requirements should be based on the consideration of modern browsers that support the relevant standards. this can include recent versions of firefox, internet explorer, google chrome, opera, and safari. note, however, that many of the tips list...
Creating hyperlinks - Learn web development
nd domain name. for example, if an index.html page is uploaded to a directory called projects that sits inside the root of a web server, and the web site's domain is http://www.example.com, the page would be available at http://www.example.com/projects/index.html (or even just http://www.example.com/projects/, as most web servers just look for a landing page such as index.html to load if it isn't
specified in the url.) an absolute url will always point to the same location, no matter where it's used. relative url: points to a location that is relative to the file you are linking from, more like what we looked at in the previous section. for example, if we wanted to link from our example file at http://www.example.com/projects/index.html to a pdf file in the same directory, the url would just be t...
... address of their choosing. specifying details in addition to the email address, you can provide other information. in fact, any standard mail header fields can be added to the mailto url you provide. the most commonly used of these are "subject", "cc", and "body" (which is not a true header field, but allows you to specify a short content message for the new email). each field and its value is
specified as a query term. here's an example that includes a cc, bcc, subject and body: <a href="mailto:nowhere@mozilla.org?cc=name2@rapidtables.com&bcc=name3@rapidtables.com&subject=the%20subject%20of%20the%20email&body=the%20body%20of%20the%20email"> send mail with cc, bcc, subject and body </a> note: the values of each field must be url-encoded, that is with non-printing characters (invisible char...
Video and audio content - Learn web development
sources. in this case the browser will go through the <source> elements and play the first one that it has the codec to support. including webm and mp4 sources should be enough to play your video on most platforms and browsers these days. each <source> element also has a type attribute. this is optional, but it is advised that you include it. the type attribute contains the mime type of the file
specified by the <source>, and browsers can use the type to immediately skip videos they don't understand. iftype isn't included, browsers will load and try to play each file until they find one that works, which obviously takes time and is an unnecessary use of resources. refer to our guide to media types and formats for help selecting the best containers and codecs for your needs, as well as to look up ...
...ssign a width or height to. it also doesn't support the poster attribute — again, no visual component. other than this, <audio> supports all the same features as <video> — review the above sections for more information about them. restarting media playback at any time, you can reset the media to the beginning—including the process of selecting the best media source, if more than one is
specified using <source> elements—by calling the element's load() method: const mediaelem = document.getelementbyid("my-media-element"); mediaelem.load(); detecting track addition and removal you can monitor the track lists within a media element to detect when tracks are added to or removed from the element's media. for example, you can watch for the addtrack event being fired on the associated audio...
Functions — reusable blocks of code - Learn web development
functions from inside functions. the above function for example calls the random() function three times, which is defined by the following code: function random(number) { return math.floor(math.random()*number); } we needed this function because the browser's built-in math.random() function only generates a random decimal number between 0 and 1. we wanted a random whole number between 0 and a
specified number. invoking functions you are probably clear on this by now, but just in case ... to actually use a function after it has been defined, you've got to run — or invoke — it. this is done by including the name of the function in the code somewhere, followed by parentheses. function myfunction() { alert('hello'); } myfunction(); // calls the function once anonymous functions you may ...
...reeting() { alert('hello'); } you will mainly use anonymous functions to just run a load of code in response to an event firing — like a button being clicked — using an event handler. again, this looks something like this: mybutton.onclick = function() { alert('hello'); // i can put as much code // inside here as i want } function parameters some functions require parameters to be
specified when you are invoking them — these are values that need to be included inside the function parentheses, which it needs to do its job properly. note: parameters are sometimes called arguments, properties, or even attributes. as an example, the browser's built-in math.random() function doesn't require any parameters. when called, it always returns a random number between 0 and 1: let mynumbe...
Client-side storage - Learn web development
ything you like — we called it request so it is obvious what it is for). you then use event handlers to run code when the request completes, fails, etc., which you'll see in use below. note: the version number is important. if you want to upgrade your database (for example, by changing the table structure), you have to run your code again with an increased version number, different schema
specified inside the onupgradeneeded handler (see below), etc. we won't cover upgrading databases in this simple tutorial. now add the following event handlers just below your previous addition — again inside the window.onload handler: // onerror handler signifies that the database didn't open successfully request.onerror = function() { console.log('database failed to open'); }; // onsucce...
...ately here because the onupgradeneeded handler (if needed) will run before the onsuccess handler, meaning that the db value wouldn't be available if we didn't do this. we then use idbdatabase.createobjectstore() to create a new object store inside our opened database called notes_os. this is equivalent to a single table in a conventional database system. we've given it the name notes, and also
specified an autoincrement key field called id — in each new record this will automatically be given an incremented value — the developer doesn't need to set this explicitly. being the key, the id field will be used to uniquely identify records, such as when deleting or displaying a record. we also create two other indexes (fields) using the idbobjectstore.createindex() method: title (which will con...
TypeScript support in Svelte - Learn web development
om todos.svelte, we will instantiate a todo component with a literal object as its parameter before the call to the moreactions component, like this: <hr /> <todo todo={ { name: 'a new task with no id!', completed: false } } /> <!-- moreactions --> <moreactions {todos} add the lang='ts' to the <script> tag of the todos.svelte component, so that it knows to use the type checking we have
specified. we will get the following error: by now you should get an idea about the kind of assistance we can get from typescript when building svelte projects. now we will undo these changes in order to start porting our application to typescript, so we won't be bothered with all the validate warnings. remove the flawed todo and the lang='ts' attribute from the todos.svelte file. also remo...
...d contain an array of todotype, etc. we can let typescript enforce this using typescript generics; let's find out more. understanding typescript generics generics allow us to create reusable code components that work with a variety of types instead of a single type. they can be applied to interfaces, classes, and functions. generic types are passed as parameters using a special syntax: they are
specified between angle-brackets, and by convention are denoted with an upper-cased single char letter. generic types allows us to capture the types provided by the user to be used later. let's see a quick example, a simple stack class that let's us push and pop elements, like this: export class stack { private elements = [] push = (element) => this.elements.push(element) pop() { if (this.ele...
Introduction to automated testing - Learn web development
gulp plugin directory has literally thousands of plugins to search through. other task runners there are many other task runners available. we certainly aren't trying to say that gulp is the best solution out there, but it works for us and it is fairly accessible to beginners. you could also try using other solutions: grunt works in a very similar way to gulp, except that it relies on tasks
specified in a config file, rather than using written javascript. see getting started with grunt for more details. you can also run tasks directly using npm scripts located inside your package.json file, without needing to install any kind of extra task runner system. this works on the premise that things like gulp plugins are basically wrappers around command line tools. so, if you can work out how to ru...
...ty browser testing services and what they can do for us. the basic premise with such applications is that the company that runs each one has a huge server farm that can run many different tests. when you use this service, you provide a url of the page you want to test along with information, such as what browsers you want it tested in. the app then configures a new vm with the os and browser you
specified, and returns the test results in the form of screenshots, videos, logfiles, text, etc. you can then step up a gear, using an api to access functionality programmatically, which means that such apps can be combined with task runners, such as your own local selenium environments and others, to create automated tests. note: there are other commercial browser testing systems available but in this ...
Accessibility API cross-reference
/a link <a> <link> according to the pdf 1.7 spec, a <link> must not be a direct child of a <toci> (table of contents item). in such a case, they should be wrapped in a <reference> pragmatically however, user agents should expect to find <link> tags as direct children of <toci> abstract role - a perceivable section containing content that is relevant to a specific, author-
specified purpose and sufficiently important that users will likely want to be able to navigate to the section easily and to have it listed in a summary of the page. such a page summary could be generated dynamically by a user agent or assistive technology. landmark n/a hypertext link that can be on image or text link n/a link <a> <link> accordi...
...page_tab tab the container of the page tab controls. pagetablist page_tab_list page_tab_list tablist a pane or frame in the current window pane n/a region or group ? the most common content type in most documents. a paragraph generally encloses distinct portions of content that are not otherwise
specified with other block level structure element types such as heading, table or list elements. <p> <p> shows percentage completion for task progressbar progress_bar n/a progressbar page showing properties of something propertypage n/a n/a n/a your average, run-of-the-mill button pushbutton...
Mozilla’s UAAG evaluation report
oggle placeholders. (p3) ni 2.11 alert unsupported language. (p3) nr ? guideline 3. allow configuration not to render some content that may reduce accessibility. checkpoint title status notes/plans 3.1 toggle background images. (p1) c preferences, appearance, colors - "use my chosen colors, ignoring the colors and background image
specified" 3.2 toggle audio, video, animated images. (p1) p animated images can be made still with the escape key animated images can be made still as a preference under preferences, privacy & security, images - "animated images should loop" mozilla has no preference or command to toggle audio or video 3.3 toggle animated/blinking text. (p1) p the following line can be...
...ments satisfied p: poor implementation, some requirements satisfied and/or difficult for user to access feature ni: not implemented nr: not rated na: not applicable guideline 7. observe operating environment conventions. checkpoint title status notes/plans 7.1 focus and selection conventions. (p1) vg mozilla uses selection colors as
specified in the control panel. mozilla exposes the focus via wm_focus system messages mozilla does not use the system focus drawing routines, because they aren't flexible enough (don't support css) 7.2 respect input configuration conventions. (p1) vg mozilla implements standard keyboard bindings there are a few missing pieces, such as support in xul comboboxes (menulist) for sel...
Theme concepts
the theme images themselves may be animated) or as dynamic themes created in a browser extension. if you have a lightweight theme it will be converted to this new theme format automatically before lightweight themes are deprecated. you do not need to port your theme. however, please feel free to update your themes to use any of the new features described here. static themes static themes are
specified using the same resources as a browser extension: a manifest.json file to define the theme components with those components stored in the same folder as the manifest.json file or a sub folder. these resources are then packed in a zip for publication on addons.mozilla.org (amo) or for self-distribution. for more information on self-distribution, visit signing and distributing your add-on. you can ...
...backgrounds_tiling": [ "repeat" ] }, full details of how to setup this theme can be found in the themes example weta_tiled. full detais of the alignment and tiling options can be found in the "theme" key description. alternatively, you can use multiple images, say combining the original weta image with this one anchored to the left of the header to create this effect where the images are
specified with: "images": { "theme_frame": "empty.png", "additional_backgrounds": [ "weta.png", "weta-left.png"] }, and their alignment by: "properties": { "additional_backgrounds_alignment": [ "right top" , "left top" ] }, full details of how to setup this theme can be found in the themes example weta_mirror. full details of the alignment options can be found in the "theme" key description. sta...
Adding a new CSS property
nsstylecoord. but don't use nsstylecoord if you only need a single type that nsstylecoord provides. the default constructor must initialize the variable to match the initial value of the property, as described in the "initial value:" line in the specification's definition of the property. you then need to add code to nsrulenode::compute*data (where the * is for the style struct) to transform a
specified value of the property into a computed value of the property. this needs to match the specification's definition of the "computed value" (and, for the 'initial' value, it's definition of "initial value"). for examples of how to write this computation code, see other examples in nsrulenode.cpp. in any case where the computation you do might vary between elements that match the same list of style...
...ch the same list of style rules, you need to set the canstoreinruletree variable to false. a common example of this is 'em' units, which depend on the font size. note that use of setcoord (if the resulting value needs to be a tagged union) or setdiscrete is preferred when it's possible to use those functions. also, it's very important not to touch the computed style data at all when there's no
specified data provided (ecssunit_null); touching the computed style data in this case would break partial computation based on a start struct, which is when we computed style data on the basis of computed data we've already computed from a subset of the style rules that we're currently computing from. then you need to change nsstyle*::calcdifference (in nsstylestruct.cpp) to describe how dynamic changes ...
HTMLIFrameElement.download()
warning: removed in firefox 65. the download() method of the htmliframeelement interface downloads a
specified url, storing it at /sdcard/download. syntax var instanceofdomrequest = instanceofhtmliframeelement.download(url, options); returns a domrequest for handling the download request. its request.onsuccess handler handles the success case, and its request.onerror handler handles the failure case. parameters url the url of the file to be downloaded. options optional an options object allowing optional settings to be
specified for the download. the available options are: filename: the filename to save the downloaded file as. if this is not
specified, the filename used will be the original filename, as
specified in the url. referrer: specifies a referrer for the downloaded fil...
...url the url of the file to be downloaded. options optional an options object allowing optional settings to be
specified for the download. the available options are: filename: the filename to save the downloaded file as. if this is not
specified, the filename used will be the original filename, as
specified in the url. referrer: specifies a referrer for the downloaded file. if this is not
specified there will be no referrer. examples var browser = document.queryselector('iframe'); var request = browser.download(foourl, { filename: 'foo.bin' }); request.onsuccess = function() { console.log("file downladed"); } request.onerror = function() { console.log("download error"); } specification not part of any specification. ...
HTMLIFrameElement.executeScript()
note: use of the browser api requires a privileged app, and browser and/or embed-apps permissions, depending on what you want to do. see using the browser api for more details. syntax var mydomrequest = instanceofhtmliframeelement.executescript(script, options); return value a domrequest object that returns an onsuccess handler if the script is successfully executed against the loaded content, or an onerror handler if not. parameters script the script to be executed. ...
...rl for the script to be executed against. it's recommended that you include an origin or url, in order to ensure that the script is being executed in the expected context: origin: an origin, e.g. http://example.com url: a url, e.g. http://example.com/index.html note: the options parameter does not currently seem to have much effect. the script seems to execute even if a url/origin is
specified. examples var request1 = browser.executescript( var a = 3; a + 3 , {url: 'http://example.com/index.html'}); request1.onsuccess = function() { console.log(request1.result); // 6 } var request2 = browser.executescript( new promise((resolve, reject) => { settimeout(function() { resolve(6); }, 1000}) ) , {origin: 'http://example.com'}); request2.onsuccess = function() { ...
HTMLIFrameElement.getScreenshot()
the image will be cropped if necessary but will not be distorted vertically or horizontally. note: getscreenshot() waits for the event loop to go idle before it takes the screenshot. it won't wait more than 2000ms (this delay is defined by the gecko dom.browserelement.maxscreenshotdelayms preference). ...
... screenshot is contained in request.result as a blob object), and its request.onerror handler handles the failure case. parameters maxwidth a number representing the maximum width of the screenshot in device pixels. maxheight a number representing the maximum height of the screenshot in device pixels. mimetype optional a mime type specifying the format of the image to be returned; if not
specified, the default used is image/jpeg. use image/png to capture the alpha channel of the rendered result by returning a png-format image. this lets you get a transparent background for the content <iframe>. examples var browser = document.queryselector('iframe'); var request = browser.getscreenshot(100, 100); request.onsuccess = function() { var blob = request.result; var url = url.createobjec...
Gecko Keypress Event
application developers can ignore this section. gecko replaces the charcode of dom keypress events for accelerator key handling, but that is not enough. problem 1 the zoom-in shortcut handler in firefox is defined as <key key="+" modifiers="accel"/>. ...
...these localized access keys work fine with the keyboard layout of the locale. however, users with the same non-latin keyboard layouts would also like to be able to use latin access keys of en-us builds (including nightly builds) without needing to switch keyboard layout (bug 399939). ...
Geckoview-Junit Tests
mulator. before running tests, install the androidtest apk on your device; otherwise, 'mach geckoview-junit' will offer to install it. mozilla-central$ mach install --app org.mozilla.geckoview.test to run all tests: mozilla-central$ mach geckoview-junit to run just one class of tests: mozilla-central$ mach geckoview-junit <class> please note that unlike robocop tests, <class> needs to be
specified using the fully qualified class name including the package, e.g. org.mozilla.geckoview.test.contentdelegatetest. to run just one test: mozilla-central$ mach geckoview-junit <class>#<test> to run more than one test: mozilla-central$ mach geckoview-junit <class1>#<test1> <class2>#<test2> mach geckoview-junit also supports running a list of tests that are
specified in a text file. each test mus...
...just one test: mozilla-central$ mach geckoview-junit <class>#<test> to run more than one test: mozilla-central$ mach geckoview-junit <class1>#<test1> <class2>#<test2> mach geckoview-junit also supports running a list of tests that are
specified in a text file. each test must be listed on its own line. for example: <class1>#<test1> <class2> <class3>#<test2> <class3>#<test3> to run the tests
specified in the file: mozilla-central$ mach geckoview-junit --test-filters-file <path-to-filter-file> disabling one failing test there is no manifest listing the geckoview junit tests. to disable a single test, edit the source code and insert junit's @ignore annotation before the existing @test annotation. for example: import org.junit.ignore ... @runwith(testrunner.class) public class testsomethi...
Dict.jsm
ning the same top-level items as the original dictionary on which the copy() method was called. del() deletes a key/value pair from the dictionary, given a key. boolean del( string akey ); parameters akey the key for the item to delete from the dictionary. return value true if an entry was found and removed; false if no match was found. get() returns the value corresponding to the
specified key. object get( string akey, [optional] object adefault ); parameters akey the key whose value should be returned. adefault optional the value to return if the
specified key isn't found. if you don't specify a default value, undefined is returned for keys that aren't found. return value the value of the
specified key, or undefined if no matching key was found. has() determines ...
... string akey, [optional] object adefault ); parameters akey the key whose value should be returned. adefault optional the value to return if the
specified key isn't found. if you don't specify a default value, undefined is returned for keys that aren't found. return value the value of the
specified key, or undefined if no matching key was found. has() determines whether or not the
specified key exists in the dictionary. boolean has( string akey ); parameters akey the key for which to determine existence in the dictionary. return value true if the
specified key is in the dictionary, otherwise false. listitems() returns an array of the key/value pairs in the dictionary. note: the order in which items are returned is arbitrary. array listitems(); parameters none. re...
Downloads.jsm
you may pass an object with a subset of the following fields: isprivate: optional indicates whether the download originated from a private window. if omitted, the download is public. promise resolves to undefined when the download has finished successfully and you can access the target file. promise can be rejected with downloaderror if the download failed. getlist() retrieves the
specified type of downloadlist object. there is one download list for each type, and this method always retrieves a reference to the same download list when called with the same argument. calling this function may cause the download list to be reloaded from the previous session, if it wasn't loaded already. promise<downloadlist> getlist(atype); parameters atype this can be downloads.public, downloa...
...downloads.public, downloads.private, or downloads.all. downloads added to the downloads.public and downloads.private lists are reflected in the downloads.all list, and downloads added to the downloads.all list are also added to either the downloads.public or the downloads.private list based on their properties. promise resolves to the requested downloadlist object. getsummary() retrieves the
specified type of downloadsummary object. there is one download summary for each type, and this method always retrieves a reference to the same download summary when called with the same argument. calling this function does not cause the list of public downloads to be reloaded from the previous session. the summary will behave as if no downloads are present until the getlist() method is called. promise<d...
JNI.jsm
value); void .setelements(number astart, [array, size_is(arr.length > number anynumber > 0)] in cdata avalsarray); .get() gets the value of the element in the array at given aindex. cdata get(number aindex); parameters aindex the position in the array to obtain. return value returns primitive cdata. .getelements() returns a new cdata object of the section of the array
specified by astart and ending at position astart + alength. void setelements(number astart, number alength); parameters astart the position to start setting elements of the array in. alength the number of elements to copy from astart. if 0 is supplied, an empty cdata array is returned. return value a new cdata array object based on the array. .set() sets an element in the array at given aind...
...t based on the array. .set() sets an element in the array at given aindex to the given aval. void set(number aindex, cdata aval); parameters aindex the position in the array to change. aval a value to set it to. return value this function has no return value, if you try to store the return value in a variable, it will be undefined. .setelements() sets a section of a typed array to
specified values. this function starts on the position of astart in the array and sets it to the values in avalsarray. this is done by calling .set for each element with the respective value in the avalsarray. void setelements(number astart, [array, size_is(arr.length > number anynumber > 0)] in cdata avalsarray); parameters astart the position to start setting elements of the array in. avalsarray ...
Deferred
resolve(); else reject(); }); }); method overview void resolve([optional] avalue); void reject([optional] areason); properties attribute type description promise read only promise a newly created promise, initially in the pending state. methods resolve() fulfills the associated promise with the
specified value, or propagates the state of an existing promise. 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 with any value of this. note: calling this method with a pending promise as the avalue argument, and then ...
...oid resolve( avalue ); parameters avalue optional if this value is not a promise, including undefined, it becomes the fulfillment value of the associated promise. if this value is a promise, then the associated promise will be resolved to the passed promise, and follow the state as the provided promise (including any future transitions). reject() rejects the associated promise with the
specified reason. if the 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 with any value of this. void reject( areason ); parameters areason optional the rejection reason for the associated promise. although the reason can be un...
Promise.jsm
defer() creates a new pending promise and provides methods to resolve or reject it. deferred defer(); obsolete since gecko 30 parameters none. return value a new object, containing the new promise in the promise property, and the methods to change its state in the resolve and reject properties. see the deferred documentation for details. resolve() creates a new promise fulfilled with the
specified value, or propagates the state of an existing promise. promise resolve( avalue ); parameters avalue optional if this value is not a promise, including undefined, it becomes the fulfillment value of the returned promise. if this value is a promise, then the returned promise will be resolved with the value, i.e. it will eventually assume the same state as the provided promise. return val...
...ptional if this value is not a promise, including undefined, it becomes the fulfillment value of the returned promise. if this value is a promise, then the returned promise will be resolved with the value, i.e. it will eventually assume the same state as the provided promise. return value a promise that can be pending, fulfilled, or rejected. reject() creates a new promise rejected with the
specified reason. promise reject( areason ); parameters areason optional the rejection reason for the returned promise. although the reason can be undefined, it is generally an error object, like in exception handling. note: this argument should not be a promise. specifying a rejected promise would make the rejection reason equal to the rejected promise itself, and not its rejection reason. ...
Deferred
thod 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 method with a pending promise as the avalue argument, and then calling ...
...oid resolve( avalue ); parameters avalue optional if this value is not a promise, including undefined, it becomes the fulfillment value of the associated promise. if this value is a promise, then the associated promise will be resolved to the passed promise, and follow the state as the provided promise (including any future transitions). reject() rejects the associated promise with the
specified reason. if the 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 reject argument, and can be called with any value of this. void reject( areason ); parameters areason optional the rejection reason for the associated promise. although the reason can be undefined, ...
PromiseWorker.jsm
on to be called as it appears in the worker file. aargs an array of arguments to pass to the function named afunctionname in the worker file. if the worker function does not have any arguments and the empty array should be passed here. if any of the arguments is a promise, it is resolved before posting the message. if any of the arguments needs to be transferred instead of copied, this may be
specified by making the argument an instance of basepromiseworker.meta or by using the atransferlist argument. by convention, the last argument may be an object options with some of the following fields: outexecutionduration {number|null} a parameter to be filled with the duration of the off main thread execution for this call. aclosure optional an object holding strong references to value t...
...e) { this.message = message; } customerror.prototype.tomsg = function() { return { exn: 'customerror', message: this.message, }; }; // a function called by message. function func() { ... // throw a custom error. throw new customerror('meow'); } the converted message will be posted back to the main thread, and it will be converted again to error object, with frommsg function
specified for the error in exceptionhandlers property. this is seen in a simple demo github :: promiseworker custom errors demo - main thread setup. // main thread // define a custom error prototype. function customerror(message) { this.message = message; } customerror.frommsg = function(msg) { return new customerror(msg.message); }; // register a constructor. myworker.exceptionhandlers['customerror...
Sqlite.jsm
ers don't need to prepare statements manually before execution. just call executecached() and the statement will be prepared for you automatically. parameters can be bound to the statement by defining the params argument. this argument can be an array of positional parameters or an object of named parameters. if the statement does not contain any bound parameters, this argument can be omitted or
specified as null. note: callers are strongly encouraged to use bound parameters instead of dynamically creating sql statements for security reasons. bound parameters aren't prone to sql injection like manual sql statement construction (e.g., concatenating a raw value into the executed sql statement). note: callers are encouraged to pass objects rather than arrays for bound parameters because they preven...
... still resolved (not rejected). the return promise will be rejected with an error instance if the statement did not finish execution fully. the error may have an errors property. if defined, it will be an array of objects describing individual errors. each object has the properties result and message. result is a numeric error code and message is a string description of the problem. if onrow is
specified, the returned promise will be resolved with a boolean indicating whether the onrow handler was called. else, the resolved value will be an array of mozistoragerow. executetransaction(func, type) this function is used to execute a database transaction. a transaction is a series of related statements treated as one functional unit. if the transaction succeeds, all the statements contained within ...
Task.jsm
plicitly when you want to recurse into other task functions. if you specify a function that is not a generator, it is called with no arguments, and the yield operator returns the return value of the function. this comes in handy when iterating over function lists where some items have been converted to tasks and some not. if you specify anything else, the yield operator returns exactly what you
specified. method overview function async(atask); promise spawn(atask); properties attribute type description result read only constructor constructs a special exception that, when thrown inside a legacy generator function, allows the associated task to be resolved with a specific value. example: task.spawn( function() { yield ... ; throw ne...
...with arguments. the promise returned by the task either fulfills with the returned value if generator returns or rejects with the thrown error if the generator throws. if you specify a function that is not a generator, it is called with no arguments, and its return value is used to fulfill the returned promise. if you specify anything else, you get a promise that is already fulfilled with the
specified value. return value a promise that is fulfills when the task returns or rejects when the task throws an exception. examples general example cu.import("resource://gre/modules/task.jsm"); task.spawn(function* () { // this is our task. it is a generator function because it contains the // "yield" operator at least once. let's create a promise object, wait on // it and capture its...
Localization and Plurals
r's locale. loading pluralform.jsm loading the pluralform module from javascript is simple with components.utils.import. just put the following line somewhere that will be evaluated before you want to use pluralform. at the top of your javascript file is fine. components.utils.import("resource://gre/modules/pluralform.jsm"); methods: get these methods make use of the browser's current locale
specified by chrome://global/locale/intl.properties's pluralrule value. /** * get the correct plural form of a word based on the number * * @param anum * the number to decide which plural form to use * @param awords * a semi-colon (;) separated string of words to pick the plural form * @return the appropriate plural form of the word */ string pluralform get(int anum, string awords) ...
... // let's get irish (plural rule #11) let [get, numforms] = pluralform.makegetter(11); // make up some values to use with "get" let dummytext = "form 1;form 2;form 3;form 4;form 5"; let dummynum = 10; // in the case of irish, the value 10 uses plural form #4, so "form 4" is printed print(get(dummynum, dummytext)); in this example, the irish plural rule was hardcoded, but this could be a value
specified in the .properties file. so for your extension, specify a pluralrule value in the .properties, and call pluralform.makegetter(pluralrulefromproperties), making sure to save the 2 returned functions. (you can use destructured assignment in javascript 1.7 to keep things clean.) the returned functions act just like pluralform.get() and pluralform.numforms(), except for the
specified plural rule inst...
Dynamic Library Linking
-ux) for unix, and the loadlibrary documentation for win32. dynamic library search path exporting symbols from the main executable program dynamic library search path the dynamic library search path is the list of directories in which to look for a dynamic library. each platform has its own standard directories in which to look for dynamic libraries, plus a customizable list of directories
specified by an environment variable. on most unix systems, this environment variable is ld_library_path. these systems typically use dlopen to load a dynamic library. hp-ux uses shl_load to load dynamic libraries, and the environment variable specifying the dynamic library search path is shlib_path. moreover, the executable program must be linked with the +s option so that it will search for shared li...
.... on most unix systems, this environment variable is ld_library_path. these systems typically use dlopen to load a dynamic library. hp-ux uses shl_load to load dynamic libraries, and the environment variable specifying the dynamic library search path is shlib_path. moreover, the executable program must be linked with the +s option so that it will search for shared libraries in the directories
specified by shlib_path at run time. alternatively, you can enable the +s option as a postprocessing step using the chatr tool. for example, link your executable program a.out without the +s option, then execute the following: chatr +s enable a.out on rhapsody, the environment variable is dyld_library_path. on win32, the environment variable is path. the same search path is used to search for execut...
NSPR LOG MODULES
this environment variable specifies which log modules have logging enabled. syntax modulename:level[, modulename:level]* modulename is the name
specified in a pr_newlogmodule call or one of the handy magic names listed below. level is a numeric value between 0 and 5, with the values having the following meanings: 0 = pr_log_none: nothing should be logged 1 = pr_log_always: important; intended to always be logged 2 = pr_log_error: errors 3 = pr_log_warning: warnings 4 = pr_log_debug: debug messages, notices 5: everything! description specify a modulename that is associated with the name argument in a call to pr_newlogmodule and a non-zero level value to enable logging for the named modulename. special log module names are provided for controlling nspr's log service at execution ti...
...ll enables all log modules. to enable all log module calls to pr_log, set the variable as follows: set nspr_log_modules=all:5 timestamp including timestamp results in a timestamp of the form "2015-01-15 21:24:26.049906 utc - " prefixing every logged line. append including append results in log entries being appended to the existing contents of the file referenced by nspr_log_file. if not
specified, the existing contents of nspr_log_file will be lost as a new file is created with the same filename. sync the name sync enables unbuffered logging. this ensures that all log messages are flushed to the operating system as they are written, but may slow the program down. bufsize:size the name bufsize:size sets the log buffer to size. examples log everything from the toolkit::storage compon...
PLHashComparator
for convenience, two comparator functions are provided. pl_comparestrings compare two character strings using strcmp. ...
... for convenience, two comparator functions are provided. pl_comparestrings compare two character strings using strcmp. ...
PL_HashTableRemove
if the entry exists, pl_hashtableremove removes the entry from the table, invokes freeentry with the ht_free_entry flag to frees the entry, and returns pr_true. if the table is underloaded, pl_hashtableremove also shrinks the number of buckets by half. ...
...if the entry exists, pl_hashtableremove removes the entry from the table, invokes freeentry with the ht_free_entry flag to frees the entry, and returns pr_true. if the table is underloaded, pl_hashtableremove also shrinks the number of buckets by half. ...
PL_strdup
if the memory allocation fails, null. description to accommodate the terminator, the size of the allocated memory is one greater than the length of the string being copied. a null argument, like a zero-length argument, results in a pointer to a one-byte block of memory containing the null value. ...
...if the memory allocation fails, null. description to accommodate the terminator, the size of the allocated memory is one greater than the length of the string being copied. a null argument, like a zero-length argument, results in a pointer to a one-byte block of memory containing the null value. ...
PRExplodedTime
the prexplodedtime structure represents clock/calendar time. prexplodedtime has the familiar time components: year, month, day of month, hour, minute, second. it also has a microsecond component, as well as the day of week and the day of year. in addition, prexplodedtime includes a prtimeparameters structure representing the local time zone information, so that the time point is non-ambiguously
specified. the essential members of prexplodedtime are: tm_year: absolute year, ad (by "absolute," we mean if the year is 2000, this field's value is 2000). tm_month: number of months past tm_year. the range is [0, 11]. 0 is january and 11 is december. tm_mday: the day of month. the range is [1, 31]. note that it starts from 1 as opposed to 0. tm_hour: number of hours past tm_mday. the range is [0, ...
...e is [0, 999999]. tm_params: a prtimeparameters structure representing the local time zone information. the nonessential members of prexplodedtime are: tm_wday: day of week. the range is [0, 6]. 0 is sunday, 1 is monday, and 6 is saturday. tm_yday: day of year. the range is [0, 365]. 0 is the 1st of january. on input to nspr functions, only the essential members of prexplodedtime must be
specified. the two nonessential members (day of week and day of year) are ignored by nspr functions as input. when an nspr function returns a prexplodedtime object or sets a prexplodedtime object as output, all of the prexplodedtime members are set, including the nonessential members. you can also use pr_normalizetime() to calculate the values of the nonessential members. ...
PR_Connect
syntax #include <prio.h> prstatus pr_connect( prfiledesc *fd, const prnetaddr *addr, printervaltime timeout); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing a socket. addr a pointer to the address of the peer to which the socket is to be connected. timeout a value of type printervaltime specifying the time limit for completion of the connect operation. returns the function returns one of the following values: upon successful completion of connection setup, pr_success. if unsuccessful, pr_failure. further information can be obtained by calling pr_geterror. ...
...the function uses the lesser of the provided timeout and the os's connect timeout. in particular, if you specify pr_interval_no_timeout as the timeout, the os's connection time limit will be used. if the socket is a udp socket, there is no connection setup to speak of, since udp is connectionless. if pr_connect is invoked on a udp socket, it has an overloaded meaning: pr_connect merely saves the
specified address as the default peer address for the socket, so that subsequently one can send and receive datagrams from the socket using pr_send and pr_recv instead of the usual pr_sendto and pr_recvfrom. ...
PR_JoinThread
description pr_jointhread is used to synchronize the termination of a thread. the function is synchronous in that it blocks the calling thread until the target thread is in a joinable state. ...
...ied thread terminates. syntax #include <prthread.h> prstatus pr_jointhread(prthread *thread); parameter pr_jointhread has the following parameter: thread a valid identifier for the thread that is to be joined. returns the function returns one of the following values: if successful, pr_success if unsuccessful--for example, if no joinable thread can be found that corresponds to the
specified target thread, or if the target thread is unjoinable--pr_failure. description pr_jointhread is used to synchronize the termination of a thread. the function is synchronous in that it blocks the calling thread until the target thread is in a joinable state. pr_jointhread returns to the caller only after the target thread returns from its root function. pr_jointhread must not be called until af...
PR_Listen
it creates a queue for pending connections and starts to listen for connection requests on the socket. ...
...filedesc object representing a socket that will be used to listen for new connections. backlog the maximum length of the queue of pending connections. returns the function returns one of the following values: upon successful completion of listen request, pr_success. if unsuccessful, pr_failure. further information can be obtained by calling pr_geterror. description pr_listen turns the
specified socket into a rendezvous socket. it creates a queue for pending connections and starts to listen for connection requests on the socket. the maximum size of the queue for pending connections is
specified by the backlog parameter. pending connections may be accepted by calling pr_accept. ...
PR_NewLogModule
...
...; parameters the function has this parameter: name the name to be assigned to the prlogmoduleinfo structure. returns a pointer to a prlogmoduleinfo structure. description this function allocates and initializes a new prlogmoduleinfo structure with the
specified name. if the environment variable nspr_log_modules contains the
specified name, then the associated level value from the variable is associated with the new prlogmoduleinfo structure. ...
PR_OpenSemaphore
creates or opens a named semaphore with the
specified name. syntax #include <pripcsem.h> #define pr_sem_create 0x1 /* create if not 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 fr...
...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 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. ...
PR_OpenSharedMemory
syntax #include <prshm.h> nspr_api( prsharedmemory * ) pr_opensharedmemory( const char *name, prsize size, printn flags, printn mode ); /* define values for pr_opensharememory(...,create) */ #define pr_shm_create 0x1 /* create if not exist */ #define pr_shm_excl 0x2 /* fail if already exists */ parameters the function has the following parameters: name the name of the shared memory segment. size the size of the shared memory segment. flags options for creating the shared memory. mode same as passed to pr_open. ...
... the shared memory segment. flags options for creating the shared memory. mode same as passed to pr_open. returns pointer to opaque structure prsharedmemory, or null if an error occurs. retrieve the reason for the failure by calling pr_geterror and pr_getoserror. description pr_opensharedmemory creates a new shared memory segment or associates a previously created memory segment with the
specified name. when parameter create is (pr_shm_excl | pr_shm_create) and the shared memory already exists, the function returns null with the error set to pr_file_exists_error. when parameter create is pr_shm_create and the shared memory already exists, a handle to that memory segment is returned. if the segment does not exist, it is created and a pointer to the related prsharedmemory structure is retur...
PR_RmDir
the directory must be empty. if the directory is not empty, pr_rmdir fails and pr_geterror returns the error code pr_directory_not_empty_error. ...
...the directory must be empty. if the directory is not empty, pr_rmdir fails and pr_geterror returns the error code pr_directory_not_empty_error. ...
PR_SendTo
syntax #include <prio.h> print32 pr_sendto( prfiledesc *fd, const void *buf, print32 amount, printn flags, const prnetaddr *addr, printervaltime timeout); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing a socket. buf a pointer to a buffer containing the data to be sent. amount the size of buf (in bytes). flags this obsolete parameter must always be zero. addr a pointer to the address of the destination. timeout a value of type printervaltime specifying the time limit for completion of the receive operation. returns the function returns one of the following values: a positive number indicates the number of bytes successfully sent. ...
...dress of the destination. timeout a value of type printervaltime specifying the time limit for completion of the receive operation. returns the function returns one of the following values: a positive number indicates the number of bytes successfully sent. the value -1 indicates a failure. the reason for the failure can be obtained by calling pr_geterror. description pr_sendto sends a
specified number of bytes from a socket to the
specified destination address. the calling thread blocks until all bytes are sent, a timeout has occurred, or there is an error. ...
PR_WaitCondVar
was interrupted with pr_interrupt), pr_failure. the details can be determined with pr_geterror. description before the call to pr_waitcondvar, the lock associated with the condition variable must be held by the calling thread. after a call to pr_waitcondvar, the lock is released and the thread is blocked in a "waiting on condition" state until another thread notifies the condition or a caller-
specified amount of time expires. when the condition variable is notified, a thread waiting on that condition moves from the "waiting on condition" state to the "ready" state. when scheduled, the thread attempts to reacquire the lock that it held when pr_waitcondvar was called. any value other than pr_interval_no_timeout or pr_interval_no_wait for the timeout parameter will cause the thread to be resched...
... a thread waiting on that condition moves from the "waiting on condition" state to the "ready" state. when scheduled, the thread attempts to reacquire the lock that it held when pr_waitcondvar was called. any value other than pr_interval_no_timeout or pr_interval_no_wait for the timeout parameter will cause the thread to be rescheduled due to either explicit notification or the expiration of the
specified interval. the latter must be determined by treating time as one part of the monitored data being protected by the lock and tested explicitly for an expired interval. to detect the expiration of the
specified interval, call pr_intervalnow before and after the call to pr_waitcondvar and compare the elapsed time with the
specified interval. ...
PR_dtoa
ue. *rve if not null this location is set to the address of the end of the result. buf the address of the buffer in which to store the result. bufsz the size of the buffer provided to hold the result. results the principle output is the null-terminated string stored in buf. if rve is not null, *rve is set to point to the end of the returned value. description this function converts the
specified floating point number to a string, using the method
specified by mode. possible modes are: 0 shortest string that yields d when read in and rounded to nearest. 1 like 0, but with steele & white stopping rule. for example, with ieee 754 arithmetic, mode 0 gives 1e23 whereas mode 1 gives 9.999999999999999e22. 2 max(1, ndigits) significant digits. this gives a return value similar to that of...
...pressed. 3 through ndigits past the decimal point. this gives a return value similar to that from fcvt, except that trailing zeros are suppressed, and ndigits can be negative. 4,5,8,9 same as modes 2 and 3, but usingleft to right digit generation. 6-9 same as modes 2 and 3, but do not try fast floating-point estimate (if applicable). all others treated as mode 2. upon return, the buffer
specified by buf and bufsz contains the converted string. trailing zeros are suppressed. sufficient space is allocated to the return value to hold the suppressed trailing zeros. if the input parameter d is+infinity,-infinity ornan, *decpt is set to 9999. ...
Threads
o ensure that the thread is valid. the effects of these functions on invalid threads are undefined. creating, joining, and identifying threads controlling thread priorities interrupting and yielding setting global thread concurrency getting a thread's scope creating, joining, and identifying threads pr_createthread creates a new thread. pr_jointhread blocks the calling thread until a
specified thread terminates. pr_getcurrentthread returns the current thread object for the currently running code. pr_attachthread associates a prthread object with an existing native thread. pr_detachthread disassociates a prthread object from a native thread. controlling thread priorities for an overview of the way nspr controls thread priorities, see setting thread priorities. you set a threa...
...s data associated with an index. interrupting and yielding pr_interrupt requests an interrupt of another thread. once the target thread has been notified of the request, the request stays with the thread until the notification either has been delivered exactly once or is cleared. pr_clearinterrupt clears a previous interrupt request. pr_sleep causes a thread to yield to other threads for a
specified number of ticks. setting global thread concurrency pr_setconcurrency sets the number of global threads used by nspr to create local threads. getting a thread's scope pr_getthreadscope gets the scoping of the current thread. ...
NSS_3.12.1_release_notes.html
in an error if host is not recognized bug 359302: remove the sslsample code from nss source tree bug 372241: need more versatile form of cert_nametoascii bug 390296: nss ignores subject cn even when san contains no dnsname bug 401928: support generalized pkcs#5 v2 pbes bug 403543: pkix: need a way to enable/disable aia cert fetching bug 408847: pkix_ocspchecker_check does not support
specified responder (and given signercert) bug 414003: crash [[@ cert_decodecertpackage] sometimes with this testcase bug 415167: memory leak in certutil bug 417399: arena allocation results are not checked in pkix_pl_infoaccess_parselocation bug 420644: improve ssl tracing of key derivation bug 426886: use const char* in pk11_importcertforkey bug 428103: cert_encodesubjectkeyid is not defined ...
... bug 430916: add sustaining asserts bug 431805: ...
NSS_3.12_release_notes.html
response sec_error_bad_ldap_response sec_error_failed_to_encode_data sec_error_bad_info_access_location sec_error_libpkix_internal new mechanism flags (see secmod.h) public_mech_aes_flag public_mech_sha256_flag public_mech_sha512_flag public_mech_camellia_flag new oids (see secoidt.h) new ec signature oids sec_oid_ansix962_ecdsa_signature_recommended_digest sec_oid_ansix962_ecdsa_signature_
specified_digest sec_oid_ansix962_ecdsa_sha224_signature sec_oid_ansix962_ecdsa_sha256_signature sec_oid_ansix962_ecdsa_sha384_signature sec_oid_ansix962_ecdsa_sha512_signature more id-ce and id-pe oids from rfc 3280 sec_oid_x509_hold_instruction_code sec_oid_x509_delta_crl_indicator sec_oid_x509_issuing_distribution_point sec_oid_x509_cert_issuer sec_oid_x509_freshest_crl sec_oid_x509_inhibit_any_policy...
... won't build bug 353745: klocwork null ptr dereference in pkcs12 decoder bug 338367: the gf2m_populate and gfp_populate should check the eccurve_map array index bounds before use bug 201139: ssltap should display plain text for null cipher suites bug 233806: support nist crl policy bug 279085: nss tools display public exponent as negative number bug 363480: ocspclnt needs option to take cert from
specified file bug 265715: remove unused hsearch.c dbm code bug 337361: leaks in jar_parse_any (security/nss/lib/jar/jarver.c) bug 338453: leaks in security/nss/lib/jar/jarfile.c bug 351408: leaks in jar_jar_sign_archive (security/nss/lib/jar/jarjart.c) bug 351443: remove unused code from mozilla/security/nss/lib/jar bug 351510: remove use_moz_thread code from mozilla/security/lib/jar bug 118830: nss publi...
Enc Dec MAC Output Public Key as CSR
c_oid_unknown) { pr_fprintf(pr_stderr, "unknown key or hash type\n"); rv = secfailure; goto cleanup; } rv = sec_dersigndata(arena, &result, encoding->data, encoding->len, privk, signalgtag); if (rv) { pr_fprintf(pr_stderr, "signing of data failed\n"); rv = secfailure; goto cleanup; } /* encode request in
specified format */ if (ascii) { char *obuf; char *name, *email, *org, *state, *country; secitem *it; int total; it = &result; obuf = btoa_convertitemtoascii(it); total = pl_strlen(obuf); name = cert_getcommonname(subject); if (!name) { name = strdup("(not
specified)"); } email = cert_getcertemailadd...
...*email, *org, *state, *country; secitem *it; int total; it = &result; obuf = btoa_convertitemtoascii(it); total = pl_strlen(obuf); name = cert_getcommonname(subject); if (!name) { name = strdup("(not
specified)"); } email = cert_getcertemailaddress(subject); if (!email) email = strdup("(not
specified)"); org = cert_getorgname(subject); if (!org) org = strdup("(not
specified)"); state = cert_getstatename(subject); if (!state) state = strdup("(not
specified)"); country = cert_getcountryname(subject); if (!country) country = strdup("(not
specified)"); pr_fprintf(outfile, "\ncertific...
FC_GetTokenInfo
name fc_gettokeninfo - obtain information about a particular token in the system. syntax ck_rv fc_gettokeninfo(ck_slot_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 character...
...bers 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 tools : pk12util
thawte consulting certificate friendly name: thawte freemail member's thawte consulting (pty) ltd. id password encryption pkcs#12 provides for not only the protection of the private keys but also the certificate and meta-data associated with the keys. password-based encryption is used to protect private keys on export to a pkcs#12 file and, optionally, the entire package. if no algorithm is
specified, the tool defaults to using pkcs12 v2 pbe with sha1 and 3key triple des-cbc for private key encryption. pkcs12 v2 pbe with sha1 and 40 bit rc4 is the default for the overall package encryption when not in fips mode. when in fips mode, there is no package encryption. the private key is always protected with strong encryption by default. several types of ciphers are supported. symmetric cbc ...
...he security databases directory because the sqlite databases are designed to be shared, these are the shared database type. the shared database type is preferred; the legacy format is included for backward compatibility. by default, the tools (certutil, pk12util, modutil) assume that the given security databases follow the more common legacy type. using the sqlite databases must be manually
specified by using the sql: prefix with the given security directory. for example: # pk12util -i /tmp/cert-files/users.p12 -d sql:/home/my/sharednssdb to set the shared database type as the default type for the tools, set the nss_default_db_type environment variable to sql: export nss_default_db_type="sql" this line can be set added to the ~/.bashrc file to make the change permanent. most applicati...
pkfnc.html
will return the newest certificate that matches the subject, based on the notbefore / notafter fields of the certificate. when you are finished with the certificate structure returned by pk11_findcertfromnickname, you must free it by calling cert_destroycertificate. the pk11_findcertfromnickname function calls the password callback function set with pk11_setpasswordfunc and passes it the pointer
specified by the wincx parameter. pk11_findkeybyanycert finds the private key associated with a
specified certificate in any available slot. syntax #include <pk11func.h> #include <certt.h> #include <keyt.h> seckeyprivatekey *pk11_findkeybyanycert( certcertificate *cert, void *wincx); parameters this function has the following parameters: cert ...
...eturns one of these values: if successful, a pointer to a private key structure. if unsuccessful, null. description when you are finished with the private key structure returned by pk11_findkeybyanycert, you must free it by calling seckey_destroyprivatekey. the pk11_findkeybyanycert function calls the password callback function set with pk11_setpasswordfunc and passes it the pointer
specified by the wincx parameter. pk11_getslotname gets the name of a slot. syntax #include <pk11func.h> char *pk11_getslotname(pk11slotinfo *slot); parameters this function has the following parameter: slot a pointer to a slot info structure. returns the function returns one of these values: if successful, a pointer to the...
ssltyp.html
when pr_false, free only the structure pointed to. otherwise, free both the structure pointed to and the secitem structure itself. returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to retrieve the error code. description this function frees the memory associated with the structure to which the
specified item points, when that structure is no longer used. when freeitem is not pr_false, also frees the item structure itself. secitem_zfreeitem zeroes and frees the memory associated with a secitem structure. syntax #include <prtypes.h> secstatus secitem_zfreeitem ( secitem *item, prbool freeitem) parameter this function has the following parameter: item ...
...f. returns the function returns one of these values: if successful, secsuccess. if unsuccessful, secfailure. use pr_geterror to retrieve the error code. description this function is similar to secitem_freeitem, except that it overwrites the structures to be freed with zeroes before it frees them. zeros and frees the memory associated with the structure to which the
specified item points, when that structure is no longer used. when freeitem is not pr_false, also zeroes and frees the item structure itself. ...
NSS tools : pk12util
ting certificate friendly name: thawte freemail member's thawte consulting (pty) ltd. id password encryption pkcs#12 provides for not only the protection of the private keys but also the certificate and meta-data associated with the keys. password-based encryption is used to protect private keys on export to a pkcs#12 file and, optionally, the entire package. if no algorithm is
specified, the tool defaults to using pkcs12 v2 pbe with sha1 and 3key triple des-cbc for private key encryption. pkcs12 v2 pbe with sha1 and 40 bit rc4 is the default for the overall package encryption when not in fips mode. when in fips mode, there is no package encryption. the private key is always protected with strong encryption by default. several types of ciphers are supported. ...
...tabases directory because the sqlite databases are designed to be shared, these are the shared database type. the shared database type is preferred; the legacy format is included for backward compatibility. by default, the tools (certutil, pk12util, modutil) assume that the given security databases follow the more common legacy type. using the sqlite databases must be manually
specified by using the sql: prefix with the given security directory. for example: # pk12util -i /tmp/cert-files/users.p12 -d sql:/home/my/sharednssdb to set the shared database type as the default type for the tools, set the nss_default_db_type environment variable to sql: export nss_default_db_type="sql" this line can be set added to the ~/.bashrc file to make the change permanent. ...
NSS tools : vfychain
-r following certfile is raw binary der (default) -t following cert is explicitly trusted (overrides db trust) -u usage 0=ssl client, 1=ssl server, 2=ssl stepup, 3=ssl ca, 4=email signer, 5=email recipient, 6=object signer, 9=protectedobjectsigner, 10=ocsp respo...
...d -b yymmddhhmmz validate date (default: now) -d directory database directory -f enable cert fetching from aia url -o oid set policy oid for cert validation(format oid.1.2.3) -p use pkix library to validate certificate by calling: * cert_verifycertificate if
specified once, * cert_pkixverifycert if
specified twice and more. -r following certfile is raw binary der (default) -t following cert is explicitly trusted (overrides db trust) -u usage 0=ssl client, 1=ssl server, 2=ssl stepup, 3=ssl ca, 4=email signer, 5=email recipient, 6=object signer, 9=protectedobjectsigner, 10=ocsp responder, 11=any ca -v verbose mode. print...
JS::Construct
syntax bool js::construct(jscontext *cx, js::handlevalue fun, const js::handlevaluearray& args, js::mutablehandlevalue rval); 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. fun js::handlevalue pointer to the function to call. should be a native function or jsapi-compiled function.. args js::handlevaluearray & arguments you are passing to the function. ...
...text. fun js::handlevalue pointer to the function to call. should be a native function or jsapi-compiled function.. args js::handlevaluearray & arguments you are passing to the function. rval js::mutablehandlevalue out parameter. on success, *rval receives the newly created object from the constructor call. description js::construct calls a
specified function as a constructor, fun. for more detail, see js::call, js_callfunction, js_callfunctionname, and js_callfunctionvalue. see also mxr id search for js::construct js::call js_callfunction js_callfunctionname js_callfunctionvalue bug 1017109 ...
JSPropertyDescriptor
criptor is an object that can have the following key values field name description getter the get syntax binds an object property to a function that will be called when that property is looked up. setter the set syntax binds an object property to a function to be called when there is an attempt to set that property. ...
...there are two main types of property descriptors that exist in an object: a data descriptor and an access descriptor. you can use the object.getownpropertydescriptor() function to get the corresponding property of an object. ...
JS_ConstructObject
ructobjectwitharguments have been removed from the jsapi. the preferred alternative is to save a 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 d...
...e constructor. argv jsval * (only in js_constructobjectwitharguments) the array of 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 reason...
JS_DefineConstDoubles
onstdoublespec records containing property names and values to create. the last array element must contain zero-valued members. cis jsconstintegerspec * pointer to an array of jsconstintegerspec records containing property names and values to create. the last array element must contain zero-valued members. ...
... cis jsconstintegerspec * pointer to an array of jsconstintegerspec records containing property names and values to create. the last array element must contain zero-valued members. description js_defineconstdoubles creates one or more properties for a
specified object, obj, where each property consists of a double value. js_defineconstintegers creates one or more properties for a
specified object, obj, where each property consists of a int32_t value. the attributes for each property is set to jsprop_readonly | jsprop_permanent. obsolete from jsapi 35 each property is automatically assigned attributes as
specified in the flags field of the jsconstdoublespec/jsconstintegerspec structure pointed to by cds/cis. if flags is set to 0, the attributes for the property are automatically ...
JS_DefineElement
creates a numeric property on a
specified object. syntax /* added in spidermonkey 38 (jsapi 32) */ bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t index, js::handlevalue value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t index, js::handleobject value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext *cx, js::handleobject obj, uint32_t index, js::handlestring value, unsigned attrs, jsnative getter = nullptr, jsnative setter = nullptr); bool js_defineelement(jscontext...
...ial 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
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 t...
JS_DeleteElement
syntax bool js_deleteelement(jscontext *cx, js::handleobject obj, uint32_t index); // added in spidermonkey 45 bool js_deleteelement(jscontext *cx, js::handleobject obj, uint32_t index, js::objectopresult &result); name type description cx jscontext * pointer to a js context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object from which to delete an element. index uint32_t index number of the element to delete. result js::objectopresult & (out parameter) receives the result of the operation. ...
...nformation. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object from which to delete an element. index uint32_t index number of the element to delete. result js::objectopresult & (out parameter) receives the result of the operation. description js_deleteelement removes a
specified element or numeric property, index, from an object, obj. if an object references an element belonging to a prototype, the element reference is removed from the object, but the prototype's element is not deleted. if deletion is successful, js_deleteelement returns true. otherwise it returns false. for javascript 1.2 and earlier, if failure occurs because you attempt to delete a permanent or read-...
JS_DeleteElement2
renamed to js_deleteelement in jsapi 39 syntax bool js_deleteelement2(jscontext *cx, js::handleobject obj, uint32_t index, bool *succeeded); name type description cx jscontext * pointer to a js context from which to derive runtime information. requires request. ...
...aller must be in a request on this jscontext. obj js::handleobject object from which to delete an element. index uint32_t index number of the element to delete. succeeded bool * out parameter. on success, *succeeded receives false if the property was not deleted because it is permanent and true otherwise. description js_deleteelement2 removes a
specified element or numeric property, index, from an object, obj. if an object references an element belonging to a prototype, the element reference is removed from the object, but the prototype's element is not deleted. if deletion is successful, js_deleteelement2 stores true to *succeeded and returns true. otherwise it returns false and the value of *succeeded is undefined. notes per the ecma standa...
JS_ExecuteScriptVersion
obsolete since jsapi 36this 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.5 execute a compiled script with
specified version. syntax jsbool js_executescriptversion(jscontext *cx, jsobject *obj, jsobject *scriptobj, jsval *rval, jsversion version); name type description cx jscontext * the context in which to execute the script. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * the scope in which to execute the script. in the simplest cases, this should just be the embedding's global object. obj ...
...ement processed in the script. version jsversion version for the script. description js_executescript executes a previously-compiled script, script. if the script executes successfully, *rval receives the value from the last executed expression statement processed in the script, and js_executescript returns true. otherwise it returns false, and the value left in *rval is un
specified. to execute a script that has not been compiled, use js::evaluate instead. see also js::compile js_executescript js::evaluate bug 1095660 ...
JS_GetElement
find a
specified numeric property of an object and return its current value. syntax bool js_getelement(jscontext *cx, js::handleobject obj, uint32_t index, js::mutablehandlevalue vp); name type description cx jscontext * the context in which to perform the property lookup. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to search for the element. index uint32_t index of the element to look up. vp js::mutablehandlevalue out parameter. on success, *vp receives the current value of the element, if it exists, and undefined otherwise. ...
...eadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to search for the element. index uint32_t index of the element to look up. vp js::mutablehandlevalue out parameter. on success, *vp receives the current value of the element, if it exists, and undefined otherwise. description js_getelement examines a
specified js object, obj, and its prototype chain, for an element or numeric property numbered index. if the element exists, js_getelement sets *vp to the element's current value. if not, it sets *vp to undefined and returns true (to indicate no error occurred). if the search fails with an error or exception, js_getelement returns false, and the value left in *vp is undefined. see also mxr id search for j...
JS_GetFunctionObject
fun must be either a function implemented by a jsnative (or jsfastnative) or the result of a call to js_compilefunction or similar functions. in other cases, the object returned by js_getfunctionobject is not necessarily safe to call and should not be exposed to script. in the javascript language, functions are objects. ...
... fun must be either a function implemented by a jsnative (or jsfastnative) or the result of a call to js_compilefunction or similar functions. in other cases, the object returned by js_getfunctionobject is not necessarily safe to call and should not be exposed to script. in the javascript language, functions are objects. ...
JS_GetProperty
syntax bool js_getproperty(jscontext *cx, js::handleobject obj, const char *name, js::mutablehandlevalue vp); bool js_getucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, js::mutablehandlevalue vp); bool js_getpropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, js::mutablehandlevalue vp); // added in spidermonkey 1.8.1 name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object to search on for the property. ...
... * or js::handleid name of the property to look up. namelen size_t (in js_getucproperty only) the length of name, in characters; or -1 to indicate that name is null-terminated. vp js::mutablehandlevalue out parameter. on success, *vp receives the current value of the property, or undefined if no such property is found. description js_getproperty examines a
specified js object obj and its prototype chain for a property with the
specified name. it behaves like the javascript expression obj[name]. js_getucproperty is the unicode version of the function. js_getpropertybyid is the same but takes a js::handleid for the property name. in the simplest case, js_getproperty stores the value of the property in *vp and returns true. however, several different hooks can...
JS_GetPropertyAttrsGetterAndSetter
obsolete since jsapi 26this 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. retrieve the attributes, getter, and setter of a
specified property. syntax jsbool js_getpropertyattrsgetterandsetter(jscontext *cx, jsobject *obj, const char *name, unsigned int *attrsp, jsbool *foundp, jspropertyop *getterp, jspropertyop *setterp); jsbool js_getucpropertyattrsgetterandsetter(jscontext *cx, jsobject *obj, const jschar *name, size_t namelen, unsigned int *attrsp, jsbool *foundp, jspropertyop *getterp, jspropertyop *setterp); jsbool js_getpropertyattrsgetterandsetterbyid(jscontext *cx, jsobject *obj, jsid id, unsigned int *attrsp, jsbool *foundp, jspropertyop *getterp, ...
... of the property to examine. namelen size_t (only in js_getucpropertyattrsgetterandsetter) the length of name in characters; or (size_t) -1 to indicate that name is null-terminated. attrsp unsigned int * out parameter. pointer to the storage area into which to place retrieves attributes. foundp jsbool * out parameter. flag indicating whether or not the
specified property was located. getterp jspropertyop * out parameter. on success, *getterp receives a pointer to the getter function for the
specified property. setterp jspropertyop * out parameter. on success, *setterp receives a pointer to the setter function for the
specified property. description see js_getpropertyattributes for details about these functions. the o...
JS_GetPropertyDefault
obsolete since jsapi 26this 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.5 finds a
specified property and retrieves its value or provided default value. syntax bool js_getpropertydefault(jscontext *cx, jsobject *obj, const char *name, jsval def, js::mutablehandle<js::value> vp); bool js_getpropertybyiddefault(jscontext *cx, jsobject *obj, jsid id, jsval def, js::mutablehandle<js::value> vp); name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ...
...h on for the property. name or id const char * or js::handleid name of the property to look up. def js::handlevalue default value if the property is not found. vp js::mutablehandlevalue out parameter. on success, *vp receives the current value of the property, or undefined if no such property is found. description js_getpropertydefault examines a
specified js object obj and its prototype chain for a property with the
specified name. on success, these functions set *vp to the current value of the property, or def if obj has no such property, and return true. on an error or exception, these functions return false, and the value left in *vp is undefined. see also bug 905774 ...
JS_GetPropertyDescriptor
syntax bool js_getpropertydescriptor(jscontext *cx, js::handleobject obj, const char *name, js::mutablehandle<jspropertydescriptor> desc); // added in spidermonkey 31 bool js_getpropertydescriptorbyid(jscontext *cx, js::handleobject obj, js::handleid id, js::mutablehandle<jspropertydescriptor> desc); name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to search for the property. ...
... to search for the property. id const char * or js::handleid the name of the property to look up. desc js::mutablehandle<jspropertydescriptor> out parameter. on success, if no property is found, desc->obj is set to null. if a property is found, *desc receives a description of it. description js_getpropertydescriptor and js_getpropertydescriptorbyid find a
specified property of an object and gets a detailed description of that property on the prototype chain (returned in desc->obj). if desc->obj is null, then this property was not found on the prototype chain. see also mxr id search for js_getpropertydescriptor mxr id search for js_getpropertydescriptorbyid js_getownpropertydescriptor js_getownpropertydescriptorbyid jspropertydescriptor bug 482381 - a...
JS_GetStringCharAt
syntax bool js_getstringcharat(jscontext *cx, jsstring *str, size_t index, char16_t *res); char16_t js_getflatstringcharat(jsflatstring *str, size_t index); name type description cx jscontext * the context in which to create the new string. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. str jsstring * or jsflatstring * the string to get character. index size_t an integer between 0 and 1-less-than the length of the string. res char16_t * (js_getstringcharat only) out parameter. ...
...er must be in a request on this jscontext. str jsstring * or jsflatstring * the string to get character. index size_t an integer between 0 and 1-less-than the length of the string. res char16_t * (js_getstringcharat only) out parameter. on successful, receives the character code. description js_getstringcharat and js_getflatstringcharat get the
specified character from the string str. on successful, js_getstringcharat returns true and stores the character code into *res, otherwise returns false. js_getflatstringcharat always succeeds, and returns the character code. index should not be greater than or equal to the length of str. see also mxr id search for js_getstringcharat mxr id search for js_getflatstringcharat bug 1034627 ...
JS_HasOwnProperty
syntax bool js_hasownproperty(jscontext* cx, handleobject obj, const char* name, bool* foundp) bool js_hasownpropertybyid(jscontext* cx, handleobject obj, handleid id, bool* foundp) name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object to search on for the property. name or id const char * or js::handleid name of the property to look up. ...
...on for the property. name or id const char * or js::handleid name of the property to look up. foundp bool * non-null pointer to a variable of type bool. on success, js_hasownproperty stores true in this variable if obj has an own property with the given name, and false if not. description js_hasownproperty searches an object, obj, for an own property with the
specified name. it behaves like the javascript expression object.hasownproperty(obj, name). js_hasownpropertybyid is the same but takes a js::handleid for the property name. if the property exists, this function sets *foundp to true and returns true. if the object obj has no such property, the function sets *foundp to false and returns true (to indicate that no error occurred). if an error occurs during...
JS_HasProperty
syntax bool js_hasproperty(jscontext *cx, js::handleobject obj, const char *name, bool *foundp); bool js_hasucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, bool *vp); bool js_haspropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, bool *foundp); // added in spidermonkey 1.8.1 name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object to search on for the property. ...
...n js_hasucproperty) the length of name in characters, or -1 to indicate that name is null-terminated. foundp bool * non-null pointer to a variable of type bool. on success, js_hasproperty stores true in this variable if obj has a property with the given name, and false if not. description js_hasproperty searches an object, obj, and its prototype chain, for a property with the
specified name. it behaves like the javascript expression name in obj. js_hasucproperty is the corresponding unicode api. js_haspropertybyid is the same but takes a js::handleid for the property name. if the property exists, this function sets *foundp to true and returns true. if the object obj has no such property, the function sets *foundp to false and returns true (to indicate that no error occurred). i...
JS_LockGCThing
syntax jsbool js_lockgcthing(jscontext *cx, void *thing); // obsolete since jsapi 21 jsbool js_unlockgcthing(jscontext *cx, void *thing); // obsolete since jsapi 21 jsbool js_lockgcthingrt(jsruntime *rt, void *thing); jsbool js_unlockgcthingrt(jsruntime *rt, void *thing); name type description cx jscontext * a context. requires request. ...
...ol js_unlockgcthingrt(jsruntime *rt, void *thing); name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. rt jsruntime * a runtime. thing void * pointer to the item to protect. description js_lockgcthing is a deprecated function that protects a
specified item, thing, associated with an executable script context, cx, from garbage collection. thing is a pointer to a jsdouble, jsstring, or jsobject. js_unlockgcthing removes a lock from a
specified item, thing, allowing it to be garbage collected when the javascript engine determines it is unreachable. js_lockgcthing and js_unlockgcthing are available only for backward compatibility with existing app...
JS_LookupElement
syntax bool js_lookupelement(jscontext *cx, js::handleobject obj, uint32_t index, js::mutablehandlevalue vp); name type description cx jscontext * the context in which to look up the property. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. ...
...dsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to search. index uint32_t the numeric id of the property to look up. vp js::mutablehandlevalue out parameter. on success, *vp receives the stored value of obj[index], or undefined if the element does not exist. description js_lookupelement examines a
specified javascript object, obj, for a numeric property numbered index. note: in the javascript language, numeric properties (also called "elements") are just ordinary properties whose names are numeric strings. for example, obj[6] is always exactly the same as obj["6"]. the ecmascript standard also specifies this behavior: see ecma 262-3 §11.2.1, step 6. so any call to js_lookupelement is equivalent to...
JS_LookupProperty
obsolete since jsapi 37this 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. determine if a
specified property exists. syntax bool js_lookupproperty(jscontext *cx, js::handleobject obj, const char *name, js::mutablehandlevalue vp); bool js_lookupucproperty(jscontext *cx, js::handleobject obj, const char16_t *name, size_t namelen, js::mutablehandlevalue vp); bool js_lookuppropertybyid(jscontext *cx, js::handleobject obj, js::handleid id, js::mutablehandlevalue vp); // added in spidermonkey 1.8.1 bool js_lookupelement(jscontext *cx, js::handleobject obj, uint32_t index, js::mutablehandlevalue vp);...
... the object on which the property was found. this will be either obj or an element on obj's prototype chain. vp js::mutablehandleobject out parameter. on success, *vp receives the stored value of the property, if any. description the functions js_lookupproperty, js_lookupucproperty, js_lookuppropertybyid, js_lookuppropertywithflags, and js_lookuppropertywithflagsbyid search a
specified object, obj, for a property with the given name. these functions all have similar behavior: the search starts with obj and proceeds along the prototype chain. if the property is found, *vp receives the property's stored value, or true if the property has no stored value; and the return value is true. if neither obj nor any of its prototypes have such a property, *vp receives undefined and the...
JS_NewObject
to: if this is null, the new object has no prototype; its __proto__ property is undefined. parent js::handle<jsobject*> pointer to the parent of the new object. the new object's __parent__ property will be a reference to this object. if parent is null, a default parent object is used. obsolete since jsapi 39 description js_newobject creates a new object based on a
specified class. cx is a pointer to a context associated with the runtime in which to establish the new object. clasp is a pointer to an existing class to use for internal methods, such as finalize. the javascript engine selects a prototype object for you. on success, js_newobject returns a pointer to the new object. otherwise it returns null. added in spidermonkey 1.8 js_newobjectwithgivenproto creates ...
...r to a context associated with the runtime in which to establish the new object. clasp is a pointer to an existing class to use for internal methods, such as finalize. the javascript engine selects a prototype object for you. on success, js_newobject returns a pointer to the new object. otherwise it returns null. added in spidermonkey 1.8 js_newobjectwithgivenproto creates a new object with the
specified prototype. if null is passed as proto, the new object will have a prototype with the js value of null. to create a new object as a property of an existing object, use js_defineobject, a convenience function that combines js_newobject and js_defineproperty. obsolete ? starting with gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5), you can create a new object in a specific compartment ...
JS_ObjectIsRegExp
if so, js_objectisregexp returns true. otherwise it returns false. ...
...if so, js_objectisregexp returns true. otherwise it returns false. ...
JS_SaveExceptionState
that object may then be used to restore again the context using js_restoreexceptionstate, or discarded using js_dropexceptionstate. either of those two functions frees any memory used by the jsexceptionstate. ...
..._saveexceptionstate(jscontext *cx); 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. description saves the current exception state (that is, any pending exception, or a cleared exception state) associated with the
specified context cx, and returns a jsexceptionstate object holding this state. that object may then be used to restore again the context using js_restoreexceptionstate, or discarded using js_dropexceptionstate. either of those two functions frees any memory used by the jsexceptionstate. the jsexceptionstate created by this function automatically roots any pending exception object which needs to be protect...
JS_SetContextCallback
nctions. this is the context which was just created, or is about to be destroyed. for example, the callback my call js_getcontextprivate(cx) in order to free up resources previously allocated by js_setcontextprivate. contextop unsigned see jscontextop. for future compatibility 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 re...
...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 returns false, the js engine will halt with an assertion. description js_setcontextcallback specifies a callback function that is automatically called when jscontexts are created or destroyed. only one callback function may be
specified per js runtime. this function returns the previous context callback, if any, else null. see also mxr id search for js_setcontextcallback js_newcontext js_destroycontext js_destroycontextnogc js_destroycontextmaybegc js_getcontextprivate js_setcontextprivate bug 845545 ...
JS_ValueToBoolean
name type description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v jsval the value to convert. bp jsbool * out parameter. on success, *bp receives the converted boolean value. description js_valuetoboolean converts a
specified javascript value, v, to a boolean value. it implements the toboolean operator
specified in ecma 262-3 §9.2. on success, js_valuetoboolean stores the converted value in *bp and returns js_true. on error or exception, it returns js_false, and the value left in *bp is undefined. for versions greater than jsversion_1_2, all objects convert to js_true, even boolean wrapper objects like the one produ...
...see related discussion on google groups. ...
JS_ValueToECMAInt32
obsolete since jsapi 28this 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. convert a javascript value to an integer type as
specified by the ecmascript standard. syntax jsbool js_valuetoecmaint32(jscontext *cx, jsval v, int32 *ip); jsbool js_valuetoecmauint32(jscontext *cx, jsval v, uint32 *ip); jsbool js_valuetouint16(jscontext *cx, jsval v, uint16 *ip); name type description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v jsval the javascript value to convert. ip int32 * or uint32 * or int16 * out parameter. on su...
...requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v jsval the javascript value to convert. ip int32 * or uint32 * or int16 * out parameter. on success, *ip receives the converted value. description js_valuetoecmaint32, js_valuetoecmauint32, and js_valuetouint16 convert a javascript value to various integer types as
specified in the ecmascript specification. js_valuetoecmaint32 implements the toint32 operator
specified in ecma 262-3 9.5. js_valuetoecmauint32 implements the touint32 operator
specified in ecma 262-3 9.6. js_valuetouint16 implements the touint16 operator
specified in ecma 262-3 9.7. all three functions first convert v to a floating-point number as if by calling js_valuetonumber; nan values are ...
JS_ValueToId
s js::handlestring the js string to convert. index uint32_t an unsigned integer index of array to convert. chars js::twobytechars the string to convert. key jsprotokey the prototype key to convert. idp js::mutablehandleid out parameter. on success, *idp receives the converted jsid. description js_valuetoid converts a
specified js::value, v, to a jsid. if v is an integer, *idp receives an integer jsid. otherwise, if e4x support is enabled and v is an object, *idp receives an object jsid. otherwise, *idp receives an interned string jsid based on the value of v. if v is not a string, it is converted to a string as if by calling js_valuetostring. js_stringtoid and js_charstoid convert a
specified string to a jsid. js_ind...
...a jsid. if v is an integer, *idp receives an integer jsid. otherwise, if e4x support is enabled and v is an object, *idp receives an object jsid. otherwise, *idp receives an interned string jsid based on the value of v. if v is not a string, it is converted to a string as if by calling js_valuetostring. js_stringtoid and js_charstoid convert a
specified string to a jsid. js_indextoid converts a
specified integer index to an integer jsid. js::protokeytoid converts a
specified prototype key to a jsid. on success, js_valuetoid stores the converted value in *idp and returns true. otherwise it returns false. the inverse of js_valuetoid is js_idtovalue. mxr id search for js_valuetoid see also mxr id search for js_idtovalue mxr id search for js_stringtoid mxr id search for js_indextoid mxr id...
JS_ValueToInt32
name type description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a 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 infinity, 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 conver...
...s_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 differently than js_valuetoecmaint32 and js::toint32. this routine was added for layers-based graphics programming in netscape 4, but unless you know you need its rounding behavior, it is best to avoid it in favour of js::toint32. js::toint32 rounds as
specified in ecma 262-3 §9.5, while this routine rounds by adding 0.5 to the converted float-point number and truncating the result at the decimal point. js::toint32 will also convert nan (and anything that converts to nan, such as an array of strings) to 0, whereas this routine would report an error. see also js_convertarguments js::toint32 bug 933946 ...
JS_ValueToString
convert a jsval to a jsstring. syntax jsstring * js_valuetostring(jscontext *cx, jsval v); name type description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v jsval the value to convert. description js_valuetostring converts a
specified javascript value, v, to a string. it implements the tostring operator
specified in ecma 262-3 §9.8. the result 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 res...
...this might be "nan", "infinity", or "-infinity". 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. ...
Parser API
properties of the reflect object the reflect object currently consists of a single method. reflect.parse(src[, options]) coerces src to a string and parses t...
... string; } an xml cdata node. interface xmlcomment <: xml { type: "xmlcomment"; contents: string; } an xml comment. interface xmlprocessinginstruction <: xml { type: "xmlprocessinginstruction"; target: string; contents: string | null; } an xml processing instruction. builder objects the optional builder parameter to reflect.parse() makes it possible to construct user-
specified data from the parser, rather than the default node objects. builder objects may contain any of the callback methods described in this section. each callback can produce any custom, user-defined datatype; these are referred to below as customexpression, customstatement, etc. note: because this library uses null for optional nodes, it is recommended that user-defined datatypes not use null as a r...
TPS Tab Lists
a tabs asset list is an array of objects with the following keys: uri: the uri of the tab, required. title: the title of the tab, optional. if
specified, only used during verify actions. profile: the name of the profile the tab belongs to. required for verify actions. for example: var tabs1 = [ { uri: "http://hg.mozilla.org/automation/crossweave/raw-file/2d9aca9585b6/pages/page1.html", title: "crossweave test page 1", profile: "profile1" }, { uri: "data:text/html,<html><head><title>hello</title></head><body>hello</body></html>", title: "hello", profile: "profile1" } ]; tab lists and phase actions tabs cannot be modified or deleted, only added or verified with the following functions: tabs.add - opens the
specified tabs in the browser window. tabs.verif...
...est page 1", profile: "profile1" }, { uri: "data:text/html,<html><head><title>hello</title></head><body>hello</body></html>", title: "hello", profile: "profile1" } ]; tab lists and phase actions tabs cannot be modified or deleted, only added or verified with the following functions: tabs.add - opens the
specified tabs in the browser window. tabs.verify - verifies that the
specified tabs can be found in the
specified profile. tabs.verifynot - verifies that the
specified tabs cannot be found in the
specified profile. there are a handful of static pages at http://hg.mozilla.org/services/tps/file/tip/pages which can be used for tab testing, and data: url's can be used as well. example see the tps tabs unit test: http://hg.mozilla.org/services/tps/f...s/test_tabs.js ...
Manipulating bookmarks using Places
t. specifying default_index as the index at which to insert the new folder places it at the end of the list. you can easily change this code to insert the new folder into the bookmarks toolbar by changing bookmarksmenufolder to another folder attribute. creating a new bookmark to create a new bookmark, use the nsinavbookmarksservice.insertbookmark() method. the uri for the bookmark needs to be
specified using an nsiuri object. var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("http://google.com/", null, null); var newbkmkid = bmsvc.insertbookmark(newfolderid, uri, bmsvc.default_index, ""); this example instantiates the nsiioservice and uses it to create an nsiuri referring to the google w...
...marksservice.getbookmarkidsforuri() method. var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var uri = ios.newuri("http://google.com/", null, null); var bookmarksarray = bmsvc.getbookmarkidsforuri(uri, {}); after executing this code, the array bookmarksarray contains the ids of all bookmarks that refer to the
specified uri (in this case, "http://google.com"). manipulating existing items there are a number of convenient methods you can use to make changes to existing bookmarks and bookmark folders. this section covers some of them. the item title to change the title of a bookmark or bookmark folder, you use the nsinavbookmarksservice.setitemtitle() method. bmsvc.setitemtitle(newbkmkid, "new title"); this ...
Places utilities for JavaScript
ean isreadonlyfolder(anode) parameters anode the node to check. return type return true if the node is a folder, false otherwise. getindexofnode() gets the index of a node within its parent container int getindexofnode(anode) parameters anode the node to look up return type returns the index of the node within its parent container, or -1 if the node was not found or the node
specified has no parent. wrapnode() string-wraps a result node according to the rules of the
specified content type. string wrapnode(anode, string atype, nsiuri aoverrideuri) parameters anode the result node to wrap (serialize) atype the content type to serialize as aoverrideurioptional used instead of the node's uri if provided. this is useful for wrapping a...
...true if it's safe to open the node in the browser, false otherwise. getquerystringforfolder() helper for getting a serialized places query for a particular folder. getquerystringforfolder(int afolderid) parameters afolderid the folder id to get a query for. return type return string serialized place uri getdescriptionfromdocument() get the description associated with a document, as
specified in a <meta> element. getdescriptionfromdocument(doc) parameters doc a dom document to get a description for return type returns a description string if a meta element was discovered with a "description" or "httpequiv" attribute, empty string otherwise. setpostdataforbookmark() set the post data associated with a bookmark, if any. used by post keywords. setpostdataforbookmark(int ab...
Querying Places
ry object. this item is an array of folder ids from the bookmark service. typically, you will only have one folder id in this list, which will given you the contents of that folder. you can set multiple folders and the result will be the intersection of all the folders. for sorting, you will generally want to use sort_by_none (the default) since this will return items in their "natural" order as
specified by the user in the bookmarks manager. other sortings will work, however. for bookmark queries you will generally want no query parameters to retrieve all items from the requested folder(s). when you specify exactly one folder and no query parameters, the system will be more efficient querying and keeping the results up-to-date since this maps to exactly one bookmark folder. // |query| and |opti...
...marked. when a "place:" uri is bookmarked, it will expand to the results of the query when it is opened by the user. the original objects can be deserialized from the string using querystringtoqueries. be careful, querystringtoqueries may not return any query objects if the string was empty. your code should handle this case. there will always be an options structure returned. if no options were
specified, it will have the default values. if there were no query parameters
specified but the input string was not empty (there were options) you may get one query object returned, containing the default query values. example of serializing and deserializing two queries and an options object: let querystring = placesutils.history.queriestoquerystring([query1, query2], 2, options); let queriesref = { }...
Using the Places livemark service
ri("http://example.com/"), uri("http://example.com/rss.xml"), -1); the first parameter is the id of the folder in which to create the livemark. the second parameter is the livemark's name as it will appear in the bookmark's title. the third parameter is the uri of the site the livemark was created from (
specified as an nsiuri object. fourth argument is the uri of the actual rss feed. the last argument takes in the index to insert at, or -1 to append the new livemark to the end of the folder. you can convert a string into an nsiuri using nsiioservice. when creating livemarks during startup, you should use the nsilivemarkservice.createlivemarkfolderonly() to avoid http traffic. this creates the encapsulatin...
...) { // it's a livemark } else { // it's not a livemark } accessing the container's site uri the nsilivemarkservice.getsiteuri() method lets you obtain the nsiuri of the website associated with a livemark container. var siteuri = livemarkservice.getsiteuri(newlvmkid); //newlvmkid = see "create a new livemark" for more detail. getsiteuri() returns null if there is no uri for the
specified livemark. nsilivemarkservice.setsiteuri() sets the uri of the website associated with a livemark container. livemarkservice.setsiteuri(newlvmkid, uri("http://newuri.com/"); //newlvmkid = see "create a new livemark" for more detail. accessing a livemark's feed uri nsilivemarkservice.getfeeduri() gets the uri of the syndication feed associated with a livemark container. var feedu...
Components.utils.Sandbox
andbox: var sandbox = components.utils.sandbox(principal[, options]); using new components.utils.sandbox(...) to create a sandbox has the same effect as calling sandbox(...) without new. the created sandbox is simply an empty javascript object marked as having been created by the restricted privilege principal. you can then use it with evalinsandbox() to make it the global scope object for the
specified script. principal the security principal defined for a sandbox determines what code running in that sandbox will be allowed to do. the principal may be one of four types: the system principal, a content principal, an expanded principal, or a null principal. see security checks for more information on security principals. system principal to specify the system principal, you can create it usi...
...sing a string uri. window objects and nsiprincipal carry additional information such as origin attributes and same-origin privilege changes caused by setting document.domain. example of obtaining content principal from the window: var principal = gbrowser.selectedtab.linkedbrowser.contentprincipal; var sandbox = components.utils.sandbox(principal); expanded principal an expanded principal is
specified as an array of the principals it subsumes. each item in the array should be an nsiprincipal, a dom window, or a uri. so this can be simply an array with a single element. for example the content principal above can be made expanded/extended like so: var principal = [gbrowser.selectedtab.linkedbrowser.contentprincipal]; // this is now an expanded (aka extended) principal var sandbox = components.
Components object
esults array of known result codes by name returncode pending result for current call stack current javascript call stack utils provides access to several useful features utils.atline provides access to the value of the atline property in the javascript environment. utils.createobjectin creates a new object in the scope of the
specified object's compartment. may only be called from javascript code. utils.evalinsandbox runs javascript code in a sandbox, usually used to run code with restricted privileges. utils.forcegc forces a garbage collection cycle. utils.getglobalforobject returns the global object with which a given object is associated (through its prototype chain at birth,...
...k reference for the object passed in. utils.import loads a javascript module into the current script, without sharing a scope. utils.lookupmethod looks up a native (i.e. declared in the interface) method or property of an xpcom object. serves the same purpose as xpcnativewrapper. utils.makeobjectpropsnormal ensures that all functions come from the
specified object's scope, and aren't cross-compartment wrappers. may only be called from javascript code. utils.methodjit obsolete since gecko 24.0 provides access to the value of the methodjit property in the javascript environment. utils.methodjit_always obsolete since gecko 24.0 provides access to the value of the methodjit_always property in the javascript en...
XPCShell Reference
bles the "interactive" mode) -f this option specifies a script file to execute. xpcshell terminates upon script completion. you can specify multiple js files to execute by using multiple -f arguments, and the scripts will be executed in the order encountered. furthermore, xpcshell looks for xpcshell.js in the current directory. if that file is found, it is executed before any other js files
specified. -g this option specifies which gecko runtime environment directory (gredir) to use for xpcom. -i this option turns on the "interactive" mode -s this option toggles the javascript strict option on and off. by default it is off. -v version this allows you to specify a specific version of js to use, and should be set to an integral value
specified by the jsversion enumerated type. for...
... useful functions that can be invoked from the command line: clear(object) clear() removes all properties from an object. for example, if you created anobject with a property named value and then called clear(anobject), the property value would no longer exist. gc(heapdumpfilename) gc() will invoke garbage collection. it takes an optional argument that can be used to dump the heap to. if
specified, it should equate to a valid filename. load(scriptfilename) load() allows you to load and run a script from the command line. for example, load("myscript.js") will execute the script myscript.js in the current directory. print(obj1, obj2, …) print() is useful to print something to the screen. it dumps whatever is passed to the screen, putting spaces between arguments and appending a n...
Language bindings
ect features. its interface is defined at js/xpconnect/idl/xpccomponents.idl.components.utils.cloneintothis function provides a safe way to take an object defined in a privileged scope and create a structured clone of it in a less-privileged scope. it returns a reference to the clone:components.utils.createobjectincomponents.utils.createobjectin creates a new javascript object in the scope of the
specified object's compartment.components.utils.evalinsandboxthe evalinsandbox() function enables you to evaluate javascript code inside a sandbox you've previously created using the components.utils.sandbox constructor.components.utils.evalinwindowthis function enables code running in a more-privileged javascript context to evaluate a string in a less-privileged javascript context. the result is structure...
...ion": a mechanism that filters out certain changes to the objects that could cause them to behave in unexpected ways. for example, privileged code using an xray to a dom object sees only the original, native version of the dom object. any expando properties are not visible, and if any native properties have been redefined, this has no effect.components.utils.makeobjectpropsnormalensures that the
specified object's methods are all in the object's scope, and aren't cross-component wrappers.components.utils.reporterrorcomponents.utils.reporterror reports a javascript error object to the error console, and returns. it is meant for use by extension developers who have exception handler blocks which want to "eat" an exception, but still want to report it to the console.components.utils.sandboxcomponents...
IAccessibleHyperlink
[propget] hresult anchor( [in] long index, [out] variant anchor ); parameters index a 0 based index identifies the anchor when, as in the case of an image map, there is more than one link represented by this object. the valid maximal index is indicated by iaccessibleaction.nactions(). anchor this is an implementation dependent value. for example, for a text link this method could ret...
... the substring is overridden with link behavior, and for an image link this method could return an iunknown variant for iaccessibleimage. see the section about. return value e_invalidarg if bad [in] passed, [out] value is null. s_false if there is nothing to return, [out] value is null. s_ok. anchortarget() returns an object representing the target of the link, as appropriate for the link at the
specified index. [propget] hresult anchortarget( [in] long index, [out] variant anchortarget ); parameters index a 0 based index identifies the anchor when, as in the case of an image map, there is more than one link represented by this object. the valid maximal index is indicated by iaccessibleaction.nactions(). anchortarget this is an implementation dependent value. for example this method could re...
IAccessibleHypertext
. a typical implementation is to implement this interface on the smallest text object such as a paragraph of text. method overview [propget] hresult hyperlink([in] long index, [out] iaccessiblehyperlink hyperlink ); [propget] hresult hyperlinkindex([in] long charindex, [out] long hyperlinkindex ); [propget] hresult nhyperlinks([out] long hyperlinkcount ); methods hyperlink() returns the
specified link. the returned iaccessiblehyperlink object encapsulates the hyperlink and provides several kinds of information describing it. [propget] hresult hyperlink( [in] long index, [out] iaccessiblehyperlink hyperlink ); parameters index this 0 based index specifies the hyperlink to return. hyperlink if the given index is valid, that is it lies in the interval from 0 to the number of links minu...
...siblehyperlink object encapsulates the hyperlink and provides several kinds of information describing it. [propget] hresult hyperlink( [in] long index, [out] iaccessiblehyperlink hyperlink ); parameters index this 0 based index specifies the hyperlink to return. hyperlink if the given index is valid, that is it lies in the interval from 0 to the number of links minus one, a reference to the
specified hyperlink object is returned. if the index is invalid then a null pointer is returned. return value e_invalidarg if bad [in] passed, [out] value is null. s_ok. hyperlinkindex() returns the index of the hyperlink that is associated with this character index. this is the case when a link spans the given character index. [propget] hresult hyperlinkindex( [in] long charindex, [out] long hyperlin...
imgIContainer
klooponceanimmode 2 kdisposeclearall -1 "disposal" method indicates how the image should be handled before the subsequent image is displayed. do not change these without looking at the implementations using them, struct gif_struct::disposal_method and gif_write() in particular. clear() the whole image, revealing. obsolete since gecko 2.0 kdisposenot
specified 0 leave frame, let new frame draw() on top. obsolete since gecko 2.0 kdisposekeep 1 leave frame, let new frame draw() on top. obsolete since gecko 2.0 kdisposeclear 2 clear() the frame's area, revealing bg. obsolete since gecko 2.0 kdisposerestoreprevious 3 restore the previous(composited) frame. obsolete since gecko 2.0 kblendsource...
...* variety. return value missing description exceptions thrown missing exception missing description decodingcomplete() obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) void decodingcomplete(); parameters none. exceptions thrown missing exception missing description native code only!draw draw the current frame on to the context
specified. void draw( in gfxcontext acontext, in gfxgraphicsfilter afilter, [const] in gfxmatrix auserspacetoimagespace, [const] in gfxrect afill, [const] in nsintrect asubimage, [const] in nsintsize aviewportsize, in pruint32 aflags ); parameters acontext the thebes context to draw the image to. afilter the filter to be used if we're scaling the image. auserspacetoimage...
imgIEncoder
quality of compression, 0-100 (worst-best). quality >= 90 prevents down-sampling of the color channels. methods addimageframe() 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 ); 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 bytes per row in the image. normally (width*3) or (width*4), depending on your input format, but some data uses padding at the end of each row, which would be extra. frameformat missing description frameoptions missing description encodeclipboardimage() obsolete since ...
...oardimage 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 bytes per row in the image. normally (width*3) or (width*4), depending on your input format, but some data uses padding at the end of each row, which would be extra. inputformat one of input_format_* constants specifying the format of data. outputoptions semicolon-delimited list of name...
mozISpellCheckingEngine
personaldictionary mozipersonaldictionary the personal dictionary. providespersonaldictionary boolean does the engine provide its own personaldictionary? read only. provideswordutils boolean does the engine provide its own word utilities? read only. methods adddirectory() adds all the dictionaries in the
specified directory to the spell checker. void adddirectory( nsifile dir ); parameters dir an nsifile object indicating the directory from which to add dictionaries. check() checks a word to determine if it's spelled correctly. when this changes, the spell checker sends a "spellcheck-dictionary-update" notification. boolean check( in wstring word ); parameters word a wo...
...rylist( [array, size_is(count)] out wstring dictionaries, out pruint32 count ); parameters dictionaries a list of dictionaries supported by this spell checker. the dictionary attribute can be set to one of these. each dictionary name is typically but not always a locale code. count the length of dictionaries. removedirectory() removes all the dictionaries in the
specified directory from the spell checker. void removedirectory( nsifile dir ); parameters dir an nsifile object indicating the directory whose spell checkers are to be removed from the spell checker. suggest() gets a list of suggestions for a misspelled word. when this changes, the spell checker sends a "spellcheck-dictionary-update" notification. void suggest( in wstring word, [ar...
mozITXTToHTMLConv
unsigned long enables conversion of smilies and non-ascii special characters. kstructphrase unsigned long enables conversion of text attributes, such as converting "*some text*" to boldfaced "some text" by wrapping in the html <strong> element. kurls unsigned long enables automatic addition of hyperlinks for urls in the text. methods scantxt() scans the
specified text, applying the requested conversions and outputting html. wstring scantxt( in wstring text, in unsigned long whattodo ); parameters text the original, plain text to scan and convert into html. whattodo a bit field composed of the conversion control attributes indicating what conversions to apply. return value the html version of the
specified string. scanhtml() scans the spe...
...thod, as doing so generates html that is non-standard. wstring scanhtml( in wstring text, in unsigned long whattodo ); parameters text the original, user-edited html. whattodo a bit field composed of the conversion control attributes indicating what conversions to apply. return value a normalized version of the original html string. citeleveltxt() returns the "cite level" of the
specified text; that is, it indicates how many levels of email reply quotes are used, when the text uses "quote" characters (such as ">") at the beginning of the line to indicate cite levels. unsigned long citeleveltxt( in wstring line, out unsigned long loglinestart ); parameters line the original line of text, which may begin with one or more cite characters such as ">". loglinestart on outp...
nsIAccessibleDocument
bsolete since gecko 2.0 nsiaccessnode getcachedaccessnode(in voidptr auniqueid); native code only! obsolete since gecko 2.0 astring getnamespaceuriforid(in short namespaceid); attributes attribute type description caretaccessible nsiaccessible read only. obsolete since gecko 1.9 doctype astring the doc type of the document, as
specified in the document. read only. domdocument nsidomdocument the nsidomdocument interface associated with this document. read only. note: renamed from document in gecko 2.0 iseditable boolean true if the document is live in an editor. false if the document is being displayed but not edited. if a <div> is contenteditable, then it has its own document, with iseditable == tru...
... gecko 2.0 iseditable boolean true if the document is live in an editor. false if the document is being displayed but not edited. if a <div> is contenteditable, then it has its own document, with iseditable == true. read only. obsolete since gecko 1.9 mimetype astring the mime type of the document. read only. title astring the title of the document, as
specified in the document. read only. url astring the url of the document read only. window nsidomwindow the nsidomwindow that the document resides in. read only. windowhandle voidptr the window handle for the os window the document is being displayed in. for example, in windows you can static cast it to an hwnd. read only. native code only! methods ...
nsIAccessibleText
range( in long offset, out long rangestartoffset, out long rangeendoffset ); parameters offset rangestartoffset rangeendoffset return value getcharacteratoffset() it would be better to return an unsigned long here, to allow unicode chars > 16 bits. wchar getcharacteratoffset( in long offset ); parameters offset return value getcharacterextents() returns the bounding box of the
specified position. the virtual character after the last character of the represented text, that is the one at position length is a special case. it represents the current input position and will therefore typically be queried by at more often than other positions. because it does not represent an existing character its bounding box is defined in relation to preceding characters. it should be roughly equiv...
...gto( in long startindex, in long endindex, in unsigned long scrolltype ); parameters startindex 0-based character offset. endindex 0-based character offset - the offset of the character just past the last character of the string. scrolltype defines how to scroll (see nsiaccessiblescrolltype.constants for available constants) scrollsubstringtopoint() moves the top left of a substring to a
specified location. void scrollsubstringtopoint( in long startindex, in long endindex, in unsigned long coordinatetype, in long x, in long y ); parameters startindex 0-based character offset. endindex 0-based character offset - the offset of the character just past the last character of the string. coordinatetype specifies the coordinates origin (for available constants refer to nsiaccessibleco...
nsIAccessibleTreeCache
invalidatecac...
...invalidatecache() invalidates the number of cached treeitem accessibles. void invalidatecache( in long arow, in long acount ); parameters arow row index the invalidation starts from. ...
nsIApplicationCache
ication cache, which stores resources for offline use. 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) each application cache has a unique client id for use with nsicacheservice.opensession() method, to access the cache's entries. each entry in the cache can be marked with a set of types,
specified in the constants section. all application caches with the same group id belong to a cache group. each group has one "active" cache that will service future loads. inactive caches are removed from the cache when no longer referenced. method overview void activate(); void addnamespaces(in nsiarray namespaces); void discard(); void gatherentries(in pruint32 typebits, out unsigned long count...
...namespaces an nsiarray of nsiapplicationcachenamespace objects describing the namespaces to add to the cache. discard() discards this application cache. this removes all resources it has cached. if this is the active application cache for the group, the group is removed. void discard(); parameters none. gatherentries() returns a list of entries in the cache whose type matches one or more of the
specified types. void gatherentries( in pruint32 typebits, out unsigned long count, [array, size_is(count)] out string keys ); parameters typebits a bit field indicating the types against which to match. see constants for a list of types. count on return, indicates how many matching entries were found. keys an array of the keys matching one or more of the types indicated by typebits. getmatchingna...
nsIAsyncStreamCopier
d 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 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...
...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 destination for the data. atarget specifies the thread on which the copy will occur. a null value is permitted and causes the copy to occur on an un
specified background thread. asourcebuffered true if asource implements nsiinputstream.readsegments(). asinkbuffered true if asink implements nsiinputstream.writesegments() . achunksize specifies how many bytes to read and write at a time. this controls the granularity of the copy operation. this value should match the segment size of any buffered streams involved in the operation. aclosesource true if as...
nsICacheEntryDescriptor
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 only. predicteddatasize print64 stores the content-length
specified in the http header for this entry. checked before we write to the cache entry, 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 nscachestoragepolic...
...locking, unbuffered input stream. openoutputstream() this method opens blocking output stream to cache data. this will fail if the cache entry is not stream based. use the stream transport service to asynchronously write to this stream on a background thread. the returned stream may implement nsiseekablestream. if opening an output stream to existing cached data, the data will be truncated to the
specified offset. nsioutputstream openoutputstream( in unsigned long offset ); parameters offset write starting from this offset into the cached data. an offset beyond the end of the stream has undefined consequences. return value returns blocking, unbuffered output stream. setdatasize() this method sets the cache entry data size. this will fail if the cache entry is stream based. void setdatasize( ...
nsICacheSession
oid asyncopencacheentry( in acstring key, in nscacheaccessmode accessrequested, in nsicachelistener listener, [optional] in boolean nowait ); parameters key the key for cache entry. accessrequested the requested access. listener the cache listener to be notified. nowait do not wait for the cache entry when it is in use and waits for validation. doomentry() asynchronously dooms an entry
specified by the key. void doomentry( in acstring key, in nsicachelistener listener ); parameters key the key for cache entry. listener the cache listener to be notified (may be null). evictentries() this method evicts all entries for this session's clientid according to its storagepolicy. void evictentries(); parameters none. isstorageenabled() this method checks if the cache devices implied by the...
...instantiation if they don't already exist. prbool isstorageenabled(); parameters none. return value returns whether any of the cache devices implied by the session storage policy are currently enabled for instantiation or not, depending on their existence. opencacheentry() this method gives a synchronous cache access. it returns a unique descriptor each time it is called, even if the same key is
specified. when called by multiple threads for write access, only one writable descriptor will be granted. if blockingmode is set to false, it will return ns_error_cache_wait_for_validation rather than block when another descriptor has been given write access but hasn't validated the entry yet. note: if at all possible, you should use asyncopencacheentry() instead of calling opencacheentry(), in order to a...
nsICollection
ms from the collection. void clear(); parameters none. count() returns the number of items in the collection. pruint32 count(); parameters none. return value number of items in the list. enumerate() returns an nsienumerator that lets you iterate over the items in the collection. nsienumerator enumerate(); parameters none. return value an nsienumerator. getelementat() returns the element at the
specified index into the collection. nsisupports getelementat( in pruint32 index ); parameters index the index position of the item to be returned. return value nsisupports item at the index position. queryelementat() performs a queryinterface on the item at the
specified index into the collection. void queryelementat( in pruint32 index, in nsiidref uuid, [iid_is(uuid),retval] out nsqire...
...l] out nsqiresult result ); parameters index position of the item to be queried. uuid nsiidref of the item. result comparison result of the previous two parameters. removeelement() removes an item from the collection. void removeelement( in nsisupports item ); parameters item nsisupports item to be removed from the list. setelementat() replaces an item at a
specified index in the collection with a new one. void setelementat( in pruint32 index, in nsisupports item ); parameters index index position where the new item will be set. item the nsisupports item to be set in that position. remarks nsienumerator is a broken interface, and nsisimpleenumerator should be used in its place. see also nsisupports nsienumerator nsisimpleenumerator ...
nsICommandLine
ormalized to -flag. /flag:param are normalized to -flag param. on unix/linux and mac os x, flags of the form --flag are normalized to -flag, and flags of the form --flag=param are normalized to the form -flag param. astring getargument( in long aindex ); parameters aindex the argument to retrieve. this index is 0-based, and does not include the application name. return value the value of the
specified argument. this is the full text of that argument, so if the argument is a flag, the returned value is "-flag [<flagvalue>]". exceptions thrown ns_error_invalid_arg the
specified index is out of bounds. handleflag() finds the
specified flag, removing it from the array of flags. reports whether or not the
specified flag was found. this is useful for boolean flags; that is, flags that don't accept...
...g to be handled. this is useful for processing flags that accept a value. this is, essentially, a helper method that combines findflag() and removearguments() into one operation. astring handleflagwithparam( in astring aflag, in boolean acasesensitive ); parameters aflag the flag name to find and remove. acasesensitive whether to do case-sensitive flag search. return value the value of the
specified flag, an empty string if the flag's value is the empty string, or null if the
specified parameter wasn't found. exceptions thrown ns_error_invalid_arg the
specified flag has no value. removearguments() removes a range of arguments from the command line; this is typically done once those arguments have been handled. void removearguments( in long astart, in long aend ); parameters astart th...
nsIContentView
e reset to the default. read only. scrolly float horizontal scroll offset in chrome-document css pixels. read only. viewportheight float height of the viewport in chrome-document css pixels. read only. viewportwidth float width of the viewport in chrome-document css pixels. read only. methods scrollby() scrolls the content view by the
specified number of chrome-document css pixels along each axis. fails if the view isn't valid. void scrollby( in float dxpx, in float dypx ); parameters dxpx the number of css pixels to scroll on the x axis; specify a positive value to scroll to the right or a negative value to scroll to the left. dypx the number of css pixels to scroll on the y axis; specify a positive value to scroll down or...
... valid. void scrollby( in float dxpx, in float dypx ); parameters dxpx the number of css pixels to scroll on the x axis; specify a positive value to scroll to the right or a negative value to scroll to the left. dypx the number of css pixels to scroll on the y axis; specify a positive value to scroll down or a negative value to scroll up. scrollto() scrolls the content view to the
specified position, in chrome-document css pixels. fails if the view isn't valid. void scrollto( in float xpx, in float ypx ); parameters xpx the x coordinate to scroll to, in css pixels. ypx the y coordinate to scroll to, in css pixels. setscale() sets the content view's scale for each axis. void setscale( in float xscale, in float yscale ); parameters xscale horizontal scaling ...
nsIContentViewManager
loat aleftsize, [optional] out unsigned long alength, [retval, array, size_is(alength)] out nsicontentview aresult); attributes attribute type description rootcontentview nsicontentview the root content view. read only. methods getcontentviewsin() returns an array of nsicontentview objects representing all of the content views that intersect with the
specified rectangle in the browser. note: the rectangle is
specified using an anchor point, then four distances to indicate how far in each direction to expand the rectangle. this lets you, for example, take the coordinates at which the user clicked (or touched) the screen, and expand outward to create a rectangle from that point. pixels are in chrome device pixels and are relative to the browser element...
...oordinate of the anchor point of the rectangle, in css pixels. atopsize the distance upward from the y anchor to expand the rectangle. arightsize the distance to the right from the x anchor to expand the rectangle. abottomsize the distance downward from the y anchor to expand the rectangle. aleftsize the distance to the left from the x anchor to expand the rectangle. alength optional if
specified, on return this parameter indicates the number of nsicontentview objects returned in the aresult array. aresult on return, an array of nsicontentview objects representing the content views in the
specified rectangle. ...
nsICookieManager
n ablocked, in jsval aoriginattributes); void removeall(); attributes attribute type description enumerator nsisimpleenumerator called to enumerate through each cookie in the cookie list. the objects enumerated over are of type nsicookie. read only. methods remove() this method is called to remove an individual cookie from the cookie list,
specified by host, name, and path. if the cookie cannot be found, no exception is thrown. typically, the arguments to this method will be obtained directly from the desired nsicookie object. void remove( in autf8string ahost, in acstring aname, in autf8string apath, in boolean ablocked, in jsval aoriginattributes ); parameters ahost the host or domain for which the cookie was set. see nsic...
... desired nsicookie object. void remove( in autf8string ahost, in acstring aname, in autf8string apath, in boolean ablocked, in jsval aoriginattributes ); parameters ahost the host or domain for which the cookie was set. see nsicookiemanager2.add() for a description of acceptable host strings. if the target cookie is a domain cookie, a leading dot must be present. aname the name
specified in the cookie. apath the path for which the cookie was set. ablocked indicates if cookies from this host should be permanently blocked. aoriginattributes the originattributes of this cookie. removeall() this method is called to remove all cookies from the cookie list. void removeall(); parameters none. see also nsicookie nsicookie2 nsicookiemanager2 nsicookiepermission ...
nsICookieManager2
ady exists. boolean cookieexists( in nsicookie2 acookie ); parameters acookie the cookie to look for. return value returns true if a cookie was found which matches the host, path, and name fields of acookie. countcookiesfromhost() returns the number of cookies that would be returned to a given host. this ignores the cookie flags isdomain, issecure, and ishttponly. therefore, if the
specified host is "weather.yahoo.com", host or domain cookies for "weather.yahoo.com" and "yahoo.com" would both be counted, while a cookie for "my.weather.yahoo.com" would not. unsigned long countcookiesfromhost( in autf8string ahost ); parameters ahost the host string to look for, such as "google.com". this should consist only of the host portion of the uri and should not contain a leading dot, ...
...or. acountfromhost the number of cookies found whose hosts are the same as, or subdomains of, the host field of acookie. return value true if a cookie was found which matches the host, path, and name fields of acookie. getcookiesfromhost() returns an enumerator of cookies that would be returned to a given host, ignoring the cookie flags isdomain, issecure, and ishttponly. therefore, if the
specified host is "weather.yahoo.com", host or domain cookies for "weather.yahoo.com" and "yahoo.com" would both be returned, while a cookie for "my.weather.yahoo.com" would not. nsisimpleenumerator getcookiesfromhost( in autf8string ahost ); parameters ahost the host string to look for, such as "google.com". this should consist only of the host portion of the uri and should not contain a leading ...
nsIDOMHTMLSourceElement
this attribute must be present. note that dynamically manipulating this value after the page has loaded has no effect on the containing element; instead, change the src attribute of that element (audio or video) instead. type domstring the type attribute gives the type of the media resource, to help the user agent determine if it can play this media resource before fetching it. if
specified, its value must be a valid mime type. the codecs parameter may be
specified and might be necessary to specify exactly how the resource is encoded. media unimplemented domstring the media attribute gives the intended media type of the media resource, to help the user agent determine if this media resource is useful to the user before fetching it. its value must be a valid media quer...
...media resource is useful to the user before fetching it. its value must be a valid media query. example <video controls> <source src="foo.webm" type="video/webm; codecs="vp9, opus""> your browser does not support the <code>video</code> element. </video> this example specifies that a video object with playback controls should be drawn, playing the file "foo.ogg". the type is
specified as "video/ogg", and the source element also specifies that the video file uses the dirac and speex codecs. ...
nsIDOMHTMLTimeRanges
t changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsisupports method overview float start(in unsigned long index); float end(in unsigned long index); attributes attribute type description length unsigned long the number of ranges represented by the nsidomhtmltimeranges object. read only. methods end() returns the time offset to the end of the
specified time range. float end( in unsigned long index ); parameters index the index to the time range whose end time is to be returned. return value the time at which the
specified range ends, in seconds measured from the beginning of the timeline represented by the object. exceptions thrown index_size_err the
specified index is not valid. start() returns the time offset to the start of the specif...
...ed range ends, in seconds measured from the beginning of the timeline represented by the object. exceptions thrown index_size_err the
specified index is not valid. start() returns the time offset to the start of the
specified time range. float start( in unsigned long index ); parameters index the index to the time range whose start time is to be returned. return value the time at which the
specified range starts, in seconds measured from the beginning of the timeline represented by the object. exceptions thrown index_size_err the
specified index is not valid. ...
nsIDOMOfflineResourceList
cache available. obsolete 5 the application cache group is now obsolete. methods mozadd() adds an item to the dynamically managed entries. the resource will be fetched and added to the application cache. void mozadd( in domstring uri ); parameters uri the uri of the resource to add to the list. mozhasitem returns a boolean value indicating whether or not the
specified uri represents a resource that's in the application cache's list. note: this method has been deprecated. you should use the mozitems attribute instead. void mozhasitem( in domstring uri ); parameters uri the uri of the resource to check. return value true if the resource is in the list, otherwise false. mozitem returns the uri of the item at the specific offset into the list of ...
...item returns the uri of the item at the specific offset into the list of cached resources. note: this method is deprecated in firefox 3.5; you should instead access the list directly using the items attribute. domstring mozitem( in unsigned long index ); parameters index the index of the cached item whose uri should be returned. return value an domstring containing the uri of the
specified resource. mozremove() removes an item from the list of dynamically managed entries. if this was the last reference to the given uri in the application cache, the cache entry is removed. void mozremove( in domstring uri ); parameters uri the uri of the item to remove from the list. swapcache() swaps in the newest version of the application cache. the newest version of resources ar...
nsIDOMXPathEvaluator
olver 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 definitions 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 space resolver. evaluate() e...
... 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 space resolver. evaluate() evaluate the
specified xpath expression. nsisupports evaluate( in domstring expression, in nsidomnode contextnode, in nsidomxpathnsresolver resolver, in unsigned short type, in nsisupports result ); parameters expression a string representing the xpath to be evaluated. contextnode a dom node to evaluate the xpath expression against. to evaluate against a whole document, use the document.docu...
nsIDispatchSupport
al( in comvariantptr comvar, out jsval val ); parameters comvar the com variant to be converted. val the jsval to receive the converted value. gethostingflags() return the activex security and hosting flags. see nsiactivexsecuritypolicy for list of flags. unsigned long gethostingflags( in string acontext ); parameters acontext return value isclassmarkedsafeforscripting() test if the
specified class is marked safe for scripting. boolean isclassmarkedsafeforscripting( in nscidref cid, out boolean classexists ); parameters cid the nsid representation of the clsid to test. classexists returns containing pr_false if the class is not registered. return value isclasssafetohost() test if the class is safe to host. boolean isclasssafetohost( in jscontextptr cx, in nscidref cid, i...
... return value isclasssafetohost() test if the class is safe to host. boolean isclasssafetohost( in jscontextptr cx, in nscidref cid, in boolean capscheck, out boolean classexists ); parameters cx cid capscheck classexists returns containing pr_false if the class is not registered. return value isobjectsafeforscripting() test if the instantiated object is safe for scripting on the
specified interface. boolean isobjectsafeforscripting( in voidptr theobject, in nsiidref id ); parameters theobject the object to test (an iunknown cast into a void *). id return value jsval2comvariant() converts a jsval to a com variant. void jsval2comvariant( in jsval var, out comvariant comvar ); parameters var the jsval to be converted. comvar the com variant to receive the converted val...
nsIDocShell
harset string the converter to use when reading the document's data. in mozilla code, all text is encoded as unicode. when reading a document, a converter is used to translate the text from its original format into unicode. this attribute lets you: see what converter was used when retrieving the document's data. override that character set for documents for which the
specified fallback or auto-detected character set is incorrect. reading this value reports the encoding that was used when loading the data into the document. setting this attribute overrides the encoding; however, to update the dom or display of the content, you need have the data reparsed. overriding the character set also sets the fallback encoding for the container frame. note: p...
... kcharsetfrommetaprescan 8 values from this one downward are html5 tentative. kcharsetfrommetatag 9 values from this one upward are html5 confident. kcharsetfromirreversibleautodetection 10 kcharsetfrombyteordermark 11 the character set was determined from a byte order mark in the content. kcharsetfromchannel 12 the nsichannel
specified the character set. kcharsetfromothercomponent 13 kcharsetfromparentforced 14 the parent's character set was forced onto this content; all descendents will have this character set forced onto it. kcharsetfromuserforced 15 the user
specified a character set to force onto this content; all descendents will have this character set forced onto it. ...
nsIEventListenerService
listener, in boolean usecapture); attributes attribute type description systemeventgroup nsidomeventgroup returns system event group. read only. obsolete since gecko 7.0 methods geteventtargetchainfor() returns an array of event targets indicating all the targets that will receive the same events that are delivered to the
specified target. aeventtarget will be at index 0. the objects are the ones that would be used as event.currenttarget while dispatching an event to aeventtarget. note: some events, especially 'load', may actually have a shorter event target chain than what this methods returns. void geteventtargetchainfor( in nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retval, array, size_is...
...meventtarget aoutarray ); parameters aeventtarget the nsidomeventtarget for which to return the event target chain. acount on return, contains the number of elements in the returned array. aoutarray the array into which to store the event targets. getlistenerinfofor() returns an array of nsieventlistenerinfo objects describing everyone listening to the
specified event target. if aeventtarget doesn't have any listeners, this returns null. void getlistenerinfofor( in nsidomeventtarget aeventtarget, [optional] out unsigned long acount, [retval, array, size_is(acount)] out nsieventlistenerinfo aoutarray ); parameters aeventtarget the nsieventtarget for which to obtain a list of listeners. acount on return, the number of re...
nsIFocusManager
t. flag_bykey 0x2000 focus is changing due to a key operation, for instance pressing the tab key. this flag would normally be passed when movefocus_forward or movefocus_backward is used. flag_bymovefocus 0x4000 focus is changing due to a call to movefocus(). this flag will be implied when movefocus() is called except when one of the other mechanisms (mouse or key) is
specified, or when the type is movefocus_root or movefocus_caret. flag_showring 0x100000 always show the focus ring or other indicator of focus, regardless of other state. movefocus_forward 1 move focus forward one element, used when pressing tab. movefocus_backward 2 move focus backward one element, used when pressing shift+tab. movefocus_forwarddoc ...
...nt focus. void movecarettofocus( in nsidomwindow awindow ); parameters awindow elementisfocusable() check if given element is focusable. boolean elementisfocusable(in nsidomelement aelement, in unsigned long aflags); parameters aelement aflags return value true if aelement is focusable. movefocus() move the focus to another element. if astartelement is
specified, then movement is done relative to astartelement. if astartelement is null, then movement is done relative to the currently focused element. if no element is focused, focus the first focusable element within the document (or the last focusable element if atype is movefocus_end). this method is equivalent to setting the focusedelement to the new element. specifying astartelement and using movefocu...
nsIHttpActivityObserver
h to perform when http activity occurs. void observeactivity( in nsisupports ahttpchannel, in pruint32 aactivitytype, in pruint32 aactivitysubtype, in prtime atimestamp, in pruint64 aextrasizedata, in acstring aextrastringdata ); parameters ahttpchannel the nsihttpchannel on which the activity occurred. aactivitytype the type of activity that occurred; this will be one of the values
specified in activity type constants. aactivitysubtype the subtype that further narrows the type of activity that occurred. if the activity type is activity_type_socket_transport, this value will be one of the status_* constants defined by nsisockettransport. if the activity type is activity_type_http_transaction, this will be one of the constants
specified in activity subtype constants above. atimestamp t...
...btype the subtype that further narrows the type of activity that occurred. if the activity type is activity_type_socket_transport, this value will be one of the status_* constants defined by nsisockettransport. if the activity type is activity_type_http_transaction, this will be one of the constants
specified in activity subtype constants above. atimestamp the time at which the activity occurred,
specified as microseconds elapsed since the epoch of midnight on january 1, 1970. aextrasizedata any additional size data available with this activity. see interpreting activity data below. aextrastringdata any additional string data available with this activity. see interpreting activity data below. interpreting activity data depending on the values of the aactivitytype and aactivitysubtype fields, the a...
nsIHttpChannel
pty and amerge is false, the header will be cleared. void setrequestheader( in acstring aheader, in acstring avalue, in boolean amerge ); parameters aheader the case-insensitive name of the request header to query (for example "cookie"). avalue the request header value to set (for example "x=1"). amerge if true, the new header value will be merged with any existing values for the
specified header. this flag is ignored if the
specified header does not support merging (for example the "content-type" header can only have one value). the list of headers for which this flag is ignored is an implementation detail. if this flag is false, then the header value will be replaced with the contents of avalue. exceptions thrown ns_error_in_progress if called after the channel has been ope...
...and merge is false, the header will be cleared. void setresponseheader( in acstring header, in acstring value, in boolean merge ); parameters header the case-insensitive name of the response header to set(for example "cache-cookie"). value the response header value to set (for example "no-cache"). merge if true, the new header value will be merged with any existing values for the
specified header. this flag is ignored if the
specified header does not support merging (for example the "content-type" header can only have one value). the list of headers for which this flag is ignored is an implementation detail. if this flag is false, then the header value will be replaced with the contents of value. exceptions thrown ns_error_not_available if called before the response has been ...
nsIIDNService
ay purposes, and ensures that the encoding is consistent with nsiuri.gethost(). autf8string converttodisplayidn( in autf8string input, out boolean isascii ); parameters input the string to convert to display format. isascii on return, this is set to true if the result is ascii or ace encoded; otherwise it's false. return value the display formatted hostname. convertutf8toace() converts the
specified hostname from utf-8 to ace format, using the idna "toascii" algorithm. acstring convertutf8toace( in autf8string input ); parameters input the hostname to convert to ace format. return value the ace encoded version of the hostname. isace() determines whether or not the
specified hostname is ace encoded. boolean isace( in acstring input ); parameters input the string to check. return val...
...normalize() performs the unicode normalization needed for hostnames in idn. ...
nsIINIParser
g nsiiniparserfactory.createiniparser(). also, if you need to write to an ini file, use nsiiniparserwriter. nsiutf8stringenumerator getkeys(in autf8string asection); nsiutf8stringenumerator getsections(); autf8string getstring(in autf8string asection, in autf8string akey); methods getkeys() returns an nsiutf8stringenumerator providing the keys available within the
specified section of the ini file. nsiutf8stringenumerator getkeys( in autf8string asection ); parameters asection the name of the section whose keys you wish to enumerate. return value an nsiutf8stringenumerator object that can be used to access the section's keys. getsections() returns an nsiutf8stringenumerator providing a list of the sections available within the ini file. nsiutf8stringenu...
...an nsiutf8stringenumerator object that can be used to access the section's keys. getsections() returns an nsiutf8stringenumerator providing a list of the sections available within the ini file. nsiutf8stringenumerator getsections(); parameters none. return value an nsiutf8stringenumerator object that can be used to access the sections in the ini file. getstring() returns the string value for the
specified key within a particular section of the ini file. autf8string getstring( in autf8string asection, in autf8string akey ); parameters asection the section containing the key whose value is to be returned. akey the key for which the value should be returned. return value the string value of the
specified key. examples getting a value for a key this example provides a function y...
nsIINIParserWriter
he file in any order, regardless of section. when you're done and ready to write the ini file to disk, call the writefile() method. method overview void setstring(in autf8string asection, in autf8string akey, in autf8string avalue); void writefile([optional] in nsifile ainifile, [optional] in unsigned long aflags); constants file writing constants these constants are
specified when calling writefile(), in order to change its behavior. constant value description write_utf16 0x1 windows and the nsis installer code sometimes expect ini files to be in utf-16 encoding. on windows only, this flag to writefile() can be used to change the encoding from its default utf-8. methods setstring() set the value of a property string for a parti...
...8string akey, in autf8string avalue ); parameters asection the name of the section into 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 ...
nsIInstallLocation
a new install location. offsetting can be brittle but you should know what install locations are being defined for your own application. constant value description priority_app_profile 0 priority_app_system_user 10 priority_xre_system_user 100 priority_app_system_global 1000 priority_xre_system_global 10000 methods getidforlocation() retrieves the guid for an item at the
specified location. note: this function makes no promises about whether or not this path is actually maintained by this install location. astring getidforlocation( in nsifile file ); parameters file the location where an item might live. return value the id for an item that might live at the location
specified. getitemfile() gets a nsifile object for a file within an item's directory structure. nsifil...
...tly( in astring id ); parameters id the guid of the item. return value true if the item's resources are managed independently of the extension system, false otherwise. removefile() removes a file from the stage. this cleans up the stage if there is nothing else left after the remove operation. void removefile( in nsifile file ); parameters file the file to remove. stagefile() stages the
specified file by copying it to some location from where it can be retrieved later to complete installation. nsifile stagefile( in nsifile file, in astring id ); parameters file the file to stage. id the guid of the item the file represents. return value the staged file. ...
nsILoginManagerCrypto
phertext); astring encrypt(in astring plaintext); attributes attribute type description isloggedin boolean current login state of the token used for encryption. if the user is not logged in, performing a crypto operation will result in a master password prompt. read only. uibusy boolean true when a master password prompt is being displayed. read only. ...
...note: the current implemention of this inferface simply uses nss/psm's "secret decoder ring" service. it is not recommended for general purpose encryption/decryption. can throw if the user cancels entry of their master password. astring encrypt( in astring plaintext ); parameters plaintext the string to be encrypted. ...
nsIMemoryReporter
een done, the reporter will be found by any client accessing the enumerator returned by nsimemoryreportermanager.enumeratereporters(). this includes the about:memory page. note: this interface is undergoing heavy development, and is subject to rapid changes. attributes attribute type description amount print64 the numeric value reported by the memory reporter,
specified in the units indicated by the units attribute. read only. note: this attribute was called memoryused prior to gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4), and its type was long long. description autf8string a human-readable description of this memory usage report. read only. kind print32 the memory kind, one of the memory reporter kind con...
... by the heap allocator, e.g. malloc, new etc. kind_other 2 an allocation that does not fit into another kind category. unit type constants requires gecko 7.0(firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) the amount reported by a memory reporter may use one of the following units. constant value description units_bytes 0 the amount is
specified as a number of bytes. units_count 1 the amount is an instantaneous count of things currently in existence. for example, the number of tabs currently open. units_count_cumulative 2 the amount contains the number of times some event has occurred since the application started up. for example, the number of times the user has opened a new tab. the amount returned must ne...
nsIMemoryReporterManager
. 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 code area. registerreporter() requests that memory reporter notifications be sent to the
specified objects. void registerreporter( in nsimemoryreporter reporter ); parame...
...area. registerreporter() requests that memory reporter notifications be sent to the
specified objects. void registerreporter( in nsimemoryreporter reporter ); parameters reporter an object implementing the nsimemoryreporter interface which provides memory usage information for a given code area. unregistermultireporter() stops sending memory multi-reporter notifications to the
specified object. void unregistermultireporter( in nsimemorymultireporter reporter ); parameters reporter an object implementing the nsimemorymultireporter interface which provides memory usage information for a given code area. unregisterreporter() stops sending memory reporter notifications to the
specified object. void unregisterreporter( in nsimemoryreporter reporter ); parameters...
nsIMsgFolder
smsgfolderflags.h. boolean getflag(in unsigned long flag); toggleflag() toggles a flag on the folder. the known flags are defined in nsmsgfolderflags.h. void toggleflag(in unsigned long flag); onflagchange() called to notify the database and/or listeners of a change of flag. void onflagchange(in unsigned long flag); setprefflag() gets the number of folders and folders that have the
specified flag set. note: do not call from js with resultsize > 1. see bug 436051. this will change. void setprefflag(); getfolderswithflag() nsimsgfolder getfolderswithflag(in unsigned long flags, in unsigned long resultsize, out unsigned long numfolders); getallfolderswithflag() nsisupportsarray getallfolderswithflag(in unsigned...
...perty(in string propertyname, in acstring propertyvalue); isancestorof() determines if this folder is an ancestor of the supplied folder. boolean isancestorof(in nsimsgfolder folder); containschildnamed() looks in immediate children of this folder for the given name. boolean containschildnamed(in astring name); getchildnamed() return the child folder which the
specified name. nsimsgfolder getchildnamed(in astring aname); findsubfolder() finds the sub folder with the
specified name. note: even if the folder doesn't currently exist, a nsimsgfolder may be returned. nsimsgfolder findsubfolder(in acstring escapedsubfoldername); addfolderlistener() void addfolderlistener(in nsifolderlistener listener); removefolderlistener() void removefolderlistener(i...
nsINavHistoryResultTreeViewer
en the requested node isn't visible (such as when its parent is collapsed). also returned if there is no tree attached. methods nodefortreeindex() returns the node for a given row index. this is only valid when a tree is attached. nsinavhistoryresultnode nodefortreeindex( in unsigned long aindex ); parameters aindex the row index of the note to return. return value the node located at the
specified index in the tree. treeindexfornode() returns the row index corresponding to the
specified node within the tree, or index_invisible if the tree is unattached or the node is not visible (if, for example, its parent container is collapsed). unsigned long treeindexfornode( in nsinavhistoryresultnode anode ); parameters anode the node whose index is to be returned. this must be a node retrieved f...
...ified node within the tree, or index_invisible if the tree is unattached or the node is not visible (if, for example, its parent container is collapsed). unsigned long treeindexfornode( in nsinavhistoryresultnode anode ); parameters anode the node whose index is to be returned. this must be a node retrieved from the same result that the viewer displays. return value the row index of the node
specified by anode, or index_invisible for nodes that are hidden (by their parents being collapsed, for example) or if there is no attached tree. see also querying places displaying places information using views nsinavhistoryresult nsitreeview ...
nsIParserUtils
laintext( in astring src, in unsigned long flags, in unsigned long wrapcol ); parameters src the html source to parse (c++ callers are allowed but not required to use the same string for the return value.) flags conversion option flags defined in nsidocumentencoder. wrapcol number of characters per line; 0 for no auto-wrapping. return value the plain text conversion of the html
specified in src. parsefragment() parses markup into a sanitized document fragment. nsidomdocumentfragment parsefragment( in astring fragment, in unsigned long flags, in boolean isxml, in nsiuri baseuri, in nsidomelement element ); parameters fragment the input markup. flags sanitization option flags defined above. isxml true if |fragment| is xml and false if html. baseuri the base...
...s, use sanitizerallowcomments. to preserve <style> elements and style attributes on other elements, use sanitizerallowstyle. -moz-binding is removed from <style> elements and style attributes if present. in this case, properties that gecko doesn't recognize can get removed as a side effect. note: if -moz-binding is not present, <style> elements and style attributes, and if sanitizerallowstyle is
specified, the sanitized content may still be xss dangerous if loaded into a non-gecko web engine! astring sanitize( in astring src, in unsigned long flags ); parameters src the html source to parse (c++ callers are allowed but not required to use the same string for the return value). flags sanitization option flags defined above. return value the resulting text. ...
nsIPermission
set: allow, deny, or unknown (which is the default). see nsipermissionmanager.permission_type_constants for allowed values. read only. expiretime print64 the expiration time of the permission measured in milliseconds since 1970 jan 1 0:00:00. read only. ...
...n session termination, on a
specified time, or never. constants are defined in nsipermissionmanager.permission_expiration_constants. read only. host autf8string the host, that is uri, on which the permission is applied. read only. type acstring the type of permission: cookie, image, and so on. this is a case-sensitive string. this string is
specified by the consumer when adding a permission via nsipermissionmanager read only. ...
nsIProfile
ssign to the new profile. nativeprofiledir the pathname of the directory to use as the profile directory; if you specify null, a new folder will be created in the default profiles directory. langcode the locale to use for the new profile. useexistingdir if true, an existing directory may be used; otherwise, the profile directory will be unique. deleteprofile() deletes the
specified profile. void deleteprofile( in wstring name, in boolean candeletefiles ); parameters name the name of the profile to delete. candeletefiles if true, the profile manager will try to delete all of the profile's files and its directory. getprofilelist() returns an array of strings indicating the names of all the available profiles. void getprofilelist( out unsigned long len...
... names of all the available profiles. void getprofilelist( out unsigned long length, [retval, array, size_is(length)] out wstring profilenames ); parameters length on return, contains the number of profiles in the profilenames array. profilenames on return, contains an array of all of the available profiles' names. profileexists() determine whether or not a profile with the
specified name exists. boolean profileexists( in wstring profilename ); parameters profilename the name of the profile to look for. return value true if there is a profile with the
specified name. renameprofile() renames an existing profile. void renameprofile( in wstring oldname, in wstring newname ); parameters oldname the name of the profile to rename. newname the new ...
nsIScreen
ess of the screen, preventing it from becoming any dimmer than that brightness level. each call to this method must eventually be followed by a corresponding call to unlockminimumbrightness() with the same value for the brightness parameter. ...
...ust be one of the values
specified in screen brightness constants. unlockminimumbrightness() releases a lock on the minimum brightness of the screen, which was previously established through a corresponding call to lockminimumbrightness(). void unlockminimumbrightness( in unsigned long brightness ); parameters brightness the brightness level to release; this must be one of the values
specified in screen brightness constants. example var screenman = components.classes["@mozilla.org/gfx/screenmanager;1"] .getservice(components.interfaces.nsiscreenmanager); var left = {}, top = {}, width = {}, height = {}; screenman.primaryscreen.getrect(left, top, width, height); print([left.value, top.value, width.value, height.value]); see also nsiscreenmanager working with out par...
nsISelectionController
description scroll_synchronous 1<<1 if set scrolls the selection into view before returning. if not set, posts a request which is processed at some point after the method returns. scroll_first_ancestor_only 1<<2 if set, only the first ancestor will be scrolled into view. scroll_center_vertically 1<<4 if set, the
specified location will be scrolled to the center of the view. methods native code only!characterextendforbackspace will extend the selection one character cell backward in the document. this method is used internally for handling backspace key only when we're after utf-16 surrogates. void characterextendforbackspace(); parameters none. native code only!characterextendfordelete will extend the...
...ng the selection if the extend = pr_false the "point" of selection that is extended is considered the "focus" point, or the last point adjusted by the selection. void pagemove( in boolean forward, in boolean extend ); parameters forward forward or backward if pr_false extend should it collapse the selection or extend it? repaintselection() repaints the selection
specified. void repaintselection( in short type ); parameters type specifies the selection to repaint. scrollhorizontal() will scroll left or right dependent on the boolean. void scrollhorizontal( in boolean left ); parameters left if true will scroll left. if not will scroll right. scrollline() will scroll line up or down dependent on the boolean. void scrollline( i...
nsIServiceManager
object each time it is called with the same arguments. void getservice( in nscidref aclass, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result ); parameters aclass the classid of the service that is being requested. aiid the interface type to be returned. result the resulting interface pointer. exceptions thrown ns_error_factory_not_registered indicates that the
specified class is not registered. getservicebycontractid() this method returns a reference to a particular xpcom service given the contractid of the service. void getservicebycontractid( in string acontractid, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result ); parameters acontractid the contractid of the service that is being requested. aiid the interface type to be returne...
...n the contractid of the service. void getservicebycontractid( in string acontractid, in nsiidref aiid, [iid_is(aiid),retval] out nsqiresult result ); parameters acontractid the contractid of the service that is being requested. aiid the interface type to be returned. result the resulting interface pointer. exceptions thrown ns_error_factory_not_registered indicates that the
specified class is not registered. isserviceinstantiated() this method tests whether or not a xpcom service, identified by classid, has been instantiated. boolean isserviceinstantiated( in nscidref aclass, in nsiidref aiid ); parameters aclass the classid of the service that is being tested. aiid the interface type to be tested. return value true if the service has already been created. ...
nsISound
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 system sound effects for the event, this will do nothing. warning: this method should not be used in modern code. please use the html 5 <audio> tag instead. void playeventsou...
...f the user's system is configured to not play system sound effects for the event, this will do nothing. warning: this method should not be used in modern code. please use the html 5 <audio> tag instead. void playeventsound( in unsigned long aeventid ); parameters aeventid an event id which is defined in the constants. playsystemsound() plays the system sound whose name is
specified. if the user's system is configured to not play system sound effects, this will do nothing. note: this function is not supported on the macintosh. void playsystemsound( in astring soundalias ); parameters soundalias two different types of names are supported: you can specify the name of a system sound provided by the host operating system; for example, if you specify "sys...
nsITimer
note that the delay is approximate: the timer can be fired before the requested time has elapsed. nsitimer instances must be initialized by calling one of the initialization methods. you may also re-initialize (using one of the initialization methods) an existing instance to avoid the overhead of destroying and creating a timer. it is not necessary to cancel the timer in that case. xpcom/threads/nsitimer.idlscriptable please add a summary to this article. last changed in gecko 5 (firefox 5 / thunderbird 5 / seamonkey 2.2) inherits from: nsisupports implemented by: @mozilla.org/timer;1. ...
...r, you probably want this one. methods cancel() cancels the timer. this method works on all types, not just on repeating timers -- you might want to cancel a type_one_shot timer, and even reuse it by re-initializing it (to avoid object destruction and creation costs by conserving one timer instance). void cancel(); parameters none. init() initialize a timer that will fire after the
specified delay. a user must keep a reference to this timer till it is no longer needed or has been cancelled. void init( in nsiobserver aobserver, in unsigned long adelay, in unsigned long atype ); parameters aobserver a callback object, that is capable listening to timer events. if the timer fires, the observer will be notified via the nsiobserver interface. the subject is set to the nsitime...
nsIToolkitProfileService
meters arootdir the profile directory. may be null, in which case a suitable default will be chosen based on the profile name. aname the name to give the new profile. return value an nsitoolkitprofile object representing the newly-created profile. exceptions thrown ns_error_unexpected an unexpected error condition occurred. ns_error_file_not_directory one of the
specified directory files is not actually a directory. ns_error_out_of_memory unable to allocate the new profile object. flush() flushes the profile list to disk. the profile list file is constructed in memory, then written out as one large chunk, in order to reduce the risk of the profile list file being corrupted by disk errors. void flush(); parameters none. exceptions thrown ns_error_out...
...ccurred trying to allocate the memory buffer used to construct the profile list. ns_error_unexpected an error occurred writing the profile list file to disk. getprofilebyname() gets a profile, given the profile's name. nsitoolkitprofile getprofilebyname( in autf8string aname ); parameters aname the profile name to find. return value an nsitoolkitprofile object describing the
specified profile. exceptions thrown ns_error_failure no matching profile was found. lockprofilepath() locks an arbitrary path as a profile. if the path does not exist, it is created and the defaults copied from the application directory. nsiprofilelock lockprofilepath( in nsilocalfile adirectory, in nsilocalfile atempdirectory ); parameters adirectory the directory to lock as a pro...
nsITransferable
less flavor used to interact with the operating system during file drags. kfilepromisedirectorymime application/x-moz-file-promise-dir a synthetic flavor which is added to the transferable once the destination directory for a file drag is known. methods adddataflavor() adds a new data flavor, indicating that this transferable can receive the type of data represented by the
specified flavor string. void adddataflavor( in string adataflavor ); parameters adataflavor a string defining a new data flavor that the transferable supports. flavorstransferablecanexport() returns a list of flavors (mime types as nsisupportscstring) that the transferable can export, either through intrinsic knowledge or output data converters. nsisupportsarray flavorstransferablecanexport()...
...s none. return value true if the data is large; otherwise, the result is false. removedataflavor() removes the data flavor matching the given one (as determined by a string comparison), along with the corresponding data. void removedataflavor( in string adataflavor ); parameters adataflavor the data flavor to remove. settransferdata() sets the data in the transferable with the
specified flavor. the transferable maintains its own copy of the data, so you can safely discard the original after making this call, if you wish. void settransferdata( in string aflavor, in nsisupports adata, in unsigned long adatalen ); parameters an instance of a class based upon nsisupportsprimitives an nsifile an nsiflavordataprovider aflavor the flavor of data that is being set. a...
nsITreeView
g an icon for a cell. if the empty string is returned, the ::moz-tree-image pseudoelement will be used. astring getimagesrc( in long row, in nsitreecolumn col ); parameters row the index of the row. col the index of the column. return value the image path of the cell. getlevel() the level is an integer value that represents the level of indentation. it is multiplied by the width
specified in the ::moz-tree-indentation pseudoelement to compute the exact indentation. long getlevel( in long index ); parameters index the index of the item. return value the level of indentation. getparentindex() methods used by the tree to draw thread lines in the tree. getparentindex is used to obtain the index of a parent row. if there is no parent row, getparentindex returns -1. long ...
...code that is forced to march down the view looking at levels can optimize the march by starting at afterindex+1. boolean hasnextsibling( in long rowindex, in long afterindex ); parameters rowindex the index of the item. afterindex the index of the item to find siblings after. return value true if the row has a next sibling. otherwise false iscontainer() whether th...
nsIURI
ion; otherwise false. resolve() resolves a relative uri string, using this uri as the base. note: some implementations may have no concept of a relative uri. autf8string resolve( in autf8string relativepath ); parameters relativepath the relative path to resolve. return value the resolved absolute uri string. ...
...s a uri with the
specified scheme. this comparison is case-insensitive. note: this is an optimization, allowing you to check the scheme of the uri without having to get the scheme and do the comparison yourself; this saves memory allocations. boolean schemeis( in string scheme ); parameters scheme a string representing the scheme to compare to. return value true if the uri is for the
specified scheme; otherwise false. see also code snippets:uri parsing ...
nsIUpdate
se if the update is a patch representing the difference between the new version and the existing version. issecurityupdate boolean true if the update is a security update. if the update is a security update, a more seriously-worded user interface message is used to present the update to the user. licenseurl astring the url to an html fragment that contains a license for the update. if this is
specified, the user is shown the license file after they choose to install the update, and they must agree to it before the download begins. name astring the name of the update, in the form "application_name update_version" patchcount unsigned long the number of patches supplied by this update. read only. platformversion astring the toolkit version of this update. previousappversion astring the ap...
...e object: "major" a major new version of the application. "minor" a minor update, such as a security update. version astring the application version of the update.obsolete since gecko 2.0 methods getpatchat() retrieves a patch. nsiupdatepatch getpatchat( in unsigned long index ); parameters index the index of the patch to retrieve. return value an nsiupdatepatch object describing the
specified patch. serialize() serializes the update object into a dom element. nsidomelement serialize( in nsidomdocument updates ); parameters updates the dom document into which to serialize the update. return value the patch object serialized into an nsidomelement. see also nsiupdatepatch nsiupdatechecklistener nsiupdatechecker nsiapplicationupdateservice nsiupdatemanager nsiupdateprompt nsiupdatet...
nsIWebNavigationInfo
indicate that a type is supported via an npapi ("netscape 4 api") plug-in. this is not the value returned for "xpcom plug-ins". other 1 << 15 note: other return types may be added here in the future as they become relevant. returned by istypesupported() to indicate that a type is supported via some other means. methods istypesupported() determines whether or not the
specified mime type is supported by the given nsiwebnavigation object. this lets you determine whether a mime type can be displayed as-is inside a browser, or if the browser will instead forward handling of the data to a plug-in or an external helper application. note: this method may cause plug-ins to be rescanned in order to ensure they are properly registered for the types they support. unsigned long ...
.... unsigned long istypesupported( in acstring atype, in nsiwebnavigation awebnav ); parameters atype the mime type to check. awebnav the nsiwebnavigation object on which to check for compatibility. you may specify null to check for compatibility with nsiwebnavigation objects that are in their default state; otherwise, the result is determined based on the configuration of the
specified object (that is, how it is configured by using nsiwebbrowsersetup). return value returns one of the support type constants, indicating whether or not the
specified mime type is supported, and in what form that support exists. example let webnavigationinfo_service = components.classes["@mozilla.org/webnavigation-info;1"] .getservice(components.interfaces.nsiwebnavi...
NS_UTF16ToCString
#include "nsstringapi.h" nsresult ns_utf16tocstring( const nsastring& asrc, nscstringencoding adestencoding, nsacstring& adest ); parameters asrc [in] a nsastring instance containing the source utf-16 string to be converted. the source string should be encoded using the host byte order. adestencoding [in] the character encoding of the destination string. ...
...destencoding [in] the character encoding of the destination string. see nscstringencoding for the set of values that can be passed for this parameter. adest [out] a nsacstring instance that will contain the result of the conversion. return values the ns_utf16tocstring function returns ns_ok if successful. otherwise, it returns an error code. the set of possible error codes is currently un
specified. example code // convert utf-16 (or ucs-2) string to utf-8 void copyutf16toutf8(const nsastring& in, nsacstring& out) { ns_utf16tocstring(in, ns_cstring_encoding_utf8, out); } history this function was frozen for mozilla 1.7. see bug bug 239123 for details. see also nsacstring, nsastring, nscstringencoding ...
XPIDL Syntax
se-engineering of the libidl source code's parser, limited mostly to the subset of functionality that is supported by the mozilla xpidl binary. purpose of this document this document is not an introduction to xpidl or idl in general. it is more focused on xpidl syntax and grammar. see xpidl main page for more links and introductory content. simplifications, conventions and notation the syntax is
specified according to abnf as defined by rfc 5234, although a few productions use prose for clarity of understanding. lexically, tokens are delimited by whitespace (defined here as spaces, tabs, vertical tabs, form feeds, line feeds, and carriage returns, or [ \t\v\f\r\n] in regular expression form). libidl only considers a single line feed as a newline, and not carriage returns (although xpidl begs to di...
...ey are handled as a preprocessing step before the idl source code is actually parsed. a `%{' that appears at the beginning of a line is the start of a raw code fragment, which extends until the end of a line that begins with `%}'. text inside raw code fragments are not otherwise parsed by xpidl directly. this may be followed by the language, as in `%{c++', to output the raw fragment only in the
specified language. a `#include "file"' line instructs the xpidl processor to include 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. xpi...
XPIDL
an out parameter is essentially an auxiliary return value, although these are moderately cumbersome 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 poss...
...having the nsid, utf8string, cstring, astring, or jsval properties may be declared shared, and, even then, only if the parameter is not an array parameter. the shared property also makes its corresponding argument const. the retval property indicates that the parameter is actually acting as the return value, and it is only the need to assign properties to the parameter that is causing it to be
specified as a parameter. it has no effect on native code, but script code uses it like a regular return value. naturally, a method which contains a retval parameter must be declared void, and the parameter itself must be an out parameter and the last parameter. other properties are the optional and iid_is property. the optional property indicates that script code may omit the property without problems; a...
Creating a gloda message query
must "involve" one of the identities provided. an identity is involved if the message was to them, from them, or carbon-copied to them. gloda.from, gloda.to, gloda.cc: just like gloda.involves, but specific to from/to/cc. gloda.daterange([lowerdate1, upperdate1], [lowerdate2, upperdate2], ...): add the constraint that the message date (per the message's date header) must fall within one of the
specified inclusive ranges. the date instances are javascript date instances. query.folder(folder1, folder2, ...): add the constraint that the message must be found in one of the
specified folders. the folder may be a glodafolder instance (retrieved via gloda.getfolderforfolder, which takes an nsimsgfolder) or an nsimsgfolder instance. query.conversation(conversation1, conversation2, ...): add the constr...
...the conversation must be a glodaconversation instance. you find these by first finding a message and then accessing its "conversation" attribute. ...
Declaring types
w array type, you use the ctypes.arraytype() method.when declaring a new array type, you provide a ctype indicating the type of each element in the array as well as an optional array length. you may declare your array either with a specific number of elements, or with no predetermined size. this is permitted since c allows it, for the widest possible compatibility. declaring an array type with un
specified length to declare a new array type without specifying a length, you simply pass in the ctype specifying the element type when calling ctypes.arraytype(). for example, to create a type for an array of c standard i/o file pointers (perhaps for tracking a number of active files on disk): const file = new ctypes.structtype("file").ptr; // create file as a file * type const filearray = new ctyp...
... i/o file pointers (perhaps for tracking a number of active files on disk): const file = new ctypes.structtype("file").ptr; // create file as a file * type const filearray = new ctypes.arraytype(file); // create a filearray type in this example, file is an opaque pointer we can use to refer to c file records, as defined in stdio.h. filearray is a new type representing an array of un
specified length, in which each entry is a pointer to a file record. declaring an array type with a specific length declaring an array type that specifies the array length is as simple as adding a length when calling ctypes.arraytype(), like this: const filearray = new ctypes.arraytype(file, 20); this declares filearray as an array type that can hold 20 elements. pointers declaring a pointer type as...
Initialization and Destruction - Plugins
xist if a single page contains multiple embedded plug-ins, or if several browser windows are open and display the same data type. at this point, a plug-in can call the npn_setvalue function to specify whether it is windowed (the default) or windowless. plug-in instances are created with npp_new and destroyed with npp_destroy. npp_new informs the plug-in of the creation of a new instance with the
specified mime type. you can allocate instance-specific private data at this time. nperror npp_new(npmimetype plugintype, npp instance, uint16 mode, int16 argc, char *argn[], char *argv[], npsaveddata *saved); the plugintype parameter represents the mime type of this instance of the plug-in. you can assign more than one mime type to a plug-in, which could ...
...nstance was created by an embed and shares the browser window with other content. np_full means that the instance was created by a separate file and is the primary content in the window. the next three parameters pass parameters from the embed element that called the plug-in. the argc parameter is the number of html arguments in the element. it determines the number of attributes in the arrays
specified by the argn and argv parameters. the arguments in the embed element are name-value pairs made up of the attribute name (for example, align) and its value (for example, top). the argn array contains the attribute names; the argv array contains the attribute values. the browser ignores any nonstandard attributes in an embed element, so the web page author can use the arg parameters to specify pri...
Plug-in Basics - Plugins
type the enabledplugin property in javascript can be used to determine which plug-in is configured for a specific mime type. though plug-ins may support multiple mime types and each mime type may be supported by multiple plug-ins, only one plug-in can be configured for a mime type. the enabledplugin property is a reference to a plugin object that represents the plug-in that is configured for the
specified mime type. you might need to know which plug-in is configured for a mime type, for example, to dynamically create an object element on the page if the user has a plug-in configured for the mime type. the following example uses javascript to determine whether the adobe flash plug-in is installed. if it is, a movie is displayed. // can we display adobe flash movies? var mimetype = navigator.mime...
...ibutes that determine the appearance and size of the plug-in instance, including these: the border and frameborder attributes specify the size of a border for the plug-in or draw a borderless plug-in. height, width, and units determine the size of the plug-in in the html page. if the plug-in is not hidden, the height and width attributes are required. hspace and vspace create a margin of the
specified width, in pixels, around the plug-in. align specifies the alignment for the plug-in relative to the web page. use the hidden attribute if you do not want the plug-in to be visible. in this case, you do not need the attributes that describe plug-in appearance. in fact, hidden overrides those attributes if they are present. use the name attribute, which specifies the name of the plug-in or plug...
Debugger.Frame - Firefox Developer Tools
sumption value specifying how the debuggee’s execution should proceed. what constitutes “a small amount of progress” varies depending on the implementation, but it is fine-grained enough to implement useful “step” and “next” behavior. if multiple debugger instances each have debugger.frame instances for a given stack frame with onstep handlers set, their handlers are run in an un
specified order. if any onstep handler forces the frame to return early (by returning a resumption value other than undefined), any remaining debuggers’ onstep handlers do not run. this property is ignored on frames that are not executing debuggee code, like "call" frames for calls to host functions and "debugger" frames. onpop this property must be either undefined or a function. if it is a func...
...at is throwing an exception or being terminated, and the handler returns undefined, then spidermonkey proceeds with the exception or termination. that is, an undefined resumption value leaves the frame’s throwing and termination process undisturbed. if multiple debugger instances each have debugger.frame instances for a given stack frame with onpop handlers set, their handlers are run in an un
specified order. the resumption value each handler returns establishes the completion value reported to the next handler. this handler is not called on "debugger" frames. it is also not called when unwinding a frame due to an over-recursion or out-of-memory exception. function properties of the debugger.frame prototype object the functions described below may only be called with a this value referri...
Index - Firefox Developer Tools
following objects from the chrome://browser/content/devtools/inspector/inspector.xul context: 71 use the inspector from the web console guide, inspector, tools the element that's currently selected in the page inspector can be referenced in the web console using the variable $0. 72 view background images in the rules view, you can see a preview of images
specified using background-image. just hover over the rule: 73 visualize transforms guide, inspector, tools if you hover over a transform property in the rules view, you'll see the transformation overlaid in the page: 74 work with animations guide, inspector, tools this article covers three tools you can use to visualize and edit animations: 75 animation...
..., debugging, devtools, developer tools, firefox, guide, javascript debugging, tools, wm, breakpoint a normal breakpoint is just associated with a line: when the program reaches that line, the debugger pauses. a conditional breakpoint also has a condition associated with it, which is represented as an expression. when the program reaches the line, the debugger pauses only if the breakpoint's
specified expression evaluates to true. 130 set watch expressions when debugging code, sometimes it's useful to watch expressions as executions are paused. the debugger features a pane for entering expressions to be watched (watch expressions). as you step through code, the debugger will watch the expression and return any results. 131 step through code debugger, devtoo...
Console messages - Firefox Developer Tools
owser loaded this active content. see mixed content for more details. loading mixed (insecure) display content on a secure page the page contained mixed display content: that is, the main page was served over https, but asked the browser to load "display content", such as images, over http. the browser loaded this display content. see mixed content for more details. this site
specified both an x-content-security-policy/report-only header and a content-security-policy/report-only header. the x-content-security-policy/report-only header(s) will be ignored. see content security policy for more details. the x-content-security-policy and x-content-security-report-only headers will be deprecated in the future. please use the content-security-policy and content-security-re...
... (http://) form action. this is a security risk that allows user login credentials to be stolen. forms containing password fields must submit them over https, not http. password fields present on an insecure (http://) iframe. this is a security risk that allows user login credentials to be stolen. iframes containing login forms must be served over https, not http. the site
specified an invalid strict-transport-security header. see http strict transport security for more details. this site makes use of a sha-1 certificate; it's recommended you use certificates with signature algorithms that use hash functions stronger than sha-1. the site uses a certificate whose signature uses the sha-1 hash algorithm. sha-1 is still still widely used in cer...
AudioBufferSourceNode.start() - Web APIs
egin playback immediately. syntax audiobuffersourcenode.start([when][, offset][, duration]); parameters when optional the time, in seconds, at which the sound should begin to play, in the same time coordinate system used by the audiocontext. if when is less than (audiocontext.currenttime, or if it's 0, the sound begins to play at once. the default value is 0. offset optional an offset,
specified as the number of seconds in the same time coordinate system as the audiocontext, to the time within the audio buffer that playback should begin. for example, to start playback halfway through a 10-second audio clip, offset should be 5. the default value, 0, will begin playback at the beginning of the audio buffer, and offsets past the end of the audio which will be played (based on the audio buff...
...or the loopend property) are silently clamped to the maximum value allowed. the computation of the offset into the sound is performed using the sound buffer's natural sample rate, rather than the current playback rate, so even if the sound is playing at twice its normal speed, the midway point through a 10-second audio buffer is still 5. duration optional the duration of the sound to be played,
specified in seconds. if this parameter isn't
specified, the sound plays until it reaches its natural conclusion or is stopped using the stop() method. using this parameter is functionally identical to calling start(when, offset) and then calling stop(when+duration). return value undefined. exceptions typeerror a negative value was
specified for one or more of the three time parameters. please don'...
AudioContextOptions.latencyHint - Web APIs
the audiocontextoptions dictionary (used when instantiating an audiocontext) may contain a property named latencyhint, which indicates the preferred maximum latency in seconds for the audio context. the value is
specified either as a member of the string enum audiocontextlatencycategory or a double-precision value. syntax audiocontextoptions.latencyhint = "interactive"; audiocontextoptions.latencyhint = 0.2; var latencyhint = audiocontextoptions.latencyhint; value the preferred maximum latency for the audiocontext. there are two ways this value can be
specified. the best way to specify the preferred latency is to use a value form the string enum audiocontextlatencycategory. in fact, the default value of latencyhint is "interactive" (meaning the browser should try to use the lowest possible a...
...this provides more precise control over the balance between audio latency and device energy usage. ...
AudioContextOptions.sampleRate - Web APIs
rate to use for the new context. the value must be a floating-point value indicating the sample rate, in samples per second, for which to configure the new context; additionally, the value must be one which is supported by audiobuffer.samplerate. ...
...ate; value the desired sample rate for the audiocontext,
specified in samples per second. the value must be compatible with audiobuffer.samplerate. this value should typically be between 8,000 hz and 96,000 hz; the default will vary depending on the output device, but the sample rate 44,100 hz is the most common. if the samplerate property is not included in the options, or the options are not
specified when creating the audio context, the new context's output device's preferred sample rate is used by default. specifications specification status comment web audio apithe definition of 'audiocontextoptions.samplerate' in that specification. working draft initial definition. ...
AudioNode.disconnect() - Web APIs
atching connection is found, an invalidaccesserror exception is thrown. output optional an index describing which output from the current audionode is to be disconnected. the index numbers are defined according to the number of output channels (see audio channels). if this parameter is out-of-bound, an indexsizeerror exception is thrown. input optional an index describing which input into the
specified destination audionode is to be disconnected. the index numbers are defined according to the number of input channels (see audio channels). if this parameter is out-of-bound, an indexsizeerror exception is thrown. exceptions indexsizeerror a value
specified for input or output is invalid, referring to a node which doesn't exist or outside the permitted range. invalidaccesserror the node o...
... numbers are defined according to the number of input channels (see audio channels). if this parameter is out-of-bound, an indexsizeerror exception is thrown. exceptions indexsizeerror a value
specified for input or output is invalid, referring to a node which doesn't exist or outside the permitted range. invalidaccesserror the node on which disconnect() was called isn't connected to the
specified destination node. 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); gainnode.disconnect(); specifications specification status comment web audio apit...
AudioParam - Web APIs
t 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. ...
...adual linear change in the value of the audioparam. the change starts at the time
specified for the previous event, follows a linear ramp to the new value given in the value parameter, and reaches the new value at the time given in the endtime parameter. audioparam.exponentialramptovalueattime() schedules a gradual exponential change in the value of the audioparam. the change starts at the time
specified for the previous event, follows an exponential ramp to the new value given in the value parameter, and reaches the new value at the time given in the endtime parameter. audioparam.settargetattime() schedules the start of a change to the value of the audioparam. the change starts at the time
specified in starttime and exponentially moves towards the value given by the target parameter. the expon...
AudioScheduledSourceNode.stop() - Web APIs
the stop() method on audioscheduledsourcenode schedules a sound to cease playback at the
specified time. if no time is
specified, then the sound stops playing immediately. each time you call stop() on the same node, the
specified time replaces any previously-scheduled stop time that hasn't occurred yet. if the node has already stopped, this method has no effect. note: if a scheduled stop time occurs before the node's scheduled start time, the node never starts to play. syntax audioscheduledsourcenode.stop([when]); parameters when optional the time, in seconds, at which the sound should stop playing. this value is
specified in the same time coordinate system as the audiocontext is using for its currenttime attribute. omitting this parameter, specifying a value of 0, or passing a negativ...
... example this example demonstrates starting an oscillator node, scheduled to begin playing at once and to stop playing in one second. the stop time is determined by taking the audio context's current time from audiocontext.currenttime and adding 1 second. ...
AudioScheduledSourceNode - Web APIs
specifically, this interface defines the start() and stop() methods, as well as the onended event handler. you can't create an audioscheduledsourcenode object directly. instead, use the interface which extends it, such as audiobuffersourcenode, oscillatornode, and constantsourcenode. ...
...ot playing (that is, before start() is called and after stop() is called). silence is represented, as always, by a stream of samples with the value zero (0). properties inherits properties from its parent interface, audionode. methods inherits methods from its parent interface, audionode, and adds the following methods: start() schedules the node to begin playing the constant sound at the
specified time. if no time is
specified, the node begins playing immediately. stop() schedules the node to stop playing at the
specified time. if no time is
specified, the node stops playing at once. events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface: ended fired when the source node has stopped playing, either bec...
AudioTrack - Web APIs
abel read only a domstring providing a human-readable label for the track. for example, an audio commentary track for a movie might have a label of "commentary with director john q. public and actors john doe and jane eod." this string is empty if no label is provided. language read only a domstring specifying the audio track's primary language, or an empty string if unknown. the language is
specified as a bcp 47 (rfc 5646) language code, such as "en-us" or "pt-br". sourcebuffer read only the sourcebuffer that created the track. returns null if the track was not created by a sourcebuffer or the sourcebuffer has been removed from the mediasource.sourcebuffers attribute of its parent media source. usage notes to get an audiotrack for a given media element, use the element's audiotracks pro...
...abling any others. tracks.foreach(function(track) { if (track.language === userlanguage) { track.enabled = true; } else { track.enabled = false; } }); the language is in standard (rfc 5646) format. for us english, this would be "en-us", for example. example this example returns an array of track kinds and labels for potential use in a user interface to select audio tracks for a
specified media element. the list is filtered to only allow certain track kinds through. function gettracklist(el) { var tracklist = []; const wantedkinds = [ "main", "alternative", "main-desc", "translation", "commentary" ]; el.audiotracks.foreach(function(track) { if (wantedkinds.includes(track.kind)) { tracklist.push({ id: track.id, kind: track.kind, label...
Bluetooth.requestDevice() - Web APIs
if there is no chooser ui, this method returns the first device matching the criteria. syntax bluetooth.requestdevice([options]) .then(function(bluetoothdevice) { ... }) returns a promise to a bluetoothdevice object. parameters options optional an object that sets options for the device request. the available options are: filters[]: an array of bluetoothscanfilters. this filter consists of an array of bluetoothserviceuuids, a name parameter, and a nameprefix parameter. ...
...ng that the requesting script can accept all bluetooth devices. the default is false. exceptions typeerror the provided options do not makes sense. for example, options.filters is present and options.acceptalldevices is true, or if options.filters is not present and options.acceptalldevices is false. or options.filters is []. notfounderror there is no bluetooth device that matches the
specified options. securityerror this operation is not permitted in this context due to security concerns. for example, it is called from insecure origin. example // discovery options match any devices advertising: // . the standard heart rate service. // . both 16-bit service ids 0x1802 and 0x1803. // . a proprietary 128-bit uuid service c48e6067-5295-48d3-8d5c-0395f61792b1. // . devices with name "e...
Bluetooth - Web APIs
interface interface bluetooth : eventtarget { promise<boolean> getavailability(); attribute eventhandler onavailabilitychanged; [sameobject] readonly attribute bluetoothdevice? referringdevice; promise<sequence<bluetoothdevice>> getdevices(); promise<bluetoothdevice> requestdevice(optional requestdeviceoptions options = {}); }; bluetooth includes bluetoothdeviceeventhandlers; bluetooth includes characteristiceventhandlers; bluetooth includes serviceeventhandlers; properties inherits properties from its parent eventtarget. ...
...e user configure an option that affects what is returned by this value. if this option is set, that is the value 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 definition of 'bluetooth' in that specification. draft initial definition. ...
CSSPrimitiveValue.getFloatValue() - Web APIs
syntax var floatvalue = cssprimitivevalue.getfloatvalue(unit); parameters unittype an unsigned short representing the code for the unit type, in which the value should be returned. valid values are: constant description css_cm the value is a <length> in centimeters. css_deg the value is an <angle> in degrees. css_dimension the value is a <number> with an unknown dimension. ...
...>. css_pc the value is a <length> in picas. css_percentage the value is a <percentage>. css_pt the value is a <length> in points. css_px the value is a <length> in pixels. css_rad the value is an <angle> in radians. css_s the value is a <time> in seconds. return value a float value in the
specified unit. exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a float value or if the float value can't be converted into the
specified unit. example var cs = window.getcomputedstyle(document.body); var cssvalue = cs.getpropertycssvalue("margin-top"); console.log(cssvalue.getfloatvalue(cssprimitivevalue.css_cm...
CSSPrimitiveValue.setFloatValue() - Web APIs
syntax cssprimitivevalue.setfloatvalue(unittype, floatvalue); parameters unittype an unsigned short representing the code for the unit type, in which the value should be returned. valid values are: constant description css_cm the value is a <length> in centimeters. css_deg the value is an <angle> in degrees. ...
... css_rad the value is an <angle> in radians. css_s the value is a <time> in seconds. floatvalue a float representing the new float value. return value void. exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a float value or if the string value can't be converted into the
specified unit. an no_modification_allowed_err is raised if this property is read-only. specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.setfloatvalue' in that specification. obsolete initial definition ...
CSSPrimitiveValue.setStringValue() - Web APIs
syntax cssprimitivevalue.setstringvalue(stringtype, stringvalue); parameters stringtype an unsigned short representing the type of the value. possible values are: constant description css_attr the value is an attr() function. css_ident the value is an identifier. css_string the value is a <string>. ...
...fier. css_string the value is a <string>. css_uri the value is a <uri>. stringvalue a domstring representing the new string value. return value void. exceptions type description domexception an invalid_access_err is raised if the css value doesn't contain a string value or if the string value can't be converted into the
specified unit. an no_modification_allowed_err is raised if this property is read-only. specifications specification status comment document object model (dom) level 2 style specificationthe definition of 'cssprimitivevalue.setstringvalue' in that specification. obsolete initial definition ...
CSSStyleSheet - Web APIs
to add or remove items in cssrules, use the cssstylesheet's insertrule() and deleterule() methods. ownerrule read only if this stylesheet is imported into the document using an @import rule, the ownerrule property returns the corresponding cssimportrule; otherwise, this property's value is null. methods inherits methods from its parent, stylesheet. deleterule() deletes the rule at the
specified index into the stylesheet's rule list. insertrule() inserts a new rule at the
specified position in the stylesheet, given the textual representation of the rule. legacy properties these properties are legacy properties first introduced by microsoft long ago; they shouldn't be used but are not likely to be removed anytime soon. rules read only the rules property is functionally identical...
...are not in danger of being removed anytime soon. addrule() adds a new rule to the stylesheet given the selector to which the style applies and the style block to apply to the matching elements. this differs from insertrule(), which simply takes the textual representation of the entire rule as a single string. removerule() functionally identical to deleterule(); removes the rule at the
specified index from the stylesheet's rule list. notes in some browsers, if a stylesheet is loaded from a different domain, accessing cssrules results in securityerror. a stylesheet is associated with at most one document, which it applies to (unless disabled). a list of cssstylesheet objects for a given document can be obtained using the document.stylesheets property. a specific style sheet can also b...
CSS Typed Object Model API - Web APIs
ssstylevalue interface of the the css typed object model api is the base class of all css values accessible through the typed om api. an instance of this class may be used anywhere a string is expected. cssstylevalue.parse(property, csstext) the parse() method of the cssstylevalue interface allows a cssnumericvalue to be constructed from a css string. it sets a specific css property to the
specified values and returns the first value as a cssstylevalue object. cssstylevalue.parseall() the parseall() method of the cssstylevalue interface 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. stylepropertymap the stylepropertymap interface of the the css typed object model api provide...
... cssnumericvalue.div - divides a supplied number by other numbers, throwing an error if 0. cssnumericvalue.min - returns the minimum value passed cssnumericvalue.max - returns the maximum value passed cssnumericvalue.equals - returns true if all the values are the exact same type and value, in the same order. otherwise, false cssnumericvalue.to - converts value into another one with the
specified unit. cssnumericvalue.tosum cssnumericvalue.type cssnumericvalue.parse - returns a number parsed from a css string csspositionvalue represents values for properties that take a position, for example object-position. csstransformvalue an interface representing a list of transform list values. they "contain" one or more csstransformcomponents, which represent individual transform fu...
CanvasRenderingContext2D.createPattern() - Web APIs
this method returns a canvaspattern. this method doesn't draw anything to the canvas directly. the pattern it creates must be assigned to the canvasrenderingcontext2d.fillstyle or canvasrenderingcontext2d.strokestyle properties, after which it is applied to any subsequent drawing. syntax canvaspattern ctx.createpattern(image, repetition); parameters image a canvasimagesource to be used as the pattern's image. ...
...g>) svgimageelement (<image>) htmlvideoelement (<video>, by using the capture of the video) htmlcanvaselement (<canvas>) imagebitmap offscreencanvas repetition a domstring indicating how to repeat the pattern's image. possible values are: "repeat" (both directions) "repeat-x" (horizontal only) "repeat-y" (vertical only) "no-repeat" (neither direction) if repetition is
specified as an empty string ("") or null (but not undefined), a value of "repeat" will be used. return value canvaspattern an opaque object describing a pattern. examples creating a pattern from an image this example uses the createpattern() method to create a canvaspattern with a repeating source image. once created, the pattern is assigned to the canvas context's fill style and applied to a re...
CanvasRenderingContext2D.createRadialGradient() - Web APIs
ent. to be applied to a shape, the gradient must first be assigned to the fillstyle or strokestyle properties. note: gradient coordinates are global, i.e., relative to the current coordinate space. when applied to a shape, the coordinates are not relative to the shape's coordinates. syntax canvasgradient ctx.createradialgradient(x0, y0, r0, x1, y1, r1); the createradialgradient() method is
specified by six parameters, three defining the gradient's start circle, and three defining the end circle. parameters x0 the x-axis coordinate of the start circle. y0 the y-axis coordinate of the start circle. r0 the radius of the start circle. must be non-negative and finite. x1 the x-axis coordinate of the end circle. y1 the y-axis coordinate of the end circle. r1 the radius of the end ci...
...x-axis coordinate of the start circle. y0 the y-axis coordinate of the start circle. r0 the radius of the start circle. must be non-negative and finite. x1 the x-axis coordinate of the end circle. y1 the y-axis coordinate of the end circle. r1 the radius of the end circle. must be non-negative and finite. return value canvasgradient a radial canvasgradient initialized with the two
specified circles. examples filling a rectangle with a radial gradient this example initializes a radial gradient using the createradialgradient() method. three color stops between the gradient's two circles are then created. finally, the gradient is assigned to the canvas context, and is rendered to a filled rectangle. html <canvas id="canvas" width="200" height="200"></canvas> javascript var can...
CanvasRenderingContext2D.drawImage() - Web APIs
encanvas. sx optional the x-axis coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context. sy optional the y-axis coordinate of the top left corner of the sub-rectangle of the source image to draw into the destination context. swidth optional the width of the sub-rectangle of the source image to draw into the destination context. if not
specified, the entire rectangle from the coordinates
specified by sx and sy to the bottom-right corner of the image is used. sheight optional the height of the sub-rectangle of the source image to draw into the destination context. dx the x-axis coordinate in the destination canvas at which to place the top-left corner of the source image. dy the y-axis coordinate in the destination canvas at which t...
... the source image to draw into the destination context. dx the x-axis coordinate in the destination canvas at which to place the top-left corner of the source image. dy the y-axis coordinate in the destination canvas at which to place the top-left corner of the source image. dwidth optional the width to draw the image in the destination canvas. this allows scaling of the drawn image. if not
specified, the image is not scaled in width when drawn. dheight optional the height to draw the image in the destination canvas. this allows scaling of the drawn image. if not
specified, the image is not scaled in height when drawn. exceptions thrown index_size_err if the canvas or source rectangle width or height is zero. invalid_state_err the image has no image data. type_mismatch_err the spe...
Basic animations - Web APIs
s we need a way to execute our drawing functions over a period of time. there are two ways to control an animation like this. scheduled updates first there's the window.setinterval(), window.settimeout(), and window.requestanimationframe() functions, which can be used to call a specific function over a set period of time. setinterval(function, delay) starts repeatedly executing the function
specified by function every delay milliseconds. settimeout(function, delay) executes the function
specified by function in delay milliseconds. requestanimationframe(callback) tells the browser that you wish to perform an animation and requests that the browser call a
specified function to update an animation before the next repaint. if you don't want any user interaction you can use the setinterval()...
...f (x > (canvasxsize)) { x = canvasxsize - imgw; } // draw aditional image if (x > (canvasxsize-imgw)) { ctx.drawimage(img, x - imgw + 1, y, imgw, imgh); } } // draw image ctx.drawimage(img, x, y,imgw, imgh); // amount to move x += dx; } below is the <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. <canvas id="canvas" width="800" height="200"></canvas> mouse following animation <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="x-ua-compatible" content="ie=edge"> ...
Using images - Web APIs
ch, as covered earlier, is one of the objects that can be used as a canvasimagesource. drawing images once we have a reference to our source image object we can use the drawimage() method to render it to the canvas. as we will see later the drawimage() method is overloaded and has several variants. in its most basic form it looks like this: drawimage(image, x, y) draws the canvasimagesource
specified by the image parameter at the coordinates (x, y). svg images must specify a width and height in the root <svg> element. example: a simple line graph in the following example, we will use an external image as the backdrop for a small line graph. using backdrops can make your script considerably smaller because we can avoid the need for code to generate the background. in this example, we're ...
...e resulting canvas looks like this: screenshotlive sample slicing the third and last variant of the drawimage() method has eight parameters in addition to the image source. it lets us cut out a section of the source image, then scale and draw it on our canvas. drawimage(image, sx, sy, swidth, sheight, dx, dy, dwidth, dheight) given an image, this function takes the area of the source image
specified by the rectangle whose top-left corner is (sx, sy) and whose width and height are swidth and sheight and draws it into the canvas, placing it on the canvas at (dx, dy) and scaling it to the size
specified by dwidth and dheight. to really understand what this does, it may help to look at the image to the right. the first four parameters define the location and size of the slice on the source ima...
Console.dir() - Web APIs
note: this feature is available in web workers. syntax console.dir(object); parameters object a javascript object whose properties should be output. ...
... note: this feature is available in web workers. syntax console.dir(object); parameters object a javascript object whose properties should be output. ...
DOMRect - Web APIs
it inherits from its parent, domrectreadonly. ...
... it inherits from its parent, domrectreadonly. ...
DataTransferItemList.add() - Web APIs
the datatransferitemlist.add() method creates a new datatransferitem using the
specified data and adds it to the drag data list. the item may be a file or a string of a given type. if the item is successfully added to the list, the newly-created datatransferitem object is returned. syntax datatransferitem = datatransferitemlist.add(data, type); datatransferitem = datatransferitemlist.add(file); parameters data a string representing the drag item's data. type a string of the drag item's type. some example types are text/html and text/plain. file a file object. no type needs to be given in this case. return value a datatransferitem containing the
specified data. if the drag item couldn't be created (for example, if the associated datatransfer object has no data store), null is retu...
... example this example shows the use of the add() method. ...
DisplayMediaStreamConstraints.video - Web APIs
rocess the video data after obtaining it from the device but prior to adding it to the stream. syntax displaymediastreamconstraints.video = allowvideoflag; displaymediastreamconstraints.video = mediatrackconstraints; displaymediastreamconstraints = { video: allowvideoflag | mediatrackconstraints; } value the value may be either a boolean or a mediatrackconstraints object. if a boolean is
specified, a value of true (the default) indicates that the stream returned by getdisplaymedia() should be in whatever format the user agent feels is best. a value of false is not permitted and will throw a typeerror. if a mediatrackconstraints object is given instead, the video track will be processed to match the settings given in the constraints object. constraints specific to screen sharing these co...
...e stream returned by getdisplaymedia() should be in whatever format the user agent feels is best. a value of false is not permitted and will throw a typeerror. if a mediatrackconstraints object is given instead, the video track will be processed to match the settings given in the constraints object. constraints specific to screen sharing these constraints apply to mediatrackconstraints objects
specified as part of the displaymediastreamconstraints object's video property when using getdisplaymedia() to obtain a stream for screen sharing. cursor a constraindomstring which specifies whether or not to include the mouse cursor in the generated track, and if so, whether or not to hide it while not moving. the value may be a single one of the following strings, or an array of them to allow the b...
DisplayMediaStreamConstraints - Web APIs
the displaymediastreamconstraints dictionary is used to specify whether or not to include video and/or audio tracks in the mediastream to be returned by getdisplaymedia(), as well as what type of processing must be applied to the tracks. processing information is
specified using mediatrackconstraints objects providing options which are applied to the track after the media data is received but before it is made available on the mediastream. ...
...data is received but before it is made available on the mediastream. properties audio a boolean or mediatrackconstraints value; if a boolean, this value simply indicates whether or not to include an audio track in the mediastream returned by getdisplaymedia(). if a mediatrackconstraints object is provided here, an audio track is included in the stream, but the audio is processed to match the
specified constraints after being retrieved from the hardware but before being added to the mediastream. the default value is false. video if true (the default), the display contents are included in a mediastreamtrack within the stream provided by getdisplaymedia(). optionally, a mediatrackconstraints object may be given, providing options specifying processing to be performed on the video data before ad...
Document.getBoxObjectFor() - Web APIs
returns a boxobject (x, y, width, height) for a
specified element. note: this method is obsolete. you should use the element.getboundingclientrect() method instead. syntax boxobject = document.getboxobjectfor(element); boxobject is an nsiboxobject. element is a domelement. ...
...d use the element.getboundingclientrect() method instead. syntax boxobject = document.getboxobjectfor(element); boxobject is an nsiboxobject. element is a domelement. example var mydiv = document.getelementbyid("mydiv"), boxobj = document.getboxobjectfor (mydiv); alert ( "x:" + boxobj.x + ", y:" + boxobj.y + ", width:" + boxobj.width + ", height:" + boxobj.height ); notes
specified in nsixuldocument.idl ...
Document.getElementsByClassName() - Web APIs
the getelementsbyclassname method of document interface returns an array-like object of all child elements which have all of the given class name(s). when called on the document object, the complete document is searched, including the root node. you may also call getelementsbyclassname() on any element; it will return only elements which are descendants of the
specified root element with the given class name(s). syntax var elements = document.getelementsbyclassname(names); // or: var elements = rootelement.getelementsbyclassname(names); elements is a live htmlcollection of found elements. names is a string representing the class name(s) to match; multiple class names are separated by whitespace getelementsbyclassname can be called on any element, not only on the document. the element on whi...
...tmlcollection[1] var testtarget = parentdom.getelementsbyclassname("test")[0]; // the first element, as we wanted console.log(testtarget); //<p class="test">hello world 2</p> </script> </body> </html> multiple classes example document.getelementsbyclassname works very similarly to document.queryselector and document.queryselectorall. only elements with all of the classnames
specified are selected. html <span class="orange fruit">orange fruit</span> <span class="orange juice">orange juice</span> <span class="apple juice">apple juice</span> <span class="foo bar">something random</span> <textarea id="resultarea" style="width:98%;height:7em"></textarea> javascript // getelementsbyclassname only selects elements that have both given classes var allorangejuicebyclass = document...
Document.querySelectorAll() - Web APIs
the document method queryselectorall() returns a static (not live) nodelist representing a list of the document's elements that match the
specified group of selectors. note: this method is implemented based on the parentnode mixin's queryselectorall() method. syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against. this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown. see locating dom elements using selectors for more information about using selectors to identify elements. multiple selectors may be
specified by separating them using commas. note: characters which are not part of standard css syntax must be escaped using a backslash character. since javasc...
...ote: characters which are not part of standard css syntax must be escaped using a backslash character. since javascript also uses backslash escaping, special care must be taken when writing string literals using these characters. see escaping special characters for more information. return value a non-live nodelist containing one element object for each element that matches at least one of the
specified selectors or an empty nodelist in case of no matches. note: if the
specified selectors include a css pseudo-element, the returned list is always empty. exceptions syntaxerror the syntax of the
specified selectors string is not valid. examples obtaining a list of matches to obtain a nodelist of all of the <p> elements in the document: var matches = document.queryselectorall("p"); thi...
DocumentOrShadowRoot - Web APIs
tylesheetsread only returns a stylesheetlist of cssstylesheet objects for stylesheets explicitly linked into, or embedded in a document. methods documentorshadowroot.caretpositionfrompoint() returns a caretposition object containing the dom node containing the caret, and caret's character offset within that node. documentorshadowroot.elementfrompoint() returns the topmost element at the
specified coordinates. documentorshadowroot.elementsfrompoint() returns an array of all elements at the
specified coordinates. documentorshadowroot.getselection() returns a selection object representing the range of text selected by the user, or the current position of the caret. documentorshadowroot.nodefrompoint() returns the topmost node at the
specified coordinates. documentorshadowroot.nodesf...
... specifications specification status comment shadow domthe definition of 'documentorshadowroot' in that specification. obsolete implementation in shadow dom. domthe definition of 'documentorshadowroot' in that specification. ...
DoubleRange - Web APIs
if no match can be found that is within the given range, an error will occur. ...
...if no match can be found that is within the given range, an error will occur. ...
Element.getAnimations() - Web APIs
it can optionally return animation objects for descendant elements too. note: this array includes css animations, css transitions, and web animations. syntax const animations = element.getanimations(options); parameters options optional an options object containing the following property: subtree a boolean value which, if true, causes animations that target descendants of element to be returned as well. this includes animations that target any css pseudo-elements attached to element or one of its descendents. ...
...imations that target descendants of element to be returned as well. this includes animations that target any css pseudo-elements attached to element or one of its descendents. defaults to false. return value an array of animation objects, each representing an animation currently targetting the element on which this method is called, or one of its descendant elements if { subtree: true } is
specified. examples the following code snippet will wait for all animations on elem and its descendants to finish before removing the element from the document. promise.all( elem.getanimations({ subtree: true }) .map(animation => animation.finished) ).then(() => elem.remove()); specifications specification status comment web animationsthe definition of 'animatable.getanim...
Element.getElementsByClassName() - Web APIs
the method getelementsbyclassname() on the document interface works essentially the same way, except it acts on the entire document, starting at the document root. syntax var elements = element.getelementsbyclassname(names); parameters names a domstring containing one or more class names to match on, separated by whitespace. return value an htmlcollection providing a live-updating list of every element which is a member of every class in names. ...
... so that it matches, it immediately appears in the collection. the opposite is also true; as elements no longer match the set of names, they are immediately removed from the collection. in quirks mode, the class names are compared in a case-insensitive fashion. otherwise, they're case sensitive. ...
Element.getElementsByTagName() - Web APIs
the returned list is live, which means it updates itself with the dom tree automatically. therefore, there is no need to call element.getelementsbytagname() with the same element and arguments repeatedly if the dom changes in between calls. when called on an html element in an html document, getelementsbytagname lower-cases the argument before searching for it. this is undesirable when trying to match camel-cased svg elements (such as <lineargradient>) in an html document. ...
...s the argument before searching for it. this is undesirable when trying to match camel-cased svg elements (such as <lineargradient>) in an html document. instead, use element.getelementsbytagnamens(), which preserves the capitalization of the tag name. element.getelementsbytagname is similar to document.getelementsbytagname(), except that it only searches for elements that are descendants of the
specified element. syntax elements = element.getelementsbytagname(tagname) elements is a live htmlcollection of elements with a matching tag name, in the order they appear. if no elements are found, the htmlcollection is empty. element is the element from where the search starts. only the element's descendants are included, not the element itself. tagname is the qualified name to look for. the speci...
Element.hasAttribute() - Web APIs
the element.hasattribute() method returns a boolean value indicating whether the
specified element has the
specified attribute or not. syntax var result = element.hasattribute(name); result holds the return value true or false. name is a string representing the name of the attribute. ...
...sult holds the return value true or false. name is a string representing the name of the attribute. ...
Element.querySelectorAll() - Web APIs
the element method queryselectorall() returns a static (not live) nodelist representing a list of elements matching the
specified group of selectors which are descendants of the element on which the method was called. note: this method is implemented based on the parentnode mixin's queryselectorall() method. syntax elementlist = parentnode.queryselectorall(selectors); parameters selectors a domstring containing one or more selectors to match against. this string must be a valid css selector string; if it's not, a syntaxerror exception is thrown. see locating dom elements using selectors for more information about using selectors to identify elements. multiple selectors may be
specified by separating them using commas. note: characters which are not part of standard css syntax must be...
...racters which are not part of standard css syntax must be escaped using a backslash character. since javascript also uses backspace escaping, special care must be taken when writing string literals using these characters. see escaping special characters for more information. return value a non-live nodelist containing one element object for each descendant node that matches at least one of the
specified selectors. note: if the
specified selectors include a css pseudo-element, the returned list is always empty. exceptions syntaxerror the syntax of the
specified selectors string is not valid. examples dataset selector & attribute selectors <section class="box" id="sect1"> <div class="funnel-chart-percent1">10.900%</div> <div class="funnel-chart-percent2">3700.00%</div> <div class...
Element.removeAttribute() - Web APIs
return value undefined. usage notes you should use removeattribute() instead of setting the attribute value to null either directly or using setattribute(). many attributes will not behave as expected if you set them to null. ...
... return value undefined. usage notes you should use removeattribute() instead of setting the attribute value to null either directly or using setattribute(). many attributes will not behave as expected if you set them to null. ...
EventTarget.dispatchEvent() - Web APIs
dispatches 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. target is used to initialize the event.target and determine which event listeners to invoke. return value the return value is false if event is cancelable and at least one of the event handlers which received event called event.preventdefault(). otherwise it returns true. ...
...et.dispatchevent(event) parameter event is the event object to be dispatched. target is used to initialize the event.target and determine which event listeners to invoke. return value the return value is false if event is cancelable and at least one of the event handlers which received event called event.preventdefault(). otherwise it returns true. the dispatchevent() method throws un
specified_event_type_err if the event's type was not
specified by initializing the event before the method was called, or if the event's type is null or an empty string. 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. notes unlike "n...
FeaturePolicy - Web APIs
featurepolicy.features returns a list of names of all features supported by the user agent. ...
...eature policy of the current execution context and/or might not be accessible because of user's permissions. featurepolicy.allowedfeatures returns a list of names of all features supported by the user agent and allowed by the feature policy. note that features appearing on this list might still be behind a user permission. featurepolicy.getallowlistforfeature returns the allow list for the
specified feature. specification specification status comment feature policy editor's draft initial definition. ...
Using files from web applications - Web APIs
you can determine how many files the user selected by checking the value of the file list's length attribute: const numfiles = filelist.length; individual file objects can be retrieved by simply accessing the list as an array: for (let i = 0, numfiles = filelist.length; i < numfiles; i++) { const file = filelist[i]; // ... } this loop iterates over all the files in the ...
...img>) element. set the image's source to a new object url representing the file, using url.createobjecturl() to create the blob url. set the image's height to 60 pixels. set up the image's load event handler to release the object url since it's no longer needed once the image has been loaded. this is done by calling the url.revokeobjecturl() method and passing in the object url string as
specified by img.src. append the new list item to the list. here is a live demo of the code above: example: uploading a user-selected file another thing you might want to do is let the user upload the selected file or files (such as the images selected using the previous example) to a server. this can be done asynchronously very easily. creating the upload tasks continuing with the code tha...
FileReaderSync - Web APIs
the filereadersync interface allows to read file or blob objects synchronously. this interface is only available in workers as it enables synchronous i/o that could potentially block. properties this interface does not have any properties. methods filereadersync.readasarraybuffer() this method converts a
specified blob or a file into an arraybuffer representing the input data as a binary string. filereadersync.readasbinarystring() this method converts a
specified blob or a file into a domstring representing the input data as a binary string. this method is deprecated, consider using readasarraybuffer() instead. filereadersync.readastext() this method converts a
specified blob or a file into a domstring representing the input data as a text string. the optional encoding parameter indi...
... specifications specification status comment file apithe definition of 'filereadersync' in that specification. working draft initial definition. ...
FileSystemFileEntry.file() - Web APIs
rcallback optional if provided, this must be a method which is called when an error occurs while trying to create the file. this callback receives as input a fileerror object describing the error. editor's note: we need to find out what kinds of errors can occur and document them. return value undefined. example this example establishes a method, readfile(), reads a text file and calls a
specified callback function with the received text (in a string object) once the read is completed. if an error occurs, a
specified (optional) error callback is called. function readfile(entry, successcallback, errorcallback) { entry.file(function(file) { let reader = new filereader(); reader.onload = function() { successcallback(reader.result); }; reader.onerror = function() { ...
...uccesscallback(reader.result); }; reader.onerror = function() { errorcallback(reader.error); } reader.readastext(file); }, errorcallback); } this function calls file(), specifying as its success callback a method 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 definition of 'file()' in that specification. draft initial specification. browser compatibility the compatibility table on this page is generated from structured...
File and Directory Entries API support in Firefox - Web APIs
g post why no filesystem api in firefox? for more insights. this has caused a number of popular web sites not to work properly on browsers other than chrome. because of that, an attempt was made to create a spec offering the features of google's api which consensus could be reached on. the result was the file and directory entries api. this subset of the api provided by chrome is still not fully
specified; however, for web compatibility reasons, it was decided to implement a subset of the api in firefox; this was introduced in firefox 50. this article describes how the firefox implementation of the file and directory entries api differs from other implementations and/or the specification. chrome deviations from the specification the largest compatibility issue still remaining is that chrome is ...
...tmlinputelement.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 filesystemdirectoryentry for files dropped on a drop zone. you can't use the localfilesystem.requestfilesystem() method to get access to a
specified local file system. the localfilesystem.resolvelocalfilesystemurl() method isn't implemented. only the asynchronous versions of the interfaces are implemented. any interfaces with names that end in "sync" aren't available. firefox only supports reading from files in the file system. you can't write to them. in particular, the filesystemfileentry.createwriter() method, used to create a filewrite...
FormData() - Web APIs
the formdata() constructor creates a new formdata object. note: this feature is available in web workers. syntax var formdata = new formdata(form) parameters form optional an html <form> element — when
specified, the formdata object will be populated with the form's current keys/values using the name property of each element for the keys and their submitted value for the values. it will also encode file input content. ...
...alue for the values. it will also encode file input content. ...
FormData.append() - Web APIs
note: this method is available in web workers. ...
... note: this method is available in web workers. syntax there are two versions of this method: a two and a three parameter version: formdata.append(name, value); formdata.append(name, value, filename); parameters name the name of the field whose data is contained in value. value the field's value. this can be a usvstring or blob (including subclasses such as file). if none of these are
specified the value is converted to a string. filename optional the filename reported to the server (a usvstring), when a blob or file is passed as the second parameter. the default filename for blob objects is "blob". the default filename for file objects is the file's filename. note: if you specify a blob as the data to append to the formdata object, the filename that will be reported to the server ...
FormData.set() - Web APIs
note: this method is available in web workers. ...
...lues. note: this method is available in web workers. syntax there are two versions of this method: a two and a three parameter version: formdata.set(name, value); formdata.set(name, value, filename); parameters name the name of the field whose data is contained in value. value the field's value. this can be a usvstring or blob (including subclasses such as file). if none of these are
specified the value is converted to a string. filename optional the filename reported to the server (a usvstring), when a blob or file is passed as the second parameter. the default filename for blob objects is "blob". the default filename for file objects is the file's filename. note: if you specify a blob as the data to append to the formdata object, the filename that will be reported to the server ...
HTMLAnchorElement - Web APIs
cument, containing a valid url of a linked resource. htmlanchorelement.hreflang is a domstring that reflects the hreflang html attribute, indicating the language of the linked resource. htmlanchorelement.media is a domstring that reflects the media html attribute, indicating the intended media for the linked resource. htmlhyperlinkelementutils.password is a usvstring containing the password
specified before the domain name. htmlhyperlinkelementutils.origin read only returns a usvstring containing the origin of the url, that is its scheme, its domain and its port. htmlhyperlinkelementutils.pathname is a usvstring representing the path name component, if any, of the referenced url. htmlhyperlinkelementutils.port is a usvstring representing the port component, if any, of the referenced ur...
...is a domstring that reflects the target html attribute, indicating where to display the linked resource. htmlanchorelement.text is a domstring being a synonym for the node.textcontent property. htmlanchorelement.type is a domstring that reflects the type html attribute, indicating the mime type of the linked resource. htmlhyperlinkelementutils.username is a usvstring containing the username
specified before the domain name. obsolete properties htmlanchorelement.charset is a domstring representing the character encoding of the linked resource. htmlanchorelement.coords is a domstring representing a comma-separated list of coordinates. htmlanchorelement.name is a domstring representing the anchor name. htmlanchorelement.rev is a domstring representing that the rev html attrib...
HTMLAreaElement - Web APIs
ts the hreflang html attribute, indicating the language of the linked resource. htmlareaelement.media is a domstring containing that reflects the media html attribute, indicating target media of the linked resource. htmlareaelement.nohref is a boolean flag indicating if the area is inactive (true) or active (false). htmlhyperlinkelementutils.password is a usvstring containing the password
specified before the domain name. htmlhyperlinkelementutils.origin read only returns a usvstring containing the origin of the url, that is its scheme, its domain and its port. htmlhyperlinkelementutils.pathname is a usvstring containing the path name component, if any, of the referenced url. htmlhyperlinkelementutils.port is a usvstring containing the port component, if any, of the referenced url. ...
...g the element's position in the tabbing order. htmlareaelement.target is a domstring that reflects the target html attribute, indicating the browsing context in which to open the linked resource. htmlareaelement.type is a domstring that reflects the type html attribute, indicating the mime type of the linked resource. htmlhyperlinkelementutils.username is a usvstring containing the username
specified before the 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. specifications specification status comment html living stand...
HTMLHyperlinkElementUtils - Web APIs
property that returns a usvstring containing the whole url, and allows the href to be updated. htmlhyperlinkelementutils.protocol this is a usvstring containing the protocol scheme of the url, including the final ':'. htmlhyperlinkelementutils.host this is a usvstring containing the host, that is the hostname, and then, if the port of the url is not empty (which 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 ...
....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. htmlhyperlinkelementutils.password this is a usvstring containing the password
specified before the domain name. htmlhyperlinkelementutils.origin read only this returns a usvstring containing the origin of the url (that is its scheme, its domain and its port). methods note: this interface doesn't inherit any method. htmlhyperlinkelementutils.tostring() this r...
Image() - Web APIs
nctionally equivalent to document.createelement('img'). disambiguation: image(), the css function notation. syntax var htmlimageelement = new image(width, height); parameters width the width of the image (i.e., the value for the width attribute). height the height of the image (i.e., the value for the height attribute). ...
...eelement('img'). disambiguation: image(), the css function notation. syntax var htmlimageelement = new image(width, height); parameters width the width of the image (i.e., the value for the width attribute). height the height of the image (i.e., the value for the height attribute). usage note the entire bitmap is loaded regardless of the sizes
specified in the constructor. the size
specified in the constructor is reflected through the properties htmlimageelement.width and htmlimageelement.height of the resulting instance. the intrinsic width and height of the image in css pixels are reflected through the properties htmlimageelement.naturalwidth and htmlimageelement.naturalheight. if no size is
specified in the constructor both pairs of properties have the same values. examples var ...
HTMLImageElement.alt - Web APIs
this may be the case because of an error, because the user has disabled the loading of images, or because the image simply hasn't finished loading yet. perhaps the most important reason to use the alt tag is to support accessibility, as the alt text may be used by screen readers and other assistive technologies to help differently-abled users make full use of your content. it will be read aloud or sent to the touch device, for example, to support visually impaired users. ...
...in the space the image would occupy and should be able to take the place of the image without altering the meaning of the page. syntax htmlimageelement.alt = alttext; let alttext = htmlimageelement.alt; value a domstring which contains the alternate text to display when the image is not loaded or for use by assistive devices. the alt attribute is officially mandatory; it's meant to always be
specified. if the image doesn't require a fallback (such as for an image which is simply decorative or an advisory icon of minimal importance), you may specify an empty string (""). for compatibility reasons, browsers generally will accept an image without an alt attribute, but you should try to get into the habit of using it. usage notes the fundamental guideline for the alt attribute is that every imag...
HTMLInputElement.stepDown() - Web APIs
the htmlinputelement.stepdown([n]) method decrements the value of a numeric type of <input> element by the value of the step attribute or up to n multiples of the step attribute if a number is passed as the parameter. the method, when invoked, decrements the value by (step * n), where n defaults to 1 if not
specified, and step defaults to the default value for step if not
specified. valid on all numeric, date, and time input types that support the step attribute, includingdate, month, week, time, datetime-local, number, and range. given <input id="mytime" type="time" max="17:00" step="900" value="17:00">, invoking mytime.step(3) will change the value to 16:15, decrementing the time by 3 * 900, or 45 minutes. mytime.step(), with no parameter, would have resulted in 16:45, as n defaults to 1. <...
...e that does match the form controls constraints. if the form control is non time, date, or numeric in nature, and therefore does not support the step attribute (see the list of supported input types in the the table above), or if the step value is set to any, an invalidstateerror exception is thrown. htmlinputelement.stepdown() decrements the value by (step * n), where n defaults to 1 if not
specified. throws an invalid_state_err exception: if the method is not applicable to for the current type value, if the element has no step value, if the value cannot be converted to a number, if the resulting value is above the max or below the min. syntax element.stepdown( [ stepdecrement ] ); parameters stepdecrement the optional stepdecrement paremeter is a numeric va...
HTMLMarqueeElement - Web APIs
,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlmarqueeelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties inherits properties from its parent, htmlelement. htmlmarqueeelement.behavior sets how the text is scrolled within the marquee. possible values are scroll, slide and alternate. if no value is
specified, the default value is scroll. htmlmarqueeelement.bgcolor sets the background color through color name or hexadecimal value. htmlmarqueeelement.direction sets the direction of the scrolling within the marquee. possible values are left, right, up and down. if no value is
specified, the default value is left. htmlmarqueeelement.height sets the height in pixels or percentage value. htmlmarquee...
... htmlmarqueeelement.scrollamount sets the amount of scrolling at each interval in pixels. the default value is 6. ...
HTMLMediaElement - Web APIs
iaelement.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. htmlmediaelement.disableremoteplayback a boolean that sets or returns the remote playback state,...
...dia at a custom speed, or to move through the media frame-by-frame to perform filtering or other operations. htmlmediaelement.setmediakeys() returns promise. sets the mediakeys keys to use when decrypting media during playback. htmlmediaelement.setsinkid() sets the id of the audio device to use for output and returns a promise. this only works when the application is authorized to use the
specified device. obsolete methods these methods are obsolete and should not be used, even if a browser still supports them. htmlmediaelement.mozloadfrom() this method, available only in mozilla's implementation, loads data from another media element. this works similarly to load() except that instead of running the normal resource selection algorithm, the source is simply set to the other eleme...
Option() - Web APIs
the option() constructor creates a new htmloptionelement. syntax var optionelementreference = new option(text, value, defaultselected, selected); parameters text optional a domstring representing the content of the element, i.e. the displayed text. if this is not
specified, a default value of "" (empty string) is used. value optional a domstring representing the value of the htmloptionelement, i.e. the value attribute of the equivalent <option>. if this is not
specified, the value of text is used as the value, e.g. for the associated <select> element's value when the form is submitted to the server. defaultselected optional a boolean that sets the selected attribute value, i.e. so that this <option> will be the default value selected in the <select> element when the page is first loaded...
...note that a value of true does not set the option to selected if it is not already selected. selected optional a boolean that sets the option's selected state; the default is false (not selected). if omitted, even if the defaultselected argument is true, the option is not selected. ...
HTMLElement.focus() - Web APIs
the focused element is the element which will receive keyboard and similar events by default. syntax element.focus(options); // object parameter parameters options optional an optional object providing options to control aspects of the focusing process. this object may contain the following property: preventscroll optional a boolean value indicating whether or not the browser should scroll the document to bring the newly-focused element into view. a value of false for preventscroll (the default) means that the browser will scroll the element into view after focusing it. if preventscroll is set to true, no scrolling will occur. ...
...ment object model (dom) level 1 specificationthe definition of 'focus' in that specification. obsolete notes if you call htmlelement.focus() from a mousedown event handler, you must call event.preventdefault() to keep the focus from leaving the htmlelement behaviour of the focus in relation to different html features like tabindex or shadow dom, which previously remained under-
specified, were recently updated (as october of 2019). checkout whatwg blog for more info. ...
HTMLScriptElement.referrerPolicy - Web APIs
ipt, defining which referrer is sent when fetching the resource. syntax refstr = scriptelem.referrerpolicy; scriptelem.referrerpolicy = refstr; value a domstring; one of the following: no-referrer the referer header will be omitted entirely. no referrer information is sent along with requests. no-referrer-when-downgrade (default) this is the user agent's default behavior if no policy is
specified. the url is sent as a referrer when the protocol security level stays the same (e.g.http→http, https→https), but isn't sent to a less secure destination (e.g. https→http). origin only send the origin of the document as the referrer in all cases. the document https://example.com/page.html will send the referrer https://example.com/. origin-when-cross-origin send a full url when performi...
...n (e.g. https→http). unsafe-url send a full url when performing a same-origin or cross-origin request. this policy will leak origins and paths from tls-protected resources to insecure origins. carefully consider the impact of this setting. note: an empty string value ("") is both the default value, and a fallback value if referrerpolicy is not supported. if referrerpolicy is not explicitly
specified on the <script> element, it will adopt a higher-level referrer policy, i.e. one set on the whole document or domain. if a higher-level policy is not available, the empty string is treated as being equivalent to no-referrer-when-downgrade. examples var scriptelem = document.createelement("script"); scriptelem.src = "/"; scriptelem.referrerpolicy = "unsafe-url"; document.body.appendchild(script)...
HTMLScriptElement - Web APIs
f registering event handlers on elements in an html document. htmlscriptelement.charset is a domstring representing the character encoding of an external script. it reflects the charset attribute. htmlscriptelement.async htmlscriptelement.defer the async and defer attributes are boolean attributes that control how the script should be executed. the defer and async attributes must not be
specified if the src attribute is absent. there are three possible execution modes: if the async attribute is present, then the script will be executed asynchronously as soon as it downloads. if the async attribute is absent but the defer attribute is present, then the script is executed when the page has finished parsing. if neither attribute is present, then the script is fetched and exec...
...he async attribute is present, then the script will be executed asynchronously as soon as it downloads. if the async attribute is absent but the defer attribute is present, then the script is executed when the page has finished parsing. if neither attribute is present, then the script is fetched and executed immediately, blocking further parsing of the page. the defer attribute may be
specified with the async attribute, so legacy browsers that only support defer (and not async) fall back to the defer behavior instead of the default blocking behavior. note: the exact processing details for these attributes are complex, involving many different aspects of html, and therefore are scattered throughout the specification. these algorithms describe the core ideas, but they rely on the parsi...
Working with the History API - Web APIs
t attempt to load this url after a call to pushstate(), but it might attempt to load the url later, for instance after the user restarts the browser. the new url does not need to be absolute; if it's relative, it's resolved relative to the current url. the new url must be of the same origin as the current url; otherwise, pushstate() will throw an exception. this parameter is optional; if it isn't
specified, it's set to the document's current url. note: in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) through gecko 5.0 (firefox 5.0 / thunderbird 5.0 / seamonkey 2.2), the passed object is serialized using json. starting in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3), the object is serialized using the structured clone algorithm. this allows a wider variety of objects to be s...
... data with your new history entry. with the hash-based approach, you need to encode all of the relevant data into a short string. if title is subsequently used by browsers, this data can be utilized (independent of, say, the hash). note that pushstate() never causes a hashchange event to be fired, even if the new url differs from the old url only in its hash. in a xul document, it creates the
specified xul element. in other documents, it creates an element with a null namespace uri. the replacestate() method history.replacestate() operates exactly like history.pushstate(), except that replacestate() modifies the current history entry instead of creating a new one. note that this doesn't prevent the creation of a new entry in the global browser history. replacestate() is particularly useful ...
IDBDatabase.transaction() - Web APIs
n the database, you can use the property idbdatabase.objectstorenames: var transaction = db.transaction(db.objectstorenames); passing an empty array will throw an exception. mode optional the types of access that can be performed in the transaction. transactions are opened in one of three modes: readonly, readwrite and readwriteflush (non-standard, firefox-only.) versionchange mode can't be
specified here. if you don't provide the parameter, the default access mode is readonly. to avoid slowing things down, don't open a readwrite transaction unless you actually need to write into the database. if you need to open the object store in readwrite mode to change data, you would use the following: var transaction = db.transaction('my-store-name', "readwrite"); as of firefox 40, indexeddb transa...
.... details optional dictionary of other settings, supported only by chrome: return value an idbtransaction object. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror the close() method has previously been called on this idbdatabase instance. notfounderror an object store
specified in in the storenames parameter has been deleted or removed. typeerror the value for the mode parameter is invalid. invalidaccesserror the function was called with an empty list 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...
IDBIndex.openCursor() - Web APIs
a success event is always fired on the result object. if at least one record matches the key range, then the result property of the event is set to the new idbcursorwithvalue object; the value of the cursor object is set to a structured clone of the referenced value. ...
... a success event is always fired on the result object. if at least one record matches the key range, then the result property of the event is set to the new idbcursorwithvalue object; the value of the cursor object is set to a structured clone of the referenced value. ...
IDBIndex - Web APIs
al indexes can reference the same object store. when the object store changes, all indexes that refers to the object store are automatically updated. you can grab a set of keys within a range. to learn more, see idbkeyrange. note: this feature is available in web workers. properties idbindex.isautolocale read only returns a boolean indicating whether the index had a locale value of auto
specified upon its creation (see createindex()'s optionalparameters.) idbindex.locale read only returns the locale of the index (for example en-us, or pl) if it had a locale value
specified upon its creation (see createindex()'s optionalparameters.) idbindex.name the name of this index. idbindex.objectstore read only the name of the object store referenced by this index. idbindex.keypath read on...
...ect store that correspond to the given key or are in range, if key is an idbkeyrange. idbindex.getallkeys() returns an idbrequest object, in a separate thread, finds all matching keys in the referenced object store that correspond to the given key or are in range, if key is an idbkeyrange. idbindex.opencursor() returns an idbrequest object, and, in a separate thread, creates a cursor over the
specified key range. idbindex.openkeycursor() returns an idbrequest object, and, in a separate thread, creates a cursor over the
specified key range, as arranged by this index. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor — this works the same as...
IDBObjectStore.delete() - Web APIs
either a key or an idbkeyrange can be passed, allowing one or multiple records to be deleted from a store. to delete all records in a store, use idbobjectstore.clear. bear in mind that if you are using a idbcursor, you can use the idbcursor.delete() method to more efficiently delete the current record — without having to explicitly look up the record's key. note: this feature is available in web workers. ...
... recomm...
IDBObjectStoreSync - Web APIs
read_only 1 modification operations are not allowed on this object store. read_write 0 modification operations are allowed on this object store. snapshot_read 2 any read operations must access a snapshot view of the data, which cannot change once it is created. methods add() stores the given value into this object store, optionally with the
specified key. if a record already exists with the given key, an exception is raised. any add( in any value, in optional any key ) raises (idbdatabaseexception); parameters returns exceptions this method can raise a idbdatabaseexception with the following codes: value the value to store into the index. key a key to use for identifying the record. any the key for the stored record. constr...
...rom the object store. exceptions this method can raise a idbdatabaseexception with the following codes: serial_err if the data being stored could not be deserialized by the internal structured cloning algorithm. not_found_err if no record exists in this index for the given key. opencursor() creates a cursor over the records of this object store. the range of the new cursor matches the
specified key range; if the key range is not
specified or is null, then the range includes all the records. cursorsync opencursor ( in optional keyrange range, in optional unsigned short direction ) raises (databaseexception); parameters range the key range to use as the cursor's range. direction the cursor's required direction. returns idbindexsync an object for accessing the index. e...
IIRFilterNode - Web APIs
the iirfilternode interface of the web audio api is a audionode processor which implements a general infinite impulse response (iir) filter; this type of filter can be used to implement tone control devices and graphic equalizers as well. 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. there are several reasons why: biquad filters are typically less sensitive to numeric quirks. the filter parameters of biquad filters can be automated. all even-ordered iir ...
...lternode() 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. it also has the following additional methods: getfrequencyresponse() uses the filter's current parameter settings to calculate the response for frequencies
specified in the provided array of frequencies. examples you can find a simple iir filter demo live on codepen. also see the source code on github. it includes some different coefficient 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 ful...
Basic concepts - Web APIs
atabase 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 version. when a database is first created, its version is the integer 1 if not
specified otherwise. each database can have only one version at any given time. durable in firefox, indexeddb used to be durable, meaning that in a readwrite transaction idbtransaction.oncomplete was fired only when all data was guaranteed to have been flushed to disk. as of firefox 40, indexeddb transactions have relaxed durability guarantees to increase performance (see bug 1112702), which i...
...you can also look up records in an object store using the key. to learn more on using indexes, see using indexeddb. for the reference documentation on index, see idbkeyrange. key and value key a data value by which stored values are organized and retrieved in the object store. the object store can derive the key from one of three sources: a key generator, a key path, or an explicitly
specified value. the key must be of a data type that has a number that is greater than the one before it. each record in an object store must have a key that is unique within the same store, so you cannot have multiple records with the same key in a given object store. a key can be one of the following types: string, date, float, a binary blob, and array. for arrays, the key can range from an empty value...
getVersion - Web APIs
api is now deprecated and as of gecko 1.9 no longer available. extension, theme, and plug-in developers must switch away from install.js based packages to the new packaging scheme with an install.rdf manifest. in particular plugin developers should see how to package a plugin as an extension. getversion returns an object representing the version number from the client version registry for the
specified component. it is used in both trigger scripts and installation scripts. method of installtrigger object syntax installversion getversion ( string component ); parameters the getversion method has one parameter: component the name of a component in the client version registry. returns if software installation is disabled, this method returns null. otherwise, it returns an installver...
...ion ( string component ); parameters the getversion method has one parameter: component the name of a component in the client version registry. returns if software installation is disabled, this method returns null. otherwise, it returns an installversion object representing the version of the component. if the component has not been registered in the client version registry or if the
specified component was installed with a null version, this method returns null. installing a component with a null version indicates that the component should always be updated when the opportunity arises. ...
startSoftwareUpdate - Web APIs
this method has been largely superseded by newer install method, which is more flexible and allows you to install more than one xpi. ...
...this method has been largely superseded by newer install method, which is more flexible and allows you to install more than one xpi. note also that xpis installed with this method must have their own install.js files in which the full installation is defined. ...
InstallTrigger - Web APIs
overview for very simple installations, the install methods on the installtrigger object may be all that's needed in the installation script. for more complex installations, you may need to use the install and/or file installation objects. in either case, you must trigger the installation process by creating a web page script in which installtrigger methods download the
specified xpi file and "trigger" the execution of the install.js script at the top level of that xpi. the principal method on the installtrigger object is install, which downloads and installs one or more software packages archived in the xpi file format. the following is a basic example of an install trigger on a web page: xpi={'xpinstall dialog display name':'simple.xpi'}; installtrigger.i...
...ultiple-package installations with install. compareversion compares the version of a file or package with the version of an existing file or package. enabled indicates whether or not software installation is enabled for this client machine. getversion returns an object representing the version number from the client version registry for the
specified component. it is used in both trigger scripts and installation scripts. install installs one or more xpi files on the local machine. installchrome installs new skin or locale packages in netscape 6 and mozilla. startsoftwareupdate triggers the downloading and installation of the software at the
specified url. ...
IntersectionObserver - Web APIs
ibility within the root. the configuration cannot be changed once the intersectionobserver is created, so a given observer object is only useful for watching for specific changes in degree of visibility; however, you can watch multiple target elements with the same observer. constructor intersectionobserver.intersectionobserver() creates a new intersectionobserver object which will execute a
specified callback function when it detects that a target element's visibility has crossed one or more thresholds. properties intersectionobserver.root read only the element or document whose bounds are used as the bounding box when testing for intersection. if no root value was passed to the constructor or its value is null, the top-level document's viewport is used. intersectionobserver.rootmargi...
...ng for intersection. if no root value was passed to the constructor or its value is null, the top-level document's viewport is used. intersectionobserver.rootmargin read only an offset rectangle applied to the root's bounding box when calculating intersections, effectively shrinking or growing the root for calculation purposes. the value returned by this property may not be the same as the one
specified when calling the constructor as it may be changed to match internal requirements. each offset can be expressed in pixels (px) or as a percentage (%). the default is "0px 0px 0px 0px". intersectionobserver.thresholds read only a list of thresholds, sorted in increasing numeric order, where each threshold is a ratio of intersection area to bounding box area of an observed target. notifications f...
KeyframeEffect.getKeyframes() - Web APIs
rns an array of the computed keyframes that make up this animation along with their computed offsets. syntax var keyframes = keyframeeffect.getkeyframes(); parameters none. return value returns a sequence of objects with the following format: property value pairs as many property value pairs as are contained in each keyframe of the animation. offset the offset of the keyframe
specified as a number between 0.0 and 1.0 inclusive or null. this is equivalent to specifying start and end states in percentages in css stylesheets using @keyframes. this will be null if the keyframe is automatically spaced using keyframeeffect.spacing. computedoffset the computed offset for this keyframe, calculated when the list of computed keyframes was produced according to keyframeeffect.spacin...
...spacing. computedoffset the computed offset for this keyframe, calculated when the list of computed keyframes was produced according to keyframeeffect.spacing. unlike offset, above, the computedoffset is never null. easing the timing function used from this keyframe until the next keyframe in the series. composite the keyframeeffect.composite operation used to combine the values
specified in this keyframe with the underlying value. this will be absent if the composite operation
specified on the effect is being used. examples in the red queen race example, we can inspect alice and the redqueen's animation to see its individual keyframes like so: // return the array of keyframes redqueen_alice.effect.getkeyframes(); specifications specification status commen...
MediaCapabilitiesInfo - Web APIs
o() or mediacapabilities.decodinginfo() methods of the mediacapabilities interface fulfills, providing information as to whether the media type is supported, and whether encoding or decoding such media would be smooth and power efficient. ...
...erface contains three boolean attribues: supported: given the properties defined in the mediaconfiguration, can the
specified piece of media content be encoded (if mediaencodingconfiguration is set) or decode (if mediadecodingconfiguration is set) at all? if yes, supported is true. otherwise, it is false. smooth: given the properties defined in the mediaconfiguration, will the playback of the
specified piece of media be high quality? will it be smooth? if supported is true, and playback will be smooth, smooth is true, otherwise, is it false. powerefficient: given the properties defined in the mediaconfiguration, will the playback of the
specified piece of media be power efficient? if supported is true, and playback will be power efficient, powerefficient is true, otherwise, is it false. bro...
Media Session action types - Web APIs
to support an action on a media session, such as seeking, pausing, or changing tracks, you need to call the mediasession interface's setactionhandler() method to establish a handler for that action. the specific type of media session action to be handled on a mediasession is identified using a string from the mediasessionaction enumerated type. syntax a media session action's type is
specified using a string from the mediasessionaction enumerated type. values each of the actions is a common media session control request. implement support for each of these in order to allow that type of action to be performed. the following strings identify the currently available types of media session action: nexttrack advances playback to the next track. pause pauses playback of the media. pl...
...revious track. seekbackward seeks backward through the media from the current position. the mediasessionactiondetails property seekoffset specifies the amount of time to seek backward. seekforward seeks forward from the current position through the media. the mediasessionactiondetails property seekoffset specifies the amount of time to seek forward. seekto moves the playback position to the
specified time within the media. the time to which to seek is
specified in the mediasessionactiondetails property seektime. if you intend to perform multiple seekto operations in rapid succession, you can also specify the mediasessionactiondetails property fastseek property with a value of true. this lets the browser know it can take steps to optimize repeated operations, and is likely to result in improve...
MediaSessionActionDetails - Web APIs
to skip forward or backward (such as 7 or 10 seconds). seektime optional if the action is seekto, this property must be present and must be a floating-point value indicating the absolute time within the media to move the playback position to, where 0 indicates the beginning of the media. this property is not present for other action types. media action types a media session action's type is
specified using a string from the mediasessionaction enumerated type. values each of the actions is a common media session control request. implement support for each of these in order to allow that type of action to be performed. the following strings identify the currently available types of media session action: nexttrack advances playback to the next track. pause pauses playback of the media. ...
...revious track. seekbackward seeks backward through the media from the current position. the mediasessionactiondetails property seekoffset specifies the amount of time to seek backward. seekforward seeks forward from the current position through the media. the mediasessionactiondetails property seekoffset specifies the amount of time to seek forward. seekto moves the playback position to the
specified time within the media. the time to which to seek is
specified in the mediasessionactiondetails property seektime. if you intend to perform multiple seekto operations in rapid succession, you can also specify the mediasessionactiondetails property fastseek property with a value of true. this lets the browser know it can take steps to optimize repeated operations, and is likely to result in improve...
MediaStream.addTrack() - Web APIs
syntax stream.addtrack(track); parameters track a mediastreamtrack to add to the stream. ...
... syntax stream.addtrack(track); parameters track a mediastreamtrack to add to the stream. ...
MediaStream.getTrackById() - Web APIs
otherwise, the returned value is null. example this example activates a commentary track on a video by ducking the audio level of the main audio track to 50%, then enabling the commentary track. ...
...otherwise, the returned value is null. example this example activates a commentary track on a video by ducking the audio level of the main audio track to 50%, then enabling the commentary track. ...
MediaStreamAudioSourceNode - Web APIs
de matches the number of tracks found in the selected audio track. number of inputs 0 number of outputs 1 channel count defined by the first audio mediastreamtrack passed to the audiocontext.createmediastreamsource() method that created it. ...
... usage notes typically, you should probably not use this type of node. it has been replaced with the more predictable mediastreamtrackaudiosourcenode, which has better-defined rules for how it chooses the track to output. ...
MediaStreamConstraints.audio - Web APIs
the mediastreamconstraints dictionary's audio property is used to indicate what kind of audio track, if any, should be included in the mediastream returned by a call to getusermedia(). to learn more about how constraints work, see capabilities, constraints, and settings. syntax var audioconstraints = true | false | mediatrackconstraints; value the value of the audio property can be
specified as either of two types: boolean if a boolean value is
specified, it simply indicates whether or not an audio track should be included in the returned stream; if it's true, an audio track is included; if no audio source is available or if permission is not given to use the audio source, the call to getusermedia() will fail. if false, no audio track is included. mediatrackconstraints a constraints...
...lls getusermedia(), specifying a set of audio constraints requesting that echo cancellation be enabled and that, if possible, the sample rate be 8 bits per sample instead of the more common 16 bits (possibly as a bandwidth saving measure). as long as an audio input device is available and the user allows it to be used, an audio track will be included in the resulting stream, and it will match the
specified constraints as well as possible. result specifications specification status comment media capture and streamsthe definition of 'mediastreamconstraints.audio' in that specification. candidate recommendation initial specification. ...
MediaStreamConstraints.video - Web APIs
the mediastreamconstraints dictionary's video property is used to indicate what kind of video track, if any, should be included in the mediastream returned by a call to getusermedia(). to learn more about how constraints work, see capabilities, constraints, and settings. syntax var videoconstraints = true | false | mediatrackconstraints; value the value of the video property can be
specified as either of two types: boolean if a boolean value is
specified, it simply indicates whether or not a video track should be included in the returned stream; if it's true, a video track is included; if no video source is available or if permission is not given to use the video source, the call to getusermedia() will fail. if false, no video track is included. mediatrackconstraints a constraints d...
...which calls getusermedia(), specifying a set of video constraints that indicate a preference for a video track whose dimensions are as close as possible to 160x120 pixels, and whose frame rate is as close to 15 frames per second as possible. as long as a video input device is available and the user allows it to be used, a video track will be included in the resulting stream, and it will match the
specified constraints as well as possible. result specifications specification status comment media capture and streamsthe definition of 'mediastreamconstraints.video' in that specification. candidate recommendation initial specification. ...
MediaStreamConstraints - Web APIs
constraints, and settings. properties some combination—but not necessarily all—of the following properties will exist on the object. track constraints audio either a boolean (which indicates whether or not an audio track is requested) or a mediatrackconstraints object providing the constraints which must be met by the audio track included in the returned mediastream. if constraints are
specified, an audio track is inherently requested. video either a boolean (which indicates whether or not a video track is requested) or a mediatrackconstraints object providing the constraints which must be met by the video track included in the returned mediastream. if constraints are
specified, a video track is inherently requested. security peeridentity a domstring identifying the peer who has ...
...o either a boolean (which indicates whether or not a video track is requested) or a mediatrackconstraints object providing the constraints which must be met by the video track included in the returned mediastream. if constraints are
specified, a video track is inherently requested. security peeridentity a domstring identifying the peer who has sole access to the stream. if this property is
specified, only the indicated peer can receive and use the stream. streams isolated in this way can only be displayed in a media element (<audio> or <video>) where the content is protected just as if cors cross-origin rules were in effect. when a peer identity is set, mediastreamtracks from that peer have their isolated flag set to true. ...
MediaStreamTrack.applyConstraints() - Web APIs
applying constraints in capabilities, constraints, and settings for more information on how to apply your preferred constraints. syntax const appliedpromise = track.applyconstraints([constraints]) parameters constraints optional a mediatrackconstraints object listing the constraints to apply to the track's constrainable properties; any existing constraints are replaced with the new values
specified, and any constrainable properties not included are restored to their default constraints. if this parameter is omitted, all currently set custom constraints are cleared. this object represents the basic set of constraints that must apply for the promise to resolve. the object may contain an advanced property containing an array of additional mediatrackconstrants objects, which are treated as exac...
...roperty containing an array of additional mediatrackconstrants objects, which are treated as exact requires. return value a promise which resolves when the constraints have been successfully applied. if the constraints cannot be applied, the promise is rejected with a mediastreamerror whose name is overconstrainederror, to indicate that the constraints could not be met. this can happen if the
specified constraints are too strict to find a match when attempting to configure the track. examples the following shows how to specify a basic and advanced set of constraints. it specifies that the page or web app needs a width between 640 and 1280 and a height between 480 and 720, with the later number in each pair being preferred. the advanced property further specifies that an image size of 1920 by ...
MediaStreamTrackAudioSourceNode() - Web APIs
another way to create a mediastreamtrackaudiosourcenode is to call theaudiocontext.createmediastreamtracksource() method, specifying the mediastreamtrack from which you want to obtain audio. syntax audiotracknode = new mediastreamtrackaudiosourcenode(context, options); parameters context an audiocontext representing the audio context you want the node to be associated with. ...
...xt you want the node to be associated with. options a mediastreamtrackaudiosourceoptions object defining the properties you want the mediastreamtrackaudiosourcenode to have: mediastreamtrack the mediastreamtrack from which to take audio data for this node's output. return value a new mediastreamtrackaudiosourcenode object representing the audio node whose media is obtained from the
specified media track. exceptions notsupportederror the
specified context is not an audiocontext. invalidstateerror the
specified mediastreamtrack isn't an audio track (that is, its kind property isn't audio. example this example uses getusermedia() to obtain access to the user's camera, then creates a new mediastreamaudiosourcenode from the first audio track provided by the device. let audioctx...
MediaTrackConstraints.latency - Web APIs
imply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { latency: constraint }; constraintsobject.latency = constraint; value a constraindouble describing the acceptable or required value(s) for an audio track's latency, with values
specified in seconds. in audio processing, latency is the time between the start of processing (when sound occurs in the real world, or is generated by a hardware device) and the data being made available to the next step in the audio input or output process. in most cases, low latency is desirable for performance and user experience purposes, but when power consumption is a concern, or delays are otherwis...
...ases, low latency is desirable for performance and user experience purposes, but when power consumption is a concern, or delays are otherwise acceptable, higher latency might be acceptable. if this property's value is a number, the user agent will attempt to obtain media whose latency tends to be as close as possible to this number given the capabilities of the hardware and the other constraints
specified. otherwise, the value of this constraindouble will guide the user agent in its efforts to provide an exact match to the required latency (if exact is
specified or both min and max are provided and have the same value) or to a best-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 variatio...
MediaTrackSettings.latency - Web APIs
this is, of course, an approximation, since latency can vary for many reasons including cpu, transmission, and storage overhead. ...
... this is, of course, an approximation, since latency can vary for many reasons including cpu, transmission, and storage overhead. ...
Using the Media Capabilities API - Web APIs
these parameters may include the codecs, resolutions, bit rates, frame rates, and other such details. ...
...h ? '' : 'not ') + 'smooth, and ' + (result.powerefficient ? '' : 'not ') + 'power efficient.') }); the response provided is defined by the mediacapabilitiesinfo interface. handling errors in our video decoding example, a typeerror would be raised if the media configuration passed to the decodinginfo() method was invalid. there are a few reasons why an error might occur, including: the
specified type isn't one of the two permtited values: file or media-source the contenttype given is the error can be due to the type not being one of the two possible values, the contenttype not being a valid codec mime type, or invalid or omitted definitions required in the videoconfiguration. navigator.mediacapabilities.decodinginfo(videoconfiguration).then( console.log('it worked') ).catch(error =...
Transcoding assets for Media Source Extensions - Web APIs
led successfully before moving to the next step. sample media should be placed in the bento4 utils directory and worked here. note: the prebuilt ffmpeg does not include libfdk_aac due to licensing reasons. bento4 uses this by default, so you need to compile ffmpeg if necessary. if you don't need it, add --audio-codec=aac to the mp4-dash-encode.py command line. container and codec support as
specified in section 1.1 of the mse spec: goals, mse is designed not to require support for any particular media format or codec. while this is true on paper, browser support varies for specific container/codec combinations. to check if the browser supports a particular container, you can pass a string of the mime type to the mediasource.istypesupported method: mediasource.istypesupported('audio/mp3'); ...
...movie flag to be set: -movflags frag_keyframe+empty_moov+default_base_moof having a properly fragmented mp4 file is all you need to get started. if you wish to employ adaptive bitrate streaming, you'll have to create encodings at multiple resolutions. while mse is flexible enough to allow you to make your implementation, it's highly recommended to use an existing dash client as dash is a well-
specified application protocol. creating content for dash given that you have ffmpeg and bento4's utilities accessible through your $path, you can run bento4's mp4-dash-encode.py python script to generate multiple encodings of your content at various resolutions. bento4's mp4-dash.py python script can then be used to generate the corresponding mpd file needed by clients. run the following commands (show...
MessageEvent.MessageEvent() - Web APIs
creates a new messageevent object instance. syntax var messageevent = new messageevent(type, init); parameters type the type of messageevent that will be created. this can be one of xxx init optional a dictionary object that can contain the following properties: data: the data you want contained in the messageevent. this can be of any data type, and will default to null if not
specified. origin: a usvstring representing the origin of the message emitter. this defaults to an empty string ("") if not
specified. lasteventid: a domstring representing a unique id for the event. this defaults to an empty string ("") if not
specified. source: an messageeventsource (which can be a windowproxy, messageport, or serviceworker object) representing the message emitter. this defaults to...
...e (which can be a windowproxy, messageport, or serviceworker object) representing the message emitter. this defaults to null if not set. ports: an array of messageport objects representing the ports associated with the channel the message is being sent through (where appropriate, e.g. in channel messaging or when sending a message to a shared worker). this defaults to an empty array ([]) if not
specified. example var mymessage = new messageevent('worker', { data : 'hello' }); specifications specification status comment html living standardthe definition of 'messageevent()' in that specification. living standard ...
Microdata DOM API - Web APIs
e deprecated. you can't use them anymore and this document is kept as information only. microdata becomes even more useful when scripts can use it to expose information to the user, for example offering it in a form that can be used by other applications. the document.getitems(typenames) method provides access to the top-level microdata items. it returns a nodelist containing the items with the
specified types, or all types if no argument is
specified. each item is represented in the dom by the element on which the relevant itemscope attribute is found. these elements have their element.itemscope idl attribute set to true. the type(s) of items can be obtained using the element.itemtype idl attribute on the element with the itemscope attribute. methods document . getitems( [ types ] ) returns a...
...reted as a space-separated list of types. the document.getitems(typenames) method takes a string that contains an unordered set of unique space-separated tokens that are case-sensitive, representing types. when called, the method must return a live nodelist object containing all the elements in the document, in tree order, that are each top-level microdata items whose types include all the types
specified in the method's argument, having obtained the types by splitting the string on spaces. if there are no tokens
specified in the argument, then the method must return a nodelist containing all the top-level microdata items in the document. when the method is invoked on a document object again with the same argument, the user agent may return the same object as the object returned by the earlier cal...
MouseEvent.pageX - Web APIs
the document are scrolled out of view, and the mouse is clicked 100 pixels inward from the left edge of the view, the value returned by pagex will be 300. originally, this property was defined as a long integer. the cssom view module redefined it as a double float. see the browser compatibility section for details. ...
...er compatibility section for details. see page in coordinate systems for some additional information about coordinates
specified in this fashion. syntax var pagex = mouseevent.pagex; value a floating-point number of pixels from the left edge of the document at which the mouse was clicked, regardless of any scrolling or viewport positioning that may be in effect. this property was originally
specified in the touch events specification as a long integer, but was redefined in the cssom view module to be a double-precision floating-point number to allow for subpixel precision. even though numeric types both are represented by number in javascript, they may be handled differently internally in the browser's code, resulting in potential behavior differences. see browser compatibility to learn which...
MutationObserverInit.attributeFilter - Web APIs
if the attributes permission is true but no attributefilter is included in the options object, all attributes' values are watched for changes. ...
...ype being "attributes"), we use the attribute's name, obtained using mutationrecord.attributename, to identify the type of change that occurred and then dispatch to the appropriate handler function. note the use of mutationrecord.oldvalue to get the previous value of the "username" property so we have that information when doing lookups in our local array of users. when observe() is called, the
specified options include both attributefilter and subtree, so that we monitor the attribute values for all of the nodes contained within the subtree rooted at the node with the id "userlist". the attributeoldvalue option is set to true because we want the prior value of the changed attributes recorded and reported in the mutation records we receive. specifications specification status com...
MutationObserverInit.attributes - Web APIs
tional attributes property is used to specify whether or not to watch for attribute value changes on the node or nodes being observed. 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. you can expand the capabilities of attribute mutation monitoring using other options: attributefilter lets you specify specific attribute names to monitor instead of monitoring all attributes. attributeoldvalue lets you specify whether or not you want ...
...t of mutationrecord objects. for any items representing an attribute change (which can be detected by the value of mutationrecord.type being "attributes"), a function called notifyuser() is used to tell the user the name of the attribute that changed as well as the attribute's new value (mutation.target[mutation.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 definition of 'mutationobserverinit.attributes' in that specification. living standard ...
MutationObserverInit - Web APIs
hildlist 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 the value of attributes on the node or nodes being monitored. the default value is true if either of attributefilter or attributeoldvalue is
specified, otherwise the default value is false. attributefilter optional an array of specific attribute names to be monitored. if this property isn't included, changes to all attributes cause mutation notifications. attributeoldvalue optional set to true to record the previous value of any attribute that changes when monitoring the node or nodes for attribute changes; see monitoring attribute values i...
...ll attributes cause mutation notifications. attributeoldvalue optional set to true to record the previous value of any attribute that changes when monitoring the node or nodes for attribute changes; see monitoring attribute values in mutationobserver for details on watching for attribute changes and value recording. the default value is false. characterdata optional set to true to monitor the
specified target node (and, if subtree is true, its descendants) for changes to the character data contained within the node or nodes. the default value is true if characterdataoldvalue 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, ...
NDEFRecord - Web APIs
attributes ndefrecord.recordtype read only represents the ndef record type. ndefrecord.mediatype read only represents the mime type of the ndef record payload. ...
... attributes ndefrecord.recordtype read only represents the ndef record type. ndefrecord.mediatype read only represents the mime type of the ndef record payload. ...
Navigator.getUserMedia() - Web APIs
the deprecated navigator.getusermedia() method prompts the user for permission to use up to one video input device (such as a camera or shared screen) and up to one audio input device (such as a microphone) as the source for a mediastream. if permission is granted, a mediastream whose video and/or audio tracks come from those devices is delivered to the
specified success callback. if permission is denied, no compatible input devices exist, or any other error condition occurs, the error callback is executed with a mediastreamerror object describing what went wrong. if the user instead doesn't make a choice at all, neither callback is executed. this is a legacy method. please use the newer navigator.mediadevices.getusermedia() instead. while technically not deprecated, this old callback versio...
... the media stream. your callback can then assign the stream to the desired object (such as an <audio> or <video> element), as shown in the following example: function(stream) { var video = document.queryselector('video'); video.srcobject = stream; video.onloadedmetadata = function(e) { // do something with the video here. }; } errorcallback when the call fails, the function
specified in the errorcallback is invokedwith a mediastreamerror object as its sole argument; this object is is modeled on domexception. see {anch("errors")}} below for a list of the errors which can occur. return value undefined. errors examples width and height here's an example of using getusermedia(), including code to cope with various browsers' prefixes. note that this is the deprecated way ...
Navigator.share() - Web APIs
the navigator.share() method of the web share api invokes the native sharing mechanism of the device. syntax var sharepromise = navigator.share(data); parameters data an object containing data to share. at least one of the following fields must be
specified. available options are: url: a usvstring representing a url to be shared. text: a usvstring representing text to be shared. title: a usvstring representing the title to be shared. files: a " frozenarray" representing the array of file to be shared. ...
...red. text: a usvstring representing text to be shared. title: a usvstring representing the title to be shared. files: a " frozenarray" representing the array of file to be shared. return value a promise that will be fulfilled once a user has completed a share action (usually the user has chosen an application to share to). it will reject immediately if the data parameter is not correctly
specified, and will also reject if the user cancels sharing. examples in our web share test (see the source code) there is a button which, when clicked, invokes the web share api to share mdn's url. the javascript looks like this: const sharedata = { title: 'mdn', text: 'learn web development on mdn!', url: 'https://developer.mozilla.org', } const btn = document.queryselector('button'); const res...
Node.appendChild() - Web APIs
if the given child is a reference to an existing node in the document, appendchild() moves it from its current position to the new position (there is no requirement to remove the node from its parent node before appending it to some other node). this means that a node can't be in two points of the document simultaneously. so if the node already has a parent, the node is first removed, then appended at the new position. the node.clonenode() method can be used to make a copy of the node before appending it under the new parent. note that the copies made with clonenode will not be automatically kept in sync. ...
...e already has a parent, the node is first removed, then appended at the new position. the node.clonenode() method can be used to make a copy of the node before appending it under the new parent. note that the copies made with clonenode will not be automatically kept in sync. if the given child is a documentfragment, the entire contents of the documentfragment are moved into the child list of the
specified parent node. newer api avaliable! the parentnode.append() method supports multiple arguments and appending strings. syntax element.appendchild(achild) parameters achild the node to append to the given parent node (commonly an element). return value the returned value is the appended child (achild), except when achild is a documentfragment, in which case the empty documentfragment is ...
Node.removeChild() - Web APIs
xecute 'removechild' on 'node': the node to be removed is not a child of this node. if the child doesn't exist on the dom of the page, the method throws the following exception: uncaught typeerror: failed to execute 'removechild' on 'node': parameter 1 is not of type 'node'. ...
...t typeerror: failed to execute 'removechild' on 'node': parameter 1 is not of type 'node'. ...
Notification.lang - Web APIs
see the sitepoint iso 2 letter language codes page for a simple reference. syntax var language = notification.lang; value a domstring specifying the language tag. ...
...see the sitepoint iso 2 letter language codes page for a simple reference. syntax var language = notification.lang; value a domstring specifying the language tag. ...
OfflineAudioContext.suspend() - Web APIs
for this reason, it is not allowed to schedule multiple suspends at the same quantized frame. also scheduling should be done while the context is not running to ensure the precise suspension. ...
...for this reason, it is not allowed to schedule multiple suspends at the same quantized frame. also scheduling should be done while the context is not running to ensure the precise suspension. ...
Page Visibility API - Web APIs
number of policies in place to mitigate the performance impact of background or hidden tabs. these may include: most browsers stop sending requestanimationframe() callbacks to background tabs or hidden <iframe>s in order to improve performance and battery life. timers such as settimeout() are throttled in background/inactive tabs to help improve performance. see reasons for delays longer than
specified for more details. budget-based background timeout throttling is now available in modern browsers (firefox 58+, chrome 57+), placing an additional limit on background timer cpu usage. this operates in a similar way across modern browsers, with the details being as follows: in firefox, windows in background tabs each have their own time budget in milliseconds — a max and a min value of +50...
...in modern browsers (firefox 58+, chrome 57+), placing an additional limit on background timer cpu usage. this operates in a similar way across modern browsers, with the details being as follows: in firefox, windows in background tabs each have their own time budget in milliseconds — a max and a min value of +50 ms and -150 ms, respectively. chrome is very similar except that the budget is
specified in seconds. windows are subjected to throttling after 30 seconds, with the same throttling delay rules as
specified for window timers (again, see reasons for delays longer than
specified). in chrome, this value is 10 seconds. timer tasks are only permitted when the budget is non-negative. once a timer's code has finished running, the duration of time it took to execute is subtracted from...
ParentNode.replaceChildren() - Web APIs
the parentnode.replacechildren() method replaces the existing children of a node with a
specified new set of children. these can be domstring or node objects. syntax // [throws, unscopable] parentnode.replacechildren(...nodesordomstrings) // returns undefined parameters nodesordomstrings a set of node or domstring objects to replace the parentnode's existing children with. if no replacement objects are
specified, then the parentnode is emptied of all child nodes. exceptions hierarchyrequesterror: the constraints of the node tree are violated. examples emptying a node replacechildren() provides a very convenient mechanism for emptying a node of all its children. ...
...for example, say we have a simple application allowing you to choose what food you want for your party. ...
PaymentCurrencyAmount.currencySystem - Web APIs
syntax currencysystem = paymentcurrencyamount.currencysystem; value a domstring which specifies the currency standard used to specify the currency in which the payment value is represented. ...
... syntax currencysystem = paymentcurrencyamount.currencysystem; value a domstring which specifies the currency standard used to specify the currency in which the payment value is represented. ...
PaymentCurrencyAmount.value - Web APIs
the paymentcurrencyamount property value is a string containing the decimal numeric value of the payment,
specified in the currency units indicated by the currency property. the contents of this string must be a valid decimal number; that is, some number of digits between 0 and 9 with up to one optional decimal point. an optional leading minus sign ("-") can be included to indicate a negative value, such as to represent a refund or discount. important note: the number given in this string is always
specified using the period (".") as the decimal point, rather than the comma (","), even if the user's locale normally uses the comma. you must convert the entered text to this form or it will not be valid. syntax value = paymentcurrencyamount.value; value a domstring indicating the numeric val...
... specifications specification status comment payment request apithe definition of 'paymentcurrencyamount.value' in that specification. candidate recommendation ...
PerformanceObserverEntryList.getEntriesByName() - Web APIs
the list is available in the observer's callback function (as the first parameter in the callback). this method is exposed to window and worker interfaces. syntax entries = list.getentriesbyname(name, type); parameters name a domstring representing the name of the entry to retrieve. ...
...dow and worker interfaces. syntax entries = list.getentriesbyname(name, type); parameters name a domstring representing the name of the entry to retrieve. type optional a domstring representing the type of entry to retrieve such as "mark". the valid entry types are listed in performanceentry.entrytype. return value a list of explicitly observed performance entry objects that have the
specified name and type. if the type argument is not
specified, only the name will be used to determine the entries to return. the items will be in chronological order based on the entries' starttime. if no objects meet the
specified criteria, an empty list is returned. example function print_perf_entry(pe) { console.log("name: " + pe.name + "; entrytype: " + pe.entrytype + ...
PerformanceObserverEntryList.getEntriesByType() - Web APIs
the getentriesbytype() method of the performanceobserverentrylist returns a list of explicitly observed performance entry objects for a given performance entry type. the list's members are determined by the set of entry types
specified in the call to the observe() method. the list is available in the observer's callback function (as the first parameter in the callback). this method is exposed to window and worker interfaces. syntax entries = list.getentriesbytype(type); parameters type the type of entry to retrieve such as "frame". the valid entry types are listed in performanceentry.entrytype. return value a list of explicitly observed performanceentry objects that have the
specified type. the items will be in chronological order based on the entries' starttime. if no objects have the...
...d worker interfaces. syntax entries = list.getentriesbytype(type); parameters type the type of entry to retrieve such as "frame". the valid entry types are listed in performanceentry.entrytype. return value a list of explicitly observed performanceentry objects that have the
specified type. the items will be in chronological order based on the entries' starttime. if no objects have the
specified type, or no argument is provided, an empty list is returned. example function print_perf_entry(pe) { console.log("name: " + pe.name + "; entrytype: " + pe.entrytype + "; starttime: " + pe.starttime + "; duration: " + pe.duration); } // create observer for all performance event types var observe_all = new performanceobserver(function(list...
RTCConfiguration.certificates - Web APIs
available for use when authenticating duing the connection process. syntax let rtcconfiguration = { certificates: certificatelist }; let rtcconfiguration.certificates = [ cert1... ]; let certificates = rtcconfiguration.certificates; value an array of rtccertificate objects, each specifying one security certificate available for use when connecting to a remote peer. if this property isn't
specified, the browser will automatically generate and use a certificate to secure the connection. see using certificates below for more information on why you might want to—or not to—explicitly provide certificates. description if this property isn't included in the configuration, a set of certificates is automatically generated for each instance of rtcpeerconnection. although a given dtls connecti...
...tificate and ignore the rest of the list; others may take a different approach. using certificates when you wish to provide your own certificates for use by an rtcpeerconnection instead of having the rtcpeerconnection generate them automatically, you do so by calling the static rtcpeerconnection.generatecertificate() function. the certificates property's value cannot be changed once it's first
specified. if it's included in the configuration passed into a call to a connection's setconfiguration(), it is ignored. this attribute supports providing multiple certificates because even though a given dtls connection uses only one certificate, providing multiple certificates allows support for multiple encryption algorithms. the implementation of rtcpeerconnection will choose which certificate to use ...
RTCDataChannel.send() - Web APIs
is may be a usvstring, a blob, an arraybuffer, or an arraybufferview. return value undefined. exceptions invalidstateerror since the data channel uses a separate transport channel from the media content, it must establish its own connection; if it hasn't finished doing so (that is, its readystate is "connecting"), this error occurs without sending or buffering the data. networkerror the
specified data would need to be buffered, and there isn't room for it in the buffer. in this scenario, the underlying transport is immediately closed. typeerror the
specified data is too large for the other peer to receive. since there are multiple techniques for breaking up large data into smaller pieces for transfer, it's possible to encounter scenarios in which the other peer does not support the same...
...g to indicate when a received message is the last piece of a multi-part object sent using send(). for more information about message size restrictions, see understanding message size limits in using webrtc data channels. example in this example, a routine called sendmessage() is created; it accepts an object as input and sends to the remote peer, over the rtcdatachannel, a json string with the
specified object and a time stamp. var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("backchannel"); function sendmessage(msg) { let obj = { "message": msg, "timestamp": new date() } dc.send(json.stringify(obj)); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.sen...
RTCIceCandidate.RTCIceCandidate() - Web APIs
esent a single ice candidate. syntax candidate = new rtcicecandidate([candidateinfo]); parameters candidateinfo optional an optional rtcicecandidateinit 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 rtcicecandidateinit dictionary. if candidateinfo is provided, the new rtcicecandidate is initialized as follows: each member of the rtcicecandidateinit object is initialized to the value of the property by the same name from rtcicecandidateinit. this includes the candidate, sdpmid, sdpmlineindex, and usernamefragment properties. the candidate string (which is sdp text) is...
... "end-of-candidates" message. 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 rtcicecandidateinit 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 definition of 'rtcicecandidate()' in that specification. candidate re...
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. the a-line string is obtained either from the rtcicecandidateinit property candidate or from a-line string passed into the constructor upon using new rtcicecandidate(). ...
...ate. the a-line string is obtained either from the rtcicecandidateinit property candidate or from a-line string passed into the constructor upon using new rtcicecandidate(). syntax var port = rtcicecandidate.port; value a 16-bit number indicating the port number on the device at the address indicated by ip at which the candidate's peer can be reached. port is initialized to null if it is not
specified in the candidate, or if the candidate string can't be parsed propertly. note: if port is null, passing the candidate to addicecandidate() will fail, throwing an operationerror exception. this applies only if the candidate implements port. usage notes consider this sdp attribute line (a-line) which describes an ice candidate: a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ hos...
RTCIceCandidate.priority - Web APIs
the rtcicecandidate interface's read-only priority property specifies the candidate's priority according to the remote peer; the higher this value is, the better the remote peer considers the candidate to be. as is the case with most of rtcicecandidate's properties, the value of priority is extracted from the candidate a-line string
specified when creating the rtcicecandidate. the a-line string is obtained either from the rtcicecandidateinit property candidate or from an a-line string passed into rtcpeerconnection.addicecandidate() instead of an rtcicecandidate. syntax var priority = rtcicecandidate.priority; value a long, unsigned integer value indicating the priority of the candidate according to the remote peer. the larger this value is, the more preferable the remote peer considers this c...
...rom an a-line string passed into rtcpeerconnection.addicecandidate() instead of an rtcicecandidate. syntax var priority = rtcicecandidate.priority; value a long, unsigned integer value indicating the priority of the candidate according to the remote peer. the larger this value is, the more preferable the remote peer considers this candidate to be. priority is initialized to null if it is not
specified in the candidate, or if the candidate string can't be parsed propertly. note: if priority is null, passing the candidate to addicecandidate() will fail, throwing an operationerror exception. this applies only if the candidate implements the priority property. usage notes consider this sdp attribute line (a-line) which describes an ice candidate: a=candidate:4234997325 1 udp 2043278322 192.1...
RTCIceCandidatePairStats - Web APIs
if a rtcstats-based object's type is candidate-pair, it's an rtcicecandidatepairstats object. properties rtcicecandidatepairstats is based upon rtcstats and inherits its properties. ...
... non-standard properties selected optional a firefox-specific boolean value which is true if the candidate pair described by this object is the one currently in use. the spec-compliant way to determine the selected candidate pair is to look for a stats object of type transport, which is an rtctransportstats object. that object's selectedcandidatepairid property indicates whether or not the
specified transport is the one being used. usage notes the currently-active ice candidate pair—if any—can be obtained by calling the rtcicetransport method getselectedcandidatepair(), which returns an rtcicecandidatepair object, or null if there isn't a pair selected. the active candidate pair describes the current configuration of the two ends of the rtcpeerconnection. any candidate pair that isn'...
RTCIceCandidateStats.address - Web APIs
syntax candidateaddress = rtcicecandidatestats.address; value either an ipv4 or ipv6 address or a fully-qualified domain name, which corresponds to the candidate. ...
... syntax candidateaddress = rtcicecandidatestats.address; value either an ipv4 or ipv6 address or a fully-qualified domain name, which corresponds to the candidate. ...
RTCPeerConnection.createDataChannel() - Web APIs
n id. default: false. id optional an 16-bit numeric id for the channel; permitted values are 0-65534. if you don't include this option, the user agent will select an id for you. the options which can be configured using the rtcdatachannelinit dictionary represent the script-settable subset of the properties on the rtcdatachannel interface. return value a new rtcdatachannel object with the
specified label, configured using the options
specified by options if that parameter is included; otherwise, the defaults listed above are established. exceptions invalidstateerror the rtcpeerconnection is closed. typeerror this can happen in a couple of situations: the label and/or protocol string is too long; these cannot be longer than 65,535 bytes (bytes, rather than characters). the id is...
...d above are established. exceptions invalidstateerror the rtcpeerconnection is closed. typeerror this can happen in a couple of situations: the label and/or protocol string is too long; these cannot be longer than 65,535 bytes (bytes, rather than characters). the id is 65535. while this is a valid unsigned 16-bit value, it's not a permitted value for id. syntaxerror values were
specified for both the maxpacketlifetime and maxretransmits options. you may only specify a non-null value for one of these. resourceinuse an id was
specified, but another rtcdatachannel is already using the same value. operationerror either the
specified id is already in use or, if no id was
specified, the webrtc layer was unable to automatically generate an id because all ids are in use. examples ...
RTCPeerConnection.getStats() - Web APIs
syntax promise = rtcpeerconnection.getstats(selector) parameters selector optional a mediastreamtrack for which to gather statistics. if this is null (the default value), statistics will be gathered for the entire rtcpeerconnection. return value a promise which resolves with an rtcstatsreport object providing connection statistics. the contents of the report depend on the selector as well as other details of the connection. ...
... a promise which resolves with an rtcstatsreport object providing connection statistics. the contents of the report depend on the selector as well as other details of the connection. exceptions this method does not throw exceptions; instead, it rejects the returned promise with one of the following errors: invalidaccesserror there is no rtcrtpsender or rtcrtpreceiver whose track matches the
specified selector, or selector matches more than one sender or receiver. obsolete syntax previously, getstats() used success and failure callbacks to report the results to you, instead of using a promise. this version of getstats() is obsolete; in addition, the data it returns is entirely different from the current specification, and the form of that data was never documented. this form of getstats()...
RTCPeerConnection.setConfiguration() - Web APIs
this lets you change the ice servers used by the connection and which transport policies to use. the most common use case for this method (and even then, probably not a very common use case) is to replace the set of ice servers to be used. two potential scenarios in which this might be done: the rtcpeerconnection was instantiated without specifying any ice servers. ...
... 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 or more of the urls
specified in configuration.iceservers is a turn server, but complete login information is not provided (that is, either the rtciceserver.username or rtciceserver.credentials is missing). this prevents successful login to the server. invalidmodificationerror the configuration includes changed identity information, but the connection already has identity information
specified. this happens if configuration...
RTCPeerConnection.setLocalDescription() - Web APIs
mypeerconnection.createoffer().then(function(offer) { return mypeerconnection.setlocaldescription(new rtcsessiondescription(offer)); }); for this reason, the rtcsessiondescription() constructor is deprecated. return value a promise which is fulfilled once the value of rtcpeerconnection.localdescription is successfully changed or rejected if the change cannot be applied (for example, if the
specified description is incompatible with one or both of the peers on the connection). the promise's fulfillment handler receives no input parameters. the process of changing descriptions actually involves intermediary steps handled by the webrtc layer to ensure that an active connection can be changed without losing the connection if the change does not succeed. see pending and current descriptions in ...
... of failure, the errorcallback will be called. deprecated exceptions when using the deprecated callback-based version of setlocaldescription(), the following exceptions may occur: invalidstateerror the connection's signalingstate is "closed", indicating that the connection is not currently open, so negotiation cannot take place. invalidsessiondescriptionerror the rtcsessiondescription
specified by the sessiondescription parameter is invalid. examples implicit descriptions one of the advantages of the parameter-free form of setlocaldescription() is that it lets you simplify your negotiation code substantially. this is all your negotiationneeded event handler needs to look like, for the most part. just add the signaling server code, which here is represented by the call to signalremot...
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
he local peer) has a corresponding record of type inbound-rtp which describes the local peer's perspective on the same data being moved between the two peers. let's create a utility function to help us look up the value of a key in the paired statistics object. the findreportentry() function shown below examines an rtcstatsreport, returning the rtcstats-based statistics record which contains the
specified key — and for which the key has the
specified value. if no match is found (or the statistics report has no record corresponding to the statistics category indicated by key. function findreportentry(report, key, value) { for (const stats of report.values()) { if (stats[key] === value) { return stats; } } return null; } since the rtcstatsreport is a javascript map, we can it...
...ory indicated by key. function findreportentry(report, key, value) { for (const stats of report.values()) { if (stats[key] === value) { return stats; } } return null; } since the rtcstatsreport is a javascript map, we can iterate over the map's values() to examine each of the rtcstats-based statistics records in the report until we find one that has the key property with the
specified value. when a match is found, the statistics object is returned. if no match is found, the function returns null. the main networkteststop() function now let's look at the networkteststop() function itself. it takes as input the rtcpeerconnection being tested, calls getstats() to get a new rtcstatsreport with current statistics, then computes the results it's looking for, outputting those resu...
RTCRtpSender.setParameters() - Web APIs
r changes made by a specific previous call to getparameters(). return value a promise that resolves when the rtcrtpsender.track property is updated with the given parameters. exceptions if an error occurs, the returned promise is rejected with the appropriate exception from the list below. invalidmodificationerror one of the following problems was detected: the number of encodings
specified in the parameters object's encodings property does not match the number of encodings currently listed for the rtcrtpsender. you cannot change the number of encoding options once the sender has been created. the order of the
specified encodings has changed from the current list's order. an attempt has been made to alter a property that cannot be changed after the sender is first created. ...
...rrent list's order. an attempt has been made to alter a property that cannot be changed after the sender is first created. invalidstateerror the transceiver of which the rtcrtpsender is a part is not running, or has no parameters to set. operationerror any error condition which occurs that isn't covered by one of the other error codes results in an operationerror. rangeerror the value
specified for scaleresolutiondownby is less than 1.0, which would result in scaling up rather than down, which is not allowed; or one or more of the
specified encodings' maxframerate values is less than 0.0. in addition, if a webrtc error occurs while configuring or accessing the media, an rtcerror is thrown with its errordetail set to hardware-encoder-error. specifications specification st...
RTCSessionDescription() - Web APIs
this constructor has been deprecated because rtcpeerconnection.setlocaldescription() and other methods which take sdp as input now directly accept an object conforming to the rtcsessiondescriptioninit dictionary, so you don't have to instantiate an rtcsessiondescription yourself. ...
...sion description; the object conforms to the rtcsessiondescriptioninit dictionary. that dictionary has the following properties: type 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 definitive 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 ...
RTCTrackEvent - Web APIs
crtpreceiver 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 rtctrackeventinit 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 track that's been added to the rtcpeerconnection.
...read only the rtcrtptransceiver being used by the new track. track event types there is only one type of track event. track the track event is sent to the rtcpeerconnection when a new track has been added to the connection. by the time the track event is delivered to the rtcpeerconnection's ontrack handler, the new media has completed its negotiation for a specific rtcrtpreceiver (which is
specified by the event's receiver property). in addition, the mediastreamtrack
specified by the receiver's track is the same one
specified by the event's track, and the track has been added to any associated remote mediastream objects. you can add a track event listener to be notified when the new track is available so that you can, for example, attach its media to a <video> element, using either rtcpeer...
Reporting API - Web APIs
ls that can receive given reports from a user agent. the report-to http header is used to specify details about the different endpoints that a user-agent has available to it for delivering reports to. you can then retrieve reports by making a request to those urls. the endpoints are arranged into groups; an endpoint group can work together to provide load balancing (each endpoint will receive a
specified proportion of report traffic) and safeguarding against failure (fallback endpoints can be
specified to use if the primary ones fail). note: there is no absolute guarantee of report delivery — a report could still fail to be collected if a serious error occurs. reports sent to endpoints can be retrieved independently of the running of the websites they relate to, which is useful — a crash ...
...res on our web page: let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); we then tell it to start observing reports using reportingobserver.observe(); this tells the observer to start collecting reports in its report queue, and runs the callback function
specified inside the constructor: observer.observe(); later on in the example we deliberately use the deprecated version of mediadevices.getusermedia(): if(navigator.mozgetusermedia) { navigator.mozgetusermedia( constraints, success, failure); } else { navigator.getusermedia( constraints, success, failure); } this causes a deprecation report to be generated; because of the e...
SVGAnimationElement - Web APIs
e is indefinite), 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). ...
...the new instance time is added to the end instance times list. events listen to these events using addeventlistener() or by assigning an event listener to the on... handler property of this interface. beginevent fired when the element local timeline begins to play. also available via the onbegin property. endevent fired when at the active end of the animation is reached. ...
SVGTransform - Web APIs
for svg_transform_matrix, svg_transform_translate and svg_transform_scale, angle will be zero. matrix svgmatrix the matrix that represents thi...
... for svg_transform_matrix, svg_transform_translate and svg_transform_scale, angle will be zero. matrix svgmatrix the matrix that represents this transformation. ...
Selection.extend() - Web APIs
specifications specification status comment selection apithe definition of 'selection.extend()' in that specification. ...
... specifications specification status comment selection apithe definition of 'selection.extend()' in that specification. working draft current browser compatibility the compatibility table on this page is generated from structured data. ...
Selection.setBaseAndExtent() - Web APIs
syntax sel.setbaseandextent(anchornode,anchoroffset,focusnode,focusoffset) parameters anchornode the node at the start of the selection. anchoroffset the number of child nodes from the start of the anchor node that should be excluded from the selection. so for example, if the value is 0 the whole node is included. if the value is 1, the whole node minus the first child node is included. and so on. focusnode the node at the end of the selection. ...
...ingle word. the first one is set as the anchornode and the second is set as the focusnode. we also have an additional paragraph that sits in between the two nodes. next, we have two form inputs that allow you to set the anchoroffset and focusoffset — they both have a default value of 0. we also have a button that when pressed invokes a function that runs the setbaseandextent() method with the
specified offsets, and copies the selection into the output paragraph at the very bottom of the html. <h1>setbaseandextent example</h1> <div> <p class="one"><span>fish</span><span>dog</span><span>cat</span><span>bird</span></p> <p>middle</p> <p class="two"><span>car</span><span>bike</span><span>boat</span><span>plane</span></p> </div> <div> <p> <label for="aoffset">anchor offset</label> <...
Selection - Web APIs
range in the selection. selection.containsnode() indicates if a certain node is part of the selection. selection.deletefromdocument() deletes the selection's content from the document. selection.empty() removes all ranges from the selection. this is an alias for removeallranges() — see selection.removeallranges() for more details. selection.extend() moves the focus of the selection to a
specified point. selection.getrangeat() returns a range object representing one of the ranges currently selected. selection.modify() changes the current selection. selection.removerange() removes a range from the selection. selection.removeallranges() removes all ranges from the selection. selection.selectallchildren() adds all the children of the
specified node to the selection. selection.setb...
... selection.setposition() collapses the current selection to a single point. ...
Using Service Workers - Web APIs
e use the serviceworkercontainer.register() function to register the service worker for this site, which is just a javascript file residing inside our app (note this is the file's url relative to the origin, not the js file that references it.) the scope parameter is optional, and can be used to specify the subset of your content that you want the service worker to control. in this case, we have
specified '/sw-test/', which means all content under the app's origin. if you leave it out, it will default to this value anyway, but we
specified it here for illustration purposes. the .then() promise function is used to chain a success case onto our promise structure. when the promise resolves successfully, the code inside it executes. finally, we chain a .catch() function onto the end that will run i...
...dexeddb can be used inside a service worker for data storage if you require it. custom responses to requests now you’ve got your site assets cached, you need to tell service workers to do something with the cached content. this is easily done with the fetch event. a fetch event fires every time any resource controlled by a service worker is fetched, which includes the documents inside the
specified scope, and any resources referenced in those documents (for example if index.html makes a cross origin request to embed an image, that still goes through its service worker.) you can attach a fetch event listener to the service worker, then call the respondwith() method on the event to hijack our http responses and update them with your own magic. self.addeventlistener('fetch', (event) => { e...
ShadowRoot - Web APIs
ds defined on the documentorshadowroot mixin. note that this is currently only implemented by chrome; other browsers still implement them on the document interface. documentorshadowroot.getselection() returns a selection object representing the range of text selected by the user, or the current position of the caret. documentorshadowroot.elementfrompoint() returns the topmost element at the
specified coordinates. documentorshadowroot.elementsfrompoint() returns an array of all elements at the
specified coordinates. documentorshadowroot.caretpositionfrompoint() 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...
... inside the <custom-square> element's class definition 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. ...
SharedWorker() - Web APIs
this script must obey the same-origin policy. note: there is disagreement among browser manufacturers about whether a data uri is of the same origin or not. although gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7) and later accept data uris, that's not the case in all other browsers. syntax var myworker = new sharedworker(aurl, name); var myworker = new sharedworker(aurl, options); parameters aurl a domstring representing the url of the script the worker will execute. it must obey the same-origin policy. ...
...ng specifying an identifying name for the sharedworkerglobalscope representing the scope of the worker, which is mainly useful for debugging purposes. options optional an object containing option properties that can set when creating the object instance. available properties are as follows: type: a domstring specifying the type of worker to create. the value can be classic or module. if not
specified, the default used is classic. credentials: a domstring specifying the type of credentials to use for the worker. the value can be omit, same-origin, or include. if not
specified, or if type is classic, the default used is omit (no credentials required). name: a domstring specifying an identifying name for the sharedworkerglobalscope representing the scope of the worker, which is mainly useful...
SourceBuffer.changeType() - Web APIs
type mid-stream. one scenario in which this is helpful is to support adapting the media source to changing bandwidth availability, by transitioning from one codec to another as resource constraints change. syntax sourcebuffer.changetype(type); parameters type a domstring specifying the mime type that future buffers will conform to. return value undefined. ...
... buffers will conform to. return value undefined. exceptions typeerror the
specified string is empty, rather than indicating a valid mime type. invalidstateerror the sourcebuffer is not a member of the parent media source's sourcebuffers list, or the buffer's updating property indicates that a previously queued appendbuffer() or remove() is still being processed. notsupportederror the
specified mime type is not supported, or is not supported with the types of sourcebuffer objects present in the mediasource.sourcebuffers list. usage notes if the parent mediasource is in its "ended" readystate, calling changetype() will transition the media source to the "open" readystate and fire a simple event named sourceopen at the parent media source. ...
SourceBuffer.removeAsync() - Web APIs
the removeasync() method of the sourcebuffer interface starts the process of asynchronously removing from the sourcebuffer media segments found within a specific time range. a promise is returned, which is fulfilled when the buffers in the
specified time range have been removed. this method can only be called when updating is false. if that's not the case, call abort() instead. syntax removepromise = sourcebuffer.removeasync(start, end); parameters start a double representing the start of the time range, in seconds. end a double representing the end of the time range, in seconds. return value a promise whose fulfillment handler is executed once the buffers in the
specified time range have been removed from the sourcebuffer. example this example establishes an asynchronous...
...double representing the start of the time range, in seconds. end a double representing the end of the time range, in seconds. return value a promise whose fulfillment handler is executed once the buffers in the
specified time range have been removed from the sourcebuffer. example this example establishes an asynchronous function, emptysourcebuffer(), which simply clears the contents of the
specified sourcebuffer. async function emptysourcebuffer(msbuffer) { await msbuffer.removeasync(0, infinity).catch(function(e) { handleexception(e); } } specifications not currently part of the mse specification. specification status comment media source extensions recommendation initial definition. ...
SourceBuffer - Web APIs
ting transitions from false to true. methods inherits methods from its parent interface, eventtarget. sourcebuffer.abort() aborts the current segment and resets the segment parser. sourcebuffer.appendbuffer() appends media segment data from an arraybuffer or arraybufferview object to the sourcebuffer. sourcebuffer.appendbufferasync() starts the process of asynchronously appending the
specified buffer to the sourcebuffer. returns a promise which is fulfilled once the buffer has been appended. sourcebuffer.appendstream() appends media segment data from a readablestream object to the sourcebuffer. sourcebuffer.changetype() changes the mime type that future calls to appendbuffer() will expect the new data to conform to. sourcebuffer.remove() removes media segments within a specific t...
...ppends media segment data from a readablestream object to the sourcebuffer. sourcebuffer.changetype() changes the mime type that future calls to appendbuffer() will expect the new data to conform to. sourcebuffer.remove() removes media segments within a specific time range from the sourcebuffer. sourcebuffer.removeasync() starts the process of asynchronously removing media segments in the
specified range from the sourcebuffer. returns a promise which is fulfilled once all matching segments have been removed. examples the following simple example loads a video chunk by chunk as fast as possible, playing it as soon as it can. this example was written by nick desaulniers and can be viewed live here (you can also download the source for further investigation.) var video = document.querysele...
StaticRange - Web APIs
et read only returns an integer value indicating the offset into the node given by endcontainer at which the last character of the range is found. staticrange.startcontainer read only returns the dom node which contains the starting point of the range (which is in turn identified by startoffset. staticrange.startoffset read only returns an integer value indicating the offset into the node
specified by startcontainer at which the first character of the range is located. methods staticrange.torange() returns a new range object which describes the same range as the source staticrange, but is "live" with values that change to reflect changes in the contents of the dom tree. usage notes a dom range specifies a span of content in a document, potentially beginning inside one node (or elem...
...dom tree. usage notes a dom range specifies a span of content in a document, potentially beginning inside one node (or element) and ending inside another one. unlike a range, a staticrange represents a range which is fixed in time; it does 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 definition of 'staticrange' in that specification. living standard static rangethe definition of 'staticrange' in that specification. editor's draft ...
SubtleCrypto.deriveKey() - Web APIs
curve diffie-hellman) is a key-agreement algorithm. it enables two people who each have an ecdh public/private key pair to generate a shared secret: that is, a secret that they — and noone else — share. they can then use this shared secret as a symmetric key to secure their communication, or can use the secret as an input to derive such a key (for example, using the hkdf algorithm). ecdh is
specified in rfc 6090. hkdf hkdf is a key derivation function. it's designed to derive key material from some high-entropy input, such as the output of an ecdh key agreement operation. it's not designed to derive keys from relatively low-entropy inputs such as passwords. for that, use pbkdf2. hkdf is
specified in rfc 5869. pbkdf2 pbkdf2 is also a key derivation function. it's designed to derive key m...
...elatively low-entropy input, such as a password. it derives key material by applying a function such as hmac to the input password along with some salt, and repeating this process many times. the more times the process is repeated, the more computationally expensive key derivation is: this makes it harder for an attacker to use brute-force to discover the key using a dictionary attack. pbkdf2 is
specified in rfc 2898. examples note: you can try the working examples on github. ecdh in this example alice and bob each generate an ecdh key pair, then exchange public keys. they then use derivekey() to derive a shared aes key, that they could use to encrypt messages. see the complete code on github. /* derive an aes key, given: - our ecdh private key - their ecdh public key */ function derivesecr...
SubtleCrypto.digest() - Web APIs
ining the data to be digested. return value digest is a promise that fulfills with an arraybuffer containing the digest. supported algorithms digest algorithms, also known as cryptographic hash functions, transform an arbitrarily large block of data into a fixed-size output, usually much shorter than the input. they have a variety of applications in cryptography. sha-1 this algorithm is
specified in fips 180-4, section 6.1, and produces an output 160 bits long. warning: this algorithm is now considered vulnerable and should not be used for cryptographic applications. sha-256 this algorithm is
specified in fips 180-4, section 6.2, and produces an output 256 bits long. sha-384 this algorithm is
specified in fips 180-4, section 6.5, and produces an output 384 bits long. sha-512 this...
..., section 6.1, and produces an output 160 bits long. warning: this algorithm is now considered vulnerable and should not be used for cryptographic applications. sha-256 this algorithm is
specified in fips 180-4, section 6.2, and produces an output 256 bits long. sha-384 this algorithm is
specified in fips 180-4, section 6.5, and produces an output 384 bits long. sha-512 this algorithm is
specified in fips 180-4, section 6.4, and produces an output 512 bits long. hint: if you are looking here for how to create an keyed-hash message authentication code (hmac), you need to use the subtlecrypto.sign() instead. examples basic example this example encodes a message, then calculates its sha-256 digest and logs the digest length: const text = 'an obscure body in the s-k system, your majesty...
SubtleCrypto.encrypt() - Web APIs
ining the data to be encrypted (also known as the plaintext). return value result is a promise that fulfills with an arraybuffer containing the "ciphertext". exceptions the promise is rejected when the following exceptions are encountered: invalidaccesserror raised when the requested operation is not valid for the provided key (e.g. invalid encryption algorithm, or invalid key for the
specified encryption algorithm). operationerror raised when the operation failed for an operation-specific reason (e.g. algorithm parameters of invalid sizes, or aes-gcm plaintext longer than 2³⁹−256 bytes). supported algorithms the web crypto api provides four algorithms that support the encrypt() and decrypt() operations. one of these algorithms — rsa-oaep — is a public-key cryptosystem...
...ult to deduce information about the secret key. while it's possible to add authentication to ctr and cbc modes, they do not provide it by default and when implementing it manually one can easily make minor, but serious mistakes. gcm does provide built-in authentication, and for this reason it's often recommended over the other two aes modes. rsa-oaep the rsa-oaep public-key encryption system is
specified in rfc 3447. aes-ctr this represents aes in counter mode, as
specified in nist sp800-38a. aes-cbc this represents aes in cipher block chaining mode, as
specified in nist sp800-38a. aes-gcm this represents aes in galois/counter mode, as
specified in nist sp800-38d. one major difference between this mode and the others is that gcm is an "authenticated" mode, which means that it includes chec...
SubtleCrypto.sign() - Web APIs
tkey() functions. the fourth algorithm — hmac — uses the same algorithm and key for signing and for verification: this means that the verification key must be kept secret, which in turn means that this algorithm is not suitable for many signature use cases. it can be a good choice however when the signer and verifier are the same entity. rsassa-pkcs1-v1_5 the rsassa-pkcs1-v1_5 algorithm is
specified in rfc 3447. rsa-pss the rsa-pss algorithm is
specified in rfc 3447. it's different from rsassa-pkcs1-v1_5 in that it incorporates a random salt in the signature operation, so the same message signed with the same key will not result in the same signature each time. an extra property, defining the salt length, is passed into the sign() and verify() functions when they are invoked. ecdsa ecds...
...ssa-pkcs1-v1_5 in that it incorporates a random salt in the signature operation, so the same message signed with the same key will not result in the same signature each time. an extra property, defining the salt length, is passed into the sign() and verify() functions when they are invoked. ecdsa ecdsa (elliptic curve digital signature algorithm) is a variant of the digital signature algorithm,
specified in fips-186, that uses elliptic curve cryptography (rfc 6090). hmac the hmac algorithm calculates and verifies hash-based message authentication codes according to the fips 198-1 standard. the digest algorithm to use is
specified in the hmackeygenparams object that you pass into generatekey(), or the hmacimportparams object that you pass into importkey(). examples note: you can try the wor...
Text.splitText() - Web APIs
the newly created node is returned to the caller. if the original node had a parent, the new node is inserted as the next sibling of the original node. if the offset is equal to the length of the original node, the newly created node has no data. separated text nodes can be concatenated using the node.normalize() method. ...
... original node. if the offset is equal to the length of the original node, the newly created node has no data. separated text nodes can be concatenated using the node.normalize() method. syntax newnode = textnode.splittext(offset) parameters offset the index immediately before which to break the text node. return value returns a newly created text node that contains the text after the
specified offset point. exceptions thrown a domexception with a value of index_size_err is thrown if the
specified offset is negative or is greater than the number of 16-bit units in the node's text; a domexception with a value of no_modification_allowed_err is thrown if the node is read-only. example in this example, the text of a <p> is split into two text nodes, and a <u> is inserted between them. ...
TextTrack.mode - Web APIs
e idl enum texttrackmode—must be one of the following values: disabled the text track is currently disabled. while the track's presence is exposed in the dom, the user agent is otherwise ignoring it. no cues are active, no events are being fired, and the user agent won't attempt to obtain the track's cues. this is the default value, unless the text track has the default boolean attribute is
specified, in which case the default is showing. hidden the text track is currently active but the cues aren't being displayed. if the user agent hasn't tried to obtain the track's cues yet, it will do so soon (thereby populating the track's texttrack.cues property). the user agent is keeping a list of the active cues (in the track's activecues property) and events are being fired at the corresponding ti...
...g displayed. showing the text track is currently enabled and is visible. if the track's cues list hasn't been obtained yet, it will be soon. the activecues list is being maintained and events are firing at the appropriate times; the track's text is also being drawn appropriately based on the styling and the track's kind. this is the default value if the text track's default boolean attribute is
specified. usage notes the default mode is disabled, unless the default boolean attribute is
specified, in which case the default mode is showing. when a text track is loaded in the disabled state, the corresponding webvtt file is not loaded until the state changes to either showing or hidden. this way, the resource fetch and memory usage are avoided unless the cues are actually needed. however, that m...
TimeRanges - Web APIs
you reference each time range by using the start() and end() methods, passing the index number of the time range you want to retrieve. ...
...meranges object" indicates that ranges in such an object are ordered, don't overlap, aren't empty, and don't touch (adjacent ranges are folded into one bigger range). properties timeranges.length read only returns an unsigned long representing the number of time ranges represented by the time range object. methods timeranges.start() returns the time for the start of the range with the
specified index. timeranges.end() returns the time for the end of the
specified range. specifications specification status comment html living standardthe definition of 'timeranges' in that specification. living standard initial definition ...
TouchEvent - Web APIs
this is also sent if the touch point moves off the edge of the surface; for example, if the user's finger slides off the edge of the screen. the event's target is the same element that received the touchstart event corresponding to the touch point, even if the touch point has moved outside that element. the touch point (or points) that were removed from the surface can be found in the touchlist
specified by the changedtouches attribute. touchmove sent when the user moves a touch point along the surface. the event's target is the same element that received the touchstart event corresponding to the touch point, even if the touch point has moved outside that element. this event is also sent if the values of the radius, rotation angle, or force attributes of a touch point change. note: the rate a...
... event from being sent as well. the exception to this is chrome, starting with version 56 (desktop, chrome for android, and android webview), where the default value for the passive option for touchstart and touchmove is true and calls to preventdefault() will have no effect. to override this behavior, you need to set the passive option to false, after which calling preventdefault() will work as
specified. the change to treat listeners as passive by default prevents the listener from blocking page rendering while a user is scrolling. a demo is available on the google developer site. globaleventhandlers the globaleventhandlers mixin defines these events as global events that are available on any element in the dom that the user can interact with. globaleventhandlers.ontouchstart a global ev...
TrackDefault.TrackDefault() - Web APIs
uffer to use when an initialization segment does not contain label information for a new track. kinds an array (sequence) of domstrings specifying default kinds for the sourcebuffer to use when an initialization segment does not contain kind information for a new track. bytestreamtrackid optional a domstring specifying the id of the specific track that the sourcebuffer should apply to. ...
...kinds an array (sequence) of domstrings specifying default kinds for the sourcebuffer to use when an initialization segment does not contain kind information for a new track. bytestreamtrackid optional a domstring specifying the id of the specific track that the sourcebuffer should apply to. if not
specified, this value will be an empty string and the sourcebuffer can contain any tracks of the
specified type. errors when this constructor is invoked, the following errors can occur: error explanation invalidaccesserror the supplied language is not a valid language code, e.g. en-us. typeerror there are values
specified in the kinds array that do not apply to the
specified type. example tbd ...
Using the User Timing API - Web APIs
nce timeline. the following example demostrates both uses of this method. function clear_marks(obj) { if (performance.clearmarks === undefined) { log("clear marks: performance.clearmarks not supported", 0); return; } log("clear marks", 0); if (typeof obj == "string") { log("... cleared '" + obj + "' mark(s)", 0); performance.clearmarks(obj); } else { // no argument
specified so clear all marks log("... cleared all marks", 0); performance.clearmarks(); } } performance measures a measure performance entry type is named by the application and its timestamp is placed between two named marks thus a measure is effectively a midpoint between two marks in the browser's performance timeline. creating a performance measure a measure is created by calling perform...
... following examples shows both uses of this method. function clear_measures(obj) { if (performance.clearmeasures === undefined) { log("clear mearsures: performance.clearmeasures not supported", 1); return; } log("clear measures", 1); if (typeof obj == "string") { log("... cleared '" + obj + "' measure(s)", 1); performance.clearmeasures(obj); } else { // no argument
specified so clear all measures log("... cleared all measures", 1); performance.clearmeasures(); } } interoperability as shown in the performance interface's browser compatibility table, the user timing methods are broadly implemented by desktop and mobile browsers (the only exceptions are no support for desktop safari and mobile safari). see also user timing standard; w3c editor's draft ...
User Timing API - Web APIs
retrieving performance marks the performance interface has three methods that can be used to retrieve a mark: performance.getentries() returns all performance entries in the performance timeline. finding only mark entries requires checking each entry's entrytype for "mark". performance.getentriesbyname(name, entrytype) returns all performance entries in the performance timeline with the
specified name and entrytype, thus set entrytype to "mark" to get all marks (and set name accordingly to retrieve more specific entries). performance.getentriesbytype(entrytype) returns all performance entries in the performance timeline with the
specified entrytype, thus set entrytype to "mark" to get all marks. removing performance marks to remove a specific mark from the performance timeline, call ...
...ng performance measures the performance interface has three methods that can be used to retrieve a measure: performance.getentries() returns all performance entries in the performance timeline. finding the measure entries requires checking each entry's entrytype for "measure". performance.getentriesbyname(name, entrytype) returns all performance entries in the performance timeline with the
specified name and entrytype, thus set entrytype to "measure" to get all measures (and set name accordingly to retrieve more specific entries). performance.getentriesbytype(entrytype) returns all performance entries in the performance timeline with the
specified entrytype, thus set entrytype to "measure" to get all measures. removing performance measures to remove a specific measure from the performan...
WebGLRenderingContext.enableVertexAttribArray() - Web APIs
you can disable the attribute array by calling disablevertexattribarray(). in webgl, values that apply to a specific vertex are stored in attributes. these are only available to the javascript code and the vertex shader. attributes are referenced by an index number into the list of attributes maintained by the gpu. some vertex attribute indices may have predefined purposes, depending on the platform and/or the gpu. ...
...array(index); parameters index a gluint specifying the index number that uniquely identifies the vertex attribute to enable. if you know the name of the attribute but not its index, you can get the index by calling getattriblocation(). return value undefined. errors to check for errors after calling enablevertexattribarray(), call geterror(). webglrenderingcontext.invalid_value the
specified index is invalid; that is, it's greater than or equal to the maximum number of entries permitted in the context's vertex attribute list, as indicated by the value of webglrenderingcontext.max_vertex_attribs. example this code — a snippet taken from the full example a basic 2d webgl animation example — shows the use of enablevertexarray() to activate the attribute that will be used by the w...
WebGLRenderingContext.getFramebufferAttachmentParameter() - Web APIs
ze gl.framebuffer_attachment_texture_layer when using the ovr_multiview2 extension: ext.framebuffer_attachment_texture_num_views_ovr: the number of views of the framebuffer object attachment. ext.framebuffer_attachment_texture_base_view_index_ovr: the base view index of the framebuffer object attachment. return value depends on the requested information (as
specified with pname). either a glint, a glenum, a webglrenderbuffer, or a webgltexture. pname parameter return value gl.framebuffer_attachment_object_type a glenum indicating the type of the texture. either gl.renderbuffer, gl.texture, or if no image is attached, gl.none. gl.framebuffer_attachment_object_name the texture (webgltexture) or renderbuffer (webglrenderb...
...egative z face of the cube. gl.framebuffer_attachment_alpha_size a glint indicating the number of bits in the alpha component of the attachment. gl.framebuffer_attachment_blue_size a glint indicating the number of bits in the blue component of the attachment. gl.framebuffer_attachment_color_encoding a glenum indicating the encoding of components of the
specified attachment. either gl.linear or gl.srgb. gl.framebuffer_attachment_component_type a glenum indicating the format of the components of the
specified attachment. either gl.float, gl.int, gl.unsigned_int, gl.signed_normalized, or gl.unsigned_normalized. gl.framebuffer_attachment_depth_size a glint indicating the number of bits in the depth component of the attachment. ...
WebGLRenderingContext.vertexAttribPointer() - Web APIs
2. default attribute values the vertex shader code may include a number of attributes, but we don't need to specify the values for each attribute. instead, we can supply a default value that will be identical for all vertices. we can call gl.disablevertexattribarray() to tell webgl to use the default value, while calling gl.enablevertexattribarray() will read the values from the array buffer as
specified with gl.vertexattribpointer(). similarily, if our vertex shader expects e.g. a 4-component attribute with vec4 but in our gl.vertexattribpointer() call we set the size to 2, then webgl will set the first two components based on the array buffer, while the third and fourth components are taken from the default value. the default value is vec4(0.0, 0.0, 0.0, 1.0) by default but we can specify a d...
... size to 2, then webgl will set the first two components based on the array buffer, while the third and fourth components are taken from the default value. the default value is vec4(0.0, 0.0, 0.0, 1.0) by default but we can specify a different default value with gl.vertexattrib[1234]f[v](). for example, your vertex shader may be using a position and a color attribute. most meshes have the color
specified at a per-vertex level, but some meshes are of a uniform shade. for those meshes, it is not necessary to place the same color for each vertex into the array buffer, so you use gl.vertexattrib4fv() to set a constant color. querying current settings you can call gl.getvertexattrib() and gl.getvertexattriboffset() to get the current parameters for an attribute, e.g. the data type or whether the att...
WebGLRenderingContext - Web APIs
ebglrenderingcontext.isprogram() returns a boolean indicating if the passed webglprogram is valid. webglrenderingcontext.isshader() returns a boolean indicating if the passed webglshader is valid. webglrenderingcontext.linkprogram() links the passed webglprogram object. webglrenderingcontext.shadersource() sets the source code in a webglshader. webglrenderingcontext.useprogram() uses the
specified webglprogram as part the current rendering state. webglrenderingcontext.validateprogram() validates a webglprogram. uniforms and attributes webglrenderingcontext.disablevertexattribarray() disables a vertex attribute array at a given position. webglrenderingcontext.enablevertexattribarray() enables a vertex attribute array at a given position. webglrenderingcontext.getactiveattrib() r...
...riable. webglrenderingcontext.uniformmatrix[234]fv() specifies a matrix value for a uniform variable. webglrenderingcontext.vertexattrib[1234]f[v]() specifies a value for a generic vertex attribute. webglrenderingcontext.vertexattribpointer() specifies the data formats and locations of vertex attributes in a vertex attributes array. drawing buffers webglrenderingcontext.clear() clears
specified buffers to preset values. webglrenderingcontext.drawarrays() renders primitives from array data. webglrenderingcontext.drawelements() renders primitives from element array data. webglrenderingcontext.finish() blocks execution until all previously called commands are finished. webglrenderingcontext.flush() empties different buffer commands, causing all commands to be executed as quickly as...
Basic scissoring - Web APIs
issoring operations. scissoring establishes a clipping region outside which drawing will not occur. clearing the drawing buffer when scissoring applies this is a simple demonstration of a rendering with scissor(). although the clear() drawing command writes the clear color (set by clearcolor()) to all pixels in the drawing buffer, scissor() defines a mask that only allows pixels inside the
specified rectangular area to be updated. this is a good opportunity to talk about the difference between pixels and fragments. a pixel is a picture element (in practice, a point) on the screen, or a single element of the drawing buffer, that area in memory that holds your pixel data (such as rgba color components). a fragment refers to the pixel while it is being handled by the webgl pipeline. the reaso...
...ring, but before color masking). before the actual pixels are updated, fragments must go through the scissor test. if the fragments pass the scissor test, they continue down the graphics pipeline, and the corresponding pixels are updated on the screen. if they fail the test, they are immediately discarded, no further processing occurs, and pixels are not updated. because only fragments within the
specified rectangular area successfully pass the scissor test, only pixels inside that area are updated, and we get a rectangle on the screen. the scissoring stage of the pipeline is disabled by default. we enable it here using the enable() method (you will also use enable() to activate many other features of webgl; hence, the use of the scissor_test constant as an argument in this case). this again demon...
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
uested() method, which accepts as input an sdp offer string. async function holdrequested(offer) { try { await peerconnection.setremotedescription(offer); await audiotransceiver.sender.replacetrack(null); audiotransceiver.direction = "recvonly"; await sendanswer(); } catch(err) { /* handle the error */ } } the steps taken here are: set the remote description to the
specified offer by calling rtcpeerconnection.setremotedescription(). replace the audio transceiver's rtcrtpsender's track with null, meaning no track. this stops sending audio on the transceiver. set the audio transceiver's direction property to "recvonly", instructing the transceiver to only accept audio and not to send any. the sdp answer is generated and sent using a method called sendanswer(), which...
...ed to begin the process of restoring normal functionality. async function disablehold(micstream) { await audiotransceiver.sender.replacetrack(micstream.getaudiotracks()[0]); audiotransceiver.receiver.track.enabled = true; audiotransceiver.direction = "sendrecv"; } this reverses the steps taken in enablehold() as follows: the audio transceiver's rtcrtpsender's track is replaced with the
specified stream's first audio track. the transceiver's incoming audio track is re-enabled. the audio transceiver's direction is set to "sendrecv", indicating that it should return to both sending and receiving streamed audio, instead of only sending. just like when hold was engaged, this triggers negotiation again, resulting in your code sending a new offer to the remote peer. remote peer when the "...
Writing a WebSocket server in C# - Web APIs
s easy to build, but might be a little bit difficult to understand. the full explanation of the server handshake can be found in rfc 6455, section 4.2.2. for our purposes, we'll just build a simple response. ...
...ding.utf8.getstring(bytes); if (regex.ismatch(s, "^get", regexoptions.ignorecase)) { console.writeline("=====handshaking from client=====\n{0}", s); // 1. obtain the value of the "sec-websocket-key" request header without any leading or trailing whitespace // 2. concatenate it with "258eafa5-e914-47da-95ca-c5ab0dc85b11" (a special guid
specified by rfc 6455) // 3. compute sha-1 and base64 hash of the new value // 4. write the hash back as the value of "sec-websocket-accept" response header in an http response string swk = regex.match(s, "sec-websocket-key: (.*)").groups[1].value.trim(); string swka = swk + "258eafa5-e914-47da-95ca-c5ab0dc85b11"; byte[] swkash...
Writing a WebSocket server in Java - Web APIs
erver conforms to rfc 6455, so it only handles connections from chrome version 16, firefox 11, ie 10 and higher. first steps websockets communicate over a tcp (transmission control protocol) connection. java's serversocket class is located in the java.net package. serversocket constructor: serversocket(int port) when you instantiate the serversocket class, it is bound to the port number you
specified by the port argument. here's an implementation split into parts: import java.io.ioexception; import java.io.inputstream; import java.io.outputstream; import java.net.serversocket; import java.net.socket; import java.security.messagedigest; import java.security.nosuchalgorithmexception; import java.util.base64; import java.util.scanner; import java.util.regex.matcher; import java.util.regex.patt...
...ted on 127.0.0.1:80.\r\nwaiting for a connection..."); socket client = server.accept(); system.out.println("a client connected."); socket methods: java.net.socket getinputstream() returns an input stream for this socket. java.net.socket getoutputstream() returns an output stream for this socket. outputstream methods: write(byte[] b, int off, int len) writes len bytes from the
specified byte array starting at offset off to this output stream. inputstream methods: read(byte[] b, int off, int len) reads up to len bytes of data from the input stream into an array of bytes. let us extend our example. inputstream in = client.getinputstream(); outputstream out = client.getoutputstream(); scanner s = new scanner(in, "utf-8"); handshaking when a client connects to a se...
Geometry and reference spaces in WebXR - Web APIs
this space, either explicitly within your code, or by using a transform to adjust the coordinates of all vertices. the most efficient way, of course, is to design your objects and code to use the same coordinate system as webgl does. the webgl coordinates and lengths are transformed automatically at render time to the size of the viewport in which the scene is being rendered. angles angles are
specified using radians. to convert degrees to radians, simply multiply the value in degrees by π/180. the following code snippet shows two simple functions, degreestoradians() and radianstodegrees(), which convert back and forth between the two units for measuring angles. const radians_per_degree = math.pi / 180.0; let degreestoradians = (deg) => deg * radians_per_degree; let radianstodegrees = (rad) =...
...changed between your app and the webxr api is expressed in relation to a specific space at the time the frame is being rendered. any further position and orientation management is between you and webgl, though you do make use of the origin offset from the reference space in order to position the objects correctly in the 3d world. when it's time to render an animation frame, the callback function
specified when you called the webxr session's xrsession object's requestanimationframe() method is invoked. the callback receives as one of its parameters a timestamp indicating the time at which the frame takes place, and should perform all rendering for the corresponding animation frame. as the callback is repeatedly called with increasing time values, the callback generates a sequence of frames which a...
Spaces and reference spaces: Spatial tracking in WebXR - Web APIs
mation. there is only one way to create an xrpose, and that's using the getpose() method on an animation frame as given using an xrframe object. this means that most frequently, you'll be using poses within your frame rendering code, which is executed as a callback from the xrframe method requestanimationframe(). getpose() computes the position of an xrreferencespace relative to the origin of a
specified xrspace and then creates a pose representing the resulting position and orientation. for example, if you wish to draw a hand controller's representation using the controller's gripspace, you can get the pose needed like this: let controlpose = frame.getpose(worldrefspace, inputsource.gripspace); this converts the position and orientation of the input's grip space to use the world's coordinate ...
... pose is represented by webxr's xrviewerpose interface. when rendering a frame, you'll use the viewer pose to determine the position and facing direction of the viewer in order to place the virtual camera and render the scene. the only way to obtain a pose that adapts positional information from one space to another is through the xrframe object received by your frame rendering callback function
specified when you called the xrsession method requestanimationframe(). for example, given an xrsession whose reference space is worldrefspace, the following line of code would request the first frame of animation to be scheduled: animationframerequestid = xrsession.requestanimationframe(mydrawframe); then, the mydrawframe() function—the callback executed when it's time to draw the frame—might be s...
Starting up and shutting down a WebXR session - Web APIs
at'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 new reference space in hand and stored into the worlddata object for safe-keeping, we call the session's requestanimationframe() method to schedule a callback to be executed when it's time to render the next frame of animation for the webxr session. the returned value is an id we can use later to cancel the request if need be, so we save that into world...
...nt is sent to the session's xrreferencespace. the event's transform property is an xrrigidtransform detailing the transform needed to realign the native origin. note that the reset event is fired at the xrreferencespace, not the xrsession! another common cause for reset events is when a bounded reference space (a reference space whose xrreferencespacetype is bounded-floor) has its geometry as
specified by the xrboundedreferencespace's property boundsgeometry change. for more common causes of reference space resets and more details and sample code, see the documentation for the reset event. detecting when the available set of webxr input controls changes webxr maintains a list of input controls which is specific to the webxr system. these devices include things such as the handheld controller...
Using IIR filters - Web APIs
this article looks at how to implement one, and use it in a simple example. ...
... can't all be set to zero, otherwise nothing would be sent to the filter. something like this is acceptable: let feedforward = [0.00020298, 0.0004059599, 0.00020298]; our feedback values cannot start with zero, otherwise on the first pass nothing would be sent back: let feedbackward = [1.0126964558, -1.9991880801, 0.9873035442]; note: these values are calculated based on the lowpass filter
specified in the filter characteristics of the web audio api specification. as this filter node gains more popularity we should be able to collate more coefficient values. using an iirfilter in an audio graph let's create our context and our filter node: const audiocontext = window.audiocontext || window.webkitaudiocontext; const audioctx = new audiocontext(); const iirfilter = audioctx.createiirfilte...
Visualizations with Web Audio API - Web APIs
ioctx.destination); note: you don't need to connect the analyser's output to another node for it to work, as long as the input is connected to the source, either directly or via another node. the analyser node will then capture audio data using a fast fourier transform (fft) in a certain frequency domain, depending on what you specify as the analysernode.fftsize property value (if no value is
specified, the default is 2048.) note: you can also specify a minimum and maximum power value for the fft data scaling range, using analysernode.mindecibels and analysernode.maxdecibels, and different data averaging constants using analysernode.smoothingtimeconstant. read those pages to get more information on how to use them. to capture data, you need to use the methods analysernode.getfloatfrequencyd...
...ants using analysernode.smoothingtimeconstant. read those pages to get more information on how to use them. to capture data, you need to use the methods analysernode.getfloatfrequencydata() and analysernode.getbytefrequencydata() to capture frequency data, and analysernode.getbytetimedomaindata() and analysernode.getfloattimedomaindata() to capture waveform data. these methods copy data into a
specified array, so you need to create a new array to receive the data before invoking one. the first one produces 32-bit floating point numbers, and the second and third ones produce 8-bit unsigned integers, therefore a standard javascript array won't do — you need to use a float32array or uint8array array, depending on what data you are handling. so for example, say we are dealing with an fft size of ...
Web Authentication API - Web APIs
tion 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 authentication api. typically, server communications would be rest over https (probably using xmlhttprequest or fetch), but they could also be soap, rfc 2549 or nearly any other protocol provided that the protocol is secure. the parameters received from the server will be passed to the create() call, typically with little or no modification and returns a pro...
...eb 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 using xmlhttprequest or fetch), but they could also be soap, rfc 2549 or nearly any other protocol provided that the protocol is secure. the parameters received from the server will be passed to the get() call, typically with little or no modification. note that it is abs...
Web Locks API - Web APIs
navigator.locks.request('my_resource', async lock => { // the lock has been acquired. await do_something_with_lock(); await do_something_else_with_lock(); // now the lock will be released. }); // the lock has been released. await do_something_else_without_lock(); options several options can be passed when requesting a lock: mode: the default mode is "exclusive", but "shared" can be
specified. ...
...the callback is invoked with null. monitoring the navigator.locks.query() method can be used by scripts to introspect the state of the lock manager for the origin. ...
Window.convertPointFromNodeToPage() - Web APIs
nodepoint a point object describing a point in node's coordinate system; this point will be converted to the page's coordinate system. return value a point object specifying a point in the page's coordinate system. ...
...int which specifies the same position in the page's coordinate system. this method is non-standard and should not be used. please review the browser compatibility section before using this method, as it's not widely supported (nor is the point object it uses). syntax point = window.convertpointfromnodetopage(node, nodepoint); parameters node the node in whose coordinate system the point
specified by nodepoint is described. nodepoint a point object describing a point in node's coordinate system; this point will be converted to the page's coordinate system. return value a point object specifying a point in the page's coordinate system. specifications this method was
specified in the defunct 20 march 2009 working draft of css 2d transforms module level 3. it is not present in the curr...
Window.convertPointFromPageToNode - Web APIs
given a point
specified in the page's coordinate system, the window method convertpointfrompagetonode() returns a point object specifying the same location in the coordinate system of the
specified dom node. please review the browser compatibility section before using this method, as it's not widely supported (nor is the point object it uses). syntax point = window.convertpointfrompagetonode(node, pagepoint); parameters node the node into whose coordinate system the point is to be converted. pagepoint a point object specifying a point in the coordinate system of the page, which is to be converted into the node's coordinate system. return value a point object describing the
specified location in the node's coordinate system. ...
...intfrompagetonode(node, pagepoint); parameters node the node into whose coordinate system the point is to be converted. pagepoint a point object specifying a point in the coordinate system of the page, which is to be converted into the node's coordinate system. return value a point object describing the
specified location in the node's coordinate system. specifications this method was
specified in the defunct 20 march 2009 working draft of css 2d transforms module level 3. it is not present in the current css transforms module level 1 working draft. ...
window.requestIdleCallback() - Web APIs
the window.requestidlecallback() method queues a function to be called during a browser's idle periods. this enables developers to perform background and low priority work on the main event loop, without impacting latency-critical events such as animation and input response. functions are generally called in first-in-first-out order; however, callbacks which have a timeout
specified may be called out-of-order if necessary in order to run them before the timeout elapses. you can call requestidlecallback() within an idle callback function to schedule another callback to take place no sooner than the next pass through the event loop. a timeout option is strongly recommended for required work, as otherwise it's possible multiple seconds will elapse before the callback is fired. syntax va...
...eference to a function that should be called in the near future, when the event loop is idle. the callback function is passed an idledeadline object describing the amount of time available and whether or not the callback has been run because the timeout period expired. options optional contains optional configuration parameters. currently only one property is defined: timeout: if timeout is
specified and has a positive value, and the callback has not already been called by the time timeout milliseconds have passed, the callback will be called during the next idle period, even if doing so risks causing a negative performance impact. example see our complete example in the article cooperative scheduling of background tasks api. specifications specification status comment...
Worker() - Web APIs
this script must obey the same-origin policy. note: that there is a disagreement among browser manufacturers about whether a data uri is of the same origin or not. though gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7) and later accept data uris, that's not the case in all other browsers. syntax var myworker = new worker(aurl, options); parameters aurl a usvstring representing the url of the script the worker will execute. it must obey the same-origin policy. options optional an object containing option properties that can be set when creating the object instance. ...
...r(aurl, options); parameters aurl a usvstring representing the url of the script the worker will execute. it must obey the same-origin policy. options optional an object containing option properties that can be set when creating the object instance. available properties are as follows: type: a domstring specifying the type of worker to create. the value can be classic or module. if not
specified, the default used is classic. credentials: a domstring specifying the type of credentials to use for the worker. the value can be omit, same-origin, or include. if not
specified, or if type is classic, the default used is omit (no credentials required). name: a domstring specifying an identifying name for the dedicatedworkerglobalscope representing the scope of the worker, which is mainly use...
Synchronous and asynchronous requests - Web APIs
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(this, this.arguments); } function xhrerror() { console.error(this.statustext); } function loadfile(url, callback /*, opt_arg1, opt_arg2, ... */) { var xhr = new xmlhttprequest(); xhr.callback = callback; xhr.arguments = array.prototype.slice.call(arguments, 2); xhr.onload = xhrsuccess; xhr.onerror = xhrerror; ...
...target url to read (via an http get request), (ii) a function to execute on successful completion of the xhr operation, and (iii) an arbitrary list of additional arguments that are passed through the xhr object (via the arguments property) to the success callback function. line 1 declares a function invoked when the xhr operation completes successfully. it, in turn, invokes the callback function
specified in the invocation of the loadfile function (in this case, the function showmessage) which has been assigned to a property of the xhr object (line 11). the additional arguments (if any) supplied to the invocation of function loadfile are "applied" to the running of the callback function. line 5 declares a function invoked when the xhr operation fails to complete successfully. line 11 stores the ...
Using XMLHttpRequest - Web APIs
.addeventlistener("load", reqlistener); oreq.open("get", "http://www.example.org/example.txt"); oreq.send(); types of requests a request made via xmlhttprequest can fetch the data in one of two ways, asynchronously or synchronously. the type of request is dictated by the optional async argument (the third argument) that is set on the xmlhttprequest.open() method. if this argument is true or not
specified, the xmlhttprequest is processed asynchronously, otherwise the process is handled synchronously. a detailed discussion and demonstrations of these two types of requests can be found on the synchronous and asynchronous requests page. do not use synchronous requests outside web workers. note: starting with gecko 30.0 (firefox 30.0 / thunderbird 30.0 / seamonkey 2.27), synchronous requests on the m...
...sferring the file."); } function transfercanceled(evt) { console.log("the transfer has been canceled by the user."); } lines 3-6 add event listeners for the various events that are sent while performing a data transfer using xmlhttprequest. note: you need to add the event listeners before calling open() on the request. otherwise the progress events will not fire. the progress event handler,
specified by the updateprogress() function in this example, receives the total number of bytes to transfer as well as the number of bytes transferred so far in the event's total and loaded fields. however, if the lengthcomputable field is false, the total length is not known and will be zero. progress events exist for both download and upload transfers. the download events are fired on the xmlhttprequest ...
XMLSerializer - Web APIs
examples serializing xml into a string the first, basic, example just serializes an entire document into a string containing xml. ...
... examples serializing xml into a string the first, basic, example just serializes an entire document into a string containing xml. ...
XPathEvaluator.evaluate() - Web APIs
solver optional permits translation of all prefixes, including the xml namespace prefix, within the xpath expression into appropriate namespace uris. type optional specifies the type of result to be returned by evaluating the expression. this must be one of the xpathresult.constants. result optional allows to specify a result object which may be reused and returned by this method. if this is
specified as null or the implementation does not reuse the
specified result, a new result object will be returned. return value an xpathresult object representing the result of evaluating the xpath expression. exceptions invalid_expression_err if the expression is not legal according to the rules of the xpathevaluator, an xpathexception of type invalid_expression_err is raised. type_err in case res...
...does not reuse the
specified result, a new result object will be returned. return value an xpathresult object representing the result of evaluating the xpath expression. exceptions invalid_expression_err if the expression is not legal according to the rules of the xpathevaluator, an xpathexception of type invalid_expression_err is raised. type_err in case result cannot be converted to the
specified type, an xpathexception of type type_err is raised. namespace_err if the expression contains namespace prefixes which cannot be resolved by the
specified xpathnsresolver, a domexception of type namespace_error is raised. wrong_document_err if the provided context node is from a document that is not supported by the xpathevaluator, a domexception of type wrong_document_err is raised. not_supp...
XPathExpression.evaluate() - Web APIs
athresult node.evaluate(contextnode, type, result); parameters contextnode a node representing the context to use for evaluating the expression. type optional specifies the type of result to be returned by evaluating the expression. this must be one of the xpathresult.constants. result optional allows to specify a result object which may be reused and returned by this method. if this is
specified as null or the implementation does not reuse the
specified result, a new result object will be returned. return value an xpathresult object representing the result of evaluating the xpath expression. exceptions invalid_expression_err if the expression is not legal according to the rules of the xpathevaluator, an xpathexception of type invalid_expression_err is raised. type_err in case res...
...does not reuse the
specified result, a new result object will be returned. return value an xpathresult object representing the result of evaluating the xpath expression. exceptions invalid_expression_err if the expression is not legal according to the rules of the xpathevaluator, an xpathexception of type invalid_expression_err is raised. type_err in case result cannot be converted to the
specified type, an xpathexception of type type_err is raised. namespace_err if the expression contains namespace prefixes which cannot be resolved by the
specified xpathnsresolver, a domexception of type namespace_error is raised. wrong_document_err if the provided context node is from a document that is not supported by the xpathevaluator, a domexception of type wrong_document_err is raised. not_supp...
XREnvironmentBlendMode - Web APIs
nd the rendered virtual content with the real world. its values are used by the xrsession interface's environmentblendmode property. values opaque the rendered image is drawn without allowing any pass-through imagery. this is primarily used by fully-immersive vr headsets, which totally obscure the surrounding environment, with none of the real world shown to the user at all. the alpha values
specified in the xrsession's renderstate property's baselayer field are ignored since the alpha values for the rendered imagery are all treated as being 1.0 (fully opaque). additive primarily used by ar devices with transparent lenses which directly allow reality to pass through to the user's eyes, the additive blending mode is designed to be used in a situation in which the device has no control over th...
...blending mode is designed to be used in a situation in which the device has no control over the background and its brightness, since that isn't being digitally controlled. all the device can do is add more light to the image; it can't make things get darker. therefore, black is rendered as fully transparent, and there's no way to make a pixel fully opaque. as with the opaque setting, alpha values
specified are ignored and treated as if they were 1.0. alpha-blend used by headsets or goggles which use cameras to capture the real world and display it digitally on the screen or screens used to render the content for the user to see, this offers a way to create an ar presentation using a vr device. alpha blending can also be used by non-wearable devices that provide ar modes, such as phones or tablets...
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 xrreferencespaceeventinit dictionary. ...
...eferencespaceeventinit 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 coordinate system before the event. methods while xrreferencespaceevent does not define any methods, it inherits the methods of its parent interface, event. event types reset the reset event is sent to a reference space when its native origin is changed due to a discontinuity, recalibration, or device reset. this is a...
XRRenderStateInit - Web APIs
the xrrenderstateinit dictionary is a writeable version of the xrrenderstate interface, and is used when calling an xrsession's updaterenderstate() method to apply changes to the render state prior to rendering the next frame. 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. all rendering will take place between the distances
specified by depthnear and depthfar. t...
... the viewer's side of this plane will be rendered. this is 0.1 meters (10 centimeters) by default. inlineverticalfieldofview optional a floating-point value indicating the default field of view, in radians, to be used when 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 xrrenderstateinit compliant object passed into updaterenderstate() are left at their current values. specifications specification status comment webxr device apithe defini...
XRRigidTransform.position - Web APIs
syntax let pos = xrrigidtransform.position; 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. ...
...vesession is true; if so, we first request a bounded-floor reference space. if that fails (probably because bounded-floor isn't supported), we try requesting a local-floor reference space. if we're not in an immersive session, we instead request a viewer reference space. in all cases, once the space has been obtained, it 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. specificatio...
XRSession.environmentBlendMode - Web APIs
mentblendmode, defining if—and if so, how—virtual, rendered content is overlaid atop the image of the real world. permitted values are: opaque the rendered image is drawn without allowing any pass-through imagery. this is primarily used by fully-immersive vr headsets, which totally obscure the surrounding environment, with none of the real world shown to the user at all. the alpha values
specified in the xrsession's renderstate property's baselayer field are ignored since the alpha values for the rendered imagery are all treated as being 1.0 (fully opaque). additive primarily used by ar devices with transparent lenses which directly allow reality to pass through to the user's eyes, the additive blending mode is designed to be used in a situation in which the device has no control over th...
...blending mode is designed to be used in a situation in which the device has no control over the background and its brightness, since that isn't being digitally controlled. all the device can do is add more light to the image; it can't make things get darker. therefore, black is rendered as fully transparent, and there's no way to make a pixel fully opaque. as with the opaque setting, alpha values
specified are ignored and treated as if they were 1.0. alpha-blend used by headsets or goggles which use cameras to capture the real world and display it digitally on the screen or screens used to render the content for the user to see, this offers a way to create an ar presentation using a vr device. alpha blending can also be used by non-wearable devices that provide ar modes, such as phones or tablets...
XRSystem: isSessionSupported() - Web APIs
the xrsystem method issessionsupported() returns a promise which resolves to true if the
specified webxr session mode is supported by the user's webxr device. otherwise, the promise resolves with false. if the no devices are available or the browser doesn't have permission to use the xr device, the promise is rejected with an appropriate domexception. syntax var issupportedpromise = xr.issessionsupported(xrsessionmode) parameters xrsessionmode a domstring specifying the webxr session mode for which support is to be checked. this string must be one of inline (to present the webxr content inline within the context of an html document) or immersive-vr for a fully-immersive virtual experience. ...
... var issupportedpromise = xr.issessionsupported(xrsessionmode) parameters xrsessionmode a domstring specifying the webxr session mode for which support is to be checked. this string must be one of inline (to present the webxr content inline within the context of an html document) or immersive-vr for a fully-immersive virtual experience. return value a promise that resolves to true if the
specified session mode is supported; otherwise the promise resolves to false. exceptions rather than throwing true exceptions, issessionsupported() rejects the returned promise, passing to the rejection handler a domexception whose name is one of the following strings. securityerror the document's origin does not have permission to use the xr-spatial-tracking feature policy. examples in this examp...
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
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. ...
...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. ...
XRWebGLLayer.getViewport() - Web APIs
the xrwebgllayer interface's getviewport() method returns the xrviewport that should be used to render the
specified xrview into the webgl layer. for webxr devices which use a single framebuffer for both the left and right eyes, the returned viewport represents the region of the framebuffer into which the scene should be rendered for the eye represented by the view. syntax let viewport = xrwebgllayer.getviewport(view); parameters view an xrview object indicating the view for which the viewport is to be returned. return value a xrviewport object representing the viewport which will restrict drawing to the portion of the layer corresponding to the
specified view. ...
...ndered for the eye represented by the view. syntax let viewport = xrwebgllayer.getviewport(view); parameters view an xrview object indicating the view for which the viewport is to be returned. return value a xrviewport object representing the viewport which will restrict drawing to the portion of the layer corresponding to the
specified view. exceptions invalidstateerror either the
specified view is not in an active xrframe or that xrframe and the xrwebgllayer are not part of the same webxr session. example this example demonstrates in part what the callback for the requestanimationframe() function might look like, using getviewport() to get the viewport so that drawing can be constrained to the area set aside for the eye whose viewpoint is currently being rendered. this works be...
ARIA Test Cases - Accessibility
markup used: aria-relevant, aria-live="polite" notes: results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 - - - - ...
...levant="additions removals text"" aria-live="polite -- should have same behavior as "all" aria-relevant="additions text" aria-live="polite" aria-live="polite" -- aria-relevant is not set, so should act the same as "additions text" expected at behavior: (al) if aria-relevant is not
specified, the screen reader should read only live node additions and text changes (al) if aria-relevant is
specified, the screen reader should read all the changes
specified by aria-relevant and no more. markup used: aria-relevant, aria-live="polite" notes: results: at firefox ie opera safari jaws 9 - - n/a n/a jaws 10 - - - - voiceover (leopard) n/a n/a - fail window-eyes - - - - nvda -...
-moz-force-broken-image-icon - CSS: Cascading Style Sheets
x 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. ...
... notes this property will only work in gecko-based browsers. ...
-moz-image-region - CSS: Cascading Style Sheets
age 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 definition initial valueautoapplies toxul <image> elements and :-moz-tree-image, :-moz-tree-twisty, and :-moz-tree-checkbox pseudo-elements. ...
...ttom, and left offsets of the edges of the image, in this order. formal definition 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. ...
-moz-orient - CSS: Cascading Style Sheets
values inline the element is 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. ...
...red 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-user-focus - CSS: Cascading Style Sheets
-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 the textbox from taking keyboard focus by setting its tab index to -1, and from taking mouse focus by preventing the default action of m...
...us 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 definition 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 similar property, user-focus, was proposed in early drafts of a predecessor of the css...
-webkit-mask-composite - CSS: Cascading Style Sheets
tination 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
s 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. ...
... specifications not part of any standard. ...
:in-range - CSS: Cascading Style Sheets
note: this pseudo-class only applies to elements that have (and can take) a range limitation. ...
... note: this pseudo-class only applies to elements that have (and can take) a range limitation. ...
:out-of-range - CSS: Cascading Style Sheets
note: this pseudo-class only applies to elements that have (and can take) a range limitation. ...
... note: this pseudo-class only applies to elements that have (and can take) a range limitation. ...
fallback - CSS: Cascading Style Sheets
the fallback descriptor can be used to specify a counter style to fall back to if the current counter style cannot create a marker representation for a particular counter value. syntax /* keyword values */ fallback: lower-alpha; fallback: custom-gangnam-style; description if the
specified fallback style is also unable to construct a representation, then its fallback style will be used. if a valid fallback style is not
specified, it 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 re...
...e 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. ...
negative - CSS: Cascading Style Sheets
is negative */ values first <symbol> this symbol will be prepended to the representation when the counter is negative. second <symbol> if present, this symbol will be appended to the representation when the counter is negative. description if the counter value is negative, the symbol provided as value for the descriptor is prepended to the counter representation; 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. formal definition related at-rule@counter-style...
...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. ...
pad - CSS: Cascading Style Sheets
the pad descriptor can be used with custom counter style definitions when you need the marker representations to have a minimum length. 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. 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 nee...
...n 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... ...
prefix - CSS: Cascading Style Sheets
the prefix descriptor of the @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>. ...
...on. 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>. ...
font-stretch - CSS: Cascading Style Sheets
for a particular font family, authors can download various font faces which correspond to the different styles of the same font family, and then use the font-stretch descriptor to explicitly specify the font face's stretch. the values for the css descriptor is same as that of its corresponding font property. ...
...dths. 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. ...
font-style - CSS: Cascading Style Sheets
for a particular font family, authors can download various font faces which correspond to the different styles of the same font family, and then use the font-style descriptor to explicitly specify the font face's style. the values for the css descriptor is same as that of its corresponding font property. syntax font-style: normal; font-style: italic; font-style: oblique; font-style: oblique 30deg; font-style: oblique 30deg 50deg; values normal selects the normal version of the font-family. italic specifies that font-face is an italicized version of the normal font. ...
...ifies 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. ...
font-weight - CSS: Cascading Style Sheets
the font-weight css descriptor allows authors to specify font weights for the fonts
specified in the @font-face rule. the font-weight property can separately be used to set how thick or thin characters in text should be displayed. for a particular font family, authors can download various font faces which correspond to the different styles of the same font family, and then use the font-weight descriptor to explicitly specify the font face's weights. the values for the css descriptor is same as that of its corresponding font property. there are generally limited weights available for a particular font family. when a
specified weight doesn't exist, a nearby weight is used. fonts lacking bold are often synthesized by the user agent. to prevent this, use font-synthesis property. syntax /* single v...
...xperiencing 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. ...
src - CSS: Cascading Style Sheets
ath/to/font.otf) format("opentype"); values <url> [ format( <string># ) ]? specifies an external reference consisting of a <url>, followed by an optional hint using the format() function to describe the format of the font resource referenced by that url. the format hint contains a comma-separated list of format strings that denote well-known font formats. if a user agent doesn't support the
specified formats, it skips downloading the font resource. if no format hints are supplied, the font resource is always downloaded. <font-face-name> specifies the name of a locally-installed font face using the local() function, which uniquely identifies a single font face within a larger family. the name can optionally be enclosed in quotes. description the value of this descriptor is a prioritized, ...
... 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. ...
width - CSS: Cascading Style Sheets
must be non-negative. ...
...iewportinitial valueas each of the properties of the shorthand:min-width: automax-width: nonepercentagesas each of the properties of the shorthand:min-width: refer to the width of the containing blockmax-width: refer to the width of the containing blockcomputed valueas each of the properties of the shorthand:min-width: the percentage as
specified or the absolute 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 definition of '"min-width" descriptor' in that spec...
Using CSS animations - CSS: Cascading Style Sheets
ned in the css style that configures the animation, keyframes use a <percentage> to indicate the time during the animation sequence at which they take place. 0% indicates the first moment of the animation sequence, while 100% indicates the final state of the animation. because these two times are so important, they have special aliases: from and to. both are optional. if from/0% or to/100% is not
specified, the browser starts or finishes the animation using the computed values of all attributes. you can optionally include additional keyframes that describe intermediate steps between the start and end of the animation. examples note: some older browsers (pre-2017) may need prefixes; the live examples you can click to see in your browser include the -webkit prefixed syntax. making text slide acro...
...ve three values set on all three properties. in this case each animation is run with the corresponding values in the same position on each property, so for example fadeinout has a duration of 2.5s and an iteration count of 2, etc. animation-name: fadeinout, moveleft300px, bounce; animation-duration: 2.5s, 5s, 1s; animation-iteration-count: 2, 1, 5; in this third case, there are three animations
specified, but only two durations and iteration counts. in such cases where there are not enough values to give a separate value to each animation, the values cycle from start to finish. so for example, fadeinout gets a duration of 2.5s and moveleft300px gets a duration of 5s. we’ve now got to the end of the available duration values, so we start from the beginning again — bounce therefore gets a durat...
Using URL values for the cursor property - CSS: Cascading Style Sheets
gecko 1.8 supports url values for the css cursor property on windows and linux. mac support was added in gecko 2 (firefox 4). this allows specifying arbitrary images as mouse cursors — any image format supported by gecko can be used. syntax the basic (css 2.1) syntax for this property is: cursor: [ <url> , ]* <keyword> this means that zero or more urls may be
specified (comma-separated), which must be followed by one of the keywords defined in the css specification, such as auto or pointer. for example, the following value would be allowed: cursor: url(foo.cur), url(http://www.example.com/bar.gif), auto; this will first try loading foo.cur. if that file does not exist or is not valid for some other reason, bar.gif is tried, and if that can't be used either, auto will be used. support for...
...t file does not exist or is not valid for some other reason, bar.gif is tried, and if that can't be used either, auto will be used. support for the css 3 syntax for cursor values got added in gecko 1.8 (firefox 1.5): cursor: [ <uri> [ <x> <y> ]? , ]* <keyword> it allows specifying the coordinates of the cursor's hotspot, which will be clamped to the boundaries of the cursor image. if none are
specified, the coordinates of the hotspot are read from the file itself (for cur and xbm files) or are set to the top left corner of the image. an example of the css3 syntax is: .foo { cursor: auto; cursor: url(cursor1.png) 4 12, auto; } .bar { cursor: pointer; cursor: url(cursor2.png) 2 2, pointer; } /* falls back onto 'auto' and 'pointer' in ie, but must be set separately */ the first numb...
Box alignment in Multi-column Layout - CSS: Cascading Style Sheets
gnment page which details the common features of box alignment across layout methods. in multi-column layout the alignment container is the content box of the multicol container. the alignment subject is the column box. the properties which apply to multi-column layouts are detailed below. note: multi-column layout predates the box alignment specification. and the properties listed here, while
specified for multicol, may not be supported in browsers. align-content and justify-content the align-content property applies to the block axis and justify-content to the inline axis. any spacing added to the columns due to use of space distribution will be added to the gap between the columns, therefore making the gap larger than might be
specified by the column-gap property. using a value of justify...
...gn-content property applies to the block axis and justify-content to the inline axis. any spacing added to the columns due to use of space distribution will be added to the gap between the columns, therefore making the gap larger than might be
specified by the column-gap property. using a value of justify-content other than normal or stretch will cause column boxes to display at the column-width
specified on the multicol container, and the remaining space distributed according to the value of justify-content. column-gap the column-gap property was
specified in earlier versions of the multiple-column layout specification, and has now been unified with the gap properties for other layout methods in box alignment. while other layout methods treat the initial value of column-gap as 0 multicol treats...
CSS Box Alignment - CSS: Cascading Style Sheets
this will typically be the alignment subject’s containing block. an alignment container may contain one or many alignment subjects. the below image shows an alignment container with two alignment subjects inside. fallback alignment if you set an alignment that cannot be fulfilled, then the fallback alignment will come into play and deal with the available space. this fallback alignment is
specified individually for each layout method and detailed on the page for that method. types of alignment there are three different types of alignment that the specification details; these use keyword values. positional alignment: specifying the position of an alignment subject with relation to its alignment container. baseline alignment: these keywords define alignment as a relationship among the b...
... and placed between the items. there needs to be space available in the dimension you wish to align the items in, in order for these keywords to take effect. with no space, there is nothing to distribute. overflow alignment the safe and unsafe keywords help define behaviour when an alignment subject is larger than the alignment container. the safe keyword will align to start in the case of a
specified alignment causing an overflow, the aim being to avoid “data loss” where part of the item is outside of the boundaries of the alignment container and can’t be scrolled to. if you specify unsafe then the alignment will be honoured even if it would cause such data loss. gaps between boxes the box alignment specification also includes the gap, row-gap, and column-gap properties. these proper...
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
grid defaults to spanning one track. this means that our initial, long-hand, example would look like this: * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-...
...the start row line, then the end line we explain that we want to span 3 lines. the area will start at line 1 and span 3 lines to line 4. .box1 { grid-column-start: 1; grid-row-start: 1; grid-row-end: span 3; } in the second example, we specify the end row line we want the item to finish at and then set the start line as span 3. this means the item will need to span upwards from the
specified row line. the area will start at line 4 and span 3 lines to line 1. .box1 { grid-column-start: 1; grid-row-start: span 3; grid-row-end: 4; } to become familiar with line based positioning in grid try to build a few common layouts by placing items onto grids with varying numbers of columns. remember that if you do not place all of the items, any leftover items will be placed accordi...
Subgrid - CSS: Cascading Style Sheets
ere is nowhere for the extra two items to go and so they go into the last track of the grid, as defined in the specification. if we remove the grid-template-rows value we enable regular creation of implicit tracks and, although these won't line up with the tracks of the parent, as many as are required will be created. the gap properties and subgrid if you have a gap, column-gap, or row-gap
specified on the parent, this will be passed into the subgrid, so it will have the same spacing between tracks as the parent. in some situations however you may wish the subgrid tracks to have a different gap or no gap. this can be achieved by using the gap-* properties on the grid container of the subgrid. you can see this in the example below. the parent grid has a gap of 20px for rows and columns. the ...
...ave named lines on the parent col-start and col-end and then used those to place the subitem. you can also specify line names on the subgrid. this is achieved by adding a list of line names enclosed in square brackets after the subgrid keyword. if you have four lines in your subgrid, to name them all you could use the syntax grid-template-columns: subgrid [line1] [line2] [line3] [line4] lines
specified on the subgrid are added to any lines
specified on the parent so you can use either or both. to demonstrate this, i have positioned one item in the example below using the parent lines, and one using the subgrid lines. using subgrids other than needing to take care of items that do not fit in your subgrid, a subgrid acts very similarly to any nested grid; the only difference is that the track...
Using z-index - CSS: Cascading Style Sheets
the first part of this article, stacking without the z-index property, explains how stacking is arranged by default. if you want to create a custom stacking order, you can use the z-index property on a positioned element. the z-index property can be
specified with an integer value (positive, zero, or negative), which represents the position of the element along the z-axis. if you are not familiar with the z-axis, imagine the page as a stack of layers, each one having a number. ...
... familiar with the z-axis, imagine the page as a stack of layers, each one having a number. layers are rendered in numerical order, with larger numbers above smaller numbers. bottom layer (farthest from the observer) ... layer -3 layer -2 layer -1 layer 0 (default rendering layer) layer 1 layer 2 layer 3 ... top layer (closest to the observer) notes: when no z-index property is
specified, elements are rendered on the default rendering layer 0 (zero). if several elements share the same z-index value (i.e., they are placed on the same layer), stacking rules explained in the section stacking without the z-index property apply. in the following example, the layers' stacking order is rearranged using z-index. the z-index of element #5 has no effect since it is not a positioned ele...
CSS values and units - CSS: Cascading Style Sheets
t. 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 value of revert was added in the cascade level 4 specification, but it does not currently have good browser support. urls a ...
...ed in the css color module. image the <image> value specifies all the different types of image that can be used in css, and is defined in the css image values and replaced content module. position the <position> type defines 2d positioning of an object inside a positioning area, for example a background image inside a container. this type is interpreted as a background-position and therefore
specified in the css backgrounds and borders specification. functional notation calc() min() max() clamp() toggle() attr() functional notation is a type of value that can represent more complex types or invoke special processing by css. the syntax starts with the name of the function immediately followed by a left parenthesis ( followed by the argument(s) to the notation followed by a right pare...
align-content - CSS: Cascading Style Sheets
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. ...
...l 3the definition 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 definition of 'align-content' in that specification. candidate recommendation initial definition initial valuenormalapplies tomulti-line flex containersinheritednocomputed valueas
specifiedanimation typediscrete ...
animation-delay - CSS: Cascading Style Sheets
onvenient to use the shorthand property animation to set all animation properties at once. syntax /* single animation */ animation-delay: 3s; animation-delay: 0s; animation-delay: -1500ms; /* multiple animations */ animation-delay: 2.1s, 480ms; values <time> the time offset, from the moment at which the animation is applied to the element, at which the animation should begin. this may be
specified in either seconds (s) or milliseconds (ms). the unit is required. a positive value indicates that the animation should begin after the
specified amount of time has elapsed. a value of 0s, which is the default, indicates that the animation should begin as soon as it's applied. a negative value causes the animation to begin immediately, but partway through its cycle. for example, if you specify...
...me, the animation will begin immediately but will start 1 second into the animation sequence. if you specify a negative value for the animation delay, but the starting value 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 definition initial value0sapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas
specifiedanimation typediscrete formal syntax <time># examples see css animations for examples. specifications ...
animation-direction - CSS: Cascading Style Sheets
teration being played forwards. the count to determine if a cycle is even or odd starts at one. alternate-reverse the animation reverses direction each cycle, with the first iteration being played backwards. the count to determine if a cycle is even or odd starts at one. ...
...u 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 definition 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 animationsthe definition of 'animation-direction' in that specification. working draft initial definition. brow...
animation-duration - CSS: Cascading Style Sheets
send us a pull request. it is often convenient to use the shorthand property animation to set all animation properties at once. syntax /* single animation */ animation-duration: 6s; animation-duration: 120ms; /* multiple animations */ animation-duration: 1.64s, 15.22s; animation-duration: 10s, 35s, 230ms; values <time> the time that an animation takes to complete one cycle. this may be
specified in either seconds (s) or milliseconds (ms). the value must be positive or zero and the unit is required. a value of 0s, which is the default value, indicates that no animation should occur. note: negative values are invalid, causing the declaration to be ignored. some early, prefixed, implementations may consider them as identical to 0s. note: when you specify multiple comma-separated value...
...e or zero and the unit is required. a value of 0s, which is the default value, indicates that no animation should occur. note: negative values are invalid, causing the declaration 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 definition initial value0sapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas
specifiedanimation typediscrete formal syntax <time># examples see css animations for examples. specifications ...
animation-fill-mode - CSS: Cascading Style Sheets
relevant keyframe normal or alternate 0% or from reverse or alternate-reverse 100% or to both the animation will follow the rules for both forwards and backwards, thus extending the animation properties in both directions. ...
...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 definition 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 infinite time, you can cause it to remain in its final state rather than reverting to the original state (which is the def...
animation-name - CSS: Cascading Style Sheets
on 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. furthermore, the identifier can't be none, unset, initial, or inherit. ...
...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 definition 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 definition of 'animation-name' in that specification. working draft initial definition. ...
animation-play-state - CSS: Cascading Style Sheets
nimations */ 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. ...
... 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 definition initial valuerunningapplies toall elements, ::before and ::after pseudo-elementsinheritednocomputed valueas
specifiedanimation typediscrete formal syntax <single-animation-play-state>#where <single-animation-play-state> = running | paused examples see css animations for examples. specifications specification status comment css animationsthe definition of 'animation-play-state' in that specification. working draft initial definition. ...
backface-visibility - CSS: Cascading Style Sheets
ce can become visible when a transformation causes the element to be rotated in 3d space. ...
...ial; 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 definition 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;</code></th> </tr> <tr> <td> <div class="container"> <div class="cube show...
background-color - CSS: Cascading Style Sheets
accessibility concerns it is important to ensure that the contrast ratio between the background color and the color of the text placed over it is high enough that people ...
...75); /* 75% transparent */ /* special keyword values */ background-color: currentcolor; background-color: transparent; /* global values */ background-color: inherit; background-color: initial; background-color: unset; the background-color property is
specified as a single <color> value. 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 color and the color of the text placed over it is high enough that people experiencing low vision conditions will be able to read the content of the page. color contrast ratio is determined by comparing the luminance o...
background-origin - CSS: Cascading Style Sheets
b.com/mdn/interactive-examples and send us a pull request. note that background-origin is ignored when background-attachment is fixed. syntax /* keyword values */ background-origin: border-box; background-origin: padding-box; background-origin: content-box; /* global values */ background-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 definition initial valuepadding-boxapplies toall elements. it also applies to ::first-letter and ::first-line.inheritednoc...
...eyword 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 definition initial valuepadding-boxapplies toall elements. ...
border-block-end - CSS: Cascading Style Sheets
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-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. formal definition initial valueas each of the properties of the shorthand:border-top-width: mediumborder-top-style: noneborder-top-color: currentcolorapplies toall elem...
...-style. <'color'> the color of the border. see color. ...
border-block-start - CSS: Cascading Style Sheets
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-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. formal definition initial valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-top-width: mediumborder-right-...
...-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hiddenborder-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-style: as each of the properties of the shorthand:border-bottom-style: as
specifiedborder-left-style: as
specifiedborder-right-style: as
specifiedborder-top-style: as
specifiedborder-block-start-color: computed coloranimation typeas each of the properties of the shorthand:border-block-start-color: a colorborder-block-start-style: discreteborder-block-start-width: a length formal syntax <'border-top-width'> | <'border-top-style'> | <'color'>where <color> = <rgb()> | <rgba()> | ...
border-block - CSS: Cascading Style Sheets
ies depending on the values defined for writing-mode, direction, and text-orientation. the borders in the other dimension can be set with border-inline, which sets border-inline-start, and border-inline-end. constituent properties this property is 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. formal definition initial valueas each of the properties of the shorthand:border-top-width: mediumborder-top-style: noneborder-top-color: currentcolorapplies toall elem...
...-style. <'color'> the color of the border. see color. ...
border-collapse - CSS: Cascading Style Sheets
ed, 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. ...
...ollapse 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-image-repeat - CSS: Cascading Style Sheets
ve-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 to fill the gap between each border. repeat the source image's edge regions are t...
...etched 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 definition initial valuestretchapplies toall elements, except internal table elements when border-collapse is collapse. ...
border-inline-end - CSS: Cascading Style Sheets
-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hiddenborder-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-style: as each of the properties of the shorthand:border-bottom-style: as
specifiedborder-left-style: as
specifiedborder-right-style: as
specifiedborder-top-style: as
specifiedborder-inline-end-color: computed coloranimation typeas each of the properties 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'>...
...-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hiddenborder-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-style: as each of the properties of the shorthand:border-bottom-style: as
specifiedborder-left-style: as
specifiedborder-right-style: as
specifiedborder-top-style: as
specifiedborder-inline-end-color: computed coloranimation typeas each of the properties of the shorthand:border-inline-end-color: a colorborder-inline-end-style: discreteborder-inline-end-width: a length formal syntax <'border-top-width'> | <'border-top-style'> | <'color'>where <color> = <rgb()> | <rgba()> | <hsl...
border-inline-start-style - CSS: Cascading Style Sheets
es 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. ...
...re 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. ...
border-inline-start - CSS: Cascading Style Sheets
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-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. formal definition initial valueas each of the properties of the shorthand:border-width: as each of the properties of the shorthand:border-top-width: mediumborder-right-...
...-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hiddenborder-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-style: as each of the properties of the shorthand:border-bottom-style: as
specifiedborder-left-style: as
specifiedborder-right-style: as
specifiedborder-top-style: as
specifiedborder-inline-start-color: computed coloranimation typeas each of the properties of the shorthand:border-inline-start-color: a colorborder-inline-start-style: discreteborder-inline-start-width: a length formal syntax <'border-top-width'> | <'border-top-style'> | <'color'>where <color> = <rgb()> | <rgba()...
border-inline - CSS: Cascading Style Sheets
set with border-block, which sets border-block-start, and border-block-end. initial valueas each of the properties of the shorthand:border-top-width: mediumborder-top-style: noneborder-top-color: currentcolorapplies toall elementsinheritednocomputed 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 coloranimation typediscrete constituent properties this property is 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 st...
...-style. <'color'> the color of the border. see color. ...
border-spacing - CSS: Cascading Style Sheets
precated cellspacing <table> attribute, except that it has an optional second value that can be used to set different horizontal and vertical spacing. ...
...l 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 vertical spacing between cells (i.e., the space between cells in adjacent rows). values <length> the size of the spacing as a fixed valu...
border-top-style - CSS: Cascading Style Sheets
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 definition 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 | double | groove | ridge | inset | outset examples html <table> <tr> ...
...css backgrounds and borders module level 3the definition of 'border-top-style' in that specification. candidate recommendation no significant change. css level 2 (revision 1)the definition of 'border-top-style' in that specification. recommendation initial definition. initial valuenoneapplies toall elements. it also applies to ::first-letter.inheritednocomputed valueas
specifiedanimation typediscrete ...
border - CSS: Cascading Style Sheets
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 of the border. defaults to none if absent. see border-sty...
...-width: the absolute length or 0 if border-bottom-style is none or hiddenborder-left-width: the absolute length or 0 if border-left-style is none or hiddenborder-right-width: the absolute length or 0 if border-right-style is none or hiddenborder-top-width: the absolute length or 0 if border-top-style is none or hiddenborder-style: as each of the properties of the shorthand:border-bottom-style: as
specifiedborder-left-style: as
specifiedborder-right-style: as
specifiedborder-top-style: as
specifiedborder-color: as each of the properties of the shorthand:border-bottom-color: computed colorborder-left-color: computed colorborder-right-color: computed colorborder-top-color: computed coloranimation typeas each of the properties of the shorthand:border-color: as each of the properties of the shorthand:bo...
bottom - CSS: Cascading Style Sheets
ottom edge and the bottom edge of its containing block. when position is set to relative, the bottom property specifies the distance the element's bottom edge is moved above its normal position. when position is set to sticky, the bottom property is used to compute the sticky-constraint rectangle. when position is set to static, the bottom property has no effect. when both top and bottom are
specified, position is set to absolute or fixed, and height is un
specified (either auto or 100%) both the 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 */ bottom: 3px; bottom: 2.4em; /* <percentage>s of the height of the co...
...cally 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. formal definition initial valueautoapplies topositioned elementsinheritednopercentagesrefer to the height of the containing blockcomputed valueif
specified as a length, the corresponding absolute length; if
specified as a percentage, the
specified value; otherwise, autoanimation typea length, percentage or calc(); formal syntax <length> | <percentage> | auto examples absolute and fixed positioning this example demonstrates the difference in behavior of the bottom property, when position is absolute versus fixed. html <p>this<br>is<br>some<br>...
box-direction - CSS: Cascading Style Sheets
rmation 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: horizontal left vertical top the edge opposite to t...
...ed 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. formal definition initial valuenormalapplies toelements with a css display value of box or inline-boxinheritednocomputed valueas
specifiedanimation typediscrete formal syntax normal | reverse | inherit examples setting box direction .example { /* bottom-to-top layout */ -moz-box-direction: reverse; /* mozilla */ -webkit-box-direction: reverse; /* webkit */ box-direction: reverse; /* as
specified */ } specifications not part of any standard. browser compatibility the compatibility table on this page...
box-flex-group - CSS: Cascading Style Sheets
. if the box would overflow after the preferred space of the children has been computed, then space is removed from flexible elements in a manner similar to that used when adding extra space. each flex group is examined in turn and space is removed according to the ratio of the flexibility of each element. elements do not shrink below their minimum widths. ...
...anner 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
, 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 the content elements. content elements that have zero flex do not grow. if only one content element has nonzero flex, then it grows to fill the availa...
...k 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
ordinal group and ensure that those elements appear 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. ...
...tainer. 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
ontents 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. end the box packs contents at the end, leaving any extra space at the start. justify the space is divided evenly in-between each child, with none of t...
...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. ...
box-sizing - CSS: Cascading Style Sheets
ts much easier, and generally eliminates a number of pitfalls you can stumble on while laying out your content. 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 calc...
...tent 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 definition 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> <div class="border-box">border box</div> css div { width: 160px; height: 80px; padding: 20px; border: 8px...
break-after - CSS: Cascading Style Sheets
itself has precedence over the break-inside value). if any of the three concerned values is an avoid break value (avoid, avoid-page, avoid-region, or avoid-column), no such break will be applied at that point. once forced breaks have been applied, soft breaks may be added if needed, but not on element boundaries that resolve in a corresponding avoid value. syntax the break-after property is
specified as one of the keyword values from the list below. values generic break values auto allows, but does not force, any break (page, column, or region) to be inserted right after the principal box. avoid avoids any break (page, column, or region) from being inserted right after the principal box. always forces a page break right after the principal box. the type of this break is that of th...
...uto 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. ...
break-before - CSS: Cascading Style Sheets
itself has precedence over the break-inside value). if any of the three concerned values is an avoid break value (avoid, avoid-page, avoid-region, or avoid-column), no such break will be applied at that point. once forced breaks have been applied, soft breaks may be added if needed, but not on element boundaries that resolve in a corresponding avoid value. syntax the break-before property is
specified as one of the keyword values from the list below. values generic break values auto allows, but does not force, any break (page, column, or region) to be inserted right before the principal box. avoid avoids any break (page, column, or region) from being inserted right before the principal box. always forces a page break right after the principal box. the type of this break is that of ...
...uto 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. ...
break-inside - CSS: Cascading Style Sheets
in turn has precedence over the break-inside value. if any of the three concerned values is an avoid break value (avoid, avoid-page, avoid-region, or avoid-column), no such break will be applied at that point. once forced breaks have been applied, soft breaks may be added if needed, but not on element boundaries that resolve in a corresponding avoid value. syntax the break-inside property is
specified as one of the keyword values from the list below. values auto allows, but does not force, any break (page, column, or region) to be be inserted within the principal box. avoid avoids any break (page, column, or region) from being inserted within the principal box. avoid-page avoids any page break within the principal box. avoid-column avoids any column break within the principal box. ...
...ak-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. a subset of values should be aliased as follows: page-break-inside break-inside auto auto avoid avoid formal definition initial valueautoapplies toblock-level elementsinheritednocomputed valueas
specifiedanimation typediscrete formal syntax auto | avoid | avoid-page | avoid-column | avoid-region examples avoiding breaking inside a figure in the following example we have a container that contains an <h1> spanning all columns (achieved using column-span: all) and a series of paragraphs laid out in multiple columns using column-width: 200px. we also have a <figure> containing an image and a capt...
caption-side - CSS: Cascading Style Sheets
the caption-side css property puts the content of a table's <caption> on the
specified side. the values are relative to the writing-mode of the table. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. 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 positio...
...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. ...
clip - CSS: Cascading Style Sheets
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. ...
...e 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. ...
color-adjust - CSS: Cascading Style Sheets
rse rather than better. the appearance of the content should not be changed except by the user's request. for example, a page might include a list of information with rows whose background colors alternate between white and a light grey. removing the background color would decrease the legibility of the content. usage notes there are a number of reasons a browser might wish to deviate from the
specified appearance, such as: the content uses text and background colors that will be too similar on the output device for legibility purposes. if the output device is a printer, and to save ink, dark or extremely dense background images might be removed. when printing a page, the browser might want to replace light-colored text on a dark background with dark text on a white background. any option...
...ol 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 definition 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 desired appearance in any rendering environment, including on paper, so we also use co...
<color> - CSS: Cascading Style Sheets
ansparent) using the rgb cubic-coordinate system (via the #-hexadecimal or the rgb() and rgba() functional notations) using the hsl cylindrical-coordinate system (via the hsl() and hsla() functional notations) note: this article describes the <color> data type in detail. to learn more about using color in html, see applying color to html elements using css. syntax the <color> data type is
specified using one of the options listed below. note: although <color> values are precisely defined, their actual appearance may vary (sometimes significantly) from device to device. this is because most devices are not calibrated, and some browsers do not support output devices' color profiles. color keywords color keywords are case-insensitive identifiers that represent a specific color, such as re...
...ons. note: as of css colors level 4, hsla() 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 definition, 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 ...
column-count - 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 value */ column-count: auto; /* <integer> value */ column-count: 3; /* global values */ column-count: inherit; column-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. ...
...perties, 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 definition 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. </p> css .content-box { column-count: 3; } result specifications specification status co...
column-fill - CSS: Cascading Style Sheets
ple 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 contexts, such as paged media, only the last fragment is balanced. ...
...ly 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 definition 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 .content-box { column-count: 4; column-rule: 1px solid black; column-fill: balanc...
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. 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 definition initial valuenoneapplies toin-flow block-level elementsinherited...
...w. 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 definition 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 the text should be distributed among the columns. </p> <p>this is a bunch of text split into ...
column-width - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. ...
... 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. percentage values are also invalid. auto the width of the column is d...
columns - CSS: Cascading Style Sheets
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, defined as an <integer> or the keyword auto. if neither this ...
...mn's width are auto, it merely indicates the maximum allowable number of columns. see column-count. formal definition initial valueas each of the properties of the shorthand:column-width: autocolumn-count: autoapplies toblock containers except table wrapper boxesinheritednocomputed valueas each of the properties of the shorthand:column-width: the absolute length, zero or largercolumn-count: as
specifiedanimation typeas each of the properties of the shorthand:column-width: a lengthcolumn-count: an integer formal syntax <'column-width'> | <'column-count'> examples setting three equal columns html <p class="content-box"> this is a bunch of text split into three columns using the css `columns` property. the text is equally distributed over the columns. </p> css .content-box { column...
contain - CSS: Cascading Style Sheets
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 is equivalent to contain: size layout paint. content ...
...f 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. ...
cursor - CSS: Cascading Style Sheets
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 be optionally followed by a pair of space-separated nu...
...though 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. ...
empty-cells - CSS: Cascading Style Sheets
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. ...
...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. ...
flex-basis - CSS: Cascading Style Sheets
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 olde...
...change was reverted in bug 1093316, so auto once again means "look at my width or height property"; and a new content keyword is being introduced to trigger automatic sizing. (bug 1105111 covers adding that keyword). ...
flex-grow - CSS: Cascading Style Sheets
ize. 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-direction value. the remaining space is the size of the flex cont...
...me 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 definition 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" style="background-color:lightblue;">b</div> <div class="box" style="background-color:yellow;">c</div> <div cla...
flex-shrink - CSS: Cascading Style Sheets
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. ...
.../* <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 definition 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 the others.</p> <div id="content"> <div class="box" style="background-color:red;">a</div> <div class="box" st...
font-kerning - CSS: Cascading Style Sheets
please clone https://github.com/mdn/interactive-examples and send us a pull request. kerning defines how letters are spaced. in well-kerned fonts, this feature makes character spacing more uniform and pleasant to read than it would otherwise be. in the image below, for instance, the examples on the left do not use kerning, while the ones on the right do: syntax the font-kerning property is
specified 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 definition ...
... 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 definition 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 { font-kerning: none; } #kern { font-kerning: normal; } javascript let input = document.getelementbyid('input'); let kern = docume...
font-language-override - CSS: Cascading Style Sheets
the font-language-override property lets you override the typeface behavior for a specific language. this is useful, for example, when the typeface you're using lacks proper support for the language. for instance, if a typeface doesn't have proper rules for the azeri language, you can force the font to use turkish glyphs, which follow similar rules. syntax the font-language-override property is
specified as the keyword normal or a <string>. values 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...
...e 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 definition initial valuenormalapplies toall elements. ...
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 more expanded font face than normal, with ultra-expanded as the mo...
...lues 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 definition 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 setting font stretch percentages note that this example will only work in browsers that support <percentage> values. html <div class="cont...
font-variant-caps - CSS: Cascading Style Sheets
/ΑΪ). 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 uppercase letters but are reduced to the size of lowercase letters. all-sm...
...erns 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 definition initial valuenormalapplies toall elements. ...
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 that all ligatures and contextual forms are disabled, even common ones. <common-lig-v...
...ese 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 definition initial valuenormalapplies toall elements. ...
font-variant-position - CSS: Cascading Style Sheets
sn'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 enhanced, and have no effect on the line-height and other box characteristics. syntax the font-variant-position property is
specified as one of the keyword values listed below. values normal deactivates alternate superscript and 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...
..., 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 definition initial valuenormalapplies toall elements. ...
grid-auto-columns - CSS: Cascading Style Sheets
content constraint). fit-content(argument) represents the formula min(max-content, max(auto, argument)), which is calculated similar to auto (i.e. minmax(auto, max-content)), except that the track size is clamped 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. ...
...e 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. ...
grid-auto-rows - CSS: Cascading Style Sheets
max is smaller than min, then max is ignored and the function is treated as min. as a maximum, a <flex> value sets the track’s flex factor. as a minimum, it is treated as zero (or minimal content, if the grid container is sized under a minimal content constraint). auto is a keyword that is identical to maximal content if it's a maximum. ...
... 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. ...
grid-column-end - CSS: Cascading Style Sheets
tomatic 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 implicit named lines of this form, so specifying grid-column-end: foo; will choose the end edge of that named grid area (unless another line named foo-end was explicitly
specified before it). otherwise, this is treated as if the integer 1 had been
specified along with the <custom-ident>. <integer> && <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-ident>, only lines with that name are counted. if...
...esponding 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. ...
grid-row-end - CSS: Cascading Style Sheets
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 implicit named lines of this form, so specifying grid-row-end: foo; will choose the end edge of that named grid area (unless another line named foo-end was explicitly
specified before it). otherwise, this is treated as if the integer 1 had been
specified along with the <custom-ident>. the <custom-ident> cannot take the span value. <integer> && <custom-ident>? contributes the nth grid line to the grid item’s placement. if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid. if a name is given as a <custom-...
... 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. ...
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 uses one of the following: first, allow-end, and last first, force-end, and last ...
...tart 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 definition 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, sit amet vulputate nulla pharetra ut.”</p> css p { hanging-punctuation: first ...
height - CSS: Cascading Style Sheets
eyword 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 formula with 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...
...tanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | w3c understanding wcag 2.0 formal definition 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 to auto. a percentage height on the root element is relative to the initial containing block.computed valuea percentage or auto or the absolute lengthanimation typea length, percentage or calc(); formal syntax auto | <length> | <percentage> | min-content | max-content | fit-content...
image-rendering - CSS: Cascading Style Sheets
t in its other properties, and to its descendants. the user agent will scale an image when the page author specifies dimensions other than its natural size. scaling may also occur due to user interaction (zooming). for example, if the natural size of an 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 (...
...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 definition 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 solution for pixelated through manual image data manipulation or with imagesmoothingen...
image() - CSS: Cascading Style Sheets
the image() css function defines an <image> in a similar fashion to the <url> function, but with added functionality including specifying the image's directionality, specifying fallback images for when the preferred image is not supported, displaying just a part of that image defined by a media fragment, and specifying a solid color as a fallback in case none of the
specified images are able to be rendered. disambiguation: image(), the htmlimageelement constructor. syntax image( <image-tags>? [ <image-src>? , <color>? ]! )where <image-tags> = ltr | rtl<image-src> = <url> | <string><color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / ...
...f not understood, and won't break the source call when used with url(). if the browser doesn't understand the media fragments notation, it simply ignores the fragment, displaying the entire image. browsers that understand image() also understand the fragment notation. therefore, if the fragment is not understood within image(), the image will be considered invalid. color fallback if a color is
specified in image() along with your image sources, it acts as a fallback if the images are invalid and do not appear. in such cases, the image() function renders as if no image were included, generating a solid-color image. as a use case, consider a dark image being used as a background for some white text. a dark background color may be needed for foreground text to be legible, if the image does not rend...
ime-mode - CSS: Cascading Style Sheets
plemented 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 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 i...
...ion 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 definition 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 type="text" name="name" value="initial value" style="ime-mode: disabled"> not...
list-style-position - CSS: Cascading Style Sheets
s 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. ...
...sition: 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. ...
list-style-type - CSS: Cascading Style Sheets
alue a <string> value the keyword none. 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 value of a @counter-style or one of the predefined styles: symbols() defines an anonymous style of the list. <string> the
specified string 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 b...
...he bug fix and that list items are not improperly described. ...
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. accessibility concerns safari has an issue whereby unorder...
...anations understanding success criterion 1.3.1 | w3c understanding wcag 2.0 formal definition initial valueas each of the properties of the shorthand:list-style-type: disclist-style-position: outsidelist-style-image: noneapplies tolist itemsinheritedyescomputed valueas each of the properties of the shorthand:list-style-image: none or the image with its uri made absolutelist-style-position: as
specifiedlist-style-type: as
specifiedanimation typediscrete formal syntax <'list-style-type'> | <'list-style-position'> | <'list-style-image'> examples setting list style type and position html list 1 <ul class="one"> <li>list item1</li> <li>list item2</li> <li>list item3</li> </ul> list 2 <ul class="two"> <li>list item a</li> <li>list item b</li> <li>list item c</li> </ul> css .one {...
margin-bottom - CSS: Cascading Style Sheets
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. formal definition initial value0applies toall elements, except elem...
... to the width of the containing block. auto the browser selects a suitable value to use. see margin. formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table. ...
margin-right - CSS: Cascading Style Sheets
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 space, as determined mainly by the layout mode that is used. if the ...
...this case, it is evenly distributed to all horizontal auto margins. flexbox layout mode formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table. ...
margin-top - CSS: Cascading Style Sheets
placed 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 definition initial value0applies toall elements, except elem...
... to the width of the containing block. auto the browser selects a suitable value to use. see margin. formal definition initial value0applies toall elements, except elements with table display types other than table-caption, table and inline-table. ...
mask-border-repeat - CSS: Cascading Style Sheets
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 to fill the gap between each border. repeat the source image's edge regions are t...
...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 definition 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 to define how the border mask slice will repeat around the border — i.e. will it just repeat, or be scaled slightly so a whole number of slices fits, or be stretched so one slic...
mask-clip - CSS: Cascading Style Sheets
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 is clipped to the object bounding box. stroke-box the painted content is clipped to the stroke bounding box. view-box uses the nearest svg viewport as reference box. 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. no-clip the painted content is not clipped. border this keyword behaves the same as border-box. padding this keyword behaves the same as ...
...es 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. ...
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 luminan...
... 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. ...
mask-type - CSS: Cascading Style Sheets
pplies to the <mask> element itself. /* keyword values */ mask-type: luminance; mask-type: alpha; /* global values */ mask-type: inherit; mask-type: initial; mask-type: unset; this property may be overridden by the mask-mode property, which has the same effect but applies to the element where the mask is used. alpha masks will generally be faster to render. syntax the mask-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. formal definition initial valuelumi...
...inance 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. ...
mask - CSS: Cascading Style Sheets
e: automask-composite: addapplies toall elements; in svg, it applies to container elements excluding the defs element and all graphics elementsinheritednopercentagesas each of the properties of the shorthand:mask-position: refer to size of mask painting area minus size of mask layer image (see the text for background-position)computed valueas each of the properties of the shorthand:mask-image: as
specified, but with <url> values made absolutemask-mode: as
specifiedmask-repeat: consists of two keywords, one per dimensionmask-position: consists of two keywords representing the origin and two offsets from that origin, each given as an absolute length (if given a <length>), otherwise as a percentage.mask-clip: as
specifiedmask-origin: as
specifiedmask-size: as
specified, but with relative lengths conve...
...e: as
specifiedmask-repeat: consists of two keywords, one per dimensionmask-position: consists of two keywords representing the origin and two offsets from that origin, each given as an absolute length (if given a <length>), otherwise as a percentage.mask-clip: as
specifiedmask-origin: as
specifiedmask-size: as
specified, but with relative lengths converted into absolute lengthsmask-composite: as
specifiedanimation typeas each of the properties of the shorthand:mask-image: discretemask-mode: discretemask-repeat: discretemask-position: repeatable list of simple list of length, percentage, or calcmask-clip: discretemask-origin: discretemask-size: repeatable list of simple list of length, percentage, or calcmask-composite: discretecreates stacking contextyes formal syntax <mask-layer>#where <mask-la...
max-block-size - CSS: Cascading Style Sheets
the max-block-size css property specifies the maximum size of an element in the direction opposite that of the writing direction as
specified by writing-mode. that is, if the writing direction is horizontal, then max-block-size is equivalent to max-height; if the writing direction is vertical, max-block-size is the same as max-width. the other dimension's maximum length is
specified using the max-inline-size property. this is useful because the max-width is always used for horizontal sizes and max-height is always used for vertical sizes, and if you need to set lengths based on the size of your text content, you need to be able to do so with the writing direction in mind. any time you would normally use max-height or max-width, you should instead use max-block-size to set the maximum "height" o...
...x-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 size of the box. max-content the intrinsic preferred max-width. min-content the intrinsic minimum max-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)). how writing-mode affects directionality the values of writing-mode affect t...
offset-rotate - CSS: Cascading Style Sheets
direction of `auto` */ offset-rotate: reverse; /* keep a constant rotation regardless the position on the path */ offset-rotate: 90deg; offset-rotate: .5turn; auto the element is rotated by the angle of the direction of the offset-path, relative to the positive x-axis. this is the default value. ...
...
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. ...
order - CSS: Cascading Style Sheets
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 definition 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 uses as much horizontal space as available. html <header>...</header> <main> <article>article</article> <nav>nav</nav> ...
...th: 200px; order: 1; } main > aside { width: 200px; order: 3; } result specifications specification status comment css flexible box layout modulethe definition of 'order' in that specification. candidate recommendation initial definition initial value0applies toflex items and absolutely-positioned flex container childreninheritednocomputed valueas
specifiedanimation typean integer ...
outline-style - CSS: Cascading Style Sheets
pearance 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 the outline is two single lines. the outline-width is the sum of ...
...e 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 definition 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 rounded edge outline with semi-translucent outer pixels that appears to glow. html ...
outline-width - CSS: Cascading Style Sheets
n/interactive-examples and send us a pull request. it is often more convenient to use the shorthand property outline when defining the appearance of an outline. syntax /* keyword values */ outline-width: thin; outline-width: medium; outline-width: thick; /* <length> values */ outline-width: 1px; outline-width: 0.1em; /* global values */ outline-width: inherit; the outline-width property is
specified as any one of the values listed below. 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 browser...
...y 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). ...
overflow-inline - CSS: Cascading Style Sheets
r, 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 necessary to fit in the padding box in the inline dimension. browsers displa...
...anges.) 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. ...
overflow-x - 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 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 in the padding box. no scrollbars are provided. clip like f...
...es.) 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. ...
overflow-y - 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 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 vertically in the padding box. no scrollbars are provided. clip ...
...es.) 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. ...
overscroll-behavior-block - CSS: Cascading Style Sheets
y 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 neighbouring scrolling areas, e.g. underlying elements will not scroll. none no scroll chaining occurs to ne...
...ounce" 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 definition 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 box has a small width (and height) set on it so it sits comforably inside the viewport, but its content is given a large height so it will al...
overscroll-behavior-inline - CSS: Cascading Style Sheets
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 neighbouring scrolling areas, e.g. underlying elements will not scroll. none no scroll chaining occurs to ne...
...ounce" 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 definition 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 inner box has a small width (and height) set on it so it sits comforably inside the viewport, but its content is given a large width so it will a...
overscroll-behavior-x - CSS: Cascading Style Sheets
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. underlying elements will not scroll. none no scroll chaining occurs to ne...
...ounce" 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 definition 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 outer box has a large width set on it so the page will scroll horizontally. the inner box has a small width (and height) set on it so it sits...
overscroll-behavior-y - CSS: Cascading Style Sheets
avior 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 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...
...ounce" 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 definition 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 vertically .messages { height: 220px; overflow: auto; overscroll-behavior-y: contain; } see overscroll-behavior for a full example and explanation. specifications specification status comment css overscroll behavior module level 1the definit...
overscroll-behavior - CSS: Cascading Style Sheets
scrolling content, once the dialog box's scroll boundary is reached, the underlying page will then start to scroll — this is called scroll chaining. in some cases these behaviors are not desirable. you can use overscroll-behavior to get rid of unwanted scroll chaining and the browser's facebook/twitter app-inspired "pull to refresh"-type behavior. syntax the overscroll-behavior property is
specified as one or two keywords chosen from the list of values below. two keywords specifies the overscroll-behavior value on the x and y axes respectively. if only one value is
specified, both x and y are assumed to have the same value. 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...
...ounce" 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 definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas
specifiedanimation typediscrete formal syntax [ contain | none | auto ]{1,2} examples preventing an underlying element from scrolling in our overscroll-behavior example (see the source code also), we present a full-page list of fake contacts, and a dialog box containing a chat window. both of these areas scroll; normally if you scrolled the chat window until you hit a scroll boundary, the underlyin...
padding-bottom - CSS: Cascading Style Sheets
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 definition initial value0applies toall elements, except table-row-group, t...
...a percentage, relative to the width of the containing block. must be nonnegative. formal definition 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 setting padding bottom with pixels and percentages .content { padding-bottom: 5%; } .sidebox { padding-bottom: 10px; } specifications specification status comment css basic box modelthe definition of 'padding-bottom' in that specification. working draft no change. ...
padding-left - CSS: Cascading Style Sheets
en 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-left: 0.5em; padding-left: 0; padding-left: 2cm; /* <percentage> value */ padding-left: 10%; /* global values */ padding-left: inherit; padding-left: 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 definition initial value0applies toall elements, except table-row-group, t...
...a percentage, relative to the width of the containing block. must be nonnegative. formal definition 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 setting left padding using pixels and percentages .content { padding-left: 5%; } .sidebox { padding-left: 10px; } specifications specification status comment css basic box modelthe definition of 'padding-left' in that specification. working draft no change. ...
padding-right - CSS: Cascading Style Sheets
ontent 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-right: 0.5em; padding-right: 0; padding-right: 2cm; /* <percentage> value */ padding-right: 10%; /* global values */ padding-right: inherit; padding-right: 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 definition initial value0applies toall elements, except table-row-group, t...
...a percentage, relative to the width of the containing block. must be nonnegative. formal definition 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 setting right padding using pixels and percentages .content { padding-right: 5%; } .sidebox { padding-right: 10px; } specifications specification status comment css basic box modelthe definition of 'padding-right' in that specification. working draft no change. ...
padding-top - CSS: Cascading Style Sheets
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-top: 0.5em; padding-top: 0; padding-top: 2cm; /* <percentage> value */ padding-top: 10%; /* global values */ padding-top: inherit; padding-top: 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 definition initial value0applies toall elements, except table-row-group, t...
...a percentage, relative to the width of the containing block. must be nonnegative. formal definition 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 setting top padding using pixels and percentages .content { padding-top: 5%; } .sidebox { padding-top: 10px; } specifications specification status comment css basic box modelthe definition of 'padding-top' in that specification. working draft no change. cs...
place-items - CSS: Cascading Style Sheets
ionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container. ...
...cting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container. ...
<position> - CSS: Cascading Style Sheets
the <position> (or <bg-position>) css data type denotes a two-dimensional coordinate used to set a location relative to an element box. it is used in the background-position and offset-anchor properties. note: the final position described by the <position> value does not need to be inside the element's box. syntax the <position> data type is
specified with one or two keywords, with optional offsets. ...
...tax the <position> data type is
specified with one or two keywords, with optional offsets. the keyword values are center, top, right, bottom, and left. each keyword represents either an edge of the element's box or the center line between two edges. depending on the context, center represents either the center between the left and right edges, or the center between the top and bottom edges. if
specified, an offset can be either a relative <percentage> value or an absolute <length> value. positive values are offset towards the right or the bottom, whichever is appropriate. negative values are offset in the opposite directions. if only a single offset value is
specified, it defines the x-coordinate, with the value for the other axis defaulting to center. /* 1-value syntax */ keyword ...
resize - CSS: Cascading Style Sheets
ed 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 the horizontal direction. vertical the element display...
...orizontally 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 definition 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 override this behavior with the resize property. html <textarea>type some text here.</textarea> css textarea { resize: none; /* disables resizability */ } result using resize w...
scale - CSS: Cascading Style Sheets
of more than 1 make the element grow */ scale: 2; /* values of less than 1 make the element shrink */ scale: 0.5; /* two values */ scale: 2 0.5; /* three values */ scale: 2 0.5 2; values single number value a <number> specifying a scale factor to make the affected element scale by the same factor along both the x and y axes. equivalent to a scale() (2d scaling) function with a single value
specified. two length/percentage values two <number>s 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 sca...
...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. ...
scroll-behavior - CSS: Cascading Style Sheets
gered by the navigation or cssom scrolling apis. 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 that any other scrolls, such as those performed by the user, 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. syntax /* keyword values */ scroll-behavior: auto; scroll-behavior: smooth; /* global values */ scroll-behavior: inherit; scroll-behavior: initial; scroll-behavior: unset; the scroll-behavior property is spe...
...ty 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. ...
scroll-margin-block-end - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. ...
...nd 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. formal definition initial value0applies toall elementsinheritednocomputed valueas
specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-block-end' in that specification. candidate recommendation initial definition ...
scroll-margin-block-start - CSS: Cascading Style Sheets
the scroll-margin-block-start property defines the margin of the scroll snap area at the start of the block dimension 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. 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 */ scroll-margin-block-start: 10px; scroll-margin-block-start: 1em; /* global values */ scroll-margin-block-start: inherit; scroll-margin-block-start: initial; scroll-margin-b...
...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. formal definition initial value0applies toall elementsinheritednocomputed valueas
specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-block-start' in that specification. candidate recommendation initial definition ...
scroll-margin-bottom - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. ...
...ve-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. formal definition initial value0applies toall elementsinheritednocomputed valueas
specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-bottom' in that specification. candidate recommendation initial definition ...
scroll-margin-inline-end - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. ...
... 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 definition 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 which snap into place, near but not quite at the right of each block. html ...
scroll-margin-inline-start - CSS: Cascading Style Sheets
the scroll-margin-inline-start property defines the margin of the scroll snap area at the start of the inline dimension 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. 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 */ scroll-margin-inline-start: 10px; scroll-margin-inline-start: 1em; /* global values */ scroll-margin-inline-start: inherit; scroll-margin-inline-start: initial; scroll-mar...
...t. 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 definition 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 which snap into place, near but not quite at the left of each block. html t...
scroll-margin-left - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. ...
.../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. formal definition initial value0applies toall elementsinheritednocomputed valueas
specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-left' in that specification. candidate recommendation initial definition ...
scroll-margin-right - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. ...
...ractive-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. formal definition initial value0applies toall elementsinheritednocomputed valueas
specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-right' in that specification. candidate recommendation initial definition ...
scroll-margin-top - CSS: Cascading Style Sheets
the source for this interactive example is stored in a github repository. ...
....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. formal definition initial value0applies toall elementsinheritednocomputed valueas
specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-top' in that specification. candidate recommendation initial definition ...
scroll-margin - CSS: Cascading Style Sheets
<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-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 coor...
...ow much of the page that's primarily outside the snapport should remain visible. thus, the scroll-margin values represent outsets defining the scroll snap area that is used for snapping this box to the snapport. the scroll snap area is determined by taking the transformed border box, finding its rectangular bounding box (axis-aligned in the scroll container’s coordinate space), then adding the
specified outsets. formal definition initial value0applies toall 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 b...
scroll-snap-align - CSS: Cascading Style Sheets
the scroll-snap-align property specifies the box’s snap position as an alignment of its snap area (as the alignment subject) within its snap container’s snapport (as the alignment container). the two 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 snappor...
...tainer'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. formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas
specifiedanimation typediscrete formal syntax [ none | start | end | center ]{1,2} specifications specification status comment css scroll snap module level 1the definition of 'scroll-snap-align' in that specification. candidate recommendation initial definition ...
scrollbar-color - CSS: Cascading Style Sheets
the platform, or a custom scrollbar with light colors. <color> <color> applies the first color to the scrollbar thumb, the second to the scrollbar track. note: user agents must apply any scrollbar-color value set on the root element to the viewport. ...
...essibility 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. ...
scrollbar-width - CSS: Cascading Style Sheets
the scrollbar-width property allows the author to set the maximum thickness of an element’s scrollbars when they are shown. initial valueautoapplies toscrolling boxesinheritednocomputed valueas
specifiedanimation typediscrete syntax /* keyword values */ scrollbar-width: auto; scrollbar-width: thin; scrollbar-width: none; /* global values */ scrollbar-width: inherit; scrollbar-width: initial; scrollbar-width: unset; values <scrollbar-width> defines the width of the scrollbar as a keyword. it must be one of the following values: auto the default scrollbar width for the platform. thin a thin scrollbar width variant on platforms that provide that option, or a thinner scrollbar than the default platform scrollbar width. none no scrollbar sh...
...mpounded on high-resolution screens; thorough testing is advised). mdn understanding wcag, guideline 2.1 explanations mdn understanding wcag, guideline 2.5 explanations understanding success criterion 2.1.1 | w3c understanding wcag 2.1 understanding success criterion 2.5.5 | w3c understanding wcag 2.1 formal definition initial valueautoapplies toscrolling boxesinheritednocomputed valueas
specifiedanimation typediscrete formal syntax auto | thin | none examples sizing overflow scrollbars css .scroller { width: 300px; height: 100px; overflow-y: scroll; scrollbar-width: thin; } html <div class="scroller">veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion daikon amaranth tatsoi tomatillo melon azuki bean garlic. gumbo beet greens corn soko endive gumbo...
table-layout - CSS: Cascading Style Sheets
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. ...
...
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 the table layout were auto, the table would grow to accomodate its contents, despite the
specified width. html <table> <tr><td>ed</td><td>wood</td></tr> <tr><td>albert</td><td>schweitzer</td></tr> <tr><td>jane</td><td>fonda</td></tr> <tr><td>william</td><td>shakespeare</td></tr> </table> css table { table-layout: fixed; width: 120px; border: 1px solid red; } td { border: 1px solid blue; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } result spec...
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 if direction is right-to-left. end the same as right if di...
...ematic for people with cognitive concerns such as dyslexia. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.8 | understanding wcag 2.0 formal definition initial valuestart, or a nameless value that acts as left if direction is ltr, right if direction is rtl if start is not supported by the browser.applies toblock containersinheritedyescomputed valueas
specified, except for the match-parent value which is calculated against its parent's direction value and results in a computed value of either left or rightanimation typediscrete formal syntax start | end | left | right | center | justify | match-parent examples left alignment html <p class="example"> integer elementum massa at nulla placerat varius. suspendisse in libero risus, in interdum mass...
text-combine-upright - CSS: Cascading Style Sheets
-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. ...
...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 definition initial valuenoneapplies tonon-replaced inline elementsinheritedyescomputed value
specified 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="exampletext">平成20年4月16日に</p> css .exampletext { writing-mode: vertical-lr; text...
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 middle. blink the text blinks (alternates between visible and invisible). conformin...
... 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 definition initial valuenoneapplies toall elements. ...
text-emphasis - CSS: Cascading Style Sheets
phasis-style and text-emphasis-color. 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 text-emphasis property is quite different from text-decoration. the text-decoration property does not inherit, and the decoration
specified is applied across the whole element. however, text-emphasis does inherit, which means it is possible to change emphasis marks for descendents. the size of the emphasis symbol, like ruby symbols, is about 50% of the size of the font, and text-emphasis may affect line height when the current leading is not enough for the marks. text-emphasis doesn't reset the value of text-emphasis-position. thi...
...re strings consisting of more than one grapheme cluster. <color> defines the color of the mark. if no color is present, it defaults to currentcolor. formal definition initial valueas each of the properties of the shorthand:text-emphasis-style: nonetext-emphasis-color: currentcolorapplies toall elementsinheritednocomputed valueas each of the properties of the shorthand:text-emphasis-style: as
specifiedtext-emphasis-color: computed coloranimation typeas each of the properties of the shorthand:text-emphasis-color: a colortext-emphasis-style: discrete formal syntax <'text-emphasis-style'> | <'text-emphasis-color'> examples a heading with emphasis shape and color this example draws a heading with triangles used to emphasize each character. css h2 { text-emphasis: triangle #d55; } html <...
text-justify - CSS: Cascading Style Sheets
values none the text justification is turned off. ...
...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 definition initial valueautoapplies toinline-level and table-cell elementsinheritedyescomputed valueas
specifiedanimation typediscrete formal syntax auto | inter-character | inter-word | none examples <p class="none"><code>text-justify: none</code> —<br>lorem ipsum dolor sit amet, consectetur adipiscing elit. nunc ornare maximus vehicula. duis nisi velit, dictum id mauris vitae, lobortis pretium quam. quisque sed nisi pulvinar, consequat justo id, feugiat leo. cras eu elementum dui.</p> <p class="aut...
text-orientation - CSS: Cascading Style Sheets
e 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 keyword causes all characters to be considered as left-to-right: the used...
... 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. formal definition initial valuemixedapplies toall elements, except table row groups, rows, column groups, and columnsinheritedyescomputed valueas
specifiedanimation typediscrete formal syntax mixed | upright | sideways examples html <p>lorem ipsum dolet semper quisquam.</p> css p { writing-mode: vertical-rl; text-orientation: upright; } result specifications specification status comment css writing modes module level 3the definition of 'text-orientation' in that specification. proposed recommendation ...
text-size-adjust - CSS: Cascading Style Sheets
ext inflation algorithm to enlarge the text to make it more readable. when an element containing text uses 100% of the screen's width, the algorithm increases its text size, but without modifying the layout. the text-size-adjust property allows web authors to disable or modify this behavior, as web pages designed with small screens in mind do not need it. syntax 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. formal definition initial valueauto for smartphone browser...
...ue previously set with css. <percentage> enables the browser's inflation algorithm, specifying a percentage value with which to increase the font size. ...
text-transform - CSS: Cascading Style Sheets
heir original case as written in the element's text). a letter is defined as a character that is part of unicode's letter or number general categories ; thus, any punctuation marks or symbols at the beginning of a word are ignored. authors should not expect capitalize to follow language-specific title casing conventions (such as skipping articles in english). the 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 definition, but with some weird cases.) by precisely defining the correct be...
...by. accessibility concerns large sections of text set with a text-transform value of uppercase 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 definition initial valuenoneapplies toall elements. ...
text-underline-offset - CSS: Cascading Style Sheets
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. <percentage> specifies the offset of underlines as a <percentage> of 1 em in the elem...
... 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 definition 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 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; t...
touch-action - CSS: Cascading Style Sheets
ontaining scrolling element). this means that in practice, touch-action is typically applied only to top-level elements which have some custom behavior, without needing to specify touch-action explicitly on any of that element's descendants. after a gesture starts, changes to touch-action will not have any impact on the behavior of the current gesture. syntax the touch-action property may be
specified as either: one of the keywords auto, none, manipulation, or one of the keywords pan-x, pan-left, pan-right, and/or one of the keywords pan-y, pan-up, pan-down, plus optionally the keyword pinch-zoom. values auto enable browser handling of all panning and zooming gestures. none disable browser handling of all panning and zooming gestures. pan-x enable single-finger horizontal panning...
...ent people experiencing low vision conditions from being able to read and understand page content. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | understanding wcag 2.0 formal definition initial valueautoapplies toall elements except: non-replaced inline elements, table rows, row groups, table columns, and column groupsinheritednocomputed valueas
specifiedanimation typediscrete formal syntax auto | none | [ [ pan-x | pan-left | pan-right ] | [ pan-y | pan-up | pan-down ] | pinch-zoom ] | manipulation examples disabling all gestures the most common usage is to disable all gestures on an element (and its non-scrollable descendants) that provides its own dragging and zooming behavior – such as a map or game surface. html <div id="map"></div>...
rotate3d() - 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. in 3d space, rotations have three degrees of liberty, which together describe a single axis of rotation. the axis of rotation is defined by an [x, y, z] vector and pass by the origin (as defined by the transform-origin property). if, as
specified, the vector is not normalized (i.e., if the sum of the square of its three coordinates is not 1), the user agent will normalize it internally. a non-normalizable vector, such as the null vector, [0, 0, 0], will cause the rotation to be ignored, but without invaliding the whole css property. note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative. in oth...
...internally. a non-normalizable vector, such as the null vector, [0, 0, 0], will cause the rotation to be ignored, but without invaliding the whole css property. note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative. in other words, the order in which the rotations are applied impacts the result. syntax the amount of rotation created by rotate3d() is
specified by three <number>s and one <angle>. the <number>s represent the x-, y-, and z-coordinates of the vector denoting the axis of rotation. the <angle> represents the angle of rotation; if positive, the movement will be clockwise; if negative, it will be counter-clockwise. rotate3d(x, y, z, a) values x is a <number> describing the x-coordinate of the vector denoting the axis of rotation which c...
scale() - CSS: Cascading Style Sheets
the element is preserved (this is a homothetic transformation). when a coordinate value is outside the [-1, 1] range, the element grows along that dimension; when inside, it shrinks. if it is negative, the result a point reflection in that dimension. a value of 1 has no effect. note: the scale() function only scales in 2d. to scale in 3d, use scale3d() instead. syntax the scale() function is
specified with either one or two values, which represent the amount of scaling to be applied in each direction. scale(sx) scale(sx, sy) values sx a <number> representing the abscissa of the scaling vector. sy a <number> representing the ordinate of the scaling vector. if not defined, its default value is sx, resulting in a uniform scaling that preserves the element's aspect ratio. cart...
...atic for accessibility, as they are a common trigger for certain types of migraine. if you need to include such animations on your website, you should provide a control to allow users to turn 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. find out more: mdn understanding wcag, guideline 2.3 explanations understanding success criterion 2.3.3 | w3c understanding wcag 2.1 examples scaling the x and y dimensions together html <div>normal</div> <div class="scaled">scaled</div> css div { width: 80px; height: 80px; background-color: skyblue; } .scaled { transform: scale(0.7); /* equal to ...
transition-delay - CSS: Cascading Style Sheets
nsition effect for the given length of time. a negative value will begin the transition effect immediately, and partway through the effect. in other words, the effect will be animated as if it had already been running for the given length of time. you may specify multiple delays, which is useful when transitioning multiple properties. each delay will be applied to the corresponding property as
specified by the transition-property property, which acts as a master list. if there are fewer delays
specified than in the master list, the list of delay values will be repeated until there are enough. if there are more delays, the list of delay values will be truncated to match the number of properties. in both cases, the css declaration remains valid. syntax /* <time> values */ transition-delay: 3s; t...
...sition-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. ...
transition-duration - CSS: Cascading Style Sheets
lete. by default, the value is 0s, meaning that no animation will occur. 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 may specify multiple durations; each duration will be applied to the corresponding property as
specified by the transition-property property, which acts as a master list. if there are fewer durations
specified than in the master 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. syntax /* <time> values */ transition-duration: 6s; transition-duration: 120ms; transition-duration...
...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. ...
vertical-align - CSS: Cascading Style Sheets
align: sub; vertical-align: super; vertical-align: text-top; vertical-align: text-bottom; vertical-align: middle; vertical-align: top; vertical-align: bottom; /* <length> values */ vertical-align: 10em; vertical-align: 4px; /* <percentage> values */ vertical-align: 20%; /* global values */ vertical-align: inherit; vertical-align: initial; vertical-align: unset; the vertical-align property is
specified as one of the values listed below. 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 specification, meaning that their behavior with this keyword may vary ...
...ns the bottom padding edge of the cell with the bottom of the row. negative values are allowed. formal definition initial valuebaselineapplies toinline-level and table-cell elements. ...
white-space - CSS: Cascading Style Sheets
end 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) within the source. pre sequences of white space are preserved. li...
...ve nowrap collapse collapse no wrap remove pre preserve preserve no wrap preserve pre-wrap preserve preserve wrap hang pre-line preserve collapse wrap remove break-spaces preserve preserve wrap wrap formal definition initial valuenormalapplies toall elementsinheritedyescomputed valueas
specifiedanimation typediscrete formal syntax normal | pre | nowrap | pre-wrap | pre-line | break-spaces examples basic example code { white-space: pre; } line breaks inside <pre> elements pre { word-wrap: break-word; /* ie 5.5-7 */ white-space: pre-wrap; /* modern browsers */ } in action html <div id="css-code" class="box"> p { white-space: <select> <option>normal</optio...
width - CSS: Cascading Style Sheets
om/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 element. max-content the intrinsic preferred width. mi...
...min(max-content, max(min-content, <length-percentage>)). ...
word-break - CSS: Cascading Style Sheets
y. 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 behavior is the same as for normal. break-word has the sa...
...-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). formal definition initial valuenormalapplies toall elementsinheritedyescomputed valueas
specifiedanimation typediscrete formal syntax normal | break-all | keep-all | break-word examples html <p>1. <code>word-break: normal</code></p> <p class="normal narrow">this is a long and honorificabilitudinitatibus califragilisticexpialidocious taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu グレートブリテンおよび北アイルランド連合王国と...
writing-mode - CSS: Cascading Style Sheets
el 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. for rtl scripts, content flows horizontally from right to left. t...
... 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. formal definition initial valuehorizontal-tbapplies toall elements except table row groups, table column groups, table rows, and table columnsinheritedyescomputed valueas
specifiedanimation typediscrete formal syntax horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr examples using multiple writing modes this example demonstrates all of the writing modes, showing each with text in various languages. html the html is a <table> with each writing mode in a row with a column showing text in various scripts using that writing mode. <table> <tr> <...
z-index - CSS: Cascading Style Sheets
roperty 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 establishes a local stacking context in which its stack level is 0...
...ent'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. ...
Audio and Video Delivery - Developer guides
seek to 122 seconds mediaelement.played.end(0); // returns the number of seconds the browser has played specifying playback range when specifying the uri of media for an <audio> or <video> element, you can optionally include additional information to specify the portion of the media to play. to do this, append a hash mark ("#") followed by the media fragment description. a time range is
specified using the syntax: #t=[starttime][,endtime] the time can be
specified as a number of seconds (as a floating-point value) or as an hours/minutes/seconds time separated with colons (such as 2:05:01 for 2 hours, 5 minutes, and 1 second). a few examples: http://example.com/video.ogv#t=10,20 specifies that the video should play the range 10 seconds through 20 seconds. http://example.com/video.o...
... detecting when no sources have loaded to detect that all child <source> elements have failed to load, check the value of the media element's networkstate attribute. if this is htmlmediaelement.network_no_source, you know that all the sources failed to load. if at that point you add another source, by inserting a new <source> element as a child of the media element, gecko attempts to load the
specified resource. showing fallback content when no source could be decoded another way to show the fallback content of a video, when none of the sources could be decoded in the current browser, is to add an error handler on the last source element. then you can replace the video with its fallback content: <video controls> <source src="dynamicsearch.mp4" type="video/mp4"></source> <a href="dynamics...
Localizations and character encodings - Developer guides
mes the text below refers to canonical names of encodings. the canonical names are the values to the right of the equals sign in unixcharset.properties. specifying the fallback encoding as of firefox 28, this section is obsolete, since the preference intl.charset.default no longer exists. the mapping from locales onto fallback encodings is now built into gecko itself. the fallback encoding is
specified by the preference intl.charset.default in intl.properties. it should be set to the canonical name of the legacy encoding that users of the localizations are most likely to encounter when browsing non-conforming legacy web content that doesn't declare its encoding. note that the fallback encoding as defined by the previous sentence does not necessarily need to be able to represent the characters n...
... best not to change the fallback encoding even if it doesn't follow the guidance given above. (for example, the fallback encoding for the polish, hungarian and czech locales should probably continue to be iso-8859-2 even though ie has a different fallback encoding.) when in doubt, use windows-1252 as the fallback encoding. specifying the heuristic detection mode the heuristic detection mode is
specified by the preference intl.charset.detector in intl.properties. the setting must be left blank for all locales other than russian, ukrainian and japanese. do not under any circumstances specify the "universal" detector. it is not actually universal despite its name! exception for minority languages if the localization is for minority language and the users are typically literate in the majority lan...
The HTML autocomplete attribute - HTML: Hypertext Markup Language
purposes. perhaps the browser offers the ability to save encrypted credit card information, for autocompletion following an authentication procedure. if an <input>, <select> or <textarea> element has no autocomplete attribute, then browsers use the autocomplete attribute of the element's form owner, which is either the <form> element that the element is a descendant of, or the <form> whose id is
specified by the form attribute of the element. for more information, see the autocomplete attribute in <form>. in order to provide autocompletion, user-agents might require <input>/<select>/<textarea> elements to: have a name and/or id attribute be descendants of a <form> element the form to have a submit button values "off" the browser is not permitted to automatically enter or select a va...
...he year in which the payment method expires. "cc-csc" the security code for the payment instrument; on credit cards, this is the 3-digit verification number on the back of the card. "cc-type" the type of payment instrument (such as "visa" or "master card"). "transaction-currency" the currency in which the transaction is to take place. "transaction-amount" the amount, given in the currency
specified by "transaction-currency", of the transaction, for a payment form. "language" a preferred language, given as a valid bcp 47 language tag. "bday" a birth date, as a full date. "bday-day" the day of the month of a birth date. "bday-month" the month of the year of a birth date. "bday-year" the year of a birth date. "sex" a gender identity (such as "female", "fa'afafine", "male"), as free...
HTML attribute: max - HTML: Hypertext Markup Language
the max attribute defines the maximum value that is acceptable and valid for the input containing the attribute. if the value of the element is greater than this, the element fails constraint validation. this value must be greater than or equal to the value of the min attribute. if the max attribute is present by is not
specified or is invalid, no max value is applied. if the max attribute is valid and a non-empty value is greater than the maximum allowed by the max attribute, constraint validation will prevent form submission. valid for the numeric input types, including the date, month, week, time, datetime-local, number and range types, and both the <progress> and <meter> elements, the max attribute is a number that specifies the most positive value a form control to be considered valid...
...rflow for more information. for the<progress> element, the max attribute describes how much work the task indicated by the progress element requires. if present, must have a value greater than zero and be a valid floating point number. for the <meter> element, the max attribute defines the upper numeric bound of the measured range. this must be greater than the minimum value (min attribute), if
specified. in both cases, if omitted, the value defaults to 1. syntax for max values for other elements input type syntax example <progress> <number> <progress id="file" max="100" value="70"> 70% </progress> <meter> <number> <meter id="fuel" min="0" max="100" low="33" high="66" optimum="80" value="40"> at 40/100</meter> ...
HTML attribute: minlength - HTML: Hypertext Markup Language
this value must be less than or equal to the value of maxlength, otherwise the value will never be valid, as it is impossible to meet both criteria. ...
...this value must be less than or equal to the value of maxlength, otherwise the value will never be valid, as it is impossible to meet both criteria. ...
HTML attribute: pattern - HTML: Hypertext Markup Language
the pattern attribute specifies a regular expression the form control's value should match. if a non-null value doesn't conform to the constraints set by the pattern value, the validitystate object's read-only patternmismatch property will be true. the pattern attribute is an attribute of the text, tel, email, url, password, and search input types. the pattern attribute, when
specified, is a regular expression which the input's value must match in order for the value to pass constraint validation. it must be a valid javascript regular expression, as used by the regexp type, and as documented in our guide on regular expressions; the 'u' flag is
specified when compiling the regular expression, so that the pattern is treated as a sequence of unicode code points, instead of as ascii. no fo...
...the input's value must match in order for the value to pass constraint validation. it must be a valid javascript regular expression, as used by the regexp type, and as documented in our guide on regular expressions; the 'u' flag is
specified when compiling the regular expression, so that the pattern is treated as a sequence of unicode code points, instead of as ascii. no forward slashes should be
specified around the pattern text. if the
specified pattern is not
specified or is invalid, no regular expression is applied and this attribute is ignored. tip: use the title attribute to specify text that most browsers will display as a tooltip to explain what the requirements are to match the pattern. you should also include other explanatory text nearby. some of the input types supporting the patt...
HTML attribute: readonly - HTML: Hypertext Markup Language
the readonly attribute is supported by text, search, url, tel, email, password, date, month, week, time, 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. ...
...isabled and readonly is that read-only controls can still function and are still focusable, whereas disabled controls can not receive focus and are not submitted with the form and generally do not function as controls until they are enabled. because a read-only field cannot have it's value changed by a user interaction, required does not have any effect on inputs with the readonly attribute also
specified. the only way to modify dynamically the value of the readonly attribute is through a script. note: the required attribute is not permitted on inputs with the readonly attribute
specified. usability browsers display the readonly attribute... constraint validation if the element is readonly, then the element's value can not be updated by the user, and does not participate in constraint vali...
HTML attribute: size - HTML: Hypertext Markup Language
if css targets the element with properties impacting the width, css takes precedence. the size attribute has no impact on constraint validation. ...
...if css targets the element with properties impacting the width, css takes precedence. the size attribute has no impact on constraint validation. ...
<area> - HTML: Hypertext Markup Language
lay on browsers that do not display images. the text should be phrased so that it presents the user with the same kind of choice as the image would offer when displayed without the alternative text. this attribute is required only if the href attribute is used. coords a set of values specifying the coordinates of the hot-spot region. the number and meaning of the values depend upon the value
specified for the shape attribute. rect or rectangle: the value is two x,y pairs: left, top, right, bottom. circle: the value is x,y,r where x,y is a pair specifying the center of the circle and r is a value for the radius. poly or polygon: the value is a set of x,y pairs for each point in the polygon: x1,y1,x2,y2,x3,y3, and so on. the values are numbers of css pixels. download this attribut...
... the background). typically used for tracking. referrerpolicy a string indicating which referrer to use when fetching the resource: "no-referrer" meaning that the referer: header will not be sent. "no-referrer-when-downgrade" meaning that no referer: header will be sent when navigating to an origin without tls (https). this is a user agent’s default behavior, if no policy is otherwise
specified. "origin" meaning that the referrer will be the origin of the page, that is roughly the scheme, the host and the port. "origin-when-cross-origin" meaning that navigations to other origins will be limited to the scheme, the host and the port, while navigations on the same origin will include the referrer's path. "unsafe-url" meaning that the referrer will include the origin and the path (bu...
<base>: The Document Base URL element - HTML: Hypertext Markup Language
tag omission there must be no closing tag. permitted parents a <head> that doesn't contain another <base> element. implicit aria role no corresponding role permitted aria roles no role permitted dom interface htmlbaseelement attributes this element's attributes include the global attributes. if either of the following attributes are
specified, this element must come before other elements with attribute values of urls, such as <link>’s href attribute. href the base url to be used throughout the document for relative urls. absolute and relative urls are allowed. target a keyword or author-defined name of the default browsing context to show the results of navigation from <a>, <area>, or <form> elements without explicit target a...
... recommendation added the target attribute ...
<input type="button"> - HTML: Hypertext Markup Language
click events occur on the button. adding keyboard shortcuts to buttons keyboard shortcuts, also known as access keys and keyboard equivalents, let the user trigger a button using a key or combination of keys on the keyboard. to add a keyboard shortcut to a button — just as you would with any <input> for which it makes sense — you use the accesskey global attribute. in this example, s is
specified as the access key (you'll need to press s plus the particular modifier keys for your browser/os combination; see accesskey for a useful list of those). <form> <input type="button" value="start machine" accesskey="s"> </form> <p>the machine is stopped.</p> const button = document.queryselector('input'); const paragraph = document.queryselector('p'); button.addeventlistener('click', update...
...e after two seconds. hidden code 1 <input type="button" value="enabled"> const button = document.queryselector('input'); button.addeventlistener('click', disablebutton); function disablebutton() { button.disabled = true; button.value = 'disabled'; window.settimeout(function() { button.disabled = false; button.value = 'enabled'; }, 2000); } if the disabled attribute isn't
specified, the button inherits its disabled state from its parent element. this makes it possible to enable and disable groups of elements all at once by enclosing them in a container such as a <fieldset> element, and then setting disabled on the container. the example below shows this in action. this is very similar to the previous example, except that the disabled attribute is set on the <fieldset> when...
<input type="week"> - HTML: Hypertext Markup Language
raint validation max the latest (time-wise) year and week number, in the string format discussed in the value section above, to accept. if the value entered into the element exceeds this, the element fails constraint validation. if the value of the max attribute isn't a valid week string, then the element has no maximum value. this value must be greater than or equal to the year and week
specified by the min attribute. min the earliest year and week to accept. if the value of the element is less than this, the element fails constraint validation. if a value is
specified for min that isn't a valid week string, the input has no minimum value. this value must be less than or equal to the value of the max attribute. readonly a boolean attribute which, if present, means this field cannot b...
...be less than or equal to the value of the max attribute. readonly a boolean attribute which, if present, means this field cannot be edited by the user. its value can, however, still be changed by javascript code directly setting the htmlinputelement.value property. note: because a read-only field cannot have a value, required does not have any effect on inputs with the readonly attribute also
specified. step the step attribute is a number that specifies the granularity that the value must adhere to, or the special value any, which is described below. only values which are equal to the basis for stepping (min if
specified, value otherwise, and an appropriate default value if neither of those is provided) are valid. a string value of any means that no stepping is implied, and any value is all...
<marquee>: The Marquee element (Obsolete) - HTML: Hypertext Markup Language
the html <marquee> element is used to insert a scrolling area of text. you can control what happens when the text reaches the edges of its content area using its attributes. dom interface htmlmarqueeelement attributes behavior sets how the text is scrolled within the marquee. possible values are scroll, slide and alternate. if no value is
specified, the default value is scroll. bgcolor sets the background color through color name or hexadecimal value. direction sets the direction of the scrolling within the marquee. possible values are left, right, up and down. if no value is
specified, the default value is left. height sets the height in pixels or percentage value. hspace sets the horizontal margin loop sets the number of times the marquee will scroll. if no va...
... sets the background color through color name or hexadecimal value. direction sets the direction of the scrolling within the marquee. possible values are left, right, up and down. if no value is
specified, the default value is left. height sets the height in pixels or percentage value. hspace sets the horizontal margin loop sets the number of times the marquee will scroll. if no value is
specified, the default value is −1, which means the marquee will scroll continuously. scrollamount sets the amount of scrolling at each interval in pixels. the default value is 6. scrolldelay sets the interval between each scroll movement in milliseconds. the default value is 85. note that any value smaller than 60 is ignored and the value 60 is used instead, unless truespeed is
specified. truespeed...
<object> - HTML: Hypertext Markup Language
ated list of uris for archives of resources for the object. borderdeprecated since html4.01obsolete since html5 the width of a border around the control, in pixels. classidhtml 4 onlyobsolete since html5 the uri of the object's implementation. it can be used together with, or in place of, the data attribute. codebasehtml 4 onlyobsolete since html5 the base path used to resolve relative uris
specified by classid, data, or archive. if not
specified, the default is the base uri of the current document. codetypehtml 4 onlyobsolete since html5 the content type of the data
specified by classid. data the address of the resource as a valid url. at least one of data and type must be defined. declarehtml 4 onlyobsolete since html5 the presence of this boolean attribute makes this element a declar...
...o percentages) name the name of valid browsing context (html5), or the name of the control (html 4). standbyhtml 4 onlyobsolete since html5 a message that the browser can show while loading the object's implementation and data. tabindexhtml 4 onlyobsolete since html5 the position of the element in the tabbing navigation order for the current document. type the content type of the resource
specified by data. at least one of data and type must be defined. typemustmatchhtml5 this boolean attribute indicates if the type attribute and the actual content type of the resource must match to be used. usemap a hash-name reference to a <map> element; that is a '#' followed by the value of a name of a map element. width the width of the display resource, in css pixels. -- (absolute values only. n...
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
ntent is aligned to the right of the cell. justify (with text only): the content is stretched out inside the cell so that it covers its entire width. char (with text only): the content is aligned to a character inside the <th> element with minimal offset. this character is defined by the char and charoff attributes unimplemented (see bug 2212). the default value when this attribute is not
specified is left. note: to achieve the same effect as the left, center, right or justify values, apply the css text-align property to the element. to achieve the same effect as the char value, give the text-align property the same value you would use for the char. unimplemented in css3. axis this attribute contains a list of space-separated strings. each string is the id of a group of c...
...redefined color kewords can also be used. to achieve a similar effect, use the css background-color property. char the content in the cell element is aligned to a character. typical values include a period (.) to align numbers or monetary values. if align is not set to char, this attribute is ignored. charoff this attribute is used to shift column data to the right of the character
specified by the char attribute. its value specifies the length of this shift. height this attribute is used to define a recommended cell height. use the css height property instead. scope this enumerated attribute defines the cells that the header (defined in the <th>) element relates to. only use this attribute with the <th> element to define the row or column for which it is a header. valign ...
itemprop - HTML: Hypertext Markup Language
each name-value pair is called a property, and a group of one or more properties forms an item. property values are either a string or a url and can be associated with a very wide range of elements including <audio>, <embed>, <iframe>, <img>, <link>, <object>, <source> , <track>, and <video>. examples the example below shows the source for a set of elements marked up with itemprop attributes, followed by a table showing the resulting structured data. ...
... if the element is a data element the value is the value of the element's value attribute if the element is a meter element the value is the value of the element's value attribute if the element is a time element the value is the element's datetime value otherwise the value is the element's textcontent. if a property's value is a url, the property must be
specified using a url property element. the url property elements are the a, area, audio, embed, iframe, img, link, object, source, track, and video elements. name order names are unordered relative to each other, but if a particular name has multiple values, they do have a relative order. in the following example, the "a" property has the values "1" and "2", in that order, but whether the "a" property ...
itemscope - HTML: Hypertext Markup Language
ibute for an element creates a new item, which results in a number of name-value pairs that are associated with the element. a related attribute, itemtype, is used to specify the valid url of a vocabulary (such as schema.org) that describes the item and its properties context. in each of the following examples, the vocabulary is from schema.org. every html element may have an itemscope attribute
specified. an itemscope element that does not have an associated itemtype must have an associated itemref. note: find more about itemtype attributes at http://schema.org/thing simple example html the following example specifies the itemscope attribute. the example specifies the itemtype as "http://schema.org/movie", and specifies three related itemprop attributes. <div itemscope itemtype="http://sch...
...tem. a global identifier allows the item to relate to other items found on pages across the web. example there are four itemscope attributes in the following example. each itemscope attribute sets the scope of its corresponding itemtype attribute. the itemtypes, recipe, aggregaterating, and nutritioninformation in the following example are part of the schema.org structured data for a recipe, as
specified by the first itemtype, http://schema.org/recipe. <div itemscope itemtype="http://schema.org/recipe"> <h2 itemprop="name">grandma's holiday apple pie</h2> <img itemprop="image" src="https://udn.realityripple.com/samples/60/d063c361c1.jpg" width="50" height="50" /> <p> by <span itemprop="author" itemscope itemtype="http://schema.org/person"> <span itemprop="name">carol smith</span>...
Global attributes - HTML: Hypertext Markup Language
that means that any non-standard elements must still permit these attributes, even though using those elements means that the document is no longer html5-compliant. for example, html5-compliant browsers hide content marked as <foo hidden>...</foo>, even though <foo> is not a valid html element. ...
...editable mode. is allows you to specify that a standard html element should behave like a registered custom built-in element (see using custom elements for more details). note: the item* attributes are part of the whatwg html microdata feature. itemid the unique, global identifier of an item. itemprop used to add properties to an item. every html element may have an itemprop attribute
specified, where an itemprop consists of a name and value pair. itemref properties that are not descendants of an element with the itemscope attribute can be associated with the item using an itemref. it provides a list of element ids (not itemids) with additional properties elsewhere in the document. itemscope itemscope (usually) works along with itemtype to specify that the html contained in a block ...
MIME types (IANA media types) - HTTP
handled. structure of a mime type the simplest mime type consists of a type and a subtype; these are each strings which, when concatenated with a slash (/) between them, comprise a mime type. no whitespace is allowed in a mime type: type/subtype the type represents the general category into which the data type falls, such as video or text. the subtype identifies the exact kind of data of the
specified type the mime type represents. for example, for the mime type text, the subtype might be plain (plain text), html (html source code), or calendar (for icalendar/.ics) files. each type has its own set of possible subtypes, and a mime type always has both a type and a subtype, never just one or the other. an optional parameter can be added to provide additional details: type/subtype;parameter=va...
...as its own set of possible subtypes, and a mime type always has both a type and a subtype, never just one or the other. an optional parameter can be added to provide additional details: type/subtype;parameter=value for example, for any mime type whose main type is text, the optional charset parameter can be used to specify the character set used for the characters in the data. if no charset is
specified, the default is ascii (us-ascii) unless overridden by the user agent's settings. to specify a utf-8 text file, the mime type text/plain;charset=utf-8 is used. mime types are case-insensitive but are traditionally written in lowercase, with the exception of parameter values, whose case may or may not have specific meaning. types there are two classes of type: discrete and multipart. discrete ty...
HTTP caching - HTTP
for more details, see also the freshness section below. cache-control: max-age=31536000 validation when using the "must-revalidate" directive, the cache must verify the status of the stale resources before using it and expired ones should not be used. for more details, see the validation section below. cache-control: must-revalidate the pragma header pragma is a http/1.0 header, it is not
specified for http responses 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 foreve...
...tale resource, it forwards this request with a if-none-match to check if it is in fact still fresh. if so, the server returns a 304 (not modified) header without sending the body of the requested resource, saving some bandwidth. here is an example of this process with a shared cache proxy: the freshness lifetime is calculated based on several headers. if a "cache-control: max-age=n" header is
specified, then the freshness lifetime is equal to n. if this header is not present, which is very often the case, it is checked if an expires header is present. if an expires header exists, then its value minus the value of the date header determines the freshness lifetime. finally, if neither header is present, look for a last-modified header. if this header is present, then the cache's freshness lifetim...
CSP: script-src - HTTP
n").addeventlistener('click', dosomething); unsafe inline script note: disallowing inline styles and inline scripts is one of the biggest security wins csp provides. however, if you absolutely have to use it, there are a few mechanisms that will allow them. to allow inline scripts and inline event handlers, 'unsafe-inline', a nonce-source or a hash-source that matches the inline block can be
specified. content-security-policy: script-src 'unsafe-inline'; the above content security policy will allow inline <script> elements <script> var inline = 1; </script> you can use a nonce-source to only allow specific inline script blocks: content-security-policy: script-src 'nonce-2726c7f26c' you will have to set the same nonce on the <script> element: <script nonce="2726c7f26c"> var inline =...
... 'sha256-b2yphkaxnvfwtrchibabymubfzdvfkkxhbwtwiddvf8=' when generating the hash, don't include the <script> tags and note that capitalization and whitespace matter, including leading or trailing whitespace. <script>var inline = 1;</script> unsafe eval expressions the 'unsafe-eval' source expression controls several script execution methods that create code from strings. ...
CSP: style-src - HTTP
prevented by disallowing javascript via the script-src csp directive. unsafe inline styles note: disallowing inline styles and inline scripts is one of the biggest security wins csp provides. however, if you absolutely have to use it, there are a few mechanisms that will allow them. to allow inline styles, 'unsafe-inline', a nonce-source or a hash-source that matches the inline block can be
specified. content-security-policy: style-src 'unsafe-inline'; the above content security policy will allow inline styles like the <style> element, and the style attribute on any element: <style> #inline-style { background: red; } </style> <div style="display:none">foo</div> you can use a nonce-source to only allow specific inline style blocks: content-security-policy: style-src 'nonce-2726c7f26c' ...
...5d14300262fa4dc5878103ab7347e158f' when generating the hash, don't include the <style> tags and note that capitalization and whitespace matter, including leading or trailing whitespace. <style>#inline-style { background: red; }</style> unsafe style expressions the 'unsafe-eval' source expression controls several style methods that create style declarations from strings. if 'unsafe-eval' isn't
specified with the style-src directive, the following methods are blocked and won't have any effect: cssstylesheet.insertrule() cssgroupingrule.insertrule() cssstyledeclaration.csstext specifications specification status comment content security policy level 3the definition of 'style-src' in that specification. working draft no changes. content security po...
Content-Security-Policy-Report-Only - HTTP
for more information, see also this article on content security policy (csp). header type response header forbidden header name no this header is not supported inside a <meta> element. ...
...runcated to contain just the scheme, host, and port. disposition either "enforce" or "report" depending on whether the content-security-policy header or the content-security-policy-report-only header is used. document-uri the uri of the document in which the violation occurred. effective-directive the directive whose enforcement caused the violation. original-policy the original policy as
specified by the content-security-policy-report-only http header. referrer the referrer of the document in which the violation occurred. script-sample the first 40 characters of the inline script, event handler, or style that caused the violation. status-code the http status code of the resource on which the global object was instantiated. violated-directive the name of the policy section that was ...
Content-Security-Policy - HTTP
gate 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 consist of json documents sent via an http post request to the
specified uri. t...
...er for the request which requested the worker script itself. the exception to this is if the worker script's origin is a globally unique identifier (for example, if its url has a scheme of data or blob). in this case, the worker does inherit the content security policy of the document or worker that created it. multiple content security policies the csp mechanism allows multiple policies being
specified for a resource, including via the content-security-policy header, the content-security-policy-report-only header and a <meta> element. you can use the content-security-policy header more than once, as in the example below. pay special attention to the connect-src directive here. even though the second policy would allow the connection, the first policy contains connect-src 'none'. adding additio...
Public-Key-Pins-Report-Only - HTTP
the header is silently ignored in modern browsers as support for hpkp has been removed. use certificate transparency and the expect-ct header instead. ...
...rmation (spki) fingerprint. it is possible to specify multiple pins for different public keys. some browsers might allow other hashing algorithms than sha-256 in the future. max-age=<expire-time> this directive is meaningless for the public-key-pins-report-only header, it will be ignored by user agents and the header will not be cached. includesubdomains optional if this optional parameter is
specified, this rule applies to all of the site's subdomains as well. report-uri="<uri>" pin validation failures are reported to the given url. this directive should be used with this header, otherwise this header will be a no-op. example public-key-pins-report-only: pin-sha256="cupctazwkaasuywhhnedttwpy3obake3h2+sozs7sws="; pin-sha256="m8hztczm3eluxkcjr2s5p4hhybnf6lhkmjahkhpgpwe="; includesubdo...
Referrer-Policy - HTTP
y: origin referrer-policy: origin-when-cross-origin referrer-policy: same-origin referrer-policy: strict-origin referrer-policy: strict-origin-when-cross-origin referrer-policy: unsafe-url directives no-referrer the referer header will be omitted entirely. no referrer information is sent along with requests. no-referrer-when-downgrade (default) this is the default behavior if no policy is
specified, or if the provided value is invalid. the origin, path, and querystring of the url are sent as a referrer when the protocol security level stays the same (http→http, https→https) or improves (http→https), but isn't sent to less secure destinations (https→http). there is effort from browsers in moving to a stricter default value, namely strict-origin-when-cross-origin (see https://github.
... specifying multiple values is only supported in the referrer-policy http header, and not in the referrerpolicy attribute. specifications specification status referrer policy ed...
Set-Cookie - HTTP
does help satisfying the requirements about which characters are allowed for <cookie-value> though. __secure- prefix: cookies names starting with __secure- (dash is part of the prefix) must be set with the secure flag from a secure page (https). __host- prefix: cookies with names starting with __host- must be set with the secure flag, must be from a secure page (https), must not have a domain
specified (and therefore aren't sent to subdomains) and the path must be /. expires=<date> optional the maximum lifetime of the cookie as an http-date timestamp. see date for the required formatting. if un
specified, the cookie becomes a session cookie. a session finishes when the client shuts down, and session cookies will be removed. warning: many web browsers have a session restore feature ...
... immediately. if both expires and max-age are set, max-age has precedence. domain=<domain-value> optional host to which the cookie will be sent. if omitted, defaults to the host of the current document url, not including subdomains. contrary to earlier specifications, leading dots in domain names (.example.com) are ignored. multiple host/domain values are not allowed, but if a domain is
specified, then subdomains are always included. path=<path-value> optional a path that must exist in the requested url, or the browser won't send the cookie header. the forward slash (/) character is interpreted as a directory separator, and subdirectories will be matched as well: for path=/docs, /docs, /docs/web/, and /docs/web/http will all match. secure optional a secure cookie is only sent to ...
Strict-Transport-Security - HTTP
me no syntax strict-transport-security: max-age=<expire-time> strict-transport-security: max-age=<expire-time>; includesubdomains strict-transport-security: max-age=<expire-time>; preload directives max-age=<expire-time> the time, in seconds, that the browser should remember that a site is only to be accessed using https. includesubdomains optional if this optional parameter is
specified, this rule applies to all of the site's subdomains as well. preload optional see preloading strict transport security for details. not part of the specification. description if a website accepts a connection through http and redirects to https, visitors may initially communicate with the non-encrypted version of the site before being redirected, if, for example, the visitor types http://www.
...now to automatically use only https, which prevents hackers from performing this sort of man-in-the-middle attack. how the browser handles it the first time your site is accessed using https and it returns the strict-transport-security header, the browser records this information, so that future attempts to load the site using http will automatically use https instead. when the expiration time
specified by the strict-transport-security header elapses, the next attempt to load the site via http will proceed as normal instead of automatically using https. whenever the strict-transport-security header is delivered to the browser, it will update the expiration time for that site, so sites can refresh this information and prevent the timeout from expiring. should it be necessary to disable strict tr...
HTTP request methods - HTTP
request methods to indicate the desired action to be performed for a given resource. although they can also be nouns, these request methods are sometimes referred to as http verbs. each of them implements a different semantic, but some common features are shared by a group of them: e.g. a request method can be safe, idempotent, or cacheable. get the get method requests a representation of the
specified resource. requests using get should only retrieve data. head the head method asks for a response identical to that of a get request, but without the response body. post the post method is used to submit an entity to the
specified resource, often causing a change in state or side effects on the server. put the put method replaces all current representations of the target resource with the ...
... connect the connect method establishes a tunnel to the server identified by the target resource. options the options method is used to describe the communication options for the target resource. ...
Protocol upgrade mechanism - HTTP
sing the xmlhttprequest.setrequestheader() method. sec-websocket-key: key key the key for this request to upgrade. the client adds this if it wishes to do so, and the server will include in the response a key of its own, which the client will validate before delivering the upgrade response to you. the server's response's sec-websocket-accept header will have a value computed based upon the
specified key. sec-websocket-protocol the sec-websocket-protocol header specifies one or more websocket protocols that you wish to use, in order of preference. the first one that is supported by the server will be selected and returned by the server in a sec-websocket-protocol header included in the response. you can use this more than once in the header, as well; the result is the same as if you used a ...
... supported on its end. sec-websocket-version: version version the websocket protocol version the client wishes to use when communicating with the server. this number should be the most recent version possible listed in the iana websocket version number registry. the most recent final version of the websocket protocol is version 13. response header if the server can't communicate using the
specified version of the websocket protocol, it will respond with an error (such as 426 upgrade required) that includes in its headers a sec-websocket-version header with a comma-separated list of the supported protocol versions. if the server does support the requested protocol version, no sec-websocket-version header is included in the response. sec-websocket-version: supportedversions supportedversi...
HTTP Public Key Pinning (HPKP) - HTTP
specify multiple pins for different public keys. some browsers might allow other hashing algorithms than sha-256 in the future. see below on how to extract this information out of a certificate or key file. max-age the time, in seconds, that the browser should remember that this site is only to be accessed using one of the defined keys. includesubdomains optional if this optional parameter is
specified, this rule applies to all of the site's subdomains as well. report-uri optional if this optional parameter is
specified, pin validation failures are reported to the given url. note: the current specification requires including a second pin for a backup key which isn't yet used in production. this allows for changing the server's public key without breaking accessibility for clients that have...
...ding to the ietf rfc. this key pinning is also valid for all subdomains, which is told by the includesubdomains declaration. finally, report-uri="https://www.example.net/hpkp-report" explains where to report pin validation failures. report-only header instead of using a public-key-pins header you can also use a public-key-pins-report-only header. this header only sends reports to the report-uri
specified in the header and does still allow browsers to connect to the webserver even if the pinning is violated. setting up your webserver to include the hpkp header the concrete steps necessary to deliver the hpkp header depend on the web server you use. note: these examples use a max-age of two months and include all subdomains. it is advised to verify that this setup will work for your server. ...
HTTP response status codes - HTTP
resource at another uri with same method that was used in the prior request. this has the same semantics as the 302 found http response code, with the exception that the user agent must not change the http method used: if a post was used in the first request, a post must be used in the second request. 308 permanent redirect this means that the resource is now permanently located at another uri,
specified by the location: http response header. this has the same semantics as the 301 moved permanently http response code, with the exception that the user agent must not change the http method used: if a post was used in the first request, a post must be used in the second request. client error responses 400 bad request the server could not understand the request due to invalid syntax. 401 unaut...
...y is larger than limits defined by server; the server might close the connection or return an retry-after header field. 414 uri too long the uri requested by the client is longer than the server is willing to interpret. 415 unsupported media type the media format of the requested data is not supported by the server, so the server is rejecting the request. 416 range not satisfiable the range
specified by the range header field in the request can't be fulfilled; it's possible that the range is outside the size of the target uri's data. 417 expectation failed this response code means the expectation indicated by the expect request header field can't be met by the server. 418 i'm a teapot the server refuses the attempt to brew coffee with a teapot. 421 misdirected request the request was di...
Control flow and error handling - JavaScript
2 because the var x statement within the block is in the same scope as the var x statement before the block. (in c or java, the equivalent code would have outputted 1.) since ecmascript2015, the let and const variable declarations are block-scoped. see the let and const reference pages for more information. conditional statements a conditional statement is a set of commands that executes if a
specified condition is true. javascript supports two conditional statements: if...else and switch. if...else statement use the if statement to execute a statement if a logical condition is true. use the optional else clause to execute a statement if the condition is false. an if statement looks like this: if (condition) { statement_1; } else { statement_2; } here, the condition can be any expressi...
.../ function could throw exception } catch (e) { monthname = 'unknown'; logmyerrors(e); // pass exception object to error handler (i.e. your own function) } the catch block you can use a catch block to handle all exceptions that may be generated in the try block. catch (catchid) { statements } the catch block specifies an identifier (catchid in the preceding syntax) that holds the value
specified by the throw statement. you can use this identifier to get information about the exception that was thrown. javascript creates this identifier when the catch block is entered. the identifier lasts only for the duration of the catch block. once the catch block finishes executing, the identifier no longer exists. for example, the following code throws an exception. when the exception occurs, cont...
Functions - JavaScript
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 working with objects. calling functions defining a function does not execute it. defining it simply names the function and specifies what to do when the function is called. calling the function actually performs the
specified actions with the indicated parameters. for example, if you define the function square, you could call it as follows: square(5); the preceding statement calls the function with an argument of 5. the function executes its statements and returns the value 25. functions must be in scope when they are called, but the function declaration can be hoisted (appear below the call in the code), as in th...
...n inside the isnan function has interesting rules; you may alternatively want to use number.isnan(), as defined in ecmascript 2015, or you can use typeof to determine if the value is not-a-number. parsefloat() the parsefloat() function parses a string argument and returns a floating point number. parseint() the parseint() function parses a string argument and returns an integer of the
specified radix (the base in mathematical numeral systems). decodeuri() the decodeuri() function decodes a uniform resource identifier (uri) previously created by encodeuri or by a similar routine. decodeuricomponent() the decodeuricomponent() method decodes a uniform resource identifier (uri) component previously created by encodeuricomponent or by a similar routine. encodeuri() the enco...
Indexed collections - JavaScript
the array length and other 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 c...
...some(isnumber)) // logs true let a3 = ['1', '2', '3'] console.log(a3.some(isnumber)) // logs false reduce(callback[, initialvalue]) applies callback(accumulator, currentvalue[, currentindex[, array]]) for each value in the array for the purpose of reducing the list of items down to a single value. the reduce function returns the final value returned by callback function. if initialvalue is
specified, then callback is called with initialvalue as the first parameter value and the value of the first item in the array as the second parameter value. if initialvalue is not
specified, then callback's first two parameter values will be the first and second elements of the array. on every subsequent call, the first parameter's value will be whatever callback returned on the previous call, and the ...
Numbers and dates - JavaScript
740991) number.max_safe_integer maximum safe integer in javascript (+253 − 1, or +9007199254740991) methods of number method description number.parsefloat() parses a string argument and returns a floating point number. same as the global parsefloat() function. number.parseint() parses a string argument and returns an integer of the
specified radix or base. same as the global parseint() function. number.isfinite() determines whether the passed value is a finite number. number.isinteger() determines whether the passed value is an integer. number.isnan() determines whether the passed value is nan. more robust version of the original global isnan(). number.issafeinteger() determines whe...
...various formats. the following table summarizes the methods of number.prototype. methods of number.prototype method description toexponential() returns a string representing the number in exponential notation. tofixed() returns a string representing the number in fixed-point notation. toprecision() returns a string representing the number to a
specified precision in fixed-point notation. math object the built-in math object has properties and methods for mathematical constants and functions. for example, the math object's pi property has the value of pi (3.141...), which you would use in an application as math.pi similarly, standard mathematical functions are methods of math. these include trigonometric, logarithmic, exponential, and ...
Regular expression syntax cheatsheet - JavaScript
l() to get all matches. \n where "n" is a positive integer. a back reference to the last substring matching the n parenthetical in the regular expression (counting left parentheses). for example, /apple(,)\sorange\1/ matches "apple, orange," in "apple, orange, cherry, peach". \k<name> a back reference to the last substring matching the named capture group
specified by <name>. for example, /(?<title>\w+), yes \k<title>/ matches "sir, yes sir" in "do you copy? sir, yes sir!". \k is used literally here to indicate the beginning of a back reference to a named capture group. (?<name>x) named capturing group: matches "x" and stores it on the groups property of the returned matches under the name
specified by <name>. the an...
...sc) script_extensions (scx) see also propertyvaluealiases.txt unicodepropertyvalue one of the tokens listed in the values section, below. many values have aliases or shorthand (e.g. the value decimal_number for the general_category property may be written nd, digit, or decimal_number). for most values, the unicodepropertyname part and equals sign may be omitted. if a unicodepropertyname is
specified, the value must correspond to the property type given. note: as there are many properties and values available, we will not describe them exhaustively here but rather provide various examples ...
Working with objects - JavaScript
ld write the following function: function car(make, model, year) { this.make = make; this.model = model; this.year = year; } notice the use of this to assign values to the object's properties based on the values passed to the function. now you can create an object called mycar as follows: var mycar = new car('eagle', 'talon tsi', 1993); this statement creates mycar and assigns it the
specified values for its properties. then the value of mycar.make is the string "eagle", mycar.year is the integer 1993, and so on. you can create any number of car objects by calls to new. for example, var kenscar = new car('nissan', '300zx', 1992); var vpgscar = new car('mazda', 'miata', 1990); an object can have a property that is itself another object. for example, suppose you define an object call...
...name (if defined). for example, if the second <form> tag in a document has a name attribute of "myform", you can refer to the form as document.forms[1] or document.forms["myform"] or document.forms.myform. defining properties for an object type you can add a property to a previously defined object type by using the prototype property. this defines a property that is shared by all objects of the
specified type, rather than by just one instance of the object. the following code adds a color property to all objects of type car, and then assigns a value to the color property of the object car1. car.prototype.color = null; car1.color = 'black'; see the prototype property of the function object in the javascript reference for more information. defining methods a method is a function associated wit...
JavaScript technologies overview - JavaScript
dom core: node, element, documentfragment, document, domimplementation, event, eventtarget, … a less rigorous definition 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 elements. the html dom includes such things as the classname property on html elements, or apis such as document.body. the html specification also defines restrictions on documents; for example, it requires all children of a <ul> element, which represents an unordered list, to be <li> e...
...quires all children of a <ul> element, which represents an unordered list, to be <li> elements, as those represent list items. in general, it also forbids using elements and attributes that aren't defined in a standard. looking for the document object, window object, and the other dom elements? read the dom documentation. other notable apis the settimeout and setinterval functions were first
specified on the window interface in html standard. xmlhttprequest makes it possible to send asynchronous http requests. the css object model abstract css rules as objects. webworkers allows parallel computation. websockets allows low-level bidirectional communication. canvas 2d context is a drawing api for <canvas>. ...
Warning: -file- is being assigned a //# sourceMappingURL, but already has one - JavaScript
javascript sources are often combined and minified to make delivering them from the server more efficient. with source maps, the debugger can map the code being executed to the original source files. ...
... javascript sources are often combined and minified to make delivering them from the server more efficient. with source maps, the debugger can map the code being executed to the original source files. ...
ArrayBuffer.prototype.slice() - JavaScript
urce 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 arraybuffer.slice(begin[, end]) parameters begin zero-based byte index at which to begin slicing. end optional byte index before which to end slicing. ...
...if the computed length of the new arraybuffer would be negative, it is clamped to zero. ...
Boolean.prototype.toString() - JavaScript
description the boolean object overrides the tostring method of the object object; it does not inherit object.prototype.tostring(). for boolean objects, the tostring method returns a string representation of the object. ...
... description the boolean object overrides the tostring method of the object object; it does not inherit object.prototype.tostring(). for boolean objects, the tostring method returns a string representation of the object. ...
Date.prototype.getYear() - JavaScript
because getyear() does not return full years ("year 2000 problem"), it is no longer used and has been replaced by the getfullyear() method. syntax dateobj.getyear() return value a number representing the year of the given date, according to local time, minus 1900. description for years greater than or equal to 2000, the value returned by getyear() is 100 or greater. for example, if the year is 2026, getyear() returns 126. for years between and including 1900 and 1999, the value returned by getyear() is between 0 and 99. for example, if the year is 1976, getyear() returns 76. for years less than 1900, the value returned by getyear() is less than 0. ...
...etween and including 1900 and 1999, the value returned by getyear() is between 0 and 99. for example, if the year is 1976, getyear() returns 76. for years less than 1900, the value returned by getyear() is less than 0. for example, if the year is 1800, getyear() returns -100. to take into account years before and after 2000, you should use getfullyear() instead of getyear() so that the year is
specified in full. backward compatibility behavior in javascript 1.2 and earlier the getyear() method returns either a 2-digit or 4-digit year: for years between and including 1900 and 1999, the value returned by getyear() is the year minus 1900. for example, if the year is 1976, the value returned is 76. for years less than 1900 or greater than 1999, the value returned by getyear() is the four-digi...
Date.prototype.setMonth() - JavaScript
syntax dateobj.setmonth(monthvalue[, dayvalue]) versions prior to javascript 1.3 dateobj.setmonth(monthvalue) parameters monthvalue a zero-based integer representing the month of the year offset from the start of the year. so, 0 represents january, 11 represents december, -1 represents december of the previous year, and 12 represents january of the following year. dayvalue optional. an integer from 1 to 31, representing the day of the month. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. ...
...expected range, setmonth() attempts to update the date information in the date object accordingly. for example, if you use 15 for monthvalue, the year will be incremented by 1, and 3 will be used for month. the current day of month will have an impact on the behaviour of this method. conceptually it will add the number of days given by the current day of the month to the 1st day of the new month
specified as the parameter, to return the new date. for example, if the current value is 31st august 2016, calling setmonth with a value of 1 will return 2nd march 2016. this is because in 2016 february had 29 days. examples using setmonth() var thebigday = new date(); thebigday.setmonth(6); //watch out for end of month transitions var endofmonth = new date(2016, 7, 31); endofmonth.setmonth(1); console...
Error.prototype.toString() - JavaScript
description the error object overrides the object.prototype.tostring() method inherited by all objects. ...
... description the error object overrides the object.prototype.tostring() method inherited by all objects. ...
Intl.DateTimeFormat() constructor - JavaScript
-hour time). possible values are true and false; the default is locale dependent. this option overrides the hc language tag and/or the hourcycle option in case both are present. hourcycle the hour cycle to use. possible values are "h11", "h12", "h23", or "h24". this option overrides the hc language tag, if both are present, and the hour12 option takes precedence in case both options have been
specified. formatmatcher the format matching algorithm to use. possible values are "basic" and "best fit"; the default is "best fit". see the following paragraphs for information about the use of this property. the following properties describe the date-time components to use in formatted output, and their desired representations. implementations are required to support at least the following subse...
...day, hour, minute, second weekday, year, month, day year, month, day year, month month, day hour, minute, second hour, minute implementations may support other subsets, and requests will be negotiated against all available subset-representation combinations to find the best match. two algorithms are available for this negotiation and selected by the formatmatcher property: a fully
specified "basic" algorithm and an implementation-dependent "best fit" algorithm. weekday the representation of the weekday. possible values are: "long" (e.g., thursday) "short" (e.g., thu) "narrow" (e.g., t). two weekdays may have the same narrow style for some locales (e.g. tuesday's narrow style is also t). era the representation of the era. possible values are: "long"...
Object.prototype.hasOwnProperty() - JavaScript
the hasownproperty() method returns a boolean indicating whether the object has the
specified property as its own property (as opposed to inheriting it). 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 obj.hasownproperty(prop) parameters prop the string name or symbol of the property to test. return value a boolean indicating whether or not the object has the
specified property as own property. description all descendents of object inherit the hasownproperty method. ...
...interactive-examples and send us a pull request. syntax obj.hasownproperty(prop) parameters prop the string name or symbol of the property to test. return value a boolean indicating whether or not the object has the
specified property as own property. description all descendents of object inherit the hasownproperty method. this method can be used to determine whether an object has the
specified property as a direct property of that object; unlike the in operator, this method does not check for a property in the object's prototype chain. if an object is an array, hasownproperty method can check whether an index exists. note hasownproperty returns true even if the value of the property is null or undefined. o = new object(); o.propone = null; o.hasownproperty('propone'); // returns t...
Object.prototype.propertyIsEnumerable() - JavaScript
the propertyisenumerable() method returns a boolean indicating whether the
specified property is enumerable and is the object's own 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. syntax obj.propertyisenumerable(prop) parameters prop the name of the property to test. return value a boolean indicating whether the
specified property is enumerable and is the object's own property. description every object has a propertyisenumerable method. ...
...ct, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax obj.propertyisenumerable(prop) parameters prop the name of the property to test. return value a boolean indicating whether the
specified property is enumerable and is the object's own property. description every object has a propertyisenumerable method. this method can determine whether the
specified property in an object can be enumerated by a for...in loop, with the exception of properties inherited through the prototype chain. if the object does not have the
specified property, this method returns false. examples a basic use of propertyisenumerable the following example shows the use of propertyisenumerable on objects and arrays: var o = {}; var a = []; o.prop = 'is enumerable'; a[0] =...
Object.setPrototypeOf() - JavaScript
warning: changing the [[prototype]] of an object is, by the nature of how modern javascript engines optimize property accesses, currently a very slow operation in every browser and javascript engine. in addition, the effects of altering inheritance are subtle and far-flung, and are not limited to simply the time spent in the object.setprototypeof(...) statement, but may extend to any code that has access to any object whose [[prototype]] has been altered. ...
...pers address this issue, if you are concerned about performance, you should avoid setting the [[prototype]] of an object. instead, create a new object with the desired [[prototype]] using object.create(). syntax object.setprototypeof(obj, prototype) parameters obj the object which is to have its prototype set. prototype the object's new prototype (an object or null). return value the
specified object. description throws a typeerror exception if the object whose [[prototype]] is to be modified is non-extensible according to object.isextensible(). does nothing if the prototype parameter isn't an object or null (i.e., number, string, boolean, or undefined). otherwise, this method changes the [[prototype]] of obj to the new value. object.setprototypeof() is in the ecmascript 2015 specif...
Object.prototype.valueOf() - JavaScript
a (unary) plus sign can sometimes be used as a shorthand for valueof, e.g. in +new number()). also see using unary plus. description javascript calls the valueof method to convert an object to a primitive value. ...
... a (unary) plus sign can sometimes be used as a shorthand for valueof, e.g. in +new number()). also see using unary plus. description javascript calls the valueof method to convert an object to a primitive value. ...
Promise.prototype.finally() - JavaScript
the finally() method returns a promise. when the promise is settled, i.e either fulfilled or rejected, the
specified callback function is executed. this provides a way for code to be run whether the promise was fulfilled successfully or rejected once the promise has been dealt with. this helps to avoid duplicating code in both the promise's then() and catch() handlers. syntax p.finally(onfinally); p.finally(function() { // settled (fulfilled or rejected) }); parameters onfinally a function called when the promise is settled. return value returns a promise whose finally handler is set to the
specified function, onfinally. description the finally() method can be useful if you want to do some processing or cleanup once the promise is settled, regardless of its outcome. the finally(...
...ch will be resolved with undefined), promise.resolve(2).finally(() => {}) will be resolved with 2. similarly, unlike promise.reject(3).then(() => {}, () => {}) (which will be fulfilled with undefined), promise.reject(3).finally(() => {}) will be rejected with 3. note: a throw (or returning a rejected promise) in the finally callback will reject the new promise with the rejection reason
specified when calling throw. examples using finally let isloading = true; fetch(myrequest).then(function(response) { var contenttype = response.headers.get("content-type"); if(contenttype && contenttype.includes("application/json")) { return response.json(); } throw new typeerror("oops, we haven't got json!"); }) .then(function(json) { /* process your json further */ }) .c...
Reflect.getPrototypeOf() - 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 reflect.getprototypeof(target) parameters target the target object of which to get the prototype. return value the prototype of the given object. ...
... reflect.getprototypeof(target) parameters target the target object of which to get the prototype. return value the prototype of the given object. if there are no inherited properties, null is returned. exceptions a typeerror, if target is not an object. description the reflect.getprototypeof method returns the prototype (i.e. the value of the internal [[prototype]] property) of the
specified object. examples using reflect.getprototypeof() reflect.getprototypeof({}) // object.prototype reflect.getprototypeof(object.prototype) // null reflect.getprototypeof(object.create(null)) // null compared to object.getprototypeof() // same result for objects object.getprototypeof({}) // object.prototype reflect.getprototypeof({}) // object.prototype // both throw in ...
Reflect.setPrototypeOf() - 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. ...
...set the prototype. prototype the object's new prototype (an object or null). return value a boolean indicating whether or not the prototype was successfully set. exceptions a typeerror, if target is not an object or if prototype is neither an object nor null. description the reflect.setprototypeof method changes the prototype (i.e. the value of the internal [[prototype]] property) of the
specified object. examples using reflect.setprototypeof() reflect.setprototypeof({}, object.prototype) // true // it can change an object's [[prototype]] to null. reflect.setprototypeof({}, null) // true // returns false if target is not extensible. reflect.setprototypeof(object.freeze({}), null) // false // returns false if it cause a prototype chain cycle. let target = {} let proto = object.crea...
RegExp.prototype.exec() - JavaScript
returns a result array, or null. javascript regexp objects are stateful when they have the global or sticky flags set (e.g. /foo/g or /foo/y). they store a lastindex from the previous match. using this internally, exec() can be used to iterate over multiple matches in a string of text (with capture groups), as opposed to getting just the matching strings with string.prototype.match(). a newer function has been proposed to simplify matching multiple parts of a string (with capture groups): string.prototype.matchall(). if you are executing a match simply to find true or false, use regexp.prototype.test() method or string.prototype.search() instead. ...
...tiline indicates if the m flag was used to search across multiple lines. false source the text of the pattern. "quick\s(brown).+?(jumps)" examples finding successive matches if your regular expression uses the "g" flag, you can use the exec() method multiple times to find successive matches in the same string. when you do so, the search starts at the substring of str
specified by the regular expression's lastindex property (test() will also advance the lastindex property). note that the lastindex property will not be reset when searching a different string, it will start its search at its existing lastindex . for example, assume you have this script: let myre = /ab*/g; let str = 'abbcdefabh'; let myarray; while ((myarray = myre.exec(str)) !== null) { let msg = 'fo...
Set.prototype.has() - JavaScript
note: technically speaking, has() uses the samevaluezero algorithm to determine whether the given element is found. ...
... a set object or not. 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.has(value); parameters value the value to test for presence in the set object. return value returns true if an element with the
specified value exists in the set object; otherwise false. note: technically speaking, has() uses the samevaluezero algorithm to determine whether the given element is found. examples using the has method var myset = new set(); myset.add('foo'); myset.has('foo'); // returns true myset.has('bar'); // returns false var set1 = new set(); var obj1 = {'key1': 1}; set1.add(obj1); set1.has(obj1); ...
String.fromCodePoint() - JavaScript
exceptions a rangeerror is thrown if an invalid unicode code point is given (e.g. "rangeerror: nan is not a valid code point"). ...
... of code points. 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 string.fromcodepoint(num1[, ...[, numn]]) parameters num1, ..., numn a sequence of code points. return value a string created by using the
specified sequence of code points. exceptions a rangeerror is thrown if an invalid unicode code point is given (e.g. "rangeerror: nan is not a valid code point"). description this method returns a string (and not a string object). because fromcodepoint() is a static method of string, you must call it as string.fromcodepoint(), rather than as a method of a string object you created. polyfill the ...
String.prototype.indexOf() - JavaScript
returns -1 if the value is not found. 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: for the array method, see array.prototype.indexof(). syntax str.indexof(searchvalue [, fromindex]) parameters searchvalue the string value to search for. ...
...in the latter instance, js seems to be finding an empty string at the end of the searched string. 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 of a string called stringname is stringname.length - 1. 'blue whale'.indexof('blue') // returns 0 'blue whale'.indexof('blute') // re...
String.prototype.repeat() - JavaScript
exceptions rangeerror: repeat count must be non-negative. ...
...rce 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 +infinity, 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 infinity and not overflow maximum string size. polyfill this method has been added to the ecmascript 2015 specification and may not be available in all javascript implementations yet. however, you can polyfill string.prototype.repeat() with the followi...
String.prototype.substr() - JavaScript
description substr() extracts length characters from a str, counting from the start index. ...
... 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.substr(start[, length]) parameters start the index of the first character to include in the returned substring. length optional. the number of characters to extract. return value a new string containing the
specified part of the given string. description substr() extracts length characters from a str, counting from the start index. if start is a positive number, the index starts counting at the start of the string. its value is capped at str.length. if start is a negative number, the index starts counting from the end of the string. its value is capped at -str.length. note: in microsoft jscript, negati...
Symbol.prototype.toString() - JavaScript
description the symbol object overrides the tostring method of the object object; it does not inherit object.prototype.tostring(). for symbol objects, the tostring method returns a string representation of the object. ...
... description the symbol object overrides the tostring method of the object object; it does not inherit object.prototype.tostring(). for symbol objects, the tostring method returns a string representation of the object. ...
TypedArray.prototype.subarray() - JavaScript
is 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.subarray([begin [,end]]) parameters begin optional element to begin at. the offset is inclusive. the whole array will be included in the new view if this value is not
specified. ...
...tribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax typedarray.subarray([begin [,end]]) parameters begin optional element to begin at. the offset is inclusive. the whole array will be included in the new view if this value is not
specified. end optional element to end at. the offset is exclusive. if not
specified, all elements from the one
specified by begin to the end of the array are included in the new view. return value a new typedarray object. description the range
specified by begin and end is clamped to the valid index range for the current array; if the computed length of the new array would be negative, it's clamped to zero. if either begin or end is negative, it refers to an index from the ...
Uint8ClampedArray() constructor - JavaScript
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). ...
... before being copied into the new array. the length of the new typed array will be same as the length of the typedarray argument. object when called with an object argument, a new typed array is created as if by the typedarray.from() method. buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the
specified arraybuffer. the byteoffset and length 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. examples different ways to create a uint8clampedarray // from a length var uintc8 = new uint8clampedarray(2); uintc8[0] = 42; uintc8[1] = 1337; console.log(uintc8[0]...
WeakMap.prototype.get() - JavaScript
if the key can't be found, undefined is returned. examples using the get method var wm = new weakmap(); wm.set(window, 'foo'); wm.get(window); // returns "foo". wm.get('baz'); // returns undefined. ...
...eakmap 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 wm.get(key); parameters key required. the key of the element to return from the weakmap object. return value the element associated with the
specified key in the weakmap object. if the key can't be found, undefined is returned. examples using the get method var wm = new weakmap(); wm.set(window, 'foo'); wm.get(window); // returns "foo". wm.get('baz'); // returns undefined. specifications specification ecmascript (ecma-262)the definition of 'weakmap.prototype.get' in that specification. ...
WebAssembly.Module.customSections() - JavaScript
ng considered. sectionname the string name of the desired custom section. return value a (possibly empty) array containing arraybuffer copies of the contents of all custom sections matching sectionname. exceptions if module is not a webassembly.module object instance, a typeerror is thrown. description a wasm module is comprised of a sequence of sections. most of these sections are fully
specified and validated by the wasm spec, but modules can also contain custom sections that are ignored and skipped over during validation. (read high level structure for information on section structures, and how normal sections ("known sections") and custom sections are distinguished.) this provides developers with a way to include custom data inside wasm modules for other purposes, for example the name...
...sections ("known sections") and custom sections are distinguished.) this provides developers with a way to include custom data inside wasm modules for other purposes, for example the name custom section, which allows developers to provide names for all the functions and locals in the module (like "symbols" in a native build). note that the webassembly text format currently doesn't have a syntax
specified for adding new custom sections; you can however add a name section to your wasm during conversion from text format over to .wasm. the wast2wasm command available as part of the wabt tool has a --debug-names option — specify this during conversion to get a .wasm with a names custom section, for example: wast2wasm simple-name-section.was -o simple-name-section.wasm --debug-names examples using...
Left shift (<<) - JavaScript
excess bits shifted off to the left are discarded. zero bits are shifted in from the right. for example, 9 << 2 yields 36: . ...
... left. excess bits shifted off to the left are discarded. zero bits are shifted in from the right. 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 a << b description this operator shifts the first operand the
specified number of bits to the left. excess bits shifted off to the left are discarded. zero bits are shifted in from the right. for example, 9 << 2 yields 36: . 9 (base 10): 00000000000000000000000000001001 (base 2) -------------------------------- 9 << 2 (base 10): 00000000000000000000000000100100 (base 2) = 36 (base 10) bitwise shifting any number x to the left by y bits yields...
in operator - JavaScript
examples basic usage the following examples show some uses of the in operator. ...
...b 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 prop in object parameters prop a string or symbol representing a property name or array index (non-symbols will be coerced to strings). object object to check if it (or its prototype chain) contains the property with
specified name (prop). examples basic usage the following examples show some uses of the in operator. // arrays let trees = ['redwood', 'bay', 'cedar', 'oak', 'maple'] 0 in trees // returns true 3 in trees // returns true 6 in trees // returns false 'bay' in trees // returns false (you must specify the index number, not the value at that index) 'length' in trees // returns true...
new operator - JavaScript
stance of the object with new. to define an object type, create a function for the object type that specifies its name and properties. an object can have a property that is itself another object. see the examples below. when the code new foo(...) is executed, the following things happen: a new object is created, inheriting from foo.prototype. the constructor function foo is called with the
specified arguments, and with this bound to the newly created object. new foo is equivalent to new foo(), i.e. if no argument list is
specified, foo is called without arguments. the object (not null, false, 3.1415 or other primitive types) returned by the constructor function becomes the result of the whole new expression. if the constructor function doesn't explicitly return an object, the object created...
...pe of object to be called car, and you want it to have properties for make, model, and year. to do this, you would write the following function: function car(make, model, year) { this.make = make; this.model = model; this.year = year; } now you can create an object called mycar as follows: var mycar = new car('eagle', 'talon tsi', 1993); this statement creates mycar and assigns it the
specified values for its properties. then the value of mycar.make is the string "eagle", mycar.year is the integer 1993, and so on. you can create any number of car objects by calls to new. for example: var kenscar = new car('nissan', '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 = nam...
Strict mode - JavaScript
, or number this; or the global object if called with an undefined or null this. (use call, apply, or bind to specify a particular this.) not only is automatic boxing a performance cost, but exposing the global object in browsers is a security hazard because the global object provides access to functionality that "secure" javascript environments must restrict. ...
... an undefined or null this. (use call, apply, or bind to specify a particular this.) not only is automatic boxing a performance cost, but exposing the global object in browsers is a security hazard because the global object provides access to functionality that "secure" javascript environments must restrict. ...
<maction> - MathML
to specify which child elements are addressed by the action, you can make use of the selection attribute. attributes actiontype the action which specifies what happens for this element. possible values are: statusline: if there is a click on the expression or the reader moves the pointer over it, the message is sent to the browser's status line. the syntax is: <maction actiontype="statusline"> expression message </maction>. ...
... <maction actiontype="toggle" selection="positive-integer" > expression1 expression2 expressionn </maction>. tooltip: when the pointer moves over the expression, a tooltip box with a message is displayed near the expression. the syntax is: <maction actiontype="tooltip"> expression message </maction>. class, id, style provided for use with stylesheets. href used to set a hyperlink to a
specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color and also the fraction line color. you can use #rgb, #rrggbb and html color names. selection the child element which is addressed by the action. the default value is 1, which is the first child element. examples the following example uses the "toggle" actiontype: <math> <ma...
<mfenced> - MathML
eparators (such as commas or semicolons) to an expression. it has been removed from the latest mathml standard and modern browsers no longer support it. use the <mrow> and <mo> elements instead. attributes class, id, style provided for use with stylesheets. close a string for the closing delimiter. the default value is ")" and any white space is trimmed. href used to set a hyperlink to a
specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color and also the fraction line color. you can use #rgb, #rrggbb and html color names. open a string for the opening delimiter. the default value is "(" and any white space is trimmed. separators a sequence of zero or more characters to be used for different separators, optionally...
...parators a sequence of zero or more characters to be used for different separators, optionally divided by white space, which is ignored. the default value is ",". by specifying more than one character, it is possible to set different separators for each argument in the expression. if there are too many separators, all excess is ignored. if there are too few separators in the expression, the last
specified separator is repeated. examples the last separator is repeated (,) sample rendering: rendering in your browser: a b c d e <math> <mfenced open="{" close="}" separators=";;,"> <mi>a</mi> <mi>b</mi> <mi>c</mi> <mi>d</mi> <mi>e</mi> </mfenced> </math> all excess is ignored (,) sample rendering: rendering in your browser: a b c d e <math> <mfenced open="...
<ms> - MathML
the mathml <ms> element represents a string literal meant to be interpreted by programming languages and computer algebra systems. by default, string literals are displayed as enclosed by double quotes ("); by using the lquote and rquote attributes, you can set custom characters to display. note that quotation marks should not be
specified unless they are part of the string literal. the content of an <ms> element is not an ascii string per se, but rather a sequence of characters and <mglyph> and <malignmark> elements. attributes class, id, style provided for use with stylesheets. dir the text direction. possible values are either ltr (left to right) or rtl (right to left). lquote the opening quote character (depends on dir) to enclose the content. the default value is """. href...
...tring per se, but rather a sequence of characters and <mglyph> and <malignmark> elements. attributes class, id, style provided for use with stylesheets. dir the text direction. possible values are either ltr (left to right) or rtl (right to left). lquote the opening quote character (depends on dir) to enclose the content. the default value is """. href used to set a hyperlink to a
specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. mathsize the size of the content. see length for possible values. deprecated values are: small, normal and big. these will be removed in the future. mathvariant this attribute specifies the logical class of the identifier, whi...
<mtable> - MathML
xis (typically the minus sign). baseline: the vertical center of the table aligns on the environment's baseline. bottom: the bottom of the table aligns on the environments baseline. center: see baseline. top: the top of the table aligns on the environments baseline. in addition, values of the align attribute can end with a rownumber (e.g. align="center 3"). this allows you to align the
specified row of the table rather than the whole table. a negative integer value counts rows from the bottom of the table. starting with gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) the interpretation of negative values has been corrected (bug 601436). in gecko 17.0 (firefox 17.0 / thunderbird 17.0 / seamonkey 2.14) the parsing has been updated to treat whitespace correctly. alignmentscope u...
...tal height. false is default. unimplemented equalrows a boolean value indicating whether to force all rows to have the same total height. false is default. frame specifies borders of the entire table. possible values are: none (default), solid and dashed. framespacing specifies additional space added between the table and frame. groupalign unimplemented href used to set a hyperlink to a
specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. unimplemented minlabelspacing a length value specifing the minimum space between a label and the adjacent cell in the row. rowalign specifies the vertical alignment of the cells. multiple values separated by space are allowed a...
MathML documentation index - MathML
mathml is <math>. every valid mathml instance must be wrapped in <math> tags. in addition you must not nest a second <math> element in another, but you can have an arbitrary number of other child elements in it. 12 <menclose> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <menclose> element renders its content inside an enclosing notation
specified by the notation attribute. 13 <merror> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <merror> element is used to display contents as error messages. in firefox this error message is rendered similar to the typical xml error message. note that this error is not thrown when your mathml markup is wrong or not well-formed xml. you will still ...
... mathml reference, mathml:element, mathml:token elements the mathml <ms> element represents a string literal meant to be interpreted by programming languages and computer algebra systems. by default, string literals are displayed as enclosed by double quotes ("); by using the lquote and rquote attributes, you can set custom characters to display. note that quotation marks should not be
specified unless they are part of the string literal. the content of an <ms> element is not an ascii string per se, but rather a sequence of characters and <mglyph> and <malignmark> elements. 28 <mspace> mathml, mathml reference, mathml:element, mathml:token elements the mathml <mspace> element is used to display a blank space, whose size is set by its attributes. 29 <msqrt>...
Autoplay guide for media and Web Audio APIs - Web media technologies
ture policy is set to 'self' (including the single quote characters), indicating that autoplay is permitted as they're hosted on the same domain as the document. you can also specify 'none' to disable autoplay entirely, '*' to allow autoplay from all domains, or one or more specific origins from which media can be automatically played. these origins are separated by space characters. note: the
specified feature policy applies to the document and every <iframe> nested within it, unless those frames include an allow, which sets a new feature policy for that frame and all frames nested within it. when using the allow attribute on an <iframe> to specify a feature policy for that frame and its nested frames, you can also specify the value 'src' to allow autoplay of media only from the same domain a...
...e policy applies to the document and every <iframe> nested within it, unless those frames include an allow, which sets a new feature policy for that frame and all frames nested within it. when using the allow attribute on an <iframe> to specify a feature policy for that frame and its nested frames, you can also specify the value 'src' to allow autoplay of media only from the same domain as that
specified by the frame's src attribute. example: allowing autoplay only from the document's domain to use the feature-policy header to only allow media to autoplay from the document's origin: feature-policy: autoplay 'self' to do the same for an <iframe>: <iframe src="mediaplayer.html" allow="autoplay 'src'"> </iframe> example: allowing autoplay and fullscreen mode adding fullscreen api per...
Image file type and format guide - Web media technologies
compression svg source may be compressed during transit using http compression techniques, or on disk as an .svgz file. licensing ©2018 w3c® (mit, ercim, keio, beihang), all rights reserved. w3c liability, trademark, document use and software licensing rules apply. no known royalty-bearing patents. tiff (tagged image file format) tiff is a...
... as the fact that most tiff images are either uncompressed or use compression algorithms that still leave fairly large files after compression. tiff supports a variety of compression methods, but the most commonly used are the ccitt group 4 (and, for older fax systems, group 3) compression systems used for by fax software, as well as lzw and lossy jpeg compression. every value in a tiff file is
specified using its tag (indicating what kind of information it is, such as the width of the image) and its type (indicating the format the data is stored in), followed by the length of the array of values to assign to that tag (all properties are stored in arrays, even for single values). this allows different data types to be used for the same properties. for example, the width of an image, imagewidth, i...
Media - Progressive web apps (PWAs)
ent: @media print { #nav-area {display: none;} } some common media types are: screen color device display print printed paged media projection projected display all all media (the default) more details there are other ways to specify the media type for a set of rules. the document's markup language might allow the media type to be
specified when the stylesheet is linked to the document. for example, in html, you have the option to specify the media type with a media attribute in the link element. in css, you can use @import at the start of a stylesheet to import another stylesheet from a url, optionally specifying the media type. these are ways of separating styling rules for different media types into different files. for full d...
... challenges move the print-specific style rules to a separate css file. read the @import reference page to find details of how to import the new print-specific css file into your style4.css stylesheet. make the headings turn blue when the mouse pointer is over them. see solutions to these challenges. what next? so far, all the style rules in this tutorial have been
specified in files. the rules and their values are fixed. the next page describes how you can change rules dynamically by using a programming language: javascript. ...
Applying SVG effects to HTML content - SVG: Scalable Vector Graphics
everything else specifies details about the gradient mask itself. applying the svg effect to (x)html is accomplished by assigning the target class defined above to an element, like this: <p class="target" style="background:lime;"> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor...
... </lineargradient> <circle cx="0.25" cy="0.25" r="0.25" id="circle" fill="white"/> <rect x="0.5" y="0.2" width="300" height="100" fill="url(#gradient-1)"/> </mask> </svg> .target { mask: url(#mask-1); } p { width: 300px; border: 1px solid #000; display: inline-block; } note that in the css, the mask is
specified using a url to the id #mask-1, which is the id of the svg mask
specified below it. everything else specifies details about the gradient mask itself. applying the svg effect to (x)html is accomplished by assigning the target class defined above to an element, like this: <p class="target" style="background:lime;"> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam...
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> definitions. ...
...nodd 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> <clippath id="myclip"> <path d="..." /> </clippath> <rect clip-path="url(#myclip)" clip-rule="evenodd" ... /> </g> as a presentation attribute, it also can be used as a property directly inside a css stylesheet usage context categories presentation attribute value nonzer...
href - SVG: Scalable Vector Graphics
ard to its timing properties. specifically, timeevents are dispatched and the animation element can be used as syncbase in an identical fashion to when the url refers to a valid target element. if the href attribute or the deprecated xlink:href attribute is not provided, then the target element will be the immediate 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 definition for this attribute is the smil animation specification. in particular, see smil animation:...
... or not is defined by the host language. if the href attribute is not provided, then the target element will be the immediate parent element of the <discard> element. value <url> default value none animatable no feimage for <feimage>, href defines a url referring to an image resource or to an element. if both, the xlink:href and the href attribute are
specified, the latter overrides the former. value <url> default value none animatable yes image for <image>, href defines a url referring to the image to render. value <url> default value none animatable yes example html, body, svg { height: 100%; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> ...
keyPoints - SVG: Scalable Vector Graphics
if there's a semicolon at the end of the value, optionally followed by white sp...
...es value <number> [; <number>]* ;? default value none animatable no <number> [; <number>] ;? this value defines a semicolon-separated list of floating point values between 0 and 1 and indicates how far along the motion path the object shall move at the moment in time
specified by corresponding keytimes value. the distance is calculated along the path
specified by the path attribute. each progress value in the list corresponds to a value in the keytimes attribute list. if a list of key points is
specified, there must be exactly as many values in the keypoints list as 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 ...
refX - SVG: Scalable Vector Graphics
l for <symbol>, refx defines the x coordinate of the symbol, which is defined by the cumulative effect of the x attribute and any transformations on the <symbol> and its host <use> element. unlike other positioning attributes, refx is interpreted as being in the coordinate system of the symbol contents, after application of the viewbox and preserveaspectratio attributes. ...
...reted as being in the coordinate system of the symbol contents, after application of the viewbox and preserveaspectratio attributes. if the attribute is not
specified, no horizontal adjustment is made, and the left side of the symbol’s rectangular viewport region (regardless of the viewbox coordinate) is positioned at the x coordinate. for backwards compatibility, the behavior when refx is not
specified on a <symbol> element is different from when it is
specified with a value of 0, and therefore different from the behavior when an equivalent attribute is not
specified on a <marker> element. value <length> | left | center | right default value none animatable yes <length-percentage> lengths are interpreted as being in the coordinate system of the mar...
refY - SVG: Scalable Vector Graphics
l for <symbol>, refy defines the y coordinate of the symbol, which is defined by the cumulative effect of the y attribute and any transformations on the <symbol> and its host <use> element. unlike other positioning attributes, refy is interpreted as being in the coordinate system of the symbol contents, after application of the viewbox and preserveaspectratio attributes. ...
...erpreted as being in the coordinate system of the symbol contents, after application of the viewbox and preserveaspectratio attributes. if the attribute is not
specified, no vertical adjustment is made, and the top side of the symbol’s rectangular viewport region (regardless of the viewbox coordinate) is positioned at the y coordinate. for backwards compatibility, the behavior when refy is not
specified on a <symbol> element is different from when it is
specified with a value of 0, and therefore different from the behavior when an equivalent attribute is not
specified on a <marker> element. value <length> | top | center | bottom default value none animatable yes <length-percentage> lengths are interpreted as being in the coordinate system of the mar...
<feComponentTransfer> - SVG: Scalable Vector Graphics
scalable vector graphics (svg) 1.1 (second edition)the definition of '<fecomponenttransfer>' in that specification. recommendation initial definition ...
...="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 definition 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 definition of '<fecomponenttransfer>' in that specification. recommendation initial definition ...
Paths - SVG: Scalable Vector Graphics
the one on wikipedia. there are an infinite 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 dx1 dy1, dx2 dy2, dx dy the last set of coordinates here (x,y) specify where the line should end. the other two are control points. (x1,y1) is the control point for the start of the curve, and (x2,y2) is the control point for the end. the control points essentially describe the slope of the line starting at each point. the bézier function then creates a smooth c...
...and, the first control point is assumed to be a reflection of the one used previously. if the s command doesn't follow another s or c command, then the current position of the cursor is used as the first control point. in this case the result is the same as what the q command would have produced with the same parameters. an example of this syntax is shown below, and in the figure to the left the
specified control points are shown in red, and the inferred control point in blue. <svg width="190" height="160" xmlns="http://www.w3.org/2000/svg"> <path d="m 10 80 c 40 10, 65 10, 95 80 s 150 150, 180 80" stroke="black" fill="transparent"/> </svg> the other type of bézier curve, the quadratic curve called with q, is actually a simpler curve than the cubic one. it requires one control point which d...
Web Components
ch for implementing a web component generally looks something like this: create a class in which you specify your web component functionality, using the ecmascript 2015 class syntax (see classes for more information). register your new custom element using the customelementregistry.define() method, passing it the element name to be defined, the class or function in which its functionality is
specified, and optionally, what element it inherits from. if required, attach a shadow dom to the custom element using element.attachshadow() method. add child elements, event listeners, etc., to the shadow dom using regular dom methods. if required, define an html template using <template> and <slot>. again use regular dom methods to clone the template and attach it to your shadow dom. use your custom ...
...lement within a shadow tree that has a matching part attribute. shadow dom shadowroot represents the root node of a shadow dom subtree. documentorshadowroot a mixin defining features that are available across document and shadow roots. element extensions extensions to the element interface related to shadow dom: the element.attachshadow() method attaches a shadow dom tree to the
specified element. the element.shadowroot property returns the shadow root attached to the
specified element, or null if there is no shadow root attached. relevant node additions additions to the node interface relevant to shadow dom: the node.getrootnode() method returns the context object's root, which optionally includes the shadow root if it is available. the node.isconnected property ret...
Using the WebAssembly JavaScript API - WebAssembly
new uint32array(memory.buffer)[0] = 42; you can then return the same value using: new uint32array(memory.buffer)[0] try this now in your demo — save what you’ve added so far, load it in your browser, then try entering the above two lines in your javascript console. growing memory a memory instance can be grown by calls to memory.prototype.grow(), where again the argument is
specified in units of webassembly pages: memory.grow(1); if a maximum value was supplied upon creation of the memory instance, attempts to grow past this maximum will throw a webassembly.rangeerror exception. the engine takes advantage of this supplied upper-bounds to reserve memory ahead of time, which can make resizing more efficient. note: since an arraybuffer’s bytelength is immutable, after a suc...
...hat this takes two parameters: an object that contains two properties describing the global variable: value: its data type, which can be any data type accepted within webassembly modules — i32, i64, f32, or f64. mutable: a boolean defining whether the value is mutable or not. a value containing the variable's actual value. this can be any value, as long as its type matches the
specified data type. so how do we use this? in the following example we define a global as a mutable i32 type, with a value of 0. the value of the global is then changed, first to 42 using the global.value property, and then to 43 using the incglobal() function exported out of the global.wasm module (this adds 1 to whatever value is given to it and then returns the new value). const output = document.g...
Navigator.mozNotification - Archive of obsolete content
x os. see displaying notifications for an example. the support for this property as been dropped in favor of the standard notification constructor. method overview notification createnotification(in domstring title, in domstring description, in domstring iconurl optional); methods createnotification() creates and returns a notification object that can be used to display the
specified message with an optional url. notification createnotification( in domstring title, in domstring description, in domstring iconurloptional ); parameters title the notification title. description the text to display in the notification. iconurl optional a url identifying the image to display in the notification. return value a new notification object. permissions when using no...
Loading Content Scripts - Archive of obsolete content
e: data.url("my-content-script.js") both contentscript and contentscriptfile accept an array of strings, so you can load multiple scripts, which can also interact directly with each other in the content process: // "data" is supplied by the "self" module var data = require("sdk/self").data; ... contentscriptfile: [data.url("jquery-1.4.2.min.js"), data.url("my-content-script.js")] scripts
specified using contentscriptfile are loaded before those
specified using contentscript. this enables you to load a javascript library like jquery by url, then pass in a simple script inline that can use jquery. unless your content script is extremely simple and consists only of a static string, don't use contentscript: if you do, you may have problems getting your add-on approved on amo. instead, keep ...
context-menu - Archive of obsolete content
u can use it to determine whether your item should be shown. you can both specify declarative contexts and listen for contexts in a content script. your context listener is called even if any declarative contexts are not current (since firefox 36). if you combine selectorcontext and the "context" event, be aware that the node argument passed to the "context" event will not always match the type
specified in selectorcontext. selectorcontext will match if the menu is invoked on the node
specified or any descendant of that node, but the "context" event handler is passed the actual node on which the menu was invoked. the example above works because <img> elements can't contain other elements, but in the example below, node.nodename is not guaranteed to be "p" - for example, it won't be "p" if the us...
system - Archive of obsolete content
on = " + system.version); // host application vendor console.log("vendor = " + system.vendor); // host application profile directory console.log("profile directory = " + system.pathfor("profd")); quit the host application to quit the host application, use the exit() function. var system = require("sdk/system"); system.exit(); globals functions exit(code) quits the host application with the
specified code. if code is omitted, exit() uses the success code 0. to exit with failure use 1. var system = require("sdk/system"); system.exit(); parameters code : integer to exit with failure, set this to 1. to exit with success, omit this argument. pathfor(id) firefox enables you to get the path to certain "special" directories, such as the desktop or the profile directory. this function exposes t...
tabs - Archive of obsolete content
he new page. example var tabs = require("sdk/tabs"); tabs.on('ready', function(tab) { var worker = tab.attach({ contentscript: 'document.body.style.border = "5px solid red";' }); }); parameters options : object optional options: name type contentscriptfile string,array the local file urls of content scripts to load. content scripts
specified by this option are loaded before those
specified by the contentscript option. optional. contentscript string,array a string or an array of strings of code to be evaluated in the context. content scripts
specified by this option are loaded after those
specified by the contentscriptfile option. optional. contentscriptoptions object you can use this op...
url - Archive of obsolete content
e=true&visible=yes#top"); console.log(url.scheme); // https userpass the username:password part of the url, null if not present. host the host of the url, null if not present. for example: var url = require("sdk/url").url("https://developer.mozilla.org/add-ons?example=true&visible=yes#top"); console.log(url.host); // developer.mozilla.org port the port number of the url, null if none was
specified. path the path component of the url. contains everything after the host of the url. compare with pathname. for example: var url = require("sdk/url").url("https://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 = re...
/loader - Archive of obsolete content
ump, 'log: '), info: dump.bind(dump, 'info: '), warn: dump.bind(dump, 'warn: '), error: dump.bind(dump, 'error: ') } } }); evaluate() evaluates code in the supplied sandbox. if options.source is provided then its value is evaluated, otherwise source is read from the supplied uri. either way, any exceptions will be reported as from the uri. optionally more options may be
specified: options.encoding: source encoding, defaults to 'utf-8'. options.line: line number to start count from in stack traces. defaults to 1. options.version: version of js used, defaults to '1.8'. // load script from the given location to a given sandbox: evaluate(sandbox, 'resource://path/to/script.js') // evaluate `code` as if it was from `foo/bar.js`: evaluate(sandbox, 'foo/bar.js', { sour...
content/loader - Archive of obsolete content
ady: function onready() { let frame = self._frame = this.element; self._emit('propertychange', { contenturl: self.contenturl }); } })); }, _onchange: function _onchange(e) { if ('contenturl' in e) this._frame.setattribute('src', this._contenturl); } }); loader properties contentscriptfile the local file urls of content scripts to load. content scripts
specified by this property are loaded before those
specified by the contentscript property. contentscript the texts of content scripts to load. content scripts
specified by this property are loaded after those
specified by the contentscriptfile property. contentscriptwhen when to load the content scripts. this may take one of the following values: "start": load content scripts immediately after the ...
content/worker - Archive of obsolete content
(options) creates a content worker. parameters options : object required options: name type window object the content window to create javascript sandbox for communication with. optional options: name type contentscriptfile string,array the local file urls of content scripts to load. content scripts
specified by this option are loaded before those
specified by the contentscript option. optional. contentscript string,array the texts of content scripts to load. content scripts
specified by this option are loaded after those
specified by the contentscriptfile option. optional. onmessage function functions that will registered as a listener to a 'message' ev...
dev/panel - Archive of obsolete content
otype = extend(panel.prototype, { label: "my panel", tooltip: "...", .... }); in the constructor definition 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 can use the notation "./my-icon.png" as an alias for the url pointing to "data/my-icon.png". mandatory url string a resource:// url pointing to an html file, typically in your add-on's "data" directory. this file contains the specification of the panel's user interface. ...
event/core - Archive of obsolete content
re are also convenient ways to remove registered listeners. all listeners of the specific type can be easily removed (only two argument must be passed): off(target, 'message'); also, removing all registered listeners is possible (only one argument must be passed): off(target); globals functions on(target, type, listener) registers an event listener that is called every time events of the
specified type is emitted on the given event target. parameters target : object event target object. type : string the type of event. listener : function the listener function that processes the event. once(target, type, listener) registers an event listener that is called only once: the next time an event of the
specified type is emitted on the given event target. parameters target : object ev...
loader/sandbox - Archive of obsolete content
you execute code in the given sandbox: evaluate(scope, 'var a = 5;'); evaluate(scope, 'a + 2;'); //=> 7 more details about evaluated script may be passed via optional arguments that may improve exception reporting: // evaluate code as if it was loaded from 'http://foo.com/bar.js' and // start from 2nd line. evaluate(scope, 'a ++', 'http://foo.com/bar.js', 2); version of javascript can be also
specified via an optional argument: evaluate(scope, 'let b = 2;', 'bar.js', 1, '1.5'); // throws cause `let` is not defined in js 1.5. load scripts this module provides a limited api for loading scripts from local urls. data: urls are supported. load(scope, 'resource://path/to/my/script.js'); load(scope, 'file:///path/to/script.js'); load(scope, 'data:,var a = 5;'); globals functions sandbox(source)...
places/bookmarks - Archive of obsolete content
let { search } = require("sdk/places/bookmarks"); search({ query: "firefox" }).on("data", function (item) { // each bookmark item that matches the query will // be called in this function }); arguments bookmark|group|sep...
places/history - Archive of obsolete content
last week // that contain 'javascript' }); globals functions search(queries, options) queries can be performed on history entries by passing in one or more query options. each query option can take several properties, which are and'd together to make one complete query. for additional queries within the query, passing more query options in will or the total results. an options object may be
specified to determine overall settings, like sorting and how many objects should be returned. parameters queries : object|array an object representing a query, or an array of objects representing queries. each query object can take several properties, which are queried against the history database. each property is and'd together, meaning that bookmarks must match each property within a query object. m...
platform/xpcom - Archive of obsolete content
type contract string a contract id. users of xpcom can use this value to retrieve the factory from components.classes: var factory = components.classes['@me.org/request'] var component = factory.createinstance(ci.nsirequest); this parameter is formally optional, but if you don't specify it, users won't be able to retrieve your factory using a contract id. if
specified, the contract id is accessible as the value of the factory's contract property. id string a class id. users of xpcom can use this value to retrieve the factory using components.classesbyid: var factory = components.classesbyid[id]; var component = factory.createinstance(ci.nsirequest); this parameter is optional. if you don't supply it, the factory constructor wi...
test/httpd - Archive of obsolete content
k/test/httpd"); var srv = startserverasync(port, basepath); require("sdk/system/unload").when(function cleanup() { srv.stop(function() { // you should continue execution from this point. }) }); this starts a server in background (assuming you're running this code in an application that has an event loop, such as firefox). the server listens at http://localhost:port/ and serves files from the
specified directory. you can serve static content or use sjs scripts, as described in documentation on developer.mozilla.org. you can also use nshttpserver to start the server manually: var { nshttpserver } = require("sdk/test/httpd"); var srv = new nshttpserver(); // further documentation on developer.mozilla.org see http server for unit tests for general information. ...
ui/toolbar - Archive of obsolete content
unlike a panel, a toolbar: does not overlap with any web content is persistent, remaining visible until the user chooses to close it is a fixed size, and appears in a fixed location usage creating and destroying toolbars you don't specify toolbar content directly: instead, you create other ui components and supply them to the toolbar constructor. ...
util/list - Archive of obsolete content
parameters element1 : object|string|number element2 : object|string|number ... : object|string|number functions addlistitem(list, item) function adds a item to a list. removelistitem(list, item) function removes an item from a list list an ordered collection (also known as a sequence) disallowing duplicate elements. ...
window/utils - Archive of obsolete content
nto private browsing. to learn more about private windows, how to opt into private browsing, and how to support private browsing, refer to the documentation for the private-browsing module. globals functions getmostrecentbrowserwindow() get the topmost browser window, as an nsidomwindow instance. returns nsidomwindow: the topmost browser window. getinnerid(window) returns the id of the
specified window's current inner window. this function wraps nsidomwindowutils.currentinnerwindowid. parameters window : nsidomwindow the window whose inner window we are interested in. returns id: the given window's id. getouterid(window) returns the id of the
specified window's outer window. this function wraps nsidomwindowutils.outerwindowid. parameters window : nsidomwindow the window whose o...
Display a Popup - Archive of obsolete content
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. the add-on consists of seven files: package.json: created when you run jpm init index.js: the main add-on code, that creates the button and panel get-text.js: the content script that interacts with the panel content text-entry.html: the panel content itself,
specified as html icon-16.png, icon-32.png, and icon-64.png: icons for the button in three different sizes the "index.js" looks like this: var data = require("sdk/self").data; // construct a panel, loading its content from the "text-entry.html" // file in the "data" directory, and loading the "get-text.js" script // into it. var text_entry = require("sdk/panel").panel({ contenturl: data.url("text-ent...
Getting started (cfx) - Archive of obsolete content
-o" option: cfx run -o this instructs cfx to use the local copies of the sdk modules, not the ones in firefox. developing without cfx run because cfx run restarts the browser each time you invoke it, it can be a little cumbersome if you are making frequent changes to an add-on. an alternative development model is to use the extension auto-installer add-on: this listens for new xpi files on a
specified port and installs them automatically. that way you can test new changes without needing to restart the browser: make a change to your add-on run cfx xpi post the add-on to the port
specified you could even automate this workflow with a simple script. for example: while true ; do cfx xpi ; wget --post-file=codesy.xpi http://localhost:8888/ ; sleep 5 ; done note that the logging level def...
Modifying the Page Hosted by a Tab - Archive of obsolete content
ch({ contentscript: 'document.body.style.border = "5px solid red";' }); } }); to run this example, save an icon file named "icon-16.png" in add-on's "data" directory. you could download this icon: . this add-on creates a button with mozilla favicon as an icon. it has a click handler which fetches the active tab and loads a script into the page hosted by the active tab. the script is
specified using the contentscript option, and just draws a red border around the page. then open any web page in the browser window, and click the button . you should see a red border appear around the page, like this: keeping content scripts in a separate file in the example above, we've passed in content script as a string. unless script is extremely simple, maintain the script as a separate file i...
Tutorials - Archive of obsolete content
ad use the tabs module to get notified when new web pages are loaded, and access their content. get the list of open tabs use the tabs module to iterate through the currently open tabs, and access their content. modify web pages modify web pages based on url create filters for web pages based on their url: whenever a web page whose url matches the filter is loaded, execute a
specified script in it. modify the active web page dynamically load a script into the currently active web page. development techniques logging log messages to the console for diagnostic purposes. creating reusable modules structure your add-on in separate modules to make it easier to develop, debug, and maintain. create reusable packages containing your modules, so other add-on deve...
Canvas code snippets - Archive of obsolete content
ar strokestyle = canvas2dcontext(canvas) .strokestyle('rgb(50, 110, 210)') .strokestyle(); code usable only from privileged code these snippets are only useful from privileged code, such as extensions or privileged apps. saving a canvas image to a file the following function accepts a canvas object and a destination file path string. the canvas is converted to a png file and saved to the
specified location. the function returns a promise which resolves when the file has been completely saved. function savecanvas(canvas, path, type, options) { return task.spawn(function *() { var reader = new filereader; var blob = yield new promise(accept => canvas.toblob(accept, type, options)); reader.readasarraybuffer(blob); yield new promise(accept => { reader.onlo...
Examples and demos from articles - Archive of obsolete content
what follows is a brief list of examples and demos from our theoretical articles. live demos javascript rich-text editor [zip] how to standardize the creation of complete rich-text editors in web pages. [article] typewriter effect [html] the following example will delete and re-type simulating a typewriter all the text content of the nodelist which match a
specified group of selectors. [article] fade in/out [html] sometimes a page uses dozens and dozens of animations. in such a condition is difficult and unnatural to keep track of all events started and then to stop them when appropriate through the cleartimeout() function. a possible approach to solve this problem is to nest all the informations needed by each animation to start, stop, etc. etc. in different objects and then to create a...
Preferences - Archive of obsolete content
s a value of the wrong type and the preference is not locked, an ns_error_unexpected exception is thrown. if the preference is locked or if there is no value for that preference in the current tree, the get method checks the default tree. if there's a value of the expected type in the default tree, it is returned (with the only exception being that calling getcomplexvalue() with atype parameter
specified as nsipreflocalizedstring, described above). otherwise an ns_error_unexpected exception is thrown. if the branch is from the default tree, the get method doesn't check the tree with current values at all. (this is not exactly how it's coded in libpref, but it's equivalent) where the default values are read from all mozilla-based applications read (application directory)/defaults/preferenc...
Displaying web content in an extension without security issues - Archive of obsolete content
sed that is meant for just that scenario: var target = entry.getelementsbyclassname("description")[0]; var fragment = components.classes["@mozilla.org/feed-unescapehtml;1"] .getservice(components.interfaces.nsiscriptableunescapehtml) .parsefragment(description, false, null, target); target.appendchild(fragment); this will add the html code to the
specified node — minus all the potentially dangerous content. ...
Installing Extensions and Themes From Web Pages - Archive of obsolete content
a green puzzle piece. the icon can be any image format supported by firefox, and should be 32x32 pixels in size. hash the hash property specifies a cryptographic hash of the xpi file contents. this is used to verify the downloaded file, to protect against a corrupted file being served by a mirror download server, for example. you can use any hash function supported by nsicryptohash. the hash is
specified as hash function:hash value, for example, sha1:28857e60d043447c5f4550853f2d40770b326a13. tostring() the tostring() property should return the xpi url, for compatibility with firefox browsers older than version 1.0, and other applications such as seamonkey. themes pretty much everything i've described applies to themes too, except you'll use the installchrome function. because so many sites in...
Chapter 2: Technologies used in developing extensions - Archive of obsolete content
tand in order to develop for firefox. i will assume that you have experience developing with dynamic html, as well as the topics below. for more information on these technologies, please refer to other sources. xml coding css coding basic javascript syntax xml: a text-based structural language extensible markup language (xml) is a meta-language for expressing various kinds of data. it was
specified in 1998 by w3c, the organization that sets standards for web-related technologies. it has a number of useful qualities: it is generic, extensible, and easy to validate as well-formed. some examples of xml-based markup languages include xhtml, which is html redefined on an xml base; svg, for expressing vector images; and mathml, for expressing mathematical formulas. xul, which is used in firefox,...
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
endchild(jsontodom(json, document, {})); jquery templating for extensions which already use jquery, it is possible to use its builtin dom building functions for templating, though care must be taken when passing non-static strings to methods such as .append() and .html(). in most cases, .text() should be used instead of the latter. when using the jquery constructor, only empty tags should be
specified in order to avoid invoking the dom parser. var href = "http://www.google.com/"; var text = "google"; $("body").append( $("<div>", { class: "foo" }) .append($("<a>", { href: href, text: text }) .click(function (event) { alert(event.target.href) })) .append($("<span>").text("foo"))); innerhtml with html escaping this method is a last resort which should b...
Intercepting Page Loads - Archive of obsolete content
is how the tamper data extension and others do it. http notifications are fired for all http requests originating from firefox. they are window-independent, so it is better to keep your observer code in non-chrome objects (your xpcom service or jsm module). otherwise you have to make sure to avoid duplicated work if you have 2 or more windows open. there are 2 http topics you can listen to, as
specified in the observer notifications page: topic description http-on-modify-request called as an http request is made. the channel is available to allow you to modify headers and such. http-on-examine-response called after a response has been received from the webserver. headers are available on the channel. the subject argument on the observe method is the ns...
JavaScript Object Management - Archive of obsolete content
in this case we set the delay to 0, which means the function should be executed as soon as possible. firefox has a minimum delay of 10-15ms (taken from this blog post), so it won't really run instantly. it is more than enough to let the window finish its load. use window.settimeout and window.setinterval to control timed code execution. in case you're using javascript ...
Setting Up a Development Environment - Archive of obsolete content
is is the file that make uses to build the xpi. you should take some time to read it and understand it, or at least identify the parts that you should change to get a project of your own going. this gnu make manual is a very good reference to get to know make and makefiles. in most cases you'll only need to change the first lines in makefile. these define the extension name, the extension id (as
specified in install.rdf) and the name of the profile directory where the extension will be installed during development and testing. more about this further ahead. let's try and build the xpi from the command line first. open the command line program in your system and navigate to the src directory in your project. run the following command: make that's it. if everything went well, you should see a...
The Essentials of an Extension - Archive of obsolete content
is the package name, which we will explain shortly. skin and locale packages have a third value to specify what locale or what skin they are extending. there can be multiple skin and locale entries relating to different skins and locales. the most common case is having one skin entry for the global skin, classic/1.0, and multiple locale entries, one for each translation. finally, the location is
specified. there are some additional options that can be included in the entries of a chrome.manifest file. they are documented in the chrome registration page. notably, we can have entries that are os-specific. this is important because the appearance of the browser is very different for each operating system. if our extension needed to look differently on different systems, we could change the manifest ...
XPCOM Objects - Archive of obsolete content
erface extends another interface. in those cases you just need to replace nsisupports with the interface you're extending. you can also extend from multiple interfaces, by including a comma-separated list of interfaces instead of only one. [scriptable, uuid(bd46f689-6c1d-47d0-bc07-bb52b546b8b5)] the scriptable qualifier says that this component can be accessed from js code. this can also be
specified on a per-method basis, which is something you'll see in some of the interfaces in firefox, but it's not likely you'll have to do it in your own components. the second part defines a uuid for the interface. you must generate a new one for each interface, and you should change it every time the interface changes. in this case you're forced to use uuid, the email address format used for extension id...
Performance best practices in extensions - Archive of obsolete content
dom mutation event listeners are extremely expensive and, once added to a document even briefly, significantly harm its performance. as mutation events are officially deprecated, and there are many alternatives, they should be avoided at all costs. lazily load services the xpcomutils javascript module provides two methods for lazily loading things: definelazygetter() defines a function on a
specified object that acts as a getter which will be created the first time it's used. see examples. definelazyservicegetter() defines a function on a
specified object which acts as a getter for a service. the service isn't obtained until the first time it's used. look through the source for examples. many common services are already cached for you in services.jsm. use asynchronous i/o this cannot be ...
Tabbed browser - Archive of obsolete content
a common feature found in many extensions is to point the user to chrome:// uris in a browser window (for example, help or about information) or external (on-line http(s)://) html documents when the user clicks an extension's button or link. the following code demonstrates how to re-use an existing tab that already displays the desired url/uri. if no such tab exists, a new one is opened with the
specified url/uri. function openandreuseonetabperurl(url) { var wm = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); var browserenumerator = wm.getenumerator("navigator:browser"); // check each browser instance for our url var found = false; while (!found && browserenumerator.hasmoreelements()) { var br...
Search Extension Tutorial (Draft) - Archive of obsolete content
gine_details.url) services.search.removeengine(engine); } } function install() {} function uninstall() {} the complex method requires two files, an xml search description file and a javascript file to register the engine. in non-restartless extensions, the xml search description may instead simply be placed in the searchplugins/ directory in the root of your xpi, as em:unpack is
specified in your install.rdf file. as above, install and uninstall code is only provided for restartless add-ons but can be adapted for traditional add-ons. search.xml <?xml version="1.0" encoding="utf-8"?> <searchplugin xmlns="http://www.mozilla.org/2006/browser/search/"> <shortname>example engine</shortname> <description>example search engine</description> <inputencoding>utf-8</inputencoding...
Adding preferences to an extension - Archive of obsolete content
nformation() method to immediately fetch and display the current information about the stock the extension is configured to monitor. we'll look at the details of how this method works later. the last thing the startup() method does is to call the window.setinterval() dom method to set up a callback that will automatically run our refreshinformation() method every 10 minutes. the interval time is
specified in milliseconds. shutdown() the stockwatcher.shutdown() method deactivates the observer on the preferences. this is also where we would add any other shutdown tasks we need to perform. shutdown: function() { this.prefs.removeobserver("", this); }, observe() the stockwatcher.observe() function is called whenever an event occurs on the preference branch we're watching. for details on how ...
Creating a dynamic status bar extension - Archive of obsolete content
ction, which is responsible for fetching and displaying stock ticker information in the status bar panel. we do this so that upon loading, the stock information is displayed as soon as possible. after doing that, we install an interval routine on the browser window by calling window.setinterval(). this configures our refreshinformation() routine to be called every 10 minutes (the time interval is
specified in milliseconds). refreshinformation() the refreshinformation() function is called whenever we want to update the stock information. it's called whenever the user clicks on the status bar panel, when our extension is first added to a browser window, and by the interval handler to periodically update the display. refreshinformation: function() { var httprequest = null; var fullurl = 'http://qu...
MozOrientation - Archive of obsolete content
upward. in free fall (weightless or falling as a result of a drop), the value remains -1. in weightlessness, all values would be zero when the device is not moving, regardless of orientation, and would only change when being accelerated. in firefox versions 3.6, 4, and 5 gecko utilized mozorientation which was also built to support orientation data but with different apis from the
specified deviceorientationevent. to normalize between the two you can do something like this: function orientationhandler(evt){ // for ff3.6+ if (!evt.gamma && !evt.beta) { evt.gamma = -(evt.x * (180 / math.pi)); evt.beta = -(evt.y * (180 / math.pi)); } // use evt.gamma, evt.beta, and evt.alpha // according to dev.w3.org/geo/api/spec-source-orientation } window.addev...
cert_override.txt - Archive of obsolete content
this file is used by firefox, thunderbird, and other xul-based applications. since there is no way to add easily an exception in a xulrunner 1.9 project, you can open the page in firefox, accept the certificate, then copy the cert_override.txt to the xulrunner application profile. the syntax is described on this web site. example here is an example for a sha1-256 hash algorithm. the key and the website are not valid: # psm certificate override settings file # this is a generated file! do not edit. ...
Defining Cross-Browser Tooltips - Archive of obsolete content
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 definition 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 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 t...
ActiveX Control for Hosting Netscape Plug-ins in IE - Archive of obsolete content
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 may also supply any custom plug-in parameters as additional <param...
How Mozilla finds its configuration files - Archive of obsolete content
try.dat file for its "registry", which contains, amongst other information, a pointer to the directory where the profile is stored (located at common/profiles/profilename/directory. the value contained in this key is a litteral value, no variables (such as %userprofile%/mozprofile) allowed. we chose to point this to the user's home directory (h:\mozilla). the configuration itself is stored in the
specified directory, in a file named prefs.js. this is a readable file of javascript commands. all other files in that directory are dynamically created by mozilla on first start. the of the binary registry file is described here. you may use the following items: a program to convert registry.dat file into a readable (and editable) xml file. usage: ./readmozprofile.pl < registry.dat >registry.xml a prog...
How Thunderbird and Firefox find their configuration files - Archive of obsolete content
the profile is stored (usually located in %appdata%\thunderbird\profiles\profilename). likewise, firefox uses a similar file, located in %appdata%\mozilla\firefox\profiles.ini. the value contained in this key is a litteral value, no variables (such as %userprofile%/mozprofile) allowed. we chose to point this to the user's home directory (h:\thunderbird). the configuration itself is stored in the
specified directory, in a file named prefs.js. this is a readable file of javascript commands. all other files in that directory are dynamically created by mozilla on first start. unlike mozilla's binary registry.dat file, thunderbird's and firefox' profiles.ini file is a readable text file. here is an example of what this may look like: [general] startwithlastprofile=1 [profile0] name=default isrelative...
Automatically Handle Failed Asserts in Debug Builds - Archive of obsolete content
as of 2004-12-8, it is now possible to automatically handle failed asserts in debug builds of mozilla for windows. the handler receives the assert string, and sequentially attempts to match each word in the string (left to right) to registry dword names from hklm\software\mozilla.org\windbgdlg and hkcu\software\mozilla.org\windbgdlg. at the first match, it will take the action
specified by the dword's value. the valid values are: 0x5 automatically ignore 0x4 automatically retry 0x3 automatically abort note that you can also force windbgdlg to prompt, by setting a value of 0xfffffffe. to "comment out" a value, set its value to 0xffffffff. as an example, consider the following failed assertion: assertion: no document: 'mdocument != nsnull', file d:/cvs-1.11.4/mozilla/content/xul/content/src...
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
lugin remove the function npp_getjavaclass from npp_gate.cpp build rename the resulting dll so that the filename starts with "np" and ends with ".dll" (or "32.dll"? 8.3?) and copy it in mozilla's "plugins" folder start mozilla and open about:plugins to verify the plugin is detected open the file "test.html" and begin testing. make sure the mimetypes of your html embed tags match the mimetype
specified in your nprt.rc file and the top of your npp_gate.cpp file version issues if vc++ compiler throws you error c2664 on 'drawtext' function call, you may replace it by 'drawtexta'. in fact, all win32 api functions dealing with character strings can be added an 'a' to the end to avoid unicode cast errors. visual c++ 2008 express don't support c99 standard about int32_t, uint32_t. you have to ad...
Finding the file to modify - Archive of obsolete content
sition in the ui relative to each other, the style layer defines how the widgets look (size, color, style, etc.) and their overall position (alignment), and the behavior layer specifies how the widgets behave and how users can use them to accomplish their goals. mention the localization layer (note: these layers are not completely mutually exclusive. in particular, positioning information can be
specified in both the structure layer and the style layer, and some behavior can be partly defined in the style layer.) we're going to add code to all three ui layers, starting with the structure layer. the structure layer consists of xul files. xul, which is short for xml-based user interface language (and is pronounced like "zool"), is an xml-based language specifically designed for describing applicati...
Creating a Microsummary - Archive of obsolete content
ns="http://www.w3.org/1999/xsl/transform" version="1.0"> <output method="text"/> </transform> </template> </generator> using a simple xslt <template> the xslt processor transforms documents by comparing each xslt <template> element in the transform sheet to a set of nodes in the document. when a <template>'s match attribute matches a node, the processor performs the transformations
specified by the content of the element. this mechanism is powerful, because it lets you traverse the node tree of a document, recursively generating output based on the contents of the document. but for the purposes of generating a microsummary for the spread firefox page, we only need to use a single <template> element that matches the root node of the document and is processed once: <?xml version="1.0...
Drag and Drop Example - Archive of obsolete content
pts: <script src="chrome://global/content/nsdraganddrop.js"/> <script src="chrome://global/content/nstransferable.js"/> <script src="dragboard.js"/> an additional script file dragboard.js is included which will contain the code we will write ourselves. the board will be created using a stack element. we'll use some style properties to set the width and height of the stack. a maximum size is also
specified so that it doesn't resize when new elements are dragged onto it. the board will need to respond to the dragdrop event so that an element is created when the user drags onto it. <stack id="board" style="width:300px; height: 300px; max-width: 300px; max-height: 300px" ondragover="nsdraganddrop.dragover(event, boardobserver)" ondragdrop="nsdraganddrop.drop(event, boardobserver)"...
Drag and Drop - Archive of obsolete content
. getdata(transfer,index) get the data being dragged. the first argument should be an nsitransferable object to hold the data. the second argument, index, should be the index of the item to return. sourcedocument the document where the drag started. sourcenode the dom node where the drag started. isdataflavorsupported(flavor) returns true if the data being dragged contains data of the
specified flavor. next » original document information author(s): neil deakin original document: copyright information: copyright (c) neil deakin ...
Block and Line Layout Cheat Sheet - Archive of obsolete content
d be considered when placing a linebox that contains a block frame. it may be set as a side-effect of calling nsblockframe::shouldapplytopmargin(); once set, shouldapplytopmargin() uses it as a fast-path way to return whether the top margin should apply. if the flag hasn't been set in the block reflow state, then shouldapplytopmargin() will crawl the line list to see if a block frame precedes the
specified frame. if so, the top margin should be applied, and the flag set to cache the result. (if not, the top margin will be applied as a result of the generational margin collapsing logic in nsblockreflowcontext::computecollapsedtopmargin(). in this case, the flag won't be set, so subsequent calls to shouldapplytopmargin() will continue crawl the line list.) this flag is also set in the nsblockreflowst...
Layout System Overview - Archive of obsolete content
on layout is primarily concerned with providing a presentation to an html or xml document. this presentation is typically formatted in accordance with the requirements of the css1 and css2 specifications from the w3c. presentation formatting is also required to provide compatibility with legacy browsers (microsoft internet explorer and netscape navigator 4.x). the decision about when to apply css-
specified formatting and when to apply legacy formatting is controlled by the document's doctype specification. these layout modes are referred to as 'standards' and 'navquirks' modes. (doctype and modes are explained in more detail in article mozilla's doctype sniffing. galley and page presentations: the presentation generally is constrained by the width of the window in which the presentation is to be di...
Repackaging Firefox - Archive of obsolete content
eck the boxes next to each one you want to generate. make sure you have the standard firefox install package in the source directory for each of these. the names of the source installer packages for each platform that are included in your source directory will appear next to each checkbox. the repackager tool will do its work, placing the customized installers into the destination directory you
specified. please remember to obtain permission as described above before distributing your new firefox installer. ...
popChallengeResponse - Archive of obsolete content
ender generalname, -- the name of the sender. key octet string, -- the public key used to encrypt the challenge. this will allow -- the client to find the appropriate key to do the decryption. challenge octet string -- the encryption (under the public key for which the cert. ...
Clipboard - Archive of obsolete content
e clipboard. the api is fairly straightforward; examples can be found here. the api lives in the future and must be imported for use. jetpack.future.import("clipboard"); methods set(contentstringflavorstring) stringwrites data from jetpack to the clipboard. this is the recommended method of copying data to the clipboard. contentthe content to be copied to the clipboard. if no other arguments are
specified, the flavor of the content is assumed to 'plain'.string flavordata type. this is an optional parameter. the only flavors currently implemented are 'plain' (text/unicode) and 'html' (which is html).string"text" here's an example of how to use the method to set the clipboard. jetpack.import.future("clipboard");// in text formatjetpack.clipboard.set("hello world");// in other clipboard get(flavor ...
Clipboard Test - Archive of obsolete content
. the api is fairly straightforward; examples can be found here. this api currently lives in the future and must be imported for use. jetpack.future.import("clipboard"); methods set(contentstringflavorstring)writes data from jetpack to the clipboard. this is the recommended method of copying data to the clipboard. string contentthe content to be copied to the clipboard. if no other arguments are
specified, the flavor of the content is assumed to 'plain'.string flavordata type. this is an optional parameter. the only flavors currently implemented are 'plain' (text/unicode) and 'html' (which is html).string"text" here's an example of how to use the method to set the clipboard. jetpack.import.future("clipboard");// in text formatjetpack.clipboard.set("hello world");// in other clipboard get(flavor ...
Clipboard - Archive of obsolete content
d. the api is fairly straightforward; examples can be found here. this api currently lives in the future and must be imported for use. jetpack.future.import("clipboard"); methods set(contentstringflavorstring)writes data from jetpack to the clipboard. this is the recommended method of copying data to the clipboard. string contentthe content to be copied to the clipboard. if no other arguments are
specified, the flavor of the content is assumed to 'plain'.string flavordata type. this is an optional parameter. the only flavors currently implemented are 'plain' (text/unicode) and 'html' (which is html).string"text" here's an example of how to use the method to set the clipboard. jetpack.import.future("clipboard"); // in text format jetpack.clipboard.set("hello world"); // in other clipboard get(fla...
Menu - Archive of obsolete content
e item's shortcut key while the menu is open. it should be one of the characters that appears in the item's label. on some platforms this character is underlined in the label. type string currently only "separator" is supported. if this property is undefined, the item is a normal menuitem. note that when type == "separator", any other properties (such as label) may be
specified. fancy separators may behave differently on different platforms, however. xulid string the id of the menuitem's backing xul element, exposed for the benefit of advanced developers. menu bar menus jetpack.menu when you need to expose functionality through a menu but no menu in particular, do the right thing by using jetpack.menu, the "jetpack menu." jetpack.me...
Clipboard - Archive of obsolete content
rd. the api is fairly straightforward; examples can be found here. the api currently lives in the future and must be imported for use. jetpack.future.import("clipboard"); methods set(contentstringflavorstring) stringwrites data from jetpack to the clipboard. this is the recommended method of copying data to the clipboard. contentthe content to be copied to the clipboard. if no other arguments are
specified, the flavor of the content is assumed to 'plain'.string flavordata type. this is an optional parameter. the only flavors currently implemented are 'plain' (text/unicode) and 'html' (which is html).string"text" here's an example of how to use the method to set the clipboard. jetpack.import.future("clipboard"); // in text format jetpack.clipboard.set("hello world"); // in other clipboard get(fla...
New Security Model for Web Services - Archive of obsolete content
in the document will result in the rest of the file to be ignored. since the commands only allow access, the order of processing the "allow" commands that were successfully parsed is never significant. allowing web script access to permit scripts to access the resources of this server, use the following command: <wsa:allow type="<request-type>" from ="<uri-prefix>"/> the type of request, if
specified, will be checked against the type of request being requested by the script, such as "soap", "soapv", or "load". types must not contain spaces. specify "any" as the type to permit any requested type of access to resources. the principle uri of the script will be checked for the
specified uri prefix. if "from" is not
specified, then all scripts will be allowed. note: one can also use wild charater...
Configuration - Archive of obsolete content
for include. trayicon indicates that a system tray (notification area) icon should be displayed for the application on windows: yes or no. iconic specifies that the application should be opened in iconic state. currently support only on windows in conjunction with the trayicon, causes the application to open minimized to the system tray: yes or no. launch prism with -webapp [bundle] to load the
specified web profile and install the webapp to your prism profile folder. once the webapp is installed, it can be launched using -webapp [webapp-id] and prism will skip the installation and run the webapp directly. any of the profile parameters can also be passed directly on the command line as well. example here is an example of a webapp.ini profile: [parameters] name=gmail id=google.mail@developer.mozil...
New Skin Notes - Archive of obsolete content
-mmondor 11:54, 26 aug 2005 (pdt) for all that it is worth, i am against setting the 'base' font-size to anything other than 100%, let the user figure out which font-setting is best for him/her on his/her computer, rather than tweak it to what the designer feels is the right size for the designers eye(s). if the designer wants smaller text, tweak his ua's text size off of the base, for 100% page
specified text. and when done, verify that the designer did not break the page with a "normal" font setting, by using a default profile. and no, break in that sense does not mean "font is too big" it means, still useable for the target audience. --callek 12:02, 26 aug 2005 (pdt) the font size isn't the problem, and we indeed shouldn't change it. the menu bar at the right, however, is too large in the new ...
PyDOM - Archive of obsolete content
the event handler could also have used getelementbyid - the point is that both the event handler and top-level script share the same namespace. using python ideally, you just tell mozilla you are using python, and magically you can use python instead of javascript. once you set the script type for a node, it is the default for that node and all children. this ...
RDF Datasource How-To - Archive of obsolete content
.com/". this roots the graph in your content model. the tree tag will be treated as if it has the id attribute with a value http://foo.bar.com/. <template>...</template>. the xul template that is used to build content from the graph. starting with the resource that corresponds to the tree element, http://foo.bar.com/, the graph will be traversed and content will be constructed using the pattern
specified within the template tags. for a complete description of how content is built from rdf, see the xul:template guide. 1 as of this writing, it is not currently possible to implement javascript xpcom components; however, it may soon be possible to do so via xpconnect. update: javascript xpcom should now be possible. contact: chris waterson (waterson@netscape.com) original document information ...
Frequently Asked Questions - Archive of obsolete content
firefox do with this file?". this is either because your browser doesn't support svg (you must have mozilla firefox 1.5 or newer), or because the webpage/server isn't correctly telling mozilla that the file contains svg. for example, webpages that embed svg using the <object> or <embed> tags must have a 'type' attribute assigned with the correct svg mime type of "image/svg+xml". if the mime type
specified is wrong (for example image/svg-xml) mozilla won't recognise it. if that isn't the problem, then it may be that the server hosting the website is misconfigured. for information on configuring servers for svg see this link. why am i asked to install a plug-in to view svg files? this is probably because there is an <embed> or <object> tag in the html page and its 'type' attribute is set to the wr...
File object - Archive of obsolete content
s the original proposal for this object, and a status update from december 1998: http://www.mozilla.org/js/js-file-object.html created by the file constructor: new file(); new file(filename); parameters filename name of the file we want to work with. directories and pipelines are considered special files. pipelines either begin or end with the pipe (|) symbol. description filenames are
specified as strings that have an implementation defined format. use of standard "file:" urls is encouraged. if no argument is supplied to the constructor, the current working directory is the file object that is returned. examples of possible prefix strings are "/" to indicate the unix root directory, "c:" to specify a windows drive letter, and "file:" to indicate a file url. when a file is constructed,...
Using Breakpoints in Venkman - Archive of obsolete content
on as it is possible. future breakpoints are used when you want to stop in a script that has not yet been compiled. the most common use of future breakpoints is to stop in a "top level" script (script that executes outside of any function), or script that executes during the onload event of a page. when a script is loaded that matches the url of a future breakpoint, and has executable code at the
specified line, venkman will automatically set a future breakpoint. except for this distinction, breakpoints in venkman work like breakpoints in most other debuggers. the dots you see in the left margin of the source code view indicate which lines contain executable code, places where a hard breakpoint can be set. setting breakpoints clicking on one of these dots in the source code view will set a breapoi...
copy - Archive of obsolete content
method of file object syntax int copy( filespecobject source, filespecobject dest ) parameters the copy method has the following parameters: source a filespecobject object reprsenting the file to be copied. dest a filespecobject object representing the destination directory. returns an integer error code. for a list of possible values, see return codes. description the destination can be a directory or a filename. ...
execute - Archive of obsolete content
execute method has the following parameters: executablefile a filespecobject representing the local file already on disk to be executed. note that file names are case sensitive. aparameters an optional parameter string that is passed to the executable. (ignored on mac os) returns an integer error code. for a list of possible values, see return codes. description the
specified file is not actually executed until the performinstall method is called. see performinstall for more information about queued commands during the installation process. example f = getfolder("program", "mytexteditor.exe"); err = file.execute(f, "myfile.txt"); // indicates that 'myfile.txt' will be // opened in the editor ...
exists - Archive of obsolete content
method of file object syntax boolean exists( filespecobject target ) parameters the exists method has the following parameters: target a filespecobject representing the file or directory being tested for existence. returns a boolean value specifying whether the file or directory does indeed exist or does not. ...
isDirectory - Archive of obsolete content
method of file object syntax boolean isdirectory ( filespecobject nativefolderpath ); parameters the isdirectory method has the following parameters: nativefolderpath a filespecobject representing the queried directory. ...
modDate - Archive of obsolete content
method of file object syntax double moddate ( filespecobject nativefolderpath ); parameters the moddate method has the following parameters: nativefolderpath a filespecobject representing the queried file. returns a double number representing the date that the file was last modified. ...
remove - Archive of obsolete content
method of file object syntax int remove( filespecobject file ) parameters the remove method has the following parameters: file a filespecobject representing the file to be removed. returns an integer error code. for a list of possible values, see return codes. ...
rename - Archive of obsolete content
method of file object syntax int rename( filespecobject file, string newname ) parameters the rename method has the following parameters: file a filespecobject representing the file to be renamed. newname the new terminal (or leaf) name of the file. returns an integer error code. for a list of possible values, see return codes. ...
compareTo - Archive of obsolete content
method of installversion object syntax compareto ( installversion version); compareto ( string version); compareto ( int major, int minor, int release, int build); parameters the compareto method has the following parameters: maj the major version number. min minor version number. rev revision number. bld build number. version an installversion object or a string representing version information in the format "4.1.2.1234". returns if the versions are the same, this method returns 0. ...
addFile - Archive of obsolete content
pathname in the client 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 deli...
deleteRegisteredFile - Archive of obsolete content
deleteregisteredfile (netscape 6 and mozilla do not currently support this method.) deletes the
specified file and removes its entry from the client version registry. method of install object syntax int deleteregisteredfile (string registryname); parameters the deleteregisteredfile method has the following parameter: registryname the pathname in the client version registry for the file that is to be deleted. returns an integer error code. for a list of possible values, see return codes. description the deleteregisteredfile method deletes the
specified file and removes the file's entry from the client version registry. if the file is currently being used, the name of the file that is to be deleted is saved and netscape 6 attempts to delete it each time it starts up ...
gestalt - Archive of obsolete content
gestalt (macintosh only) retrieves information about the operating environment. method of install object syntax int gestalt ( string selector ); parameters the gestalt method takes the following parameters: selector the selector code for the information you want. returns returns the requested information. the format depends on the select code
specified in the selector parameter. description the gestalt method is a wrapper for the gestalt function of the macintosh toolbox. for information on that function, see inside macintosh: operating system utilities. this method returns null on unix and windows platforms. ...
getComponentFolder - Archive of obsolete content
folder (string registryname); object getcomponentfolder ( string registryname, string subdirectory); parameters the getcomponentfolder method has these parameters: registryname the pathname in the client version registry for the component whose installation directory is to be obtained. subdirectory a string that specifies the name of a subdirectory. if the
specified subdirectory doesn't exist, it is created. this parameter is available in netscape 6 and may be case sensitive (depending on the operating system). returns an object representing the directory in which the component is installed, or null if the component could not be found or if subdirectory refers to a file that already exists. description the getcomponentfolder method to find the location of...
getFolder - Archive of obsolete content
d directories. there are two sets of possible values for this parameter. the first set contains platform-independent locations; the second set contains platform-specific locations. you are encouraged to use the platform-independent locations. see the list in the description section for the two sets of locations. subdirectory a string that specifies the name of a subdirectory. if the
specified subdirectory doesn't exist, it is created. this parameter is available in netscape 6 or later and may be case sensitive (depending on the operating system). localdirspec a filespecobject representing a directory obtained by getcomponentfolder or getfolder. returns a filespecobject representing one of netscape's standard directories, or null in case of error or if subdirectory refe...
getWinProfile - Archive of obsolete content
e. 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 winprofile. this method returns null on unix an...
patch - Archive of obsolete content
for the component 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 va...
getValueNumber - Archive of obsolete content
. method of winreg object syntax number getvaluenumber ( string subkey, string valname); parameters the getvaluestring method has the following parameters: subkey the key path to the appropriate location in the key hierarchy, such as "software\\netscape\\navigator\\mail". valname the name of the value-name/value pair whose value you want. returns number value of the
specified key or null if there's an error, the value is not found, or the value is not a string. ...
Learn XPI Installer Scripting by Example - Archive of obsolete content
tinstall, addfile, and performinstall are all examples of common install object methods)--the install object is implicit; like the window object in regular web page scripts, the install object does not need to be prefixed to the method. initializing the installation all installations must begin with initinstall(). the initinstall() method on the install object creates a new installation for the
specified software and version. in the browser.xpi installation, this function appears at line 20: var err = initinstall("netscape seamonkey", "browser", "6.0.0.2000110807"); if you call a method on the install object before initinstall(), you will get an error. the initinstall method takes the following parameters: the display name of the package, the name of the package as it appears in the client re...
A XUL Bestiary - Archive of obsolete content
nd="window.opendialog('chrome://help/content/help.xul', '_blank', 'chrome,all,dialog=no')" /> in this example, the chrome url is being used to point to a chrome within the package hierarchy of the mozilla application. a help chrome defined in mozilla/bin/chrome/help/ is being invoked from the help menu. note that when no file name is
specified after the chrome directory path, a file name with the same name as the package is assumed. in other words, a chrome url like the global pointer above picks up a file called global.css, and the help pointer above could also be written as chrome://help/content, because the name of the package itself is "help." viewing chromes other than mozilla's there is a special flag you can use to start mozil...
Menus - Archive of obsolete content
d, the menupopup is displayed over top of the window, aligned along the bottom of the help menu label. when a menu command is selected or the menu is cancelled, the menupopup disappears from the screen again. the menu element the menu element is used for the labels on a menubar and for the labels of submenus. for information about submenus, see submenus below. the label for the menu element is
specified using the label attribute. in the example below, the menu has the label 'view'. <menu label="view"> <menupopup> <menuitem label="toolbar"/> <menuitem label="status bar"/> </menupopup> </menu> when the menu is clicked, it opens the menupopup contained within it. for this reason, a menupopup should be placed as a direct child of the menu. the menu can also be opened by using the key...
OpenClose - Archive of obsolete content
function mouseclicked(event) { var panel = document.getelementbyid("some-panel"); panel.openpopup(null, "", event.clientx, event.clienty, false, false); } the openpopupatscreen method a second method, openpopupatscreen, may be used to open up a popup and place it at a specific screen coordinate. in this case, the popup is not anchored to an element and just appears at a specific location
specified by the x and y arguments to this method. void openpopupatscreen(in long x, in long y, in boolean iscontextmenu); the iscontextmenu argument indicates that a context menu is being opened, and functions the same as the corresponding argument for the openpopup method. in the following example, the popup is opened at horizontal positon 100 and vertical position 200: popup.openpopupatscreen(100, 2...
uri - Archive of obsolete content
« xul reference uri type: ? used to specify the variable name for the content. when a rule is evaluated, it scans through each resource in the rdf datasource looking for a match. each resource is placed in the variable
specified in the uri attribute in turn. then, the other rules are evaluated for a match. this attribute should always be present. ...
Notes - Archive of obsolete content
implementing an nsicommandlinehandler on windows may trigger a bug that causes an error message ("windows cannot find the file
specified") to be displayed when opening external links (like from a shortcut or from an external application). deleting the "(default)" values in the following registry keys will fix this: hkey_classes_root\http\shell\open\ddeexec hkey_classes_root\https\shell\open\ddeexec you can also do this from within your xpcom component using windows registry interface. some more links on the matter: a mozillazine post. a blog post. ...
Actions - Archive of obsolete content
the content to generate goes directly inside the action element. this content will be copied for each matching result (though see below for an exception) and inserted into the document. let's look at a simple example first. ...
Additional Template Attributes - Archive of obsolete content
te to display the same structure multiple times but with different starting nodes in each case. the generated content is always inserted into the root node, in this example the listbox, not inside the template. declaring the container and member variables normally, the container and member variables are determined by the template builder automatically. the container or starting node variable is
specified in the <content> tag inside a query, while the member variable is determined by the value of the uri attribute inside the action body. it is also possible to be explicit about the two variables by using two attributes on the <template> element. <template container="?first" member="?item"> the container and member attributes can be used to specify the container and member variables. this isn't p...
Attribute Substitution - Archive of obsolete content
from a binding are evaluated using a much simpler process. the bug is that this code path for bindings doesn't handle the textnode element properly. thus, if you use a variable set in a binding, you must ensure the datasource is loaded before the template is built, or just rebuild the template. another possibilty is to rearrange the rdf such that the values, in this example, the descriptions, are
specified before the containers. this issue is fixed in firefox 3 (mozilla 1.9) and later. « previousnext » ...
Bindings - Archive of obsolete content
<template> <query> ... </query> <rule> <binding subject="?photo" predicate="http://purl.org/dc/elements/1.1/description" object="?description"/> <action> ... </action> </rule> </template> the description triple has been changed to a binding element, but the attributes are the same. this allows a match to occur even if the description is not
specified. note that when bindings are used, the bindings and the action must be enclosed inside a rule element. the template builder examines bindings after the query has generated results. it has already determined, in this example, that three matches have been found. the builder continues by filling in the values for any bindings. they are evaluated in a similar though simpler manner than the triples. t...
Building Trees - Archive of obsolete content
lue, a progress meter or a checkbox is determined by the type attribute on the column the cell is in. for cells in normal columns, you can use the value attribute to store some other value and you can use the view’s getcellvalue() method to retrieve it. naturally, this will retrieve the value after any variables have been substituted. besides the attributes mentioned above, any other attributes
specified on the tree rows and cells are ignored. since no elements are generated, you won’t be able to retrieve the values for them either. thus, the value attribute may be useful to associate an additional value with a row since it will be easier to retrieve. the src attribute may be used to set an image to appear in a cell. for example: <tree id="photoslist" flex="1" datasources="template-guide-photos...
RDF Modifications - Archive of obsolete content
en't added the photo to the container resource. once we do add it to the container with another rdf assertion, the process described above is applied again and this time it may match. there are still two more things to do before a result is accepted as a new match. first, once the builder reaches the content statement, it checks what the container or reference variable is, in this case ?start, as
specified by the uri attribute. the calculated value for the potential new match is 'http://www.xulplanet.com/rdf/myphotos'. the builder looks to see if this resource is being used as the stating point in the template. as it happens, this resource is being used, since it is the value of the ref attribute we've been using in these examples. this would also be the case for any starting points used in recursi...
RDF Query Syntax - Archive of obsolete content
box datasources="http://www.xulplanet.com/ds/sample.rdf" ref="http://www.xulplanet.com/rdf/a"> <template> <query> <content uri="?start"/> <triple subject="?start" predicate="http://www.xulplanet.com/rdf/relateditem" object="?relateditem"/> </query> <rule> ... </rule> </template> </vbox> this query has two statements, each
specified with a different tag. the template won't generate anything yet since we still need to fill in the content to be generated which goes in the missing part inside the rule. however, the template builder will be able to compile the rules and examine them as described earlier. the builder needs to start with a single result as the seed result. this is done with the content tag. it indicates that we ar...
Rule Compilation - Archive of obsolete content
also contains a set of rules which define content to be generated based on various conditions. an attribute substitution syntax, explained later, is used to modify the attributes of elements generated from the template, to correspond with the data for each result. each rule is declared with a rule tag, and you may have more than one. for each result that is generated by the query, the conditions
specified within the rules are scanned, and content is generated when a rule matches. only the first matching rule for each result from the query will apply. for example, the first rule might apply to results that represent books, while the second rule might apply only to results that are magazines. this way, different kinds of output can be created based on the specifics of the result. in many cases, you ...
Simple Query Syntax - Archive of obsolete content
icates with specific values. for instance, you may filter results that have a certain category or country. you can only filter on predicates pointing out of the member resource. that is, you cannot filter on predicates pointing into the member resource nor can you cannot filter based on predicates pointing out of other resources. for that, you need to use the full syntax. the triples to check are
specified using attributes on the rule element (thus, a rule element should be used). the namespace of the attribute and the attribute name combine to form the predicate you wish to filter by and the value of the attribute will be the value to filter by. any results that match the criteria are accepted and any that do not match are rejected. you can use multiple attributes to filter by several criteria. in...
textbox (Toolkit autocomplete) - Archive of obsolete content
eadonly type: boolean if set to true, then the user cannot change the value of the element. however, the value may still be modified by a script. showcommentcolumn new in thunderbird 3requires seamonkey 2.0 type: boolean if true, a comment column appears in the popup. for the url history, the comment column will contain the page titles associated with each url. if this attribute is not
specified, the comment column doesn't appear. showimagecolumn type: boolean if true, an image column appears in the popup. there is no default styling of this image, but the class name returned by the results appears in the property list for the column. if this attribute is not
specified, the image column doesn't appear. size type: integer the number of characters that can be displayed in the...
The Joy of XUL - Archive of obsolete content
esupply 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 definition. 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 that is easier and less costly to maintai...
Things I've tried to do with XUL - Archive of obsolete content
pi: // auto-create and attach 1st cell var row = mylistbox.appenditem( label, value ); // create and attach 2nd cell var cell = document.createelement('listcell'); cell.setattribute('label', label2 ); cell.setattribute('value', value2 ); row.appendchild( cell ); // etc // ... while this works at first, after a number of rows have been added it breaks and stops displaying the first cell (the one
specified by the appenditem call). instead, you must build up your own listitem full of listcells, and then add that listitem to the listbox, using generic dom calls: var row = document.createelement('listitem'); // create and attach 1st cell var cell = document.createelement('listcell'); cell.setattribute('label', label ); cell.setattribute('value', value ); row.appendchild( cell ); // create and attach ...
Tree Widget Changes - Archive of obsolete content
tree.treeboxobject.getcolumnid(1) to get the id of a column, in this case column 1. use tree.columns.getkeycolumn().index instead of tree.treeboxobject.getkeycolumnindex(). the nsitreeboxobject.getpagecount() method has been renamed to make it clearer what it does. it returns the number of rows that can be displayed in the tree. this should correspond to the rows attribute on the tree if it was
specified. tree.treeboxobject.getpagecount() is now tree.treeboxobject.getpagelength(). the invalidateprimarycell(row) method has been removed, instead use nsitreeboxobject.invalidatecell() like this invalidatecell(row, tree.columns.getprimarycolumn()). this may be used to redraw a cell after it or its data has been changed. the nsitreeview.cycleheader() method has been changed, cycleheader(colid, eleme...
Adding Event Handlers to XBL-defined Elements - Archive of obsolete content
necessary. if an event does not match any of the handler events, it is simply passed to the inner content as usual. the general handler syntax is as follows: <binding id="binding-name"> <handlers> <handler event="event-name" action="script"/> </handlers> </binding> place all of your handlers within the handlers element. each handler element defines the action taken for a particular event
specified by its event attribute. valid event types are those supported by xul and javascript, such as click and focus. use the event name without the 'on' in front of it. a common reason to set handlers is to modify the custom properties when an event occurs. for example, a custom checkbox might have a checked property which needs to be changed when the user clicks the checkbox: <handlers> <handler even...
Adding Methods to XBL-defined Elements - Archive of obsolete content
« previousnext » next, we'll find out how to add custom methods to xbl-defined elements. methods in addition to adding script properties to the xbl-defined element, you can also add methods. these methods can be called from a script. methods are the functions of objects, such as window interface's open() method loads the
specified resource into the browsing context (window, <iframe> or tab) with the
specified name. if the name doesn't exist, then a new window is opened and the
specified resource is loaded into its browsing context.">window.open(). you can define custom methods for your elements using the method element. the general syntax of methods is as follows: <implementation> <method name="method-name"> <parameter name="parameter-name1"/> <parameter name="parameter-name2"/...
Box Model Details - Archive of obsolete content
box appears in the right box along with its label. just below the check box is a spacer. the spacer will grow and shrink but not exceed 30 pixels. the result is that the check box and the find button will be spaced apart from each other by some space of no more than 30 pixels. the second box has an alignment of start. this causes the child elements to be aligned on the left edge. if this was not
specified, the default would be stretch, which would make the child elements stretch horizontally. because we don't want the find button to change size, we need to set an alignment. next, we will learn about a more specialized type of box, the groupbox. « previousnext » ...
Custom Tree Views - Archive of obsolete content
that it needs to display. in general, although the tree view has thirty or so functions that may be implemented, you only need to implement the ones that the tree will call. three methods that you should implement are listed below. rowcount this property should be set to the total number of rows in the tree. getcelltext( row , column ) this method should return the text contents at the
specified row and column. this will be called to display data for each cell. the rows are supplied as numeric values starting at 0. the columns are treecolumn objects. in the older versions of mozilla (before firefox 1.5 or mozilla 1.8), the columns are supplied as the values of the id attribute on the columns. if you need a id attribute like older versions, the id property of treecolumn can be used. sett...
Document Object Model - Archive of obsolete content
c dom element interface. a namespace is a uri which specifies the kind of element. here are some examples: <button xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/> <button xmlns="http://www.w3.org/1999/xhtml"/> <html:button xmlns:html="http://www.w3.org/1999/xhtml"/> <html:button xmlns:html="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/> namespaces are
specified using the xmlns attribute. the first button is a xul element as it has been placed in the xul namespace. the second element is an xhtml element as it has been given the xhtml namespace. in the third example, the prefix 'html' is mapped to the namespace 'http://www.w3.org/1999/xhtml'. you can also use the prefix syntax with a colon to use a specific namespace . this is used when you are using...
Element Positioning - Archive of obsolete content
f simply setting the width property does not set the button width as you expect, try also to modify the button min-width property. height this specifies the height of the element. by setting either of the two properties, the element will be created with that width and height. if you specify only one size property, the other is calculated as needed. the size of these style properties should be
specified as a number followed by a unit. flexible elements the sizes are fairly easy to calculate for non-flexible elements. they simply obey their
specified widths and heights, and if the size wasn't
specified, the element's default size is just large enough to fit the contents. for flexible elements, the calculation is slightly trickier. flexible elements are those that have a flex attribute set to a...
Input Controls - Archive of obsolete content
e made up of a label and an image, where the image switches between checked and unchecked when it is pressed. check boxes have many of the same attributes as buttons: label the label on the check box or radio button. disabled set this to either true or false to disable or enable the check box or radio button. accesskey the shortcut key that can be used to select the element. the letter
specified is usually drawn underlined in the label. to view xul, you need e.g. seamonkey or waterfox and remote-xul-manager from https://github.com/jvillalobos/remote-xul-manager find files example so far : source view in the next section, we will look at some elements for entering and selecting numbers. « previousnext » looking for a guide to using input controls and forms on the web? see...
List Controls - Archive of obsolete content
multi-column list boxes the listbox also supports multiple columns. each cell may have arbitrary content within it, although usually only text is used. when the user selects an item in the list, the entire row is selected. you cannot have a single cell selected. two tags are used to specify the columns in the listbox. the listcols element is used to hold the column information, each of which is
specified using a listcol element. you will need one listcol element for each column in the listbox. the listcell element may be used for each cell in a row. if you want to have three columns, you will need to add three listcell elements inside each listitem. to specify the text content of a cell, place a label attribute on a listcell. for the simple case where there is only one column, you may also place ...
More Button Features - Archive of obsolete content
means place the image below the text. example 3 : source view <button label="left" image="happy.png"/> <button label="right" image="happy.png" dir="reverse"/> <button label="above" image="happy.png" orient="vertical"/> <button label="below" image="happy.png" orient="vertical" dir="reverse"/> the example here shows all four types of alignment of buttons. note that the two attributes are not
specified when the default value can be used. buttons with extra content buttons may have arbitrary markup contained inside them, and it will be rendered inside the button. you probably wouldn't use this very often, but you might use it when creating custom elements. for example, the following will create a button where two of the words are red: example 4 : source view <button> <description value="this i...
Popup Menus - Archive of obsolete content
d="searchpanel" orient="vertical" context="editpopup"> here a simple popup that is similar to the edit menu has been added to the first tabpanel. if you right-click (control-click on the macintosh) anywhere on the first panel, the popup will appear. however, the popup will not appear if you click anywhere else. note that the textbox has its own built-in popup menu which will override the one we
specified. our find files example so far : source view next, we'll look at how to create scrolling menus. « previousnext » ...
Scroll Bars - Archive of obsolete content
an 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. the leftmost or topmost position of the scroll bar has the value 0 and the rightmost or bottommost position of the scroll bar has the value given by maxpos. by adjusting the values of the scroll bar, you can have the thumb positioned just as you want it and the change when the...
Stack Positioning - Archive of obsolete content
child elements of a stack stretch to fit the size of the stack. however, you may also place the children at specific coordinates. for example, if a stack has two buttons as children, one may be placed 20 pixels from the left edge and 50 pixels from the top edge. the second button can be placed at 100 pixels from the left edge and 5 pixels from the top edge. the position of a child element may be
specified by placing two attributes on the element. for the horizontal position, use the left attribute and for the vertical position, use the top attribute. if you don't put these attributes on a child of a stack, the child will stretch to fit the size of the stack. example 1 : source view <stack> <button label="goblins" left="5" top="5"/> <button label="trolls" left="60" top="20"/> <button labe...
Using Spacers - Archive of obsolete content
readability. note that other factors, such as the button labels and button minimum sizes, will affect the actual sizes of the buttons. for instance, a button won't shrink less than the space needed to fit its label. specifying a flex value of 0 has the same effect as leaving the flex attribute out entirely. it means that the element is not flexible at all. you may also sometimes see a flex value
specified as a percentage. this has no special meaning and is treated as if the percent sign was not there. you may have noticed that when you resize the find file dialog vertically, the buttons resize themselves to fit the height of the window. this is because all of the buttons have an implied vertical flex given to them by the window. in the next section we'll learn how to change this. find files exa...
XBL Attribute Inheritance - Archive of obsolete content
nts. for example: xul: <searchbox/> xbl: <binding id="searchbinding"> <content> <xul:textbox/> <xul:button label="search"/> </content> </binding> in the example, the label attribute has been placed directly on the button element. the problem with this is that the label would be the same every time the binding was used. in this case, it would be preferable if the attribute could be
specified on the searchbox instead. xbl provides an inherits attribute which can be used to inherit attributes from the bound element. it should be placed on the element that should inherit an attribute from the outer element, in this case the button. its value should be set to a comma-separated list of attribute names that are to be inherited. <xul:textbox xbl:inherits="flex"/> <xul:button xbl:inherits="l...
Writing Skinnable XUL and CSS - Archive of obsolete content
should never occur in xul. any chrome url that references an image in the skin is strictly forbidden in the xul. if you find yourself needing to display an image from the skin, then use <titledbutton> and style it rather than using <html:img>. the problem here is that you'll end up placing a restriction on the skin, which will force the skin designer to supply an image with the exact name you've
specified. this is not healthy. note that some particularly evil people put images chrome urls in dtds. this is even worse, and it also is strictly forbidden. original document information author(s): david hyatt last updated date: may 24, 2000 copyright information: copyright (c) 1999-2000 david hyatt ...
XUL Accesskey FAQ and Policies - Archive of obsolete content
prompt() are being used to create a dialog, use an & before the button or checkbox text to make the next character an accesskey. for example, "do it &now" makes "n" the underlined accesskey. to insert a real ampersand, use &&. how do i pick an accesskey letter? accesskey attribute is case sensitive! notice that the difference between the button examples above is the case of the accesskey
specified. mozilla's accesskey implementation will first try to underline a letter of the same case, but if there isn't one it will fall back on a letter of the opposite case. our preference is to underline the first letter of one of the words, so it's important to be aware of this quirk. avoid duplicates don't use the same accesskey letter twice in the same window. be especially careful of ...
XUL Template Primer - Bindings - Archive of obsolete content
warning: the content of this article may be out of date. see xul:template guide for up to date documentation. overview this document expands on the xul template primer by introducing the <bindings> element in the extended xul template syntax. the <bindings> element is used to create additional,optional variable bindings, in addition to those that are
specified in a rule's <conditions>. this is different from the variables
specified in the rule's conditions, where a value must be found for each variable for the rule to match. if a <binding> can't be matched, the rule will still fire. example to illustrate how <bindings> work, we'll examine this xul document, which builds a simple content model an rdf/xml file. <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin" ty...
XUL accessibility guidelines - Archive of obsolete content
y for accessibility. presentation should also be flexible to window and font resizing. cooperative applications adapt well to the user's environment. system defaults maintain system defaults. many users set their computers to use larger than normal fonts and/or specific color themes. by default, xul menus, labels, and other widgets get their font, size, and color settings from the user settings
specified in the operating system. respect these defaults unless you have a specific and unavoidable reason to change them. if you must change them, use css to size elements relative to the default sizes (for example, use % or em rather than specific point or pixel sizes). color color is an important tool. different colors can give different meanings to objects and text. however, color alone is inadequat...
Accessibility/XUL Accessibility Reference - Archive of obsolete content
>" /> <label control="butwrap2" value="is" /> <label control="butwrap2" value="a" /> <label control="butwrap2" value="button" /> </button> <button image="images/img.xbm" tooltiptext="<!--button text-->"/> note that in the third example, only the first label is read browser jaws 7.10 issues to use a browser element with html, the type="content" attribute should be
specified. however, this attribute causes any xul loaded in the browser to have issues with jaws 7.10. we believe they are using the window class to determine that it is content rather than dialog, but does not support content mode for xul. therefore, with jaws 7.10, to use xul inside of a browser, the type attribute cannot not be used. caption see groupbox checkbox <chec...
XUL accessibility tool - Archive of obsolete content
buttons (make sure they have accessible alternatives). new features: (aaronlev) automatically test any new windows as they are opened. (aaronandy) highlight or blink source element in original xul app upon click of referencing line in report. (aaronlev) compatibility with more xul applications. (aaronandy) maybe an online tool to automatically generate a xul a11y tool compatible with a user-
specified xul app. (aaronandy) link report sections to relevant part of xul a11y guidelines. (aaronandy) enable tabs, context menu, and other browser extras in report window. (aaronandy) xul runner version that can run from the command line, check a text file, and output the results somewhere. known bugs: test for lowercase i or l as accesskey (sometimes?) flags upppercase i and l too. possible fal...
XUL controls - Archive of obsolete content
isplays a labelled box around other user interface controls. <groupbox> <caption label="network"/> </groupbox> more information about the groupbox element. groupbox reference related elements: caption <filefield> allows the user to select a file. <filefield/> filefield reference <image> an image
specified by a url. <image src="start.png"/> more information about the image element. image reference <label> adds a text label to a nearby control. <label control="volume" value="volume:"/> more information about the label element. label reference <listbox> the listbox is used to select an item from a list o...
arrowscrollbox - Archive of obsolete content
arrowscrollbox. if not set explicitly, it will fall back to the smoothscroll attribute and then to the toolkit.scrollbox.smoothscroll preference. currently, smooth scrolling supports horizontal arrowscrollboxes only. tabindex type: integer gets and sets the value of the tabindex attribute. methods ensureelementisvisible( element ) return type: no return value if the
specified element is not currently visible to the user, the displayed items are scrolled so that it is. if the item is already visible, no scrolling occurs. scrollbyindex( lines ) return type: no return value scrolls the contents of the arrowscrollbox by a certain number of lines. a line is a single element. use a positive value as the lines argument to scroll forward that many lines...
browser - Archive of obsolete content
rrer, charset ) return type: no return value load a url into the document, with the given referrer and character set. the first argument should be a string, not a nsiuri object. to get a string from an nsiuri, use nsiuri.spec or nsiuri.asciispec loaduriwithflags( uri, flags, referrer, charset, postdata ) return type: no return value load a url into the document, with the
specified load flags, the given referrer, character set, and post data. in addition to the flags allowed for the reloadwithflags method, the following flags are also valid: load_flags_is_refresh: this flag is used when the url is loaded because of a meta tag refresh or redirect. load_flags_is_link: this flag is used when the url is loaded because a user clicked on a link. the http referer header is s...
button - Archive of obsolete content
t instead of getattribute(). for buttons, the type attribute must be set to checkbox or radio for this attribute to have any effect. command type: id set to the id of a command element that is being observed by the element. crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side
specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales. end the text will be cropped on its right side in left-to-right text ...
caption - Archive of obsolete content
</caption> </groupbox> attributes accesskey type: character this should be set to a character that is used as a shortcut key. this should be one of the characters that appears in the label attribute for the element. crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side
specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales. end the text will be cropped on its right side in left-to-right text ...
content - Archive of obsolete content
ren tag. thus, nested elements will not match because they are directly inside a treeitem. this attribute is useful to provide different rules for outer and inner elements. uri type: ? used to specify the variable name for the content. when a rule is evaluated, it scans through each resource in the rdf datasource looking for a match. each resource is placed in the variable
specified in the uri attribute in turn. then, the other rules are evaluated for a match. this attribute should always be present. métodos inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelem...
datepicker - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a datepicker allows the user to enter a date. three types are available, which can be
specified using the 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...
description - Archive of obsolete content
an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales. end the text will be cropped on its right side in left-to-right text ...
dialogheader - Archive of obsolete content
an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales. end the text will be cropped on its right side in left-to-right text ...
listcell - Archive of obsolete content
default it only contains text but iconic and checkbox listcells are also available. attributes crop, disabled, image, label, type properties disabled style classes listcell-iconic, examples (example needed) attributes crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side
specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales. end the text will be cropped on its right side in left-to-right text ...
menuitem - Archive of obsolete content
e user unchecks the menuitem, as a value of false will both correctly hide the checkmark and persist its hidden state. command type: id set to the id of a command element that is being observed by the element. closemenu type: one of the values below indicates if the menu closes when the menuitem is activated. auto this, the default value if the closemenu attribute is not
specified, closes up the menu and all parent menus. single the menu the item is contained within is closed, but the parent menus remain open. none no menus are closed. crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side
specified by the crop attribute. an ellipsis will be used in place...
menuseparator - Archive of obsolete content
events type: boolean if true, events are passed to children of the element. otherwise, events are passed to the element only. command type: id set to the id of a command element that is being observed by the element. crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side
specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales. end the text will be cropped on its right side in left-to-right text ...
notificationbox - Archive of obsolete content
fault button. there can be only one default button. if no button has this set, the first button in the array is the default. type - a string. valid values are "menu-button" and "menu" which must be set if the button is to provide a popup via the popup property. getnotificationwithvalue( value ) return type: notification element retrieve the notification with a particular value. the value is
specified when adding the notification with appendnotification. if no matching value is found, returns null. removeallnotifications( immediate ) return type: no return value remove all notifications. if immediate is true, the messages are removed immediately. if immediate is false, the notifications are removed using a slide transition. removecurrentnotification() return type: no return value rem...
param - Archive of obsolete content
the value to bind should be text as a child of the param element. for more information, see query_parameters. attributes index, name, type attributes index type: integer the index within the sql statement of the parameter. name type: string the name of a parameter within the sql statement. this name should appear within the query preceded by a colon. ...
progressmeter - Archive of obsolete content
ssmeter mode="determined" id="myprogress"/> <button label="example" onmouseover="setloading(true)" onmouseout="setloading(false)"/> function setloading(state){ document.getelementbyid('myprogress').mode = (state) ? 'undetermined' : 'determined'; } attributes max type: integer the maximum value that progressmeter may have. the default value if not
specified is 100 such that the value may be used as a percentage. mode type: one of the values below a determinedprogressmeter is used in cases where you know how long an operation will take. an undeterminedprogressmeter can be used when you don't and will typically be drawn as a spinning barber pole. determined the progress meter uses its value attribute to determine the amount of the bar...
resizer - Archive of obsolete content
ibutes | properties | methods | related ] an element used for window resizing. if you place a custom resizing button inside the resizer, the user will be able to resize the window by dragging it. the resizer will send a command event after the resize is complete. note: starting in gecko 2.0, you can also specify a target element using the element attribute, to use the resizer to resize the
specified element instead of the window. attributes dir, element, type examples resizing a window <window xmlns="http://www.mozilla.org/keymaster/gat...re.is.only.xul" hidechrome="true" windowtype="main" orient="vertical" sizemode="normal" width="400" height="300" persist="screenx screeny width height"> <hbox flex="1"> <vbox width="2" style="background-color: grey;"> <resizer dir="topl...
<statusbarpanel> - Archive of obsolete content
an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales. end the text will be cropped on its right side in left-to-right text ...
tab - Archive of obsolete content
ediately before the currently selected tab. this is set automatically set when needed and you shouldn't adjust it manually. this is primarily useful for themes so that they can adjust the appearance of the area around the selected tab. crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side
specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales. end the text will be cropped on its right side in left-to-right text ...
tabbox - Archive of obsolete content
l first elements go here --></tabpanel> <tabpanel><!-- tabpanel second elements go here --></tabpanel> <tabpanel><button label="click me"/></tabpanel> <tabpanel><!-- tabpanel fourth elements go here --></tabpanel> </tabpanels> </tabbox> attributes eventnode type: one of the values below indicates where keyboard navigation events are listened to. if this attribute is not
specified, events are listened to from the tabbox. thus, if this attribute is not used, the tabbox or an element inside it must have the focus for the keyboard navigation to apply. parent keyboard navigation is captured at the parent of the tabbox. window keyboard navigation is captured at the window level. tab navigation will occur as long as any element in the window is focused. document ...
template - Archive of obsolete content
to declare a template for rule-based construction of elements. elements are constructed from a datasource. for more information see the rule element. more information is available in the xul tutorial. attributes container, member examples (example needed) attributes container type: string may optionally be set to the variable to use as the container or reference variable. if not
specified, the variable
specified in the uri attribute of the content tag in the template's first rule is used. member type: string may optionally be set to the variable to use as the member variable. if not
specified, the variable
specified in the uri attribute in the action body of the template's first rule is used. inherited from xul element align, allowevents, allownegativeassertions, cl...
toolbar - Archive of obsolete content
s. these are toolbars that are not children of a toolbox element. you can associate an external toolbar with a toolbox for the purpose of managing your toolbars by setting the toolboxid property on the toolbar. the chromeclass-toolbar class may be used to create a toolbar where its visibility depends on the toolbar flag when opening the window with the window interface's open() method loads the
specified resource into the browsing context (window, <iframe> or tab) with the
specified name. if the name doesn't exist, then a new window is opened and the
specified resource is loaded into its browsing context.">window.open() method. more information is available in the xul tutorial. note: starting in gecko 1.9.1, toolbar items are moved from the toolbarpalette and added to the toolbar when a toolba...
toolbarbutton - Archive of obsolete content
set instead of getattribute(). for buttons, the type attribute must be set to checkbox or radio for this attribute to have any effect. command type: id set to the id of a command element that is being observed by the element. crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side
specified by the crop attribute. an ellipsis will be used in place of the cropped text. if the box direction is reversed, the cropping is reversed. start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales. end the text will be cropped on its right side in left-to-right text ...
treeitem - Archive of obsolete content
hods | related ] a treeitem should be placed inside a treechildren element and should contain treerow elements. the treeitem can be clicked by the user to select the row of the tree. the treeitem contains a single row and all of what appear to the user as that row's descendants. in a template condition, you should use a treeitem instead of a content element when the dont-build-content flag is
specified. set the uri attribute to the variable name to bind to a content node during matching. more information is available in the xul tutorial. attributes container, empty, label, open, uri examples (example needed) attributes container type: boolean set to true if the element is to act as a container which can have child elements. this would be used for folders. this will be set by t...
triple - Archive of obsolete content
that all the conditions match. if the assertion does not exist, the rule will not match. both the subject and object attributes may be variables. the subject of a triple is an rdf resource. in an rdf file this would usually be an rdf description element. the predicate would be a child element or property. for example, for a bookmark resource, the name and url would be predicates. they should be
specified in their full uri form. the object is the value of the rdf property. more information is available in the xul tutorial. attributes object, predicate, subject examples (example needed) attributes object type: string the object of the element. it can be a variable reference, an rdf resource uri, or an rdf literal value. predicate type: uri the predicate or property to matc...
window - Archive of obsolete content
w hardware layer managers to accelerate the window. activetitlebarcolor type: color string specify background color of the window's titlebar when it is active (foreground). moreover this hides separator between titlebar and window contents. this only affects mac os x. chromemargin type: margin string controls the amount of chrome that should be visible on each side of the window. the
specified string should contain four numbers, separated by commas, indicating the margin in pixels for the top, right, bottom, and left edges of the window, respectively. this value may be -1 to use the default margin for that side on the current platform, 0 to have no system border (that is, to extend the client area to the edge of the window), or a value greater than zero to indicate how much less than t...
wizard - Archive of obsolete content
supply null as the argument to go to the next page in the sequence. cancel() return type: no return value call this method to cancel and close the wizard. getbutton( type ) return type: button element returns the button element in the dialog corresponding to the given type. getpagebyid( pageid ) return type: wizardpage element returns the wizardpage element corresponding to the
specified pageid. goto( pageid ) return type: no return value this method is used to change which page is currently displayed,
specified by the pageid argument. the page will be changed regardless of the value of canadvance or canrewind. rewind() return type: no return value call this method to go back a page. it is equivalent to pressing the back button. the canrewind property must be set to t...
Creating a Windows Inno Setup installer for XULRunner applications - Archive of obsolete content
se test your application before deploying it. if your application does not run, neither will the installed version. step 3: creating the inno setup script create an inno setup script (.iss file). the inno setup script wizard can't set chrome directory's deployment point, so you have to edit the iss file yourself. also you had better set the appname and apppublisher properties to the same values
specified in your xulrunner application's application.ini file. my app's .iss file sample as follows: ; script generated by the inno setup script wizard. ; see the documentation for details on creating inno setup script files! [setup] appname=my app appvername=my app 1.0 apppublisher=mark finkle apppublisherurl=http://developer.mozilla.org/en/docs/getting_started_with_xulrunner appsupporturl=http://deve...
Specifying Startup Chrome Window - Archive of obsolete content
s, there is a file named xulmine.js. its contents are: pref("toolkit.defaultchromeuri", "chrome://xulmine/content/xulmine.xul"); the toolkit.defaultchromeuri preference specifies that the xul window at chrome://xulmine/content/xulmine.xul is the main application window. specifying a single instance main window by default, each time the user launches the application xulrunner opens the window
specified by toolkit.defaultchromeuri. an application wishing to have only one main window should set the toolkit.singletonwindowtype preference and specify the windowtype attribute on the main application window. specifying window features by default, the main window is opened as a resizeable, non-dialog chrome window. this default can be changed by setting the toolkit.defaultchromefeatures preference. ...
Mozprofile - Archive of obsolete content
r creating and managing profiles for mozilla's applications (firefox, thunderbird, etc.). in addition to creating profiles, mozprofile can install addons and set preferences. mozprofile can be utilized from the command line or as an api. command line usage mozprofile may be used to create profiles, set preferences in profiles, or install addons into profiles. the profile to be operated on may be
specified with the --profile switch. if a profile is not
specified, one will be created in a temporary directory which will be echoed to the terminal: (mozmill)> mozprofile /tmp/tmp4q1ieu.mozrunner (mozmill)> ls /tmp/tmp4q1ieu.mozrunner user.js to run mozprofile from the command line enter: mozprofile --help for a list of options. api usage to use mozprofile as an api you can import mozprofile.profile and...
Mozrunner - Archive of obsolete content
as part of the mozbase project, please see the mozbase project page. mozrunner is a python package which handles running of mozilla applications. mozrunner utilizes mozprofile for managing application profiles and mozprocess for robust process control. mozrunner may be used from the command line or programmatically as an api. command line usage the mozrunner command will launch the application (
specified by --app) from a binary
specified with -b or as located on the path. mozrunner takes the command line options from mozprofile for constructing the profile to be used by the application. run mozrunner --help for detailed information on the command line program. api usage mozrunner features a base class, mozrunner.runner.runner which is an integration layer api for interfacing with mozilla applicat...
nsIContentPolicy - Archive of obsolete content
bdocument 5 obsolete since gecko 1.8 control_tag 6 obsolete since gecko 1.8 raw_url 7 obsolete since gecko 1.8 document 8 obsolete since gecko 1.8 methods shouldload() called to let your content policy implementation decide whether or not the resource at a given location should be loaded. this method is called before loading the resource
specified by acontentlocation to determine whether or not to start loading the requested resource. shouldload() can be called while the dom and layout of the document involved is in an inconsistent state. this means that implementers of this method must not do any of the following: modify the dom in any way (e.g., setting attributes is a no-no). query any dom properties that depend on layout (e.g., of...
2006-11-10 - Archive of obsolete content
ed a notice about unit testing for the mozilla toolkit, letting developers know about the importance of testing for the improvement of mozilla 2, and asks for complete coverage. several community members comment, backing up benjamin's post. william vanderpol asks, regarding remote xul applications, if is it possible (or does it exist?) to have an extension that will allow chrome access to certain
specified url's? james leigh points out that resources are available at o'reily, in the creating applications with mozilla section. benjamin smedberg has been "working on some xptcall refactoring which will allow us to expose xptcall via a frozen api (and c linkage)". he is looking for xptcall port maintainers to submit patches to bug 349002. matthew gertner wants to know if anyone has written code to past...
NPN_Enumerate - Archive of obsolete content
syntax #include <npruntime.h> bool npn_enumerate(npp npp, npobject *npobj, npidentifier **identifiers, uint32_t *identifiercount); parameters the function has the following parameters: npp the npp indicating which plugin instance is making the request. npobj the object of which the properties and methods are to be retrieved. identifiers a pointer to receive a pointer to the start of an array of string identifiers of the names of the properties and methods of npobj. ...
NPN_Evaluate - Archive of obsolete content
syntax #include <npruntime.h> bool npn_evaluate(npp npp, npobject *npobj, npstring *script, npvariant *result); parameters the function has the following parameters: npp the npp indicating which plugin instance's window to evaluate the script in. npobj the scope object. script the script to evaluate. result on return, contains the value returned by the script. can't be null. returns true if the script was evaluated successfully, otherwise false. ...
NPN_GetProperty - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary gets the value of a property on the
specified npobject. syntax #include <npruntime.h> bool npn_getproperty(npp npp, npobject *npobj, npidentifier propertyname, npvariant *result); parameters the function has the following parameters: <tt>npp</tt> the npp indicating which plugin instance's is making the request. <tt>npobj</tt> the object from which a value is to be retrieved. <tt>propertyname</tt> a string identifier indicating the name of the property whose value is to be retrieved. <tt>result</tt> on return, contains the value of the
specified property. returns true if the value was retrieved successfully, otherwise false. note: the caller must call npn_releasevariantvalue() to release the returned va...
NPN_GetStringIdentifiers - Archive of obsolete content
de <npruntime.h> void npn_getstringidentifiers(const nputf8 **names, int32_t namecount, npidentifier *identifiers); parameters the function has the following parameters: names an array of strings for which opaque identifiers should be returned. namecount the number of strings in the names array. identifiers a pointer to the first element of an array to fill with the identifiers for the strings
specified by names. returns on return, the identifiers array is filled out with the identifiers for each of the strings in the names array. description as is the case with npn_getstringidentifier(), all calls for the same strings are guaranteed to return the same exact identifiers. ...
NPN_GetURL - Archive of obsolete content
syntax #include <npapi.h> nperror npn_geturl(npp instance, const char* url, const char* target); parameters the function has the following parameters: instance pointer to the current plug-in instance. url pointer to the url of the request. can be of any type, such as http, ftp, news, or mailto. target name of the target window or frame, or one of the following special target names. values: _blank or _new: load the link in a new blank unnamed window. ...
NPN_GetURLNotify - Archive of obsolete content
syntax #include <npapi.h> nperror npn_geturlnotify(npp instance, const char* url, const char* target, void* notifydata); parameters the function has the following parameters: instance pointer to the current plug-in instance. url pointer to the url of the request. can be of any type, such as http, ftp, news, or mailto. ...
NPN_HasMethod - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary determines whether or not the
specified npobject has a particular method. syntax #include <npruntime.h> bool npn_hasmethod(npp npp, npobject *npobj, npidentifier methodname); parameters the function has the following parameters: npp the npp indicating which plugin instance is making the request. npobj the object on which to look for the method. methodname a string identifier indicating the name of the method to look for. returns true if the method exists on the
specified object, otherwise false. ...
NPN_HasProperty - Archive of obsolete content
« gecko plugin api reference « scripting plugins summary determines whether or not the
specified npobject has a particular property. syntax #include <npruntime.h> bool npn_hasproperty(npp npp, npobject *npobj, npidentifier propertyname); parameters the function has the following parameters: <tt>npp</tt> the npp indicating which plugin instance is making the request. <tt>npobj</tt> the object on which to look for the property. <tt>propertyname</tt> a string identifier indicating the name of the property to look for. returns true if the property exists on the
specified object, otherwise false. ...
NPN_IntFromIdentifier - Archive of obsolete content
api reference « scripting plugins summary returns the integer value corresponding to the given integer identifier. syntax #include <npruntime.h> int32_t npn_intfromidentifier(npidentifier identifier); parameters the function has the following parameter: <tt>identifier</tt> the integer identifier whose corresponding integer value should be returned. returns an integer corresponding to the
specified <tt>identifier</tt>. note: the behavior of this function is undefined if <tt>identifier</tt> isn't an integer identifier. ...
NPN_InvalidateRect - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary invalidates the
specified portion of the plugin's drawing area, adding it to the region that needs to be redrawn when the plugin next repaints its contents. syntax #include <npapi.h> void npn_invalidaterect(npp instance, nprect *invalidrect); parameters the function has the following parameters: instance pointer to the plug-in instance to invalidate a portion of. invalidrect the area to invalidate,
specified in a coordinate system that originates at the top left of the plug-in's content area. description before a windowless plug-in can repaint or refresh part of its drawing area, the plug-in must first invalidate the area with either npn_invalidaterect() or npn_invalidateregion(). npn_invalidaterect() c...
NPN_Invoke - Archive of obsolete content
string identifier indicating the name of the method to invoke. args an array of arguments to pass to the method. argcount the number of arguments in the args array. result a pointer to an npvariant to receive the result returned by the method. returns true if the method was successfully invoked, otherwise false. if the method was invoked successfully, any return value is stored in the npvariant
specified by result. when the caller no longer needs the result, it must call npn_releasevariantvalue() to release it. description the method arguments are passed as an array of npvariants, and the number of arguments is passed in. the result of the method invocation is returned through an npvariant result parameter. if the method invocation succeeds, npn_invoke() returns true, else false. note: early on i...
NPN_InvokeDefault - Archive of obsolete content
method. args an array of arguments to pass to the default method. argcount the number of arguments in the args array. result a pointer to an npvariant to receive the result returned by the default method. returns true if the default method was successfully invoked, otherwise false. if the default method was invoked successfully, any return value is stored in the npvariant
specified by result. when the caller no longer needs the result, it must call npn_releasevariantvalue() to release it. description the method arguments are passed as an array of npvariants, and the number of arguments is passed in. the result of the method invocation is returned through an npvariant result parameter. if the method invocation succeeds, npn_invoke() returns true, else false. ...
NPN_MemAlloc - Archive of obsolete content
<npapi.h> void *npn_memalloc (uint32 size); parameters the function has the following parameters: size size of memory, in bytes, to allocate in the browser's memory space. returns if successful, the function returns a pointer to the allocated memory, in bytes. if insufficient memory is available, the plug-in returns null. description the plug-in calls npn_memalloc to allocate a
specified amount of memory in the browser's memory space. if you allocate saved instance data with npp_destroy, be sure to use npn_memalloc to allocate memory. this ensures that the browser can free the saved data at a later time with the equivalent of npn_memfree. since the browser and plug-ins share the same memory space, npn_memalloc allows plug-ins to take advantage of any customized memory allocation ...
NPN_MemFlush - Archive of obsolete content
syntax #include <npapi.h> uint32 npn_memflush(uint32 size); parameters the function has the following parameters: size size of memory, in bytes, to free in the browser's memory space. returns if successful, the function returns the amount of freed memory, in bytes. if no memory can be freed, the browser returns 0. ...
NPN_PluginThreadAsyncCall - Archive of obsolete content
*), 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. userdata pointer to the data to pass to the function func once called. returns nothing. description causes asynchronous execution of the
specified function pointer on the "plug-in thread", passing in the
specified user data pointer when it is called. the "plug-in thread" is the thread hosting the plug-in, which may be either the browser's main thread or the plug-in process if the plug-in is being executed out-of-process. it is the application's responsibility to perform any synchronization between the thread calling npn_pluginthreadasynccal...
NPN_RemoveProperty - Archive of obsolete content
syntax #include <npruntime.h> bool npn_removeproperty(npp npp, npobject *npobj, npidentifier propertyname); parameters the function has the following parameters: npp the npp indicating which plugin instance is making the request. npobj the object on which a property is to be deleted. propertyname a string identifier indicating the name of the property to remove. ...
-ms-scroll-limit-x-max - Archive of obsolete content
the -ms-scroll-limit-x-max css property is a microsoft extension that specifies the maximum value for the element.scrollleft property. initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas
specifiedanimation typediscrete syntax values auto the maximum value for the scrollleft property is equal to element.scrollwidth. <length> the maximum value for the scrollleft property. formal syntax auto | <length> specifications not part of any specification. remarks this property has no effect on non-scrollable elements. the
specified behavior of the -ms-scroll-limit-x-max property is only applicable at a mscontentzoomfactor of 1; the behavior of this property is undefined at other zoom factors. this pro...
-ms-scroll-limit-x-min - Archive of obsolete content
the -ms-scroll-limit-x-min css property is a microsoft extension that specifies the minimum value for the element.scrollleft property. initial value0applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas
specifiedanimation typediscrete syntax values <length> the minimum value for the scrollleft property. if the value is negative, then 0 is used. formal syntax <length> specifications not part of any specification. remarks this property has no effect on non-scrollable elements. the
specified behavior of the -ms-scroll-limit-x-min property is only applicable at a mscontentzoomfactor of 1; the behavior of this property is undefined at other zoom factors. this property requires windows 8 or later. ...
-ms-scroll-limit-y-max - Archive of obsolete content
the -ms-scroll-limit-y-max css property is a microsoft extension that specifies the maximum value for the element.scrolltop property. initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas
specifiedanimation typediscrete syntax values auto the maximum value for the scrolltop property is equal to element.scrollheight. <length> the maximum value for the scrolltop property. formal syntax auto | <length> specifications not part of any specification. remarks this property has no effect on non-scrollable elements. the
specified behavior of the -ms-scroll-limit-y-max property is only applicable at a mscontentzoomfactor of 1; the behavior of this property is undefined at other zoom factors. this prope...
-ms-scroll-limit-y-min - Archive of obsolete content
the -ms-scroll-limit-y-min css property is a microsoft extension that specifies the minimum value for the element.scrolltop property. initial value0applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas
specifiedanimation typediscrete syntax values <length> the minimum value for the scrolltop property. if the value is negative, then 0 is used. formal syntax <length> specifications not part of any specification. remarks this property has no effect on non-scrollable elements. the
specified behavior of the -ms-scroll-limit-y-min property is only applicable at a mscontentzoomfactor of 1; the behavior of this property is undefined at other zoom factors. this property requires windows 8 or later. ...
-ms-scroll-snap-points-x - Archive of obsolete content
the -ms-scroll-snap-points-x css property is a microsoft extension that specifies where snap-points will be located along the x-axis. initial valuesnapinterval(0px, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas
specifiedanimation typediscrete syntax values note: a <length-percentage> is a value that can be either a <length> or a <percentaqe>. snapinterval( <length-percentage>, <length-percentage> ) specifies a starting snap-point followed by the interval between all snap-points. the first value specifies where the first snap-point will be placed. the second value specifies the distance between subsequent snap-points both to the left and the right of the initial snap-point. snaplist( <length-percentage...
-ms-scroll-snap-points-y - Archive of obsolete content
the -ms-scroll-snap-points-y css property is a microsoft extension that specifies where snap-points will be located along the y-axis. initial valuesnapinterval(0px, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas
specifiedanimation typediscrete syntax values note: a <length-percentage> is a value that can be either a <length> or a <percentaqe>. snapinterval( <length-percentage>, <length-percentage> ) specifies a starting snap-point followed by the interval between all snap-points. the first value specifies where the first snap-point will be placed. the second value specifies the distance between subsequent snap-points both above and below the initial snap-point. snaplist( <length-percentage># ) ...
-ms-scroll-snap-x - Archive of obsolete content
that specifies values for the -ms-scroll-snap-type and -ms-scroll-snap-points-x properties. initial valueas each of the properties of the shorthand:-ms-scroll-snap-type: none-ms-scroll-snap-points-x: snapinterval(0px, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas each of the properties of the shorthand:-ms-scroll-snap-type: as
specified-ms-scroll-snap-points-x: as
specifiedanimation typediscrete syntax values the -ms-scroll-snap-x shorthand property is
specified as one or both of the following values, in order and separated by spaces. -ms-scroll-snap-type the value of the -ms-scroll-snap-type property. -ms-scroll-snap-points-x the value of the -ms-scroll-snap-points-x property. formal syntax <'-ms-scroll-sn...
-ms-scroll-snap-y - Archive of obsolete content
that specifies values for the -ms-scroll-snap-type and -ms-scroll-snap-points-y properties. initial valueas each of the properties of the shorthand:-ms-scroll-snap-type: none-ms-scroll-snap-points-y: snapinterval(0px, 100%)applies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas each of the properties of the shorthand:-ms-scroll-snap-type: as
specified-ms-scroll-snap-points-y: as
specifiedanimation typediscrete syntax values the -ms-scroll-snap-y shorthand property is
specified as one or both of the following values, in order and separated by spaces. -ms-scroll-snap-type the value of the -ms-scroll-snap-type property. -ms-scroll-snap-points-y the value of the -ms-scroll-snap-points-y property. formal syntax <'-ms-scroll-sn...
-ms-scrollbar-3dlight-color - Archive of obsolete content
the -ms-scrollbar-3dlight-color css property is a microsoft extension specifying the color of the top and left edges of the scroll box and scroll arrows of a scroll bar. initial valuedepends on user agentapplies toall elementsinheritedyescomputed valueas
specifiedanimation typediscrete syntax values <color> the color of the top and left edges of the scroll box and scroll arrows of the scroll bar. 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} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | r...
-ms-scrollbar-arrow-color - Archive of obsolete content
the -ms-scrollbar-arrow-color css property is a microsoft extension that specifies the color of the arrow elements of a scroll arrow. initial valuebuttontextapplies toall elementsinheritedyescomputed valueas
specifiedanimation typediscrete syntax values <color> the color of the scroll arrows of the scroll bar. 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} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgba( <number>{3} [ / <alpha-value> ]? ) | rgba( <percentage>#{3} , <alpha-value>? ) | rg...
-ms-scrollbar-base-color - Archive of obsolete content
the -ms-scrollbar-base-color css property is a microsoft extension that specifies the base color of the main elements of a scroll bar. initial valuedepends on user agentapplies toall elementsinheritedyescomputed valueas
specifiedanimation typediscrete syntax values <color> the base color of the main elements of a scroll bar. 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} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgba( <number>{3} [ / <alpha-value> ]? ) | rgba( <percentage>#{3} , <alpha...
-ms-scrollbar-darkshadow-color - Archive of obsolete content
the -ms-scrollbar-darkshadow-color css property is a microsoft extension that specifies the color of a scroll bar's gutter. initial valuethreeddarkshadowapplies toall elementsinheritedyescomputed valueas
specifiedanimation typediscrete syntax values <color> the color of the scroll bar's gutter. 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} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgba( <number>{3} [ / <alpha-value> ]? ) | rgba( <percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3}...
-ms-scrollbar-face-color - Archive of obsolete content
the -ms-scrollbar-face-color css property is a microsoft extension that specifies the color of the scroll box and scroll arrows of a scroll bar. initial valuethreedfaceapplies toall elementsinheritedyescomputed valueas
specifiedanimation typediscrete syntax values <color> the color of the scroll box and scroll arrows. 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} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgba( <number>{3} [ / <alpha-value> ]? ) | rgba( <percentage>#{3} , <alpha-value>...
-ms-scrollbar-highlight-color - Archive of obsolete content
the -ms-scrollbar-highlight-color css property is a microsoft extension that specifies the color of the slider tray, the top and left edges of the scroll box, and the scroll arrows of a scroll bar. initial valuethreedhighlightapplies toall elementsinheritedyescomputed valueas
specifiedanimation typediscrete syntax values <color> the color of the slider tray, the top and left edges of the scroll box, and the scroll arrows of a scroll bar. 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} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )<rgba()> = rgba( ...
Debug - Archive of obsolete content
led determines whether debugging is enabled for the script context. debugging may be enabled or disabled whether or not a debugger is attached. debug.setnonusercodeexceptions determines whether any try-catch blocks in this scope are to be treated by the debugger as user-unhandled. functions debug.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 relations...
GetObject - Archive of obsolete content
standards mode, internet explorer 10 standards mode, internet explorer 11 standards mode, and windows store apps or later. use the getobject function to access an automation object from a file. assign the object returned by getobject to the object variable. for example: var cadobject; cadobject = getobject("c:\\cad\\schema.cad"); when this code is executed, the application associated with the
specified pathname is started, and the object in the
specified file is activated. if pathname is a zero-length string (""), getobject returns a new object instance of the
specified type. if the pathnameargument is omitted, getobject returns a currently active object of the
specified type. if no object of the
specified type exists, an error occurs. some applications allow you to activate part of a file. to...
VBArray.getItem - Archive of obsolete content
syntax safearray.getitem(dimension1[, dimension2, ...], dimensionn) parameters safearray a vbarray object. dimension1, ..., dimensionn specifies the exact location of the desired element of the vbarray. n equals the number of dimensions in the vbarray. example the following example consists of three parts. the first part is vbscript code to create a visual basic safe array. ...
VBArray.lbound - Archive of obsolete content
syntax safearray.lbound(dimension) remarks if the vbarray is empty, the lbound method returns undefined. if dimension is greater than the number of dimensions in the vbarray, or is negative, the method generates a "subscript out of range" error. parameters safearray a vbarray object. dimension optional optional. the dimension of the vbarray for which the lower bound index is wanted. ...
VBArray.ubound - Archive of obsolete content
syntax safearray.ubound(dimension) parameters safearray a vbarray object. dimension optional the dimension of the vbarray for which the higher bound index is wanted. if omitted, ubound behaves as if a 1 was passed. remarks if the vbarray is empty, the ubound method returns undefined. ...
VBArray - Archive of obsolete content
); var b = a.toarray(); var i; for (i = 0; i < 9; i++) { document.writeln(b[i]); } } --> </script> </head> <body> <script type="text/javascript"> <!-- vbarraytest(createvbarray()); --> </script> </body> properties the vbarray object has no properties. methods vbarray.dimensions returns the number of dimensions in a vbarray. vbarray.getitem returns the item at the
specified location. vbarray.lbound returns the lowest index value used in the
specified dimension of a vbarray. vbarray.toarray returns a standard javascript array converted from a vbarray. vbarray.ubound returns the highest index value used in the
specified dimension of the vbarray. requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 ...
New in JavaScript 1.2 - Archive of obsolete content
ype.replace() string.prototype.search() string.prototype.slice() string.prototype.substr() new operators delete equality operators (== and !=) new statements labeled statements switch do...while import export other new features regular expressions signed scripts changed functionality in javascript 1.2 you can now nest functions within functions. number now converts a
specified object to a number. number now produces nan rather than an error if x is a string that does not contain a well-formed numeric literal. string now converts a
specified object to a string. array.prototype.sort() now works on all platforms. it no longer converts undefined elements to null and sorts them to the high end of the array. string.prototype.split() it can take a regular expression...
New in JavaScript 1.3 - Archive of obsolete content
etscape navigator 4.0 to 4.5. the old netscape documentation can be found on archive.org. netscape navigator 4.5 was released on october 19, 1998. the most significant change in javascript 1.3 was compliance with ecma-262 and unicode by removing inconsistencies between javascript 1.2 and the new ecma standard (which was published in june 1997). additional features of version 1.2, at the time not
specified by ecma-262 were kept in the javascript language (see below for a list of differences). javascript versions netscape communicator and navigator 4.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...
New in JavaScript 1.7 - Archive of obsolete content
ble or function names. the features that do not introduce new keywords (destructuring assignment and array comprehensions) can be used without specifying the javascript version. new features in javascript 1.7 the following features added with javascript 1.7 were not part of an ecma-262 standard at the time. in more recent firefox versions, the implementation is updated to work with semantics as
specified in ecmascript edition 6. please see the reference pages for differences. iterators and generators array comprehensions let statement (support for let expression was dropped in gecko 41, see bug 1023609). const statement destructuring assignment (support for js1.7 style destructuring for-in was dropped in gecko 40, see bug 1083498). ...
New in JavaScript 1.8.5 - Archive of obsolete content
the following is a changelog for javascript 1.8.5. this version was included in firefox 4. new features in javascript 1.8.5 new functions function description object.create() creates a new object with the
specified prototype object and properties. bug 492840 object.defineproperty() adds the named property described by a given descriptor to an object. object.defineproperties() adds the named properties described by the given descriptors to an object. object.getownpropertydescriptor() returns a property descriptor for a named ...
ECMAScript 2015 support in Mozilla - Archive of obsolete content
arraybuffer get arraybuffer[@@species] (firefox 48) dataview int8array uint8array uint8clampedarray int16array uint16array int32array uint32array float32array float64array get %typedarray%[@@species] (firefox 48) expressions and operators new.target (firefox 41) spread operator for arrays (firefox 16) ...
Object.unobserve() - Archive of obsolete content
the object.unobserve() method was used to remove observers set by object.observe(), but has been deprecated and removed from browsers. you can use the more general proxy object instead. syntax object.unobserve(obj, callback) parameters obj the object to stop observing. callback the reference to the observer to stop calling each time changes are made on the object obj. return value the
specified object. description object.unobserve() should be called after object.observe() in order to remove an observer from an object. the callback should be a reference to a function and not an anonymous function, because this reference will be used to unset the previous observer. it's useless to call object.unobserve() with an anonymous function as callback, it will not remove any observer. examples...
Object.prototype.watch() - Archive of obsolete content
ch is especially true when used on global objects, such as window. you can usually use setters and getters or proxies instead. the watch() method watches for a property to be assigned a value and runs a function when that occurs. syntax obj.watch(prop, handler) parameters prop the name of a property of the object on which you wish to monitor changes. handler a function to call when the
specified property's value changes. return value undefined. description watches for assignment to a property named prop in this object, calling handler(prop, oldval, newval) whenever prop is set and storing the return value in that property. a watchpoint can filter (or nullify) the value assignment, by returning a modified newval (or by returning oldval). if you delete a property for which a watchpoi...
for each...in - Archive of obsolete content
the for each...in statement is deprecated as the part of ecma-357 (e4x) standard. e4x support has been removed. consider using for...of instead. firefox now warns about the usage of for each...in and it no longer works starting with firefox 57. please see warning: javascript 1.6's for-each-in loops are deprecated for migration help. the for each...in statement iterates a
specified variable over all values of object's properties. for each distinct property, a
specified statement is executed. syntax for each (variable in object) { statement } variable variable to iterate over property values, optionally declared with the var keyword. this variable is local to the function, not to the loop. object object for which the properties are iterated. statement a statement to execute ...
JavaClass - Archive of obsolete content
the liveconnect java, sun, and netscape objects provide shortcuts for commonly used java packages and also create javaclass objects. description a javaclass object is a reference to one of the classes in a java package, such as netscape.javascript.jsobject. a javapackage object is a reference to a java package, such as netscape.javascript. ...
JavaObject - Archive of obsolete content
summary core object the type of a wrapped java object accessed from within javascript code. created by any java method which returns an object type. in addition, you can explicitly construct a javaobject using the object's java constructor with the packages keyword: new packages.javaclass(parameterlist) javaclassis the fully-
specified name of the object's java class. parameters parameterlist an optional list of parameters,
specified by the constructor of the java class. description the javaobject object is an instance of a java class that is created in or passed to javascript. javaobject is a wrapper for the instance; all references to the class instance are made through the javaobject. any java data brought into javascript is converted to javascript data types. when the javaobjec...
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
ipts should behave using the runat attribute of the script tag (or by setting a runat property on a javascript function object). the common values for this attribute are explained below, though there are more than just these. runat=”client” – code contained in this block is restricted to execution client-side, which is also what happens if no runat attribute is
specified. runat=”server” – code contained in this block is restricted to execution server-side. runat=”both” – code may be invoked on the client or server side. runat=”server-proxy” – allows for the exposure of server-side javascript functions to the browser. jaxer manages ajax calls behind the scenes to accomplish this. while most of the runat attribute values abov...
Window.importDialog() - Archive of obsolete content
function was only available in the original, xul-based version of firefox for android, which is no longer supported; for that reason, this function is obsolete and should never be used. summary because opening windows on mobile isn't necessarily appropriate, the firefox mobile team designed the importdialog() method to replace window.opendialog(). instead of opening a new window, it merges the
specified xul dialog into the main window. syntax newdialog = importdialog(aparent, asrc, aarguments) newdialog the opened window aparent the dialog's parent; can be null. asrc the chrome url of the xul dialog. aarguments a javascript object containing data to pass to the dialog. example var dialog = importdialog(null, "chrome://myextension/content/dialog.xul", myobject); notes the xul p...
Troubleshooting XForms Forms - Archive of obsolete content
control ref binding expression matches the namespace of the data. if form controls are within repeat, check that you are using attribute nodeset for the repeat instead of attribute ref. if the instance is not in the empty namespace (xmlns=""), then all binding expressions must use a prefix bound to the namespace. xpath 1.0 expressions do not have a default namespace, so a prefix must always be
specified if the namespace is not the empty namespace. if your binding expression starts with a /, make sure the first thing is the name of the root node of the instance. if your binding expression contains a /, look for any containing xf:group, xf:repeat, xf:input or other elements that set the context node. instance(...) not working be aware that the instance(...) returns an element node, and not th...
Mozilla XForms Specials - Archive of obsolete content
<tr> ... </tr> </xf:repeat> </table> or <ul> <xf:repeat ...> <li> ... </li> </xf:repeat> </ul> section 9.3.2 states that mixing with table will probably never work. mixing with ul might suffer from the same limitation. pseudo-class support we currently support all the css pseudo-classes in xforms (:enabled, :disabled, etc. ), except for :read-only and :read-write, because of non-
specified behaviour of these for (x)html. instead you have to use :-moz-read-only and :-moz-read-write for now. (limitation tracked in bug 313111)pseudo element support there is no support for the pseudo elements (::value, ::repeat-item, and ::repeat-index ). instead you will have to use the following normal classes instead: xf-value xf-repeat-item xf-repeat-index for example, to target the value element...
XForms Alert Element - Archive of obsolete content
introduction this message will be shown when the form control cannot properly bind to instance data or when the instance data value is invalid or out of the
specified range of selectable values (see the spec). the message of the alert element can exist in instance data, in a remote document, or as inline text. if more than one source of message is
specified in this element, the order of precedence is: single node binding attributes, linking attributes, inline text. attributes single-node binding linking src - url of a document whose contents will be retrieved by the alert element and used to provide the alert message for the containing form control. type restrictions the alert element can be bound to any simple content. representations can be represented in two ways: modeless wind...
XForms Help Element - Archive of obsolete content
introduction specifies contextual help for the containing form control (see the spec). the help message will be displayed if the f1 key is pressed while the containing form control has focus or if the containing form control recieves a xforms-help event. the message of the help element can exist in instance data, in a remote document, or as inline text. if more than one source of message is
specified in this element, the order of precedence is: single node binding attributes, linking attributes, inline text. attributes single-node binding linking src - url of a document whose contents will be retrieved by the help element and used to provide a help message for the containing form control. type restrictions the help element can be bound to any simple content. representations is repre...
XForms Hint Element - Archive of obsolete content
introduction similar to a tooltip (see the spec). the hint is displayed when the mouse moves and pauses over the containing form control. the hint will also be displayed if the containing form control recieves a xforms-hint event. the message of the hint element can exist in instance data, in a remote document, or as inline text. if more than one source of message is
specified in this element, the order of precedence is: single node binding attributes, linking attributes, inline text. attributes single-node binding linking src - url of a document whose contents will be retrieved by the hint element and used to provide hint text for the containing form control. type restrictions the hint element can be bound to any simple content. representations is represented by a tooltip window th...
XForms Label Element - Archive of obsolete content
introduction specifies the label (short description) for the xforms control (see the spec). every form control other than the output and choices elements must contain a label element. it is valid for a form control to have an empty label element. the label text can be
specified in instance data, in a remote document, or as inline text. if more than one source of label text is
specified for this element, the order of precedence is: single node binding attributes, linking attributes, inline text. ui behavior accesskey support - if the accesskey attribute is
specified on labeled xforms controls or on the label element itself then the label text for the control will contain an indicator as to what the access key is in a standard way. usually by underlining the accesskey character in the label te...
XForms Range Element - Archive of obsolete content
upported. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special incremental - supported, default value is false start - lower bound of possible values end - upper bound of possible values step - is used for incrementing/decrementing values start/end/step attributes if the value of the bound instance node is outside the range of values
specified by the start and end attributes, then the range element receives a xforms-out-of-range event. if the bound value then becomes in range, the range element receives a xforms-in-range event. start specifies the lower bound of possible values, i.e. values can't be less than the value of this attribute. if this attribute is omitted, then it is assumed to be 0. end specifies the upper bound of possible...
XForms Trigger Element - Archive of obsolete content
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. representations the xforms trigger element can be represented by the following widgets for the
specified appearance attribute values: button - default representation (xhtml/xul) link/clickable text - used when appearance = 'minimal' (xhtml only) button displaying a button is the default presentation (xhtml/xul). characteristics analogous widgets are <html:input type="button"/> and <xul:button/> link/clickable text xforms authors can use this representation if they want to have a widget...
XForms Upload Element - Archive of obsolete content
visually, the upload control is shown as a file picker dialog that hides disallowed (filtered) file types. the xforms author can set the filter by using the mediatype attribute directly on the upload element or by placing a mediatype element (see the spec) as a direct child of the upload element. attributes ui common appearance - isn't supported. accesskey - used to specify the keyboard shortcut for focusing this control. single-node binding special mediatype - supported. ...
Mozilla XForms User Interface - Archive of obsolete content
ontrol (see the spec). the help will be displayed if the f1 key is pressed while the containing form control has focus. hint similar to a tooltip (see the spec). the hint is displayed when the mouse moves and pauses over the containing form control. alert this message will be shown when the form control cannot properly bind to instance data or when the instance data value is invalid or out of the
specified range of selectable values (see the spec). message used in combination with event listeners to display a message to the user when the
specified event occurs (see the spec). xforms user interface these elements are mainly used to organize and manage the form's markup. they can be bound to instance nodes to define context for the xforms controls that they contain, should any of their child nodes ha...
Archived open Web documentation - Archive of obsolete content
to simplify asynchronous code in firefox by opting in to using javascript version 1.7 or later. you can opt in in html as follows: window.importdialog() because opening windows on mobile isn't necessarily appropriate, the firefox mobile team designed the importdialog() method to replace window.opendialog(). instead of opening a new window, it merges the
specified xul dialog into the main window. writing javascript for xhtml technical review completed. editorial review completed. xforms xforms were envisioned as the future of online forms as envisioned by the w3c. drawing on other w3c standards like xml schema, xpath, and xml events, xforms tried to address some of the limitations of...
Square tilemaps implementation: Static maps - Game development
les, since they are crucial for implementing layers — empty tiles are usually assigned a negative index value, 0, or a null value. in these examples, empty tiles will be represented by index 0, so we will shift the indices of the atlases by one (and thus the first tile of the atlas will be assigned index 1, the second index 2, etc.) the gettile() helper method returns the tile contained at the
specified column and row. if tiles were a 2d matrix, then the returned value would just be tiles[column][row]. however, it's usually more common to represent the grid with a 1-dimensional array. in this case, we need to map the column and row to an array index: var index = row * map.cols + column; wrapping up, an example of a tilemap object could look like the following. this features an 8 x 8 map with t...
Create the Canvas and draw on it - Game development
method. it takes six parameters: x and y coordinates of the arc's center arc radius start angle and end angle (what angle to start and finish drawing the circle, in radians) direction of drawing (false for clockwise, the default, or true for anti-clockwise.) this last parameter is optional. the fillstyle property looks different than before. this is because, just as with css, color can be
specified as a hexadecimal value, a color keyword, the rgba() function, or any of the other available color methods. instead of using fill() and filling the shapes with colors, we can use stroke() to only colour the outer stroke. try adding this code to your javascript too: ctx.beginpath(); ctx.rect(160, 10, 100, 40); ctx.strokestyle = "rgba(0, 0, 255, 0.5)"; ctx.stroke(); ctx.closepath(); the code abov...
Initialize the framework - Game development
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 not. the id of the <canvas> to use for rendering if one already exists on the page (we've
specified null because we want phaser to create its own.) the names to use for phaser's three key functions that load and start the game, and update the game 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 ...
2D maze game with device orientation - Game development
the definitions 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 in that last argument or the element is not found, the canvas will be added to the <body> tag. without the framework, to add the canvas element to the page, you would have to write something like this inside the <body> tag: <canvas id='game' width='320' height='480'></canvas> the important thing to remember is that the framework is setting up helpful methods to speed up a lot of things like ima...
Base64 - MDN Web Docs Glossary: Definitions of Web-related terms
ary data so it can be included in a data: url. in javascript there are two functions respectively for decoding and encoding base64 strings: btoa(): creates a base-64 encoded ascii string from a "string" of binary data ("btoa" should be read as "binary to ascii"). atob(): decodes a base64 encoded string("atob" should be read as "ascii to binary"). the algorithm used by atob() and btoa() is
specified in rfc 4648, section 4. note that btoa() expects to be passed binary data, and will throw an exception if the given string contains any characters whose utf-16 representation occupies more than one byte. for more details, see the documentation for btoa(). encoded size increase each base64 digit represents exactly 6 bits of data. so, three 8-bits bytes of the input string/binary file (3×8 bits...
Selector (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
a css selector is the part of a css rule that describes what elements in a document the rule will match. the matching elements will have the rule's
specified style applied to them. consider this css: p { color: green; } div.warning { width: 100%; border: 2px solid yellow; color: white; background-color: darkred; padding: 0.8em 0.8em 0.6em; } #customized { font: 16px lucida grande, arial, helvetica, sans-serif; } the selectors here are "p" (which applies the color green to the text inside any <p> element), "div.warning" (which makes any <div> element with the class "warning" look like a warning box), and "#customized", which sets the base font of the element with the id "customized" to 16-pixel tall lucida grande or one of a few fallback fonts. we can then apply this cs...
DOM (Document Object Model) - MDN Web Docs Glossary: Definitions of Web-related terms
ode tree, where each node represents part of the document (e.g. an element, text string, or comment). the dom is one of the most-used apis on the web because it allows code running in a browser to access and interact with every node in the document. nodes can be created, moved and changed. event listeners can be added to nodes and triggered on occurrence of a given event. dom was not originally
specified—it came about when browsers began implementing javascript. this legacy dom is sometimes called dom 0. today, the whatwg maintains the dom living standard. ...
Distributed Denial of Service - MDN Web Docs Glossary: Definitions of Web-related terms
eways. ddos concerns computer networks and cpu resource management. in a typical ddos attack, the assailant begins by exploiting a vulnerability in one computer system and making it the ddos master. the attack master, also known as the botmaster, identifies and infects other vulnerable systems with malware. eventually, the assailant instructs the controlled machines to launch an attack against a
specified target. there are two types of ddos attacks: a network-centric attack (which overloads a service by using up bandwidth) and an application-layer attack (which overloads a service or database with application calls). the overflow of data to the target causes saturation in the target machine so that it cannot respond or responds very slowly to legitimate traffic (hence the name "denial of service...
Fallback alignment - MDN Web Docs Glossary: Definitions of Web-related terms
in css box alignment, a fallback alignment is
specified in order to deal with cases where the requested alignment cannot be fullfilled. for example, if you specify justify-content: space-between there must be more than one alignment subject. if there is not, the fallback alignment is used. this is
specified per alignment method, as detailed below. first baseline start last baseline safe end baseline start space-between flex-start (start) space-around center space-evenly center stretch flex-start (start) learn more css box alignment ...
Grid Column - MDN Web Docs Glossary: Definitions of Web-related terms
d column is a vertical track in a css grid layout, and is the space between two vertical grid lines. it is defined by the grid-template-columns property or in the shorthand grid or grid-template properties. in addition, columns may be created in the implicit grid when items are placed outside of columns created in the explicit grid. these columns will be auto-sized by default, or can have a size
specified with the grid-auto-columns property. when working with alignment in css grid layout, the axis down which columns run is known as the block, or column, axis. learn more property reference grid-template-columns grid-auto-columns grid grid-template further reading css grid layout guide: basic concepts of grid layout ...
Grid Row - MDN Web Docs Glossary: Definitions of Web-related terms
a grid row is a horizontal track in a css grid layout, that is the space between two horizontal grid lines. it is defined by the grid-template-rows property or in the shorthand grid or grid-template properties. in addition, rows may be created in the implicit grid when items are placed outside of rows created in the explicit grid. these rows will be auto sized by default, or can have a size
specified with the grid-auto-rows property. when working with alignment in css grid layout, the axis along which rows run is known as the inline, or row, axis. learn more property reference grid-template-rows grid-auto-rows grid grid-template further reading css grid layout guide: basic concepts of grid layout ...
JavaScript - MDN Web Docs Glossary: Definitions of Web-related terms
by the netscape corporation), javascript soon came to netscape navigator 2.0 in september 1995. javascript enjoyed immediate success and internet explorer 3.0 introduced javascript support under the name jscript in august 1996. in november 1996, netscape began working with ecma international to make javascript an industry standard. since then, the standardized javascript is called ecmascript and
specified under ecma-262, whose latest (tenth, es2019) edition is available as of june 2019. recently, javascript's popularity has expanded even further through the successful node.js platform—the most popular cross-platform javascript runtime environment outside the browser. node.js - built using chrome's v8 javascript engine - allows developers to use javascript as a scripting language to automate thi...
Media (CSS) - MDN Web Docs Glossary: Definitions of Web-related terms
k your document's styles—or even offer different styles—according to the media type (such as screen or print, to name two) or media capabilities (such as width, resolution, or other values) of the viewer's device. learn more general knowledge using media queries technical reference media queries define a set of characteristics or parameters required to apply the css styles that are
specified within the curly braces of the media query; for example: only applying certain css styles for devices below 768 pixels. @media at-rule conditionally apply part of a stylesheet, based on the result of a media query. window.matchmedia() test the viewing device against a media query. ...
Navigation directive - MDN Web Docs Glossary: Definitions of Web-related terms
list of csp navigation directives 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. learn more https://www.w3.org/tr/csp/#directives-navigation other kinds of directives: fetch directive document directive reporting directive block-all-mixed-content upgrade-insecure-requests require-sri-for trusted-types content-security-policy ...
Primitive - MDN Web Docs Glossary: Definitions of Web-related terms
ing it, the expression is evaluated, foo is replaced by 5 and the javascript engine passes that value to the functions as an argument before executing the statements inside the functions' bodies, javascript takes a copy of the originally passed argument (which is a primitive) and creates a local copy. these copies, existing only inside the functions' scopes, are accessible via the identifiers we
specified in the functions' definitions (num for addtwo, foo for addtwo_v2) then, the functions' statements are executed: in the first function, a local num variable had been created. we are increasing its value by 2, not the original foo's value! in the second function, a local foo variable had been created. we are increasing its value by 2, not the original (external) foo's value! also, in this...
Quality values - MDN Web Docs Glossary: Definitions of Web-related terms
xt/html and application/xhtml+xml 1.0 application/xml 0.9 */* 0.8 if there is no priority defined for the first two values, the order in the list is irrelevant. nevertheless, with the same quality, more specific values have priority over less specific ones: text/html;q=0.8,text/*;q=0.8,*/*;q=0.8 value priority text/html 0.8 (but totally
specified) text/* 0.8 (partially
specified) */* 0.8 (not
specified) some syntax, like the one of accept, allow additional specifiers like text/html;level=1. these increase the specificity of the value. their use is extremely rare. browser-specific information firefox starting with firefox 18, the quality factor values are clamped to 2 decimal places. they used to be clampe...
XInclude - MDN Web Docs Glossary: Definitions of Web-related terms
.getresponseheader('content-type'); //text/xml; charset="utf-8" // send to get headers first? // fix: we test for file extensions as well in case file:// doesn't return content type (as seems to be the case); can some other tool be uesd in ff (or ie) to detect encoding of local file? ...
XML - MDN Web Docs Glossary: Definitions of Web-related terms
the information technology (it) industry uses many languages based on xml as data-description languages. xml tags resemble html tags, but xml is much more flexible because it lets users define their own tags. in this way xml acts like a meta-language—that is, it can be used to define other languages, such as rss. moreover, html is a presentation language, whereas xml is a data-description language. this means that xml has far broader applications than just the web. ...
HTML: A good basis for accessibility - Learn web development
this is nearly always a bad idea, as it can cause major confusion. use it only if you really need to, for example, if the layout shows things in a very different visual order to the source code, and you want to make things work more logically. there are two other options for tabindex: tabindex="0"...
HTML: A good basis for accessibility - Learn web development
this is nearly always a bad idea, as it can cause major confusion. use it only if you really need to, for example, if the layout shows things in a very different visual order to the source code, and you want to make things work more logically. there are two other options for tabindex: tabindex="0"...
Debugging CSS - Learn web development
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 adds on the padding and border width. the element with a class of box2 is using border-box, so here the padding and border is subtracted from the size that you have given the element. this means that the space taken up on the page by the box is the exact size that you
specified — in our case width: 400px. note: find out more in examining and inspecting the box model. solving specificity issues sometimes during development, but in particular when you need to edit the css on an existing site, you will find yourself having a hard time getting some css to apply. no matter what you do, the element just doesn't seem to take the css. what is generally happening here i...
Overflowing content - Learn web development
w-wrap properties. in addition, some of the methods discussed in sizing items in css may help you create boxes that scale better with varying amounts of content. as with scroll, you get a scrollbar in the scrolling dimension whether or not there is enough content to cause a scrollbar. note: you can specify x and y scrolling using the overflow property, passing two values. if two keywords are
specified, the first applies to overflow-x and the second applies to overflow-y. otherwise, both overflow-x and overflow-y are set to the same value. for example, overflow: scroll hidden would set overflow-x to scroll and overflow-y to hidden. if you only want scrollbars to appear when there is more content than can fit in the box, use overflow: auto. this allows the browser to determine if it should dis...
Grids - Learn web development
e following: .container { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 20px; } you will now get 3 1fr tracks just as before. the first value passed to the repeat function is how many times you want the listing to repeat, while the second value is a track listing, which may be one or more tracks that you want to repeat. the implicit and explicit grid we have only
specified column tracks so far, and yet rows are being created to hold our content. this is an example of the explicit versus the implicit grid. the explicit grid is the one that you create using grid-template-columns or grid-template-rows. the implicit grid is created when content is placed outside of that grid — such as into our rows. the explicit and implicit grids are analogous to the main and cross ...
How CSS is structured - Learn web development
will encounter many other examples of shorthand 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 ...
Styling links - Learn web development
t even more. two points to note here are: the underline has been created using border-bottom, not text-decoration — some people prefer this because the former has better styling options than the latter, and is drawn a bit lower, so doesn't cut across the descenders of the word being underlined (e.g. the tails on g and y). the border-bottom value has been set as 1px solid, with no color
specified. doing this makes the border adopt the same color as the element's text, which is useful in cases like this where the text is a different color in each case. finally, a:active is used to give the links an inverted color scheme while they are being activated, to make it clear something important is happening! active learning: style your own links in this active learning session, we'd like...
Styling lists - Learn web development
ng css: ul { list-style-type: square; list-style-image: url(example.png); list-style-position: inside; } could be replaced by this: ul { list-style: square url(example.png) inside; } the values can be listed in any order, and you can use one, two or all three (the default values used for the properties that are not included are disc, none, and outside). if both a type and an image are
specified, the type is used as a fallback if the image can't be loaded for some reason. controlling list counting sometimes you might want to count differently on an ordered list — e.g. starting from a number other than 1, or counting backwards, or counting in steps of more than 1. html and css have some tools to help you here. start the start attribute allows you to start the list counting from a nu...
What is the difference between webpage, website, web server, and search engine? - Learn web development
in each section are like webpages. one website may have several webpages, e.g., the science section (the website) will have books on heat, sound, thermodynamics, statics, etc. (the webpages). webpages can each be found at a unique location (url). the search index is like the search engine. each book has its own unique location in the library (two books cannot be kept at the same place) which is
specified by the catalog number. active learning there is no active learning available yet. deeper dive so, let's dig deeper into how those four terms are related and why they are sometimes confused with each other. web page a web page is a simple document displayable by a browser. such documents are written in the html language (which we look into in more detail in other articles). a web page can e...
How do you upload your files to a web server? - Learn web development
ignore the bottom and top panes for now. respectively, these are a log of messages showing the connection status between your computer and the sftp server, and a live log of every interaction between your sftp client and the server. uploading to the server our example host instructions told us "to publish on the web, put your files into the public/htdocs directory." you need to navigate to the
specified directory in your right pane. this directory is effectively the root of your website — where your index.html file and other assets will go. once you've found the correct remote directory to put your files in, to upload your files to the server you need to drag-and-drop them from the left pane to the right pane. are they really online? so far, so good, but are the files really online? you can...
Basic native form controls - Learn web development
all form elements. you've met some of these already, but below is a list of those common attributes, for your reference: attribute name default value description autofocus false this boolean attribute lets you specify that the element should automatically have input focus when the page loads. only one form-associated element in a document can have this attribute
specified. disabled false this boolean attribute indicates that the user cannot interact with the element. if this attribute is not
specified, the element inherits its setting from the containing element, for example, <fieldset>; if there is no containing element with the disabled attribute set, then the element is enabled. form the <form> element that the widget is associate...
Sending form data - Learn web development
a valid relative or absolute url. if this attribute isn't provided, the data will be sent to the url of the page containing the form — the current page. in this example, the data is sent to an absolute url — https://example.com: <form action="https://example.com"> here, we use a relative url — the data is sent to a different url on the same origin: <form action="/somewhere_else"> when
specified with no attributes, as below, the <form> data is sent to the same page that the form is present on: <form> note: it's possible to specify a url that uses the https (secure http) protocol. when you do this, the data is encrypted along with the rest of the request, even if the form itself is hosted on an insecure page accessed using http. on the other hand, if the form is hosted on a secure page...
Marking up a letter - Learn web development
places where the letter should have a hyperlink. add appropriate links with titles. for the location that the links point to, you may use http://example.com as the url. mark up the university motto quote and citation with appropriate elements. the head of the document the character set of the document should be set as utf-8 using the appropriate meta tag. the author of the letter should be
specified in an appropriate meta tag. the provided css should be included inside an appropriate tag. hints and tips use the w3c html validator to validate your html. award yourself bonus points if it validates. you don't need to know any css to do this assignment. you just need to put the provided css inside an html element. example the following screenshot shows an example of what the letter mi...
HTML table basics - Learn web development
data 1 data 2 calcutta orange robots jazz this isn't ideal, as we have to repeat the styling information across all three cells in the column (we'd probably have a class set on all three in a real project and specify the styling in a separate stylesheet). instead of doing this, we can specify the information once, on a <col> element. <col> elements are
specified inside a <colgroup> container just below the opening <table> tag. we could create the same effect as we see above by specifying our table as follows: <table> <colgroup> <col> <col style="background-color: yellow"> </colgroup> <tr> <th>data 1</th> <th>data 2</th> </tr> <tr> <td>calcutta</td> <td>orange</td> </tr> <tr> <td>robots</td> <td>jazz</td> <...
Choosing the right approach - Learn web development
t('hello, mr. universe!'); }, 2000) pitfalls you can use recursive settimeout() calls to run a function repeatedly in a similar fashion to setinterval(), using code like this: let i = 1; settimeout(function run() { console.log(i); i++; settimeout(run, 100); }, 100); there is a difference between recursive settimeout() and setinterval(): recursive settimeout() guarantees at least the
specified amount of time (100ms in this example) will elapse between the executions; the code will run and then wait 100 milliseconds before it runs again. the interval will be the same regardless of how long the code takes to run. with setinterval(), the interval we choose includes the time taken to execute the code we want to run in. let's say that the code takes 40 milliseconds to run — the interval ...
Introducing asynchronous JavaScript - Learn web development
e response is not yet available. instead, you need your code to wait until the response is returned before it tries to do anything else to it. there are two main types of asynchronous code style you'll come across in javascript code, old-style callbacks and newer promise-style code. in the below sections we'll review each of these in turn. async callbacks async callbacks are functions that are
specified as arguments when calling a function which will start executing code in the background. when the background code finishes running, it calls the callback function to let you know the work is done, or to let you know that something of interest has happened. using callbacks is slightly old-fashioned now, but you'll still see them in use in a number of older-but-still-commonly-used apis. an example ...
Fetching data from the server - Learn web development
ut modern javascript apis — most of the newer ones are heavily based on promises. let's look at the promise structure from above again to see if we can make some more sense of it: fetch(url).then(function(response) { response.text().then(function(text) { poemdisplay.textcontent = text; }); }); the first line is saying "fetch the resource located at url" (fetch(url)) and "then run the
specified function when the promise resolves" (.then(function() { ... })). "resolve" means "finish performing the
specified operation at some point in the future". the
specified operation, in this case, is to fetch a resource from a
specified url (using an http request), and return the response for us to do something with. effectively, the function passed into then() is a chunk of code that won't run imme...
Introduction to web APIs - Learn web development
function() { const superheroes = request.response; populateheader(superheroes); showheroes(superheroes); } note: you can see this code in action in our ajax.html example (see it live also). the first five lines specify the location of the resource we want to fetch, create a new instance of a request object using the xmlhttprequest() constructor, open an http get request to retrieve the
specified resource, specify that the response should be sent in json format, then send the request. the onload handler function then specifies what we do with the response. we know the response will be successfully returned and available after the load event has fired (unless an error occurred), so we save the response containing the returned json in the superheroes variable, then pass it to two different...
A first splash into JavaScript - Learn web development
ppened? the numbers 1 to 20 were printed out in your console. this is because of the loop. a for loop takes three input values (arguments): a starting value: in this case we are starting a count at 1, but this could be any number you like. you could replace the letter i with any name you like too, but i is used as a convention because it's short and easy to remember. a condition: here we have
specified i < 21 — the loop will keep going until i is no longer less than 21. when i reaches 21, the loop will no longer run. an incrementor: we have
specified i++, which means "add 1 to i". the loop will run once for every value of i, until i reaches a value of 21 (as discussed above). in this case, we are simply printing the value of i out to the console on every iteration using console.log(). now ...
Adding features to our bouncing balls demo - Learn web development
) { if (e.key === 'a') { _this.x -= _this.velx; } else if (e.key === 'd') { _this.x += _this.velx; } else if (e.key === 'w') { _this.y -= _this.vely; } else if (e.key === 's') { _this.y += _this.vely; } } so when a key is pressed, the event object's keycode property is consulted to see which key is pressed. if it is one of the four represented by the
specified keycodes, then the evil circle will move left/right/up/down. for a bonus point, can you tell us why we've had to set let _this = this; in the position it is in? it is something to do with function scope. collisiondetect() this method will act in a very similar way to ball()'s collisiondetect() method, so you can use a copy of that as the basis of this new method. but there are a couple of diff...
Inheritance in JavaScript - Learn web development
as additional arguments in call(). so, for example, if you had something really simple like this: function brick() { this.width = 10; this.height = 20; } you could inherit the width and height properties by doing this (as well as the other steps described below, of course): function blueglassbrick() { brick.call(this); this.opacity = 0.5; this.color = 'blue'; } note that we've only
specified this inside call() — no other parameters are required as we are not inheriting any properties from the parent that are set via parameters. setting teacher()'s prototype and constructor reference all is good so far, but we have a problem. we have defined a new constructor, and it has a prototype property, which by default just contains an object with a reference to the constructor function its...
Object building practice - Learn web development
ball's x and y properties. the radius of the arc — in this case, the ball's size property. the last two parameters specify the start and end number of degrees around the circle that the arc is drawn between. here we specify 0 degrees, and 2 * pi, which is the equivalent of 360 degrees in radians (annoyingly, you have to specify this in radians). that gives us a complete circle. if you had
specified only 1 * pi, you'd get a semi-circle (180 degrees). last of all, we use the fill() method, which basically states "finish drawing the path we started with beginpath(), and fill the area it takes up with the color we
specified earlier in fillstyle." you can start testing your object out already. save the code so far, and load the html file in a browser. open the browser's javascript co...
Object prototypes - Learn web development
e instead is a property containing an object on which you define members that you want to be inherited. revisiting create() earlier on we showed how the object.create() method can be used to create a new object instance. for example, try this in your previous example's javascript console: let person2 = object.create(person1); what create() actually does is to create a new object from a
specified prototype object. here, person2 is being created using person1 as a prototype object. you can check this by entering the following in the console: person2.__proto__ this will return the person1 object. the constructor property every constructor function has a prototype property whose value is an object containing a constructor property. this constructor property points to the original con...
CSS performance optimization - Learn web development
d a <link> to the html mark up, and add a media query, in this case stating it's a print stylesheet. <link rel="stylesheet" href="styles.css"> <!-- blocking --> <link rel="stylesheet" href="print.css" media="print"> <!-- not blocking --> <link rel="stylesheet" href="mobile.css" media="screen and (max-width: 480px)"> <!-- not blocking on large screens --> by default the browser assumes that each
specified style sheet is render blocking. tell the browser when the style sheet should be applied by adding a media attribute with the media query. when the browser sees a style sheet it knows that it only needs to apply it for a specific scenario, it still downloads the stylesheet, but doesn't render block. by separating out the css into multiple files, the main render-blocking file, in this case styles.c...
Website security - Learn web development
. note: this section draws heavily on the information in wikipedia here. cross-site request forgery (csrf) csrf attacks allow a malicious user to execute actions using the credentials of another user without that user’s knowledge or consent. this type of attack is best explained by example. john is a malicious user who knows that a particular site allows logged-in users to send money to a
specified account using an http post request that includes the account name and an amount of money. john constructs a form that includes his bank details and an amount of money as hidden fields, and emails it to other site users (with the submit button disguised as a link to a "get rich quick" site). if a user clicks the submit button, an http post request will be sent to the server containing the transac...
Starting our Svelte Todo list app - Learn web development
the console should currently give you a message along the lines of "<app> was created with unknown prop 'name'". to get rid of this, remove the name prop from src/main.js; it should now look like so: import app from './app.svelte' const app = new app({ target: document.body }) export default app now ...
Getting started with Svelte - Learn web development
mpiled a list of links to useful guides — see git and github. note: if you just want to download the files without cloning the git repo, you can use the degit tool like this — npx degit opensas/mdn-svelte-tutorial. you can also download a specific folder with npx degit opensas/mdn-svelte-tutorial/01-getting-started. degit won't create a local git repo, it will just download the files of the
specified folder. using the svelte repl a repl (read–eval–print loop) is an interactive environment that allows you to enter commands and immediately see the results — many programming languages provide a repl. svelte's repl is much more than that. it's an online tool that allows you to create complete apps, save them online, and share with others. it's the easiest way to start playing with svel...
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
all to newtodo component, like so: <!-- newtodo --> <newtodo on:addtodo={e => addtodo(e.detail)} /> working with dom nodes using the bind:this={dom_node} directive now we want the newtodo <input> to re-gain focus every time the add button is pressed. for that we'll need a reference to the dom node of the input. svelte provides a way to do this with the bind:this={dom_node} directive. when
specified, as soon as the component is mounted and the dom node is created svelte assigns a reference to the dom node to the
specified variable. we'll create a nameel variable and bind it to the input it using bind:this={nameel}. then inside addtodo(), after adding the new todo we will call nameel.focus() to refocus the <input> again. we will do the same when the user presses the escape key, with the onca...
Adding a new todo form: Vue events, methods, and models - Learn web development
: @event.modifier. here is a list of event modifiers: .stop: stops the event from propagating. equivalent to event.stoppropagation() in regular javascript events. .prevent: prevents the event's default behavior. equivalent to event.preventdefault(). .self: triggers the handler only if the event was dispatched from this exact element. {.key}: triggers the event handler only via the
specified key. mdn has a list of valid key values; multi-word keys just need to be converted to kebab case (e.g. page-down). .native: listens for a native event on the root (outer-most wrapping) element on your component. .once: listens for the event until it's been triggered once, and then no more. .left: only triggers the handler via the left mouse button event. .right: only triggers the hand...
Handling common JavaScript problems - Learn web development
ng has finished. loadscript() looks like this: function loadscript(src, done) { const js = document.createelement('script'); js.src = src; js.onload = function() { done(); }; js.onerror = function() { done(new error('failed to load script ' + src)); }; document.head.appendchild(js); } this function creates a new <script> element, then sets its src attribute to the path we
specified as the first argument ('polyfills.js' when we called it in the code above). when it has loaded, we run the function we
specified as the second argument (main()). if an error occurs in the loading of the script, we still call the function, but with a custom error that we can retrieve to help debug a problem if it occurs. note that polyfills.js is basically the two polyfills we are using put toget...
Setting up your own test automation environment - Learn web development
mocha's arbitrary timeout (which is 3 seconds). note: saucelabs-sample-test-frameworks contains several useful examples showing how to set up different combinations of test/assertion tools. running remote tests it turns out that running tests on remote servers isn't that much more difficult than running them locally. you just need to create your driver instance, but with a few more features
specified, including the capabilities of the browser you want to test on, the address of the server, and the user credentials you need (if any) to access it. lambdatest getting selenium tests to run remotely on lambdatest is very simple. the code you need should follow the pattern seen below. let's write an example: inside your project directory, create a new file called lambdatest_google_test.js gi...
Deploying our app - Learn web development
s the code that we want to make public. to finish up, click deploy site. after a short wait for the deployment to occur, you should get a url that you can go to, to see your published site — try it out! and even better, whenever we make a change and push the change to our remote git repository (on github), this will trigger a notification to netlify which will then run our
specified build task and then deploy the resulting dist directory to our published site. try it now — make a small change to your app, and then push it to github using these commands: git add . git commit -m ‘simple netlify test’ git push github master you should see your published site update with the change — this might take a few minutes to publish, so have a little patience. that's...
Client-side tooling overview - Learn web development
d your code from scratch each time. a few very common safety net tool types you will find being used by developers are as follows. linters linters are tools that check through your code and tell you about any errors that are present, what error types they are, and what code lines they are present on. often linters can be configured to not only report errors, but also report any violations of a
specified style guide that you team might be using (for example code that is using the wrong number of spaces for indentation, or using template literals rather than regular string literals). eslint is the industry standard javascript linter — a highly configurable tool for catching potential syntax errors and encouraging "best practices" throughout your code. some companies and projects have also share...
Gecko info for Windows accessibility vendors
es applied to a node. the return value numstyleproperties specifies the number of style properties for this node, and the last 2 parameters return 2 arrays corresponding to style property name and style property value. another [in] parameter, usealternativemediaproperties, indicates whether you want style information for the default media type (usually screen), or a set of alternative media types
specified in nsisimpledomdocument::set_alternateviewmediatype(mediatypestring) . see the w3c's website for a list of official media type name. unfortunately, at this time the argument usealternateview is ignored. hresult get_computedstyle( /* [in] */ unsigned short maxstyleproperties, /* [in] */ boolean usealternateview, // if true, returns properties for media // as set in nsidomdocument::set_alt...
Information for External Developers Dealing with Accessibility
oolkits, widget by widget. in addition, here is a list of official keyboard ui guidelines for each desktop: windows keys: guidelines on keyboard ui design and on implementing keyboard shortcuts: an excellent resource from microsoft. mac keys: keyboard shortcuts quick reference for mac os x complete reference on keyboard for mac os x: this document list all functions of
specified keys, known keyboard shortcuts, explains how to create keyboard shortcuts, explains appropriate use for the arrow keys, how to move the insertion point with keys, how to extent text selection with keys, functions of function keys, what are reserved keyboard shortcuts, how to create your own keyboard shortcuts, keyboard focus and navigation, type-ahead and key-repeat, etc. gnome keys: keyboa...
Adding a new word to the en-US dictionary
locales/hunspell/dictionary-sources there's a special script used for editing dictionaries. the script only works if you have the environment variable editor set to the executable of an editor program; if you don't have it set, you can do editor=vim sh edit-dictionary to edit using vim (or you can substitute some other editor), or you can just do sh edit-dictionary if you have an editor already
specified. add and remove words in the dictionary file, then quit the editor. sh merge-dictionaries to process the dictionary changes you've made. move the revised dictionary file into position: mv en-us.dic .. build firefox and test your updated dictionary. ...
Chrome registration
ee different sets of files, for windows and os/2, macintosh, and unix-like platforms. for example, the order of the "ok" and "cancel" buttons in a dialog is different, as well as the names of some items. the "platform" modifier is only parsed for content registration; it is not recognized for locale or skin registration. however, it applies to content, locale, and skin parts of the package, when
specified. to indicate that a package is platform-specific, add the "platform" modifier to the "content" line after the path, for example: content global-platform jar:toolkit.jar!/toolkit/content/global-platform/ platform once that is
specified in your manifest you then ensure that under the directory global-platform are subdirectories win (windows/os2), mac (os9/osx), or unix (everything else). anythi...
Continuous Integration
firefox and chrome. eventually, the system will likely be expanded with support for android. post-job analysis and alerts there is some analysis of test data that occurs out-of-band after jobs complete. perfherder alerts we track changes to talos and other performance frameworks inside perfherder, and try to automatically alert when there is a sustained change exceeding a certain magnitude (
specified per test). performance sheriffs review the list of alerts on a regular basis and file bugs if appropriate. you can view the current set of alerts on the perfherder alerts dashboard. intermittent failures after functional tests complete, test log data are combined with treeherder's failure classification data. the result is the treeherder intermittent failures view. the "orange factor" is the av...
Creating Sandboxed HTTP Connections
, a new nsichannel is created, and both the old and new ones are passed in as arguments. since nsistreamlistener does not 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. below is an example: // global channel var gchannel; // init the channel // the io service var ioservice = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); // create an nsiuri var uri = ioservice.newuri(myurlstring, null, null); // get a channel for that nsiu...
Debugging Frame Reflow
ormation is used. the block has been required to compute the max. element size only once and it reports now: block 02d7bcf8 d=1410,300 the block shows the same address as the previous one. frames with children that overflow the parent have the ns_frame_outside_children flag set. for these frames the overflow area is displayed as block 025ed8f0 d=8940,1020 o=(0,0) 9180 x 1020. the overflow area is
specified as (x,y) origin and width x height. the reflow finishes at the same level where it started. advanced reflow debugging the previously described technique dumps the data for every frame. sometimes the log is clearer if only the main frames are shown. the entries in the reflow log can be controlled on a frame level. for instance adding text 0 to the rules in reflow_rules.txt would hide the text entr...
Adding APIs to the navigator object
var categorymanager = components.classes["@mozilla.org/categorymanager;1"] .getservice(components.interfaces.nsicategorymanager); categorymanager.addcategoryentry("javascript-navigator-property", "myapi", my_contract_id, false, true); this adds a new object, myapi, to the window.navigator object. the newly added object is a reference to the component
specified by the contract id my_contract_id. you can learn more about contract ids are unique text identifiers for xpcom components. using a manifest to add an object to navigator you can also add an object to the window.navigator object by using the chrome manifest of an add-on: component {ffffffff-ffff-ffff-ffff-ffffffffffff} mycomponent.js contract @mozilla.org/mycomponent;1 {ffffffff-ffff-ffff-ffff-...
Configuring Build Options
alternatively, use the moz_build_projects make option. using moz_build_projects in a single mozconfig to use moz_build_projects, you must specify a moz_objdir and a moz_build_projects make option, containing space separated names. each name can be an arbitrary directory name. for each name, a subdirectory is created under the toplevel objdir. you then need to use the ac_add_app_options with the
specified names to enable different applications in each object directory. for example: ac_add_options --disable-optimize --enable-debug mk_add_options moz_objdir=/mozilla/src/obj-@config_guess@ mk_add_options moz_build_projects="browser mail" ac_add_app_options browser --enable-application=browser ac_add_app_options mail --enable-application=comm/mail if you want to build only one project using t...
The Firefox codebase: CSS Guidelines
consider using an actual <img> tag (for html documents) or list-style-image (for xul documents) if rendering the image is important. if you are not using windows, one way to test against those adjustments on other platforms is: going to about:preferences clicking on the "colors..." button in the "fonts & colors" sub-section of the "language and appearance" section under "override the colors
specified by the page with your selections above", select the "always" option chrome area the automatic adjustments previously mentioned only apply to pages rendered in the content area. the chrome area of firefox uses colors as authored, which is why using pre-defined variables, currentcolor or inheritance is useful to integrate with the system theme with little hassle. if not, as a last resort, using...
Gecko Logging
" there are special module names to change logging behavior. you can specify one or more special module names without logging level. special module name append append new logs to existing log file. sync print each log synchronously, this is useful to check behavior in real time or get logs immediately before crash. raw print exactly what has been
specified in the format string, without the process/thread/timestamp, etc. prefix. timestamp insert timestamp at start of each log line. rotate:n this limits the produced log files' size. only most recent n megabytes of log data is saved. we rotate four log files with .0, .1, .2, .3 extensions. note: this option disables 'append' and forces 'timestamp'. for example, if you...
Commenting IDL for better documentation
vel; /** * feeds a cookie to the cookie monster. * @param cookietoeat the nsicookie to eat. */ void eatcookie(in nsicookie cookietoeat); /** * sings the song "c is for cookie." */ void sing(); /** * returns a string containing a funny quote the cookie monster might say. * * @param number the saying number to return. * * @returns an astring containing the requested funny quote. if the
specified * quote number is invalid, an exception is thrown. * * @throws ns_error_failure unable to locate the requested quote. */ astring getfunnysaying(in integer number); /** * says something appreciative of the tastiness of the cookie in the
specified * language. * * @param language the localization identification indicating the language in * which the cookie monster is to express his love of...
Error codes returned by Mozilla APIs
c_illegalinput (0x8050000e) ns_imagelib_error_failure (0x80540005) ns_imagelib_error_no_decoder (0x80540006) ns_imagelib_error_not_finished (0x80540007) ns_imagelib_error_load_aborted (0x80540008) ns_error_wont_handle_content (0x805d0001) moz_error_storage_error (0x80630001) ns_error_schemavalidator_no_schema_loaded (0x80640001) ns_error_schemavalidator_no_dom_node_
specified (0x80640002) ns_error_schemavalidator_no_type_found (0x80640003) ns_error_schemavalidator_type_not_found (0x80640004) note: there are other errors in these files: gfx/public/nsidevicecontext.h base/public/nsneterror.h parser/htmlparser/public/nsiparser.h layout/base/nslayouterrors.h profile/public/nsiprofileinternal.idl security/manager/ssl/public/nsicmsmessageerrors.idl dir...
Experimental features in Firefox
for more details. release channel version added enabled by default? nightly 77 no developer edition 77 no beta 77 no release 77 no preference name layout.css.grid-template-masonry-value.enabled media feature: prefers-contrast the prefers-contrast media feature is used to detect whether the user has
specified a preference for higher (or lower) contrast in the presentation of web content. refer to bug 1506364 for more details. release channel version added enabled by default? nightly 80 no developer edition 80 no beta 80 no release 80 no preference name layout.css.prefers-contrast.enabled apis graphics: ...
Multiple Firefox profiles
name to the target path, but outside of the quotes, replacing "profile_name" with the actual profile name you chose. if you would also like to allow multiple instances of firefox to run at the same time, add -no-remote after the profile name. once you are all done, click ok. do this for each icon you'd like to have a specific profile for. once done, each one should automatically start with the
specified profile. linux there is no extremely straightforward way to create custom application launchers in gnome 3 like there was in gnome 2. the following tutorial will help get you going overall: gnome 3 custom application launcher. once you get to the point of adding a new item, you can have the profile dialog show up every time or set the launcher to launch a specific profile. if you want to have ...
Browser API
ed (it is used only by the firefox devtools at this point). see bug 1503070 for more details. the methods removed in firefox 65 are: htmliframeelement.addnextpaintlistener() defines a handler to listen for the next mozafterpaint event in the browser <iframe>. htmliframeelement.clearmatch() clears any content highlighted by findall() or findnext(). htmliframeelement.download() downloads a
specified url, storing it at the
specified filename/path. htmliframeelement.executescript() allows a
specified script to be executed against a page loaded in the browser <iframe>. htmliframeelement.findall() searches for a string in a browser <iframe>'s content; if found, the first instance of the string relative to the caret position will be highlighted. htmliframeelement.findnext() highlights the n...
-moz-window-dragging
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 draggable formal syntax drag | no-drag example toolbarpaletteitem { -moz-window-dragging: ...
overflow-clip-box
efault, padding-box is used everywhere, but <input type="text"> and similar use the value content-box. prior to firefox 29, this behavior was hardcoded; since then it uses this property that can be used elsewhere too. note that this property is activated by default only in the ua stylesheet and chrome contexts. initial valuepadding-boxapplies toall elementsinheritednomediavisualcomputed valueas
specifiedanimation typediscretecanonical orderthe unique non-ambiguous order defined by the formal grammar 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 syntax padding-box | content-box examples padding-box html <div class="things"> <input value="abcdefghijklmnopqrst...
MozBeforePaint
and smil animations being performed within the same window. usage outline in order to time your animation, the first thing you need to know is the time base; that is, the time at which your animation sequence started. you can determine this value by looking at window.mozanimationstarttime. this new property indicates the time, in milliseconds since epoch, at which all animations started in the
specified window during the current refresh interval should be considered to have started running. with that value in hand, you can then schedule all your subsequent animation frames. whenever you're ready to refresh your animation, you call the window.requestanimationframe() method. once you've called this, the mozbeforepaint event will be fired one time, when it's time for animations to be updated for t...
Embedding Tips
can be used to step through the pages. when finished with preview mode, call nsiwebbrowserprint::exitprintpreview(). how do i get popup windows working? implement and register a nsiwindowcreator object with the window watcher service. the nsiwindowcreator::createchromewindow method will be called whenever gecko needs to open a new window. this method should create the new browser window in the
specified style and hand back the nsiwebbrowserchrome interface to it. nscomptr<nsiwindowwatcher> wwatch(do_getservice(ns_windowwatcher_contractid)); if (wwatch) { wwatch->setwindowcreator(mywindowcreator); } i need the javascript inside the browser window to talk to my embedding client. how do i do it? at startup use the category manager to register properties of the global object in javascript like...
Script security
s 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 expanded principals that include its origin, and any other content principals with the same origin. expanded principal an expanded principal is
specified as an array of origins: ["http://mozilla.org", "http://moz.org"] the expanded principal subsumes every content principal it contains. the content principals do not subsume the expanded principal, even if the expanded principal only contains a single content principal. thus ["http://moz.org"] subsumes "http://moz.org" but not vice versa. the expanded principal gets full access to the content pr...
HTTP Cache
ies also looks into the memory-only storage; when instructed via a special argument also primarily looks into application caches application cache (appcachestorage): when a consumer has a specific nsiapplicationcache (i.e. ...
How Mozilla determines MIME Types
ernalhelperappservice.cpp line 463 (this is done for speed – it is faster to find data in the hardcoded list than asking the os or looking in preferences) if the extension is not listed there, it becomes interesting. firstly, the operating system is asked for a mime type. (on unix, this means checking mime.types.) if that fails, a user-supplied helper app is searched for by extension, and the
specified mime type will be used. (i.e. the list in edit/preferences/helper applications) if that failed, a list of "extra" mime types is searched for an extension match. see line 507 for the complete list. if that also failed, the list of loaded plugins is checked for a plugin that can handle this extension, and is asked for the mime type if no plugin is registered, the ext-to-type-mapping xpcom categor...
Add-on Repository
g boolean true if a search is currently in progress; otherwise false. methods getrecommendedurl() returns the url that can be visited to see recommended add-ons. string getrecommendedurl(); parameters none. return value an url indicating the repository's page of recommended add-ons. getsearchurl() returns an url of a web page that can be visited to see search results for the
specified search terms. string getsearchurl( in string searchterms ); parameters searchterms search terms used to search the repository. return value the url of the search results page for the
specified search terms. cancelsearch() cancels the search in progress. does nothing if there is no search in progress. void cancelsearch(); parameters none. retrieverecommendedaddons() begins a sear...
DeferredTask.jsm
the current task state. bool ispending(); return value returns true if pending, false otherwise. start obsolete since gecko 28 start (or postpone) task. void start(); flush obsolete since gecko 28 perform any postponed task immediately. void flush(); cancel obsolete since gecko 28 cancel any pending task. void cancel(); arm request the execution of the task after the delay
specified on construction. multiple calls don't introduce further delays. if the task is running, the delay will start when the current execution finishes. the task will always be executed on a different tick of the event loop, even if the delay
specified on construction is zero. multiple "arm" calls within the same tick of the event loop are guaranteed to result in a single execution of the task. by des...
Download
mise start(); parameters none. promise resolves to undefined when the download has finished successfully and you can access the target file. promise can be rejected with downloaderror if the download failed. launch() opens or executes the target file after download has completed. if the launcherpath property is null, the file will be opened with the default application for the mime type
specified in the contenttype property. if the content type is not available, an attempt will be made to obtain it from the extension of the target file. if the launcherpath property is set, the file will be opened with the
specified custom application. promise launch(); parameters none. promise resolves to undefined when the instruction to launch the file has been successfully given to the operating...
DownloadList
omise removeview( object aview ); parameters aview optional the view object to remove. promise resolves to undefined when the view has been removed. at this point, the removed view will not receive any more notifications. removefinished() removes downloads from the list that have finished, have failed, or have been canceled without keeping partial data. a filter function may be
specified to remove only a subset of those downloads. this method finalizes each removed download, ensuring that any partially downloaded data associated with it is also removed. promise removefinished( function afilterfn ); parameters afilterfn the filter function is called with each download as its only argument, and should return true to remove the download and false to keep it. this p...
Http.jsm
text and the xhr object. logger an object that implements the debug and log methods (e.g. log.jsm). headers or post data are given as an array of arrays, for each inner array the first value is the key and the second is the value. for example: [["key1", "value1"], ["key2", "value2"]]. submitting post data httprequest allows attaching data to the post requests. the data can be
specified via postdata option. postdata can be of 2 different types: a string or an array of parameters. when null/undefined is given, no post data will be attached. if a string is given the data will be appended to the request as is. in case an array of parameters is given, it will be treated as an array of key-value pairs. the elements of the array will be url-encoded and "application/x-www-form-urlencod...
ISO8601DateUtils.jsm
pt date object. string create( adate ); parameters adate a javascript date object to translate into an iso 8601 format string. return value an iso 8601 format date string. parse converts an iso 8601 format date string into a javascript date object. date parse( adatestring ); parameters adatestring an iso 8601 format date string. return value a javascript date object corresponding to the
specified date string. ...
Examples
hain. let lastpromise = newpromise.then(null, components.utils.reporterror); in this case, if the file existence check succeeds, the onfulfill callback is invoked. when the callback finishes execution, newpromise will be fulfilled with an undefined fulfillment value, because the callback does not return any value. when newpromise is fulfilled, nothing happens, because no fulfillment callback is
specified and the return value of the last then method is ignored. if the file existence check fails, for example because access is denied, promise is rejected with an os.file.error instance. this state will propagate to newpomise, and components.utils.reporterror will report all the details of the exception to the console. using a promise returned by a function (compact) the same code as the previous e...
Localizing extension descriptions
versa). if there is more than one locale with the same number of matching parts, then use the most general one (e.g., en in preference to en-gb when searching for en-us). the current app locale will be searched for and then there will be a fallback search for en-us. if a preference isn't set and there isn't a matching em:localized property for the current locale or en-us, then the properties
specified directly on the install manifest are used as a last resort, as they were always used before gecko 1.9. localizing before gecko 1.9 before gecko 1.9, add-on developers must go through a special process to define localized add-on descriptions for add-ons targeting toolkit-based apps (such as firefox or thunderbird). if you do not currently have them, create localized properties files. make su...
Localization technical reviews
name just after the moz_langpack_creator. the team can also wrap contributors with <em:contributor> tags just after the moz_langpack_contributors section. make sure that the the text content is wrapped with emptylines. leading comments are ok, but watch out for #filter emptylines #define ... # comment #define ... #unfilter emptylines in toolkit/defines.inc, the native name of the language is
specified, which is used as description for the built language packs. region.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 accordin...
Setting up the infrastructure
php with gettext support, apache and some unix experience. create a new branch for l10n (optional if starting a new project). create a locale directory in your website (usually something like docroot/locale). copy the shell scripts from /addons/trunk/site/app/locale/ to your locale directory: extract-po.sh will be used to extract all english strings from your application's directories
specified in source_dirs, merge the resulting template (*.pot) file with the existing (already containing translations) messages.po files for each locale (if they exist) and merge the new messages.po files to messages.mo files. by default the script looks for gettext calls in *thtml or *.php files, so you may need to adjust that to your code. compile-mo.sh will only compile all locales' messages.po file...
Mozilla Framework Based on Templates (MFBT)
emporary for it will assert. (an unnamed temporary lives for a shorter period of time than the scope where it's found, so it usually isn't what was desired.) data structures linkedlist.h implements a type-safe doubly-linked list class. most new code should use this rather than prclist. rangedptr.h implements rangedptr, a smart pointer template whose value may be manipulated only within a range
specified at construction time, and which may be dereferenced only at valid locations in that range. this pointer is a useful way to expose access to values within an array. refptr.h implements various smart pointer templates to simplify reference counting of values of particular classes. scoped.h implements scope-based resource management, to simplify the task of cleaning up resources when leaving a sc...
Fonts for Mozilla 2.0's MathML engine
ted by specific unicode characters. mozilla can display any of these symbols provided suitable unicode fonts are installed. furthermore, in accordance with the w3c css2 recommendation on fonts, authors can specify an ordered list of particular fonts which they prefer (using the font-family property of css), with the assurance that mozilla's font engine will hunt for alternate fonts whenever their
specified fonts are not found on a particular user's system. if no appropriate font is ultimately found for a given character, mozilla will instead display a box containing the hexadecimal representation of the unicode code point for the character. some mathematical operators are also drawn by using glyphs for larger variants of the character (e.g. summation symbol) or by assembling glyphs for a few pieces...
Mozilla MathML Status
he native support. references to mathml 3 are given. the sections are marked with their current status: supported, in progress, and not currently supported. sections related to semantics/content mathml or irrelevant features are left blank or not listed at all. if only the main features of an element are implemented then its section is marked as supported but details of unsupported attributes are
specified below. the top-level math element see § 2.2. attribute notes display implemented. maxwidth, overflow not implemented. see bug 534962. altimg, altimg-width, altimg-height, altimg-valign, alttext accepted, but do not have any effect on the rendering. mathml is always enabled since bug 660762. cdgroup accepted, but does not have any effect...
Mozilla Style System Documentation
e every time they are needed. the code that does this sharing work is mostly in nsstylecontext::getstyledata, nsrulenode::getstyledata, and nsrulenode::walkruletree. when nsrulenode::walkruletree computes a struct, it walks the rules, starting with the style context's rule node, towards the root of the rule tree. it uses the appropriate declaration struct and has each rule fill in any properties
specified by that rule that are not filled in already. the walking stops when all of the properties are filled in or when the root of the rule tree is reached. then the style struct is computed from the declaration and stored at the appropriate location in the rule tree or on the style context. problems: dynamic style changes often destroy too much data. css stylesheet backend css stylesheet loading [t...
BloatView
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. ...
GC and CC logs
browserenv["moz_cc_log_shutdown"] = "1" analyzing gc and cc logs there are numerous scripts that analyze gc and cc logs on github. to find out why an object is being kept alive, the relevant scripts are find_roots.py and parse_cc_graph.py (which is called by find_roots.py). calling find_roots.py on a cc log with a specific object or kind of object will produce paths from rooting objects to the
specified objects. most big leaks include an nsglobalwindow, so that's a good class to try if you don't have any better idea. to fix a leak, the next step is to figure out why the rooting object is alive. for a c++ object, you need to figure out where the missing references are from. for a js object, you need to figure out why the js object is reachable from a js root. for the latter, you can use the corr...
Measuring performance using the PerfMeasurement.jsm code module
windows (bug 583322) and osx (bug 583323) as well, and we welcome patches for other operating systems. for instance, let's measure instructions executed, cache references, and cache misses: let monitor = new perfmeasurement(perfmeasurement.cpu_cycles | perfmeasurement.cache_references | perfmeasurement.cache_misses); this creates a new perfmeasurement object, configured to record the
specified event types. it doesn't, however, start to record data. now we want to benchmark a function that is pretty fast (but not fast enough), so we run it several thousand times: for (let i = 0; i < 10000; i++) { set_up_some_state(); monitor.start(); code_to_be_benchmarked(); monitor.stop(); clean_up_afterward(); } we call the perfmeasurement object's start() method when we want to start reco...
Refcount tracing and balancing
jects being logged. for example: env xpcom_mem_log_classes=nsdocshell xpcom_mem_refcnt_log=./refcounts.log ./mach run this will log the addref and release calls only for instances of nsdocshell while running the browser using mach, to a file refcounts.log. note that setting xpcom_mem_log_classes will also list the serial number of each object that leaked in the "bloat log" (that is, the file
specified by the xpcom_mem_bloat_log variable; see the bloatview documentation for more details). an object's serial number is simply a unique number, starting at one, that is assigned to the object when it is allocated. you may use an object's serial number with the following variable to further restrict the reference count tracing: xpcom_mem_log_objects set this variable to a comma-separated lis...
browser.dom.window.dump.file
changes require an application restart. type:string default value:none exists by default: no application support: gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) status: active; last updated 2012-03-18 introduction: pushed to nightly on 2009-04-24 bugs: bug 489938 values the value holds the file system path for the file in which the content of the window.dump() calls get written, e.g. c:\dump.txt . it will be created if it doesn't exist yet. ...
Preference reference
.altclicksave controls whether clicking a link while holding the alt key starts the download of that link.browser.dom.window.dump.enabledthis setting enables the dump function, which sends messages to the system console. set it to true to enable it, or false to disable it.browser.dom.window.dump.filebrowser.dom.window.dump.file redirects the ouput of window.dump() calls to a file whose address is
specified in this preference if browser.dom.window.dump.enabled is set to true. changes require an application restart.browser.download.lastdir.savepersitebrowser.download.lastdir.savepersite controls whether the directory preselected in the file picker for saving a file download is being remembered on a per-website (host) base. if set to true, the data is stored as content preference.browser.pagethumbnail...
Preferences system
<preferences> <preference id="pref1" name="pref.name" type="bool"/> </preferences> .. ui elements that refer to the preferences above, e.g.: <checkbox id="check1" preference="pref1" label="&check1.label;" accesskey="&check1.accesskey;"/> </prefpane> <prefpane id="pane2" label="&pane2.title;" src="chrome://uri/to/pane.xul"/> </prefwindow> pane content can be
specified inline or an external chrome uri supplied for pane content to be loaded in via a dynamic overlay. you should be careful to read the higs for the platforms you are targeting and use the xul preprocessor if necessary to set different window titles as appropriate. you should also be careful to specify the width of the window (in em) as appropriate using the preprocessor for each targeted platform, a...
AsyncTestUtils extended framework
efinitions. look at the section on synthetic message sets above to understand how to specify these. create a single folder with messages in it let [folder, set1, set2, ...] = make_folder_with_sets([asynsetdef1, asynsetdef2, ...]); yield wait_for_message_injection(); this creates a folder with an automatically generated name and adds one or more sets of messages to it. if multiple sets are
specified, their messages will be interleaved. example: let [folder, messageset] = make_folder_with_sets([{count: 3}]); this creates a new folder with a set of three messages in it and saves the folder handle into 'folder' and the message set into 'messageset'. another example: let [foobarfolder, fooset, barset] = make_folder_with_sets([{count: 3, subject: "foo"}, {count: 3, subject: "bar"}]); this cre...
Condition Variables
d data. the association between a condition and a monitor is established when a condition variable is created, and the association persists for its life. in addition, a static association exists between the condition and some data within the monitor. this data is what will be manipulated by the program under the protection of the monitor. a call to pr_waitcondvar causes a thread to block until a
specified condition variable receives notification of a change of state in its associated monitored data. other threads may notify the condition variable when changes occur. for an introduction to nspr thread synchronization, including locks and condition variables, see introduction to nspr. for reference information on nspr locks, see locks. nspr provides a special type, prmonitor, for use with java. u...
Date and Time
rfaces, represents time in the familiar year, month, day, hour, minute, second components. in this form, the time zone information is important. for example, without specifying the time zone, the time 8:00am 1 may 1998 is ambiguous. the nspr data type for clock/calendar time, called an exploded time, has the time zone information in it, so that its corresponding point in absolute time is uniquely
specified. note that absolute and clock times are not normally used in timing operations. for functions that deal with the measurement of elapsed time and with timeouts, see interval timing. macros for time unit conversion types and constants time parameter callback functions functions macros for time unit conversion macros for converting between seconds, milliseconds, microseconds, and nanoseco...
I/O Functions
his chapter, see i/o types. functions that operate on pathnames functions that act on file descriptors directory i/o functions socket manipulation functions converting between host and network addresses memory-mapped i/o functions anonymous pipe function polling functions pollable events manipulating layers functions that operate on pathnames a file or directory in a file system is
specified by its pathname. nspr uses unix-style pathnames, which are null-terminated character strings. only the ascii character set is supported. the forward slash (/) separates the directories in a pathname. nspr converts the slashes in a pathname to the directory separator of the native os--for example, backslash (\) on windows and colon (:) on mac os--before passing it to the native system calls. some...
Introduction to NSPR
fication 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 definitively 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 time elapsed re-asserted when the call returns. philosophically, timeouts should be treated as explicit notifications, and therefore req...
Locks
itor is intended for use with java and reflects the java approach to thread synchronization. for an introduction to nspr thread synchronization, including locks and condition variables, see introduction to nspr. for reference information on nspr condition variables, see condition variables. lock type prlock lock functions pr_newlock creates a new lock object. pr_destroylock destroys a
specified lock object. pr_lock locks a
specified lock object. pr_unlock unlocks a
specified lock object. ...
Monitors
or, which creates a new monitor object, all monitor functions require a pointer to an opaque object of type prmonitor. monitor functions all monitor functions are thread-safe. however, this safety does not extend to protecting the monitor object from deletion. pr_newmonitor creates a new monitor. pr_destroymonitor destroys a monitor object. pr_entermonitor enters the lock associated with a
specified monitor. pr_exitmonitor decrements the entry count associated with a
specified monitor. pr_wait waits for a notify on a
specified monitor's condition variable. pr_notify notifies a thread waiting on a
specified monitor's condition variable. pr_notifyall notifies all threads waiting on a
specified monitor's condition variable. ...
PLHashEnumerator
inue enumerating entries */ #define ht_enumerate_stop 1 /* stop enumerating entries */ #define ht_enumerate_remove 2 /* remove and free the current entry */ #define ht_enumerate_unhash 4 /* just unhash the current entry */ description plhashenumerator is a function type used in the enumerating a hash table. when all the table entries are enumerated, each entry is passed to a user-
specified function of type plhashenumerator with the hash table entry, an integer index, and an arbitrary piece of user data as argument. remark the meaning of ht_enumerate_unhash is not clear. in the current implementation, it will leave the hash table in an inconsistent state. the entries are unlinked from the table, they are not freed, but the entry count (the nentries field of the plhashtable structu...
PL_HashString
a general-purpose hash function for character strings. syntax #include <plhash.h> plhashnumber pl_hashstring(const void *key); parameter the function has the following parameter: key a pointer to a character string. returns the hash number for the
specified key. description pl_hashstring can be used as the key hash function for a hash table if the key is a character string. ...
PL_HashTableAdd
add a new entry with the
specified key and value to the hash table. syntax #include <plhash.h> plhashentry *pl_hashtableadd( plhashtable *ht, const void *key, void *value); parameters the function has the following parameters: ht a pointer to the the hash table to which to add the entry. key a pointer to the key for the entry to be added. value a pointer to the value for the entry to be added. returns a pointer to the new entry. description add a new entry with the
specified key and value to the hash table. if an entry with the same key already exists in the table, the freeentry function is invoked with the ht_free_value flag. you can write your freeentry function to free the value of the
specified entry if the old value should be freed. the default freeentry function doe...
PL_HashTableEnumerateEntries
enumerates all the entries in the hash table, invoking a
specified function on each entry. syntax #include <plhash.h> printn pl_hashtableenumerateentries( plhashtable *ht, plhashenumerator f, void *arg); parameters the function has the following parameters: ht a pointer to the hash table whose entries are to be enumerated. f function to be applied to each entry. arg argument for function f. returns the number of entries enumerated. description the entries are enumerated in an un
specified order. for each entry, the enumerator function is invoked with the entry, the index (in the sequence of enumeration, starting from 0) of the entry, and arg as arguments. ...
PL_strcpy
copies a string, up to and including the trailing '\0', into a destination buffer. syntax char * pl_strcpy(char *dest, const char *src); parameters the function has these parameters: dest pointer to a buffer. on output, the buffer contains a copy of the string passed in src. src pointer to the string to be copied. returns the function returns a pointer to the buffer
specified by the dest parameter. description if the string
specified by src is longer than the buffer
specified by dest, the buffer will not be null-terminated. ...
PL_strlen
returns the length of a
specified string (not including the trailing '\0') syntax pruint32 pl_strlen(const char *str); parameter the function has these parameter: str size in bytes of item to be allocated. returns if successful, the function returns length of the
specified string. ...
PRDir
directory structure used with directory i/o functions. syntax #include <prio.h> typedef struct prdir prdir; description the opaque structure prdir represents an open directory in the file system. the function pr_opendir opens a
specified directory and returns a pointer to a prdir structure, which can be passed to pr_readdir repeatedly to obtain successive entries (files or subdirectories in the open directory). to close the directory, pass the prdir pointer to pr_closedir. ...
PR_Initialize
the type for the root function used by pr_initialize is
specified as follows: syntax typedef printn (pr_callback *prprimordialfn)(printn argc, char **argv); see also pr_initialize ...
PRThreadScope
syntax #include <prthread.h> typedef enum prthreadscope { pr_local_thread, pr_global_thread pr_global_bound_thread } prthreadscope; enumerators pr_local_thread a local thread, scheduled locally by nspr within the process. pr_global_thread a global thread, scheduled by the host os. pr_global_bound_thread a global bound (kernel) thread, scheduled by the host os description an enumerator of type prthreadscope specifies how a thread is scheduled: either locally by nspr within the process (a local thread) or globally by the host (a global thread). ...
PRThreadType
syntax #include <prthread.h> typedef enum prthreadtype { pr_user_thread, pr_system_thread } prthreadtype; enumerators pr_user_thread pr_cleanup blocks until the last thread of type pr_user_thread terminates. pr_system_thread nspr ignores threads of type pr_system_thread when determining when a call to pr_cleanup should return. description threads can be either user threads or system threads. nspr allows the client to synchronize the termination of all user threads and ignores those created as system threads. this arrangement implies that a system thread should not have volatile data that needs to be safely stored away. ...
PR_APPEND_LINK
appends an element to the end of a list. syntax #include <prclist.h> pr_append_link ( prclist *elemp, prclist *listp); parameters elemp a pointer to the element to be inserted. listp a pointer to the list. description pr_append_link adds the
specified element to the end of the
specified list. ...
PR_ASSERT
terminates execution when a given expression is false. syntax #include <prlog.h> void pr_assert ( expression ); parameters the macro has this parameter: expression any valid c language expression that evaluates to true or false. returns nothing description this macro evaluates the
specified expression. when the result is zero (false) the application terminates; otherwise the application continues. the macro converts the expression to a string and passes it to pr_assert, using file and line parameters from the compile-time environment. this macro compiles to nothing if compile-time options are not
specified to enable logging. ...
PR_Accept
syntax #include <prio.h> prfiledesc* pr_accept( prfiledesc *fd, prnetaddr *addr, printervaltime timeout); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing the rendezvous socket on which the caller is willing to accept new connections. addr a pointer to a structure of type prnetaddr. on output, this structure contains the address of the connecting entity. timeout a value of type printervaltime specifying the time limit for completion of the accept operation. returns the function returns one of the following values: upon successful acceptance of a connection, a pointer to a new prfiledesc structure representing the newly accepted connection. ...
PR_Assert
g and terminates execution. syntax #include <prlog.h> void pr_assert ( const char *s, const char *file, printn ln); parameters the function has these parameters: s a string to be displayed in the log. file the file name of the compilation unit containing this function call. ln the line number within the
specified file of this function call. returns nothing description this function displays data in the log. normally an application would not call this function directly; use pr_assert instead. ...
PR_Available
syntax #include <prio.h> print32 pr_available(prfiledesc *fd); parameter the function has the following parameter: fd pointer to a prfiledesc object representing a file or socket. returns the function returns one of the following values: if the function completes successfully, it returns the number of bytes that are available for reading. for a normal file, these are the bytes beyond the current file pointer. if the function fails, it returns the value -1. ...
PR_Available64
syntax #include <prio.h> print64 pr_available64(prfiledesc *fd); parameter the function has the following parameter: fd pointer to a prfiledesc object representing a file or socket. returns the function returns one of the following values: if the function completes successfully, it returns the number of bytes that are available for reading. for a normal file, these are the bytes beyond the current file pointer. if the function fails, it returns the value -1. ...
PR_Bind
binds an address to a
specified socket. syntax #include <prio.h> prstatus pr_bind( prfiledesc *fd, const prnetaddr *addr); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing a socket. addr a pointer to a prnetaddr object representing the address to which the socket will be bound. returns the function returns one of the following values: upon successful binding of an address to a socket, pr_success. if unsuccessful, pr_failure. further information can be obtained by calling pr_geterror. description when a new socket is created, it has no address bound to it. pr_bind assigns the
specified address (also known as name) to the socket. if you do not care about the exact ip address assigned to the socket, set the inet.ip field ...
PR_Calloc
uint32 nelem, pruint32 elsize); parameters nelem the number of elements of size elsize to be allocated. elsize the size of an individual element. returns an untyped pointer to the allocated memory, or if the allocation attempt fails, null. call pr_geterror() to retrieve the error returned by the libc function malloc(). description this function allocates memory on the heap for the
specified number of objects of the
specified size. all bytes in the allocated memory are cleared. ...
PR_CEnterMonitor
onitor(void *address); parameter the function has the following parameter: address a reference to the data that is to be protected by the monitor. this reference must remain valid as long as there are monitoring operations being performed. returns the function returns one of the following values: if successful, the function returns a pointer to the prmonitor associated with the value
specified in the address parameter. if unsuccessful (the monitor cache needs to be expanded and the system is out of memory), the function returns null. description pr_centermonitor uses the value
specified in the address parameter to find a monitor in the monitor cache, then enters the lock associated with the monitor. if no match is found, an available monitor is associated with the address and the m...
PR_CExitMonitor
nction has the following parameters: address the address of the protected object--the same address previously passed to pr_centermonitor. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. this may indicate that the address parameter is invalid or that the calling thread is not in the monitor. description using the value
specified in the address parameter to find a monitor in the monitor cache, pr_cexitmonitor decrements the entry count associated with the monitor. if the decremented entry count is zero, the monitor is exited. ...
PR_CLIST_IS_EMPTY
checks for an empty circular list. syntax #include <prclist.h> printn pr_clist_is_empty (prclist *listp); parameter listp a pointer to the linked list. description pr_clist_is_empty returns a non-zero value if the
specified list is an empty list, otherwise returns zero. ...
PR_CNotify
llowing parameter: address the address of the monitored object. the calling thread must be in the monitor defined by the value of the address. returns pr_success indicates that the calling thread is the holder of the mutex for the monitor referred to by the address parameter. pr_failure indicates that the monitor has not been entered by the calling thread. description using the value
specified in the address parameter to find a monitor in the monitor cache, pr_cnotify notifies single a thread waiting for the monitor's state to change. if a thread is waiting on the monitor (having called pr_cwait), then that thread is made ready. as soon as the thread is scheduled, it attempts to reenter the monitor. ...
PR_CNotifyAll
r: address the address of the monitored object. the calling thread must be in the monitor at the time pr_cnotifyall is called. returns pr_success indicates that the referenced monitor was located and the calling thread was in the monitor. pr_failure indicates that the referenced monitor could not be located or that the calling thread was not in the monitor description using the value
specified in the address parameter to find a monitor in the monitor cache, pr_cnotifyall notifies all threads waiting for the monitor's state to change. all of the threads waiting on the state change are then scheduled to reenter the monitor. ...
PR_CloseDir
syntax #include <prio.h> prstatus pr_closedir(prdir *dir); parameter the function has the following parameter: dir a pointer to a prdir structure representing the directory to be closed. returns if successful, pr_success. if unsuccessful, pr_failure. the reason for the failure can be retrieved via pr_geterror. description when a prdir object is no longer needed, it must be closed and freed with a call to pr_closedir call. note that after a pr_closedir call, any prdirentry object returned by a previous pr_readdir call on the same prdir object becomes invalid. ...
PR_CloseSemaphore
syntax #include <pripcsem.h> nspr_api(prstatus) pr_closesemaphore(prsem *sem); parameter the function has the following parameter: sem a pointer to a prsem structure returned from a call to pr_opensemaphore. ...
PR ConvertIPv4AddrToIPv6
converts an ipv4 address into an (ipv4-mapped) ipv6 address. syntax #include <prnetdb.h> void pr_convertipv4addrtoipv6( pruint32 v4addr, pripv6addr *v6addr ); parameters the function has the following parameters: v4addr the ipv4 address to convert into an ipv4-mapped ipv6 address. this must be
specified in network byte order. v6addr a pointer to a buffer, allocated by the caller, that is filled in with the ipv6 address on return. ...
PR_CreateFileMap
prot protection option for read and write accesses of a file mapping. ...
PR_CreateIOLayerStub
creates a new layer. syntax #include <prio.h> prfiledesc* pr_createiolayerstub( prdescidentity ident priomethods const *methods); parameters the function has the following parameters: ident the identity to be associated with the new layer. methods a pointer to the priomethods structure specifying the functions for the new layer. returns a new file descriptor for the
specified layer. description a new layer may be allocated by calling pr_createiolayerstub. the file descriptor returned contains the pointer to the i/o methods table provided. the runtime neither modifies the table nor tests its correctness. the caller should override appropriate contents of the file descriptor returned before pushing it onto the protocol stack. ...
PR_DELETE
allocates memory of a
specified size from the heap. syntax #include <prmem.h> void pr_delete(_ptr); parameter _ptr the address of memory to be returned to the heap. must be an lvalue (an expression that can appear on the left side of an assignment statement). returns nothing. description this macro returns allocated memory to the heap from the
specified location and sets _ptr to null. ...
PR_Delete
if the function fails, the error code can then be retrieved via pr_geterror. ...
PR_DeleteSemaphore
syntax #include <pripcsem.h> nspr_api(prstatus) pr_deletesemaphore(const char *name); parameter the function has the following parameter: name the name of a semaphore that was previously created via a call to pr_opensemaphore. ...
PR_DestroyLock
syntax #include <prlock.h> void pr_destroylock(prlock *lock); parameter pr_destroylock has one parameter: lock a pointer to a lock object. caution the caller must ensure that no thread is currently in a lock-specific function. locks do not provide self-referential protection against deletion. ...
PR_EnterMonitor
syntax #include <prmon.h> void pr_entermonitor(prmonitor *mon); parameter the function has the following parameter: mon a reference to an existing structure of type prmonitor. description when the calling thread returns, it will have acquired the monitor's lock. attempts to acquire the lock for a monitor that is held by some other thread will result in the caller blocking. the operation is neither timed nor interruptible. if the monitor's entry count is greater than zero and the calling thread is recognized as the holder of the lock, pr_entermonitor increments the entry count by one and returns. ...
PR_ExitMonitor
syntax #include <prmon.h> prstatus pr_exitmonitor(prmonitor *mon); parameter the function has the following parameter: mon a reference to an existing structure of type prmonitor. the monitor object referenced must be one for which the calling thread currently holds the lock. returns the function returns one of the following values: if successful, pr_success. if unsuccessful (the calling thread has not entered the monitor), pr_failure. description if the decremented entry count is zero, pr_exitmonitor releases the monitor's lock. ...
PR_ExplodeTime
); parameters the function has these parameters: usecs an absolute time in the prtime format. params a time parameter callback function. exploded a pointer to a location where the converted time can be stored. this location must be preallocated by the caller. returns nothing; the buffer pointed to by exploded is filled with the exploded time. description this function converts the
specified absolute time to a clock/calendar time in the
specified time zone. upon return, the location pointed to by the exploded parameter contains the converted time value. ...
PR_FindSymbol
estion. syntax #include <prlink.h> void* pr_findsymbol ( prlibrary *lib, const char *name); parameters the function has these parameters: lib a valid reference to a loaded library, as returned by pr_loadlibrary, or null. name a textual representation of the symbol to resolve. returns an untyped pointer. description this function finds and returns an untyped reference to the
specified symbol in the
specified library. if the lib parameter is null, all libraries known to the runtime and the main program are searched in an un
specified order. use this function to look up functions or data symbols in a shared library. getting a pointer to a symbol in a library does indicate that the library is available when the search was made. the runtime does nothing to ensure the continued val...
PR_FindSymbolAndLibrary
to a location at which the runtime will store the library in which the symbol was discovered. this location must be pre-allocated by the caller. returns if successful, returns a non-null pointer to the found symbol, and stores a pointer to the library in which it was found at the location pointed to by lib. if the symbol could not be found, returns null. description this function finds the
specified symbol in one of the currently loaded libraries. it returns the address of the symbol. upon return, the location pointed to by the parameter lib contains a pointer to the library that contains that symbol. the location must be pre-allocated by the caller. the function returns null if no such function can be found. the order in which the known libraries are searched in not
specified. this functio...
PR_GetDescType
syntax #include <prio.h> prdesctype pr_getdesctype(prfiledesc *file); parameter the function has the following parameter: file a pointer to a prfiledesc object whose descriptor type is to be returned. returns the function returns a prdesctype enumeration constant that describes the type of file. description the prdesctype enumeration is defined as follows: typedef enum prdesctype { pr_desc_file = 1, pr_desc_socket_tcp = 2, pr_desc_socket_udp = 3, pr_desc_layered = 4 } prdesctype; the enumeration has the following enumerators: pr_desc_file the prfiledesc object represents a normal file. ...
PR_GetFileInfo
gets information about a file with a
specified pathname. file size is expressed as a 32-bit integer. syntax #include <prio.h> prstatus pr_getfileinfo( const char *fn, prfileinfo *info); parameters the function has the following parameters: fn the pathname of the file to get information about. info a pointer to a file information object (see prfileinfo). on output, pr_getfileinfo writes information about the given file to the file information object. returns one of the following values: if the file information is successfully obtained, pr_success. if the file information is not successfully obtained, pr_failure. description pr_getfileinfo stores information about the file with the
specified pathname in the prfileinfo structure pointed to by info. the file size is returned ...
PR_GetFileInfo64
gets information about a file with a
specified pathname. file size is expressed as a 64-bit integer. syntax #include <prio.h> prstatus pr_getfileinfo64( const char *fn, prfileinfo64 *info); parameters the function has the following parameters: fn the pathname of the file to get information about. info a pointer to a 64-bit file information object (see prfileinfo64). on output, pr_getfileinfo64 writes information about the given file to the file information object. returns one of the following values: if the file information is successfully obtained, pr_success. if the file information is not successfully obtained, pr_failure. description pr_getfileinfo64 stores information about the file with the
specified pathname in the prfileinfo64 structure pointed to by info. the fil...
PR_GetIdentitiesLayer
finds the layer with the
specified identity in the
specified stack of layers. syntax #include <prio.h> prfiledesc* pr_getidentitieslayer( prfiledesc* stack, prdescidentity id); parameters the function has the following parameters: stack a pointer to a prfiledesc object that is a layer in a stack of layers. id the identity of the
specified layer. returns the function returns one of the following values: if successful, a pointer to a file descriptor of the layer with the
specified identity in the given stack of layers. if not successful, null. description the stack of layers to be searched is
specified by the fd parameter, which is a layer in the stack. both the layers underneath fd and the layers above fd are searched to find the layer with the
specified identity. ...
PR_GetLayersIdentity
gets the unique identity for the layer of the
specified file descriptor. syntax #include <prio.h> prdescidentity pr_getlayersidentity(prfiledesc* fd); parameter the function has the following parameter: fd a pointer to a file descriptor. returns if successful, the function returns the prdescidentity for the layer of the
specified file descriptor. ...
PR_GetLibraryName
); parameters the function has these parameters: dir a null-terminated string representing the path name of the library, as returned by pr_getlibrarypath. lib the leaf name of the library of interest. returns if successful, returns a new character string containing a constructed path name. in case of error, returns null. description this function constructs a full path name from the
specified directory name and library name. the constructed path name refers to the actual dynamically loaded library. it is suitable for use in the pr_loadlibrary call. this function does not test for existence of the
specified file, it just constructs the full filename. the way the name is constructed is system dependent. if sufficient storage cannot be allocated to contain the constructed path name, th...
PR_GetNameForIdentity
gets the string associated with a layer's unique identity. syntax #include <prio.h> const char* pr_getnameforidentity(prdescidentity ident); parameter the function has the following parameter: ident a layer's identity. returns the function returns one of the following values: if successful, the function returns a pointer to the string associated with the
specified layer. if unsuccessful, the function returns null. description a string may be associated with a layer when the layer is created. the string is copied by the runtime, and pr_getnameforidentity returns a pointer to that copy. ...
PR_GetSockName
syntax #include <prio.h> prstatus pr_getsockname( prfiledesc *fd, prnetaddr *addr); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing the socket. addr on return, the address of the socket. returns if successful, pr_success. if unsuccessful, pr_failure. ...
PR_GetSocketOption
syntax #include <prio.h> prstatus pr_getsocketoption( prfiledesc *fd, prsocketoptiondata *data); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing the socket whose options are to be retrieved. data a pointer to a structure of type prsocketoptiondata. on input, the option field of this structure must be set to indicate which socket option to retrieve for the socket represented by the fd parameter. on output, this structure contains the requested socket option data. returns if successful, pr_success. if unsuccessful, pr_failure. ...
PR_GetThreadPriority
returns the priority of a
specified thread. syntax #include <prthread.h> prthreadpriority pr_getthreadpriority(prthread *thread); parameter pr_getthreadpriority has the following parameter: thread a valid identifier for the thread whose priority you want to know. ...
PR_GetUniqueIdentity
layer identified by the layer's name. syntax #include <prio.h> prdescidentity pr_getuniqueidentity(const char *layer_name); parameter the function has the following parameter: layer_name the string associated with the creation of a layer's identity. returns the function returns one of the following values: if successful, the prdescidentity for the layer associated with the string
specified in the layer named layer_name. if the function cannot allocate enough dynamic memory, it fails and returns the value pr_invalid_io_layer with the error code pr_out_of_memory_error. description a string may be associated with a layer when the layer is created. pr_getuniqueidentity allocates a unique layer identity and associates it with the string. the string can be subsequently passed to pr_c...
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_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. for example, prclist free_object_list = pr_init_static_clist(&free_object_list); ...
PR_INSERT_AFTER
inserts an element after another element in a circular list. syntax #include <prclist.h> pr_insert_after ( prclist *elemp1 prclist *elemp2); parameters elemp1 a pointer to the element to be inserted. elemp2 a pointer to the element after which elemp1 is to be inserted. description pr_insert_after inserts the element
specified by elemp1 into the circular list, after the element
specified by elemp2. ...
PR_INSERT_BEFORE
inserts an element before another element in a circular list. syntax #include <prclist.h> pr_insert_before ( prclist *elemp1 prclist *elemp2); parameters elemp1 a pointer to the element to be inserted. elemp2 a pointer to the element before which elemp1 is to be inserted. description pr_insert_before inserts the element
specified by elemp1 into the circular list, before the element
specified by elemp2. ...
PR_INSERT_LINK
inserts an element at the head of the list. syntax #include <prclist.h> pr_insert_link ( prclist *elemp, prclist *listp); parameters elemp a pointer to the element to be inserted. listp a pointer to the list. description pr_insert_link inserts the
specified element at the head of the
specified list. ...
PR_ImplodeTime
converts a clock/calendar time to an absolute time. syntax #include <prtime.h> prtime pr_implodetime(const prexplodedtime *exploded); parameters the function has these parameters: exploded a pointer to the clock/calendar time to be converted. returns an absolute time value. description this function converts the
specified clock/calendar time to an absolute time and returns the converted time value. ...
PR_InitializeNetAddr
include <prnetdb.h> prstatus pr_initializenetaddr( prnetaddrvalue val, pruint16 port, prnetaddr *addr); parameters the function has the following parameters: val the value to be assigned to the ip address portion of the network address. 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. 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_initiali...
PR_NewThreadPrivateIndex
n *newindex, prthreadprivatedtor destructor); parameters pr_newthreadprivateindex has the following parameters: newindex on output, an index that is valid for all threads in the process. you use this index with pr_setthreadprivate and pr_getthreadprivate. destructor specifies a destructor function prthreadprivatedtor for the private data associated with the index. this function can be
specified as null. returns the function returns one of the following values: if successful, pr_success. if the total number of indices exceeds 128, pr_failure. description if pr_newthreadprivateindex is successful, every thread in the same process is capable of associating private data with the new index. until the data for an index is actually set, the value of the private data at that index is ...
PR_NormalizeTime
syntax #include <prtime.h> void pr_normalizetime ( prexplodedtime *time, prtimeparamfn params); parameters the function has these parameters: time a pointer to a clock/calendar time in the prexplodedtime format. params a time parameter callback function. returns nothing; the time parameter is altered by the callback function. description this function adjusts the fields of the
specified time structure using the
specified time parameter callback function, so that they are in the proper range. call this function in these situations: to normalize a time after performing arithmetic operations directly on the field values of the calendar time object. for example, if you have a ] object that represents the date 3 march 1998 and you want to say "forty days from 3 march 1998", you c...
PR_NotifyAll
syntax #include <prmon.h> prstatus pr_notifyall(prmonitor *mon); parameters the function has the following parameter: mon a reference to an existing structure of type prmonitor. the monitor object referenced must be one for which the calling thread currently holds the lock. returns the function returns one of the following values: if successful, pr_success. if unsuccessful, pr_failure. description a call to pr_notifyall causes all of the threads waiting on the monitor to be scheduled to be promoted to a ready state. if no threads are waiting, the operation is no-op. pr_notifyall should be used with some care. ...
PR_NotifyAllCondVar
notifies all of the threads waiting on a
specified condition variable. syntax #include <prcvar.h> prstatus pr_notifyallcondvar(prcondvar *cvar); returns the function returns one of the following values: if successful, pr_success. if unsuccessful (for example, if the caller has not locked the lock associated with the condition variable), pr_failure. description the calling thread must hold the lock that protects the condition, as well as the invariants that are tightly bound to the condition. a call to pr_notifyallcondvar causes all of the threads waiting on the
specified condition variable to be promoted to a ready state. if no threads are waiting, the operation is no-op. ...
PR_OpenAnonFileMap
size the size of the shared memory. prot how the shared memory is mapped. returns pointer to prfilemap or null on error. description if the shared memory already exists, a handle is returned to that shared memory object. on unix platforms, pr_openanonfilemap uses dirname as a directory name, without the trailing '/', to contain the anonymous file. a filename is generated for the name. ...
PR_OpenDir
opens the directory with the
specified pathname. syntax #include <prio.h> prdir* pr_opendir(const char *name); parameter the function has the following parameter: name the pathname of the directory to be opened. returns if the directory is successfully opened, a prdir object is dynamically allocated and the function returns a pointer to it. if the directory cannot be opened, the function returns null. description pr_opendir opens the directory
specified by the pathname name and returns a pointer to a directory stream (a prdir object) that can be passed to subsequent pr_readdir calls to get the directory entries (files and subdirectories) in the directory. the prdir pointer should eventually be closed by a call to pr_closedir. ...
PR_OpenTCPSocket
syntax #include <prio.h> prfiledesc* pr_opentcpsocket(printn af); parameters the function has the following parameters: af the address family of the new tcp socket. can be pr_af_inet (ipv4), pr_af_inet6 (ipv6), or pr_af_local (unix domain, supported on posix systems only). returns the function returns one of the following values: upon successful completion, a pointer to the prfiledesc object created for the newly opened tcp socket. if the creation of a new tcp socket failed, null. description tcp (transmission control protocol) is a connection-oriented, reliable byte-stream protocol of the tcp/ip protocol suite. pr_opentcpsocket creates a new tcp socket of the address family af. ...
PR OpenUDPSocket
syntax #include <prio.h> prfiledesc* pr_openudpsocket(printn af); parameters the function has the following parameters: af the address family of the new udp socket. can be pr_af_inet (ipv4), pr_af_inet6 (ipv6), or pr_af_local (unix domain, supported on posix systems only). returns the function returns one of the following values: upon successful completion, a pointer to the prfiledesc object created for the newly opened udp socket. if the creation of a new udp socket failed, null. description udp (user datagram protocol) is a connectionless, unreliable datagram protocol of the tcp/ip protocol suite. udp datagrams may be lost or delivered in duplicates or out of sequence. ...
PR_PREV_LINK
returns the preceding element in a list. syntax #include <prclist.h> prclist *pr_prev_link (prclist *elemp); parameter elemp a pointer to the element. returns a pointer to a list element. description pr_prev_link returns a pointer to the element preceding the
specified element. it can be used to traverse a list. the preceding element is not removed from the list. ...
PR_PopIOLayer
removes a layer from the stack. syntax #include <prio.h> prfiledesc *pr_popiolayer( prfiledesc *stack, prdescidentity id); parameters the function has the following parameters: stack a pointer to a prfiledesc object representing the stack from which the
specified layer is to be removed. id identity of the layer to be removed from the stack. returns the function returns one of the following values: if the layer is successfully removed from the stack, a pointer to the removed layer. if the layer is not found in the stack or cannot be popped (for example, the bottommost layer), the function returns null with the error code pr_invalid_argument_error. description pr_popiolayer pops the
specified layer from the stack. if the object to be removed is found, pr_popiolayer returns ...
PR_PostSemaphore
syntax #include <pripcsem.h> nspr_api(prstatus) pr_postsemaphore(prsem *sem); parameter the function has the following parameter: sem a pointer to a prsem structure returned from a call to pr_opensemaphore. ...
PR_PushIOLayer
ss. if the layer is not successfully pushed onto the stack, pr_failure. use pr_geterror to get additional information regarding the reason for the failure. description a file descriptor for a layer (possibly allocated using pr_createiolayerstub) may be pushed onto an existing stack of file descriptors at any time. the new layer is inserted into the stack just above the layer with the identity
specified by id. even if the id parameter indicates the topmost layer of the stack, the value of the file descriptor describing the original stack will not change. in other words, stack continues to point to the top of the stack after the function returns. caution keeping the pointer to the stack even as layers are pushed onto the top of the stack is accomplished by swapping the contents of the file des...
PR_Realloc
pointer to the existing memory block being resized. size the size of the new memory block. returns an untyped pointer to the allocated memory, or if the allocation attempt fails, null. call pr_geterror() to retrieve the error returned by the libc function realloc(). description this function attempts to enlarge or shrink the memory block addressed by ptr to a new size. the contents of the
specified memory remains the same up to the smaller of its old size and new size, although the new memory block's address can be different from the original address. ...
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. ...
PR_REMOVE_LINK
removes an element from a circular list. syntax #include <prclist.h> pr_remove_link (prclist *elemp); parameter elemp a pointer to the element. description pr_remove_link removes the
specified element from its circular list. ...
PR_RecvFrom
me specifying the time limit for completion of the receive operation. returns the function returns one of the following values: a positive number indicates the number of bytes actually received. the value 0 means the network connection is closed. the value -1 indicates a failure. the reason for the failure can be obtained by calling pr_geterror. description pr_recvfrom receives up to a
specified number of bytes from socket, which may or may not be connected. the operation blocks until one or more bytes are transferred, a timeout has occurred, or there is an error. no more than amount bytes will be transferred. pr_recvfrom is usually used with a udp socket. ...
PR_STATIC_ASSERT
false at compile time. syntax #include <prlog.h> pr_static_assert ( expression ); parameters the macro has this parameter: expression any valid expression which evaluates at compile-time to true or false. an expression which cannot be evaluated at compile time will cause a compiler error; see pr_assert for a runtime alternative. returns nothing description this macro evaluates the
specified expression. when the result is zero (false) program compilation will fail with a compiler error; otherwise compilation completes successfully. the compiler error will include the number of the line for which the compile-time assertion failed. this macro may only be used in locations where an extern function declaration may be used. ...
PR_SetError
the runtime merely stores the value and returns it when requested. ...
PR_SetErrorText
sets the text associated with an error. syntax #include <prerror.h> void pr_seterrortext(printn textlength, const char *text) parameters the function has these parameters: textlength the length of the text in the text. may be null. if not null, and if text is zero, the string is assumed to be a null-terminated c string. otherwise the text is assumed to be the length
specified and to possibly include null characters (as might occur in a multilingual string). text the text to associate with the error. description the text is copied into the thread structure and remains there until the next call to pr_seterror. if there is error text already present in the thread, the previous value is first deleted. the new value is copied into storage allocated and owned by nspr and remains there ...
PR_SetLogFile
sets the name of the log file. syntax #include <prlog.h> prbool pr_setlogfile(const char *name); parameters the function has this parameter: name the name of the log file. returns pr_true when successful. otherwise, pr_false. description creates a log file with the
specified file name. subsequent log messages are written to this file. ordinarily, a user application need not use this function, as nspr initializes logging at nspr startup. the application can use the model provided in use example to effect application logging. ...
PR_SetSocketOption
syntax #include <prio.h> prstatus pr_setsocketoption( prfiledesc *fd, prsocketoptiondata *data); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing the socket whose options are to be set. data a pointer to a structure of type prsocketoptiondata specifying the options to set. returns if successful, pr_success. if unsuccessful, pr_failure. the reason for the failure can be obtained by calling pr_geterror. ...
PR_SetThreadPriority
syntax #include <prthread.h> void pr_setthreadpriority( prthread *thread, prthreadpriority priority); parameters pr_setthreadpriority has the following parameters: thread a valid identifier for the thread whose priority you want to set. priority the priority you want to set. description modifying the priority of a thread other than the calling thread is risky. it is difficult to ensure that the state of the target thread permits a priority adjustment without ill effects. ...
PR_Shutdown
syntax #include <prio.h> prstatus pr_shutdown( prfiledesc *fd, prshutdownhow how); parameters the function has the following parameters: fd a pointer to a prfiledesc object representing a connected socket. how the kind of disallowed operations on the socket. possible values include the following: pr_shutdown_rcv. further receives will be disallowed. pr_shutdown_send. further sends will be disallowed. pr_shutdown_both. further sends and receives will be disallowed. returns the function returns one of the following values: upon successful completion of shutdown request, pr_success. if unsuccessful, pr_failure. ...
PR_Sync
g device (disk). syntax #include <prio.h> prstatus pr_sync(prfiledesc *fd); parameter the function has the following parameter: fd pointer to a prfiledesc object representing a file. returns the function returns one of the following values: on successful completion, pr_success. if the function fails, pr_failure. description pr_sync writes all the in-memory buffered data of the
specified file to the disk. ...
PR_Unlock
releasing an unlocked lock results in an error. attempting to release a lock that was locked by a different thread causes undefined behavior. syntax #include <prlock.h> prstatus pr_unlock(prlock *lock); parameter pr_unlock has one parameter: lock a pointer to a lock object to be released. returns the function returns one of the following values: if successful, pr_success. if unsuccessful (for example, if the caller does not own the lock), pr_failure. ...
PR_Writev
ead calling pr_writev blocks until all the data is written or the write operation fails. therefore, the return value is equal to either the sum of all the buffer lengths (on success) or -1 (on failure). note that if pr_writev returns -1, part of the data may have been written before an error occurred. if the timeout parameter is not pr_interval_no_timeout and all the data cannot be written in the
specified interval, pr_writev returns -1 with the error code pr_io_timeout_error. this is the type definition for priovec: typedef struct priovec { char *iov_base; int iov_len; } priovec; the priovec structure has the following fields: iov_base a pointer to the beginning of the buffer. iov_len the size of the buffer. ...
Process Management and Interprocess Communication
this chapter describes the nspr routines that deal with processes. a process is an instance of a program. nspr provides routines to create a new process and to wait for the termination of another process. nspr does not provide an equivalent of the unix fork(). the newly-created process executes its program from the beginning. a new process can inherit
specified file descriptors from its parent, and the parent can redirect the standard i/o streams of the child process to
specified file descriptors. note that the functions described in this chapter are not available for macos or win16 operating systems. process management types and constants the types defined for process management are: prprocess prprocessattr process management functions the process manipulation function fall into these...
NSS Certificate Download Specification
information is correct. server certificates are imported via the server admin interface. certificates are pasted into a text input field in an html form, and then the form is submitted to the admin server. since the certificates are pasted into text fields, only the text formats described above are supported for servers. the type of certificate being imported (e.g. server or ca or cert chain) is
specified by the server administrator by selections made on the admin pages. if a certificate chain is being imported then the first certificate in the chain must be the server or ca certificate, and any subsequent certificates will be added as untrusted ca certificates to the local database. object identifiers the base of all netscape object ids is: netscape object identifier ::= { 2 16 840 1 113730...
FIPS Mode - an explanation
eys it contains. it may not do any cryptographic operations that involve the use of cryptographic keys, nor allow any of the keys or certificates it holds to be seen or used, except when a user has successfully authenticated to it. if users authenticate to it with a password, it must ensure that their passwords are strong passwords. it must implement the us government standard algorithms (also
specified in other fips documents) such as aes, triple-des, sha-1 and sha-256, that are needed to do whatever job the application wants it to perform. it must generate or derive cryptographic keys and store them internally. except for "public keys", it must not allow any keys to leave it (to get outside of it) unless they are encrypted ("wrapped") in a special way. this makes it difficult to move keys f...
NSS_3.12.2_release_notes.html
multiple pkcs#11 token password command line option to nss tools. 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 subject from the cert if none is
specified. bug 444974: crash upon reinsertion of e-identity smartcard bug 447563: modutil -add prints no error explanation on failure bug 448431: pk11_createmergelog() declaration causes gcc warning when compiling with -wstrict-prototypes bug 449334: pk12util has duplicate options letters bug 449725: signver is still using static libraries. bug 450427: add comodo ecc certification authority cer...
NSS 3.16.2 release notes
l aes assembly code for 32-bit and 64-bit windows, contributed by shay gueron and vlad krasnov of intel. new functions in cert.h cert_addextensionbyoid - adds an extension to a certificate. it is the same as cert_addextension except that the oid is represented by a secitem instead of a secoidtag. in pk11pub.h pk11_privdecrypt - decrypts with a private key. the algorithm is
specified with a ck_mechanism_type. pk11_pubencrypt - encrypts with a public key. the algorithm is
specified with a ck_mechanism_type. new macros in sslerr.h ssl_error_next_protocol_no_callback - an ssl error code that means the next protcol negotiation extension was enabled, but the callback was cleared prior to being needed. ssl_error_next_protocol_no_protocol - an ssl error code that...
NSS 3.31 release notes
is a minor release. distribution information the hg tag is nss_3_31_rtm. nss 3.31 requires netscape portable runtime (nspr) 4.15 or newer. nss 3.31 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_31_rtm/src/ new in nss 3.31 new functionality allow certificates to be
specified by rfc7512 pkcs#11 uris. allow querying a certificate object for its temporary or permanent storage status in a thread safe way. new functions in cert.h cert_getcertisperm - retrieve the permanent storage status attribute of a certificate in a thread safe way. cert_getcertistemp - retrieve the temporary storage status attribute of a certificate in a thread safe way. in pk11p...
NSS 3.47 release notes
ort aes hw acceleration on armv8 bug 1267894 - allow per-socket run-time ordering of the cipher suites presented in clienthello bug 1570501 - add cmac to freebl and pkcs #11 libraries bugs fixed in nss 3.47 bug 1459141 - make softoken cbc padding removal constant time bug 1589120 - more cbc padding tests bug 1465613 - add ability to distrust certificates issued after a certain date for a
specified root cert bug 1588557 - bad debug statement in tls13con.c bug 1579060 - mozilla::pkix tag definitions for issueruniqueid and subjectuniqueid shouldn't have the constructed bit set bug 1583068 - nss 3.47 should pick up fix from bug 1575821 (nspr 4.23) bug 1152625 - support aes hw acceleration on armv8 bug 1549225 - disable dsa signature schemes for tls 1.3 bug 1586947 - pk11_importandreturnp...
NSS API Guidelines
certificate doesn't drag all the code in for all constituent objects, unless they're actually being used our agressive pointer-tracking facility all these are useful, but they don't combine well. now some of the pointer-tracking pressure has eased off, we can drop its use when it becomes too difficult. many routines are defined to take an nssarena *arenaopt argument. this means if an arena is
specified (non-null), it is used, otherwise (null) the routine uses the heap. you can think of the heap as a default arena you can't destroy. error handling nss 3.0 introduces the concept of an error stack. when something goes wrong, the call stack unwinds, with routines returning an error indication. each level which flags a problem, adds its own error number to the stack. at the bottom of the stack is ...
NSS Config Options
nss config options format the
specified ciphers will be allowed by policy, but an application may allow more by policy explicitly: config="allow=curve1:curve2:hash1:hash2:rsa-1024..." only the
specified hashes and curves will be allowed: config="disallow=all allow=sha1:sha256:secp256r1:secp384r1" only the
specified hashes and curves will be allowed, and rsa keys of 2048 or more will be accepted, and dh key exchange with 1024-bit primes or more: config="disallow=all allow=sha1:sha256:secp256r1:secp384r1:min-rsa=2048:min-dh=1024" a policy that enables the aes ciphersuites and the secp256/384 curves: config="allow=aes128-cbc:aes128-gcm::hmac-sha1:sha1:sha256:sha384:rsa:ecdhe-rsa:secp256r1:secp384r1" turn off md5 config="disallow=md5" turn off md5 and sha1 only for ssl config="d...
NSS Sample Code Sample_1_Hashing
* it writes out the digest as a hexadecimal string. */ static int digestfile(prfiledesc *outfile, prfiledesc *infile, secoidtag hashoidtag) { unsigned int nb; unsigned char ibuf[4096]; unsigned char digest[64]; unsigned int len; unsigned int digestlen; hash_hashtype hashtype; hashcontext *hashcontext = null; hashtype = hash_gethashtypebyoidtag...
Hashing - sample 1
* it writes out the digest as a hexadecimal string. */ static int digestfile(prfiledesc *outfile, prfiledesc *infile, secoidtag hashoidtag) { unsigned int nb; unsigned char ibuf[4096]; unsigned char digest[64]; unsigned int len; hash_hashtype hashtype; hashcontext *hashcontext = null; hashtype = hash_gethashtypebyoidtag(hashoidtag); hashcontext...
sample1
* it writes out the digest as a hexadecimal string. */ static int digestfile(prfiledesc *outfile, prfiledesc *infile, secoidtag hashoidtag) { unsigned int nb; unsigned char ibuf[4096]; unsigned char digest[64]; unsigned int len; unsigned int digestlen; hash_hashtype hashtype; hashcontext *hashcontext = null; hashtype = hash_getha...
nss tech note2
it works by inserting a special set of entry points between nss and the module. to enable the module logger, you must set the environment variable nss_debug_pkcs11_module to the name of the target module. for example, to log the softoken, use: nss_debug_pkcs11_module="nss internal pkcs #11 module" note: in the command prompt on windows, do not quote the name of the target module, otherwise the quotes are considered part of the name. ...
NSS Tools sslstrength
ent to the ciphers command is a string of characters, where each single character represents a cipher. you can obtain this list of character->cipher mappings by doing 'sslstrength ciphers'. for example, ciphers=bfi will turn on these cipher preferences and turn off all others. policy=export or policy=domestic will set your policies appropriately. policy will default to domestic if not
specified. step-up step up is a mode where the connection starts out with 40-bit encryption, but due to a 'change-cipher-spec' handshake, changes to 128-bit encryption. this is only done in 'export mode', with servers with a special certificate. you can tell if you stepped-up, because the output will says 'using export policy', and you'll find the secret key size was 128-bits. prerequisites you should ...
PKCS11 Implement
ptographic modules. in the cryptographic modules frame, click add. in the create a new security module dialog box, add the security module name for your module and the full pathname for the security module file. to avoid requiring the user to type long pathnames, make sure your module is not buried too deeply. semantics unique to nss these sections describe semantics required by nss but not
specified by pkcs #11. supporting multiple sessions if you support multiple sessions simultaneously and if you wish to support c_initpin, c_setpin, or c_generatekeypair, you must support simultaneous read-only and read/write sessions. random-number generation and simple digesting the nss requires that the following functions operate without authenticating to the token: c_seedrandom, c_generaterandom,...
FC_CopyObject
ect, ck_attribute_ptr ptemplate, ck_ulong uscount, ck_object_handle_ptr phnewobject ); parameters hsession [in] session handle. hobject [in] object handle. ptemplate [in] object template. uscount [in] number of attributes in the template. phnewobject [out] pointer to location to receive the new object's handle. description fc_copyobject creates a copy of an object using the attributes
specified in the template. a user must log into the token (to assume the nss user role) before copying a secret or private key object. return value examples see also fc_destroyobject, nsc_copyobject ...
FC_CreateObject
fc_createobject( ck_session_handle hsession, ck_attribute_ptr ptemplate, ck_ulong ulcount, ck_object_handle_ptr phobject ); parameters hsession [in] session handle. ptemplate [in] object template. ulcount [in] number of attributes in the template. phobject [out] pointer to location to receive the new objects handle. description fc_createobject creates an object using the attributes
specified in the template. a user must log into the token (to assume the nss user role) before calling fc_createobject. return value examples see also fc_destroyobject, nsc_createobject ...
FC_EncryptInit
sm[in] pointer to the mechanism to be used for subsequent encryption. hkey[in] handle of the encryption key. description fc_encryptinit 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_encryptinit. 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. examples see also nsc_encryptinit ...
FC_GenerateRandom
name fc_generaterandom - generate a random number. syntax ck_rv fc_generaterandom( ck_session_handle hsession, ck_byte_ptr prandomdata, ck_ulong ulrandomlen ); parameters hsession [in] session handle. prandomdata [out] pointer to the location to receive the random data. ulrandomlen [in] length of the buffer in bytes. description fc_generaterandom generates random data of the
specified length. a user may call fc_generaterandom without logging into the token (to assume the nss user role). return value examples see also nsc_generaterandom ...
FC_GetSlotInfo
info takes two parameters: slotid [in] pinfo [out] the address of a ck_slot_info structure. description fc_getslotinfo stores the information about the slot in the ck_slot_info structure that pinfo points to. a user may call fc_getslotinfo without logging into the token (to assume the nss user role). 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. examples see also nsc_getslotinfo ...
NSS environment variables
ular format. 3.12.8 nsdistmode string on operating systems other than windows, this controls whether copies, absolute symlinks, or relative symlinks of the output files should be published to mozilla/dist. the possible values are: copy: copies of files are published absolute_symlink: symlinks whose targets are absolute pathnames are published if not
specified, default to relative symlinks (symlinks whose targets are relative pathnames). on windows, copies of files are always published. before 3.0 ns_use_gcc boolean (1 to enable) on systems where gcc is not the default compiler, this tells nss to build with gcc. before 3.0 nss_allow_sslkeylogfile boolean (1 to enable) enable nss support in optimized build...
NSS tools : vfychain
f a process that typically also involves managing key databases and certificate databases. options -a the following certfile is base64 encoded -b yymmddhhmmz validate date (default: now) -d directory database directory -f enable cert fetching from aia url -o oid set policy oid for cert validation(format oid.1.2.3) -p use pkix library to validate certificate by calling: * cert_verifycertificate if
specified once, * cert_pkixverifycert if
specified twice and more. -r following certfile is raw binary der (default) -t following cert is explicitly trusted (overrides db trust) -u usage 0=ssl client, 1=ssl server, 2=ssl stepup, 3=ssl ca, 4=email signer, 5=email recipient, 6=object signer, 9=protectedobjectsigner, 10=ocsp responder, 11=any ca -v verbose mode. prints root cert subject(double the argument fo...
NSS Tools sslstrength
ent to the ciphers command is a string of characters, where each single character represents a cipher. you can obtain this list of character->cipher mappings by doing 'sslstrength ciphers'. for example, ciphers=bfi will turn on these cipher preferences and turn off all others. policy=export or policy=domestic will set your policies appropriately. policy will default to domestic if not
specified. step-up step up is a mode where the connection starts out with 40-bit encryption, but due to a 'change-cipher-spec' handshake, changes to 128-bit encryption. this is only done in 'export mode', with servers with a special certificate. you can tell if you stepped-up, because the output will says 'using export policy', and you'll find the secret key size was 128-bits. prerequisites you should ...
NSS Tools ssltap
oing by. if a connection is ssl, the data display includes interpreted ssl records and handshaking. availability this tool is known to build on solaris 2.5.1 (sunos 5.5.1) and windows nt 4.0. description the ssltap command opens a socket on a rendezvous port and waits for an incoming connection from the client side. once this connection arrives, the tool makes another connection to the
specified host name and port on the server side. it passes any data sent by the client to the server and vice versa. the tool also displays the data to the shell window from which it was called. it can do this for plain http connections or any tcp protocol, as well as for ssl streams, as described here. the tool cannot and does not decrypt any encrypted message data. you use the tool to look at the plain...
NSS tools : signver
tabases directory because the sqlite databases are designed to be shared, these are the shared database type. the shared database type is preferred; the legacy format is included for backward compatibility. by default, the tools (certutil, pk12util, modutil) assume that the given security databases follow the more common legacy type. using the sqlite databases must be manually
specified by using the sql: prefix with the given security directory. for example: # signver -a -s signature -d sql:/home/my/sharednssdb to set the shared database type as the default type for the tools, set the nss_default_db_type environment variable to sql: export nss_default_db_type="sql" this line can be set added to the ~/.bashrc file to make the change permanent. most applic...
Necko walkthrough
read this pump calls nsiasyncinputstream::asyncwait (the input for the response stream pipe created with the nshttptransaction, i.e. nspipeinputstream::asyncwait), with target thread set to the current thread, i.e. main. so, subsequent callbacks will be dispatched to the main thread. nspipeinputstream::asyncwait sets the callback to be used later for a response if a target is
specified (in this case, the main thread), callback is proxied via an nsinputstreamreadyevent, which is created now and may be called later otherwise, the callback would be called directly, when the socket is readable et voila, the transaction has been posted to the socket thread, and the main thread continues on, unblocked from network io. so, on the socket thread... the event queue works around ...
Rhino Examples
controlling the javascript engine the runscript class runscript.java is a simple program that executes a script from the command line. the control class control.java is a program that executes a simple script and then manipulates the result. javascript shell shell.java is a program that executes javascript programs; it is a simplified version of the shell in the tools package. the programs may be
specified as files on the command line or by typing interactively while the shell is running. primitivewrapfactory primitivewrapfactory.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 t...
Rhino JavaScript compiler
ply to save space in the resulting class file. -o outputfile writes the class file to outputfile, which should end in .class and must be a writable filename. -d outputdirectory writes the class file to outputdirectory. -opt optlevel optimizes at level optlevel, which must be an integer between -1 and 9. see optimization for more details. if optlevel is greater than zero, -debug may not be
specified. -package packagename specifies the package to generate the class into. the string packagename must be composed of valid identifier characters optionally separated by periods. -version versionnumber specifies the language version to compile with. the string versionnumber must be one of 100, 110, 120, 130, 140, 150, 160, or 170. see javascript language versions for more information on lang...
Rhino overview
ring for version 1.2 only, the two arguments are not swapped if the first argument is less than the second one. all other versions are ecma compliant. string.prototype.split for version 1.2 only, split performs the perl4 special case when given a single space character as an argument (skips leading whitespace, and splits on whitespace). all other versions split on the space character proper as
specified by ecma. security the security features in rhino provide the ability to track the origin of a piece of code (and any pieces of code that it may in turn generate). these features allow for the implementation of a traditional url-based security policy for javascript as in netscape navigator. embeddings that trust the javascript code they execute may ignore the security features. embeddings that ...
Rebranding SpiderMonkey (1.8.5)
perform the build and installation of your custom branded spidermonkey library: make note: depending on your system you may need administrative rights to perform the installation: make install the following information isn't technically needed for using your library but it will help other applications use your library. your rebranded library has been succesfully built and installed to libdir as
specified in ./config/autoconf.mk. a pkgconfig file has also been installed for your library at libdir/pkgconfig/$brand.pc. you may wish to manually edit this file. it describes your library package. the script file js-config has not been modified either and still points to mozjs185. if this is not desirable, you can issue the following command on unix systems: sed -i "s/mozjs185/$brand/" /usr/bin/js-conf...
Creating JavaScript jstest reftests
v2[, message]) checks that v1 and v2 are the same value. if they're not, throw an exception (which will cause the test to fail). reportcompare reportcompare(expected, actual, description) is somewhat like asserteq(actual, expected, description) except that the first two arguments are swapped, failures are reported via stdout rather than by throwing exceptions, and the matching is fuzzy in an un
specified way. for example, reportcompare sometimes considers numbers to be the same if they are "close enough" to each other, even if the == operator would return false. expected = 3; actual = 1 + 2; reportcompare(expected, actual, '3==1+2'); comparesource comparesource(expected, actual, description) is used to test if the decompilation of a javascript object (conversion to source code) matches an e...
Hacking Tips
chmarking with sub-milliseconds (browser) in a simillar way as datenow() in the js shell, you can use performance.now() in the javascript code of a page. dumping the javascript heap from the shell, you can call the dumpheap before firefox function to dump out all gc things (reachable and unreachable) that are present in the heap. by default the function writes to stdout, but a filename can be
specified as an argument. example output might look as follows: 0x1234abcd b global object ========== # zone 0x56789123 # compartment http://gmail.com [in zone 0x56789123] # compartment http://gmail.com/iframe [in zone 0x56789123] # arena allockind=3 size=64 0x1234abcd b object > 0x1234abcd b prop1 > 0xabcd1234 w prop2 0xabcd1234 w object > 0xdeadbeef b prop3 # arena allockind=5 size=72 0xdeadbeef w obje...
Self-hosted builtins in SpiderMonkey
for example, use function.prototype.apply directly. a select set of c++-implemented builtins is installed via the intrinsic_functions array in selfhosting.cpp, as described below. using the same mechanism, c++-implemented helper functions are made available to self-hosted code. some general-purpose functions provided in this way are: the abstract operations toobject, tointeger, and iscallable
specified in the ecmascript language specification. throwtypeerror, throwrangeerror, throwsyntaxerror, which self-hosted code should use instead of throw so that the error message is
specified in js.msg and can be localized. the makeconstructible function described above. the file utilities.js provides some additional, js-implemented helper functions. of note, it provides implementations of list and re...
INT_FITS_IN_JSVAL
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. determines if a
specified c integer is safe to pass to int_to_jsval. syntax #define int_fits_in_jsval(i) /* ... */ name type description i jsint the c integer value to check. description determines if a
specified c integer value, i, lies within the range allowed for integer jsvals. if so, int_fits_in_jsval returns true, and i can be cast to jsval by calling int_to_jsval(i). otherwise, int_fits_in_jsval returns false. in this case, the application can still convert i to a jsval using js_newnumbervalue. warning: the type of the argument i must be jsint, but the c/c++ ...
INT_TO_JSVAL
please use js::int32value instead in spidermonkey 45 or later. syntax jsval int_to_jsval(int32_t i); name type description i any integer type c integer to convert to a jsval. description int_to_jsval converts a c integer, i, to a jsval. ...
JS::AutoIdArray
t * 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. ida jsidarray * a pointer to jsidarray to take the ownership. methods method description bool operator!() const return true if this has no owned array. jsid operator[](size_t i) const return a jsid in
specified index of the owned array. size_t length() const return the length of the owned array. jsidarray *steal() return the owned array and release the ownership. description js::autoidarray takes the ownership of jsidarray, and frees it in destructor by calling js_destroyidarray. examples { js::autoidarray ids(cx, js_enumerate(cx, obj)); if (!ids) // check the retur...
JS::AutoVectorRooter
rray of type t. syntax js::autovectorrooter(jscontext* cx); methods method description size_t length() const returns the length of the array. bool empty() const determines if the array is empty (length is zero). bool append(const t &v) appends an element v to the array. bool append(const t *ptr, size_t len) appends a sequence of t
specified with a pointer ptr and length len to the array. bool appendall(const autovectorrooter<t> &other) appends all elements of other to the array. bool insert(t *p, const t &val) inserts an element val at the position
specified by p. void infallibleappend(const t &v) appends an element v to the array. for use when space has already been reserved. void popbac...
JS::CallArgs
bility 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 un
specified. 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't need to use or change this if your meth...
JS::CompileFunction
ves the result function. description js::compilefunction compiles a function from a text string chars, bytes, or srcbuf. name is the name to assign to the newly created function. nargs is the number of arguments the function takes, and argnames is a pointer to the first element of an array of names to assign each argument. the number of argument names should match the number of arguments
specified in nargs. chars, bytes, or srcbuf is a string containing the source code of the function. length is the length of the source code in characters. on success, js::compilefunction stores an function object representing the newly compiled function into fun and and returns true. otherwise, it returns false and the value left in fun is undefined. see also the jsapi user guide contains example cod...
JS::CompileOffThread
to application-defined data. description js::compileoffthread compiles a script, chars for execution. the script is associated with a js object. chars is the string containing the text of the script. length indicates the size of the text version of the script in characters. after successfully triggering an off thread compile of a script, the callback will eventually be invoked with the
specified data and a token for the compilation. the callback will be invoked while off the main thread, so its operations must be thread safe. afterwards, js::finishoffthreadscript must be invoked on the main thread to get the result script or nullptr. if maybecx is not
specified, the resources will be freed, but no script will be returned. the characters passed in to js::compileoffthread must remain live...
JS::CreateError
enumber. columnnumber uint32_t the value of error.prototype.columnnumber. report jserrorreport * a pointer to jserrorreport instance. message js::handlestring the value of error.prototype.message. rval js::mutablehandlevalue out parameter. receives the created error object. description js::createerror creates an error object with
specified properties. if successful, js::createerror stores the created error object to *rval and returns true, otherwise returns false and the value of *rval is undefined. see also mxr id search for js::createerror jsexntype jserrorreport bug 984048 bug 1038238 -- change stack parameter from js::handlestring to js::handleobject ...
JS::Evaluate
length size_t the length of chars or bytes, in characters. filename const char * name of file or url containing the script. used to report filename or url in error messages. rval js::mutablehandlevalue out parameter. on success, if rval is not null, *rval receives the result value. description js::evaluate compiles and executes a script in the
specified scope, obj or scopechain. srcbuf, chars and bytes are the string containing the text of the script. length indicates the size of the text version of the script in characters. filename is the name of the file (or url) containing the script. this information is used in messages if an error occurs during compilation. rval is an optional out parameter. if it is non-null, then on success, the resul...
JS::OrdinaryToPrimitive
nversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to convert. type jstype the type of converted value. vp js::mutablehandlevalue out parameter. on success, *vp receives the converted value. description js::ordinarytoprimitive converts a javascript object to a
specified type value, by the algorithm
specified in es6 draft rev 28 (2014 oct 14) 7.1.1, second algorithm. most users should not call this -- use js::tonumber, js::toboolean, or js::tostring instead. this should only be called from custom convert hooks. it implements the default conversion behavior shared by most objects in js, so it's useful as a fallback. on success, js::ordinarytoprimitive stores the...
JS::ProtoKeyToId
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. key jsprotokey the prototype key to convert. vp js::mutablehandleid out parameter. *idp receives the converted id. description js::protokeytoid converts a
specified js prototype key key, to a js id. js::protokeytoid stores a jsid to *idp. see also mxr id search for js::protokeytoid js_idtoprotokey bug 987669 ...
JS::Value
t both -0 and +0 are allowed, and the latter may sometimes be stored using the int32_t representation.) js::value further provides these methods combining various aspects of the above methods: js::objectornullvalue(jsobject*) returns an object value corresponding to the given non-null pointer, or a null value if the pointer is null. val.setobjectornull(jsobject *) sets the given value to the
specified object, or to null if the pointer was null. val.isobjectornull() returns true if the value is either an object or undefined. correspondingly, val.toobjectornull() returns a non-null jsobject * if the value is an object, and null if the value is null. val.isprimitive() returns true if the value is a primitive value -- that is, not an object. it is equivalent to !val.isobject(). val.isnullorund...
JSFastNative
* the context in which the fast native 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()). argc unsigned int the number of arguments supplied to the function by the caller (as opposed to, say, the number of arguments the function is
specified to take in its jsfunctionspec). vp jsval * the arguments, including the this argument, the return-value slot, and the callee function object are accessible through this pointer using macros described below. description the callback should use the following macros to access the fields of vp: macro name description js_callee(cx, vp) returns the func...
JSID_IS_EMPTY
test whether a js id is jsid_empty. syntax bool jsid_is_empty(jsid id); name type description id jsid the property identifier to test. description jsid_is_empty tests whether a
specified js id, id, is jsid_empty. see also mxr id search for jsid_is_empty jsid_empty ...
JSID_IS_GCTHING
testing and conversion functions between a js id and a gc thing. syntax bool jsid_is_gcthing(jsid id); js::gccellptr jsid_to_gcthing(jsid id); name type description id jsid the property identifier to test or convert. description jsid_is_gcthing tests whether a
specified js id, id, is a gc thing, and returns true if it's a gc thing. jsid_to_gcthing converts a
specified js id, id to a gc thing. see also mxr id search for jsid_is_gcthing mxr id search for jsid_to_gcthing ...
JSID_IS_INT
and conversion functions between a js id and an integer. syntax bool jsid_is_int(jsid id); int32_t jsid_to_int(jsid id); bool int_fits_in_jsid(int32_t i); jsid int_to_jsid(int32_t i); name type description id jsid the property identifier to test or convert. i int32_t an integer to test or convert. description jsid_is_int tests whether a
specified js id, id, is an integer, and returns true if it's an integer. jsid_to_int converts a
specified js id, id to an integer. int_fits_in_jsid tests whether a
specified integer fits in jsid, it means the integer value is not negative. int_to_jsid converts a
specified integer, i to a jsid. see also mxr id search for jsid_is_int mxr id search for jsid_to_int mxr id search for int_fits_in_jsid ...
JSID_IS_STRING
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. id jsid the property identifier to test or convert. str jsstring * an interned string to convert to an id. description jsid_is_string tests whether a
specified js id, id, is a string, and returns true if it's a string. jsid_to_string converts a
specified js id, id to a jsstring *. interned_string_to_jsid converts a
specified interned string, str to a jsid. jsid_to_flat_string converts a
specified js id, id to a jsflatstring *. see also mxr id search for jsid_is_string mxr id search for jsid_to_string mxr id search for interned_string_to_jsid m...
JSID_IS_SYMBOL
ting and conversion functions between a js id and a js symbol. syntax bool jsid_is_symbol(jsid id); js::symbol * jsid_to_symbol(jsid id); jsid symbol_to_jsid(js::symbol *sym); name type description id jsid the property identifier to test or convert. sym js::symbol a js symbol to test or convert. description jsid_is_symbol tests whether a
specified js id, id, is a js symbol, and returns true if it's a js symbol. jsid_to_symbol converts a
specified js id, id to a js symbol. symbol_to_jsid converts a
specified js symbol, i to a jsid. see also mxr id search for jsid_is_symbol mxr id search for jsid_to_symbol mxr id search for symbol_to_jsid bug 645416 ...
JSID_IS_VOID
test whether a js id is jsid_void. syntax bool jsid_is_void(jsid id); name type description id jsid the property identifier to test. description jsid_is_void tests whether a
specified js id, id, is jsid_void. see also mxr id search for jsid_is_void jsid_void ...
JSID_IS_ZERO
test whether a js id is a zero id. syntax bool jsid_is_zero(jsid id); name type description id jsid the property identifier to test. description jsid_is_zero tests whether a
specified js id, id, is zero (0 in its integer representation). see also mxr id search for jsid_is_zero bug 601457 ...
JSNative
* 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()). argc unsigned the number of arguments supplied to the function by the caller (as opposed to, say, the number of arguments the function is
specified to take in its jsfunctionspec). vp js::value * the arguments, the this argument, the return-value slot, and the callee function object are accessible through this pointer using macros described below. description jsnative is the type of native implementations of javascript functions. full documentation of how to define a jsnative (or a jsfastnative, the equivalent typedef ...
JSObjectOps.defineProperty
efine. 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.getProperty
if getting or setting, the new value is returned in *vp on success. if deleting without error, *vp will be jsval_false if obj[id] is permanent, and jsval_true if id named a direct property of obj that was in fact deleted, or if id names no direct property of obj (id could name a property of a prototype, or no property in obj or its prototype chain). this reflects the quirky behavior of delete as
specified in ecma 262-3 §11.4.1 and ecma 262-3 §8.6.2.5. ...
JSVAL_TO_DOUBLE
obsolete since jsapi 32this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. casts a given jsval to a jsdouble without any type checking or error handling. syntax jsdouble jsval_to_double(jsval v); description jsval_to_double casts a
specified js value, v, to a c floating-point number of type jsdouble. as a precondition, jsval_is_double(v) must be true. this function is not type-safe: if v is an integer, string, null, or anything else, the behavior is undefined. to convert any value to a number, use js_valuetonumber instead. see also bug 952650 ...
JSVAL_TO_INT
obsolete since jsapi 32this 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. converts an integer jsval to a c integer without any type checking or error handling. syntax jsval_to_int(v) description jsval_to_int converts a
specified integer jsval, v, to the corresponding c integer value. if v is any other type of value, the result is un
specified. note that although jsval is an integer type, it must be treated as opaque. the jsval encoding of the integer 4, for instance, is not ((jsval) 4) but some other pattern of bits. to convert an integer to jsval, use int_fits_in_jsval and int_to_jsval. see also bug 952650 ...
JS_AddFinalizeCallback
name type description fop jsfreeop * a pointer to an instance of jsfreeop. status jsfinalizestatus one of the jsfinalizestatus constants, described below, indicating the stage of finalize. iscompartment bool false if all compartments are being collected, true if a compartment is being collected. data void * data parameter
specified in js_addfinalizecallback. added in spidermonkey 38 name description jsfinalize_group_start called when preparing to sweep a group of compartments, before anything has been swept. the collector will not yield to the mutator before calling the callback with jsfinalize_group_end status. jsfinalize_group_end called when preparing to sweep a group of compart...
JS_AlreadyHasOwnProperty
o determine whether a property already exists on a specific jsobject without modifying the object. by design, this search may not find a property that other property lookup functions, such as js_lookupproperty, would find. for native objects—objects whose properties are stored in the default data structure provided by spidermonkey—these functions simply check that data structure to see if the
specified field is present. they do not search anywhere else for the property. this means that: the prototype chain of obj is not searched. the object's jsclass.resolve hook is not called, so lazily defined properties are not found. (this is the only api that can directly detect that a lazily resolved property has not yet been resolved.) shared, permanent, delegated properties are not found. (such prop...
JS_CheckAccess
s callback. otherwise, if obj's class has a non-null jsclass.checkaccess callback, then it is called to perform the check. otherwise, if a runtime-wide check-object-access callback has been installed by calling js_setcheckobjectaccesscallback, then that is called to perform the check. otherwise, access is granted. on success, js_checkaccess returns js_true, *vp is set to the current value of the
specified property, and *attrsp is set to the property's attributes. on error or exception, including if access is denied, js_checkaccess returns js_false, and the values left in *vp and *attrsp are undefined. mxr id search for js_checkaccess ...
JS_CompileFunction
string, bytes, and optionally associates it with a js object, obj. js_compileucfunction is the unicode version of the function. name is the name to assign to the newly created function. nargs is the number of arguments the function takes, and argnames is a pointer to the first element of an array of names to assign each argument. the number of argument names should match the number of arguments
specified in nargs. body is a string containing the source code of the function. length is the length of the source code in characters. filename is the name of the file (or url) containing the function. this information is used in error messages if an error occurs during compilation. similarly, lineno is used to report the line number where an error occurred during compilation. if both obj and name are ...
JS_CompileFunctionForPrincipals
. principals is a pointer to the jsprincipals structure that contains the security information to associate with this function. name is the name to assign to the newly created function. nargs is the number of arguments the function takes, and argnames is a pointer to the first element of an array of names to assign each argument. the number of argument names should match the number of arguments
specified in nargs. body is the string containing the source code of the function. length is the length of the string in characters. filename is the name of the file (or url) containing the function. this information is passed in messages if an error occurs during compilation. similarly, lineno is used to report the line number of the function or file where an error occurred during compilation. on succe...
JS_ConvertValue
ype jstype the type to which the value is to be converted. type must be one of jstype_void, jstype_object, jstype_function, jstype_string, jstype_number, or jstype_boolean. otherwise js_convertvalue reports an error. vp js::mutablehandlevalue out parameter. on success, *vp receives the converted value. description js_convertvalue converts a javascript value, v, to the
specified type. on success, the converted value is stored in *vp. typically users of this function set vp to point to v, so that if conversion is successful, v now contains the converted value. js_convertvalue calls other, type-specific conversion routines based on the type argument. converting any value to jstype_void always succeeds. the result is undefined value. converting to jstype_object works e...
JS_DefaultValue
vp js::mutablehandle<js::value> out parameter. on success, *vp receives the converted value. description js_defaultvalue converts a javascript object, obj, to a primitive value using that object's [[defaultvalue]] hook. ecmascript specifies that all objects have a [[defaultvalue]] hook. objects with classes defined by ecmascript itself all use the [[defaultvalue]] algorithm
specified in §8.12.8 (but note the algorithm's special case for date objects). objects with a custom jsclass
specified by the embedder will invoke that class's convert hook, which must convert the object to a primitive value, to determine the primitive result of conversion. behavior when the convert hook is js_convertstub is identical to that for objects defined by ecmascript. on success, js_defaultvalue...
JS_DefineFunction
create a native function and assign it as a property to a
specified js object. syntax jsfunction * js_definefunction(jscontext *cx, js::handle<jsobject*> obj, const char *name, jsnative call, unsigned nargs, unsigned attrs); jsfunction * js_defineucfunction(jscontext *cx, js::handle<jsobject*> obj, const char16_t *name, size_t namelen, jsnative call, unsigned nargs, unsigned attrs); jsfunction * js_definefunctionbyid(jscontext *cx, js::handle<jsobject*> obj, js::handle<jsid> id, jsnative call, unsigned nargs, unsigned attrs); // added in spidermonkey 17 name type description cx jscontext * the context in which to define the function. ...
JS_DefineFunctions
escription defineallproperties define all properties regardless of their flags. onlydefinelateproperties define only properties which have a jsprop_define_late flag. dontdefinelateproperties 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 propert...
JS_DefineProperties
ps const jspropertyspec * pointer to the first element of an array containing names, ids, flags, and getproperty and setproperty method for the properties to create. the last array element must contain 0-valued members. in spidermonkey versions prior to spidermonkey 24, the last argument to js_definepropeties was not const. description js_defineproperties creates properties on a
specified object, obj. ps is a 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_d...
JS_DefineProperty
t engine will call each time the property is assigned; or null. attrs unsigned property attributes. desc js::handle<jspropertydescriptor> the property descriptor for the property to be defined. result js::objectopresult & (out parameter) receives the result of the operation. description js_defineproperty defines a single property in 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. ...
JS_DestroyRuntime
frees a javascript runtime. syntax void js_destroyruntime(jsruntime *rt); name type description rt jsruntime * the runtime to destroy. description js_destroyruntime frees the
specified the javascript runtime environment, rt. call js_destroyruntime after completing all other js api calls. js_destroyruntime garbage collects and frees the memory previously allocated by js_newruntime. see also mxr id search for js_destroyruntime js_newruntime ...
JS_DropExceptionState
ext *cx, jsexceptionstate *state); 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. state jsexceptionstate * pointer to the jsexceptionstate object to destroy. description this function destroys the
specified jsexceptionstate object, unrooting as necessary any attached exception object and freeing the memory resources associated with the jsexceptionstate object. this object should previously have been created using js_saveexceptionstate. see also mxr id search for js_dropstateexception jsexceptionstate js_saveexceptionstate js_restoreexceptionstate ...
JS_DumpHeap
ings reachable from the runtime roots. when non-null, dump only things reachable from the object indicated. startkind jsgctracekind trace kind of startthing, if startthing is not null. must be jstrace_object when startthing is null. thingtofind void * null or a pointer to a gc thing. if this is non-null, js_dumpheap only dumps paths in the object graph leading to the
specified thing. maxdepth size_t the upper bound on the number of edges to descend from the graph roots. thingtoignore void * null or a pointer to a gc thing that will be ignored during graph traversal. enum jsgctracekind { // these trace kinds have a publicly exposed, although opaque, c++ type. // note: the order here is determined by our value packing. other u...
JS_EncodeString
destringtoutf8(jscontext *cx, js::handlestring str); // added in spidermonkey 24 name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.. str jsstring * / js::handlestring a string to encode. description js_encodestring and js_encodestringtoutf8 convert the
specified javascript str to a c string (an array of 8-bit chars). if js_cstringsareutf8 is true, then the returned string of js_encodestring is utf-8, and the conversion is lossless. otherwise the high byte is simply dropped from each char16_t. js_encodestringtoutf8 encode the string to utf-8. the array returned by js_encodestring on success is allocated as though by a call to js_malloc. the caller may ...
JS_EncodeStringToBuffer
type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. str jsstring * a string to encode. buffer char * a character buffer to receive encoded string. length size_t the size of buffer in bytes. description js_encodestringtobuffer converts the
specified javascript str to a c string (an array of 8-bit chars) and fills the
specified buffer with up to length bytes of the string. it returns the length of the whole string encoding or (size_t)-1 if the string can't be encoded as bytes. if the returned value is greater than the length you
specified, the string was truncated. to encode to utf8, use js::getdeflatedutf8stringlength and js::deflatestringt...
JS_Enumerate
, js::handleobject obj); name type description cx jscontext * the context in which to enumerate object properties. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object whose properties are to be enumerated. description js_enumerate gets the ids of all own properties of the
specified object, obj, that have the jsprop_enumerate attribute. (the term own property refers to a property that is not inherited from the object's prototype.) this is not quite the same behavior as a javascript for...in loop, which converts all property ids to strings and also enumerates inherited properties. this calls obj's jsclass.enumerate hook. on success, js_enumerate returns a pointer to the first...
JS_EvaluateScript
name of file or url containing the script. used to report filename or url in error messages. lineno unsigned int line number. used to report the offending line in the file or url if an error occurs. rval jsval * out parameter. on success, if rval is not null, *rval receives the result value. description js_evaluatescript compiles and executes a script in the
specified scope, obj. js_evaluateucscript is the unicode version of the function. src is the string containing the text of the script. length indicates the size of the text version of the script in characters. filename is the name of the file (or url) containing the script. this information is used in messages if an error occurs during compilation. similarly, lineno is used to report the line number of t...
JS_EvaluateScriptForPrincipals
unsigned int line number. used to report the offending line in the file or url if an error occurs. rval jsval * out parameter. on success, *rval receives the value from the last-executed expression statement in the script. version jsversion javascript version for the script. description js_evaluatescriptforprincipals compiles and executes a script in the
specified scope, obj. js_evaluateucscriptforprincipals is the unicode version of the function. principals is a pointer to the jsprincipals structure that contains the security information to associate with this script. src is the string containing the text of the script. length is the length of the script, in characters. filename is the name of the file (or url) containing the script. this information i...
JS_ExecuteRegExp
to the lastindex for the execution, and received the updated lastindex. test bool pass true to avoid creating match result array and store boolean value to rval. rval js::mutablehandlevalue out parameter. receives the result match result array or boolean value. description js_executeregexp and js_newregexpobjectnostatics execute the regexp object, reobj, to the
specified input string, chars, from *indexp index. if test is false, js_executeregexp and js_newregexpobjectnostatics store the match result array to *rval if matches, otherwise stores null to *rval. if test is true, js_executeregexp and js_newregexpobjectnostatics store the boolean value true to *rval if matches, otherwise stores null to *rval. js_executeregexp updates the built-in regexp object's prope...
JS_ExecuteScript
cript, script. js::cloneandexecutescript handles a cross-compartment script. if the script is cross-compartment, it is cloned into the current compartment before executing. if the script executes successfully, rval receives the value from the last executed expression statement processed in the script, and js_executescript returns true. otherwise it returns false, and the value left in rval is un
specified. the jsapi user guide contains example code using compiled scripts. to execute a script that has not been compiled, use js::evaluate instead. see also mxr id search for js_executescript mxr id search for js::cloneandexecutescript js::compile js::evaluate bug 993438 bug 1145294 -- removed obj from js::cloneandexecutescript. bug 1097987 -- removed obj from js_executescript ...
JS_ForwardGetPropertyTo
syntax bool js_forwardgetpropertyto(jscontext *cx, js::handleobject obj, js::handleid id, js::handleobject onbehalfof, js::mutablehandlevalue vp); bool js_forwardgetelementto(jscontext *cx, js::handleobject obj, uint32_t index, js::handleobject onbehalfof, js::mutablehandlevalue vp); name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object to search on for the property. ...
JS_GC
name type description cx jscontext * the context to for which to perform garbage collection. added in spidermonkey 52 rt jsruntime * the runtime to for which to perform garbage collection. obsolete since jsapi 50 description js_gc performs garbage collection of js objects, strings and other internal data structures that are no longer reachable in the
specified context or runtime. garbage collection frees memory so that it can be reused by the system. when your scripts create many objects, you may want to call js_gc directly in your code, particularly when a script terminates or when the application has idle time. to perform garbage collection only if needed, call js_maybegc instead. use js_setgccallback to add hooks that are called during garbage col...
JS_GET_CLASS
th a jscontext* and a jsobject* as arguments in thread-safe builds, and in non-thread-safe builds it took only a jsobject*. the js_get_class(cx, obj) macro abstracted away this detail. newer versions have removed the context argument, so that the same signature is used regardless whether or not the build is thread-safe. description js_get_class returns a pointer to the jsclass associated with a
specified js object, obj. the application must treat the jsclass as read-only. to check the type of an object, use js_hasinstance instead. for a stricter, exact-match-only check, use js_instanceof or js_getinstanceprivate. the js_get_class abstracted away signature differences in the js_getclass method in threadsafe and non-threadsafe builds. as of spidermonkey 1.8.8 it no longer exists, because js_getcla...
JS_GetArrayPrototype
cription cx jscontext * pointer to a javascript context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. forobj js::handleobject an object from the global whose array.prototype is being retrieved. description js_getarrayprototype() retrieves the original array.prototype of a
specified object, obj. if an error occurs, it returns null. note: this expression might have different values over time if the global array property is modified, but this method returns only the original value. see also mxr id search for js_getarrayprototype bug 872043 ...
JS_GetClass
oth a jscontext* and a jsobject* as arguments in thread-safe builds, and in non-thread-safe builds it took only a jsobject*. the js_get_class(cx, obj) macro abstracted away this detail. newer versions have removed the context argument, so that the same signature is used regardless whether or not the build is thread-safe. description js_getclass returns a pointer to the jsclass associated with a
specified js object, obj. the application must treat the jsclass as read-only. if obj has no jsclass, this returns null. to check the type of an object, use js_hasinstance instead. for a stricter, exact-match-only check, use js_instanceof or js_getinstanceprivate. see also mxr id search for js_getclass bug 723517 ...
JS_GetClassObject
description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. key jsprotokey the key of the prototype. objp js::mutablehandle<jsobject*> out parameter. if successful, receive the class constructor. description js_getclassobject gets the builtin class costructor for the
specified prototype key. if successful, js_getclassobject stores the class constructor to *objp and returns true, otherwise returns false and the value of *objp is undefined. see also mxr id search for js_getclassobject js_getclassprototype jsprotokey ...
JS_GetClassPrototype
ion cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. key jsprotokey the key of the prototype. objp js::mutablehandle<jsobject*> out parameter. if successful, receive the class prototype object. description js_getclassprototype gets the builtin class costructor for the
specified prototype key. if successful, js_getclassprototype stores the class prototype object to *objp and returns true, otherwise returns false and the value of *objp is undefined. see also mxr id search for js_getclassprototype js_getclassobject jsprotokey ...
JS_GetFunctionName
retrieve the given name for a
specified function. use js_getfunctionid instead. syntax const char * js_getfunctionname(jsfunction *fun); name type description fun jsfunction * a pointer to a javascript function. description js_getfunctionname retrieves the function name associated with a function pointer, fun. the return value is either the name of a function, or the string "anonymous", which indicates that the function was not assigned a name when created. the pointer returned by this function is valid only as long as the
specified function, fun, exists. see also js_getfunctionid js_getfunctiondisplayid bug 617215 ...
JS_GetFunctionPrototype
cx jscontext * pointer to a javascript context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. forobj js::handleobject an object from the global whose function.prototype is being retrieved. description js_getfunctionprototype() retrieves the original function.prototype of a
specified object, obj. if an error occurs, it returns null. note: this expression might have different values over time if the global function property is modified, but this method returns only the original value. see also mxr id search for js_getfunctionprototype bug 726182 ...
JS_GetFunctionScript
this article covers features introduced in spidermonkey 38 retrieves a jsscript for a
specified function. syntax jsscript * js_getfunctionscript(jscontext *cx, js::handlefunction fun); 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. fun js::handlefunction pointer to a js function. description js_getfunctionscript returns a pointer to jsscript for the
specified function, fun. if fun is a native function, it returns null. see also mxr id search for js_getfunctionscript bug 1069694 ...
JS_GetGlobalForCompartmentOrNull
syntax jsobject * js_getglobalforcompartmentornull(jscontext *cx, jscompartment *c); name type description cx jscontext * the context for which to return the global object. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. c jscompartment * the compartment for which to return the global object. description js_getglobalforcompartmentornull() returns the global object for the context and the compartment. ...
JS_GetGlobalObject
name type description cx jscontext * the context from which to retrieve the global object. description this function is obsolete: use js_getglobalforobject or js_getglobalforscopechain instead. the concept of a global object belonging to a context will likely be phased out in future versions of spidermonkey. js_getglobalobject retrieves the global object for a
specified jscontext *, cx. this returns null if cx has no global object. spidermonkey supports applications that have multiple global objects, such as the various window objects in a web browser. the object returned by js_getglobalobject is not necessarily the same thing as the global object seen by any javascript code that runs in cx! if a function is executing, the global object used by that function is ...
JS_GetInstancePrivate
syntax void * js_getinstanceprivate(jscontext *cx, js::handle<jsobject*> obj, const jsclass *clasp, js::callargs *args); // added in jsapi 32 void * js_getinstanceprivate(jscontext *cx, js::handle<jsobject*> obj, const jsclass *clasp, jsval *argv); // obsolete since jsapi 32 name type description cx jscontext * a context. obj js::handle<jsobject*> the object for which to retrieve private data. clasp jsclass * class against which to test the object. ...
JS_GetObjectPrototype
ption cx jscontext * pointer to a javascript context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. forobj js::handleobject an object from the global whose object.prototype is being retrieved. description js_getobjectprototype() retrieves the original object.prototype of a
specified object, obj. if an error occurs, it returns null. note: this expression might have different values over time if the global object property is modified, but this method returns only the original value. see also mxr id search for js_getobjectprototype bug 725888 ...
JS_GetObjectRuntime
this article covers features introduced in spidermonkey 17 retrieve a pointer to the jsruntime of a
specified object. syntax jsruntime * js_getobjectruntime(jsobject *obj); name type description obj jsobject * the object to query. description js_getobjectruntime retrieves a pointer to the jsruntime for a
specified jsobject. see also mxr id search for js_getobjectruntime bug 723286 ...
JS_GetParentRuntime
this article covers features introduced in spidermonkey 31 retrieve a pointer to the parent jsruntime. syntax jsruntime * js_getparentruntime(jscontext *cx); name type description cx jscontext * the context to query. description js_getparentruntime retrieves a pointer to the parent jsruntime of the runtime for a
specified jscontext. if the cx's runtime has no parent runtime, js_getparentruntime returns cx's runtime itself. see also mxr id search for js_getparentruntime js_getruntime bug 964059 ...
JS_GetPrototype
context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject object for which to retrieve the prototype. protop js::mutablehandleobject out parameter. if successful, receives prototype object of obj. description js_getprototype retrieves the prototype of a
specified object, obj. a prototype object provides properties inherited by similar js objects. this is the equivalent of object.getprototypeof(obj) from javascript. if js_getprototype returns false, that signals an exception, which should be handled as usual. otherwise, it stores a pointer to the prototype or null to *protop and returns true. to set an object's prototype, use js_setprototype. see also ...
JS_GetRegExpFlags
this article covers features introduced in spidermonkey 17 get the flags of the given regexp object. syntax unsigned js_getregexpflags(jscontext *cx, handleobject obj) name type description cx jscontext * a context. obj js::handleobject the object to get the flags. description js_getregexpflags returns flags of the
specified object, obj. if successful, js_getregexpflags returns the flags, otherwise returns false. see also mxr id search for js_getregexpflags js_newregexpobject js_newucregexpobject flags regexp bug 655641 ...
JS_GetRegExpSource
covers features introduced in spidermonkey 17 get the source string of the given regexp object. syntax jsstring * js_getregexpsource(jscontext *cx, js::handleobject obj); name type description cx jscontext * a context. obj js::handleobject the object to get the source string. description js_getregexpsource returns a source string of the
specified object, obj. if successful, js_getregexpsource returns a pointer to the source string, otherwise returns null. see also mxr id search for js_getregexpsource js_newregexpobject js_newucregexpobject regexp bug 655641 ...
JS_GetRuntime
retrieves a pointer to the jsruntime. syntax jsruntime * js_getruntime(jscontext *cx); name type description cx jscontext * the context to query. description js_getruntime retrieves a pointer to the jsruntime with which a
specified jscontext, cx, is associated. each context is associated with a particular jsruntime when it is created (see js_newcontext); js_getruntime provides a convenient, programmatic way to look up the association. see also mxr id search for js_getruntime js_newcontext ...
JS_GetStringBytes
ring. syntax char * js_getstringbytes(jsstring *str); const char * js_getstringbytesz(jscontext *cx, jsstring *str); // added in jsapi 1.8.2 name type description cx jscontext * (js_getstringbytesz and js_encodestring only) a context. str jsstring * string to retrieve bytes from. description js_getstringbytes and js_getstringbytesz convert the
specified javascript string, str, to a c string (an array of 8-bit chars). if js_cstringsareutf8 is true, then the returned string is utf-8, and the conversion is lossless. otherwise the high byte is simply dropped from each jschar. on success, the return value is a pointer to the char array, which is null-terminated. on failure, js_getstringbytes returns a pointer to a null-terminated empty string; js_get...
JS_GetStringEncodingLength
vascript string in bytes. syntax size_t js_getstringencodinglength(jscontext *cx, jsstring *str); name type description cx jscontext * a context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext.. str jsstring * a string to encode. description js_getstringencodinglength returns the length of the
specified string in bytes, regardless of its encoding. you can use this value to create a buffer to encode the string into using the js_encodestringtobuffer function. to encode to utf8, use js::getdeflatedutf8stringlength and js::deflatestringtoutf8buffer instead. see also mxr id search for js_getstringencodinglength js_encodestringtobuffer js::deflatestringtoutf8buffer js::getdeflatedutf8stringlen...
JS_GetTypeName
obsolete since jsapi 34this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. returns a pointer to the string literal description of a
specified js data type. syntax const char * js_gettypename(jscontext *cx, jstype type); name type description cx jscontext * pointer to a js context from which to derive runtime information. type jstype one of jstype_void, jstype_object, jstype_function, jstype_string, jstype_number, or jstype_boolean. description js_gettypename returns a pointer to a string literal description of a
specified js data type, type. the following table lists jstypes and the string literals reported by js_gettypename: type ...
JS_GetVersion
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. ...
JS_HasElement
determine whether a javascript array has an element in the
specified index. syntax bool js_haselement(jscontext *cx, js::handleobject obj, uint32_t index, bool *foundp); name type description cx jscontext * the context in which to perform the property lookup. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to search for the element. index uint32_t index of the element to look up. foundp bool * out parameter. on success, it stores true to *foundp, false otherwise. description js_haselement examines a
specified js object, obj, and its prototype chain, for an element or numeric property numbered index. if the element exists, js_hasele...
JS_HasInstance
ive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handle<jsobject*> constructor/prototype to test. v js::handle<js::value> the value to test. bp bool * out parameter. on success, *bp receives the result of the test. description js_hasinstance determines if a
specified js value, v, is an instance of js object, obj. this function is equivalent to v instanceof obj test in javascript. on success, js_hasinstance stores the result of the instanceof test in *bp and returns true. on error or exception, it returns false, and the value left in *bp is undefined. when providing a prototype as obj, the prototype's jsclass must have its hasinstance method set. otherwise js...
JS_IdArrayGet
ced in spidermonkey 17 get the item of a jsidarray. syntax jsid js_idarrayget(jscontext *cx, jsidarray *ida, unsigned index) name type description cx jscontext * a context. ida jsidarray * the jsidarray to get the length. index unsigned the index of the id in the jsidarray. description js_idarrayget gets the item in the
specified index of the id array pointed to by ida. see also mxr id search for js_idarrayget jsidarray js_idarraylength bug 641027 ...
JS_IdToProtoKey
otokey js_idtoprotokey(jscontext *cx, js::handleid id); 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. id js::handleid the property identifier to convert. description js_idtoprotokey converts a
specified js id, id, to a prototype key. on success, js_idtoprotokey returns a jsprotokey. otherwise it returns jsproto_null. see also mxr id search for js_idtoprotokey js::protokeytoid bug 933681 ...
JS_IdToValue
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. id jsid the property identifier to convert. vp js::mutablehandle<js::value> out parameter. on success, *vp receives the converted value. description js_idtovalue converts a
specified js id, id, to a js value. on success, js_idtovalue stores the converted value in *vp and returns true. otherwise it returns false. the inverse of js_idtovalue is js_valuetoid. see also mxr id search for js_idtovalue js_valuetoid ...
JS_InstanceOf
syntax bool js_instanceof(jscontext *cx, js::handle<jsobject*> obj, const jsclass *clasp, js::callargs *args); // added in spidermonkey 38 bool js_instanceof(jscontext *cx, js::handle<jsobject*> obj, const jsclass *clasp, jsval *argv); // obsolete since jsapi 32 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::handle<jsobject*> object to test. clasp jsclass * class against which to test the object. ...
JS_InternString
s const char * or const char16_t * pointer to a character array containing the data for the string. in js_internstring and js_internucstring, the string must be null-terminated. length size_t (only in js_internstringn and js_internucstringn) the length of s in characters. description js_internstring and js_internstringn return an interned javascript string with a
specified value, s. js_internucstring and js_internucstringn are the unicode versions of the function. each jsruntime keeps a table of all existing interned strings. if an interned string already exists with the desired value, these functions return the existing string. otherwise a new string is created and added to the table. strings created with these functions are protected from garbage collection for t...
JS_IsArrayObject
determine if a
specified object is an array. syntax bool js_isarrayobject(jscontext *cx, js::handlevalue value, bool *isarray); bool js_isarrayobject(jscontext *cx, js::handleobject obj, bool *isarray); // obsolete since jsapi 44 bool js_isarrayobject(jscontext *cx, js::handlevalue value); bool js_isarrayobject(jscontext *cx, js::handleobject obj); name type description cx jscontext * a context. value js::handlevalue the value to examine. obj js::handleobject the object to examine. isarray bool whether the value/object is an array. description js_isarrayobject determines if a
specified object, obj or value, is an array object. on success, returns true and sets isarray indicating whether obj is an array ob...
JS_IsConstructor
this article covers features introduced in spidermonkey 24 return whether the given function is a valid constructor. syntax bool js_isconstructor(jsfunction *fun); name type description fun jsfunction * the function to examine. description js_isconstructor determines if a
specified function, fun is a valid constructor object. if so, js_isconstructor returns true. otherwise it returns false. see also mxr id search for js_isconstructor js::isconstructor bug 807228 ...
JS_IsExtensible
name type description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to examine. extensible bool * out parameter. receives true if extensible, false otherwise. description js_isextensible queries [[extensible]] property of the
specified object, obj. if successful, js_isextensible stores [[extensible]] property to *extensible and returns true, otherwise returns false and the value of *extensible is undefined. see also mxr id search for js_preventextensions js_preventextensions bug 492845 ...
JS_IsExternalString
syntax bool js_isexternalstring(jsstring *str); name type description str jsstring * the string to check. ...
JS_IsRunning
indicates whether or not a script or function is currently executing in a given context. syntax bool js_isrunning(jscontext *cx); name type description cx jscontext * the context to query. description js_isrunning determines if a script or function is currently executing in a
specified jscontext, cx. if a script is executing, js_isrunning returns true. otherwise it returns false. see also mxr id search for js_isrunning ...
JS_IterateCompartments
syntax void js_iteratecompartments(jsruntime *rt, void *data, jsiteratecompartmentcallback compartmentcallback); name type description cx jsruntime * the runtime of the compartments to iterate over. data void * this will be passed as the data parameter of the jsiteratecompartmentcallback. compartmentcallback jsiteratecompartmentcallback callback function (see below). ...
JS_LooselyEqual
context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v1, v2 js::handle<js::value> the value to compare. equal bool * out parameter. receives the comparison result. description js_looselyequal determines if v1 is loosely equal to v2 under the javascript == operator, as
specified in ecma 262-3 §11.9.3. if the comparison attempt was successful, the method returns js_true and stores the result in *equal; otherwise it returns js_false. comparing jsvals directly in c++, as in v1 == v2, does not produce a meaningful result, since it is possible for two distinct jsstrings or jsdoubles to represent the same string or number. see also mxr id search for js_looselyequal js_s...
JS_NewDateObject
bject to. mday int the day of the month to set the new object to. hour int the hour to set the new object to. min int the minute to set the new object's time to. sec int the second to set the new object's time to. description creates and returns a new jsobject representing a javascript date object, which is pre-configured using the
specified values. see also mxr id search for js_newdateobject js_newdateobjectmsec js_objectisdate bug 625870 ...
JS_NewDateObjectMsec
syntax jsobject * js_newdateobjectmsec(jscontext *cx, double msec); name type description cx jscontext * the context. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. msec double time since unix epoch in milliseconds. ...
JS_NewDoubleValue
as desired in some cases but not others. the result is subject to garbage collection until you protect against it using a local root, an object property, or the js_addroot function. this can be avoided by using the address of a rooted variable as rval. on success, js_newdoublevalue stores a numeric jsval in *rval and returns js_true. otherwise it returns js_false and the value left in *rval is un
specified. see also js_numbervalue bug 549143 ...
JS_NewGlobalObject
s * the security information to associate with this 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 nu...
JS_NewNumberValue
js garbage collection heap. in this case, the value is subject to garbage collection until you protect against it using a local root, an object property, or the js_addroot function. this can be avoided by using the address of a rooted variable as rval. on success, js_newnumbervalue stores a numeric jsval in *rval and returns js_true. otherwise it returns js_false and the value left in *rval is un
specified. see also js_numbervalue bug 752223 ...
JS_NewRuntime
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 state (the self-hosting and initial atoms compartments). 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. (the engine may use helper threads internally, though.) on success, js_newruntime returns a pointer to the newly created r...
JS_ObjectIsDate
syntax bool js_objectisdate(jscontext *cx, js::handleobject obj); name type description cx jscontext * pointer to a javascript context from which to derive runtime information. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj jsobject * jsobject that should be checked. description js_objectisdate() can be used to check if you are dealing with a date object, or a date object used across compartments (or windows or sites, in the browser embedding). ...
JS_ParseJSON
reviver only) a reviver function to apply to the created value after parsing; see json.parse. vp jsval * out parameter. *vp receives the value after parsing (and optionally, processing by the reviver). if an error occurs, the value left in *vp is undefined. description use these functions to parse a sequence of characters as json. the parsing rules applied by these methods are exactly those
specified by ecmascript 5. various json extensions like trailing commas, unquoted property names, more generous number parsing, and so on are not supported. mxr id search for js_parsejson mxr id search for js_parsejsonwithreviver ...
JS_PropertyStub
and returns true. js_enumeratestub is a stub for jsclass.enumerate. it does nothing and returns true. js_resolvestub is a stub for jsclass.resolve. it does nothing and returns true. js_convertstub is a stub for jsclass.convert. its behavior is the same as the default conversion behavior for objects. it attempts to call the object's valueof and tostring functions, in the order determined by the
specified type, in accordance with the default defaultvalue algorithm in es5 §8.12.8. js_finalizestub is a stub for jsclass.finalize. it does nothing. see also mxr id search for js_propertystub mxr id search for js_strictpropertystub jspropertyop jsstrictpropertyop bug 1103152 - removed js_deletepropertystub, js_enumeratestub, js_resolvestub, and js_convertstub bug 736978 - removed js_finalizest...
JS_RemoveRootRT
thing that rp points to from the list of gc things that are protected from garbage collection. rp is thus a pointer to a pointer to a js double, string, or object. do not pass a pointer to a js double, string, or object -- you must pass a pointer to a pointer or a pointer to a jsval that's a gc thing. the entry for the gc thing rp points to is removed in the garbage collection hash table for the
specified runtime, rt. js_removerootrt always returns js_true. see also mxr id search for js_removeroot jsval_is_gcthing js_addroot js_addnamedroot js_addnamedrootrt js_dumpnamedroots, js_removeroot ...
JS_SetElement
bject. it behaves like the javascript expression obj[index] = v. on success, js_setelement returns true. on error or exception, js_setelement returns false. obsolete since jsapi 29 on success, js_setelement returns true and the value left in *vp is left unchanged unless an addproperty hook or setter modified it. on error or exception, js_setelement returns false and the value left in *vp is un
specified. see also mxr id search for js_setelement bug 963167 - added v ...
JS_SetFunctionCallback
const jscontext *cx, int entering); name type description fun const jsfunction * the javascript function being invoked or exited. scr const jsscript * the script being executed. cx jscontext * the javascript context in which the script is being run. entering int true if the callback is being called because the
specified function is being invoked or false if the function is exiting. see also mxr id search for js_setfunctioncallback function tracing js_getfunctioncallback bug 1103269 ...
JS_SetNativeStackQuota
but are not strictly performed on behalf of such script), trusted script (as determined by js_settrustedprincipals), and untrusted script. each kind of code may have a different stack quota, allowing 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
d; otherwise the property's setter is called, passing the arguments (cx, obj, id, &v). if the setter succeeds and the property has a stored value, then the value left in v becomes the stored value of the property. on success, js_setproperty returns true, and the value in v is left unchanged unless a hook or setter modified it. on error or exception, it returns false, and the value left in v is un
specified. internally, property assignment, including all the behavior described above, is implemented by obj's jsobjectops.setproperty callback. see also mxr id search for js_setproperty mxr id search for js_setucproperty mxr id search for js_setpropertybyid bug 461163 ...
JS_SetPrototype
description cx jscontext * the context in which to set the object's prototype. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject the object to modify. proto js::handleobject the object to set as the new prototype of obj. description js_setprototype sets the prototype object for a
specified object. a prototype object provides properties that are shared by similar js object instances. ordinarily you set a prototype for an object when you create the object with js_newobject, but if you do not set a prototype at that time, you can later call js_setprototype to do so. obj is a pointer to an existing js object, and proto is a pointer to second existing object upon which the first object ...
JS_SetRegExpInput
t. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. obj js::handleobject a pointer to a global object. input js::handlestring a pointer to the input string. multiline bool true if input is multiline. description js_setregexpinput sets the pending input string of the built-in regexp object to the
specified input string. the jsreg_multiline is set to multiline parameter, and other flags are all reset. on successful, js_setregexpinput returns true, otherwise returns false. see also mxr id search for js_setregexpinput js_newregexpobject js_newucregexpobject jsreg_multiline js_clearregexpstatics regexp ...
JS_SetVersion
rsion of the javascript language. syntax jsversion js_setversion(jscontext *cx, jsversion version); name type description cx jscontext * pointer to a js context from which to derive runtime information. version jsversion version of javascript to set context to. description js_setversion attempts to set the version of javascript to version for a
specified executable script context, cx. the version comes from the jsversion enumerated type. js_setversion returns the js version in effect for the context before you changed it. see also mxr id search for js_setversion jsversion js_getversion js_versiontostring js_stringtoversion bug 880917 ...
JS_SetVersionForCompartment
pt language. syntax void js_setversionforcompartment(jscompartment *compartment, jsversion version); name type description compartment jscompartment * pointer to a js compartment. version jsversion version of javascript to set compartment to. description js_setversionforcompartment attempts to set the version of javascript to version for a
specified compartment, compartment. the version comes from the jsversion enumerated type. see also mxr id search for js_setversionforcompartment jsversion js_getversion js_versiontostring js_stringtoversion bug 880917 ...
JS_StrictlyEqual
which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v1, v2 js::handle<js::value> / jsval the value to compare. equal bool * out parameter. receives the comparison result. description js_strictlyequal determines if v1 is strictly equal to v2 under the javascript === operator, as
specified in ecma 262-3 §11.9.6. if the comparison attempt was successful, the method returns true and stores the result in *equal; otherwise it returns false. comparing jsvals directly in c++, as in v1 == v2, does not produce a meaningful result, since it is possible for two distinct jsstrings or jsdoubles to represent the same string or number. see also mxr id search for js_strictlyequal js_loosel...
JS_ToggleOptions
syntax uint32 js_toggleoptions(jscontext *cx, uint32 options); name type description cx jscontext * a context on which to modify options. options uint32 the set of options to toggle. this is the logical or of zero or more flags described at js_setoptions. ...
JS_TypeOfValue
value. syntax jstype js_typeofvalue(jscontext *cx, js::handle<js::value> v); name type description cx jscontext * the context in which to perform the type check. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handle<js::value> the value to examine. description js_typeofvalue examines a
specified js value, v, and returns its js data type. the return value is always one of jstype_void, jstype_object, jstype_function, jstype_string, jstype_number, or jstype_boolean. see also mxr id search for js_typeofvalue js_convertvalue js_gettypename js_valuetoboolean js_valuetofunction js_valuetoint32 js_valuetonumber js_valuetoobject js_valuetostring ...
JS_ValueToFunction
levalue v); jsfunction * js_valuetoconstructor(jscontext *cx, js::handlevalue v); name type description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the value to convert. description js_valuetofunction converts a
specified javascript value, v, to a function. js_valuetoconstructor is the exactly same function as js_valuetofunction. this conversion is dangerous and almost entirely useless, because the resulting jsfunction is not a real function object and therefore cannot be safely passed to any other jsapi function. that includes js_callfunction() and js_getfunctionobject(). a jsfunction represents only the compi...
JS_ValueToNumber
s, *dp receives the converted floating-point value. description js_valuetonumber converts a javascript value to a number. it implements the tonumber operator described in ecma 262-3 §9.3. if v is already a number, conversion succeeds. if v is undefined, null, false, or true, conversion succeeds, and the result is nan, 0, 0, or 1 respectively. if v is a string, conversion proceeds as
specified in ecma 262-3 §9.3.1. js_valuetonumber always succeeds in this case, returning js_true. if the string is not a numeric string, *dp is set to nan. otherwise v is an object. js_valuetonumber carries out the following steps to convert it to a number. if at any step an error or exception occurs, or conversion succeeds, the rest of the steps are skipped. (this behavior is implemented by v's jsobject...
JS_ValueToObject
n cx jscontext * the context in which to convert the value. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handlevalue the value to convert. objp js::mutablehandleobject out parameter. on success, *objp receives null or a pointer to the resulting object. description js_valuetoobject converts a
specified javascript value, v, to an object. on success, this function stores either null or a pointer to the resulting object in *objp and returns true. otherwise it returns false and the value left in *objp is un
specified. if v is jsval_null or jsval_void, the result is null. if v is a boolean value, a number, or a string, the result is a new wrapper object of type boolean, number, or string. otherwi...
JS_ValueToSource
ax jsstring * js_valuetosource(jscontext *cx, js::handle<js::value> v); name type description cx jscontext * the context in which to perform the conversion. requires request. in a js_threadsafe build, the caller must be in a request on this jscontext. v js::handle<js::value> the value to convert. description js_valuetosource converts a
specified javascript value, v, to a javascript source. on success, js_valuetosource returns a pointer to a string. on error or exception, it returns null. this happens, for example, if v is an object and v.tosource() throws an exception. see also bug 462910 ...
JS_freeop
ee. syntax void js_freeop(jsfreeop *fop, void *p); name type description fop jsfreeop * a pointer to jsfreeop structure to be used to get the implementation of free. p void * a pointer to the allocated memory to be freed. description js_freeop is a wrapper for js_free(p) that may delay js_free(p) invocation as a performance optimization as
specified by the given jsfreeop instance. see also mxr id search for js_freeop jsfreeop js_free bug 737365 ...
OBJECT_TO_JSVAL
please use js::objectvalue/js::objectornullvalue instead in spidermonkey 45 or later. syntax jsval object_to_jsval(jsobject *obj); name type description obj jsobject * a pointer to a javascript object to convert to a jsval. description object_to_jsval casts obj from type jsobject * to jsval. ...
Property attributes
existing property. added in spidermonkey 38 mxr id search for jsprop_ignore_readonly jsprop_ignore_permanent ignore the value in jsprop_permanent. this flag only valid when defining over an existing property. added in spidermonkey 38 mxr id search for jsprop_ignore_permanent jsprop_ignore_value ignore the js::value in the descriptor. nothing was
specified when passed to object.defineproperty from script. added in spidermonkey 38 mxr id search for jsprop_ignore_value see also bug 575997 - for jsprop_shared bug 1088002 - added jsprop_propop_accessors bug 825199 - added jsprop_define_late bug 365851 - added jsfun_stub_gsops bug 581263 - added jsfun_constructor bug 1101123 - added jsprop_redefine_nonconfigurable bug 1037770 - ...
STRING_TO_JSVAL
please use js::stringvalue instead in spidermonkey 45 or later. syntax jsval string_to_jsval(jsstring *str) name type description obj jsstring * a pointer to a js string to convert to a jsval. description string_to_jsval casts a given jsstring * to jsval. ...
SpiderMonkey 1.8.5
31 bits long) as pointers to jsdouble; instead, the jsdouble value is directly stored in the jsval. this affects macros like double_to_jsval and jsval_to_double, which now operate directly on jsdouble rather than jsdouble pointers. previous spidermonkey versions usually represented integer values smaller than 2^31 as jsvals encoding jsint; e.g. so that jsval_is_int was true. while this was never
specified behaviour, it is no longer true; numeric values which are integers are frequently encoded as jsdouble inside the jsval. embedders must be careful when converting numbers from jsvals into c. note also that spidermonkey can now fit a full 32-bit integer (jsint) inside a jsval without promoting to a jsdouble. jsextendedclass jsextendedclass has been removed from the api entirely. jsid previous spid...
SpiderMonkey 1.8.7
31 bits long) as pointers to jsdouble; instead, the jsdouble value is directly stored in the jsval. this affects macros like double_to_jsval and jsval_to_double, which now operate directly on jsdouble rather than jsdouble pointers. previous spidermonkey versions usually represented integer values smaller than 2^31 as jsvals encoding jsint; e.g. so that jsval_is_int was true. while this was never
specified behaviour, it is no longer true; numeric values which are integers are frequently encoded as jsdouble inside the jsval. embedders must be careful when converting numbers from jsvals into c. note also that spidermonkey can now fit a full 32-bit integer (jsint) inside a jsval without promoting to a jsdouble. jsextendedclass jsextendedclass has been removed from the api entirely. jsid previous spid...
Running Automated JavaScript Tests
es, run tests named in a given file, exclude tests named in a given file, hide the progress bar, change the timeout, run skipped tests, print output in tinderbox format, run a test in the debugger, or run tests in valgrind. run with the -h option to see all the options. the jstests test suite also includes some tests from web-platform-tests. by default, these are only run when no tests paths are
specified; this can be overridden by the --wpt=enabled flag. running jstest in a browser jstests also runs on browser, with the following command: ./mach jstestbrowser to run specific test, you can use --filter=pattern command-line argument, where pattern is a regexp pattern that is tested against file:///{path_to_obj_dir}/dist/test-stage/jsreftest/tests/jsreftest.html?test={relative_path_to_test_from...
XForms Accessibility
specifies contextual help for the containing form control (see the spec, the docs). the help element has role_alert role. hint similar to a tooltip (see the spec, the docs). the value of hint element is used as description of accessible object. alert this message will be shown when the form control cannot properly bind to instance data or when the instance data value is invalid or out of the
specified range of selectable values (see the spec, the docs). the alert element has role_alert role for both usual and inline alert elements. message used in combination with event listeners to display a message to the user when the
specified event occurs (see the spec, the docs). the message element has role_alert role. resources below you will find a list of xforms/accessiblity resources: mozilla...
Using the Places annotation service
ifaviconservice.getfaviconlinkforpage. it is important that you use these functions and not make up your own uris, because these functions will efficiently default to the default page favicon when it does not exist. see using the places favicon service for more information. lifetime of annotations annotation expiration can be explicitly stated when the annotation is created. if no expiration is
specified, the annotation is expired when the number of visits to the url is set to zero. valid values for expiration are: expire_with_history : default. annotations live as long as the uri is in history (eg: has >0 visits). expire_never : never expire. must be explictly removed. expire_session : removed at application exit. expire_days : removed at 7 days. expire_weeks : removed at 30 days. expir...
Using the Places keywords API
fined if there's no post data. if no keyword exists, will resolve to null. placesutils.keywords.fetch("my_keyword").then(entry => { /* entry is either null, or a keyword entry */ }, e => { /* failure */}); fetching entries by url the fetch() method also accepts a keyword entry, where it's possible to specify keyword, url, or both. if both are
specified it will try to fetch an exact match. specifying only an url, will fetch all the keywords associated to such an url. note that fetch() always resolves to a single entry, to fetch all of the entries it's necessary to provide a callback function. placesutils.keywords.fetch({ url: "http://www.example.com/" }, entry => { /* invoked for each found keyword entry */ }) ...
The Publicity Stream API
r - if the publicity server is unreachable for_apps is a json list of apps that this store has (each represented as its origin url), so that stream events not relating to applications in a given presentation context can be excluded from the return value. if null or an empty list is passed, events for all apps are returned. since the timestamp of the earliest event you want returned. if not
specified, will default to the beginning of the stream. before the timestamp of the latest event you want returned. if not
specified, will default to now. count the maximum number of events to return, with preference given to more recent events [make this preference its own parameter?]. if not
specified, will default to [25]. ...
XPCOM array guide
n each member: void notifyobservers(const nstarray<observerclass*>& observers) { for (pruint32 i = observers.length(); i > 0 ; ) { --i; observers[i]->observe(); } } bounds-safe access to elements you can also access elements in an nstarray<t> using the safeelementat() method. this method is bounds-safe; that is, if you attempt to access an element outside the range of the array, a
specified "safe" value is returned. for example: var value = myarray.safeelementat(idx, defaultvalue); if (value == defaultvalue) { /* the index idx was out of bounds, or the value at that index was the default value */ } note: as of gecko 8.0, if the element type is a pointer type, you can use the safeelementat() method without providing a default value. it returns a null pointer if the index is ou...
How to build an XPCOM component in JavaScript
nt in. _xpcom_categories: [{ // each object in the array specifies the parameters to pass to // nsicategorymanager.addcategoryentry(). 'true' is passed for both // apersist and areplace params. category: "some-category", // optional, defaults to the object's classdescription entry: "entry name", // optional, defaults to the object's contractid (unless 'service' is
specified) value: "...", // optional, defaults to false. when set to true, and only if 'value' is not //
specified, the concatenation of the string "service," and the object's contractid // is passed as avalue parameter of addcategoryentry. service: true }], // queryinterface implementation, e.g. using the generateqi helper (remove argument if skipped steps above) queryinterfac...
Component Internals
at startup. registration methods in xpcom what is xpcom registration? in a nutshell, registration is the process that makes xpcom aware of your component(s). as this section and the next describe, you can register your component explicitly during installation, or with the regxpcom program, or you can use the autoregistration methods in the service manager to find and register components in a
specified components directory: xpinstall apis regxpcom command-line tool nsicomponentregistrar apis from service manager the registration process is fairly involved. this section introduces it in terms of xpcom initialization, and the next chapter describes what you have to do in your component code to register your component with xpcom. once the manifest files are read in, xpcom checks to see if...
Creating the Component Code
ent. this method is only called once, so you have to persist the location if you are going to use it later. the next two parameters are usually passed into the nsicomponentregistrar methods and used by xpcom to determine how to handle the component's registration. the aloaderstr parameter, which is opaque and should not be modified, distinguishes components that are loaded from the same location
specified by the nsifile parameter. a single zip archive may store several xpcom components, where every component in the archive has the same nsifile parameter but the aloaderstr parameter can be used to refer to the location within the zip archive. the last parameter specifies what kind of loader to use on the component. this is reserved as an optimization, for the most part, but it can be a useful way ...
Starting WebLock
presented by the property. * */ nsifile getfile(in string prop, out prbool persistent); }; modifying paths with nsifile the directory service returns an nsifile object, but that object points to the application directory and not the file itself. to modify this nsifile so that it points to the file, you must call the append method of the nsifile. append adds the input string to the path already
specified in the nsifile. on unix, for example, calling append("b") on an nsifile modifies that nsifile representing /u/home/dougt/a to point to /u/home/dougt/a/b. the next operation on the nsifile returns results associated with the "b" path. if "a" wasn't a directory, further operations would fail, even if the initial append was successful. this is why append is considered a string operation. the webloc...
Receiving startup notifications
einstance(). if you want your component to be started as a service, prepend "service," to the contract id: categorymanager->addcategoryentry(appstartup_category, "mycomponentname", "service,contract-id", pr_true, pr_true, 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 appstartupn...
Components.utils.import
are not part of its public api. import throws if it encounters an error (like a syntax error) in the file it reads. example components.utils.import("resource://gre/modules/xpcomutils.jsm", this); difference from mozijssubscriptloader the differences from mozijssubscriptloader: the behavior when importing/loading the same code from different locations: the subscript loader evaluates the
specified code each time it is invoked, with the caller's global object. components.utils.import evaluates the code of each module only once, in its own scope. for example: var scope1 = {}, scope2 = {}; components.utils.import("resource://gre/modules/json.jsm", scope1); components.utils.import("resource://gre/modules/json.jsm", scope2); assert(scope2.xpcomutils === scope1.xpcomutils); ...returns true...
NS_NewLocalFile
systems. on windows, passing true causes shortcuts to be automatically resolved, and on macos, passing true causes finder aliases to be automatically resolved. aresult [out] a reference to the newly created nsilocalfile instance. return values the ns_newlocalfile function returns ns_ok if successful. otherwise, it returns an error code. ns_error_file_unrecognized_path indicates that the
specified path is invalid. this error is returned if a relative file path is passed to ns_newlocalfile. remarks on unix systems, the prefix "~/" is supported as a shorthand for the user's home directory. example code // create a local file that references c:\foo.txt nsresult rv; nscomptr<nsilocalfile> file; rv = ns_newlocalfile(nsembedstring(l"c:\\foo.txt"), pr_false, getter_addr...
NS_NewNativeLocalFile
ms. on windows, passing true causes shortcuts to be automatically resolved, and on macos, passing true causes finder aliases to be automatically resolved. aresult [out] a reference to the newly created nsilocalfile instance. return values the ns_newnativelocalfile function returns ns_ok if successful. otherwise, it returns an error code. ns_error_file_unrecognized_path indicates that the
specified path is invalid. this error is returned if a relative file path is passed to ns_newnativelocalfile. remarks on unix systems, the prefix "~/" is supported as a shorthand for the user's home directory. if you use this function on windows 2000 or later, you would not be able to handle file names containing characters outside the default code page even though the os has no problem dealing with the...
Clone
static void* clone( const void* aptr, size_t asize ); parameters aptr [in] the address of the memory block to copy. this must be non-null. asize [in] specifies the new size in bytes of the block of memory to allocate. the buffer at aptr must be at least asize bytes in length. return values this function returns nsnull if the memory allocation fails. otherwise, it returns a pointer to the newly allocated buffer. ...
nsMemory
ticular size. realloc the realloc function reallocates a block of memory to a new size. free the free function frees a block of memory that was allocated by xpcom's memory manager. heapminimize the heapminimize function attempts to shrink the size of the heap. clone the clone function creates a copy of an existing memory block up to the size
specified. getglobalmemoryservice the getglobalmemoryservice function returns a reference to xpcom's global nsimemory object. remarks to use the methods in this class, you must link your component or application against the xpcom glue library. the static methods defined on this class are not frozen. however, if you use these functions in your xpcom component, and if you link to the xpcom glu...
IAccessible2
ult role( [out] long role ); parameters role the role of an iaccessible2 object. return value s_ok. scrollto() makes an object visible on the screen. hresult scrollto( [in] enum ia2scrolltype scrolltype ); parameters scrolltype defines where the object should be placed on the screen. return value e_invalidarg if bad [in] passed. s_ok. scrolltopoint() moves the top left of an object to a
specified location. hresult scrolltopoint( [in] enum ia2coordinatetype coordinatetype, [in] long x, [in] long y ); parameters coordinatetype specifies whether the coordinates are relative to the screen or the parent object. x defines the x coordinate. y defines the y coordinate. return value e_invalidarg if bad [in] passed. s_ok. states() returns the bit strip containing any iaccessible2 states. t...
IAccessibleComponent
is interface is implemented by any object that can be rendered on the screen. 1.0 66 introduced gecko 1.9 inherits from: iunknown last changed in gecko 1.9 (firefox 3) this interface provides the standard mechanism for an assistive technology to retrieve information concerning the graphical representation of an object. coordinates used by the functions of this interface are
specified in different coordinate systems. their scale is the same and is equal to that of the screen coordinate system. in other words all coordinates are measured in pixels. they differ in their respective origin: the screen coordinate system has its origin in the upper left corner of the current screen. the origin of the parent coordinate system is the upper left corner of the parent's bounding box. wi...
IAccessibleImage
eposition() returns the coordinates of the image. [propget] hresult imageposition( [in] enum ia2coordinatetype coordinatetype, [out] long x, [out] long y ); parameters coordinatetype specifies whether the returned coordinates should be relative to the screen or the parent object. x the x coordinate. y the y coordinate. return value s_ok. imagesize() returns the size of the image in units
specified by parent's coordinate system. [propget] hresult imagesize( [out] long height, [out] long width ); parameters height the height of the image. width the width of the image. return value s_ok. ...
mozIJSSubScriptLoader
ts.interfaces.mozijssubscriptloader); note: see components.utils.import for another way to import javascript code. method overview jsval loadsubscript(in string url, in object targetobj optional, in string charset optional); jsval loadsubscriptwithoptions(in string url, in object options); methods loadsubscript() synchronously loads and executes the script from the
specified url. as of gecko 8.0, scripts are loaded from the startup cache where possible. the loaded script is executed with the principal associated with the target object. any top-level functions or variables created by the loaded script via var are created as properties of the targetobj target object (but things declared via let and const are not). additionally, properties of the targetobj target obje...
mozIStorageBindingParamsArray
ts by calling the mozistoragestatement.newbindingparamsarray(). method overview void addparams(in mozistoragebindingparams aparameters); mozistoragebindingparams newbindingparams(); attributes attribute type description length unsigned long the number of mozistoragebindingparams objects in the array. methods addparams() adds the
specified set of parameters to the end of the array. the appended parameters will be used when mozistoragestatement.executeasync() is called. void addparams( in mozistoragebindingparams aparameters ); parameters aparameters the mozistoragebindingparams object containing the parameters to append to the array. newbindingparams() creates and returns a new, empty, mozistoragebindingparams object to...
mozIStorageRow
ant getresultbyname(in autf8string aname); methods getresultbyindex() returns the value from a specific column in the row, using a zero-based index to identify the column. nsivariant getresultbyindex( in unsigned long aindex ); parameters aindex the zero-based index of the column number whose value is to be returned. return value an nsivariant object containing the value of the
specified column. getresultbyname() returns the value from a specific column in the row, identifying the column by name. nsivariant getresultbyname( in autf8string aname ); parameters aname the name of the column whose value is to be returned. return value an nsivariant object containing the value of the
specified column. see also storage mozistorageresultset mozistorageconnection mozist...
nsIAccessNode
es an object visible on screen. void scrollto( in unsigned long ascrolltype ); parameters ascrolltype defines where the object should be placed on the screen (see nsiaccessiblescrolltype.constants for available constants). exceptions thrown ns_error_failure indicates that the access node is unattached from the accessible tree. scrolltopoint() moves the top left of an object to a
specified location. void scrolltopoint( in unsigned long acoordinatetype, in long ax, in long ay ); parameters acoordinatetype specifies whether the coordinates are relative to the screen or the parent object (for available constants refer to nsiaccessiblecoordinatetype.constants. ax defines the x coordinate. ay defines the y coordinate. exceptions thrown ns_error_failure indicates t...
nsIAccessibleTableCell
le.idlscriptable please add a summary to this article. 1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview boolean isselected(); attributes attribute type description columnextent long return the number of columns occupied by this cell. the result differs from 1 if the
specified cell spans multiple columns. read only. columnheadercells nsiarray return an array of column header cells for this cell. read only. columnindex long return column index of this cell. read only. rowextent long return the number of rows occupied by this accessible cell. the result differs from 1 if the
specified cell spans multiple rows. read only. rowheadercells nsiarray return an array of...
nsIAppStartup
, when doing performance testing of the startup process to discount numbers for tests that were interrupted by a user prompt. nativeappsupport nsinativeappsupport getter for "native application support." read only. obsolete since gecko 1.9.1 constants the following flags may be passed as the amode parameter to the quit() method. one and only one of the "quit" flags must be
specified. the erestart flag may be bit-wise combined with one of the "quit" flags to cause the application to restart after it quits. constant value description econsiderquit 0x01 attempt to quit if all windows are closed. eattemptquit 0x02 try to close all windows, then quit if successful. eforcequit 0x03 force all windows to close, then quit. ...
nsIApplicationCacheNamespace
ead only. constants constant value description namespace_bypass 1 items matching this namespace can be fetched from the network when loading from this cache. the data attribute is not used. namespace_fallback 2 items matching this namespace can be fetched from the network when loading from this cache; however, if the load fails, 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 name...
nsIArray
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. null is a valid result for this method, but exceptions are thrown in other circumstances. void queryelementat( in unsigned long index, in nsiidref uuid, [iid_is(uuid), retval] out nsqiresult result ); parameters index position of element. uuid the iid of the requested interface. result the object, queryinterface'd to the requested interface. exceptions thrown ns_error_illegal...
nsIAuthModule
voidptr aintoken, in unsigned long aintokenlength, in boolean confidential, out voidptr aouttoken, out unsigned long aouttokenlength); constants constant value description req_default 0 default behavior. req_mutual_auth (1 << 0) client and server will be authenticated. req_delegate (1 << 1) the server is allowed to impersonate the client. the req_mutual_auth flag may also need to be
specified in order for this flag to take effect. methods getnexttoken() this method is called to get the next token in a sequence of authentication steps. void getnexttoken( [const] in voidptr aintoken, in unsigned long aintokenlength, out voidptr aouttoken, out unsigned long aouttokenlength ); parameters aintoken a buffer containing the input token (for example a challenge from a server). thi...
nsIAutoCompleteInput
timeout unsigned long the number of milliseconds after a keystroke before a search begins. methods getsearchat() returns the name of one of the autocomplete search session objects. acstring getsearchat( in unsigned long index ); parameters index the index number of the search session object whose name is to be returned. return value the name of the
specified object. onsearchbegin() called when the search starts. void onsearchbegin(); parameters none. onsearchcomplete() called when the search ends successfully. void onsearchcomplete(); parameters none. ontextentered() called when the user selects and presses enter on a result item. boolean ontextentered(); parameters none. return value return true to prevent handling the selection. ontextreverted()...
nsIBrowserHistory
nds since the unix epoch. markpageasfollowedlink() obsolete since gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) note: this method was moved to another interface in gecko 22.0. you should use nsinavhistoryservice.markpageasfollowedlink() instead. this function was originally added in gecko 2.0 (firefox 4/thunderbird 3.3/seamonkey 2.1). designates the
specified url as coming from a link explicitly followed by the user (for example by clicking on it). void markpageasfollowedlink( in nsiuri auri ); parameters auri the url that is to be marked as explicitly followed by the user. markpageastyped() obsolete since gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) note: this method was moved to another interfa...
nsICacheMetaDataVisitor
inherits from: nsisupports last changed in gecko 1.7 method overview boolean visitmetadataelement(in string key, in string value); methods visitmetadataelement() this method is called for each key/value pair in the meta data for a cache entry. boolean visitmetadataelement( in string key, in string value ); parameters key the key for visiting the meta data for a cache entry. value the value for visiting the meta data for a cache entry. ...
nsICachingChannel
tations are compatible. the implementation of nsicachingchannel would be expected to only read from the cache entry identified by the cache token and not try to validate it. the cache token can be queryinterface'd to a nsicacheentryinfo if more detail about the cache entry is needed. for example, expiration time. offlinecacheclientid acstring the session into which to cache offline data. if not
specified, data will be placed in "http-offline". offlinecachetoken nsisupports the same as cachetoken but accessing the offline app cache token if there is any. exceptions thrown ns_error_not_available when there is not offline cache token. constants constant value description load_no_network_io 1 << 26 this load flag inhibits fetching from the net. an error of ns_error_document_not_cached...
nsIClipboard
in the given list. boolean hasdatamatchingflavors( [array, size_is(alength)] in string aflavorlist, in unsigned long alength, in long awhichclipboard ); parameters aflavorlist an array of ascii strings. alength the length of the aflavorlist. awhichclipboard specifies the clipboard to which this operation applies. return value returns true, if data is present and it matches the
specified flavor. otherwise it returns false. setdata() this method sets the data from a transferable on the native clipboard. void setdata( in nsitransferable atransferable, in nsiclipboardowner anowner, in long awhichclipboard ); parameters atransferable the transferable containing the data to put on the clipboard. anowner the owner of the transferable. awhichclipboard specifies the cl...
nsICommandController
void docommandwithparams( in string command, in nsicommandparams acommandparams ); parameters command the command to execute. acommandparams the parameters. getcommandstatewithparams() void getcommandstatewithparams( in string command, in nsicommandparams acommandparams ); parameters command...
nsIComponentRegistrar
ing registered. if afactory is null, the contract will be associated with a previously registered classid. registerfactorylocation() registers a factory to be used to instantiate a particular class identified by classid, and creates an association of class name and contractid with the class. however, unlike registerfactory(), the location of the component containing the factory implementation is
specified instead of the factory instance. void registerfactorylocation( in nscidref aclass, in string aclassname, in string acontractid, in nsifile afile, in string aloaderstr, in string atype ); parameters aclass the classid of the class being registered. aclassname the name of the class being registered. this value is intended as a human-readable name for the class and need not be globally...
nsICompositionStringSynthesizer
setstring(). sum of alength must be same as the length of astring of setstring(). void appendclause(in unsigned long alength, in unsigned long aattribute); parameters alength the length of appending clause. aattribute the attribute of appending clause. must be one of attr_* constants. dispatchevent() dispatches dom events for setting the composition string which are
specified by setstring(), appendclause() and setcaret() to the focused editor. if appendclause() hasn't been called, this dispatches events to set composition string without clause information. in other words, commits composition string. if appendclause() and/or setcaret() are not called properly, e.g., sum of alength of calls of appendclause() is not same as composition string set by setstring(), this t...
nsIContentFrameMessageManager
ither synchronous or asynchronous messages to the chrome process: for details on these messaging apis see the documentation for the nsicontentframemessagemanager's parent classes nsisyncmessagesender and nsimessagesender. methods void dump(in domstring astr); domstring atob(in domstring aasciistring); domstring btoa(in domstring abase64data); dump() prints the
specified string to standard output. parameters name type description astr string the message to log. atob() convert ascii base64 data to binary data. parameters name type description aasciistring string ascii string to decode. returns string: the decoded binary data. btoa() convert binary data to ascii base64 data . ...
nsIContentPrefService2
ences; 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 definition 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.example.com", not "example.com". private-browsing context parameters many methods also accept a "context" parameter. this parameter relates to private browsin...
nsIContentSecurityPolicy
calls to this may trigger violation reports when queried, so this value should not be cached. boolean permitsancestry( in nsidocshell docshell ); parameters docshell containing the protected resource. return value true if the frame's ancestors are all permitted by policy. refinepolicy() updates the policy currently stored in the content security policy to be "refined" or tightened by the one
specified in the string policystring. void refinepolicy( in astring policystring, in nsiuri selfuri ); parameters policystring selfuri scanrequestdata() called after the content security policy object is created to fill in the appropriate request and request header information needed in case a report needs to be sent. void scanrequestdata( in nsihttpchannel achannel ); parameters achannel se...
nsIConverterInputStream
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 defines the buffer size of the converter stream. in case of a buffer size of less than or equal to 0, the default size converter_buffer_size will be used. this is currently set to 8192 bytes. areplacementchar any unknown byte sequence will be replaced with this character. the default replacement character is u+fffd. a value of 0x0000 will cause an exception to be thro...
nsICryptoHash
r s = array.from(hash, (c, i) => tohexstring(hash.charcodeat(i))).join(""); // s now contains your hash in hex this gives 5eb63bbbe01eeed093cb22bb8f5acdc3 for the hash value. this example, while simple, shows most of the functionality of the interface. the first thing to note is that when you call the init() method you must specify the hash algorithm to use. all of the available algorithms are
specified as constants on the interface. also note that when you call the updatefromstream() method, the second parameter is the number of bytes to read. passing pr_uint32_max here indicates that you want the entire file read. finally, note that calling the finish() method produces the hash value. the single parameter to this method is false in this example to return binary data. passing true returns the...
nsIDOMChromeWindow
ialog/wizard element, the applications should call this method for the accessibility and the usability on windows at onload event. void notifydefaultbuttonloaded( in nsidomelement defaultbutton ); parameters defaultbutton the default button element of the window. restore() restores the size and position of the window. void restore(); parameters none. setcursor() sets the mouse cursor to the
specified cursor. the mouse cursor is locked to the
specified cursor if it's not "auto". at that time, the cursor has been never changed by cursor moving. after you call this method with "auto", the cursor will be unlocked. void setcursor( in domstring cursor ); parameters cursor you can specify same values of css cursor property (including -moz- prefixed values). and there are special values: "grab", ...
nsIDOMClientRect
it is returned by functions like element.getboundingclientrect. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) attributes attribute type description bottom float y-coordinate, relative to the viewport origin, of the bottom of the rectangle box. read only. height float height of the rectangle box (this is identical to bottom minus top). read only. ...
nsIDOMEvent
t() 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 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 wi...
nsIDOMFileException
idomfileexception.idlscriptable please add a summary to this article. last changed in gecko 1.9 (firefox 3) attributes attribute type description code unsigned short the error code describing the error condition that took place; see the constants list for details. constants constant value description not_found_err 0 the
specified file wasn't found. not_readable_err 1 the
specified file wasn't readable. see also nsidomfile nsidomfilelist nsidomfilereader ...
nsIDOMFileReader
content/base/public/nsidomfilereader.idlscriptable please add a summary to this article. last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) inherits from: nsisupports implemented by: @mozilla.org/files/filereader;1. to create an instance, use: var filereader = components.classes["@mozilla.org/files/filereader;1"].createinstance(components.interfaces.nsidomfilereader); this interface implements the dom filereader object; see that documentation for details. ...
nsIDOMFontFace
s available for all fonts these attributes are always available. attribute type description cssfamilyname domstring a family name that could be used in css font-family (not necessarily the actual name that was used, due to aliases, generics, localized names, and so on). read only. name domstring full font name as obtained from the font resource. read only. attributes only available when
specified with @font-face these attributes only have meaningful values when the font is a user font defined using @font-face. attribute type description format domstring the font format. read only. localname domstring null if not a src:local(...) rule. read only. metadata domstring xml metadata from woff file(if any). read only. rule nsidomcssfontfacerule null if no associated @font-face rule. r...
nsIDOMFontFaceList
nsidomfontface item( in unsigned long index ); parameters index the index into the array of the font face object to return. return value an nsidomfontface object representing a single font face. see also nsidomfontface @font-face ...
nsIDOMMozNetworkStatsManager
ats object describing the network statistics. if network stats are not available for some dates, then rxbytes and txbytes are undefined for those dates. if the filtering start date is greater than the end date, an exception is thrown. exceptions thrown ns_error_invalid_arg the filtering start date is greater than the end date. ns_error_not_implmented both appmanifesturl and servicetype are
specified at the same time in the networkstatsgetoptions dictionary. invalidnetwork the network must be in the return of getavailablenetworks. addalarm() install an alarm on a network. when total data usage reaches threshold bytes, a "networkstats-alarm" system message is sent to the application, where the optional parameter data must be a cloneable object. nsidomdomrequest addalarm(in nsisupports ne...
nsIDOMSimpleGestureEvent
n double deltaarg); attributes attribute type description delta double the delta value indicating how far the gesture moved. for update events, this indicates the movement since the previous update; for the mozrotategesture and mozmagnifygesture events, this indicates the total movement that occurred while the event was being processed. the value is
specified in degrees for rotation events (where positive values indicate clockwise rotation and negative values indicate counter-clockwise rotation). for magnify gestures, the units are implementation-specific; however, positive values indicate zooming in, and negative values indicate zooming out. read only. note: on mac os x, the units used for magnification gestures by the underlying operating syste...
nsIDOMStorageList
irefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview nsidomstorage nameditem(in domstring domain); methods nameditem() called when the list of available access points changes. nsidomstorage nameditem( in domstring domain ); parameters domain the name of the domain for whom to return the storage object. return value the nsidomstorage object representing the data store for the
specified domain.see also dom storage structured client-side storage (html 5 specification) nsidomwindow ...
nsIDOMStorageManager
nstance of the localstorage object for auri's origin. this is used to ensure that only one local storage area exists for a given origin. nsidomstorage getlocalstorageforprincipal( nsiprincipal aprincipal, domstring adocumenturi ); parameters aprincipal the principal for which to return the local storage object. adocumenturi the document's uri. return value the local storage object for the
specified principal. getusage() returns the amount of disk space used by a domain. usage is checked against the domain of the page that set the key (the owner domain), not the domain of the storage object. long getusage( astring aownerdomain ); parameters aownerdomain the domain to check. return value the space usage of the domain, in bytes.see also offline apps dom storage structured client-side sto...
nsIDOMWindow
lue the nsiselection object for the window. scrollby() scrolls the window by a given number of pixels relative to the current scroll position. void scrollby( in long xscrolldif, in long yscrolldif ); parameters xscrolldif the number of pixels by which to scroll horizontally. yscrolldif the number of pixels by which to scroll vertically. scrollbylines() scrolls the window by the
specified number of lines. void scrollbylines( in long numlines ); parameters numlines the number of lines by which to scroll. scrollbypages() scrolls the window by the
specified number of pages. void scrollbypages( in long numpages ); parameters numpages the number of pages by which to scroll. scrollto() scrolls the window to an absolute pixel offset. void scrollto( in long xscr...
nsIDOMWindowInternal
d() void home() void stop() void print() void moveto(in long xpos, in long ypos) void moveby(in long xdif, in long ydif) void resizeto(in long width, in long height) void resizeby(in long widthdif, in long heightdif) void scroll(in long xscroll, in long yscroll) nsidomwindow window interface's open() method loads the
specified resource into the browsing context (window, <iframe> or tab) with the
specified name. if the name doesn't exist, then a new window is opened and the
specified resource is loaded into its browsing context.">open(in domstring url, in domstring name, in domstring options) nsidomwindow nsisupports aextraargument) void close() void updatecommands(in domstring action) ...
nsIDOMXPathResult
expression used in the evaluator. first_ordered_node_type 9 type is the first node in the document that matches the expression used in the evaluator. methods iteratenext() iterates through the available nodes of an unordered_node_iterator_type or ordered_node_iterator_type result. nsidomnode iteratenext(); parameters none. return value a dom node. snapshotitem() returns the
specified node from what is essentially an array of resulting dom nodes. is only available if the result type is unordered_node_snapshot_type or ordered_node_snapshot_type. nsidomnode snapshotitem( in unsigned long index ); parameters index the index of the dom node to return. return value a dom node. see also introduction to using xpath in javascript document object model (dom) level 3 xpa...
nsIDictionary
absent. getkeys() retrieve all keys in the dictionary. void getkeys( out pruint32 count, [retval, array, size_is(count)] out string keys ); return value array of all keys, unsorted. getvalue() find the value indicated by the key. nsisupports getvalue( in string key ); parameters key the lookup key indicating the value. return value the value associated with the
specified key. if the key doesn't exist, ns_error_failure is returned. setvalue() add the key-value pair to the dictionary. if the key is already present, the new value replaces the old one. void setvalue( in string key, in nsisupports value ); parameters key the key by which the value can be accessed. value the value to store. deletevalue() find the value indicated by th...
nsIDirIndex
netwerk/streamconv/public/nsidirindex.idlscriptable a class holding information about a directory index. because this has no reference back to their original source, changing these attributes won't affect the directory. inherits from: nsisupports last changed in gecko 1.7 attributes attribute type description contenttype string the content type; may be null if it is unknown. un
specified for directories. description wstring a description for the filename, which should be displayed by a viewer. lastmodified prtime last-modified time in seconds-since-epoch. if the last modified time is unknown, this value is -1. location string the fully qualified filename, expressed as a uri. this is encoded with the encoding
specified in the nsidirindexparser, and is also escaped. size lo...
nsIDownloadProgressListener
in long long amaxselfprogress, in long long acurtotalprogress, in long long amaxtotalprogress, in nsidownload adownload ); parameters awebprogress the nsiwebprogress instance used by the download manager to monitor downloads. arequest the nsichannel that changed state. this parameter will not be null. acurselfprogress the current amount of progress that's been made on the download
specified by adownload. amaxselfprogress the value that the self progress needs to reach to indicate that the download is complete. acurtotalprogress the current amount 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 acu...
nsIDownloader
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 will select a location and the resulting file will be deleted (or otherwise made invalid) when the downloader object is destroyed. if an explicit download location is
specified then the resulting file will not be deleted, and it will be the callers responsibility to keep track of the file, and so on. ...
nsIDragDropHandler
se 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 detach(); void hookupto(in nsidomeventtarget attachpoint, in nsiwebnavigation navigator); methods detach() unregisters all handlers related to drag and drop. void detach(); parameters none. hookupto() attaches drag handlers to a
specified receiver, setting up callbacks to let built-in behaviors be overridden. void hookupto( in nsidomeventtarget attachpoint, in nsiwebnavigation navigator ); parameters attachpoint the receiver to which to attach drag handlers. navigator the nsiwebnavigation object to handle the dropped urls. if this is null, the client must handle the drop itself, either through the method provided via ove...
nsIDragSession
checks to see if any of the native data on the clipboard matches a given data flavor. if numdropitems is greater than one, there is no indication as to which of the items matches the data flavor. boolean isdataflavorsupported( in string adataflavor ); parameters adataflavor a string representing the mime type of the data to be matched, such as "text/unicode". return value true if the
specified flavor matches any of the native data on the clipboard, otherwise false. ...
nsIErrorService
rorstringbundle( in short errormodule ); parameters errormodule the module for which the string bundle is registered. error modules are obtained from nsresult code with ns_error_get_module. return value the url of the string bundle registered for that module. geterrorstringbundlekey() retrieves a key in a string bundle for an nsresult error code. if no key is registered for the
specified nsresult, then the caller should use the nsresult's code (obtained with ns_error_get_code) instead. string geterrorstringbundlekey( in nsresult error ); parameters error the nsresult for which the string bundle key is to be retrieved. return value the key to use to retrieve the error string from the nsresult's module's string bundle. registererrorstringbundle() registers a stri...
nsIEventTarget
boolean isoncurrentthread(); void postevent(in pleventptr aevent); native code only! obsolete since gecko 1.9 constants dispatch flags constant value description dispatch_normal 0 this flag specifies the default mode of event dispatch, whereby the event is simply queued for later processing. when this flag is
specified, dispatch() returns immediately after the event is queued. dispatch_sync 1 this flag specifies the synchronous mode of event dispatch, in which the dispatch() method does not return until the event has been processed. note: passing this flag to dispatch may have the side-effect of causing other events on the current thread to be processed while waitin...
nsIExternalHelperAppService
es.nsiexternalhelperappservice); method overview boolean applydecodingforextension(in autf8string aextension, in acstring aencodingtype); nsistreamlistener docontent(in acstring amimecontenttype, in nsirequest arequest, in nsiinterfacerequestor awindowcontext, in boolean aforcesave); methods applydecodingforextension() determines whether or not data whose filename has the
specified extension should be decoded from the
specified encoding type before being saved or delivered to helper applications. boolean applydecodingforextension( in autf8string aextension, in acstring aencodingtype ); parameters aextension the filename extension to check. aencodingtype the encoding type to check. return value true if data from urls with the
specified extension and en...
nsIFaviconService
overbloated and won't be saved to the db. setfaviconurlforpage() obsolete since gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) note: this method was removed in gecko 22.0. you should use the new async api moziasyncfavicons.setandfetchfaviconforpage() instead. this method declares that a given page uses a favicon with the given uri. you needn't have any
specified data at this point. an entry linking the favicon with the page will be create with no data. you can populate it later with setfavicondata(). however, any favicons not associated with a visited web page, a bookmark, or a "place:" uri will be expired when history cleanup is done * (typically at app shutdown, but also possibly if the user clears their * cache or history). this will send out history ...
nsIFormHistory2
me, in astring value ); parameters name value return value nameexists() returns true if there is no entry that is paired with a name. boolean nameexists( in astring name ); parameters name return value removeallentries() removes all entries in the entire form history. void removeallentries(); parameters none. removeentriesbytimeframe() removes entries that were created between the
specified times. void removeentriesbytimeframe( in long long abegintime, in long long aendtime ); parameters abegintime the beginning of the timeframe, in microseconds. aendtime the end of the timeframe, in microseconds. removeentriesforname() removes all entries that are paired with a name. void removeentriesforname( in astring name ); parameters name removeentry() removes a name and value pa...
nsIFrameLoader
e. exceptions thrown throws an exception with non-remote frames. destroy() destroys the frame loader and everything inside it. this will clear the weak owner content reference. void destroy(); parameters none. loadframe() starts loading the frame. this method figures out what to load from the owner content in the frame loader. void loadframe(); parameters none. loaduri() loads the
specified uri in this frame. behaves identically to loadframe(), except that this method lets you specify the uri to load. void loaduri( in nsiuri auri ); parameters auri the uri to load into the frame. sendcrossprocesskeyevent() creates and sends a keyevent to the content viewport's process. see nsidomwindowutils.sendkeyevent() for details; this method is its equivalent for cross-process event...
nsIFrameLoaderOwner
interface. void swapframeloaders( in nsiframeloaderowner aotherowner ); parameters aotherowner the other frame loader owner with which to swap frame loaders. exceptions thrown ns_error_dom_security_err if the swap is not allowed on security grounds. ns_error_not_implemented if the swapping logic is not implemented for the either the current frame loader owner or the
specified one with which you're trying to swap. see also nsiframeloader ...
nsIFrameMessageListener
methods receivemessage() note: this method is for javascript only. called to deliver a message to the frame handling process; called with one parameter, which has the following properties: name the name of the message. sync a boolean value indicating whether or not the message should be handled synchronously. if true, the response should be returned in the
specified json object. json the json object in which to return the response if the message is being handled synchronously. objects unimplemented an array of cpow, or null if sync is false. when the listener is called, the this value is the target of the message. void receivemessage(); parameters none. see also content process event handling nsiframelistener ...
nsIInterfaceRequestor
ueryinterface() on to get to interface b, you must be able to nsisupports.queryinterface() on b to get back to a. nsiinterfacerequestor, however, allows you to obtain an interface c from a that may (or most likely) will not have the ability to get back to a. method overview void getinterface(in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result); methods getinterface() retrieves the
specified interface pointer. void getinterface( in nsiidref uuid, [iid_is(uuid),retval] out nsqiresult result ); parameters uuid the iid of the interface being requested. result the interface pointer to be filled in if the interface is accessible. exceptions thrown ns_error_no_interface the requested interface is not available. ...
nsIJSID
s that implement this interface: components.interfaces.name components.classes[contract] components.interfacesbyid[uuid] components.classesbyid[cid] the first two cases create a named 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 js...
nsIMarkupDocumentViewer
llow. note: this attribute was added late in the gecko 2.0 development cycle and was implemented by the nsimarkupdocumentviewer_mozilla_2_0_branch interface; it was merged into this interface in gecko 7.0. prevdoccharacterset acstring textzoom float the amount by which to scale all text. default is 1.0. methods scrolltonode() scroll the make the
specified node visible. void scrolltonode( in nsidomnode node ); parameters node the nsidomnode of the node to make visible. sizetocontent() tell the container to shrink-to-fit or grow-to-fit its contents. void sizetocontent(); parameters none. see also full page zoom ...
nsIMemoryMultiReporter
e measurements in a single operation (such as a single traversal of a large data structure), you can use a multi-reporter to do so. the callback, which must implement the nsimemorymultireportercallback interface, receives values that match the fields in the nsimemoryreporter object. in order for a multi-reporter to gather and generate reports, you need to call collectreports(). this will call the
specified callback's nsimemorymultireportercallback.callback() method once for each report. this will trigger any needed computation work. note: this differs from the behavior of nsimemoryreporter, which lets all fields except amount be accessed without triggering computation. attributes attribute type description explicitnonheap print64 the sum of all of this multi...
nsIMessageListenerManager
ding; this is false by default. this parameter only has an effect for frame message managers in the main process. an alternative method to listen for death of frame script is to use a message-manager-disconnect observer; see observer notifications :: message manager. removemessagelistener() undo an addmessagelistener() call; that is, calling this causes listener to stop being invoked when the
specified message is received. void removemessagelistener(in astring messagename, in nsimessagelistener listener); removemessagelistener() does not remove a message listener added via addweakmessagelistener(); use removeweakmessagelistener() for that. parameters messagename the name of the message whose listener is to be removed. listener an nsimessagelistener represen...
nsIMicrosummaryGenerator
nt to generate a microsummary. microsummaries generated by xslt templates need page content, while those which represent the actual microsummary do not. read only. uri nsiuri the canonical location and unique identifier of the generator. it tells us where the generator comes from and where to go for updates. read only. for generators referenced by web pages via <link> tags, this uri is the url
specified by the tag. for generators installed via nsisidebar.addmicrosummarygenerator(), this uri is a urn of the form urn:source:<url>, where <url> is the remote location from which we installed the generator. for generators installed via some other mechanism (for example an extension that dynamically creates generators), this uri is a urn in a form of the extension's own choosing, with the only restrict...
nsIMsgDBView
rt order used for the folder. defined in the interface: nsmsgviewsortorder. viewflags other flags to be used. defined in the interface: nsmsgviewflagstype. return values count upon return, the count variable may contain the number of messages in the folder. note: this return value does not appear to be implemented in the base implementation. openwithhdrs() opens the view with a set of
specified headers. note: this is not implemented in the base implementation. void openwithhdrs(in nsisimpleenumerator aheaders, in nsmsgviewsorttypevalue asorttype, in nsmsgviewsortordervalue asortorder, in nsmsgviewflagstypevalue aviewflags, out long acount); parameters aheaders a list of headers to open, arranged in an ns...
nsIMsgWindow
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 not used. body the html to display in the message pane. note that the...
nsIMutableArray
element the new element to insert. index the position in the array. if the position is lower than the current length of the array, an existing element will be replaced. if the position is equal to the current length of the array, the new element is appended. if the position is higher than the current length of the array, empty elements are appended followed by the new element at the
specified position. an index lower than 0 is invalid and will be ignored. weak whether or not to store the new element using a weak reference. exceptions thrown ns_error_failure when a weak reference is requested, but the element does not support nsiweakreference. see also nsiarray ...
nsINavHistoryResultObserver
te the new value for the last visit date and time for the node. anewaccesscount the new access count value for the node. nodeiconchanged() called right after a node's icon property has changed. void nodeiconchanged( in nsinavhistoryresultnode anode ); parameters anode the node whose icon has changed. nodeinserted() called when an item is inserted into a container. the item previously at the
specified index (if any) and everything below it is shifted down by one. void nodeinserted( in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode anode, in unsigned long anewindex ); parameters aparent the container into which to insert the item. anode the node to insert into the container; it may be either a leaf or another container. anewindex the index at which to insert t...
nsINavHistoryResultViewer
tainer. void nodeinserted( in nsinavhistorycontainerresultnode aparent, in nsinavhistoryresultnode anode, in unsigned long anewindex ); parameters aparent the container into which to insert the item. anode the node to insert into the container; it may be either a leaf or another container. anewindex the index at which to insert the item. remarks the item previously at the
specified index (if any) as well as everything below it, is shifted down by one. sortingchanged() called when the sorting order is changed to a particular mode. for trees, this would update the column headers to reflect the altered sorting. void sortingchanged( in unsigned short sortingmode ); parameters sortingmode one of the nsinavhistoryqueryoptions.sort_by_* constants, indicating the soft...
nsINavHistoryService
the page is actually added to history, since the page isn't added until it actually starts loading. the typed flag affects the url bar autocomplete. this will cause the transition type of the next visit of the url to be marked as "typed." void markpageastyped( in nsiuri auri ); parameters auri the page that is to be marked as typed by the user. markpageasfollowedlink() designates the
specified url as coming from a link explicitly followed by the user (for example by clicking on it). void markpageasfollowedlink( in nsiuri auri ); parameters auri the url that is to be marked as explicitly followed by the user. canadduri() this method checks if the given uri would be added to the history or not. many types of uris, such as "chrome:" uris, are not stored when adduri is called. ...
nsIObserverService
see nsiobserver for a javascript example. void addobserver( in nsiobserver anobserver, in string atopic, in boolean ownsweak ); parameters anobserver the nsiobserver object which will receive notifications. atopic the notification topic or subject. ownsweak if set to false, the nsiobserverservice will hold a strong reference to anobserver. if set to true and anobserver sup...
nsIPermissionManager
is allowed. deny_action 2 permission is denied. prompt_action 3 prompt user if the permission is allowed. permission expiration constants constant value description expire_never 0 permission never expires. expire_session 1 permission expires at end of session. expire_time 2 permission expires at a
specified time. methods add() add permission information and permission type for a given uri. if the permission already exists for a given type, it will be modified. void add( in nsiuri uri, in string type, in pruint32 permission, [optional] in pruint32 expiretype, [optional] in print64 expiretime ); parameters uri the uri to add the permission for. type a unique, case-sensitive...
Component; nsIPrefBranch
the value to the default value. if no default value exists the preference will cease to exist. note: this method does nothing if the prefbranch it is called on is a default branch. void clearuserpref( in string aprefname ); parameters aprefname the preference to be cleared. remarks note: prior to gecko 6.0, this method would throw an exception if there was no user value set for the
specified preference. now, this method never throws. instead, it simply does nothing. deletebranch() called to remove all of the preferences referenced by this branch. note: this method can be called on either a default or user branch but, in effect, always operates on both. void deletebranch( in string astartingat ); parameters astartingat the point on the branch at which to start the deletin...
nsIPrefService
le to easily access the preferences browser.startup.page, browser.startup.homepage, and browser.startup.homepage_override by simply requesting page, homepage, or homepage_override. nsnull or "" (empty string) may be used to access to the entire preference tree. return value nsiprefbranch - the object representing 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 ...
nsIPrincipal
the future: perhaps we should consider a certificate principal for a given uri subsuming a codebase principal for the same uri? not sure what the immediate benefit would be, but i think the setup could make some code (e.g. maybedowngradetocodebase) clearer. boolean subsumes( in nsiprincipal other ); parameters other missing description return value true if this principal subsumes the
specified principal; otherwise false. ...
nsIPrivateBrowsingService
abled boolean indicates whether or not private browsing mode is currently enabled. you may also turn private browsing mode on and off by setting the value of this attribute. changing this value while handling one of the notifications generated by the private browsing service throws an ns_error_failure exception. methods removedatafromdomain() removes all data stored for the
specified domain, including its subdomains. void removedatafromdomain( in autf8string adomain ); parameters adomain the domain for which data should be removed. ...
nsIProcess
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. methods init() initializes the nsiprocess with the
specified executable file. once initialized, you can start the process executing by calling run(). note: this function does not work with application bundles on mac os x, see bug 307463 for details. void init( in nsifile executable ); parameters executable the nsifile executable file to be represented by the nsiprocess object. initwithpid() obsolete since gecko 1.9.2 (firefox 3...
nsIPromptService
true for ok, false for cancel confirmex() puts up a dialog with up to 3 buttons and an optional, labeled checkbox. the buttons are numbered 0 - 2. the implementation can decide what order the buttons appear in, and it may not be simply right-to-left (2, 1, 0) or left-to-right (0, 1, 2). see bug 624043 for more on this. button 0 is the default button unless one of the button default flags is
specified (see button default flags). a button may use a predefined title,
specified by one of the button title flags values. each title value can be multiplied by a position value to assign the title to a particular button. if button_title_is_string is used for a button, the string parameter for that button will be used. if the value for a button position is zero, the button will not be shown. the followi...
nsIProtocolProxyService
n should be used. if this proxy is unavailable, getfailoverforproxy() may be called to determine the correct secondary proxy to be used. if the protocol handler for the given uri supports nsiproxiedprotocolhandler, then the nsiproxyinfo instance returned from resolve may be passed to the nsiproxiedprotocolhandler.newproxiedchannel() method to create a nsichannel to the given uri that uses the
specified proxy. however, if the nsiproxyinfo type is "http", then it means that the given uri should be loaded using the http protocol handler, which also supports nsiproxiedprotocolhandler. nsiproxyinfo resolve( in nsiuri auri, in unsigned long aflags ); parameters auri the uri to test. aflags a bit-wise combination of the resolve_ flags defined above. pass 0 to specify the default beha...
nsIProxyInfo
ct" - no proxy "unknown" - unknown proxy (see nsiprotocolproxyservice.resolve()) a future version of this interface may define additional types. read only. note: prior to gecko 1.8 type was available by the type method. constants the following "proxy flags" may be bit-wise combined to construct the flags attribute defined on this interface. all un
specified bits are reserved for future use. constant value description transparent_proxy_resolves_host 1 << 0 this flag is set if the proxy is to perform name resolution itself. if this is the case, the hostname is used in some fashion, and we shouldn't do any form of dns lookup ourselves. see also nsiprotocolproxyservice nsiprotocolprox...
nsIRadioInterfaceLayer
void sendsms( in domstring number, in domstring message, in long requestid, in unsigned long long processid ); parameters number a domstring with a telephone number to send to. message the text message as a domstring. requestid missing description processid missing description setupdatacall() pdp apis. void setupdatacall( in long radiotech, in domstring apn, in domstring ...
nsIRandomGenerator
netwerk/base/public/nsirandomgenerator.idlscriptable interface used to generate random data. 1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void generaterandombytes(in unsigned long alength, [retval, array, size_is(alength)] out octet abuffer); methods generaterandombytes() generates the
specified amount of random bytes. void generaterandombytes( in unsigned long alength, [retval, array, size_is(alength)] out octet abuffer ); parameters alength the length of the data to generate. abuffer a buffer that contains random bytes of size alength. ...
nsIResumableChannel
acstring entityid); attributes attribute type description entityid acstring the entity id for this uri. available after onstartrequest. read only. exceptions thrown ns_error_not_resumable if this load is not resumable. methods asyncopenat() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) open this channel, and read starting at the
specified offset. the request given to the nsistreamlistener will be qiable to nsiresumableinfo. void asyncopenat( in nsistreamlistener listener, in nsisupports ctxt, in unsigned long startpos, in nsiresumableentityid entityid ); parameters listener as for asyncopen. ctxt as for asyncopen. startpos the starting offset, in bytes, to use to download. entityid information about the file, to match be...
nsIScreenManager
r's definition 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 rectangle. if the rectangle overlaps multiple screens, the screen containing the majority of the rectangle's area is selected and returned. the coordinates must be
specified using global (screen) coordinates, and are in pixels. nsiscreen screenforrect( in long left, in long top, in long width, in long height ); parameters left the left edge of the rectangle. top the top edge of the rect...
nsIScriptError
initwithwindowid(). read only. linenumber pruint32 the number of the line where the error occurred. 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. sourceline astring the line from the file
specified by sourcename. you are responsible for providing that line. you may pass null if you are lazy; that will prevent showing the source line in javascript console. read only. sourcename astring the url of the file in which the error occurred. this will be a hyperlink in the javascript console, so you should use a real url. you may pass null if it's not applicable. read only. t...
nsIScriptableUnicodeConverter
nal [array, size_is(alen),retval] out octet adata ); converttoinputstream() converts a unicode string to an input stream. the bytes in the stream are encoded according to the charset attribute. the returned stream is non-blocking. nsiinputstream converttoinputstream( in astring astring ); parameters astring the text to encode to the stream. the text is encoded into the character set
specified by the charset attribute. return value an nsiinputstream that will present the text
specified in astring as its data. examples see reading textual data and writing textual data for examples. ...
nsISocketTransportService
method should be used. note: this function may only be called from an event dispatch on the socket thread. void attachsocket( in prfiledescptr afd, in nsasockethandlerptr ahandler ); parameters afd open file descriptor of the socket to control. ahandler socket handler that will receive notifications when the socket is ready or detached. createtransport() creates a transport for a
specified host and port. note: this function can be called from any thread. nsisockettransport createtransport( in array<acstring> asockettypes, in autf8string ahost, in long aport, in nsiproxyinfo aproxyinfo ); parameters asockettypes array of socket type strings. currently "starttls", "ssl" and "udp" are supported. pass an empty array [] if the default socket type should be used. you do n...
nsISpeculativeConnect
o the i/o service's implementation of nsispeculativeconnect. then call speculativeconnect() to let the networking layer know what you might be doing in the future. method overview void speculativeconnect(in nsiuri auri, in nsiinterfacerequestor acallbacks, in nsieventtarget atarget); methods speculativeconnect() call this method to hint to the networking layer that a new transaction for the
specified uri is likely to happen soon. the code implementing this method may use this information to start a tcp and/or ssl level handshake for that resource immediately so that it is ready (or at least in the process of becoming ready) when the transaction is actually submitted. no obligation is taken on by the implementer, nor is the submitter obligated to actually open the new channel. void speculative...
nsIStyleSheetService
type one of the type constants. sheetregistered() check if a stylesheet has been registered boolean sheetregistered( in nsiuri sheeturi, in unsigned long type ); parameters sheeturi uri of the stylesheet to check. type one of the type constants. return value returns true if a style sheet at sheeturi has previously been added to the list of style sheets
specified by type. unregistersheet() remove the style sheet at sheeturi from the list of style sheets
specified by type. the removal takes effect immediately, even for already-loaded documents. void unregistersheet( in nsiuri sheeturi, in unsigned long type ); parameters sheeturi uri of the stylesheet to unregister. type one of the type constants. see also see using th...
nsISupports proxies
e and idl for it and have generated a typelib. if you haven't, or you've never heard of these things, see http://www.mozilla.org/scriptable/ . the proxytype parameter can be either two flags: proxy_sync or proxy_async. these two flags can also be ored with proxy_always. proxy_always will ensure that a proxy object is always created no matter what thread you currently are on. if this flag is not
specified, the proxy object manager will compare the eventq which you pass to the eventq which is on the current thread. if they match, it will return the real non-proxied object. most of the time you will want to set this flag. proxy_sync acts just like a function call in that it blocks the calling thread until the the method is invoked on the destination thread. this is the normal and default case. pro...
nsITaggingService
return value returns array of tags (sorted by name). see also places using the places tagging service ...
nsITaskbarPreviewController
any time. see drawpreview() for more information. read only. note: although these attributes are read only, that indicates that the previews controlled by an nsitaskbarpreviewcontroller cannot alter these values. the controller and its supporting code, however, may change this values at any time. methods drawpreview() invoked by nsitaskbarpreview when it needs to render the preview. the
specified context is attached to a surface with the controller's width and height, the values of which are obtained immediately prior to calling this method. boolean drawpreview( in nsidomcanvasrenderingcontext2d ctx ); parameters ctx an nsidomcanvasrenderingcontext2d object representing the drawing context into which the preview is to be rendered. note that this context is not actually attached t...
nsITaskbarWindowPreview
r.drawpreview() and nsitaskbarpreviewcontroller.drawthumbnail() methods will be called to draw the preview. if false, the operating system draws these for you. constants constant value description num_toolbar_buttons 7 the maximum number of toolbar buttons supported by the windows taskbar api. methods getbutton() returns the
specified button from the preview's toolbar. note: by default, all buttons are hidden. you must fetch and configure each button that you want to make visible. nsitaskbarpreviewbutton getbutton( in unsigned long index ); parameters index the index into the button array for the nsitaskbarpreviewbutton to retrieve. this value must be at least 0 (the leftmost button) and less than num_toolbar...
nsIThreadInternal
) reverts a call to pusheventqueue(). when an event queue is popped, any events remaining in the queue are appended to the elder queue. void popeventqueue(); parameters none. pusheventqueue() causes any events currently enqueued on the thread to be suppressed until popeventqueue() is called. in addition, any new events dispatched to the thread are only processed if they are accepted by the
specified filter. if the filter is null, all new events are accepted. calls to pusheventqueue() may be nested, and must each be paired with a corresponding call to popeventqueue() to restore the original state of the thread. void pusheventqueue( in nsithreadeventfilter filter ); parameters filter the nsithreadeventfilter to apply to dispatched events, or null to accept all dispatched events. s...
nsIThreadManager
the main thread. read only. methods native code only!getthreadfromprthread given a prthread, this method returns the corresponding nsithread. returns null if there isn't a corresponding nsithread. nsithread getthreadfromprthread( in prthread prthread ); parameters prthread the prthread for which to retrieve the corresponding nsithread. return value the nsithread matching the
specified prthread, or null if there is no matching nsithread. newthread() create a new thread. internally, this is a global user prthread. nsithread newthread( in unsigned long creationflags ); parameters creationflags reserved for future use. pass 0. return value the newly created nsithread. see also the thread manager nsithread nsithreadpool nsithreadinternal nsithreadobserver nsi...
nsIThreadPool
provides support for thread pools. 1.0 66 introduced gecko 1.9 inherits from: nsieventtarget last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) a thread pool provides a convenient way to process events off the main thread. when you send events to the thread pool, the pool creates a new thread to process the event, up to the number of threads
specified by the threadlimit attribute. method overview void shutdown(); attributes attribute type description idlethreadlimit unsigned long get/set the maximum number of idle threads that are kept alive. once there are more than this many idle worker threads, the idle threads start getting destroyed. idlethreadtimeout unsigned long get/set th...
nsITransactionManager
zero means the transaction manager will execute each transaction, then immediately release all references it has to the transaction without pushing it on the undo stack. a value greater than zero indicates the max number of transactions that can exist at any time on both the undo and redo stacks. this method will prune the necessary number of transactions on the undo and redo stacks if the value
specified is less than the number of items that exist on both the undo and redo stacks. numberofredoitems long the number of items on the redo stack. read only. numberofundoitems long the number of items on the undo stack. read only. methods addlistener() adds a listener to the transaction manager's notification list. listeners are notified whenever a transaction is done, undone, or redone. the list...
nsITreeBoxObject
s numpages the number of pages to scroll. positive values move down in the tree. scrolltocell() scrolls such that a given cell is visible (if possible) at the top left corner of the visible view. void scrolltocell(in long row, in nsitreecolumn col); parameters row the cell's row index col the nsitreecolumn of the cell scrolltocolumn() scrolls horizontally so that the
specified column is at the left of the view (if possible). void scrolltocolumn(in nsitreecolumn col); parameters col the nsitreecolumn to scroll to scrolltohorizontalposition() scroll to a specific horizontal pixel position. void scrolltohorizontalposition(in long horizontalposition); parameters horizontalposition the number of pixels to scroll invalidate() invalidatecolumn() invali...
nsITreeContentView
last changed in gecko 1.8.0 inherits from: nsisupports method overview long getindexofitem(in nsidomelement item); nsidomelement getitematindex(in long index); attributes attribute type description root nsidomelement the element in the dom which this view uses as root content. read only. obsolete since gecko 1.8 methods getindexofitem() retrieve the index associated with the
specified content item. long getindexofitem( in nsidomelement item ); parameters item a tree row for which to find the row index. return value a non-negative integer row index if the row was found within the tree. returns -1 if the item was not found. getitematindex() retrieve the content item associated with the
specified index. nsidomelement getitematindex( in long index ); parameters index the ...
nsIURIFixup
ample on the url bar. nsiuri createexposableuri( in nsiuri auri ); parameters auri the uri to be converted. return value the converted, exposable uri, as an nsiuri. exceptions thrown ns_error_unknown_protocol when we can not get a protocol handler service for the uri scheme. ns_error_malformed_uri when the exposable portion of auri is malformed. createfixupuri() converts the
specified string into a uri, first attempting to correct any errors in the syntax or other vagaries. returns a well formed uri or nsnull if it cannot. nsiuri createfixupuri( in autf8string auritext, in unsigned long afixupflags ); parameters auritext candidate uri. afixupflags flags that govern ways the uri may be fixed up. return value the converted uri. keywordtouri() converts the speci...
nsIURL
his is purely based on searching for the last trailing slash. and hence don't rely on this to be a definite 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: this was removed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) because the semicolon is not actually valid for this purpose and should not have been specially handled. query autf8string query portion (the part after the "?") of the url. if there isn't one, an empty st...
nsIUpdateManager
teat(in long index); void saveupdates(); attributes attribute type description activeupdate nsiupdate an nsiupdate object describing the currently in use update. this update is not in the history list. read only. updatecount long the number of updates in the history list; the updates can be fetched by calling getupdateat(). read only. methods getupdateat() returns the update at the
specified index into the history list. nsiupdate getupdateat( in long index ); parameters index an index into the history list for the nsiupdate to retrieve. return value the nsiupdate at the
specified index into the history list. saveupdates() saves all updates to disk. void saveupdates(); parameters none. see also nsiupdate nsiupdatechecklistener nsiupdatechecker nsiupdatepatch nsiapplicationupdat...
nsIUploadChannel2
most implementations of this interface require that the stream: implement threadsafe addref and release implement nsiinputstream.readsegments() implement nsiseekablestream.seek(). void explicitsetuploadstream( in nsiinputstream astream, in acstring acontenttype, in long long acontentlength, in acstring amethod, in boolean astreamhasheader...
nsIWebBrowserChrome
ed. void setstatus( in unsigned long statustype, in wstring status ); parameters statustype indicates what is setting the text. status status string. null is an acceptable value meaning no status. showasmodal() shows the window as a modal window. void showasmodal(); parameters none. return value note: the function error code returned by this corresponds to the status value
specified in exitmodaleventloop. sizebrowserto() tells the chrome to size itself such that the browser will be the
specified size. void sizebrowserto( in long acx, in long acy ); parameters acx new width of the browser. acy new height of the browser. ...
nsIWebContentHandlerRegistrar
the title of the handler presented to the user as a string. contentwindow the dom content window from which the method has been called. registerprotocolhandler summary of registerprotocolhandler void registerprotocolhandler( in domstring protocol, in domstring uri, in domstring title, in nsidomwindow contentwindow ); parameters protocol the protocol the site wishes to handle,
specified as a string. uri the uri to the handler as a string. you must include "%s" to indicate where to insert the escaped uri of the document to be handled. otherwise ns_error_dom_syntax_err will be thrown. this string must also be of either the http or https schemes. title the title of the handler presented to the user as a string. contentwindow the dom content window from which the method has be...
nsIWebNavigation
void loaduri(in wstring uri , in unsigned long loadflags , in nsiuri referrer , in nsiinputstream postdata, in nsiinputstream headers) void reload(in unsigned long reloadflags) void stop(in unsigned long stopflags) constants load flags constant value description load_flags_mask 65535 this flag defines the range of bits that may be
specified. load_flags_none 0 this is the default value for the load flags parameter. load_flags_is_refresh 16 this flag specifies that the load should have the semantics of an html meta-refresh tag (that is, that the cache should be bypassed). this flag is only applicable to loaduri. xxx the meaning of this flag is poorly defined. xxx no one uses this, so we should probably de...
nsIWebPageDescriptor
e description display_as_source 0x0001 generates an optionally syntax-highlighted (for xml/html documents) source of the original page. display_normal 0x0002 just refetches the existing page. note that if the descriptor is that of the source of another page, this keeps the source view, but uses the current syntax highlighting preference. methods loadpage() tells the object to load the page
specified by the page descriptor. void loadpage( in nsisupports apagedescriptor, in unsigned long adisplaytype ); parameters apagedescriptor the page descriptor for the page to load. adisplaytype the display type to use when displaying the loaded page; see display type constants for possible values. ...
nsIWindowMediator
pen browser window. var wm = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); var enumerator = wm.getenumerator(type); while(enumerator.hasmoreelements()) { var win = enumerator.getnext(); // win is [object chromewindow] (just like window), do something with it } this code iterates over all windows of the
specified type, where type you specify is the window type. if, for example, you wish to enumerate all browser windows, you would specify "navigator:browser". if you want to enumerate all windows regardless of type, specify null. note: in nsiwindowmediator's reference page the return type of getmostrecentwindow and the type of enumerator's elements is said to be nsidomwindow/nsidomwindowinternal. in fact, ...
nsIWindowsShellService
retrieves a windows registry entry value. string getregistryentry( in long ahkeyconstant, in string asubkeyname, in string avaluename ); parameters ahkeyconstant the starting key, using the constants defined above. asubkeyname the sub key to locate. avaluename the value to locate in the sub key. the empty string returns the default value of the sub key. return value the value of the
specified sub key/value, truncated to 4096 bytes. restorefilesettings() obsolete since gecko 1.9 (firefox 3) restores system settings to what they were before firefox modified them. void restorefilesettings( in boolean aforallusers ); parameters aforallusers whether or not firefox should restore settings for all users on a multi-user system. shortcutmaintenance() provides th...
nsIWorker
ges are received on the worker's message port. methods postmessage() used to allow the worker to send a message back to the web application that created it. void postmessage( in domstring amessage, in nsiworkermessageport amessageport optional ); parameters amessage the message the worker wishes to post back to its creator. amessageport a message port on which to post the message; if not
specified, the default message port is used. ...
nsIWorkerFactory
chromeworker. implemented by: threads/workerfactory;1. to create an instance, use: var workerfactory = components.classes['@mozilla.org/threads/workerfactory;1'] .createinstance(components.interfaces.nsiworkerfactory); method overview nsiworker newchromeworker(in domstring ascripturl); methods newchromeworker() returns a new chromeworker that will run a
specified script. nsiworker newchromeworker( in domstring ascripturl ); parameters ascripturl the url of the script to load into the new worker. return value an nsiworker object representing the new chromeworker. see also using web workers worker sharedworker ...
nsIWorkerScope
tribute, it gets called. void close(); parameters none. postmessage() posts a message to the scope's parent worker object. void postmessage( in domstring amessage, in nsiworkermessageport amessageport optional ); parameters amessage the message to post. it will be stored as the data member in the event. amessageport optional specifies the message port onto which to post the message; if not
specified, the default port is used. see also using web workers nsiworkermessageevent nsiworkermessageport nsiworkerglobalscope nsiabstractworker nsiworker ...
nsIXULBrowserWindow
ppropriate target into which to load the link. this may be used, for example, to redirect links into new tabs or windows when it's not desirable to replace the content in the current tab (such as when the link is clicked in an app tab). astring onbeforelinktraversal( in astring originaltarget, in nsiuri linkuri, in nsidomnode linknode, in prbool isapptab ); parameters originaltarget the
specified target for the link. linkuri the uri of the link that is about to be traversed. linknode the nsidomnode representing the dom node in which the link is located. isapptab whether or not the link being clicked is in an app tab. return value a string indicating the revised target for the link. setjsdefaultstatus() sets the default status according to javascript's version of the default status. void ...
nsIXULWindow
shell ); parameters achromeflags see nsiwebbrowserchrome. aappshell the app shell passed to nsiappshellservice's createtoplevelwindow method. return value the newly minted window. in the case of a content window, the function creates a browser window and waits for it to load. you can then load a document into the window's primary content shell. getcontentshellbyid() the content shell
specified by the supplied id. note: that this is a docshell tree item and therefore can not be assured of what object it is. it could be an editor, a docshell, or a browser object. or down the road any other object that supports being a docshelltreeitem query accordingly to determine the capabilities. nsidocshelltreeitem getcontentshellbyid( in wstring id ); parameters id the id of the content sh...
nsIXmlRpcClient
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. ...
NS_CStringToUTF16
f the source string. see nscstringencoding for the set of values that can be passed for this parameter. adest [out] a nsastring instance that will contain the result of the conversion. the result will be encoded using the host byte order. return values the ns_cstringtoutf16 function returns ns_ok if successful. otherwise, it returns an error code. the set of possible error codes is currently un
specified. example code nsembedcstring str("hello"); nsembedstring ustr; ns_cstringtoutf16(str, ns_cstring_encoding_ascii, ustr); const prunichar *unicharbuf = ustr.get(); history this function was frozen for mozilla 1.7. see bug bug 239123 for details. see also nsacstring, nsastring, nscstringencoding ...
NS_StringContainerInit
stance for use as a nsastring. this is a low-level api. #include "nsstringapi.h" nsresult ns_stringcontainerinit( nsstringcontainer& astring ); parameters astring [in] a nsstringcontainer instance to be initialized. return values the ns_stringcontainerinit function returns ns_ok if successful. otherwise, it returns an error code. remarks the nsstringcontainer structure has un
specified 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_stringcontainerinit, the coder is required to call ns_stringcontainerfinish when done with the nsstringcontainer object. therefore, it is generally b...
XPCOM string functions
nstance. this is a low-level api.ns_stringsetdatathe ns_stringsetdata function copies data into the string's internal buffer. this is a low-level api.ns_stringsetdatarangethe ns_stringsetdatarange function copies data into a section of the string's internal buffer. this is a low-level api.ns_utf16tocstringthe ns_utf16tocstring function converts the value of a nsastring instance from utf-16 to the
specified multi-byte encoding and stores the result in a nsacstring instance. ...
Reference Manual
it. nsiweakreference* weakptr = ...; weakptr->queryreferent( using an nscomptr<t> as a t* using an nscomptr as a pointer "in" parameters "out" parameters: getter_addrefs assignment into an nscomptr is fairly easy to understand. the nscomptr releases its old value, if any, and then assigns in the new value, addrefing, and/or calling queryinterface as you
specified with the directives described above. these rules apply equally to the "assignment" that happens when copying parameters or function results that are declared to be nscomptrs. if we want nscomptrs to be a viable substitute for raw xpcom interface pointers, however, we will need to deal with the issue of "out" parameters. many xpcom functions return interface pointers as results through parameters,...
The Valgrind Test Job
ob locally, run the following command. mach valgrind-test see also the general instructions for using valgrind with mozilla code. understanding errors for each problem that valgrind finds, it emits a message describing the problem, along with a stack trace indicating where the problem occurs. it also prints a suppression, which is a sequence of text that can be put in a suppression file (and
specified via valgrind's --suppressions option) if you want valgrind to ignore such errors in future runs. for example, we have a small number of deliberate but inconsequential memory leaks in the codebase that have corresponding suppressions. but generally errors should be fixed rather than suppressed. when running locally, you may see errors that do not occur on the test machines. errors in system li...
Gloda examples
instead you need to do two queries, first to get the "identity" object for an email address and then to get the messages. this requires two chained asynchronous calls: //first take an email address and turn it into an identity object id_q = gloda.newquery(gl...
Building a Thunderbird extension 3: install manifest
his element indicates the most recent version of thunderbird for which the extension is intended to work. this cannot be higher than the currently available version. "5.0.*" indicates that the extension works with thunderbird 5.0 and any subsequent 5.0.x releases. see valid application versions for a list of the supported version numbers and formats. there are more optional elements that can be
specified in install.rdf. these are described on the install manifests page. note that elements can be
specified in any order, as long as they are children of the <description> node. « previous next » ...
Folders and message lists
rdisplay.selectedmessageuris: returns an array of the uris corresponding to the selected messages. like selectedmessages, this also includes messages in selected collapsed threads when so enabled. changing the current message selection in addition to getting the currently-selected messages, you can also change the selection: gfolderdisplay.selectmessage(msghdr): selects a single message, as
specified by msghdr (an nsimsgdbhdr) and scrolls to its position in the message list. gfolderdisplay.selectmessages(arrayofmsghdrs): selects all the messages in the array arrayofmsghdrs. like selectmessage, this function will attempt to scroll the view so the entire selection is visible (which may not be possible for large selections). gfolderdisplay.clearselection(): clears the list of selected messages...
Working with windows in chrome code
window.open("chrome://myextension/content/about.xul", "aboutmyextension", "chrome,centerscreen"); the first parameter to window.open is the uri of the xul file that describes the window and its contents. the second parameter is the window's name; the name can be used in links or forms as the target attribute. this is different from the user-visible window title, which is
specified using xul. the third, and optional, parameter is a list of special window features the window should have. the window.opendialog function works similarly, but lets you specify optional arguments that can be referenced from the javascript code. it also handles window features a little differently, including always assuming the dialog feature is
specified. from xpcom components and modules if t...
Using C struct and pointers
ript representation of the c struct. using c strings with js-ctypes a pointer to char in javascript is declared as follows: var str = ctypes.pointertype(ctypes.char); now imagine you call a c function that returns a c string and you want to modify the contents of this string. in the js-ctypes context, you can only operate on buffers of known capacity. therefore, the size of the buffer must be
specified. additionally, the js-ctypes pointer must be casted to reflect the size of the buffer: var ptr = ctypes.cast( str, ctypes.arraytype( ctypes.char, buff_size ).ptr ); here buff_size is of type ctypes.size_t. once we have a ctypes char pointer that points to a buffer of known size, we modiify the contents of the memory block as follows: ptr.contents = string("hello world from javascript!!!"); ...
CData
memory. method overview methods available on all cdata objects cdata address() string tosource() string tostring() properties properties of all cdata objects property type description constructor ctype the data type of the cdata object, as a ctype. read only. note: this is never ctypes.void_t or an array type with an un
specified length. value object the javascript equivalent of the cdata object's value. this will throw a typeerror exception if the value can't be converted. methods available on all cdata objects address() returns a cdata object of the pointer type ctypes.pointertype(dataobject.constructor) whose value points to the c object referred to by the object. this provides a way to get ...
Library
windows libraries, which will be ctypes.winapi_abi or ctypes.stdcall_abi. see abi constants. you don't need to provide this for exported data; it's only needed for function declarations. returntype the ctype type returned by the defined api, if it's a function. this parameter should not be provided if the api is an exported data symbol. argtype1...argtypen zero or more parameter ctype may be
specified for the parameters of the function being declared. these should not be provided if the api is an exported data symbol rather than a function. return value a functiontype cdata object representing the declared api. exceptions thrown ctypes ctype functiontype abi typeerror the return type was
specified as an array. alternative syntax another use for ctypes.declare is to get non-fu...
PointerType
object. writing to this value writes the c conversion of the data into the pointed-to memory. if converting the data fails, a typeerror exception is thrown. properties inherited from cdata property type description constructor ctype the data type of the cdata object, as a ctype. read only. note: this is never ctypes.void_t or an array type with an un
specified length. value object the javascript equivalent of the cdata object's value. this will throw a typeerror exception if the value can't be converted. pointertype cdata method_overview bool isnull() methods inherited from cdata cdata address() string tosource() string tostring() pointertype cdata methods isnull() determin...
Blocking By Domain - Plugins
prompts. according to the firefox plugin roadmap, the plugin block list is planned for firefox 55. effects of plugin blocking once a site is included in plugin blocking, it is not possible for that site or any subframes within that site to use plugins. any attempt to use a plugin (via the <object> or <embed> element) will behave as if the plugin was not installed, and use fallback content as
specified by the html standard. plugin detection mechanisms such as navigator.mimetypes and navigator.plugins will also behave as if the plugin were not installed. there are two versions of plugin blocking: first-party plugin blocking list sites on this list may not use plugins. third-party plugin block list sites on this list may not use plugins when they are loaded into a third-party iframe in ano...
Streams - Plugins
lug-in sending the stream in random-access mode sending the stream in file mode telling the plug-in when a stream is created to tell the plug-in instance when a new stream is created, the browser calls the npp_newstream method. this method also determines which mode it should use to send data to the plug-in. ...
Preferences System
<preferences> <preference id="pref1" name="pref.name" type="bool"/> </preferences> .. ui elements that refer to the preferences above, e.g.: <checkbox id="check1" preference="pref1" label="&check1.label;" accesskey="&check1.accesskey;"/> </prefpane> <prefpane id="pane2" label="&pane2.title;" src="chrome://uri/to/pane.xul"/> </prefwindow> pane content can be
specified inline or an external chrome uri supplied for pane content to be loaded in via a dynamic overlay. you should be careful to read the higs for the platforms you are targeting and use the xul preprocessor if necessary to set different window titles as appropriate. you should also be careful to specify the width of the window (in em) as appropriate using the preprocessor for each targeted platform, a...
Accessibility Inspector - Firefox Developer Tools
lity tree represents. you can click on the "target" icon that comes after it to select the node in the page inspector. hovering over the "target" icon highlights the dom node in the page content. description — any further description provided on the element, usually by the content of a title attribute. keyboardshortcut — any keyboard shortcut that is available to activate the element, as
specified in an accesskey attribute. note that this works correctly as of firefox 62 (bug 1467381). childcount — the number of child items the current item has in the accessibility tree hierarchy. indexinparent — an index value indicating what number child the item is, inside its parent. if the item is the first item inside its parent, it has a value of 0. if it is the second, it has a value of 1. an...
Use watchpoints - Firefox Developer Tools
break on, and then one of property set property get property get or set a watchpoint icon appears to the right of the property in the scopes pane. set watchpoint icons are blue, get watchpoint icons are reddish, and get or set watchpoint icons are dark yellow. click play or press f8 to resume execution. view a watchpoint when the watched property is accessed in the way
specified by the watchpoint type (get or set), the debugger pauses, enabling you to see line of code responsible, and to inspect anything else you wish at that time. in the following screenshot, the debugger pauses at line 7, where obj.a is set. the message panel in the upper right corner indicates that the debugger is "paused on property set". delete a watchpoint locate the watched property in the ...
Debugger.Memory - Firefox Developer Tools
ript often have visible effects on memory consumption. web developers need to know their pages’ actual memory consumption on real browsers, so it is correct for the tool to expose these behaviors, as long as it is done in a way that helps developers make decisions about their own code. this section covers some areas where firefox’s actual behavior deviates from what one might expect from the
specified behavior of the web platform. objects spidermonkey objects usually use less memory than the naïve “table of properties with attributes” model would suggest. for example, it is typical for many objects to have identical sets of properties, with only the properties’ values varying from one object to the next. to take advantage of this regularity, spidermonkey objects with identical sets of...
Debugger.Object - Firefox Developer Tools
ptured at the time of the allocation. otherwise, return null. function properties of the debugger.object prototype the functions described below may only be called with a this value referring to a debugger.object instance; they may not be used as methods of other kinds of objects. the descriptions use “referent” to mean “the referent of this debugger.object instance”. unless otherwise
specified, these methods are not invocation functions; if a call would cause debuggee code to run (say, because it gets or sets an accessor property whose handler is debuggee code, or because the referent is a proxy whose traps are debuggee code), the call throws a debugger.debuggeewouldrun exception. these methods may throw if the referent is not a native object. even simple accessors like isextensible m...
Debugger.Script - Firefox Developer Tools
eaches the given instruction, spidermonkey calls the hit method ofhandler, passing a debugger.frame instance representing the currently executing stack frame. the hit method’s return value should be a resumption value, determining how execution should continue. any number of breakpoints may be set at a single location; when control reaches that point, spidermonkey calls their handlers in an un
specified order. any number of breakpoints may use the samehandler object. breakpoint handler method calls are cross-compartment, intra-thread calls: the call takes place in the same thread that hit the breakpoint, and in the compartment containing the handler function (typically the debugger’s compartment). the new breakpoint belongs to the debugger instance to which this script belongs. disabling...
Debugger.Source - Firefox Developer Tools
r.source instance inherits the following accessor properties from its prototype: text if the instance refers to javascript source, the javascript source code, as a string. the value satisfies the program, functiondeclaration, or functionexpression productions in the ecmascript standard. if the instance refers to webassembly code, the serialized text representation. the format is yet to be
specified in the webassembly standard. currently, the text is an s-expression based syntax. the text generation is disabled if the debugger has the allowwasmbinarysource property set, the "[wasm]" value will be returned in this case. binary if the instance refers to webassembly code and the debugger has the allowwasmbinarysource property set, a uint8array that contains the webassembly bytecode. url ...
Tutorial: Set a breakpoint - Firefox Developer Tools
ts are hit, and both handlers run. this shows how any number of debugger-based tools can observe a single web page simultaneously. in fact, you can use the browser content toolbox’s debugger panel to set its own breakpoint in report, and it will trigger along with the first two. keep in mind, however, that when multiple debuggers share a debuggee, the order in which their handlers run is not
specified. if more than one tool tries to influence the debuggee’s behavior, their combined behavior could be unpredictable. close the web page and the browser content toolbox. since both the scratchpad’s global object and the debuggee window are now gone, the debugger instances will be garbage collected, since they can no longer have any visible effect on firefox’s behavior. the debugger ap...
Debugger.Object - Firefox Developer Tools
ebuggerhostannotationsforfirefox annotations] for its host objects. function properties of the debugger.object prototype the functions described below may only be called with a this value referring to a debugger.object instance; they may not be used as methods of other kinds of objects. the descriptions use "referent" to mean "the referent of this debugger.object instance". unless otherwise
specified, these methods are not invocation functions; if a call would cause debuggee code to run (say, because it gets or sets an accessor property whose handler is debuggee code, or because the referent is a proxy whose traps are debuggee code), the call throws a debugger.debuggeewouldrun exception. getproperty(name) return the value of the referent's property namedname, or undefined if it has no s...
All keyboard shortcuts - Firefox Developer Tools
n lists the shortcut for opening each tool and the second section lists shortcuts that are applicable to the toolbox itself. after that there's one section for each tool, which lists the shortcuts that you can use within that tool. because access keys are locale-dependent, they're not documented in this page. opening and closing tools these shortcuts work in the main browser window to open the
specified tool. the same shortcuts will work to close tools hosted in the toolbox, if the tool is active. for tools like the browser console that open in a new window, you have to close the window to close the tool. command windows macos linux open toolbox (with the most recent tool activated) ctrl + shift + i cmd + opt + i ctrl + shift + i bring toolbox to for...
View background images - Firefox Developer Tools
in the rules view, you can see a preview of images
specified using background-image. just hover over the rule: from firefox 41, if you right-click the image declaration, you'll see an option to copy the image as a data: url: ...
IndexedDB - Firefox Developer Tools
n inside the indexed db storage type in the storage tree of the storage inspector, a table lists the details of all the databases present for that origin. note: the data shown in an indexeddb database is a snapshot of the data as it was when you opened the storage inspector tool. databases have the following details: database name — the name of the database. storage — the storage type
specified for the database. origin — the origin of the database. version — the database version. object stores — the number of object stores in the database. when an indexeddb database is selected in the storage tree, details about all the object stores are listed in the table. any object store has the following details: object store name — the name of the object store. key — the keypath...
View Source - Firefox Developer Tools
the page you're viewing. to activate view source: context-click in the page and select view page source press ctrl + u on windows and linux, or cmd + u on macos the command opens a new tab with the source for the current page. view source features view source has three additional features, which can be accessed from the context menu in the view source tab: go to line scrolls to the
specified line. if the number is higher than the lines in a file, you receive an error message. wrap long lines (toggle) wraps long lines to the width of the page. syntax highlighting (toggle) applies syntax highlighting to the code.when syntax highlighting is on, view source also highlights parsing errors in red. hovering your mouse over errors displays a tooltip explaining the error. this feature...
AddressErrors.city - Web APIs
an object based on addresserrors includes a city property when validation of the address fails for the value given for the address's city property. the returned string explains the error and should offer suggestions for how to correct it. syntax var cityerror = addresserrors.city; value if the value
specified in the paymentaddress object's city property could not be validated, this property contains a domstring 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 definition of 'addresserrors.city' in that specification. candidate recommendation ...
AddressErrors.country - Web APIs
the value is a string describing the error and should offer suggestions for how to correct it. syntax var countryerror = addresserrors.country; value if an error occurred during validation of the address due to the country property having an invalid value, this property is set to a domstring providing a human-readable error message explaining the validation error. the text should also include, when possible, advice about how to go about correcting the error. ...
AddressErrors.dependentLocality - Web APIs
an object based on addresserrors includes a dependentlocality property when the address's dependentlocality property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var localityerror = addresserrors.dependentlocality; value if the value
specified in the paymentaddress object's dependentlocality property could not be validated, this property contains a domstring offering a human-readable 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 definition of 'addresserrors.dependentlocality' in ...
AddressErrors.languageCode - Web APIs
an object based on addresserrors includes a languagecode property when the address's languagecode property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var languageerror = addresserrors.languagecode; value if the value
specified in the paymentaddress object's languagecode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. this validation might be as simple as ensuring the text of the string is compliant with the syntax defined in bcp-47, or as detailed as actually verifying that the
specified string matches a value from a database. if the languagecode value was validated successfully, this proper...
AddressErrors.organization - Web APIs
an object based on addresserrors includes an organization property when the address's organization property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var organizationerror = addresserrors.organization; value if the value
specified in the paymentaddress object's organization property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. for example, if validation simply ensures that only permitted characters are included in the organization's name, this might return a string such as "the organization name may only contain the letters a-z, digits, spaces, and commas." if the organization value was validated s...
AddressErrors.phone - Web APIs
an object based on addresserrors includes a phone property when the address's phone property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var phoneerror = addresserrors.phone; value if the value
specified in the paymentaddress object's phone property could not be validated, this property contains a domstring 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 definition of 'addresserrors.phone' in that specification. candidate recommendation initial definition. ...
AddressErrors.postalCode - Web APIs
an object based on addresserrors includes a postalcode property when the address's postalcode property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var postcodeerror = addresserrors.postcode; value if the value
specified in the paymentaddress object's postalcode property could not be validated, this property contains a domstring offering 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 definition of 'addresserrors.postalcode' in that specification. candidate recommendat...
AddressErrors.recipient - Web APIs
an object based on addresserrors includes a recipient property when the address's recipient property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var recipienterror = addresserrors.recipient; value if the value
specified in the paymentaddress object's recipient property could not be validated, this property contains a domstring offering 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 definition of 'addresserrors.recipient' in that specification. candidate recommendation...
AddressErrors.region - Web APIs
an object based on addresserrors includes a region property when the address's region property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var regionerror = addresserrors.region; value if the value
specified in the paymentaddress object's region property could not be validated, this property contains a domstring 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 definition of 'addresserrors.region' in that specification. candidate recommendation initial definitio...
AddressErrors.regionCode - Web APIs
an object based on addresserrors includes a regioncode property when the address's regioncode property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var regioncodeerror = addresserrors.regioncode; value if the value
specified in the paymentaddress object's regioncode property could not be validated, this property contains a domstring offering a human-readable explanation of the validation error and offers suggestions for correcting it. if the regioncode value was validated successfully, this property is not included in the addresserrors object. usage notes the region code is derived from the iso 3166-2 country subdivision name standard. specifications specification status comment payment req...
AddressErrors.sortingCode - Web APIs
an object based on addresserrors includes a sortingcode property when the address's sortingcode property couldn't be validated. the returned string explains the error and should offer suggestions for how to correct it. syntax var sortingcodeerror = addresserrors.sortingcode; value if the value
specified in the paymentaddress object's sortingcode property could not be validated, this property contains a domstring offering 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 definition of 'addresserrors.sortingcode' in that specification. candidate ...
AddressErrors - Web APIs
out address errors and with the reset of the object's values taken from shippingaddresserrors, and, using "...defaultpaymentdetails" as the final entry in the object, the remeainder of the properties' values are taken from defaultpaymentdetails. the final step is to call the event's updatewith() method, passing along the updatedetails object. this lets the payment request api know to present the
specified error or errors but to allow the user to keep trying to edit the address. setting up the donate now button this code creates a handler for the load event on the window which in turn adds the needed click event handler to the "donate now" button so that clicking it starts the payment process. window.addeventlistener("load", function(ev) { document.getelementbyid("pay").addeventlistener("click...
AesGcmParams - Web APIs
ryption. according to the web crypto specification this must have one of the following values: 32, 64, 96, 104, 112, 120, or 128. the aes-gcm specification recommends that it should be 96, 104, 112, 120 or 128, although 32 or 64 bits may be acceptable in some applications: appendix c of the specification provides additional guidance here. taglength is optional and defaults to 128 if it is not
specified. examples see the examples for subtlecrypto.encrypt() and subtlecrypto.decrypt(). specifications specification status comment web cryptography apithe definition of 'subtlecrypto.aesgcmparams' in that specification. recommendation ...
AnalyserNode.fftSize - Web APIs
an unsigned integer, representing the window size of the fft, given in number of samples. a higher value will result in more details in the frequency domain but fewer details in the time domain. must be a power of 2 between 252^5 and 2152^15, so one of: 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, and 32768. defaults to 2048. note: if its value is not a power of 2, or it is outside the
specified range, a domexception with the name indexsizeerror is thrown. example the following example shows basic usage of an audiocontext to create an analysernode, then requestanimationframe and <canvas> to collect time domain data repeatedly and draw an "oscilloscope style" output of the current audio input. for more complete applied examples/information, check out our voice-change-o-matic demo (see a...
AnimationEffect - Web APIs
ts for playing, and keyframeeffectreadonly (which is used by css animations and transitions). methods animationeffect.gettiming() returns the effecttiming object associated with the animation containing all the animation's timing values. animationeffect.getcomputedtiming() returns the calculated timing properties for this animationeffect. animationeffect.updatetiming() updates the
specified timing properties of this animationeffect. specifications specification status comment web animationsthe definition of 'animationeffect' in that specification. working draft editor's draft. ...
Attr.namespaceURI - Web APIs
the result of a namespace lookup based on an examination of the namespace declarations in scope. the namespace uri of an attribute is frozen at the attribute creation time. in firefox 3.5 and earlier, the namespace uri for html attributes in html documents is null. in later versions, in compliance with html5, it is https://www.w3.org/1999/xhtml as in xhtml. you can create an attribute with the
specified namespaceuri using the dom level 2 method element.setattributens. per the namespaces in xml specification, an attribute does not inherit its namespace from the element it is attached to. if an attribute is not explicitly given a namespace, it has no namespace. the dom does not handle or enforce namespace validation per se. it is up to the dom application to do any validation necessary. note too...
Attr.prefix - Web APIs
before dom4 this api was defined within the node interface. syntax string = attribute.prefix examples the following logs "x" to the console. <div x:id="example" onclick="console.log(this.attributes[0].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. specifications specification status comment domthe definition of 'attr: prefix' in that specification. ...
AudioBuffer.copyToChannel() - Web APIs
syntax myarraybuffer.copytochannel(source, channelnumber, startinchannel); parameters source a float32array that the channel data will be copied from. channelnumber the channel number of the current audiobuffer to copy the channel data to. if channelnumber is greater than or equal to audiobuffer.numberofchannels, an index_size_err will be thrown. startinchannel optional an optional offset to copy the data to. if startinchannel is greater than audiobuffer.length, an index_size_err will be thrown. ...
AudioBuffer - Web APIs
numberofchannels read only returns an integer representing the number of discrete audio channels described by the pcm data stored in the buffer. methods audiobuffer.getchanneldata() returns a float32array containing the pcm data associated with the channel, defined by the channel parameter (with 0 representing the first channel). audiobuffer.copyfromchannel() copies the samples from the
specified channel of the audiobuffer to the destination array. audiobuffer.copytochannel() copies the samples to the
specified channel of the audiobuffer, from the source array. example the following simple example shows how to create an audiobuffer and fill it with random white noise. you can find the full source code at our webaudio-examples repository; a running live version is also available. var...
AudioBufferSourceNode.loop - Web APIs
s a boolean indicating if the audio asset must be replayed when the end of the audiobuffer is reached. the loop property's default value is false. syntax var loopingenabled = audiobuffersourcenode.loop; audiobuffersourcenode.loop = true | false; value a boolean which is true if looping is enabled; otherwise, the value is false. when looping is enabled, the sound begins playing at the time
specified as the start point when start() is called. when the time
specified by the loopend property is reached, playback continues at the time
specified by loopstart example in this example, the audiocontext.decodeaudiodata function is used to decode an audio track and put it into an audiobuffersourcenode. buttons are provided to play and stop the audio playback, and a slider control is used to change t...
AudioContext() - Web APIs
for, as a value from the audiocontextlatencycategory enum or a double-precision floating-point value indicating the preferred maximum latency of the context in seconds. the user agent may or may not choose to meet this request; check the value of audiocontext.baselatency to determine the true latency after creating the context. samplerate optional the samplerate to be used by the audiocontext,
specified in samples per second. the value may be any value supported by audiobuffer. if not
specified, the preferred sample rate for the context's output device is used by default. return value the newly constructed audiocontext instance. exceptions notsupportederror the
specified samplerate isn't supported by the context. usage notes the specification doesn't go into a lot of detail about thi...
AudioContext.createMediaStreamSource() - Web APIs
audio source nodes, check out the mediastreamaudiosourcenode reference page. syntax audiosourcenode = audiocontext.createmediastreamsource(stream); parameters stream a mediastream to serve as an audio source to be fed into an audio processing graph for use and manipulation. return value a new mediastreamaudiosourcenode object representing the audio node whose media is obtained from the
specified source stream. example in this example, we grab a media (audio + video) stream from navigator.getusermedia, feed the media into a <video> element to play then mute the audio, but then also feed the audio into a mediastreamaudiosourcenode. next, we feed this source audio into a low pass biquadfilternode (which effectively serves as a bass booster), then a audiodestinationnode. the range slider ...
AudioContext.createMediaStreamTrackSource() - Web APIs
the createmediastreamtracksource() method of the audiocontext interface creates and returns a mediastreamtrackaudiosourcenode which represents an audio source whose data comes from the
specified mediastreamtrack. this differs from createmediastreamsource(), which creates a mediastreamaudiosourcenode whose audio comes from the audio track in a
specified mediastream whose id is first, lexicographically (alphabetically). syntax var audioctx = new audiocontext(); var track = audioctx.createmediastreamtracksource(track); parameters track the mediastreamtrack to use as the source of all audio data for the new node. return value a mediastreamtrackaudiosourcenode object which acts as a source for audio data found in the
specified audio track. example in this example, getusermedia() is use...
AudioContextOptions - Web APIs
for, as a value from the audiocontextlatencycategory enum or a double-precision floating-point value indicating the preferred maximum latency of the context in seconds. the user agent may or may not choose to meet this request; check the value of audiocontext.baselatency to determine the true latency after creating the context. samplerate optional the samplerate to be used by the audiocontext,
specified in samples per second. the value may be any value supported by audiobuffer. if not
specified, the preferred sample rate for the context's output device is used by default. constants standard values for latencyhint the latencyhint property can be number specifying a preferred maximum latency in seconds or a string from the audiocontextlatencycategory enumerated string, which selects a standard...
AudioParam.linearRampToValueAtTime() - Web APIs
syntax var audioparam = audioparam.linearramptovalueattime(value, endtime) parameters value a floating point number representing the value the audioparam will ramp to by the given time. ...
AudioParam.setTargetAtTime() - Web APIs
audiocontext.currenttime, the parameter will start changing immediately. timeconstant the time-constant value, given in seconds, of an exponential approach to the target value. the larger this value is, the slower the transition will be. returns a reference to this audioparam object. some older browser implementations of this interface return void. description the change starts at the time
specified in starttime and exponentially moves towards the value given by the target parameter. the decay rate as defined by the timeconstant parameter is exponential; therefore the value will never reach target completely, but after each timestep of length timeconstant, the value will have approached target by another 1-e-1≈63.2%1 - e^{-1} \approx 63.2%. for the complete formula (which uses a first-orde...
AudioTrack.id - Web APIs
klist.gettrackbyid() method to locate a specific track within the media associated with a media element. the track id can also be used as the fragment of a url that loads the specific track (if the media supports media fragments). syntax var trackid = audiotrack.id; value a domstring which identifies the track, suitable for use when calling gettrackbyid() on an audiotracklist such as the one
specified by a media element's audiotracks property. specifications specification status comment html living standardthe definition of 'audiotrack.id' in that specification. living standard html5the definition of 'audiotrack.id' in that specification. recommendation ...
AudioTrack.label - Web APIs
track's human-readable label, if one is available in the track metadata. otherwise, an empty string ("") is returned. for example, a track whose kind is "commentary" might have a label such as "commentary with director mark markmarkimark and star donna donnalidon". example this example returns an array of track kinds and labels for potential use in a user interface to select audio tracks for a
specified media element. the list is filtered to only allow certain track kinds through. function gettracklist(el) { var tracklist = []; const wantedkinds = [ "main", "alternative", "main-desc", "translation", "commentary" ]; el.audiotracks.foreach(function(track) { if (wantedkinds.includes(track.kind)) { tracklist.push({ id: track.id, kind: track.kind, label...
AudioTrack.language - Web APIs
track. for tracks that include multiple languages (such as a movie in english in which a few lines are spoken in other languages), this should be the video's primary language. syntax var audiotracklanguage = audiotrack.language; value a domstring specifying the bcp 47 (rfc 5646) format language tag of the primary language used in the audio track, or an empty string ("") if the language is not
specified or known, or if the track doesn't contain speech. for example, if the primary language used in the track is united states english, this value would be "en-us". for brazilian portuguese, the value would be "pt-br". example this example locates all of a media element's primary language and translated audio tracks and returns a list of objects containing each of those tracks' id, kind, and langua...
AudioTrackList - Web APIs
have been enabled or disabled by their enabled flag being changed. onremovetrack an event handler to call when the removetrack event is sent, indicating that an audio track has been removed from the media element. methods this interface also inherits methods from its parent interface, eventtarget. gettrackbyid() returns the audiotrack found within the audiotracklist whose id matches the
specified string. if no match is found, null is returned. events addtrack fired when a new audio track has been added to the media element. also available via the onaddtrack property. change fired when a track has been enabled or disabled. also available via the onchange property. removetrack fired when a new audio track has been removed from the media element. also available via the onremovet...
AudioWorkletGlobalScope.registerProcessor - Web APIs
syntax audioworkletglobalscope.registerprocessor(name, processorctor); parameters name a string representing the name under which the processor will be registered. processorctor the constructor of a class derived from audioworkletprocessor. note: a key-value pair { name: constructor } is saved internally in the audioworkletglobalscope once the processor is registered. the name is to be referred to when creating an audioworkletnode based on the registered processor. ...
AudioWorkletNode() - Web APIs
ial 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 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 definition of ...
AudioWorkletNodeOptions - Web APIs
ing audioworkletprocessor. usage notes when creating an audioworkletnode, these options 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 numb...
BaseAudioContext.createBuffer() - Web APIs
ach sample-frame is the size of a sample in bytes multiplied by numofchannels). to determine the length to use for a specific number of seconds of audio, use numseconds * samplerate. samplerate the sample rate of the linear audio data in sample-frames per second. all browsers must support sample rates in at least the range 8,000 hz to 96,000 hz. returns an audiobuffer configured based on the
specified options. exceptions notsupportederror one or more of the options are negative or otherwise has an invalid value (such as numberofchannels being higher than supported, or a samplerate outside the nominal range). rangeerror there isn't enough memory available to allocate the buffer. examples first, a couple of simple trivial examples, to help explain how the parameters are used: var audi...
BaseAudioContext.createChannelMerger() - Web APIs
e createchannelmerger() method of the baseaudiocontext interface creates a channelmergernode, which combines channels from multiple audio streams into a single audio stream. syntax baseaudiocontext.createchannelmerger(numberofinputs); parameters numberofinputs the number of channels in the input audio streams, which the output stream will contain; the default is 6 if this parameter is not
specified. returns a channelmergernode. example the following example shows how you could separate a stereo track (say, a piece of music), and process the left and right channel differently. to use them, you need to use the second and third parameters of the audionode.connect(audionode) method, which allow you to specify both the index of the channel to connect from and the index of the channel to con...
BaseAudioContext.createChannelSplitter() - Web APIs
od of the baseaudiocontext interface is used to create a channelsplitternode, which is used to access the individual channels of an audio stream and process them separately. syntax baseaudiocontext.createchannelsplitter(numberofoutputs); parameters numberofoutputs the number of channels in the input audio stream that you want to output separately; the default is 6 if this parameter is not
specified. returns a channelsplitternode. example the following simple example shows how you could separate a stereo track (say, a piece of music), and process the left and right channel differently. to use them, you need to use the second and third parameters of the audionode.connect(audionode) method, which allow you to specify the index of the channel to connect from and the index of the channel to...
BaseAudioContext.createDelay() - Web APIs
elay() method of the baseaudiocontext interface is used to create a delaynode, which is used to delay the incoming audio signal by a certain amount of time. syntax var delaynode = audioctx.createdelay(maxdelaytime); parameters maxdelaytime optional the maximum amount of time, in seconds, that the audio signal can be delayed by. must be less than 180 seconds, and defaults to 1 second if not
specified. returns a delaynode. the default delaynode.delaytime is 0 seconds. example we have created a simple example that allows you to play three different samples on a constant loop — see create-delay (you can also view the source code). if you just press the play buttons, the loops will start immediately; if you slide the sliders up to the right, then press the play buttons, a delay will be int...
BaseAudioContext.createGain() - Web APIs
the creategain() method of the baseaudiocontext interface creates a gainnode, which can be used to control the overall gain (or volume) of the audio graph. syntax var gainnode = audiocontext.creategain(); return value a gainnode which takes as input one or more audio sources and outputs audio whose volume has been adjusted in gain (volume) to a level
specified by the node's gainnode.gain a-rate parameter. example the following example shows basic usage of an audiocontext to create a gainnode, which is then used to mute and unmute the audio when a mute button is clicked by changing the gain property value. the below snippet wouldn't work as is — for a complete working example, check out our voice-change-o-matic demo (view source.) <div> <button class="mute">mute button</button> </div>...
BaseAudioContext.createIIRFilter() - Web APIs
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. this array may have up to 20 members, the first of which must not be zero. return value an iirfilternode implementing the filter with the
specified feedback and feedforward coefficient arrays. exceptions invalidstateerror all of the feedforward coefficients are 0, and/or the first feedback coefficient is 0. notsupportederror one or both of the input arrays exceeds 20 members. specifications specification status comment web audio apithe definition of 'createiirfilter()' in that specification. working draft...
BaseAudioContext.createPeriodicWave() - Web APIs
teperiodicwave(real, imag[, constraints]); returns a periodicwave. parameters real an array of cosine terms (traditionally the a terms). imag an array of sine terms (traditionally the b terms). the real and imag arrays have to have the same length, otherwise an error is thrown. constraints optional an dictionary object that specifies whether normalization should be disabled (if not
specified, normalization is enabled by default.) it takes one property: disablenormalization: if set to true, normalization is disabled for the periodic wave. the default is false. if normalized, the resulting wave will have a maximum absolute peak value of 1. example the following example illustrates simple usage of createperiodicwave(), to create a periodicwave object containing a simple si...
BaseAudioContext.createScriptProcessor() - Web APIs
de used for direct audio processing. note: as of the august 29 2014 web audio api spec publication, this feature has been marked as deprecated, and was replaced by audioworklet (see audioworkletnode). syntax var scriptprocessor = audioctx.createscriptprocessor(buffersize, numberofinputchannels, numberofoutputchannels); parameters buffersize the buffer size in units of sample-frames. if
specified, the buffersize must be one of the following values: 256, 512, 1024, 2048, 4096, 8192, 16384. if it's not passed in, or if the value is 0, then the implementation will choose the best buffer size for the given environment, which will be a constant power of 2 throughout the lifetime of the node. this value controls how frequently the audioprocess event is dispatched and how many sample-frames nee...
BiquadFilterNode.getFrequencyResponse() - Web APIs
the getfrequencyresponse() method of the biquadfilternode interface takes the current filtering algorithm's settings and calculates the frequency response for frequencies
specified in a
specified array of frequencies. the two output arrays, magresponseoutput and phaseresponseoutput, must be created before calling this method; they must be the same size as the array of input frequency values (frequencyarray). syntax biquadfilternode.getfrequencyresponse(frequencyarray, magresponseoutput, phaseresponseoutput); parameters frequencyarray a float32array containing an array of frequencies,
specified in hertz, which you want to filter. magresponseoutput a float32array to receive the computed magnitudes of the freqency response for each frequency value in the frequencyarray. for any frequency...
BiquadFilterNode - Web APIs
he phase transition occurs. controls how sharp the transition is at the medium frequency. the larger this parameter is, the sharper and larger the transition will be. not used methods inherits methods from its parent, audionode. biquadfilternode.getfrequencyresponse() from the current filter parameter settings this method calculates the frequency response for frequencies
specified in the provided array of frequencies. example the following example shows basic usage of an audiocontext to create a biquad filter node. for a complete working example, check out our voice-change-o-matic demo (look at the source code too). var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); //set up the different audio nodes we will use for the app var analyser = audioct...
Blob() - Web APIs
into the blob. the default value is the empty string, (""). endings optional how to interpret newline characters (\n) within the contents, if the data is text. the default value, transparent, copies newline characters into the blob without changing them. to convert newlines to the host system's native convention, specify the value native. return value a new blob object containing the
specified data. example var afileparts = ['<a id="a"><b id="b">hey!</b></a>']; // an array consisting of a single domstring var omyblob = new blob(afileparts, {type : 'text/html'}); // the blob specification specification status comment file apithe definition of 'blob()' in that specification. working draft initial definition. ...
Blob.slice() - Web APIs
ed). if you specify a negative value, it's treated as an offset from the end of the blob toward the beginning. for example, -10 would be the 10th from last byte in the blob. the default value is size. contenttype optional the content type to assign to the new blob; this will be the value of its type property. the default value is an empty string. return value a new blob object containing the
specified subset of the data contained within the blob on which this method was called. the original blob is not altered. specifications specification status comment file apithe definition of 'blob.slice()' in that specification. working draft initial definition ...
Blob.text() - Web APIs
usage notes the filereader method readastext() is an older method that performs a similar function. it works on both blob and file objects. there are two key differences: blob.text() returns a promise, whereas filereader.readastext() is an event based api. blob.text() always uses utf-8 as encoding, while filereader.readastext() can use a different encoding depending on the blob's type and a
specified encoding name. specifications specification status comment file apithe definition of 'blob.text()' in that specification. working draft ...
Blob - Web APIs
ob object. blob.prototype.type read only a string indicating the mime type of the data contained in the blob. if the type is unknown, this string is empty. instance methods blob.prototype.arraybuffer() returns a promise that resolves with an arraybuffer containing the entire contents of the blob as binary data. blob.prototype.slice() returns a new blob object containing the data in the
specified range of bytes of the blob on which it's called. blob.prototype.stream() returns a readablestream that can be used to read the contents of the blob. blob.prototype.text() returns a promise that resolves with a usvstring containing the entire contents of the blob interpreted as utf-8 text. examples creating a blob the blob() constructor can create blobs from other objects. for example, to ...
BlobBuilder - Web APIs
of the newly introduced blob constructor. method overview void append(in arraybuffer data); void append(in blob data); void append(in string data, [optional] in string endings); blob getblob([optional] in domstring contenttype); file getfile(in domstring name, [optional] in domstring contenttype); methods append() appends the contents of the
specified javascript object to the blob being built. if the value you specify isn't a blob, arraybuffer, or string, the value is coerced to a string before being appended to the blob. void append( in arraybuffer data ); void append( in blob data ); void append( in string data, [optional] in string endings ); parameters data the data to append to the blob being constructed. endings speci...
BluetoothRemoteGATTServer.getPrimaryService() - Web APIs
the bluetoothremotegattserver.getprimaryservice() method returns a promise to the primary bluetoothgattservice offered by the bluetooth device for a
specified bluetoothserviceuuid. 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 definition of 'getprimaryservice()' in that specification. draft initial definition. ...
BluetoothRemoteGATTServer.getPrimaryServices() - Web APIs
the bluetoothremotegattserver.getprimaryservices() method returns a promise to a list of primary bluetoothgattservice objects offered by the bluetooth device for a
specified bluetoothserviceuuid. syntax bluetoothremotegattserver.getprimaryservices(bluetoothserviceuuid).then(function(bluetoothgattservices) { ... }) returns a promise that resolves to a list of bluetoothgattservice objects. parameters bluetoothserviceuuid a bluetooth service universally unique identifier for a
specified device. specifications specification status comment web bluetooththe definition of 'getprimaryservices()' in that specification. draft initial definition. ...
BluetoothRemoteGATTServer - Web APIs
othdevice running the server. methods bluetoothremotegattserver.connect() causes the script execution environment to connect to this.device. bluetoothremotegattserver.disconnect() causes the script execution environment to disconnect from this.device. bluetoothremotegattserver.getprimaryservice() returns a promise to the primary bluetoothgattservice offered by the bluetooth device for a
specified bluetoothserviceuuid. bluetoothremotegattserver.getprimaryservices() returns a promise to a list of primary bluetoothgattservice objects offered by the bluetooth device for a
specified bluetoothserviceuuid. specifications specification status comment web bluetooththe definition of 'bluetoothremotegattserver' in that specification. draft initial definition. ...
BudgetState.budgetAt - Web APIs
syntax var budget = budgetstate.budgetat value a double. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. ...
CSSNumericValue.toSum() - Web APIs
syntax var cssmathsum = cssnumericvalue.tosum(units); parameters units the units to convert to. return value a cssnumericvalue. exceptions syntaxerror undefined typeerror indicates that an invalid type was passed to the method. ...
CSSNumericValue - Web APIs
umericvalue by the supplied value. cssnumericvalue.div divides the cssnumericvalue by the supplied value. cssnumericvalue.min returns the minimum value passed cssnumericvalue.max returns the maximum value passed cssnumericvalue.equals true if all the values are the exact same type and value, in the same order. otherwise, false. cssnumericvalue.to converts value into another one with the
specified unit. cssnumericvalue.tosum tbd cssnumericvalue.type tbd cssnumericvalue.parse allows a cssnumericvalue to be constructed directly from a string containing css. specifications specification status comment css typed om level 1the definition of 'cssnumericvalue' in that specification. working draft initial definition. ...
CSSRule.cssText - Web APIs
in other words, attempting to set it does absolutely nothing, and doesn't even omit a warning or error. furthermore, it has no settable sub-properties. ...
CSSRule - Web APIs
references to a cssrule may be obtained by looking at a cssstylesheet's cssrules list. properties common to all cssrule instances cssrule.csstext represents the textual representation of the rule, e.g. ...
CSSStyleDeclaration.getPropertyValue() - Web APIs
syntax var value = style.getpropertyvalue(property); parameters property is a domstring representing the property name to be checked. return value value is a domstring containing the value of the property. if not set, returns the empty string. ...
CSSStyleDeclaration.item() - Web APIs
thod doesn't throw exceptions as long as you provide arguments; the empty string is returned if the index is out of range and a typeerror is thrown if no argument is provided. syntax var propertyname = style.item(index); parameters index is the index of the node to be fetched. the index is zero-based. return value propertyname is a domstring that is the name of the css property at the
specified index. javascript has a special simpler syntax for obtaining an item from a nodelist by index: var propertyname = style[index]; example var style = document.getelementbyid('div1').style; var propertyname = style.item(1); // or simply style[1] - returns the second style listed specifications specification status comment css object model (cssom)the definition of ...
CSSStyleDeclaration.setProperty() - Web APIs
the cssstyledeclaration.setproperty() method interface sets a new value for a property on a css style declaration object. syntax style.setproperty(propertyname, value, priority); parameters propertyname is a domstring representing the css property name (hyphen case) to be modified. value optional is a domstring containing the new property value. if not
specified, treated as the empty string. note: value must not contain "!important" -- that should be set using the priority parameter. priority optional is a domstring allowing the "important" css priority to be set. if not
specified, treated as the empty string. the following values are accepted: string value "important" keyword undefined string empty value "" return value undefined exceptions domexcepti...
CSSStyleSheet.addRule() - Web APIs
ctor, styleblock, index); parameters selector a domstring specifying the selector portion of the css rule. the default is the string undefined. styleblock a domstring indicating the style block to apply to elements matching the selector. the default is the string undefined. index optional an optional index into the stylesheet's cssrulelist at which to insert the new rule. if index is not
specified, the next index after the last item currently in the list is used (that is, the value of cssstylesheet.cssrules.length). return value always returns -1. note that due to somewhat estoteric rules about where you can legally insert rules, it's possible that an exception may be thrown. see insertrule() for more information. usage notes this method is implemented by browsers by constructing a s...
CSSStyleValue.parse() - Web APIs
syntax cssstylevalue.parse(property, csstext) parameters property a css property to set. csstext a comma-separated string containing one or more values to apply to the provided property. return value a cssstylevalue object containing the first supplied value. example the code below parses a set of declarations for the transform property. the second code block shows the structure of the returned object as it would be rendered in a developer tools console. ...
CSSStyleValue.parseAll() - Web APIs
syntax cssstylevalue.parseall(property, value) parameters property a css property to set. csstext a comma-separated string containing one or more values that apply to the provided property. return value an array of cssstylevalue objects, each containing one of the supplied values. ...
CSSStyleValue - Web APIs
ss values accessible through the typed om api. an instance of this class may be used anywhere a string is expected. interfaces based on cssstylevalue below is a list of interfaces based on the cssstylevalue interface. cssimagevalue csskeywordvalue cssnumericvalue csspositionvalue csstransformvalue cssunparsedvalue methods cssstylevalue.parse() sets a specific css property to the
specified values and returns 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 definition of 'cssstylevalue' in that specification. ...
Using the CSS Painting API - Web APIs
; } li:nth-of-type(3n+1) { --boxcolor: hsla(255, 90%, 60%, 1.0); --widthsubtractor: 40; } in our worklet, we can reference those custom properties. ...
CacheStorage.match() - Web APIs
t to true, tells the matching operation not to perform vary header matching. in other words, if the url matches you will get a match regardless of whether the response object has a vary header or not. it defaults to false. cachename: a domstring that represents a specific cache to search within. return value a promise that resolves to the matching response. if no matching response to the
specified request is found, the promise resolves with undefined. examples this example is from the mdn sw-test example (see sw-test running live). here we wait for a fetchevent to fire. we construct a custom response like so: check whether a match for the request is found in the cachestorage using cachestorage.match(). if so, serve that. if not, open the v1 cache using open(), put the default network...
CacheStorage.open() - Web APIs
syntax caches.open(cachename).then(function(cache) { // do something with your cache }); parameters cachename the name of the cache you want to open. return value a promise that resolves to the requested cache object. ...
CanvasCaptureMediaStreamTrack - Web APIs
uremediastreamtrack.canvas read only returns the htmlcanvaselement object whose surface is captured in real-time. methods this interface inherits the methods of its parent, mediastreamtrack. canvascapturemediastreamtrack.requestframe() manually forces a frame to be captured and sent to the stream. this lets applications that wish to specify the frame capture times directly do so, if they
specified a framerate of 0 when calling capturestream(). specifications specification status comment media capture from dom elementsthe definition of 'canvascapturemediastreamtrack' in that specification. working draft initial definition ...
CanvasPattern.setTransform() - Web APIs
od uses an svgmatrix or dommatrix object as the pattern's transformation matrix and invokes it on the pattern. syntax void pattern.settransform(matrix); parameters matrix an svgmatrix or dommatrix to use as the pattern's transformation matrix. examples using the settransform method this is just a simple code snippet which uses the settransform method to create a canvaspattern with the
specified pattern transformation from an svgmatrix. the pattern gets applied if you set it as the current fillstyle and gets drawn onto the canvas when using the fillrect() method, for example. html <canvas id="canvas"></canvas> <svg id="svg1"></svg> javascript var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); var svg1 = document.getelementbyid('svg1'); var matrix = s...
CanvasRenderingContext2D.bezierCurveTo() - Web APIs
rc(cp1.x, cp1.y, 5, 0, 2 * math.pi); // control point one ctx.arc(cp2.x, cp2.y, 5, 0, 2 * math.pi); // control point two ctx.fill(); result in this example, the control points are red and the start and end points are blue. a simple bézier curve this example draws a simple bézier curve using beziercurveto(). html <canvas id="canvas"></canvas> javascript the curve begins at the point
specified by moveto(): (30, 30). the first control point is placed at (120, 160), and the second at (180, 10). the curve ends at (220, 140). const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.moveto(30, 30); ctx.beziercurveto(120,160, 180,10, 220,140); ctx.stroke(); result specifications specification status comment htm...
CanvasRenderingContext2D.clearRect() - Web APIs
note: be aware that clearrect() may cause unintended side effects if you're not using paths properly. make sure to call beginpath() before starting to draw new items after calling clearrect(). syntax void ctx.clearrect(x, y, width, height); the clearrect() method sets the pixels in a rectangular area to transparent black (rgba(0,0,0,0)). the rectangle's corner is at (x, y), and its size is
specified by width and height. parameters x the x-axis coordinate of the rectangle's starting point. y the y-axis coordinate of the rectangle's starting point. width the rectangle's width. positive values are to the right, and negative to the left. height the rectangle's height. positive values are down, and negative are up. examples erasing the whole canvas this code snippet erases the enti...
CanvasRenderingContext2D.createImageData() - Web APIs
the canvasrenderingcontext2d.createimagedata() method of the canvas 2d api creates a new, blank imagedata object with the
specified dimensions. all of the pixels in the new object are transparent black. syntax imagedata ctx.createimagedata(width, height); imagedata ctx.createimagedata(imagedata); parameters width the width to give the new imagedata object. a negative value flips the rectangle around the vertical axis. height the height to give the new imagedata object. a negative value flips the rectangle around the horizontal axis. imagedata an existing imagedata object from which to copy the width and height. the image itself is not copied. return value a new imagedata object with the
specified width and height. the new object is filled with transparent black pixels. errors throw...
CanvasRenderingContext2D.createLinearGradient() - Web APIs
vasgradient. to be applied to a shape, the gradient must first be assigned to the fillstyle or strokestyle properties. note: gradient coordinates are global, i.e., relative to the current coordinate space. when applied to a shape, the coordinates are not relative to the shape's coordinates. syntax canvasgradient ctx.createlineargradient(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...
CanvasRenderingContext2D.drawFocusIfNeeded() - Web APIs
syntax void ctx.drawfocusifneeded(element); void ctx.drawfocusifneeded(path, element); parameters element the element to check whether it is focused or not. path a path2d path to use. examples managing button focus this example draws two buttons on a canvas. the drawfocusifneeded() method is used to draw a focus ring when appropriate. ...
CanvasRenderingContext2D.fillRect() - Web APIs
ct() method of the canvas 2d api draws a rectangle that is filled according to the current fillstyle. this method draws directly to the canvas without modifying the current path, so any subsequent fill() or stroke() calls will have no effect on it. syntax void ctx.fillrect(x, y, width, height); the fillrect() method draws a filled rectangle whose starting point is at (x, y) and whose size is
specified by width and height. the fill style is determined by the current fillstyle attribute. parameters x the x-axis coordinate of the rectangle's starting point. y the y-axis coordinate of the rectangle's starting point. width the rectangle's width. positive values are to the right, and negative to the left. height the rectangle's height. positive values are down, and negative are up. exam...
CanvasRenderingContext2D.lineTo() - Web APIs
like other methods that modify the current path, this method does not directly render anything. to draw the path onto a canvas, you can use the fill() or stroke() methods. syntax ctx.lineto(x, y); parameters x the x-axis coordinate of the line's end point. y the y-axis coordinate of the line's end point. return value undefined. examples drawing a straight line this example draws a straight line using the lineto() method. ...
CanvasRenderingContext2D.moveTo() - Web APIs
syntax void ctx.moveto(x, y); parameters x the x-axis (horizontal) coordinate of the point. y the y-axis (vertical) coordinate of the point. examples creating multiple sub-paths this example uses moveto() to create two sub-paths within a single path. both sub-paths are then rendered with a single stroke() call. html <canvas id="canvas"></canvas> javascript the first line begins at (50, 50) and ends at (200, 50). the second line begins at (50, 90) and ends at (280, 120). ...
CanvasRenderingContext2D.quadraticCurveTo() - Web APIs
t ctx.fill(); // control point ctx.fillstyle = 'red'; ctx.beginpath(); ctx.arc(230, 30, 5, 0, 2 * math.pi); ctx.fill(); result in this example, the control point is red and the start and end points are blue. a simple quadratic curve this example draws a simple quadratic bézier curve using quadraticcurveto(). html <canvas id="canvas"></canvas> javascript the curve begins at the point
specified by moveto(): (20, 110). the control point is placed at (230, 150). the curve ends at (250, 20). const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.moveto(20, 110); ctx.quadraticcurveto(230, 150, 250, 20); ctx.stroke(); result specifications specification status comment html living standardthe definition of 'c...
CanvasRenderingContext2D.rect() - Web APIs
dify the current path, this method does not directly render anything. to draw the rectangle onto a canvas, you can use the fill() or stroke() methods. note: to both create and render a rectangle in one step, use the fillrect() or strokerect() methods. syntax void ctx.rect(x, y, width, height); the rect() method creates a rectangular path whose starting point is at (x, y) and whose size is
specified by width and height. parameters x the x-axis coordinate of the rectangle's starting point. y the y-axis coordinate of the rectangle's starting point. width the rectangle's width. positive values are to the right, and negative to the left. height the rectangle's height. positive values are down, and negative are up. examples drawing a rectangle this example creates a rectangular pat...
CanvasRenderingContext2D.scale() - Web APIs
tical axis. a value of 1 results in no horizontal scaling. y scaling factor in the vertical direction. a negative value flips pixels across the horizontal axis. a value of 1 results in no vertical scaling. examples scaling a shape this example draws a scaled rectangle. a non-scaled rectangle is then drawn for comparison. html <canvas id="canvas"></canvas> javascript the rectangle has a
specified width of 8 and a height of 20. the transformation matrix scales it by 9x horizontally and by 3x vertically. thus, its final size is a width of 72 and a height of 60. notice that its position on the canvas also changes. since its
specified corner is (10, 10), its rendered corner becomes (90, 30). const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // scaled re...
CanvasRenderingContext2D.strokeRect() - Web APIs
ngle that is stroked (outlined) according to the current strokestyle and other context settings. this method draws directly to the canvas without modifying the current path, so any subsequent fill() or stroke() calls will have no effect on it. syntax void ctx.strokerect(x, y, width, height); the strokerect() method draws a stroked rectangle whose starting point is at (x, y) and whose size is
specified by width and height. parameters x the x-axis coordinate of the rectangle's starting point. y the y-axis coordinate of the rectangle's starting point. width the rectangle's width. positive values are to the right, and negative to the left. height the rectangle's height. positive values are down, and negative are up. examples a simple stroked rectangle this example draws a rectangle ...
CanvasRenderingContext2D.textAlign - Web APIs
erif'; ctx.textalign = 'left'; ctx.filltext('left-aligned', x, 40); ctx.textalign = 'center'; ctx.filltext('center-aligned', x, 85); ctx.textalign = 'right'; ctx.filltext('right-aligned', x, 130); result direction-dependent text alignment this example demonstrates the two direction-dependent values of the textalign property: "start" and "end". note that the direction property is manually
specified as "ltr", although this is also the default for english-language text. html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.font = '30px serif'; ctx.direction = 'ltr'; ctx.textalign = 'start'; ctx.filltext('start-aligned', 0, 50); ctx.textalign = 'end'; ctx.filltext('end-aligned', canvas.width, 120); res...
Basic usage of canvas - Web APIs
he <canvas> element <canvas 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,...
Drawing text - Web APIs
s(); }); edit.addeventlistener('click', function() { textarea.focus(); }) textarea.addeventlistener('input', drawcanvas); window.addeventlistener('load', drawcanvas); advanced text measurements in the case you need to obtain more details about the text, the following method allows you to measure it. measuretext() returns a textmetrics object containing the width, in pixels, that the
specified text will be when drawn in the current text style. the following code snippet shows how you can measure a text and get its width. function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); var text = ctx.measuretext('foo'); // textmetrics object text.width; // 16; } gecko-specific notes in gecko (the rendering engine of firefox, firefox os and other mozilla based ...
Hit regions and accessibility - Web APIs
ccessibility tools. it allows you to make hit detection easier and lets you route events to dom elements. the api has the following three methods (which are still experimental in current web browsers; check the browser compatibility tables). canvasrenderingcontext2d.addhitregion() adds a hit region to the canvas. canvasrenderingcontext2d.removehitregion() removes the hit region with the
specified id from the canvas. canvasrenderingcontext2d.clearhitregions() removes all hit regions from the canvas. you can add a hit region to your path and check for the mouseevent.region property to test if your mouse is hitting your region, for example. <canvas id="canvas"></canvas> <script> var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); ctx.beginpath(); ctx.ar...
Transformations - Web APIs
unction are: a (m11) horizontal scaling. b (m12) horizontal skewing. c (m21) vertical skewing. d (m22) vertical scaling. e (dx) horizontal moving. f (dy) vertical moving. settransform(a, b, c, d, e, f) resets the current transform to the identity matrix, and then invokes the transform() method with the same arguments. this basically undoes the current transformation, then sets the
specified transform, all in one step. resettransform() resets the current transform to the identity matrix. this is the same as calling: ctx.settransform(1, 0, 0, 1, 0, 0); example for transform and settransform function draw() { var ctx = document.getelementbyid('canvas').getcontext('2d'); var sin = math.sin(math.pi / 6); var cos = math.cos(math.pi / 6); ctx.translate(100, 100); var c = 0;...
ChannelMergerNode() - Web APIs
ameters context a baseaudiocontext representing the audio context you want the node to be associated with. options optional a channelmergeroptions dictionary object defining the properties you want the channelmergernode to have (also inherits parameters from the audionodeoptions dictionary): numberofinputs: a number defining the number of inputs the channelmergernode should have. if not
specified, the default value used is 6. 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 comme...
ChannelSplitterNode.ChannelSplitterNode() - Web APIs
t a baseaudiocontext representing the audio context you want the node to be associated with. options optional a channelsplitteroptions dictionary object defining the properties you want the channelsplitternode to have (it also inherits the options defined in the audionodeoptions dictionary): numberofoutputs: a number defining 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 definition of 'channelsplitternode' in that specification. working draft ...
ChildNode.after() - Web APIs
od inserts a set of node or domstring objects in the children list of this childnode's parent, just after this childnode. domstring objects are inserted as equivalent text nodes. syntax [throws, unscopable] void childnode.after((node or domstring)... nodes); parameters nodes a set of node or domstring objects to insert. exceptions hierarchyrequesterror: node cannot be inserted at the
specified point in the hierarchy. examples inserting an element var parent = document.createelement("div"); var child = document.createelement("p"); parent.appendchild(child); var span = document.createelement("span"); child.after(span); console.log(parent.outerhtml); // "<div><p></p><span></span></div>" inserting text var parent = document.createelement("div"); var child = document.createelement(...
ChildNode.before() - Web APIs
inserts a set of node or domstring objects in the children list of this childnode's parent, just before this childnode. domstring objects are inserted as equivalent text nodes. syntax [throws, unscopable] void childnode.before((node or domstring)... nodes); parameters nodes a set of node or domstring objects to insert. exceptions hierarchyrequesterror: node cannot be inserted at the
specified point in the hierarchy. examples inserting an element var parent = document.createelement("div"); var child = document.createelement("p"); parent.appendchild(child); var span = document.createelement("span"); child.before(span); console.log(parent.outerhtml); // "<div><span></span><p></p></div>" inserting text var parent = document.createelement("div"); var child = document.createelement...
ChildNode.replaceWith() - Web APIs
ewith() method 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. syntax [throws, unscopable] void childnode.replacewith((node or domstring)... nodes); parameters nodes a set of node or domstring objects to replace. exceptions hierarchyrequesterror: node cannot be inserted at the
specified point in the hierarchy. examples using replacewith() var parent = document.createelement("div"); var child = document.createelement("p"); parent.appendchild(child); var span = document.createelement("span"); child.replacewith(span); console.log(parent.outerhtml); // "<div><span></span></div>" childnode.replacewith() is unscopable the replacewith() method is not scoped into the with state...
Clipboard.write() - Web APIs
navigator.clipboard.write(data) parameters data an array of clipboarditem objects containing data to be written to the clipboard. return value a promise which is resolved when the data has been written to the clipboard. the promise is rejected if the clipboard is unable to complete the clipboard access. example this example function replaces the current contents of the clipboard with a
specified string. function setclipboard(text) { let data = [new clipboarditem({ "text/plain": text })]; navigator.clipboard.write(data).then(function() { /* success */ }, function() { /* failure */ }); } the code begins by creating a new clipboarditem object into which the text will be placed for sending to the clipboard. the key of the object passed to the clipboarditem constructor ind...
Clipboard.writeText() - Web APIs
text may be read back using either read() or readtext(). the "clipboard-write" permission of the permissions api, is granted automatically to pages when they are in the active tab. note: browser support for the asynchronous clipboard apis is still in the process of being implemented. be sure to check the compatibility table as well as clipboard availability in clipboard for more information. syntax var promise = navigator.clipboard.writetext(newcliptext) parameters newcliptext the domstring to be written to the clipboard. return value a promise which is resolved once the clipboard's contents have been updated. ...
ClipboardItem.getType() - Web APIs
thod of the clipboarditem interface returns a promise that resolves with a blob of the requested mime type or an error if the mime type is not found. syntax var blob = clipboarditem.gettype(type); parameters type a valid mime type. return value a promise that resolves with a blob object. exceptions domexception the type does not match a known mime type. typeerror no parameter is
specified or the type is not that of the clipboarditem. examples in the following example, we're returning all items on the clipboard via the clipboard.read() method. then utilizing the clipboarditem.types property to set the gettype() argument and return the corresponding blob object. async function getclipboardcontents() { try { const clipboarditems = await navigator.clipboard.read(); for ...
ClipboardItem.types - Web APIs
ilable within the clipboarditem syntax var types = clipboarditem.types; value an array of available mime types. examples in the below example, we're returning all items on the clipboard via the clipboard.read() method. then checking the types property for available types before utilizing the clipboarditem.gettype() method to return the blob object. if no clipboards contents is found for the
specified type, an error is returned. async function getclipboardcontents() { try { const clipboarditems = await navigator.clipboard.read(); for (const clipboarditem of clipboarditems) { for (const type of clipboarditem.types) { const blob = await clipboarditem.gettype(type); // we can now use blob here } } } catch (err) { console.error(err.name, err.mes...
CloseEvent - Web APIs
nt.code read only returns an unsigned short containing the close code sent by the server. the following values are permitted status codes. the following definitions 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. 1000 normal closure normal closure; the connection successfully completed whatever purpose for which it was created. 1001 going away the endpoint is going away, either because of a server failure or becaus...
Console.dirxml() - Web APIs
if it is not possible to display as an element the javascript object view is shown instead. the output is presented as a hierarchical listing of expandable nodes that let you see the contents of child nodes. syntax console.dirxml(object); parameters object a javascript object whose properties should be output. ...
ContentIndexEvent() - Web APIs
syntax var contentindexevent = new contentindexevent(type, contentindexeventinit); parameters type a domstring indicating the event which occurred. for contentindexevent, this is always delete. eventinitdict optional an options object containing any initialization data you want to populate the contentindexevent object with. the options are: id: the id of the indexed content you want the contentindexevent to remove. return value a contentindexevent object configured using the given inputs. ...
ContentIndexEvent - Web APIs
serviceworker. it contains the id of the indexed content to be removed. the contentdelete event is only fired when the deletion happens due to interaction with the browser's built-in user interface. it is not fired when the contentindex.delete method is called. constructor contentindexevent() creates and returns a new contentindexevent object whose type and other options are configured as
specified. properties in addition to the properties listed below, this interface inherits the properties of its parent interface, extendableevent. id read only a string which identifies the deleted content index via it's id. methods while contentindexevent offers no methods of its own, it inherits any
specified by its parent interface, extendableevent. examples this example shows the sevic...
Content Index API - Web APIs
page that displays media, and which works offline. interfaces contentindex the contentindex interface provides functionality to register content available offline. contentindexevent the contentindexevent interface of the content index api defines the object used to represent the contentdelete event. service worker additions the following additions to the serviceworker have been
specified in the content index api spec to provide an entry point for using content indexing. serviceworkerregistration.index read only returns a reference to the contentindex interface for indexing cached pages. serviceworkerglobalscope.oncontentdelete an event handler fired whenever a contentdelete event occurs. this happens when content is removed by the user agent. examples all the follo...
CustomElementRegistry.define() - Web APIs
ption is currently supported: extends: string specifying the name of a built-in element to extend. used to create a customized built-in element. return value void. exceptions exception description notsupportederror the customelementregistry already contains an entry with the same name or the same constructor (or is otherwise already defined), or extends is
specified and it is a valid custom element name, or extends is
specified but the element it is trying to extend is an unknown element. syntaxerror the provided name is not a valid custom element name. typeerror the referenced constructor is not a constructor. note: you'll often get notsupportederrors thrown that seem like define() is failing, but instead it is likely a probl...
CustomEvent() - Web APIs
earg a domstring representing the name of the event. customeventinit optional a customeventinit 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 customeventinit dictionary also accepts fields from the eventinit dictionary. return value a new customevent object of the
specified type, with any other properties configured according to the customeventinit dictionary (if one was provided). example // add an appropriate event listener obj.addeventlistener("cat", function(e) { process(e.detail) }); // create and dispatch the event var event = new customevent("cat", { detail: { hazcheeseburger: true } }); obj.dispatchevent(event); additional examples can be found a...
DOMException() - Web APIs
syntax var domexception = new domexception(); var domexception = new domexception(message); var domexception = new domexception(message, 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 definition of 'domexception()' in that specification. ...
DOMException - Web APIs
tion interface represents an abnormal event (called an exception) that occurs as a result of calling a method or accessing a property of a web api. this is basically how error conditions are described in web apis. each exception has a name, which is a short "camelcase" style string identifying the error or abnormal condition. constructor domexception() returns a domexception object with a
specified message and name. properties domexception.code read only 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. domexception.message read only returns a domstring representing a message or description associated with t...
DOMMatrixReadOnly.scale() - Web APIs
dommatrix.scale(scalex[, scaley][, scalez][, originx][, originy][, originz]) parameters scalex a multiplier for the scale value on the x-axis. scaley optional a multiplier for the scale value on the y-axis. if not supplied, this defaults to the value of scalex. scalez optional a multiplier for the scale value on the z-axis. ...
DOMPoint.fromPoint() - Web APIs
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 dompointinit-compliant object, which includes both dompoint and dompointreadonly, from which to take the values of the new point's properties. ...
DOMPointReadOnly() - Web APIs
pth 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 finite floating-point value, you may use special values such as ±infinity 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); specifications specification status comment geometry interfaces module level 1the definition of 'dompointreadonly' in that ...
DOMPointReadOnly.fromPoint() - Web APIs
you can also create a new dompointreadonly object using the new dompointreadonly() constructor. syntax const point = dompointreadonly.frompoint(sourcepoint) properties sourcepoint a dompointinit-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). ...
DOMPointReadOnly - Web APIs
y.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 static method that creates a new dompointreadonly object given the coordinates provided in the
specified dompointinit object. methods matrixtransform() applies a matrix transform
specified as a dommatrixinit object to the dompointreadonly object. tojson() returns a json representation of the dompointreadonly object. specifications specification status comment geometry interfaces module level 1the definition of 'dompoint' in that specification. candidate r...
DOMTokenList.remove() - Web APIs
syntax tokenlist.remove(token1[, token2[, ...tokenn]]); parameters tokenn a domstring representing the token you want to remove from the list. if the string is not in the list, no error is thrown, and nothing happens. return value undefined examples in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist. we then remove a token from the list, and write the list into the <span>'s node.textcontent. ...
DOMTokenList - Web APIs
tokenlist.value a stringifier property that returns the value of the list as a domstring. methods domtokenlist.item(index) returns the item in the list by its index, or undefined if index is greater than or equal to the list's length. domtokenlist.contains(token) returns true if the list contains the given token, otherwise false. domtokenlist.add(token1[, token2[, ...tokenn]]) adds the
specified token(s) to the list. domtokenlist.remove(token1[, token2[, ...tokenn]]) removes the
specified token(s) from the list. domtokenlist.replace(oldtoken, newtoken) replaces token with newtoken. domtokenlist.supports(token) returns true if a given token is in the associated attribute's supported tokens. domtokenlist.toggle(token [, force]) removes token from the list if it exists, or adds toke...
DataTransfer.mozClearDataAt() - Web APIs
the index must be in the range from zero to the number of items minus one. if the format argument is not provided, then the data associated with all formats is removed. if the format is not found, then this method has no effect. if the last format for the item is removed, the entire item is removed, reducing mozitemcount by one. removing the last format for a particular index removes that item entirely, shifting the remaining items down and changing their indices. note: this method is gecko-specific. ...
DataTransfer.mozGetDataAt() - Web APIs
the datatransfer.mozgetdataat() method is used to retrieve an item in the drag event's data transfer object, based on a given format and index. this method returns null if the
specified item does not exist or if the index is not in the range from zero to the number of items minus one. note: this method is gecko-specific. syntax nsivariant datatransfer.mozgetdataat([type], index); arguments type a string representing the type of the drag data to retrieve from the drag data object. index a unsigned long representing the index of the data to retrieve. return value nsivariant the data item requested. if the
specified item does not exist, null is returned. example this example shows the use of the mozgetdataat() method in a drop event handler. function drop_handler(event) { va...
DataTransfer.mozTypesAt() - Web APIs
if the index is not in the range from 0 to the number of items minus one, an empty string list is returned. note: this method is gecko-specific. syntax nsivariant datatransfer.moztypesat(index); arguments index a unsigned long that is the index of the data for which to retrieve the types. return value nsivariant a list of data formats (which are strings). if the index is not in the range from 0 to the number of items minus one, an empty string list is returned. example this example shows the use of the moztypesat() method in a drop event handler. ...
DataTransfer.setData() - Web APIs
if data for the given type does not exist, it is added at the end of the drag data store, such that the last item in the types list will be the new type. if data for the given type already exists, the existing data is replaced in the same position. that is, the order of the types list is not changed when replacing data of the same type. example data types are text/plain and text/uri-list. syntax void datatransfer.setdata(format, data); arguments format a domstring representing the type of the drag data to add to the drag object. data a domstring representing the data to add to the drag object. ...
DataTransfer.setDragImage() - Web APIs
transfer.setdragimage(img | element, xoffset, yoffset); arguments img | element an image element element to use for the drag feedback image. if element is an img element, then set the drag data store bitmap to the element's image (at its intrinsic size); otherwise, set the drag data store bitmap to an image generated from the given element (the exact mechanism for doing so is not currently
specified). xoffset a long indicating the horizontal offset within the image. yoffset a long indicating the vertical offset within the image. return value void example this example shows how to use the setdragimage() method. note the example refers to an image file named example.gif. if that file is present, it will be used as the drag image and if that file is not present, the browser will u...
DataTransferItem - Web APIs
is interface has no constructor. properties datatransferitem.kind read only the kind of drag data item, string or file. datatransferitem.type read only the drag data item's type, typically a mime type. methods datatransferitem.getasfile() returns the file object associated with the drag data item (or null if the drag item is not a file). datatransferitem.getasstring() invokes the
specified callback with the drag data item string as its argument. datatransferitem.webkitgetasentry() returns an object based on filesystementry 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...
DataTransferItemList.DataTransferItem() - Web APIs
the datatransferitem() getter method implements support for accessing items in the datatransferitemlist using array-style syntax (that is datatransferitem[index]). syntax dataitem = datatransferitem[index]; parameters index the zero-based index of the item in the drag data list to return. return value the datatransferitem object at the
specified index in the item list. if the index is less than zero or greater than or equal to the number of items in the list (as indicated by the list's length property, undefined is returned. the returned value is never null. example this example shows how to use drag and drop. javascript function dragstart_handler(ev) { console.log("dragstart"); // add this element's id to the drag payload so the drop handler will // know which element to add ...
DataTransferItemList.remove() - Web APIs
if the index is less than zero or greater than one less than the length of the list, the list will not be changed. syntax datatransferitemlist.remove(index); parameters index the zero-based index number of the item in the drag data list to remove. if the index doesn't correspond to an existing item in the list, the list is left unchanged. return value undefined. exceptions invalidstateerror the drag data store is not in read/write mode, so the item can't be removed. example this example shows the use of the remove() method. ...
DelayNode - Web APIs
default count mode) channel interpretation "speakers" constructor delaynode() creates a new instance of an delaynode object instance. alternatively, you can use the baseaudiocontext.createdelay() factory method. properties inherits properties from its parent, audionode. delaynode.delaytime read only is an a-rate audioparam representing the amount of delay to apply,
specified in seconds. methods no specific methods; inherits methods from its parent, audionode. example we have created a simple example that allows you to play three different samples on a constant loop — see create-delay (you can also view the source code). if you just press the play buttons, the loops will start immediately; if you slide the sliders up to the right, then press the play buttons, a...
DeprecationReportBody - Web APIs
the report details are displayed via the displayreports() fuction, which takes the observer callback's reports parameter as its parameter: function displayreports(reports) { const outputelem = document.que...
DisplayMediaStreamConstraints.audio - Web APIs
tem audio output and the user's microphone, but there is no way to specify which source to use. syntax displaymediastreamconstraints.audio = allowaudioflag; displaymediastreamconstraints.audio = mediatrackconstraints; displaymediastreamconstraints = { audio: allowaudioflag|mediatrackconstraints; } value the value may be either a boolean or a mediatrackconstraints object. if a boolean is
specified, a value of true indicates that an audio track should be included in the stream returned by getdisplaymedia(), if an appropriate audio source exists and the user agent supports audio on display media. a value of false—the default—indicates that no audio track is to be included in the stream. if a mediatrackconstraints object is given, and an audio source is available, an audio track matching...
Document.caretRangeFromPoint() - Web APIs
syntax var range = document.caretrangefrompoint(float x, float y); parameters x a horizontal position within the current viewport. y a vertical position within the current viewport. returns one of the following: a range. null, if x or y are negative, outside viewport, or there is no text entry node. ...
Document.characterSet - Web APIs
he document.characterset read-only property returns the character encoding of the document that it's currently rendered with. (a character encoding is a set of characters and how to interpret bytes into those characters.) a “character set” and a “character encoding” are related, but different. despite the name of this property, it returns the encoding. users can override the developer-
specified encoding inside the content-type header or inline like <meta charset="utf-8">, such as with firefox's view → text encoding menu. this override is provided to fix incorrect developer-
specified encodings that result in garbled text. the properties document.charset and document.inputencoding are legacy aliases for document.characterset. do not use them any more. syntax var string = document.c...
Document.clear() - Web APIs
in recent versions of mozilla-based applications, as well as in internet explorer and netscape 4, this method does nothing. ...
Document.createElement() - Web APIs
syntax let element = document.createelement(tagname[, options]); parameters tagname a string that specifies the type of element to be created. the nodename of the created element is initialized with the value of tagname. don't use qualified names (like "html:a") with this method. when called on an html document, createelement() converts tagname to lower case before creating the element. in firefox, opera, and chrome, createelement(null) works like createelement("null"). ...
Document.createElementNS() - Web APIs
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. ...
Document.createEvent() - Web APIs
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'. ...
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. ...
Document.createProcessingInstruction() - Web APIs
obsolete added more explicit definition of how the data parameter is validated. document object model (dom) level 3 core specificationthe definition 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 definition of 'createprocessinginstruction()' in that specification. obsolete no change document object model (dom) level 1 specificationthe definition of 'createprocessinginstruction()' in that specification. obsolete initial definition ...
Document.createTouchList() - Web APIs
5.0, this method was defined on the documenttouch mixin. the document.createtouchlist() method creates and returns a new touchlist object. syntax var list = documenttouch.createtouchlist([touch1 [, touch2 [, ...]]]); parameters touches zero or more touch objects. note: firefox also accepts an array of touch objects. return value list a touchlist object containing the touch objects
specified by the touches parameter. example this example illustrates using the document.createtouchlist() method to create touchlist objects. in following code snippet, some touch objects are created for the target element and those touch points are then used to create some touchlist objects. var target = document.getelementbyid("target"); // create some touch points var touch1 = document.createtouch...
Document.enableStyleSheetsForSet() - Web APIs
syntax document.enablestylesheetsforset(name); parameters name the name of the style sheets to enable. all style sheets with a title that match this name will be enabled, while all others that have a title will be disabled. specify an empty string for the name parameter to disable all alternate and preferred style sheets (but not the persistent style sheets; that is, those with no title attribute). notes title matches are case-sensitive. ...
Document.getElementById() - Web APIs
the document method getelementbyid() returns an element object representing the element whose id property matches the
specified string. since element ids are required to be unique if
specified, they're a useful way to get access to a specific element quickly. if you need to get access to an element which doesn't have an id, you can use queryselector() to find the element using any selector. syntax var element = document.getelementbyid(id); parameters id the id of the element to locate. the id is case-sensitive string which is unique within the document; only one element may have any given id. return value an element object describing the dom element object matching the
specified id, or null if no matching element was found in the document. example html <html> <head> <title>getelem...
Document.getElementsByName() - Web APIs
</html> notes the name attribute can only be applied in (x)html documents. the returned nodelist collection contains all elements with the given name, such as <meta>, <object>, and even elements which do not support the name attribute at all. the getelementsbyname method works differently in ie10 and below. there, getelementsbyname() also returns elements that have an id attribute with the
specified value. 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>). both ie and edge return an htmlcollection, not a nodelist specifications specification status comment html living standardthe d...
Document.implementation - Web APIs
0"; var conformtest = document.implementation.hasfeature( modname, modver ); alert( "dom " + modname + " " + modver + " supported?: " + conformtest ); // alerts with: "dom html 2.0 supported?: true" if dom level 2 html module is supported. a list of module names (e.g., core, html, xml, etc.) is available in the dom level 2 conformance section. notes the w3c's dom level 1 recommendation only
specified the hasfeature method, which is one way to determine if a dom module is supported by a browser (see example above and what does your user agent claim to support?). if available, other domimplementation methods provide services for controlling things outside of a single document. for example, the domimplementation interface includes a createdocumenttype method with which dtds can be created for on...
Document.onfullscreenchange - Web APIs
ves a fullscreenchange event, indicating that the document is transitioning into or out of full-screen mode. usage notes the fullscreenchange event does not directly specify whether the transition is into or out of full-screen mode, so your event handler should look at the value of document.fullscreenelement. if it's null, the event indicates a transition out of full-screen mode. otherwise, the
specified element is about to take over the screen. example document.onfullscreenchange = function ( event ) { console.log("full screen change") }; document.documentelement.onclick = function () { // requestfullscreen() must be in an event handler or it will fail document.documentelement.requestfullscreen(); } specifications specification status comment fullscreen api...
Document.open() - Web APIs
on of document.open() , which is an alias of window.open() (see its page for full details). this call, for example opens github.com in a new window, with its opener set to null: document.open('https://www.github.com','', 'noopener=true') two-argument document.open() browsers used to support a two-argument document.open(), with the following signature: document.open(type, replace) where type
specified the mime type of the data you are writing (e.g. text/html) and replace if set (i.e. a string of "replace")
specified that the history entry for the new document would replace the current history entry of the document being written to. this form is now obsolete; it won't throw an error, but instead just forwards to document.open() (i.e. is the equivalent of just running it with no arguments). th...
Document.queryCommandEnabled() - Web APIs
syntax isenabled = document.querycommandenabled(command); parameters command the command for which to determine support. return value returns a boolean which is true if the command is enabled and false if the command isn't. notes for 'cut' and 'copy' commands the method only returns true when called from a user-initiated thread. the 'paste' command return false not only if the feature is unavailable, but also if the script calling it has insufficient privileges to perform the action. ...
Document.queryCommandSupported() - Web APIs
syntax issupported = document.querycommandsupported(command); parameters command the command for which to determine support. return value returns a boolean which is true if the command is supported and false if the command isn't. ...
Document.title - Web APIs
document.title = newtitle; newtitle is the new title of the document. the assignment affects the return value of document.title, the title displayed for the document (e.g. ...
Document.xmlEncoding - Web APIs
obsolete since gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7)this feature is obsolete. although it may still work in some browsers, its use is discouraged since it could be removed at any time. try to avoid using it. returns the encoding as determined by the xml declaration. should be null if un
specified or unknown. warning: do not use this attribute; it has been removed from the dom level 4 specification and is no longer supported in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7). if the xml declaration states: <?xml version="1.0" encoding="utf-16"?> ...the result should be "utf-16". however, firefox 3.0 includes information on endianness (e.g., utf-16be for big endian encoding), and while this extra information is removed as of firefox 3.1b3, firefox 3.1...
Document.xmlVersion - Web APIs
this attribute was never really useful, since it always returned 1.0, and has been removed in dom level 4. as such, firefox 10 no longer implements it. ...
DocumentFragment.querySelector() - Web APIs
the documentfragment.queryselector() method returns the first element, or null if no matches are found, within the documentfragment (using depth-first pre-order traversal of the document's nodes) that matches the
specified group of selectors. if the selector matches an id and this id is erroneously used several times in the document, it returns the first matching element. if the selectors
specified in parameter are invalid a domexception with a syntax_err value is raised. syntax element = documentfragment.queryselector(selectors); parameters selectors is a domstring containing one or more css selectors separated by commas. examples basic example in this basic example, the first element in the documentfragment with the class "myclass" is returned: var el = documentfragment.queryselec...
DocumentFragment.querySelectorAll() - Web APIs
note: the definition 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. ...
DocumentFragment - Web APIs
l if there is none. parentnode.childelementcount read only returns an unsigned long giving the amount of children that the documentfragment has. methods this interface inherits the methods of its parent, node, and implements those of the parentnode interface. documentfragment.queryselector() returns the first element node within the documentfragment, in document order, that matches the
specified selectors. documentfragment.queryselectorall() returns a nodelist of all the element nodes within the documentfragment that match the
specified selectors. documentfragment.getelementbyid() returns the first element node within the documentfragment, in document order, that matches the
specified id. functionally equivalent to document.getelementbyid(). usage notes a common use for documentfr...
DocumentOrShadowRoot.elementsFromPoint() - Web APIs
it operates in a similar way to the elementfrompoint() method. syntax const elements = document.elementsfrompoint(x, y); parameters x the horizontal coordinate of a point. y the vertical coordinate of a point. return value an array of element objects. ...
DocumentOrShadowRoot.nodeFromPoint() - Web APIs
currently this method is only implemented in firefox, and only available to chrome code. syntax var node = document.nodefrompoint(x, y); parameters x a double representing the horizontal coordinate of a point. y a double representing the vertical coordinate of a point. returns a node object. ...
DocumentOrShadowRoot.nodesFromPoint() - Web APIs
currently this method is only implemented in firefox, and only available to chrome code. syntax var nodes = document.nodesfrompoint(x, y); parameters x the horizontal coordinate of a point. y the vertical coordinate of a point. returns an array of node objects. ...
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
and css getting a text node from the table this example introduces two new dom attributes. first it uses the childnodes attribute to get the list of child nodes of mycel. the childnodes list includes all child nodes, regardless of what their name or type is. like getelementsbytagname(), it returns a list of nodes. the differences are that (a) getelementsbytagname() only returns elements of the
specified tag name; and (b) getelementsbytagname() returns descendants at any level, not just immediate children. once you have the returned list, use [x] method to retrieve the desired child item. this example stores in myceltext the text node of the second cell in the second row of the table. then, to display the results in this example, it creates a new text node whose content is the data of myceltext...
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
he dom. we'll look at these, and some solutions, later on. how does css process whitespace? most whitespace characters are ignored, not all of them are. in the earlier example one of the spaces between "hello" and "world!" still exists when the page is rendered in a browser. there are rules in the browser engine that decide which whitespace characters are useful and which aren’t — these are
specified at least in part in css text module level 3, and especially the parts about the css white-space property and whitespace processing details, but we also offer an easier explanation below. let’s take another really simple example. to make it easier, we’ve illustrated all spaces with ◦, all tabs with ⇥ , and all line breaks with ⏎: this example: <h1>◦◦◦hello◦⏎ ⇥⇥⇥⇥<spa...
EffectTiming.duration - Web APIs
is "auto". this value must not be negative; otherwise, it can have any value (including positive infinity). currently, a value of "auto" is the same as specifying 0.0. this is a forwards-compatiblity measure since in the future, "auto" will be expanded to take into account the duration of any child effects. consider using "auto" rather than 0 if that makes sense. exceptions typeerror the
specified value is either a string other than "auto", a number less than zero, nan, or some other type of object entirely. examples in the pool of tears example, each tear is passed a random duration via its timing object: // randomizer function var getrandommsrange = function(min, max) { return math.random() * (max - min) + min; } // loop through each tear tears.foreach(function(el) { // animate...
EffectTiming.endDelay - Web APIs
an object of timing properties including enddelay. the value of enddelay corresponds directly to animationeffecttimingreadonly.enddelay in timing objects returned by animationeffectreadonly, keyframeeffectreadonly, and keyframeeffect. syntax var timingproperties = { enddelay: delayinmilliseconds } timingproperties.enddelay = delayinmilliseconds; value a number representing the end delay,
specified in milliseconds. the default value is 0. specifications specification status comment web animationsthe definition of 'enddelay' in that specification. working draft editor's draft. ...
Element.animate() - Web APIs
ations: infinity }); implicit to/from keyframes in newer browser versions, you are able to set a beginning or end state for an animation only (i.e. a single keyframe), and the browser will infer the other end of the animation if it is able to. for example, consider this simple animation — the keyframe object looks like so: let rotate360 = [ { transform: 'rotate(360deg)' } ]; we have only
specified the end state of the animation, and the beginning state is implied. specifications specification status comment web animations level 2the definition of 'keyframeanimationoptions.iterationcomposite' in that specification. draft added the iterationcomposite option. web animationsthe definition of 'animate()' in that specification. working draft initial...
Element.attachShadow() - Web APIs
elements you can attach a shadow to note that you can't attach a shadow root to every type of element. there are some that can't have a shadow dom for security reasons (for example <a>), and more besides. ...
Element.attributes - Web APIs
it is a namednodemap, not an array, so it has no array methods and the attr nodes' indexes may differ among browsers. to be more specific, attributes is a key/value pair of strings that represents any information regarding that attribute. syntax var attr = element.attributes; example basic examples // get the first <p> element in the document var para = document.getelementsbytagname("p")[0]; var atts = para.attributes; enumerating elements attributes numerical indexing is useful for going through all of an element's attributes. ...
Element.classList - Web APIs
replace class "foo" with class "bar" div.classlist.replace("foo", "bar"); versions of firefox before 26 do not implement the use of several arguments in the add/remove/toggle methods. see https://bugzilla.mozilla.org/show_bug.cgi?id=814014 polyfill the legacy onpropertychange event can be used to create a living classlist mockup thanks to a element.prototype.classname property that fires the
specified event once it is changed. the following polyfill for both classlist and domtokenlist ensures full compliance (coverage) for all standard methods and properties of element.prototype.classlist for ie10-ie11 browsers plus nearly compliant behavior for ie 6-9. check it out: // 1. string.prototype.trim polyfill if (!"".trim) string.prototype.trim = function(){ return this.replace(/^[\s]+|[\s]+...
Element.className - Web APIs
syntax var cname = elementnodereference.classname; elementnodereference.classname = cname; cname is a string variable representing the class or space-separated classes of the current element. example let el = document.getelementbyid('item'); if (el.classname === 'active'){ el.classname = 'inactive'; } else { el.classname = 'active'; } notes the name classname is used for this property instead of class because of conflicts with the "class" keyword in many languages which are used to manipulate the dom. ...
Element.getAttributeNode() - Web APIs
syntax var attrnode = element.getattributenode(attrname); attrnode is an attr node for the attribute. attrname is a string containing the name of the attribute. example // html: <div id="top" /> let t = document.getelementbyid("top"); let idattr = t.getattributenode("id"); alert(idattr.value == "top") notes when called on an html element in a dom flagged as an html document, getattributenode lower-cases its argument before proceeding. the attr node inherits from node, but is not considered a part of the document tree. common node attributes like parentnode, previoussibling, and nextsibling are null for an attr node. ...
Element.getElementsByTagNameNS() - Web APIs
syntax elements = element.getelementsbytagnamens(namespaceuri, localname) elements is a live htmlcollection of found elements in the order they appear in the tree. element is the element from where the search should start. ...
Element.hasAttributeNS() - Web APIs
syntax result = element.hasattributens(namespace,localname) result is the boolean value true or false. namespace is a string specifying the namespace of the attribute. localname is the name of the attribute. ...
Element.innerHTML - Web APIs
changed to this new string. as a result, the document contents are replaced with a display of the page's entire source code. document.documentelement.innerhtml = "<pre>" + document.documentelement.innerhtml.replace(/</g,"<") + "</pre>"; operational details what exactly happens when you set value of innerhtml? doing so causes the user agent to follow these steps: the
specified value is parsed as html or xml (based on the document type), resulting in a documentfragment object representing the new set of dom nodes for the new elements. if the element whose contents are being replaced is a <template> element, then the <template> element's content attribute is replaced with the new documentfragment created in step 1. for all other elements, the element's contents are rep...
Element.insertAdjacentElement() - Web APIs
gin': just inside the targetelement, before its first child. 'beforeend': just inside the targetelement, after its last child. 'afterend': after the targetelement itself. element the element to be inserted into the tree. return value the element that was inserted, or null, if the insertion failed. exceptions exception explanation syntaxerror the position
specified is not a recognised value. typeerror the element
specified is not a valid element. visualization of position names <!-- beforebegin --> <p> <!-- afterbegin --> foo <!-- beforeend --> </p> <!-- afterend --> note: the beforebegin and afterend positions work only if the node is in a tree and has an element parent. example beforebtn.addeventlistener('click', function() { ...
Element.insertAdjacentHTML() - Web APIs
it does not reparse the element it is being used on, and thus it does not corrupt the existing elements inside that element. this avoids the extra step of serialization, making it much faster than direct innerhtml manipulation. syntax element.insertadjacenthtml(position, text); parameters position a domstring representing the position relative to the element; must be one of the following strings: 'beforebegin': before the element itself. 'afterbegin': just inside the element, before its first child. ...
Element.insertAdjacentText() - Web APIs
'beforebegin': before the element itself. 'afterbegin': just inside the element, before its first child. 'beforeend': just inside the element, after its last child. 'afterend': after the element itself. element a domstring representing the text to be inserted into the tree. return value void. exceptions exception explanation syntaxerror the position
specified is not a recognised value. visualization of position names <!-- beforebegin --> <p> <!-- afterbegin --> foo <!-- beforeend --> </p> <!-- afterend --> note: the beforebegin and afterend positions work only if the node is in a tree and has an element parent. example beforebtn.addeventlistener('click', function() { para.insertadjacenttext('afterbegin',textinput.value); }); afterb...
Element.matches() - Web APIs
the matches() method checks to see if the element would be selected by the provided selectorstring -- in other words -- checks if the element "is" the selector. syntax var result = element.matches(selectorstring); parameters selectorstring is a string representing the selector to test. return value result is a boolean. exceptions syntax_err the
specified selector string is invalid. example <ul id="birds"> <li>orange-winged parrot</li> <li class="endangered">philippine eagle</li> <li>great white pelican</li> </ul> <script type="text/javascript"> var birds = document.getelementsbytagname('li'); for (var i = 0; i < birds.length; i++) { if (birds[i].matches('.endangered')) { console.log('the ' + birds[i].textcontent + ' is endangered!'); } } </script> this ...
Element.namespaceURI - Web APIs
d value that is the result of a namespace lookup based on an examination of the namespace declarations in scope. the namespace uri of a node is frozen at the node creation time. in firefox 3.5 and earlier, the namespace uri for html elements in html documents is null. in later versions, in compliance with html5, it is http://www.w3.org/1999/xhtml as in xhtml. you can create an element with the
specified namespaceuri using the dom level 2 method document.createelementns. the dom does not handle or enforce namespace validation per se. it is up to the dom application to do any validation necessary. also note that the namespace prefix, once it is associated with a particular element, cannot be changed. specifications specification status comment domthe definition of 'e...
Element.outerHTML - Web APIs
place the contents of an element, use the innerhtml property instead. syntax var content = element.outerhtml; element.outerhtml = htmlstring; value reading the value of outerhtml returns a domstring containing an html serialization of the element and its descendants. setting the value of outerhtml replaces the element and all of its descendants with a new dom tree constructed by parsing the
specified htmlstring. exceptions syntaxerror an attempt was made to set outerhtml using an html string which is not valid. nomodificationallowederror an attempt was made to set outerhtml on an element which is a direct child of a document, such as document.documentelement. examples getting the value of an element's outerhtml property: html <div id="d"> <p>content</p> <p>further elaborated</...
Element.prefix - Web APIs
before dom4 this api was defined within the node interface. syntax string = element.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. ...
Element.removeAttributeNS() - Web APIs
syntax element.removeattributens(namespace, attrname); parameters namespace is a string that contains the namespace of the attribute. attrname is a string that names the attribute to be removed from the current node. ...
Element.removeAttributeNode() - Web APIs
syntax removedattr = element.removeattributenode(attributenode) attributenode is the attr node that needs to be removed. removedattr is the removed attr node. example // given: <div id="top" align="center" /> var d = document.getelementbyid("top"); var d_align = d.getattributenode("align"); d.removeattributenode(d_align); // align is now removed: <div id="top" /> notes if the removed attribute has a default value, it is immediately replaced. the replacing attribute has the same namespace uri and local name, as well as the original prefix, when applicable. ...
Element.scrollLeft - Web APIs
of the content. on systems using display scaling, scrollleft may give you a decimal value. syntax getting the value // get the number of pixels scrolled var sleft = element.scrollleft; sleft is an integer representing the number of pixels that element has been scrolled from the left edge. setting the value // set the number of pixels scrolled element.scrollleft = 10; scrollleft can be
specified as any integer value. however: if the element can't be scrolled (e.g., it has no overflow), scrollleft is set to 0. if
specified as a value less than 0 (greater than 0 for right-to-left elements), scrollleft is set to 0. if
specified as a value greater than the maximum that the content can be scrolled, scrollleft is set to the maximum. example html <div id="container"> <div id="content...
Element.setAttributeNode() - Web APIs
syntax var replacedattr = element.setattributenode(attribute); attribute is the attr node to set on the element. replacedattr is the replaced attribute node, if any, returned by this function. example this example copies the align attribute from one element to another. ...
Element.setAttributeNodeNS() - Web APIs
note that if you try to set without cloning the node, mozilla gives an ns_error_dom_inuse_attribute_err "attribute already in use" error, as the dom requires cloning for attr to be reused (unlike other nodes which can be moved). dom methods dealing with element's attribute...
Element.shadowRoot - Web APIs
sting element. syntax var shadowroot = element.shadowroot; value a shadowroot object 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 definition 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.'); ...
Element.tabStop - Web APIs
this property was proposed to add tab functionality for custom elements. while with the existing tabindex property, it is required to specify an order for the element to become tabbable. the tabstop property would decouple the tabbable property from the tab index. ...
Element.toggleAttribute() - Web APIs
utomatically converted to all lower-case when toggleattribute() is called on an html element in an html document. force optional a boolean value to determine whether the attribute should be added or removed, no matter whether the attribute is present or not at the moment. return value true if attribute name is eventually present, and false otherwise. exceptions invalidcharactererror the
specified attribute name contains one or more characters which are not valid in attribute names. example in the following example, toggleattribute() is used to toggle the readonly attribute of a <input>. html <input value="text"> <button>toggleattribute("readonly")</button> javascript var button = document.queryselector("button"); var input = document.queryselector("input"); button.addeventlistener...
Event - Web APIs
the event interface represents an event which takes place in the dom. an event can be triggered by the user action e.g. clicking the mouse button or tapping keyboard, or generated by apis to represent the progress of an asynchronous task. it can also be triggered programmatically, such as by calling the htmlelement.click() method of an element, or by defining the event, then sending it to a
specified target using eventtarget.dispatchevent(). there are many types of events, some of which use other interfaces based on the main event interface. event itself contains the properties and methods which are common to all events. many dom elements can be set up to accept (or "listen" for) these events, and execute code in response to process (or "handle") them. event-handlers are usually connected (or "...
EventListener - Web APIs
due to the need for compatibility with legacy content, eventlistener accepts both a function and an object with a handleevent() property function. this is shown in the example below. properties this interface neither implements, nor inherits, any properties. methods this interface doesn't inherit any methods. eventlistener.handleevent() a function that is called whenever an event of the
specified type occurs. example html <button id="btn">click here!</button> javascript const buttonelement = document.getelementbyid('btn'); // add a handler for the 'click' event by providing a callback function. // whenever the element is clicked, a pop-up with "element clicked!" will // appear. buttonelement.addeventlistener('click', function (event) { alert('element clicked through function!'); ...
EventSource - Web APIs
hat means that you can open 6 sse connections across all of the tabs to www.example1.com and another 6 sse connections to www.example2.com. (from stackoverflow). when using http/2, the maximum number of simultaneous http streams is negotiated between the server and the client (defaults to 100). constructor eventsource() creates a new eventsource to handle receiving server-sent events from a
specified url, optionally in credentials mode. properties this interface also inherits properties from its parent, eventtarget. eventsource.readystate read only a number representing the state of the connection. possible values are connecting (0), open (1), or closed (2). eventsource.url read only a domstring representing the url of the source. eventsource.withcredentials read only a boolean ...
FeaturePolicy.getAllowlistForFeature() - Web APIs
the getallowlistforfeature() method of the featurepolicy allows query of the allow list for a specific feature for the current feature policy. syntax const allowlist = featurepolicy.getallowlistforfeature(<feature>) parameter feature name a specific feature name must be
specified. return value an allow list for the
specified feature. errors the function will raise a warning if the
specified feature policy directive name is not known. however, it will also return empty array, inditating that no origin is allowed to use the feature. example the followin example prints all the origins that are allowed to use camera api by the feature policy. please note that camera api might be restricted by the permissions api, if the user did not grant the corrsponding permission yet. // firs...
Using Fetch - Web APIs
ent.respondwith( new response(mybody, { headers: { 'content-type': 'text/plain' } }) ); }); the response() constructor takes two optional arguments — a body for the response, and an init object (similar to the one that request() accepts.) note: the static method error() simply returns an error response. similarly, redirect() returns a response resulting in a redirect to a
specified url. these are also only relevant to service workers. body both requests and responses may contain body data. a body is an instance of any of the following types: arraybuffer arraybufferview (uint8array and friends) blob/file string urlsearchparams formdata the body mixin defines the following methods to extract a body (implemented by both request and response). these all return a pr...
File.getAsText() - Web APIs
ta interpreted as text using a given encoding. note: this method is obsolete; you should use the filereader method readastext() instead. syntax var str = instanceoffile.getastext(encoding); parameters encoding a string indicating the encoding to use for the returned data. if this string is empty, utf-8 is assumed. returns a string containing the file's data interpreted as text in the
specified encoding. example // fileinput is a htmlinputelement: <input type="file" id="myfileinput" multiple> var fileinput = document.getelementbyid("myfileinput"); // files is a filelist object (similar to nodelist) var files = fileinput.files; // object for allowed media types var accept = { binary : ["image/png", "image/jpeg"], text : ["text/plain", "text/css", "application/xml", "text/html"]...
File - Web APIs
llowing properties available to it: file.prototype.size read only returns the size of the file in bytes. file.prototype.type read only returns the mime type of the file. instance methods the file interface doesn't define any methods, but inherits methods from the blob interface: blob.prototype.slice([start[, end[, contenttype]]]) returns a new blob object containing the data in the
specified range of bytes of the source blob. blob.prototype.stream() transforms the file into a readablestream that can be used to read the 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 ...
FileError - Web APIs
space or the storage quota was reached and the user declined to give more space to the database. to ask for more storage, see managing html5 offline storage. security_err 2 access to the files were denied for one of the following reasons: the files might be unsafe for access within a web application. too many calls are being made on file resources. other un
specified security error code or situations. type_mismatch_err 11 the app looked up an entry, but the entry found is of the wrong type. for example, the app is asking for a directory, when the entry is really a file. ...
FileException - Web APIs
10 either there's not enough remaining storage space or the storage quota was reached and the user declined to give more space to the database. security_err 2 access to the files were denied for one of the following reasons: the files might be unsafe for access within a web application. too many calls are being made on file resources. other un
specified security error code or situations. type_mismatch_err 11 the user has attempted to look up a file or directory, but the entry found is of the wrong type. for example, the app is accessing a directoryentry when the user is requesting a fileentry. browser compatibility the compatibility table on this page is generated from structured data. if you'd like to contribute ...
FileList - Web APIs
de fetches the first file in the node's file list as a file object: var file = document.getelementbyid('fileitem').files[0]; method overview file item(index); properties attribute type description length integer a read-only value indicating the number of files in the list. methods item() returns a file object representing the file at the
specified index in the file list. file item( index ); parameters index the zero-based index of the file to retrieve from the list. return value the file representing the requested file. example this example iterates over all the files selected by the user using an input element: // fileinput is an html input element: <input type="file" id="myfileinput" multiple> var fileinput = document.g...
FileReader.readAsArrayBuffer() - Web APIs
when the read operation is finished, the readystate becomes done, and the loadend is triggered. at that time, the result attribute contains an arraybuffer representing the file's data. newer api available the blob.arraybuffer() method is a newer promise-based api to read a file as an array buffer. syntax instanceoffilereader.readasarraybuffer(blob); parameters blob the blob or file from which to read. ...
FileReader.readAsBinaryString() - Web APIs
when the read operation is finished, the readystate becomes done, and the loadend is triggered. at that time, the result attribute contains the raw binary data from the file. note that this method was once removed from the file api specification, but re-introduced for backward compatibility. using filereader.readasarraybuffer() is recommended. syntax instanceoffilereader.readasbinarystring(blob); parameters blob the blob or file from which to read. ...
FileReader.readAsDataURL() - Web APIs
when the read operation is finished, the readystate becomes done, and the loadend is triggered. at that time, the result attribute contains the data as a data: url representing the file's data as a base64 encoded string. note: the blob's result cannot be directly decoded as base64 without first removing the data-url declaration preceding the base64-encoded data. to retrieve only the base64 encoded string, first remove data:*/*;base64, from the result. syntax instanceoffilereader.readasdataurl(blob); parameters blob the blob or file from which to read. ...
FileReader.readAsText() - Web APIs
the readastext() method is used to read the contents of the
specified blob or file. when the read operation is complete, the readystate is changed to done, the loadend event is triggered, and the result property contains the contents of the file as a text string. newer api avaliable the blob.text() method is a newer promise-based api to read a file as text. syntax instanceoffilereader.readastext(blob[, encoding]); parameters blob the blob or file from which to read. encoding optional a string specifying the encoding to use for the returned data. by default, utf-8 is assumed if this parameter is not
specified. specifications specification status comment file apithe definition of 'readastext()' in that specification. working draft initial definition ...
FileSystemDirectoryEntry.createReader() - Web APIs
reader() returns a filesystemdirectoryreader object which can be used to read the entries in the directory. syntax directoryreader = filesystemdirectoryentry.createreader(); parameters none. return value a filesystemdirectoryreader object which can be used to read the directory's entries. example this example creates a method called readdirectory(), which fetches all of the entries in the
specified filesystemdirectoryentry and returns them in an array. function readdirectory(directory) { let dirreader = directory.createreader(); let entries = []; let getentries = function() { dirreader.readentries(function(results) { if (results.length) { entries = entries.concat(toarray(results)); getentries(); } }, function(error) { /* handle error -- erro...
FileSystemDirectoryEntry.removeRecursively() - Web APIs
; parameters successcallback a function to call once the directory removal process has completed. the callback has no parameters. errorcallback optional a function to be called if an error occurs while attempting to remove the directory subtree. receives a fileerror describing the error which occurred as input. return value undefined. errors if an error occurs and an errorcallback was
specified, it gets called with a single parameter: a fileerror object describing the error. the fileerror.code specifies what type of error occurred, as follows: fileerror.invalid_modification_err an attempt was made to remove the root directory; this is not permitted. fileerror.no_modification_allowed_err the file system's state doesn't permit modification. fileerror.not_found_err the directory re...
FileSystemEntry.copyTo() - Web APIs
there are some typical restrictions on what you can do: a directory can't be copied into itself. an entry can't be copied into its parent directory unless you specify a new name. when copying a directory, the copy is always recursive; you can't leave out subfolders. syntax filesystementry.copyto(newparent[, newname][, successcallback][, errorcallback]); parameters newparent a filesystemdirectoryentry object specifying the destination directory for the copy operation. newname optional if this parameter is provided, the copy is given this string as its new file or directory name. ...
FileSystemEntry.getParent() - Web APIs
l callback which is executed if an error occurs. there's a single parameter: a fileerror describing what went wrong. return value undefined. errors fileerror.invalid_state_err the operation failed because the file system's state doesn't permit it. this can happen, for example, if the file system's cached state differs from the actual state of the file system. fileerror.not_found_err the
specified path could not be found. fileerror.security_err security restrictions prohibit obtaining the parent directory's information. example this example renames the file
specified by the variable fileentry to "newname.html". fileentry.getparent(function(parent) { fileentry.moveto(parent, "newname.html", function(updatedentry) { console.log("file " + fileentry.name + " renamed to newname.htm...
FileSystemEntry.isDirectory - Web APIs
tementry is a directory. example this example shows how this property might be used to determine whether to process the entry 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 definition 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-...
FileSystemEntry.isFile - Web APIs
lesystementry is a file. example this example shows how this property might be used to determine whether to process the entry 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 definition 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 ...
FileSystemEntry.moveTo() - Web APIs
there are some typical restrictions on what you can do: a directory can't be moved into itself. an entry can't be moved into its parent directory unless you specify a new name. specifying a new name lets moveto() double as a rename operation. when moving a directory, the move is always recursive; you can't leave out subfolders. you can't move a file such that it replaces an existing directory, and you can't move a directory such that it replaces an existing file. ...
FileSystemEntry.name - Web APIs
name property of the filesystementry interface returns a usvstring specifying the entry's name; this is the entry within its parent directory (the last component of the path as indicated by the fullpath property). syntax var name = filesystementry.name; value a usvstring indicating the entry's name. example this 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 definition of 'name' in that specification. draft initial specification. browser ...
FileSystemEntry.remove() - Web APIs
stemdirectoryentry.removerecursively() instead. syntax filesystementry.remove(successcallback[, errorcallback]); parameters successcallback a function which is called once the file has been successfully removed. errorcallback optional an optional callback which is called if the attempt to remove the file fails. return value undefined. errors fileerror.invalid_modification_err the
specified entry was the file system's root directory, or the
specified entry is a directory which isn't empty. fileerror.invalid_state_err the file system's cached state is inconsistent with its state on disk, so the file could not be deleted for safety reasons. fileerror.no_modification_allowed_err the file system's state doesn't permit removing the file or directory. fileerror.not_found_err the fil...
FileSystemEntry - Web APIs
ods. copyto() copies the file or directory to a new location on the file system. getmetadata() obtains metadata about the file, such as its modification date and size. getparent() returns a filesystemdirectoryentry representing the entry's parent directory. moveto() moves the file or directory to a new location on the file system, or renames the file or directory. remove() removes the
specified file or directory. you can only remove directories which are empty. tourl() creates and returns a url which identifies the entry. this url uses the url scheme "filesystem:". specifications specification status comment file and directory entries api draft draft of proposed api this api has no official w3c or whatwg specification. browser compatibility...
FontFace.loaded - Web APIs
syntax var apromise = fontface.loaded; value a promise that resolves with the current fontface object. ...
FontFace - Web APIs
or sets the family of the font. it is equivalent to the font-family descriptor. fontface.featuresettings a cssomstring that retrieves or sets infrequently used font features that are not available from a font's variant properties. it is equivalent to the font-feature-settings descriptor. fontface.loaded read only returns a promise that resolves with the current fontface object when the font
specified in the object's constructor is done loading or rejects with a syntaxerror. fontface.status read only returns an enumerated value indicating the status of the font, one of "unloaded", "loading", "loaded", or "error". fontface.stretch a cssomstring that retrieves or sets how the font stretches. it is equivalent to the font-stretch descriptor. fontface.style a cssomstring that retrieves or s...
Using FormData Objects - Web APIs
t(); oreq.open("post", "stash.php", true); oreq.onload = function(oevent) { if (oreq.status == 200) { ooutput.innerhtml = "uploaded!"; } else { ooutput.innerhtml = "error " + oreq.status + " occurred when trying to upload your file.<br \/>"; } }; oreq.send(odata); ev.preventdefault(); }, false); note: if you pass in a reference to the form, the request method
specified in the form will be used over the method
specified in the open() call. you can also append a file or blob directly to the formdata object, like this: data.append("myfile", myblob, "filename.txt"); when using the append() method it is possible to use the third optional parameter to pass a filename inside the content-disposition header that is sent to the server. when no filename is
specified ...
Using the Frame Timing API - Web APIs
ing interfaces including example code. for an overview of these interfaces see frame timing api. frame observers the performance observer interfaces allow an application to register an observer for specific performance event types. when one of those event types is added to the browser's performance timeline, the application is notified of the event via the observer's callback function that was
specified when the observer was created. creating an observer to observe "frame" performance entry types, the application first creates a performanceobserver object with a specific frame observer callback. in the following example, two observers for the "frame" performance entry type are created and the first observer constructor uses inline function syntax. function create_frame_observer() { if (wind...
Frame Timing API - Web APIs
data, particularly the duration timestamp, can be used to help identify performance problems. frame observers the performance observer interfaces allow an application to register an observer for specific performance event types. when one of those event types is recorded in the browser's performance timeline, the application is notified of the event via the observer's callback function that was
specified when the observer was created. to observe "frame" performance entry types, the application first creates a performanceobserver object with a specific frame observer callback (function). next, performanceobserver.observe() is used to specify the set of performance events to observe - in this case, just the "frame" event type. when the browser adds a new frame to the performance timeline, the spec...
Fullscreen API - Web APIs
element interfaces to allow turning off and on full-screen mode. methods on the document interface document.exitfullscreen() requests that the user agent switch from full-screen mode back to windowed mode. returns a promise which is resolved once full-screen mode has been completely shut off. methods on the element interface element.requestfullscreen() asks the user agent to place the
specified element (and, by extension, its descendants) into full-screen mode, removing all of the browser's ui elements as well as all other applications from the screen. returns a promise which is resolved once full-screen mode has been activated. properties the document interface provides properties that can be used to determine if full-screen mode is supported and available, and if full-screen mode i...
Gamepad.id - Web APIs
for example, a ps2 controller returned 810-3-usb gamepad. this information is intended to allow you to find a mapping for the controls on the device as well as display useful feedback to the user. ...
GamepadHapticActuator.pulse() - Web APIs
syntax gamepadhapticactuatorinstance.pulse(value, duration).then(function(result) { ... }); parameters value a double representing the intensity of the pulse. this can vary depending on the hardware type, but generally takes a value between 0.0 (no intensity) and 1.0 (full intensity). duration a double representing the duration of the pulse, in milliseconds. note: repeated calls to pulse() override the previous calls if they are still ongoing. ...
GamepadHapticActuator - Web APIs
designed to provide haptic feedback to the user (if available), most commonly vibration hardware. this interface is accessible through the gamepad.hapticactuators property. properties gamepadhapticactuator.type read only returns an enum representing the type of the haptic hardware. methods gamepadhapticactuator.pulse() read only makes the hardware pulse at a certain intensity for a
specified duration. examples tbd. specifications specification status comment gamepad extensionsthe definition of 'gamepadhapticactuator' in that specification. editor's draft initial definition ...
Using the Gamepad API - Web APIs
shown below: window.addeventlistener("gamepadconnected", function(e) { var gp = navigator.getgamepads()[e.gamepad.index]; console.log("gamepad connected at index %d: %s. %d buttons, %d axes.", gp.index, gp.id, gp.buttons.length, gp.axes.length); }); the gamepad object's properties are as follows: id: a string containing some information about the controller. this is not strictly
specified, but in firefox it will contain three pieces of information separated by dashes (-): two 4-digit hexadecimal strings containing the usb vendor and product id of the controller, and the name of the controller as provided by the driver. this information is intended to allow you to find a mapping for the controls on the device as well as display useful feedback to the user. index: an integer that i...
GeolocationCoordinates.heading - Web APIs
zero degrees represents true true north, and the direction is determined clockwise (which means that east is 90 degrees and west is 270 degrees). if geolocationcoordinates.speed is 0, heading is nan. if the device is not able to provide heading information, this value is null. syntax let heading = geolocationcoordinatesinstance.heading value a double representing the direction in which the device is traveling. ...
GeolocationCoordinates.longitude - Web APIs
together with a domtimestamp indicating a time of measurement, the geolocationcoordinates object is part of the geolocationposition interface, which is the object type returned by geolocation api functions that obtain and return a geographical position. ...
GeolocationCoordinates - Web APIs
the accuracy of the latitude and longitude properties, expressed in meters. geolocationcoordinates.altitudeaccuracy read only secure context returns a double representing the accuracy of the altitude expressed in meters. this value can be null. geolocationcoordinates.heading read only secure context returns a double representing the direction towards which the device is facing. this value,
specified in degrees, indicates how far off from heading true north the device is. 0 degrees represents true north, and the direction is determined clockwise (which means that east is 90 degrees and west is 270 degrees). if speed is 0, heading is nan. if the device is unable to provide heading information, this value is null. geolocationcoordinates.speed read only secure context returns a double represe...
GlobalEventHandlers.ontouchcancel - Web APIs
this attribute is not widely implemented. syntax var cancelhandler = someelement.ontouchcancel; return value cancelhandler the touchcancel event handler for element someelement. example this example shows two ways to use ontouchcancel to set an element's touchcancel event handler. ...
GlobalEventHandlers.ontouchend - Web APIs
this attribute is not widely implemented. syntax var endhandler = targetelement.ontouchend; return value endhandler the touchend event handler for element targetelement. example this example shows two ways to use ontouchend to set an element's touchend event handler. ...
GlobalEventHandlers.ontouchmove - Web APIs
this attribute is not widely implemented. syntax var movehandler = someelement.ontouchmove; return value movehandler the touchmove event handler for element someelement. example this example shows two ways to use ontouchmove to set an element's touchmove event handler. ...
GlobalEventHandlers.ontouchstart - Web APIs
this attribute is not widely implemented. syntax var starthandler = someelement.ontouchstart; return value starthandler the touchstart event handler for element someelement. example this example shows two ways to use ontouchstart to set an element's touchstart event handler. ...
Audio() - Web APIs
attached to a document for the user to interact with and/or listen to, or can be used offscreen to manage and play audio. syntax audioobj = new audio(url); parameters url optional an optional domstring containing the url of an audio file to be associated with the new audio element. return value a new htmlaudioelement object, configured to be used for playing back the audio from the file
specified by url.the new object's preload property is set to auto and its src property is set to the
specified url or null if no url is given. if a url is
specified, the browser begins to asynchronously load the media resource before returning the new object. usage notes you can also use other element-creation methods, such as the document object's createelement() method, to construct a new htmlaudioe...
HTMLBaseElement - Web APIs
ents: all;} properties inherits properties from its parent, htmlelement. htmlbaseelement.href is a domstring that reflects the href html attribute, containing a base url for relative 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 definition of 'htmlbaseelement' in that specification. living standard html 5.1the definition of 'htmlbaseelement' in that specification. recommendation no change from html5 html5the definiti...
HTMLBaseFontElement - Web APIs
manipulating <basefont> elements. the <basefont> element has been deprecated in html4 and removed in html5. this latest specification requires that this element implements htmlunknownelement rather than htmlbasefontelement. properties inherits properties from its parent, htmlelement. htmlbasefontelement.color is a domstring representing the text color using either a named color or a color
specified in the hexadecimal #rrggbb format. htmlbasefontelement.face is a domstring representing a list of one or more font names. the document text in the default style is rendered in the first font face that the client's browser supports. if no font listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system. htmlbasefontelement.size...
HTMLCanvasElement.toBlob() - Web APIs
the created image is in a resolution of 96dpi. the third argument is used when creating images using lossy compression (namely, image/jpeg) to specify the quality of the output. ...
HTMLCanvasElement.toDataURL() - Web APIs
the returned image is in a resolution of 96 dpi. if the height or width of the canvas is 0 or larger than the maximum canvas size, the string "data:," is returned. if the requested type is not image/png, but the returned value starts with data:image/png, then the requested type is not supported. chrome also supports the image/webp type. syntax canvas.todataurl(type, encoderoptions); parameters type optional a domstring indicating the image format. the default format type is image/png. ...
HTMLCollection.item - Web APIs
the htmlcollection method item() returns the node located at the
specified offset into the collection. note: because the contents of an htmlcollection are live, changes to the underlying dom can and will cause the position of individual nodes in the collection to change, so the index value will not necessarily remain constant for a given node. syntax var element = htmlcollection.item(index) parameters index the position of the node to be returned. elements appear in an htmlcollection in the same order in which they appear in the document's source. return value the node at the
specified index, or null if index is less than zero or greater than or equal to the length property. usage notes the item() method returns a numbered element from an htmlcollection. in javascript, it is easier ...
HTMLCollection - Web APIs
ction.item() returns the specific node at the given zero-based index into the list. returns null if the index is out of range. an alternative to accessing collection[i] (which instead returns undefined when i is out-of-bounds). this is mostly useful for non-javascript dom implementations. htmlcollection.nameditem() returns the specific node whose id or, as a fallback, name matches the string
specified by name. matching by name is only done as a last resort, only in html, and only if the referenced element supports the name attribute. returns null if no node exists by the given name. an alternative to accessing collection[name] (which instead returns undefined when name does not exist). this is mostly useful for non-javascript dom implementations. usage in javascript htmlcollection also exp...
HTMLElement.lang - Web APIs
element's attribute values and text content. the language code returned by this property is defined in the tags for identifying languages (bcp47) ietf document. common examples include "en" for english, "ja" for japanese, "es" for spanish and so on. the default value of this attribute is unknown. note that this attribute, though valid at the individual element level described here, is most often
specified for the root element of the document. this also only works with the lang attribute and not with xml:lang. syntax var languageused = elementnodereference.lang; // get the value of lang elementnodereference.lang = newlanguage; // set new value for lang languageused is a string variable that gets the language in which the text of the current element is written. newlanguage is a string variable ...
HTMLFontElement.color - Web APIs
the obsolete htmlfontelement.color property is a domstring that reflects the color html attribute, containing either a named color or a color
specified in the hexadecimal #rrggbb format. the format of the string must follow one of the following html microsyntaxes: microsyntax description examples valid name color string nameofcolor (case insensitive) green green green valid hex color string in rgb format: #rrggbb #008000 rgb using decimal values rgb(x,x,x) (x in 0-255 range) rgb(0,128,0) syntax colorstring = fontobj.color; fontobj.color = colorstring; examples // assumes there is <font id="f"> element in the html var f = document.getelementbyid("f"); f.color = "green"; specifications the <font> tag ...
HTMLFontElement - Web APIs
implements the document object model (dom) representation of the font element. the html font element <font> defines the font size, font face and color of text. properties inherits properties from its parent, htmlelement. htmlfontelement.color is a domstring that reflects the color html attribute, containing either a named color or a color
specified in the hexadecimal #rrggbb format. htmlfontelement.face is a domstring that reflects the face html attribute, containing a comma-separated list of one or more font names. htmlfontelement.size is a domstring that reflects the size html attribute, containing either a font size number ranging from 1 to 7 or a relative size to the size attribute of the <basefont> element, for example -2 or +1. methods no specific method; inherits methods from...
HTMLFormControlsCollection.namedItem() - Web APIs
note that this version of nameditem() hides the one inherited from htmlcollection. like that one, in javascript, using the array bracket syntax with a string, like collection["value"] is equivalent to collection.nameditem("value"). syntax var item = collection.nameditem(str); var item = collection[str]; parameters str is a domstring return value item is a radionodelist , element, or null. ...
HTMLFormControlsCollection - Web APIs
mlformcontrolscollection</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties this interface inherits the properties of its parent, htmlcollection. methods this interface inherits the methods of its parent, htmlcollection. htmlformcontrolscollection.nameditem() returns the radionodelist or the element in the collection whose name or id matches the
specified name, or null if no nodes match. note that this version of nameditem() hide the one inherited from htmlcollection. like that one, in javascript, using the array bracket syntax with a string, like collection["value"] is equivalent to collection.nameditem("value"). specifications specification status comment html living standardthe definition of 'htmlformcontrolscollectio...
HTMLFormElement.method - Web APIs
the htmlformelement.method property represents the http method used to submit the <form>. unless explicitly
specified, the default method is 'get'. syntax var string = form.method; form.method = string; example document.forms['myform'].method = 'post'; const formelement = document.createelement("form"); // create a form document.body.appendchild(formelement); console.log(formelement.method); // 'get' specifications specification status comment html living standardthe definition of 'htmlformelement: method' in that specification. living standard ...
HTMLFormElement.requestSubmit() - Web APIs
x htmlformelement.requestsubmit(submitter); parameters submitter optional the submit button whose attributes describe the method by which the form is to be submitted. this may be either an <input> or <button> element whose type attribute is submit. if you omit the submitter parameter, the form element itself is used as the submitter. return value none. exceptions typeerror the
specified submitter is not a submit button. notfounderror the
specified submitter isn't a member of the form on which requestsubmit() was called. the submitter must be either a descendant of the form element or must have an form attribute referring to the form. usage notes the obvious question is: why does this method exist, when we've had the submit() method since the dawn of time? the answer is sim...
HTMLFormElement: reset event - Web APIs
the reset event fires when a <form> is reset. bubbles yes (although
specified as a simple event that doesn't bubble) cancelable yes interface event event handler property globaleventhandlers.onreset examples this example uses eventtarget.addeventlistener() to listen for form resets, and logs the current event.timestamp whenever that occurs. html <form id="form"> <label>test field: <input type="text"></label> <br><br> <button type="reset">reset form</button> </form> <p id="log"></p> javascript function logreset(event) { log.textcontent = `form reset! time stamp: ${event.timestamp}`; } const form = document.getelementbyid('form'); const log = document.getelementbyid('log'); form.addeventlistener('reset', logreset); result spec...
HTMLFormElement: submit event - Web APIs
however, the submitevent which is sent to indicate the form's submit action has been triggered includes a submitter property, which is the button that was invoked to trigger the submit request. ...
HTMLHyperlinkElementUtils.origin - Web APIs
e.g "blob:https://mozilla.org" will have "https://mozilla.org". note: this feature is available in web workers. syntax string = object.origin; examples // on this page, returns the origin var result = window.location.origin; // returns:'https://developer.mozilla.org' specifications specification st...
HTMLHyperlinkElementUtils.username - Web APIs
the htmlhyperlinkelementutils.username property is a usvstring containing the username
specified before the domain name. syntax string = object.username; object.username = string; examples // let's <a id="myanchor" href="https://anonymous:flabada@developer.mozilla.org/docs/htmlhyperlinkelementutils.username"> be in the document var anchor = document.getelementbyid("myanchor"); var result = anchor.username; // returns:'anonymous' specifications specification status comment html living standardthe definition of 'htmlhyperlinkelementutils.username' in that specification. living standard initial definition. ...
HTMLIFrameElement.referrerPolicy - Web APIs
rpolicy attribute of the <iframe> element defining which referrer is sent when fetching the resource. syntax refstr = iframeelt.referrerpolicy; iframeelt.referrerpolicy = refstr; values no-referrer the referer header will be omitted entirely. no referrer information is sent along with requests. no-referrer-when-downgrade (default) this is the user agent's default behavior if no policy is
specified. the url is sent as a referrer when the protocol security level stays the same (http→http, https→https), but isn't sent to a less secure destination (https→http). origin only send the origin of the document as the referrer in all cases. the document https://example.com/page.html will send the referrer https://example.com/. origin-when-cross-origin send a full url when performing a same...
HTMLImageElement.complete - Web APIs
nt interface's complete attribute is a boolean value which indicates whether or not the image has completely loaded. syntax let doneloading = htmlimageelement.complete; value a boolean value which is true if the image has completely loaded; otherwise, the value is false. the image is considered completely loaded if any of the following are true: neither the src nor the srcset attribute is
specified. the srcset attribute is absent and the src attribute, while
specified, is the empty string (""). the image resource has been fully fetched and has been queued for rendering/compositing. the image element has previously determined that the image is fully available and ready for use. the image is "broken;" that is, the image failed to load due to an error or because image loading is disabled. ...
HTMLImageElement.hspace - Web APIs
empty space to leave empty on the left and right sides of the <img> element when laying out the page. this property reflects the html hspace attribute. syntax htmlimageelement.hspace = marginwidth; marginwidth = htmlimageelement.hspace; value an integer value specifying the width, in pixels, of the horizontal margin to apply to the left and right sides of the image. 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 definition of 'htmlimageelement.hsp...
HTMLImageElement.isMap - Web APIs
htmlimageelement.ismap; value a boolean value which is true if the image is being used for a server-side image map; otherwise, the value is false. usage notes when an image marked as being part of a server-side image map is clicked, the browser constructs the string "?x,y", where x and y indicate the coordinates at which the mouse was clicked as offsets from the top-left 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 definition of 'htmlimageelement.isma...
HTMLImageElement.lowSrc - Web APIs
the htmlimageelement interface's obsolete lowsrc property can be used to specify the url of a reduced-quality or otherwise faster-loading version of the image
specified by the src property. this property reflects the html lowsrc attribute. syntax htmlimageelement.lowsrc = imageurl; imageurl = htmlimageelement.lowsrc; value a domstring specifying the url of a version of the image
specified by src which has been modified in some fashion so that it loads significantly more quickly than the primary image. there are a number of ways to achieve this; primary among them: higher compression levels (for example, a primary image saved as a jpeg using 85% quality might have a lowsrc version saved at 15%. reduced color depth; a primary image in 32-bit color might have an alternate image in 8-bit...
HTMLImageElement.src - Web APIs
s the best match for the viewport size and display pixel density, the src attribute is a usvstring specifying the url of the desired image. this can be set either within the html itself using the src content attribute, or programmatically by setting the element's src property. if you use the srcset content attribute to provide multiple image options for different display pixel densities, the url
specified by the src attribute is used in one of two ways: as a fallback for browsers that don't support srcset. as an equivalent for specifying an image in srcset with the size multiplier 1x; that is, the image
specified by src is used on low-density screens (such as typical 72 dpi or 96 dpi displays). additionally, if you use src along with both sizes (or the corresponding sizes content attribute) ...
HTMLImageElement.vspace - Web APIs
imageelement interface specifies the number of pixels of empty space to leave empty on the top and bottom of the <img> element when laying out the page. syntax htmlimageelement.vspace = marginheight; marginheight = htmlimageelement.vspace; value an integer value specifying the height, in pixels, of the vertical margin to apply to the top and bottom sides of the image. usage 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 definition of 'htmlimageelement.vs...
HTMLInputElement.mozGetFileNameArray() - Web APIs
the htmlinputelement.mozgetfilenamearray() method returns an array of the names of the files that were selected by the user on an html input element. note: this method is gecko-specific and is not available in other browsers. also, it throws an error if used in web pages. syntax inputelement.mozgetfilenamearray(alength, afilenames); parameters alength if
specified, will receive the number of file names in the returned array. afilenames is an array into which the file names are placed. example var numfiles = 0; var filearray = {}; inputelement.mozgetfilenamearray(numfiles, filearray); ...
HTMLInputElement.stepUp() - Web APIs
the htmlinputelement.stepup() method increments the value of a numeric type of <input> element by the value of the step attribute, or the default step value if the step attribute is not explicitly set. the method, when invoked, increments the value by (step * n), where n defaults to 1 if not
specified, and step defaults to the default value for step if not
specified. input type default step value example step declaration date 1 (day) 7 day (one week) increments: <input type="date" min="2019-12-25" step="7"> month 1 (month) 12 month (one year) increments: <input type="month" min="2019-12" step="12"> week 1 (week) two week increments: <input type="week" min="2019-w23" step="2"> time 60 (seconds) 900 second (15 m...
HTMLKeygenElement - Web APIs
see bug 101019 for details and status. the <keygen> elements expose the htmlkeygenelement interface, which provides special properties and methods (beyond the regular element object interface they also have available to them by inheritance) for manipulating the layout and presentation of keygen elements. properties autofocus is a boolean that reflects the autofocus html attribute, indicating that the form control should have input focus when the page loads. challenge is a domstring that reflects the challenge html attribute, containing a challenge string that is packaged with the submitted key. ...
HTMLMediaElement.load() - Web APIs
thin the media element itself. load() will reset the element and rescan the available sources, thereby causing the changes to take effect. syntax mediaelement.load(); parameters none. return value undefined. usage notes calling load() aborts all ongoing operations involving this media element, then begins the process of selecting and loading an appropriate media resource given the options
specified in the <audio> or <video> element and its src attribute or child <source> element(s). this is described in more detail in supporting multiple formats in video and audio content. the process of aborting any ongoing activities will cause any outstanding promises returned by play() being resolved or rejected as appropriate based on their status before the loading of new media can begin. pending pla...
HTMLMediaElement.msInsertAudioEffect() - 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 htmlmediaelement.msinsertaudioeffect() method inserts the
specified audio effect into the media pipeline. this proprietary method is specific to internet explorer and microsoft edge. syntax htmlmediaelement.msinsertaudioeffect(activatableclassid: domstring, effectrequired: boolean, config); parameters activatableclassid a domstring defining the audio effects class. effectrequired a boolean which if set to true requires an audio effect to be defined. configoptional an optional object to hel...
HTMLMediaElement.onerror - Web APIs
the onerror property of the htmlmediaelement interface is the eventhandler for processing error events. the error event fires when 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 definition of 'onerror' in that specification. living standard ...
HTMLMediaElement.play() - Web APIs
arameter (as opposed to a traditional exception being thrown). possible errors include: notallowederror the user agent (browser) or operating system doesn't allow playback of media in the current context or situation. this may happen, for example, if the browser requires the user to explicitly start media playback by clicking a "play" button. notsupportederror the media source (which may be
specified as a mediastream, mediasource, blob, or file, for example) doesn't represent a supported media format. other exceptions may be reported, depending on browser implementation details, media player implementation, and so forth. usage notes although the term "autoplay" is usually thought of as referring to pages that immediately begin playing media upon being loaded, web browsers' autoplay polici...
HTMLMediaElement.setSinkId() - Web APIs
syntax htmlmediaelement.setsinkid(sinkid).then(function() { ... }) returns a promise that resolves to undefined. parameters sinkid the mediadeviceinfo.deviceid of the audio output device. ...
HTMLObjectElement - Web APIs
the object loads. htmlobjectelement.tabindex is a long representing the position of the element in the tabbing navigation order for the current document. htmlobjectelement.type is a domstring that reflects the type html attribute, specifying the mime type of the resource. htmlobjectelement.typemustmatch is a boolean that reflects the typemustmatch html attribute, indicating if the resource
specified by data must only be played if it matches the type attribute. htmlobjectelement.usemap is a domstring that reflects the usemap html attribute, specifying a <map> element to use. htmlobjectelement.validationmessage read only returns a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any). this is the empty string if the...
HTMLOrForeignElement - Web APIs
the focused element is the element which will receive keyboard and similar events by default. specifications specification status comment html living standardthe definition of 'htmlorforeignelement' in that specification. living standard initial definition. ...
HTMLSelectElement.namedItem() - Web APIs
in javascript, using the array bracket syntax with a string, like selectelt["value"] is equivalent to selectelt.nameditem("value"). syntax var item = collection.nameditem(str); var item = collection[str]; parameters str is a domstring. return value item is a htmloptionelement. ...
HTMLSelectElement.remove() - Web APIs
syntax collection.remove(index); parameters index is a long for the index of the htmloptionelement to remove from the collection. if the index is not found the method has no effect. ...
HTMLSelectElement.setCustomValidity() - Web APIs
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. specifications specification status comment html living standardthe definition of 'htmlselectelement.setcustomvalidity()' in that specification. living standard no change since the latest snapshot, html5. ...
HTMLStyleElement - Web APIs
the htmlstyleelement interface represents a <style> element. it inherits properties and methods from its parent, htmlelement, and from linkstyle. this interface doesn't allow to manipulate the css it contains (in most case). to manipulate css, see using dynamic styling information for an overview of the objects used to manipulate
specified css properties using the dom. <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" strok...
HTMLTableCellElement - Web APIs
cell. it reflects the headers attribute. htmltablecellelement.rowspan an unsigned long integer indicating the number of rows this cell must span; this lets a cell occupy space across multiple rows of the table. it reflects the rowspan attribute. htmltablecellelement.scope a domstring indicating the scope of a <th> cell. header cells can be configured, using the scope property, the apply to a
specified row or column, or to the not-yet-scoped cells within the current row group (that is, the same ancestor <thead>, <tbody>, or <tfoot> element). if no value is
specified for scope, the header is not associated directly with cells in this way. permitted values for scope are: col the header cell applies to the following cells in the same column (or columns, if colspan is used as well), until eit...
HTMLTableElement.deleteRow() - Web APIs
the htmltableelement.deleterow() method removes a specific row (<tr>) from a given <table>. syntax htmltableelement.deleterow(index) parameters index index is an integer representing the row that should be deleted. however, the special index -1 can be used to remove the very last row of a table. return value no return value errors thrown if the number of the row to delete,
specified by the parameter, is greater or equal to the number of available rows, or if it is negative and not equal to the special index -1, representing the last row of the table, the exception index_size_err is thrown. example this example uses javascript to delete a table's second row. 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 ...
HTMLVideoElement.msInsertVideoEffect() - 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 htmlmediaelement.msinsertvideoeffect() method inserts the
specified video effect into the media pipeline. this proprietary method is specific to internet explorer and microsoft edge. syntax str = htmlmediaelement.msinsertvideoeffect(activatableclassid: domstring, effectrequired: boolean, config); parameters activatableclassid a domstring defining the video effects class. effectrequired a boolean which if set to true requires a video effect to be defined. configoptional an optional object t...
HTMLVideoElement - Web APIs
ent.mozhasaudio read only returns a boolean indicating if there is some audio associated with the video. microsoft extensions htmlvideoelement.msframestep() steps the video by one frame forward or one frame backward. htmlvideoelement.mshorizontalmirror gets or sets whether a video element is flipped horizontally in the display. htmlvideoelement.msinsertvideoeffect() inserts the
specified video effect into the media pipeline. htmlvideoelement.msislayoutoptimalforplayback read only indicates whether the video can be rendered more efficiently. htmlvideoelement.msisstereo3d read only determines whether the system considers the loaded video source to be stereo 3-d or not. value set to true indicates source is stereo 3d. htmlvideoelement.mszoom controls whether the video fr...
Using microtasks in JavaScript with queueMicrotask() - Web APIs
ay, using a microtask to send them as a single object when the context exits. const messagequeue = []; let sendmessage = message => { messagequeue.push(message); if (messagequeue.length === 1) { queuemicrotask(() => { const json = json.stringify(messagequeue); messagequeue.length = 0; fetch("url-of-receiver", json); }); } }; when sendmessage() gets called, the
specified message is first pushed onto the message queue array. then things get interesting. if the message we just added to the array is the first one, we enqueue a microtask that will send a batch. the microtask will execute, as always, when the javascript execution path reaches the top level, just before running callbacks. that means that any further calls to sendmessage() made in the interim will push...
Headers - Web APIs
of the key/value pairs contained in this object. headers.set() sets a new value for an existing header inside a headers object, or adds the header if it does not already exist. headers.values() returns an iterator allowing you to go through all values of the key/value pairs contained in this object. note: to be clear, the difference between headers.set() and headers.append() is that if the
specified header does already exist and does accept multiple values, headers.set() will overwrite the existing value with the new one, whereas headers.append() will append the new value onto the end of the set of values. see their dedicated pages for example code. note: all of the headers methods will throw a typeerror if you try to pass in a reference to a name that isn't a valid http header name. the ...
History.pushState() - Web APIs
the browser won't attempt to load this url after a call to pushstate(), but it might attempt to load the url later, for instance after the user restarts the browser. the new url does not need to be absolute; if it's relative, it's resolved relative to the current url. the new url must be of the same origin as the current url; otherwise, pushstate() will throw an exception. if this parameter isn't
specified, it's set to the document's current url. description in a sense, calling pushstate() is similar to setting window.location = "#foo", in that both will also create and activate another history entry associated with the current document. but pushstate() has a few advantages: the new url can be any url in the same origin as the current url. in contrast, setting window.location keeps you at the...
History - Web APIs
lue (for instance, specifying -1 when there are no previously-visited pages in the session history), this method silently has no effect. calling go() without parameters or a value of 0 reloads the current page. internet explorer lets you specify a string, instead of an integer, to go to a specific url in the history list. pushstate() pushes the given data onto the session history stack with the
specified title (and, if provided, url). the data is treated as opaque by the dom; you may specify any javascript object that can be serialized. note that all browsers but safari currently ignore the title parameter. for more information, see working with the history api. replacestate() updates the most recent entry on the history stack to have the
specified data, title, and, if provided, url. the data ...
IDBCursor.continue() - Web APIs
note: this feature is available in web workers. syntax cursor.continue(key); parameters key optional the key to position the cursor at. exceptions this method may raise a domexception of one of the following types: exception description transactioninactiveerror this idbcursor's transaction is inactive. ...
IDBCursorSync - Web APIs
ursor includes duplicates, and its direction is monotonically decreasing in the order of keys. prev_no_duplicate 3 this cursor does not include duplicates, and its direction is monotonically decreasing in the order of keys. methods continue() advances the cursor to the next position along its direction, to the item whose key matches the optional key parameter. if no key is
specified, advance to the immediate next position. returns false if the cursor has reached the end of its range; otherwise returns true. bool continue ( in optional any key ); parameters key the key to which to move the cursor's position. remove() deletes the record at the cursor's position, without changing the cursor's position void delete ( ) raises (databaseexception); exceptions this m...
IDBDatabase.createObjectStore() - Web APIs
the name of the new object store to be created. note that it is possible to create an object store with an empty name. optionalparameters optional an options object whose attributes are optional parameters to the method. it includes the following properties: attribute description keypath the key path to be used by the new object store. if empty or not
specified, the object store is created without a key path and uses out-of-line keys. you can also pass in an array as a keypath. autoincrement if true, the object store has a key generator. defaults to false. unknown parameters are ignored. returns a new idbobjectstore. exceptions this method may raise a domexception with a domerror of one of the following types: ...
IDBFactorySync - Web APIs
ns of accessing the capabilities of indexed databases. method overview idbdatabasesync open (in domstring name, in domstring description, in optional boolean modifydatabase) raises (idbdatabaseexception); methods open() opens and returns a connection to a database. blocks the calling thread until the connection object is ready to return. if there is already a database with the
specified name, it uses that one; otherwise, it creates the database using the
specified name and description. idbdatabasesync open ( in domstring name, in domstring description ) raises (idbdatabaseexception); parameters name the name for the database. description the description for the database. returns idbdatabasesync an object to access the open database. exceptions this method c...
IDBIndex.isAutoLocale - Web APIs
example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. ...
IDBIndex.locale - Web APIs
syntax var myindex = objectstore.index('index'); console.log(myindex.locale); value a domstring. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. ...
IDBIndex.name - Web APIs
h can occur when you attempt to change an index's name. invalidstateerror the index, or its object store, has been deleted; or the current transaction is not an upgrade transaction. you can only rename indexes during upgrade transactions; that is, when the mode is "versionchange". transactioninactiveerror the current transaction is not active. constrainterror an index is already using the
specified name. example in the following example we open a transaction and an object store, then get the index lname from a simple contacts database. we then open a basic cursor on the index using idbindex.opencursor() — this works the same as opening a cursor directly on an idbobjectstore using opencursor() except that the returned records are sorted based on the index, not the primary key. the name...
IDBKeyRange.bound() - Web APIs
the bounds can be open (that is, the bounds exclude the endpoint values) or closed (that is, the bounds include the endpoint values). by default, the bounds are closed. note: this feature is available in web workers. syntax var myidbkeyrange = idbkeyrange.bound(lower, upper); var myidbkeyrange = idbkeyrange.bound(lower, upper, loweropen); var myidbkeyrange = idbkeyrange.bound(lower, upper, loweropen, upperopen); parameters lower specifies the lower bound of the new key range. upper specifies the upper bound of the new key range. ...
IDBKeyRange.includes() - Web APIs
note: this feature is available in web workers. syntax var isincluded = mykeyrange.includes(key) parameters key the key you want to check for in your key range. this can be any type. return value a boolean. exceptions this method may raise a domexception of the following type: attribute description dataerror the supplied key was not a valid key. ...
IDBKeyRange - Web APIs
methods static methods idbkeyrange.bound() creates a new key range with upper and lower bounds. idbkeyrange.only() creates a new key range containing a single value. idbkeyrange.lowerbound() creates a new key range with only a lower bound. idbkeyrange.upperbound() creates a new upper-bound key range. instance methods idbkeyrange.includes() returns a boolean indicating whether a
specified key is inside the key range. examples the following example illustrates how you'd use a key range. here we declare a keyrangevalue as a range between values of "a" and "f". we open a transaction (using idbtransaction) and an object store, and open a cursor with idbobjectstore.opencursor, declaring keyrangevalue as its optional key range value. this means that the cursor will only retrieve reco...
IDBObjectStore.add() - Web APIs
n error constrainerror event is fired on the returned request object. for updating existing records, you should use the idbobjectstore.put method instead. note: this feature is available in web workers. syntax var request = objectstore.add(value); var request = objectstore.add(value, key); parameters value the value to be stored. key optional the key to use to identify the record. if un
specified, it results to null. returns an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description readonlyerror the transaction associated with this operation is in read-only mode. transactioninactiveerror this idbobjectstore's transact...
IDBObjectStore.count() - Web APIs
return value an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore has been deleted. transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the
specified key or key range is invalid. example in this simple fragment we create a transaction, retrieve an object store, then count the number of records in the store using count() — when the success handler fires, we log the count value (an integer) to the console. var transaction = db.transaction(['fthings'], 'readonly'); var objectstore = transaction.objectstore('fthings'); var countreq...
IDBObjectStore.createIndex() - Web APIs
any sorting operations performed on the data via key ranges will then obey sorting rules of that locale (see locale-aware sorting.) you can specify its value in one of three ways: string: a string containing a specific locale code, e.g. en-us, or pl. auto: the platform default locale will be used (may be changed by user agent settings.) null or undefined: if no locale is
specified, normal javascript sorting will be used — not locale-aware. return value an idbindex object: the newly created index. exceptions this method may raise a domexception of one of the following types: exception description constrainterror occurs if an index with the same name already exists in the database. index names are case-sensitive. ...
IDBObjectStore.deleteIndex() - Web APIs
note that this method must be called only from a versionchange transaction mode callback. note that this method synchronously modifies the idbobjectstore.indexnames property. note: this feature is available in web workers. syntax objectstore.deleteindex(indexname); parameters indexname the name of the existing index to remove. ...
IDBObjectStore.get() - Web APIs
this is for retrieving specific records from an object store. if a value is successfully found, then a structured clone of it is created and set as the result of the request object. note: this method produces the same result for: a) a record that doesn't exist in the database and b) a record that has an undefined value. to tell these situations apart, call the opencursor() method with the same key. that method provides a cursor if the record exists, and no cursor if it does not. ...
IDBObjectStore.getAll() - Web APIs
if a value is successfully found, then a structured clone of it is created and set as the result of the request object. this method produces the same result for: a record that doesn't exist in the database a record that has an undefined value to tell these situations apart, you either call the opencursor() method with the same key. that method provides a cursor if the record exists, and no cursor if it does not. ...
IDBObjectStore.getAllKeys() - Web APIs
if a value is successfully found, then a structured clone of it is created and set as the result of the request object. this method produces the same result for: a record that doesn't exist in the database a record that has an undefined value to tell these situations apart, you need to call the opencursor() method with the same key. ...
IDBObjectStore.getKey() - Web APIs
this is for retrieving specific records from an object store. if a key is successfully found, then a structured clone of it is created and set as the result of the request object. note: this feature is available in web workers. syntax var request = objectstore.getkey(key); parameters key the key or key range that identifies the record to be retrieved. return value an idbrequest object on which subsequent events related to this operation are fired. ...
IDBObjectStore.name - Web APIs
occur when you attempt to change an object store's name. invalidstateerror either the object store has been deleted or the current transaction is not an upgrade transaction; you can only rename indexes during upgrade transactions; that is, when the mode is "versionchange". transactioninactiveerror the current transaction is not active. constrainterror an object store is already using the
specified name. example in the following code snippet, we open a read/write transaction on our database and add some data to an object store using add(). after the object store has been created, we log objectstore.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); db...
IDBObjectStore.openCursor() - Web APIs
lue an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore or idbindex has been deleted. transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the
specified key or key range is invalid. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store: var transaction = db.transaction("name", "readonly"); var objectstore = transaction.objectstore("name"); var request = objectstore.opencursor(); request.onsuccess = function(event) { var cursor = ...
IDBObjectStore.openKeyCursor() - Web APIs
lue an idbrequest object on which subsequent events related to this operation are fired. exceptions this method may raise a domexception of one of the following types: exception description invalidstateerror this idbobjectstore or idbindex has been deleted. transactioninactiveerror this idbobjectstore's transaction is inactive. dataerror the
specified key or key range is invalid. example in this simple fragment we create a transaction, retrieve an object store, then use a cursor to iterate through all the records in the object store: var transaction = db.transaction("name", "readonly"); var objectstore = transaction.objectstore("name"); var request = objectstore.openkeycursor(); request.onsuccess = function(event) { var cursor...
IDBObjectStore.put() - Web APIs
yield a valid key. the key parameter was provided but does not contain a valid key. invalidstateerror the idbobjectstore has been deleted or removed. datacloneerror the data being stored could not be cloned by the internal structured cloning algorithm. parameters value the value to be stored. key the key to use to identify the record. if un
specified, it results to null. if the object store has a key generator (e.g. autoincrement) the key of the object must be passed in to update the object. example the following example requests a given record title; when that request is successful the onsuccess function gets the associated record from the idbobjectstore (made available as objectstoretitlerequest.result), updates one property of the recor...
IDBRequest.error - Web APIs
d record back into the object store. also included at the bottom is an onerror function that reports what the error was if the request fails. ...
IIRFilterNode.getFrequencyResponse() - Web APIs
the getfrequencyresponse() method of the iirfilternode interface takes the current filtering algorithm's settings and calculates the frequency response for frequencies
specified in a
specified array of frequencies. the two output arrays, magresponseoutput and phaseresponseoutput, must be created before calling this method; they must be the same size as the array of input frequency values (frequencyarray). syntax iirfilternode.getfrequencyresponse(frequencyarray, magresponseoutput, phaseresponseoutput); parameters frequencyarray a float32array containing an array of frequencies,
specified in hertz, which you want to filter. magresponseoutput a float32array to receive the computed magnitudes of the freqency response for each frequency value in the frequencyarray. phaseresponseoutput a...
IdleDeadline.didTimeout - Web APIs
if didtimeout is true, the idledeadline object's timeremaining() method will return approximately 0. idle callbacks support the concept of a timeout in order to ensure that whatever task they're meant to perform actually happens, even if the user agent never has enough idle time available. ...
IdleDeadline - Web APIs
he user agent estimates it will remain idle and a property, didtimeout, which lets you determine if your callback is executing because its timeout duration expired. to learn more about how request callbacks work, see collaborative scheduling of background tasks. properties idledeadline.didtimeout read only a boolean whose value is true if the callback is being executed because the timeout
specified when the idle callback was installed has expired. methods idledeadline.timeremaining() returns a domhighrestimestamp, which is a floating-point value providing an estimate of the number of milliseconds remaining in the current idle period. if the idle period is over, the value is 0. your callback can call this repeatedly to see if there's enough time left to do more work before returning. ...
ImageCapture() constructor - Web APIs
tor creates a new imagecapture object. syntax const imagecapture = new imagecapture(videotrack) parameters videotrack a mediastreamtrack from which the still images will be taken. this can be any source, such as an incoming stream of a video conference, a playing movie, or the stream from a webcam. return value a new imagecapture object which can be used to capture still frames from the
specified video track. example the following example shows how to use a call to mediadevices.getusermedia() to retrieve the mediastreamtrack needed by the imagecapture() constructor. navigator.mediadevices.getusermedia({video: true}) .then(mediastream => { document.queryselector('video').srcobject = mediastream const track = mediastream.getvideotracks()[0]; imagecapture = new imagecapture...
IndexedDB API - Web APIs
s over object stores and indexes. idbcursorwithvalue iterates over object stores and indexes and returns the cursor's current value. idbkeyrange defines a key range that can be used to retrieve data from a database in a certain range. idblocaleawarekeyrange defines a key range that can be used to retrieve data from a database in a certain range, sorted according to the rules of the locale
specified for a certain index (see createindex()'s optionalparameters.). this interface isn't part of the 2.0 specification. custom event interfaces this specification fires events with the following custom interface: idbversionchangeevent the idbversionchangeevent interface indicates that the version of the database has changed, as the result of an idbopendbrequest.onupgradeneeded event handler fun...
compareVersion - Web APIs
it is often used as a check against which to initiate the installation process. if registryname is not found in the client version registry or if registryname does not have version, registryname is assumed to have a version of 0.0.0.0. if registryname represents a file, compareversion checks for the existence of the file. if the file has been deleted, its version is assumed to be 0.0.0.0...
IntersectionObserver.observe() - Web APIs
the intersectionobserver method observe() adds an element to the set of target elements being watched by the intersectionobserver. one observer has one set of thresholds and one root, but can watch multiple target elements for visibility changes in keeping with those. to stop observing the element, call intersectionobserver.unobserve(). when the visibility of the
specified element crosses over one of the observer's visibility thresholds (as listed in intersectionobserver.thresholds), the observer's callback is executed with an array of intersectionobserverentry objects representing the intersection changes which occurred. note that this design allows multiple elements' intersection changes to be processed by a single call to the callback. syntax intersectionobserver.observe(targetelem...
IntersectionObserver.root - Web APIs
ment which is the observer's target. if the root is null, then the bounds of the actual document viewport are used. syntax var root = intersectionobserver.root; value a element or document object whose bounding box is used as the bounds of the viewport for the purposes of determining how much of the target element is visible. the intersection of this bounding rectangle, offset by any margins
specified in the options passed to the intersectionobserver() constructor, the target element's bounds, minus the bounds of every element or other object which overlaps the target element, is considered to be the visible area of the target element. if root is null, then the owning document is used as the root, and the bounds its viewport (that is, the visible area of the document) are used as the root bou...
IntersectionObserver.rootMargin - Web APIs
ionobserver.rootmargin; value a string, formatted similarly to the css margin property's value, which contains offsets for one or more sides of the root's bounding box. these offsets are added to the corresponding values in the root's bounding box before the intersection between the resulting rectangle and the target element's bounds. the string returned by this property may not match the one
specified when the intersectionobserver was instantiated. the browser is permitted to alter the values if rootmargin isn't
specified when the object was instantiated, it defaults to the string "0px 0px 0px 0px", meaning that the intersection will be computed between the root element's unmodified bounds rectangle and the target's bounds. the root element and root margin in intersection observer api descri...
IntersectionObserver.thresholds - Web APIs
the intersectionobserver interface's read-only thresholds property returns the list of intersection thresholds that was
specified when the observer was instantiated with intersectionobserver(). if only one threshold ratio was provided when instanitating the object, this will be an array containing that single value. see thresholds in intersection observer api to learn how thresholds work. syntax var thresholds = intersectionobserver.thresholds; value an array of intersection thresholds, originally
specified using the threshold property when instantiating the observer. if only one observer was
specified, without being in an array, this value is a one-entry array containing that threshold. regardless of the order your original threshold array was in, this one is always sorted in nume...
IntersectionObserver.unobserve() - Web APIs
return value undefined. example 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")); /* ... ...
IntersectionObserverEntry.rootBounds - Web APIs
syntax var rootbounds = intersectionobserverentry.rootbounds; value a domrectreadonly which describes the root intersection rectangle. for roots which are the document's viewport, this rectangle is the bounds rectangle of the entire document. otherwise, it's the bounds of the root element. ...
IntersectionObserverEntry.time - Web APIs
read-only time property is a domhighrestimestamp that indicates the time at which the intersection change occurred relative to the time at which the document was created. syntax var time = intersectionobserverentry.time; value a domhighrestimestamp which indicates the time at which the target element experienced the intersection change described by the intersectionobserverentry. the time is
specified in milliseconds since the creation of the containing document. example see timing element visibility with the intersection observer api for a complete example which uses the time property to track how long elements are visible to the user. specifications specification status comment intersection observerthe definition of 'intersectionobserverentry.time' in that specifi...
MediaKeySession - Web APIs
.close() returns a promise after notifying the current media session is no longer needed and that the cdm should release any resources associated with this object and close it. mediakeysession.generaterequest() returns a promise after generating a media request based on initialization data. mediakeysession.load() returns a promise that resolves to a boolean value after loading data for a
specified session object. mediakeysession.remove() returns a promise after removing any session data associated with the current object. mediakeysession.update() returns a promise after loading messages and licenses to the cdm. examples // tbd specifications specification status comment encrypted media extensionsthe definition of 'mediakeysession' in that specification. ...
MediaPositionState.playbackRate - Web APIs
tate.playbackrate; value a floating-point value specifying a multiplier corresponding to the current relative rate at which the media being performed is playing. a value of 1.0 indicates the media is playing forward at normal speed, while higher values indicate that the media is being played faster than normal. lower values indicate the media is being played more slowly. negative values can be
specified to indicate the media is playing in reverse, with decreasing values then indicating faster and faster reverse playback. note: a value of 0.0 is not permitted. example in this example, an app is updating the browser to let it know that the user has clicked a button causing the playback to shift to a double-speed mode. it begins by creating a mediapositionstate object, then submits it to the b...
MediaQueryList - Web APIs
s from its parent interface, eventtarget. addlistener() adds to the mediaquerylist a callback which is invoked whenever the media query status—whether or not the document matches the media queries in the list—changes. this method exists primarily for backward compatibility; if possible, you should instead use addeventlistener() to watch for the change event. removelistener() removes the
specified listener callback from the callbacks to be invoked when the mediaquerylist changes media query status, which happens any time the document switches between matching and not matching the media queries listed in the mediaquerylist. this method has been kept for backward compatibility; if possible, you should generally use removeeventlistener() to remove change notification callbacks (which should h...
MediaRecorder.audioBitsPerSecond - Web APIs
syntax var audiobitspersecond = mediarecorder.audiobitspersecond value a number (unsigned long). specifications specification status comment mediastream recordingthe definition of 'audiobitspersecond' in that specification. working draft initial definition. browser compatibility the compatibility table in this page is generated from structured data. ...
MediaRecorder.isTypeSupported - Web APIs
the mediarecorder.istypesupported() static method returns a boolean which is true if the mime type
specified is one the user agent should be able to successfully record. syntax var canrecord = mediarecorder.istypesupported(mimetype) parameters mimetype the mime media type to check. return value true if the mediarecorder implementation is capable of recording blob objects for the
specified mime type. recording may still fail if there are insufficient resources to support the recording and encoding process. if the value is false, the user agent is incapable of recording the
specified format. example var types = ["video/webm", "audio/webm", "video/webm\;codecs=vp8", "video/webm\;codecs=daala", "video/webm\;codecs=h264", "aud...
MediaRecorder.mimeType - Web APIs
this is the file format of the file that would result from writing all of the recorded data to disk. keep in mind that not all codecs are supported by a given container; if you write media using a codec that is not supported by a given media container, the resulting file may not work reliably if at all when you try to play it back. see our media type and format guide for information about container and codec support across browsers. ...
MediaRecorder.onerror - Web APIs
order.ondataavailable = function(event) { bufferlist.push(event.data); }; recorder.onerror = function(event) { let error = event.error; switch(error.name) { case invalidstateerror: shownotification("you can't record the video right " + "now. ...
MediaRecorderErrorEvent.error - Web APIs
the specification. the descriptions here are generic ones; you'll find more specific ones to various scenarios in which they may occur in the corresponding method references. invalidstateerror an operation was attempted in a context in which it isn't allowed, or a request has been made on an object that's deleted or removed. notsupportederror a mediarecorder couldn't be created because the
specified options weren't valid. the message atttribute should provide additional information, if it exists. securityerror the mediastream is configured to disallow recording. this may be the case, for example, with sources obtained using getusermedia() when the user denies permission to use an input device. this also happens when a mediastreamtrack within the stream is marked as isolated due to the pee...
MediaSession.setPositionState() - Web APIs
(statedict); parameters statedict optional an object conforming to the mediapositionstate dictionary, providing updated information about the playback position and speed of the document's ongoing media. if the object is empty, the existing playback state information is cleared. return value undefined. exceptions typeerror this error can occur in an array of circumstances: the
specified mediapositionstate object's duration is missing, negative, or null. position is missing or null, or is either negative or greater than duration. the playbackrate is zero. example in this example, a player for a non-standard media file format, written in javascript, uses setinterval() to establish a callback which fires once per second to refresh the position information by calling setp...
MediaSessionActionDetails.action - Web APIs
s being invoked for: nexttrack advances playback to the next track. pause pauses playback of the media. play begins (or resumes) playback of the media. previoustrack moves back to the previous track. seekbackward seeks backward through the media from the current position. seekforward seeks forward from the current position through the media. seekto moves the playback position to the
specified time within the media. skipad skips past the currently playing advertisement or commercial. this action may or may not be available, depending on the platform and user agent, or may be disabled due to subscription level or other circumstances. stop halts playback entirely. specifications specification status comment media session standardthe definition of 'mediasessi...
MediaSessionActionDetails.fastSeek - Web APIs
your handler should take steps to return as quickly as possible by skipping any steps of its operation which are only necessary when the seek operation is complete. once fastseek is false or not present, the repeating series of seekto actions is complete and you can finalize the state of your web app or content. ...
MediaSessionActionDetails.seekOffset - Web APIs
provide the number of seconds the seekforward and seekbackward actions should move the playback time by. syntax let mediasessionactiondetails = { seekoffset: deltatimeinseconds }; let deltatime = mediasessionactiondetails.seekoffset; value a floating-point value indicating the time delta in seconds by which to move the playback position relative to its current timestamp. if the offset isn't
specified, the user agent will choose an appropriate offset automatically. this is typically in the range of five to ten seconds. specifications specification status comment media session standardthe definition of 'mediasessionactiondetails.seekoffset' in that specification. draft initial definition. ...
MediaSource.addSourceBuffer() - Web APIs
t. the new sourcebuffer is also returned. syntax var sourcebuffer = mediasource.addsourcebuffer(mimetype); parameters mimetype a domstring specifying the mime type of the sourcebuffer to create and add to the mediasource. return value a sourcebuffer object representing the new source buffer that has been created and added to the media source. exceptions invalidaccesserror the value
specified for mimetype is an empty string rather than a valid mime type. invalidstateerror the mediasource is not in the "open" readystate. notsupportederror the
specified mimetype isn't supported by the user agent, or is not compatible with the mime types of other sourcebuffer objects that are already included in the media source's sourcebuffers list. quotaexceedederror the user agent can't handle a...
MediaSource.isTypeSupported() - Web APIs
the mediasource.istypesupported() static method returns a boolean value which is true if the given mime type is likely to be supported by the current user agent. that is, if it can successfully create sourcebuffer objects for that mime type. if the returned value is false, then the user agent is certain that it cannot access media of the
specified format. syntax var isitsupported = mediasource.istypesupported(mimetype); parameters mimetype the mime media type that you want to test support for in the current browser. this may include the codecs parameter to provide added details about the codecs used within the file. return value a boolean which is true if the browser feels that it can probably play media of the
specified type. this is not a guarantee, however, and your code must be prepa...
MediaStream() - Web APIs
otherwise, the stream has no tracks. syntax newstream = new mediastream(); newstream = new mediastream(stream); newstream = new mediastream(tracks[]); parameters stream a different mediastream object whose tracks are added to the newly-created stream automatically. the tracks are not removed from the original stream, so they're shared by the two streams. ...
MediaStream.onaddtrack - Web APIs
. the addtrack event does not get fired when javascript code explicitly adds tracks to the stream (by calling addtrack()). syntax mediastream.onaddtrack = eventhandler; value this should be set to a function which you provide that accepts as input a mediastreamtrackevent object representing the addtrack event which has occurred. the mediastreamtrack representing the track which was added is
specified in the event's track property. example this example adds a listener which, when a new track is added to the stream, appends a new item to a list of tracks; the new item shows the track's kind ("audio" or "video") and label. stream.onaddtrack = function(event) { let tracklist = document.getelementbyid("tracks"); let label = document.createelement("li"); label.innerhtml = event.track.kind...
MediaStream.onremovetrack - Web APIs
event does not get fired when javascript code explicitly removes tracks from the stream (by calling removetrack()). syntax mediastream.onremovetrack = eventhandler; value this should be set to a function which you provide that accepts as input a mediastreamtrackevent object representing the removetrack event which has occurred. the mediastreamtrack representing the track which was removed is
specified in the event's track property. example this example adds a listener which, when a track is removed from the stream, logs the track that was removed. stream.onremovetrack = function(event) { let tracklist = document.getelementbyid("tracks"); let label = document.createelement("li"); label.innerhtml = "removed: " + event.track.kind + ": " + event.track.label; tracklist.appendchild(label...
MediaStream - Web APIs
the mediastream interface represents a stream of media content. a stream consists of several tracks such as video or audio tracks. each track is
specified as an instance of mediastreamtrack.you can obtain a mediastream object either by using the constructor or by calling mediadevices.getusermedia(). some user agents subclass this interface to provide more precise information or functionality, like in canvascapturemediastream. constructor mediastream() creates and returns a new mediastream object. you can create an empty stream, a stream which is based upon an existing stream, or a stream that contains a
specified list of tracks (
specified as an array of mediastreamtrack objects). properties this interface inherits properties from its parent, eventtarget. mediastream.active read only ...
MediaStreamAudioSourceNode() - Web APIs
text you want the node to be associated with. options a mediastreamaudiosourceoptions object defining the properties you want the mediastreamaudiosourcenode to have: mediastream a required property which specifies the mediastream from which to obtain audio for the node. return value a new mediastreamaudiosourcenode object representing the audio node whose media is obtained from the
specified source stream. exceptions invalidstateerror the
specified mediastream doesn't have any audio tracks. examples this example uses getusermedia() to obtain access to the user's camera, then creates a new mediastreamaudiosourcenode from its mediastream. // define variables var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // getusermedia block - grab stream // put it ...
MediaStreamAudioSourceNode.mediaStream - Web APIs
the mediastreamaudiosourcenode interface's read-only mediastream property indicates the mediastream that contains the audio track from which the node is receiving audio. this stream was
specified when the node was first created, either using the mediastreamaudiosourcenode() constructor or the audiocontext.createmediastreamsource() method. syntax audiosourcestream = mediastreamaudiosourcenode.mediastream; value a mediastream representing the stream which contains the mediastreamtrack serving as the source of audio for the node. the user agent uses the first audio track it finds on the
specified stream as the audio source for this node. however, there is no way to be certain which track that will be on multi-track streams. if the specific track matters to you, or you need to have access to the ...
MediaStreamTrack.getSettings() - Web APIs
returns a mediatracksettings object describing the current configuration of the track's constrainable properties. note: the returned object identifies the current values of every constrainable property, including those which are platform defaults rather than having been expressly set by the site's code. to instead fetch the most-recently established constraints for the track's properties, as
specified by the site's code, use getconstraints(). specifications specification status comment media capture and streamsthe definition of 'getsettings()' in that specification. candidate recommendation initial definition. ...
MediaStreamTrack - Web APIs
ata temporarily (such as when the network is experiencing a service malfunction). also available using the onmute event handler property. isolationchange sent whenever the value of the isolated property changes due to the document gaining or losing permission to access the track. also available through the onisolationchange event handler property. overconstrained sent when the constraints
specified 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. also available through the onunmute event handler property. specifications specification status comment identity for webrtcthe defin...
MediaStreamTrackAudioSourceNode - Web APIs
er than assuming the first audio track on a stream. number of inputs 0 number of outputs 1 channel count defined by the first audio mediastreamtrack passed to the audiocontext.createmediastreamtracksource() method that created it. constructor new mediastreamtrackaudiosourcenode() creates a new mediastreamtrackaudiosourcenode object instance with the
specified options. properties the mediastreamtrackaudiosourcenode interface has no properties of its own; however, it inherits the properties of its parent, audionode. methods inherits methods from its parent, audionode. example in this example, we grab a media (audio + video) stream from navigator.getusermedia, feed the media into a <video> element to play then mute the audio, but then also feed th...
MediaStreamTrackEvent - Web APIs
svg></div> a:hover text { fill: #0095dd; pointer-events: all;} the events based on this interface are addtrack and removetrack properties also inherits properties from its parent interface, event. track read only a mediastreamtrack object representing the track which was added to the stream. constructor mediastreamtrackevent() constructs a new mediastreamtrackevent with the
specified configuration. methods also inherits methods from its parent event. specifications specification status comment media capture and streamsthe definition of 'mediastreamtrackevent' in that specification. candidate recommendation ...
MediaTrackConstraints.aspectRatio - Web APIs
atio. the value is the width divided by the height and is rounded to ten decimal places. for example, the standard high-definition video aspect ratio of 16:9 can be computed as 1920/1080, or 1.7777777778. if this value is a number, the user agent will attempt to obtain media whose aspect ratio is as close as possible to this number given the capabilities of the hardware and the other constraints
specified. otherwise, the value of this constraindouble will guide the user agent in its efforts to provide an exact match to the required aspect ratio (if exact is
specified or both min and max are provided and have the same value) or to a best-possible value. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification s...
MediaTrackConstraints.autoGainControl - Web APIs
r with. automatic gain control is typically a feature provided by microphones, although it can be provided by other input sources as well. syntax var constraintsobject = { autogaincontrol: constraint }; constraintsobject.autogaincontrol = constraint; value if this value is a simple true or false, the user agent will attempt to obtain media with automatic gain control enabled or disabled as
specified, if possible, but will not fail if this can't be done. if, instead, the value is given as an object with an exact field, that field's boolean value indicates a required setting for the automatic gain control feature; if it can't be met, then the request will result in an error. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications ...
MediaTrackConstraints.channelCount - Web APIs
unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { channelcount: constraint }; constraintsobject.channelcount = constraint; value if this value is a number, the user agent will attempt to obtain media whose channel count is as close as possible to this number given the capabilities of the hardware and the other constraints
specified. otherwise, the value of this constrainlong will guide the user agent in its efforts to provide an exact match to the required channel count (if exact is
specified or both min and max are provided and have the same value) or to a best-possible value. the channel count is 1 for monaural sound, 2 for stereo, and so forth. example see example: constraint exerciser in capabilities, constraints, an...
MediaTrackConstraints.echoCancellation - Web APIs
iliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { echocancellation: constraint }; constraintsobject.echocancellation = constraint; value if this value is a simple true or false, the user agent will attempt to obtain media with echo cancellation enabled or disabled as
specified, if possible, but will not fail if this can't be done. if, instead, the value is given as an object with an exact field, that field's boolean value indicates a required setting for the echo cancellation feature; if it can't be met, then the request will result in an error. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications ...
MediaTrackConstraints.facingMode - Web APIs
, tracks associated with a webrtc rtcpeerconnection will never include this property. syntax var constraintsobject = { facingmode: constraint }; constraintsobject.facingmode = constraint; value an object based on constraindomstring specifying one or more acceptable, ideal, and/or exact (mandatory) facing modes are acceptable for a video track. an exact value in this case indicates that the
specified facing mode is specifically required; for example: var constraints = { facingmode: { exact: "user" } }; this indicates that only a user-facing camera is acceptable; if there is no user-facing camera, or the user declines permission to use that camera, the media request will fail. the following strings are permitted values for the facing mode. these may represent separate cameras, or they may...
MediaTrackConstraints.frameRate - Web APIs
object = { framerate: constraint }; constraintsobject.framerate = constraint; value a constraindouble describing the acceptable or required value(s) for a video track's frame rate, in frames per second. if this value is a number, the user agent will attempt to obtain media whose frame rate is as close as possible to this number given the capabilities of the hardware and the other constraints
specified. otherwise, the value of this constraindouble will guide the user agent in its efforts to provide an exact match to the required frame rate (if exact is
specified or both min and max are provided and have the same value) or to a best-possible value. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification sta...
MediaTrackConstraints.height - Web APIs
typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { height: constraint }; constraintsobject.height = constraint; value if this value is a number, the user agent will attempt to obtain media whose height is as close as possible to this number given the capabilities of the hardware and the other constraints
specified. otherwise, the value of this constrainlong will guide the user agent in its efforts to provide an exact match to the required height (if exact is
specified or both min and max are provided and have the same value) or to a best-possible value. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status ...
MediaTrackConstraints.noiseSuppression - Web APIs
they're unfamiliar with. noise suppression is typically provided by microphones, although it can be provided by other input sources as well. syntax var constraintsobject = { noisesuppression: constraint }; constraintsobject.noisesuppression = constraint; value if this value is a simple true or false, the user agent will attempt to obtain media with noise suppression enabled or disabled as
specified, if possible, but will not fail if this can't be done. if, instead, the value is given as an object with an exact field, that field's boolean value indicates a required setting for the noise suppression feature; if it can't be met, then the request will result in an error. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications ...
MediaTrackConstraints.sampleRate - Web APIs
is is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { samplerate: constraint }; constraintsobject.samplerate = constraint; value if this value is a number, the user agent will attempt to obtain media whose sample rate is as close as possible to this number given the capabilities of the hardware and the other constraints
specified. otherwise, the value of this constrainlong will guide the user agent in its efforts to provide an exact match to the required sample rate (if exact is
specified or both min and max are provided and have the same value) or to a best-possible value. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification stat...
MediaTrackConstraints.sampleSize - Web APIs
sers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { samplesize: constraint }; constraintsobject.samplesize = constraint; value if this value is a number, the user agent will attempt to obtain media whose sample size (in bits per linear sample) is as close as possible to this number given the capabilities of the hardware and the other constraints
specified. otherwise, the value of this constrainlong will guide the user agent in its efforts to provide an exact match to the required sample size (if exact is
specified or both min and max are provided and have the 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. ...
MediaTrackControls.volume - Web APIs
ect.volume = constraint; value a constraindouble describing the acceptable or required value(s) for an audio track's volume, on a linear scale where 0.0 means silence and 1.0 is the highest supported volume. if this value is a number, the user agent will attempt to obtain media whose volume is as close as possible to this number given the capabilities of the hardware and the other constraints
specified. otherwise, the value of this constraindouble will guide the user agent in its efforts to provide an exact match to the required volume (if exact is
specified or both min and max are provided and have the same value) or to a best-possible value. any constraint set which only permits values outside the range 0.0 to 1.0 cannot be satisfied and will result in failure. example see example: constra...
MediaTrackConstraints.width - Web APIs
er, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var constraintsobject = { width: constraint }; constraintsobject.width = constraint; value if this value is a number, the user agent will attempt to obtain media whose width is as close as possible to this number given the capabilities of the hardware and the other constraints
specified. otherwise, the value of this constrainlong will guide the user agent in its efforts to provide an exact match to the required width (if exact is
specified or both min and max are provided and have the same value) or to a best-possible value. example see example: constraint exerciser in capabilities, constraints, and settings for an example. specifications specification status ...
MediaTrackConstraints - Web APIs
. allowed values are none and crop-and-scale. none means that the user agent uses the resolution provided by the camera, its driver or the os. crop-and-scale means that the user agent can use cropping and downscaling on the camera output in order to satisfy other constraints that affect the resolution. properties of shared screen tracks these constraints apply to mediatrackconstraints objects
specified as part of the displaymediastreamconstraints object's video property when using getdisplaymedia() to obtain a stream for screen sharing. cursor a constraindomstring which specifies whether or not to include the mouse cursor in the generated track, and if so, whether or not to hide it while not moving. the value may be a single one of the following strings, or an array of them to allow the b...
MediaTrackSettings.aspectRatio - Web APIs
the mediatracksettings dictionary's aspectratio property is a double-precision floating-point number indicating the aspect ratio of the mediastreamtrack as currently configured. this lets you determine what value was selected to comply with your
specified constraints for this property's value as described in the mediatrackconstraints.aspectratio property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.aspectratio as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var aspectratio = mediatracksetti...
MediaTrackSettings.autoGainControl - Web APIs
the mediatracksettings dictionary's autogaincontrol property is a boolean value whose value indicates whether or not automatic gain control (agc) is enabled on an audio track. this lets you determine what value was selected to comply with your
specified constraints for this property's value as described in the mediatrackconstraints.autogaincontrol property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). automatic gain control is a feature in which a sound source automatically manages changes in the volume of its source media to maintain a steady overall volume level. this feature is typically used on microphones, although it can be provided by other input sources as well. if needed, you can determine whether or not this constraint is supported by checking ...
MediaTrackSettings.channelCount - Web APIs
the mediatracksettings dictionary's channelcount property is an integer indicating how many audio channel the mediastreamtrack is currently configured to have. this lets you determine what value was selected to comply with your
specified constraints for this property's value as described in the mediatrackconstraints.channelcount property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.channelcount as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var channelcount = mediatracksettings.channelcoun...
MediaTrackSettings.deviceId - Web APIs
the mediatracksettings dictionary's deviceid property is a domstring which uniquely identifies the source for the corresponding mediastreamtrack for the origin corresponding to the browsing session. this lets you determine what value was selected to comply with your
specified constraints for this property's value as described in the mediatrackconstraints.deviceid property you provided when calling either getusermedia(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.deviceid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated w...
MediaTrackSettings.echoCancellation - Web APIs
the mediatracksettings dictionary's echocancellation property is a boolean value whose value indicates whether or not echo cancellation is enabled on an audio track. this lets you determine what value was selected to comply with your
specified constraints for this property's value as described in the mediatrackconstraints.echocancellation property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). echo cancellation is a feature which attempts to prevent echo effects on a two-way audio connection by attempting to reduce or eliminate crosstalk between the user's output device and their input device. for example, it might apply a filter that negates the sound being produced on the speakers from being included in the input track generated from the microphone. if ...
MediaTrackSettings.facingMode - Web APIs
the mediatracksettings dictionary's facingmode property is a domstring indicating the direction in which the camera producing the video track represented by the mediastreamtrack is currently facing. this lets you determine what value was selected to comply with your
specified constraints for this property's value as described in the mediatrackconstraints.facingmode property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.facingmode as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't in...
MediaTrackSettings.frameRate - Web APIs
the mediatracksettings dictionary's framerate property is a double-precision floating-point number indicating the frame rate, in frames per second, of the mediastreamtrack as currently configured. this lets you determine what value was selected to comply with your
specified constraints for this property's value as described in the mediatrackconstraints.framerate property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.framerate as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var framerate = me...
MediaTrackSettings.groupId - Web APIs
the mediatracksettings dictionary's groupid property is a browsing-session unique domstring which identifies the group of devices which includes the source for the mediastreamtrack. this lets you determine what value was selected to comply with your
specified constraints for this property's value as described in the mediatrackconstraints.groupid property you provided when calling either getusermedia(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.groupid as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. because rtp doesn't include this information, tracks associated with a webrtc rtcpee...
MediaTrackSettings.height - Web APIs
the mediatracksettings dictionary's height property is an integer indicating the number of pixels tall mediastreamtrack is currently configured to be. this lets you determine what value was selected to comply with your
specified constraints for this property's value as described in the mediatrackconstraints.height property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.height as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var height = mediatracksettings.height; value an integer value indi...
MediaTrackSettings.noiseSuppression - Web APIs
the mediatracksettings dictionary's noisesuppression property is a boolean value whose value indicates whether or not noise suppression technology is enabled on an audio track. this lets you determine what value was selected to comply with your
specified constraints for this property's value as described in the mediatrackconstraints.noisesuppression property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). noise suppression automatically filters the audio to remove background noise, hum caused by equipment, and the like from the sound before delivering it to your code. this feature is typically used on microphones, although it is technically possible it could be provided by other input sources as well. if needed, you can determine whether or not this constr...
MediaTrackSettings.sampleRate - Web APIs
the mediatracksettings dictionary's samplerate property is an integer indicating how many audio samples per second the mediastreamtrack is currently configured for. this lets you determine what value was selected to comply with your
specified constraints for this property's value as described in the mediatrackconstraints.samplerate property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.samplerate as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var samplerate = mediatracksettings.samplerate; ...
MediaTrackSettings.sampleSize - Web APIs
the mediatracksettings dictionary's samplesize property is an integer indicating the linear sample size (in bits per sample) the mediastreamtrack is currently configured for. this lets you determine what value was selected to comply with your
specified constraints for this property's value as described in the mediatrackconstraints.samplesize property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.samplesize as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var samplesize = mediatracksettings.sa...
MediaTrackSettings.volume - Web APIs
the mediatracksettings dictionary's volume property is a double-precision floating-point number indicating the volume of the mediastreamtrack as currently configured, as a value from 0.0 (silence) to 1.0 (maximum supported volume for the device). this lets you determine what value was selected to comply with your
specified constraints for this property's value as described in the mediatrackconstraints.volume property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.volume as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they'r...
MediaTrackSettings.width - Web APIs
the mediatracksettings dictionary's width property is an integer indicating the number of pixels wide mediastreamtrack is currently configured to be. this lets you determine what value was selected to comply with your
specified constraints for this property's value as described in the mediatrackconstraints.width property you provided when calling either getusermedia() or mediastreamtrack.applyconstraints(). if needed, you can determine whether or not this constraint is supported by checking the value of mediatracksupportedconstraints.width as returned by a call to mediadevices.getsupportedconstraints(). however, typically this is unnecessary since browsers will simply ignore any constraints they're unfamiliar with. syntax var width = mediatracksettings.width; value an integer value indicatin...
MediaTrackSettings - Web APIs
this value would be 16 in that case. volume a double-precision floating point value indicating the current value of the volume property, specifying the volume level of the track. this value will be between 0.0 (silent) to 1.0 (maximum supported volume). properties of video tracks 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-definition widescreen aspect ratio), and 1.6 (for the 16:10 aspect ratio common among widescreen computers and tablets). fac...
MediaTrackSupportedConstraints - Web APIs
ionary establishes the list of constrainable properties recognized by the user agent or browser in its implementation of the mediastreamtrack object. an object conforming to mediatracksupportedconstraints is returned by mediadevices.getsupportedconstraints(). because of the way interface definitions in webidl work, if a constraint is requested but not supported, no error will occur. instead, the
specified constraints will be applied, with any unrecognized constraints stripped from the request.that can lead to confusing and hard to debug errors, so be sure to use getsupportedconstraints() to retrieve this information before attempting to establish constraints if you need to know the difference between silently ignoring a constraint and a constraint being accepted. an actual constraint set is descr...
Media Source API - Web APIs
y() method. trackdefault provides a sourcebuffer with kind, label, and language information for tracks that do not contain this information in the initialization segments of a media chunk. trackdefaultlist a simple container list for multiple trackdefault objects. extensions to other interfaces url.createobjecturl() creates an object url pointing to a mediasource object that can then be
specified as the src value of an html media element to play a media stream. htmlmediaelement.seekable when a mediasource object is played by an html media element, this property will return a timeranges object that contains the time ranges that the user is able to seek to. htmlvideoelement.getvideoplaybackquality() returns a videoplaybackquality object for the currently played video. audiotrack.source...
MerchantValidationEvent() - Web APIs
validationurl optional the url from which to retrieve payment handler specific verification information used to validate the merchant. this is an empty string by default. return value a newly-created merchantvalidationevent providing the information that needs to be delivered to the client-side code to present to the user agent by calling complete(). exceptions typeerror the string
specified as validationurl could not be parsed as a url. rangeerror the
specified methodname does not correspond to a known and supported merchant or is not a well-formed standard payment method identifier. specifications specification status comment payment request apithe definition of 'merchantvalidationevent()' in that specification. candidate recommendation initial de...
MerchantValidationEvent - Web APIs
specifying a url from which the site or app can fetch payment handler specific validation information. once this data is retrieved, the data (or a promise resolving to the validation data) should be passed into complete() to validate that the payment request is coming from an authorized merchant. methods merchantvalidationevent.complete() secure context pass the data retrieved from the url
specified by validationurl into complete() to complete the validation process for the paymentrequest. specifications specification status comment payment request apithe definition of 'merchantvalidationevent' in that specification. candidate recommendation initial definition. ...
MimeTypeArray - Web APIs
the mimetypearray interface returns an array of mimetype instances, each of which contains information about a supported browser plugins. this object is returned by navigatorplugins.mimetypes. properties mimetypearray.length the number of items in the array. methods mimetypearray.item() returns the mimetype object with the
specified index. mimetypearray.nameditem() returns the mimetype object with the
specified name. example the following example tests whether a plugin is available for the application/pdf mime type and if so, which plugin that is. var mimetypes = navigator.mimetype; var flashplugin = mimetypes['video/x-flv']; if (typeof flashplugin === "undefined") { var vid = document.createelement('video'); // use vid.canplaytype() to test for a supported mime type. } else...
MouseEvent.getModifierState() - Web APIs
see the document of keyboardevent.getmodifierstate() for details. syntax var active = event.getmodifierstate(keyarg); returns a boolean parameters keyarg a modifier key value. the value must be one of the keyboardevent.key values which represent modifier keys or "accel". this is case-sensitive. ...
MouseEvent - Web APIs
read only alias for mouseevent.clienty constants mouseevent.webkit_force_at_mouse_down 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...
MutationObserver - Web APIs
the mutationobserver interface provides the ability to watch for changes being made to the dom tree. it is designed as a replacement for the older mutation events feature, which was part of the dom3 events specification. constructor mutationobserver() creates and returns a new mutationobserver which will invoke a
specified callback function when dom changes occur. methods disconnect() stops the mutationobserver instance from receiving further notifications until and unless observe() is called again. observe() configures the mutationobserver to begin receiving notifications through its callback function when dom changes matching the given options occur. takerecords() removes all pending notifications from the mutationobserver's notification queue and returns them in a new array of mu...
MutationObserverInit.attributeOldValue - Web APIs
t of mutationrecord objects. for any items representing an attribute change (which can be detected by the value of mutationrecord.type being "attributes"), a function called notifyuser() is used to tell the user the name of the attribute that changed as well as the attribute's new value (mutation.target[mutation.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 definition of 'mutationobserverinit.attributeoldvalue' in that specification. living standard ...
MutationObserverInit.characterData - Web APIs
tmlelement, 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. if true, the callback
specified when observe() was used to start observing the node or subtree is called any time the contents of a text node are changed. you can expand the capabilities of attribute mutation monitoring using other options: characterdataoldvalue lets you specify whether or not you want the previous value of changed text nodes to be provided using the mutationrecord's oldvalue property. subtree lets you spe...
MutationObserverInit.characterDataOldValue - Web APIs
ed on the text, processinginstruction, and comment interfaces. syntax var options = { characterdataoldvalue: true | false } value a boolean value indicating whether or not to set the mutationrecord's oldvalue property to be a string containing the value of the character node's contents prior to the change represented by the mutation record. by default, only changes to the text of the node
specified 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 de...
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.. ...
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. for example, to watch the target node only for attribute changes, the mutationobserverinit passed into mutationobserver() can be: var options = { attributes: true, sub...
NDEFMessage - Web APIs
the ndefmessage interface of the web nfc api is an abstract interface that represents message that can be received or sent to a to compatible nfc devices, e.g. nfc tags supporting ndef. constructor ndefmessage.ndefmessage() returns a new ndefmessage containing
specified data. attributes ndefmessage.records read only represents a list of ndef records defining the ndef message. specifications specification status comment web nfc, ndefmessage draft initial definition. ...
NDEFReader - Web APIs
the ndefreader interface of the web nfc api is an abstract interface used to read data from compatible nfc devices, e.g. nfc tags supporting ndef, when these devices are within the reader's magnetic induction field. constructor ndefreader.ndefreader() returns an ndefreader with configuration
specified in the parameters or default ones if no parameters are
specified. properties in addition to the properties listed below, ndefreader inherits properties from its parent interface, eventtarget. ndefreader.onreading an event handler for reading event, that notifies about availability of a new reading. ndefreader.onerror an event handler for error event which is called to notify that an error occured during reading. methods the ndefreader interface inherits the methods of event...
NDEFWriter.write() - Web APIs
syntax var sessionpromise = ndefwriter.write(message, options); parameters message the message to be written, either domstring or buffersource or ndefmessageinit. options optional ignoreread -- boolean specifying whether or not to skip reading for the activated reader objects. will be ignored if overwrite is false. overwrite -- boolean specifying whether or not existing record should be overwritten, if such exists. signal -- optional abortsignal that allows to cancell this write operation. return value a promise that resolves with undefined when and if the message transfer is successfully completed. ...
Navigator.doNotTrack - Web APIs
the navigator.donottrack property returns the user's do not track setting, which indicates whether the user is requesting web sites and advertisers to not track them. the value of the property reflects that of the dnt http header, i.e. values of "1", "0", or "un
specified". example console.log(navigator.donottrack); // prints "1" if dnt is enabled; "0" if the user opted-in for tracking; otherwise this is "un
specified" specifications specification status comment tracking preference expression (dnt)the definition of 'navigator.donottrack' in that specification. obsolete initial definition ...
Navigator.requestMediaKeySystemAccess() - Web APIs
er function. the fulfillment handler receives as input just one parameter: mediakeysystemaccess a mediakeysystemaccess object representing the media key system configuration described by keysystem and supportedconfigurations exceptions in case of an error, the returned promise is rejected with a domexception whose name indicates what kind of error occurred. notsupportederror either the
specified keysystem isn't supported by the platform or the browser, or none of the configurations
specified by supportedconfigurations can be satisfied (if, for example, none of the codecs
specified in contenttype are available). typeerror either keysystem is an empty string or the supportedconfigurations array is empty. specifications specification status comment encrypted med...
Node.baseURI - Web APIs
s to obtain an absolute url, for example when processing the html <img> element's src attribute or xml xlink:href attribute. in most cases the base url is simply the location of the document, but it can be affected by many factors, including the <base> element in html and the xml:base attribute in xml. syntax var nodebaseuri = node.baseuri; value a domstring representing the base url of the
specified node. it may be null if unable to obtain an absolute uri. although this property is read-only, its value may change in certain situations (see below). details the base url of a document the base url of a document defaults to the document's address (as displayed by the browser and available in window.location), but it can be changed: when an html <base> tag is found in the document when the...
Node.insertBefore() - Web APIs
the node.insertbefore() method inserts a node before a reference node as a child of a
specified parent node. if the given node already exists in the document, insertbefore() moves it from its current position to the new position. (that is, it will automatically be removed from its existing parent before appending it to the
specified new parent.) this means that a node cannot be in two locations of the document simultaneously. note: the node.clonenode() can be used to make a copy of the node before appending it under the new parent. note that the copies made with clonenode() will not be automatically kept in sync. if the given child is a documentfragment, the entire contents of the documentfragment are moved into the child list of the
specified parent node. syntax let insertednode = parent...
Node.isSupported() - Web APIs
tring containing the name of the feature to test. this is the same name which can be passed to the method hasfeature on domimplementation. possible values defined within the core dom specification are listed on the dom level 2 conformance section. version is a domstring containing the version number of the feature to test. in dom level 2, version 1, this is the string 2.0. if the version is not
specified, supporting any version of the feature will cause the method to return true. example <div id="doc"> </div> <script> // get an element and check to see if its supports the dom2 html module. var main = document.getelementbyid('doc'); var output = main.issupported('html', '2.0'); </script> specifications specification status comment document object model (dom) l...
Node.namespaceURI - Web APIs
amespace uri of a node is frozen at the node creation time. in firefox 3.5 and earlier, the namespace uri for html elements in html documents is null. in later versions, in compliance with html5, it is https://www.w3.org/1999/xhtml as in xhtml. for nodes of any node.nodetype other than element_node and attribute_node the value of namespaceuri is always null. you can create an element with the
specified namespaceuri using the dom level 2 method document.createelementns and attributes with the method element.setattributens. per the namespaces in xml specification, an attribute does not inherit its namespace from the element it is attached to. if an attribute is not explicitly given a namespace, it has no namespace. the dom does not handle or enforce namespace validation per se. it is up to the ...
Node.nextSibling - Web APIs
syntax nextnode = node.nextsibling notes gecko-based browsers insert text nodes into a document to represent whitespace in the source markup. therefore a node obtained, for example, using 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. ...
Node.normalize() - Web APIs
in a normalized sub-tree, no text nodes in the sub-tree are empty and there are no adjacent text nodes. ...
Node.parentNode - Web APIs
syntax parentnode = node.parentnode parentnode is the parent of the current node. the parent of an element is an element node, a document node, or a documentfragment node. example if (node.parentnode) { // remove a node from the tree, unless // it's not in the tree already node.parentnode.removechild(node); } notes document and documentfragment nodes can never have a parent, so parentnode will always return null. it also returns null if the node has just been created and is not yet attached to the tree. ...
Node.prefix - Web APIs
in dom4 this api was moved from node to the element and attr interfaces. syntax string = node.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. specifications specification status comment document object model (dom) level 3 core specificationthe definition of 'node.prefix' in that specification. obsolete specifies the behavior when it's set to null. ...
Node.previousSibling - Web APIs
syntax previousnode = node.previoussibling; example <img id="b0"> <img id="b1"> <img id="b2"> console.log(document.getelementbyid("b1").previoussibling); // <img id="b0"> console.log(document.getelementbyid("b2").previoussibling.id); // "b1" notes gecko-based browsers insert text nodes into a document to represent whitespace in the source markup. ...
NodeIterator.nextNode() - Web APIs
the nodeiterator.nextnode() method returns the next node in the set represented by the nodeiterator and advances the position of the iterator within the set. the first call to nextnode() returns the first node in the set. this method returns null when there are no nodes left in the set. in old browsers, as
specified in old versions of the specifications, the method may throws the invalid_state_err domexception if this method is called after the nodeiterator.detach()method. recent browsers never throw. syntax node = nodeiterator.nextnode(); example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false // this optional argument is not used any more ); currentnode = nod...
NodeIterator.referenceNode - Web APIs
the nodeiterator.referencenode read-only returns the node to which the iterator is anchored; as new nodes are inserted, the iterator remains anchored to the reference node as
specified by this property. syntax node = nodeiterator.referencenode; example var nodeiterator = document.createnodeiterator( document.body, nodefilter.show_element, { acceptnode: function(node) { return nodefilter.filter_accept; } }, false ); node = nodeiterator.referencenode; specifications specification status comment domthe definition of 'nodeiterator.referencenode' in that specification. living standard initial definition. ...
NodeIterator - Web APIs
ist of the nodes in a subtree of the dom. the nodes will be returned in document order. syntax a nodeiterator can be created using the document.createnodeiterator() method, as follows: const nodeiterator = document.createnodeiterator(root, whattoshow, filter); properties this interface doesn't inherit any property. nodeiterator.root read only returns a node representing the root node as
specified when the nodeiterator was created. nodeiterator.whattoshow read only returns an unsigned long being a bitmask made of constants describing the types of node that must to be presented. non-matching nodes are skipped, but their children may be included, if relevant. the possible values are: constant numerical value description nodefilter.show_all -...
NonDocumentTypeChildNode.nextElementSibling - Web APIs
the nondocumenttypechildnode.nextelementsibling read-only property returns the element immediately following the
specified one in its parent's children list, or null if the
specified element is the last one in the list. syntax var nextnode = elementnodereference.nextelementsibling; example <div id="div-01">here is div-01</div> <div id="div-02">here is div-02</div> <script type="text/javascript"> var el = document.getelementbyid('div-01').nextelementsibling; console.log('siblings of div-01:'); while (el) { console.log(el.nodename); el = el.nextelementsibling; } </script> this example outputs the following into the console when it loads: siblings of div-01: div script polyfill for internet explorer 8 this property is unsupported prior to ie9, so the following snippet can b...
NonDocumentTypeChildNode.previousElementSibling - Web APIs
the nondocumenttypechildnode.previouselementsibling read-only property returns the element immediately prior to the
specified one in its parent's children list, or null if the
specified element is the first one in the list. syntax prevnode = elementnodereference.previouselementsibling; example <div id="div-01">here is div-01</div> <div id="div-02">here is div-02</div> <li>this is a list item</li> <li>this is another list item</li> <div id="div-03">here is div-03</div> <script> let el = document.getelementbyid('div-03').previouselementsibling; document.write('<p>siblings of div-03</p><ol>'); while (el) { document.write('<li>' + el.nodename + '</li>'); el = el.previouselementsibling; } document.write('</ol>'); </script> this example outputs the following into the page when ...
Notification.Notification() - Web APIs
ing any custom settings that you want to apply to the notification. the possible options are: dir: the direction in which to display the notification. it defaults to auto, which just adopts the browser's language setting behavior, but you can override that behaviour by setting values of ltr and rtl (although most browsers seem to ignore these settings.) lang: the notification's language, as
specified using a domstring representing a bcp 47 language tag. see the sitepoint iso 2 letter language codes page for a simple reference. badge: a usvstring containing the url of the image used to represent the notification when there isn't enough space to display the notification itself. body: a domstring representing the body text of the notification, which is displayed below the title. tag: a dom...
Notification.data - Web APIs
the notification's data can be any arbitrary data that you want associated with the notification. syntax var data = notification.data; value a structured clone. examples the following snippet fires a notification; a simple options object is created, then the notification is fired using the notification() constructor. ...
OscillatorNode - Web APIs
an oscillatornode is created using the baseaudiocontext.createoscillator() method. it always has exactly one output and no inputs. ...
PaintWorklet.registerPaint - Web APIs
erate an image where a css property expects a file. syntax registerpaint(name, class); parameters name the name of the worklet class to register. class a reference to the class that implements the worklet. return value undefined exceptions typeerror thrown when one of the arguments is invalid or missing. invalidmodificationerror thrown when the a worklet already exists with the
specified name. examples the following shows registering an example worklet module. this should be in a separate js file. note that registerpaint() is called without a reference to paintworklet. the file itself is loaded through css.paintworklet.addmodule() (documented here on the parent class of paintworklet, at worklet.addmodule(). /* checkboardworklet.js */ class checkerboardpainter { paint(ctx, ...
PannerNode.orientationX - Web APIs
ponent of the direction in which the audio source is facing, in a 3d cartesian coordinate space. the complete vector is defined by the position of the audio source, given as (positionx, positiony, positionz), and the orientation of the audio source (that is, the direction in which it's facing), given as (orientationx, orientationy, orientationz). depending on the directionality of the sound (as
specified using the attributes coneinnerangle, coneouterangle, and coneoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the listener, it will be louder than if the sound is pointed away from the listener. the audioparam contained by this property is read only; however, you can still change the value of the parameter ...
PannerNode.orientationY - Web APIs
rtical) component of the direction the audio source is facing, in 3d cartesian coordinate space. the complete vector is defined by the position of the audio source, given as (positionx, positiony, positionz), and the orientation of the audio source (that is, the direction in which it's facing), given as (orientationx, orientationy, orientationz). depending on the directionality of the sound (as
specified using the attributes coneinnerangle, coneouterangle, and codeoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the listener, it will be louder than if the sound is pointed away from the listener. the audioparam contained by this property is read only; however, you can still change the value of the parameter ...
PannerNode.orientationZ - Web APIs
(depth) component of the direction the audio source is facing, in 3d cartesian coordinate space. the complete vector is defined by the position of the audio source, given as (positionx, positiony, positionz), and the orientation of the audio source (that is, the direction in which it's facing), given as (orientationx, orientationy, orientationz). depending on the directionality of the sound (as
specified using the attributes coneinnerangle, coneouterangle, and codeoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the listener, it will be louder than if the sound is pointed away from the listener. the audioparam contained by this property is read only; however, you can still change the value of the parameter ...
PannerNode.positionX - Web APIs
ource's position in 3d cartesian coordinates, corresponding to the horizontal axis (left-right). the complete vector is defined by the position of the audio source, given as (positionx, positiony, positionz), and the orientation of the audio source (that is, the direction in which it's facing), given as (orientationx, orientationy, orientationz). depending on the directionality of the sound (as
specified using the attributes coneinnerangle, coneouterangle, and codeoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the listener, it will be louder than if the sound is pointed away from the listener. the audioparam contained by this property is read only; however, you can still change the value of the parameter ...
PannerNode.positionY - Web APIs
o source's position in 3d cartesian coordinates, corresponding to the vertical axis (top-bottom). the complete vector is defined by the position of the audio source, given as (positionx, positiony, positionz), and the orientation of the audio source (that is, the direction in which it's facing), given as (orientationx, orientationy, orientationz). depending on the directionality of the sound (as
specified using the attributes coneinnerangle, coneouterangle, and codeoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the listener, it will be louder than if the sound is pointed away from the listener. the audioparam contained by this property is read only; however, you can still change the value of the parameter ...
PannerNode.positionZ - Web APIs
n in 3d cartesian coordinates, corresponding to the depth axis (behind-in front of the listener). the complete vector is defined by the position of the audio source, given as (positionx, positiony, positionz), and the orientation of the audio source (that is, the direction in which it's facing), given as (orientationx, orientationy, orientationz). depending on the directionality of the sound (as
specified using the attributes coneinnerangle, coneouterangle, and codeoutergain), the orientation of the sound may alter the perceived volume of the sound as it's being played. if the sound is pointing toward the listener, it will be louder than if the sound is pointed away from the listener. the audioparam contained by this property is read only; however, you can still change the value of the parameter ...
PannerNode - Web APIs
ibute.) pannernode.setorientation() defines the direction the audio source is playing in. pannernode.setvelocity() defines the velocity vector of the audio source — how fast it is moving and in what direction. in a previous version of the specification, the pannernode had a velocity that could pitch up or down audiobuffersourcenodes connected 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...
ParentNode.append() - Web APIs
node.appendchild() returns the appended node object. parentnode.append() can append several nodes and strings, whereas node.appendchild() can only append one node. syntax // [throws, unscopable] parentnode.append(...nodesordomstrings) // returns undefined parameters nodes a set of node or domstring objects to insert. exceptions hierarchyrequesterror: node cannot be inserted at the
specified point in the hierarchy. examples appending an element let parent = document.createelement("div") let p = document.createelement("p") parent.append(p) console.log(parent.childnodes) // nodelist [ <p> ] appending text let parent = document.createelement("div") parent.append("some text") console.log(parent.textcontent) // "some text" appending an element and text let parent = document.cre...
ParentNode.prepend() - Web APIs
the parentnode.prepend() method inserts a set of node objects or domstring objects before the first child of the parentnode. domstring objects are inserted as equivalent text nodes. syntax parentnode.prepend(...nodestoprepend); parameters nodestoprepend one or more nodes to insert before the first child node currently in the parentnode. each node can be
specified as either a node object or as a string; strings are inserted as new text nodes. return value undefined. exceptions hierarchyrequesterror: node cannot be inserted at the
specified point in the hierarchy. examples prepending an element var parent = document.createelement("div"); var p = document.createelement("p"); var span = document.createelement("span"); parent.append(p); parent.prepend(span); console.log(parent.child...
ParentNode - Web APIs
s or domstring objects after the last child of the parentnode. domstring objects are inserted as equivalent text nodes. parentnode.prepend() inserts a set of node objects or domstring objects before the first child of the parentnode. domstring objects are inserted as equivalent text nodes. parentnode.queryselector() returns the first element with the current element as root 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 definition of 'parentnode' in...
PaymentAddress - Web APIs
fecture. paymentaddress.regioncode read only a domstring specifying the region of the address, represented as a "code element" of an iso3166-2 country subdivision name (e.g. "qld" for queensland, australia, "ca" for california, and so on). paymentaddress.sortingcode read only a domstring providing a postal sorting code such as is used in france. note: properties for which values were not
specified contain empty strings. obsolete properties the following properties are obsolete and should no longer be used, but may still be present in some browser versions. paymentaddress.languagecode read only a domstring indicating the language code of the address. this identifies the language in which the address is given, and is intended to aid in localization of the display of the address. ...
PaymentCurrencyAmount.currency - Web APIs
syntax currency = paymentcurrencyamount.currency; value a domstring specifying the canonical, three-character currency identification code defined by the iso 4217 standard. this is the currency in which the payment's value is given. all currency values must include the currency system in this property. example this example represents the price of $42.95 in us dollars. ...
PaymentItem - Web APIs
charge. properties amount secure context a paymentcurrencyamount object describing the monetary value of the item. label secure context a string specifying a human-readable name or description of the item or service being charged for. this may be displayed to the user by the user agent, depending on the design of the interface. pending secure context a boolean value which is true if the
specified amount has not yet been finalized. this can be used to show items such as shipping or tax amounts that depend upon the selection of shipping address, shipping option, or so forth. the user agent may show this information but is not required to do so. specifications specification status comment payment request apithe definition of 'paymentitem' in that specification. ...
PaymentMethodChangeEvent - Web APIs
ier 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 available or required. this is null by default. return value a newly-created paymentmethodchangeevent object describing a change to the options
specified for the 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 ap...
PaymentRequest: shippingoptionchange event - Web APIs
pping option. paymentrequest.addeventlistener("shippingoptionchange", event => { const value = calculatenewtotal(paymentrequest.shippingoption); const total = { currency: "eur", label: "total due", value, }; event.updatewith({ total }); }, false); after caling a custom function, calculatenewtotal(), to compute the updated total based on the newly-selected shipping option as
specified by the shippingoption. the revised total is submitted back to the payment request by calling the event's updatewith() method. you can also create an event handler for shippingoptionchange using its corresponding event handler property, onshippingoptionchange: paymentrequest.onshippingoptionchange = event => { const value = calculatenewtotal(paymentrequest.shippingoption); const total = { ...
PaymentRequest.show() - Web APIs
. the promise is also rejected with aborterror if the user cancels the payment request. invalidstateerror the promise rejects with an invalidstateerror if the same payment has already been shown for this request (its state is interactive because it is being shown already). notsupportederror the promise rejects with a notsupportederror if the user agent does not support the payment methods
specified when the paymentrequest constructor was called. securityerror the promise rejects with a securityerror if the call to show() was not in response to a user action, such as a click or keyup event. other reasons a securityerror may be thrown are at the discretion of the user agent, and may include situations such as too many calls to show() being made in a short time or show() being called while p...
PaymentRequestEvent.openWindow() - Web APIs
it returns a promise that resolves with a reference to a windowclient. syntax var apromise = paymentrequestevent.openwindow(url) parameters url the url to open in the new window. it must be on the same origin as the calling page. return value a promise that resolves with a reference to a windowclient. ...
PaymentRequestEvent - Web APIs
tails. 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. 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 definition of...
PaymentResponse.retry() - Web APIs
ds whose values are not acceptable, call the response's complete() method with a value of "fail" to indicate failure. if the response's data is valid and acceptable, call complete("success") to finalize the payment and proces it. if show() is rejected, the payment request failed, usually because either there's already one being processed, because the user agent doesn't support any of the
specified payment methods, or because of a security issue. see the list of exceptions for show() for further details. call complete("fail") to close the payment request. async function handlepayment() { const payrequest = new paymentrequest(methoddata, details, options); try { let payresponse = await payrequest.show(); while (payresponse has errors) { /* let the user edit the payment ...
performance.getEntriesByName() - Web APIs
explicit points in time. note: this feature is available in web workers. syntax entries = window.performance.getentriesbyname(name, type); arguments name the name of the entry to retrieve. type optional the type of entry to retrieve such as "mark". the valid entry types are listed in performanceentry.entrytype. return value entries a list of performanceentry objects that have the
specified name and type. if the type argument is not
specified, only the name will be used to determine the entries to return. the items will be in chronological order based on the entries' starttime. if no objects meet the
specified criteria, an empty list is returned. example function use_performanceentry_methods() { log("performanceentry tests ..."); if (performance.mark === undefined) { log...
performance.getEntriesByType() - Web APIs
r measures (for example by calling the mark() method) at explicit points in time. note: this feature is available in web workers. syntax entries = window.performance.getentriesbytype(type); arguments type the type of entry to retrieve such as "mark". the valid entry types are listed in performanceentry.entrytype. return value entries a list of performanceentry objects that have the
specified type. the items will be in chronological order based on the entries' starttime. if no objects have the
specified type, or no argument is provided, an empty list is returned. example function useperformanceentrymethods() { log("performanceentry tests ..."); if (performance.mark === undefined) { log("... performance.mark not supported"); return; } // create some performance ...
performance.setResourceTimingBufferSize() - Web APIs
a browser's recommended resource timing buffer size is at least 150 performance entry objects. note: this feature is available in web workers. syntax performance.setresourcetimingbuffersize(maxsize); arguments maxsize a number representing the maximum number of performance entry objects the browser should hold in its performance entry buffer. return value none this method has no return value. ...
Performance - Web APIs
name() returns a list of performanceentry objects based on the given name and entry type. performance.getentriesbytype() returns a list of performanceentry objects of the given entry type. performance.mark() creates a timestamp in the browser's performance entry buffer with the given name. performance.measure() creates a named timestamp in the browser's performance entry buffer between two
specified marks (known as the start mark and end mark, respectively). performance.now() returns a domhighrestimestamp representing the number of milliseconds elapsed since a reference instant. performance.setresourcetimingbuffersize() sets the browser's resource timing buffer size to the
specified number of "resource" type performance entry objects. performance.tojson() is a jsonizer returning a json...
PerformanceObserver() - Web APIs
yntax var observer = new performanceobserver(callback); parameters callback a performanceobservercallback callback that will be invoked when observed performance events are recorded. when the callback is invoked, its first parameter is a list of performance observer entries and the second parameter is the observer object. return value a new performanceobserver object which will call the
specified callback when observed performance events occur. example var observer = new performanceobserver(function(list, obj) { var entries = list.getentries(); for (var i=0; i < entries.length; i++) { // process "mark" and "frame" events } }); observer.observe({entrytypes: ["mark", "frame"]}); function perf_observer(list, observer) { // process the "measure" event } var observer2 = new perf...
PerformanceObserver - Web APIs
hey are recorded in the browser's performance timeline. note: this feature is available in web workers. constructor performanceobserver() creates and returns a new performanceobserver object. methods performanceobserver.observe() specifies the set of entry types to observe. the performance observer's callback function will be invoked when a performance entry is recorded for one of the
specified entrytypes performanceobserver.disconnect() stops the performance observer callback from receiving performance entries. performanceobserver.takerecords() returns the current list of performance entries stored in the performance observer, emptying it out. example function perf_observer(list, observer) { // process the "measure" event } var observer2 = new performanceobserver(perf_obse...
PerformanceResourceTiming.initiatorType - Web APIs
, 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" 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 (v...
PerformanceResourceTiming - Web APIs
een 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 domhighrestimestamp immediately before dispatching the fetchevent if a service worker thread is already running, or immed...
PerformanceServerTiming.description - Web APIs
the description read-only property returns a domstring value of the server-
specified metric description, or an empty string. syntax servertiming.description; specifications specification status comment server timingthe definition of 'description' in that specification. working draft initial definition. ...
PerformanceServerTiming.duration - Web APIs
the duration read-only property returns a double that contains the server-
specified metric duration, or value 0.0. syntax servertiming.duration; specifications specification status comment server timingthe definition of 'duration' in that specification. working draft initial definition. ...
PerformanceServerTiming.name - Web APIs
the name read-only property returns a domstring value of the server-
specified metric name. syntax servertiming.name; specifications specification status comment server timingthe definition of 'name' in that specification. working draft initial definition. ...
PerformanceServerTiming - Web APIs
ith the response in the server-timing http header. 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. note that this interface is only available in secure contexts (https) in some browsers. properties performanceservertiming.descriptionread only a domstring value of the server-
specified metric description, or an empty string. performanceservertiming.durationread only a double that contains the server-
specified metric duration, or value 0.0. performanceservertiming.nameread only a domstring value of the server-
specified metric name. methods performanceservertiming.tojson() returns a domstring that is the json representation of the performanceservertiming object. exa...
PluginArray - Web APIs
as the length property and supports accessing individual items using bracket notation (plugins[2]), as well as via item(index) and nameditem("name") methods. note: own properties of pluginarray objects are no longer enumerable in the latest browser versions. properties pluginarray.lengthread only the number of plugins in the array. methods pluginarray.item returns the plugin at the
specified index into the array. pluginarray.nameditem returns the plugin with the
specified name. pluginarray.refresh refreshes all plugins on the current page, optionally reloading documents. examples the following example function returns the version of the shockwave flash plugin. var pluginslength = navigator.plugins.length; document.body.innerhtml = pluginslength + " plugin(s)<br>" + '<table...
Point - Web APIs
directly related to this defunct interface, you are probably looking for dompoint, which is part of the geometry interfaces module level 1 specification. properties x a floating-point value specifying the point's position with respect to the x (horizontal) axis. y a floating-point value specifying the point's position with respect to the y (vertical) axis. specifications this class was
specified in the defunct 20 march 2009 working draft of css 2d transforms module level 3. it is not present in the current working draft of the css transforms level 1 specification. ...
Pointer events - Web APIs
rty the touch-action css property is used to specify whether or not the browser should apply its default (native) touch behavior (such as zooming or panning) to a region. this property may be applied to all elements except: non-replaced inline elements, table rows, row groups, table columns, and column groups. a value of auto means the browser is free to apply its default touch behavior (to the
specified region) and the value of none disables the browser's default touch behavior for the region. the values pan-x and pan-y, mean that touches that begin on the
specified region are only for horizontal and vertical scrolling, respectively. the value manipulation means the browser may consider touches that begin on the element are only for scrolling and zooming. in the following example, the browser's...
PromiseRejectionEvent() - Web APIs
jection which occurred: promise the promise that was rejected. reason any value or object which represents the reason the promise was rejected. this can be anything from a numeric error code to an error domstring to an object which contains detailed information describing the situation resulting in the promise being rejected. return value a new promiserejectionevent configured as
specified by the parameters. examples this example creates a new unhandledrejection event for the promise mypromise with the reason being the string "my house is on fire". the reason could just as easily be a number, or even an object with detailed information including the home address, how serious the fire is, and the phone number of an emergency contact who should be notified. let myrejectionevent = ...
PublicKeyCredential.id - Web APIs
overrides the getter defined in credential. credential management level 1the definition of 'id' in that specification. working draft initial definition. ...
PushManager.subscribe() - Web APIs
ptional configuration parameters. it can have the following properties: uservisibleonly: a boolean indicating that the returned push subscription will only be used for messages whose effect is made visible to the user. applicationserverkey: a base64-encoded domstring or arraybuffer containing an ecdsa p-256 public key that the push server will use to authenticate your application server. if
specified, all messages from your application server must use the vapid authentication scheme, and include a jwt signed with the corresponding private key. this key is not the same ecdh key that you use to encrypt the data. for more information, see "using vapid with webpush". note: this parameter is required in some browsers like chrome and edge. returns a promise that resolves to a pushsubsc...
PushManager.unregister() - Web APIs
in the updated api, a subscription is can be unregistered via the pushsubscription.unsubscribe() method. syntax var request = navigator.push.unregister(pushendpoint); properties pushendpoint a pushendpoint to be unregistered. return a domrequest object to handle the success or failure of the method call. if the method call is successful, the request's result will be a pushregistration object representing the endpoint that has been unregistered. ...
PushManager - Web APIs
issionstatus of the requesting webapp, which will be one of granted, denied, or default. replaced by pushmanager.permissionstate(). pushmanager.register() subscribes to a push subscription. replaced by pushmanager.subscribe(). pushmanager.registrations() retrieves existing push subscriptions. replaced by pushmanager.getsubscription(). pushmanager.unregister() unregisters and deletes a
specified subscription endpoint. in the updated api, a subscription is unregistered by calling the pushsubscription.unsubscribe() method. example this.onpush = function(event) { console.log(event.data); // from here we can write the data to indexeddb, send it to any open // windows, display a notification, etc. } navigator.serviceworker.register('serviceworker.js').then( function(serviceworkerr...
PushSubscription.getKey() - Web APIs
hich 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() is not currently
specified in here. it is currently firefox-only experimental. browser compatibility the compatibility table on this page is generated from structured data. if 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 androidoper...
Push API - Web APIs
s replaced the functionality offered by the obsolete pushregistrationmanager interface. pushmessagedata provides access to push data sent by a server, and includes methods to manipulate the received data. pushsubscription provides a subcription's url endpoint, and allows unsubscription from a push service. service worker additions the following additions to the service worker api have been
specified in the push api spec to provide an entry point for using push messages. they also monitor and respond to push and subscription change events. serviceworkerregistration.pushmanager read only returns a reference to the pushmanager interface for managing push subscriptions including subscribing, getting an active subscription, and accessing push permission status. this is the entry point into u...
RTCConfiguration.bundlePolicy - Web APIs
will fall back to not bundling if the remote peer can't handle it. max-bundle the ice agent starts by creating a single rtcdtlstransport to handle all of the connection's media. if the remote peer isn't bundle-compatible, only one media track is negotiated and the rest are ignored. this maximizes bundling at the risk of losing tracks if the remote peer can't do bundling. if any other value is
specified, no configuration is
specified when creating the rtcpeerconnection, or if the bundlepolicy property isn't included in the rtcconfiguration object
specified when creating the connection, balanced is assumed. description the bundlepolicy configuration option for an rtcpeerconnection specifies how the ice agent should handle negotiation if the remote peer isn't compatible with the sdp bundle stand...
RTCConfiguration.iceServers - Web APIs
et rtcconfiguration.iceservers = [ iceserver1... ]; value an array of zero or more rtciceserver objects, each of which describes one stun or turn server for the ice agent to use during the connection's negotiation. each object must at least have an urls property, which is an array of one or more strings, each providing one server's url. if the array is empty, or if the iceservers option isn't
specified, the ice agent will negotiate without the use of any servers, which will limit the connection to local peers. description how the list of servers you provide is used is up to the implementation of the user agent. while it can be useful to provide a second server as a fallback in case the first is offline, listing too many servers can delay the user's connection being established, depending on t...
RTCDTMFSender.insertDTMF() - Web APIs
the insertdtmf() method on the rtcdtmfsender interface starts sending dtmf tones to the remote peer over the rtcpeerconnection. sending of the tones is performed asynchronously, with tonechange events sent to the rtcdtmfsender every time a tone starts or ends. as long as the connection is active, you can send tones at any time. calling insertdtmf() will append the
specified tones to the end of the current tone buffer, so that those tones play after the previously-enqueued tones. syntax rtcdtmfsender.insertdtmf(tones[, duration[, intertonegap]]); parameters tones a domstring containing the dtmf codes to be transmitted to the recipient. specifying an empty string as the tones parameter clears the tone buffer, aborting any currently queued tones. a "," character inserts a two second delay. ...
RTCDTMFSender - Web APIs
ontains the list of dtmf tones currently in the queue to be transmitted (tones which have already been played are no longer included in the string). see tonebuffer for details on the format of the tone buffer. methods rtcdtmfsender.insertdtmf() given a string describing a set of dtmf codes and, optionally, the duration of and inter-tone gap between the tones, insertdtmf() starts sending the
specified tones. calling insertdtmf() replaces any already-pending tones from the tonebuffer. you can abort sending queued tones by specifying an empty string ("") as the set of tones to play. events listen to these events using addeventlistener() or by assigning an event listener to the oneventname property of this interface. tonechange the tonechange event is sent to the rtcdtmfsender instance's e...
RTCDTMFToneChangeEvent.RTCDTMFToneChangeEvent() - Web APIs
ype rtcdtmftonechangeeventinit, 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 telephone keypad. the letters a-d these characters represent the "a" through "d" keys which are part of the dtmf standard but not included on most telephones. these are not interpreted as digits. lower-case "a"-"d" automatically gets converted to upper-case. the pound/hash sign ("#") and...
RTCDataChannel.binaryType - Web APIs
ld be used to represent binary data received on the rtcdatachannel. values allowed by the websocket.binarytype property are also permitted here: "blob" if blob objects are being used or "arraybuffer" if arraybuffer objects are being used. the default is "blob". when a binary message is received on the data channel, the resulting message event's messageevent.data property is an object of the type
specified by the binarytype. syntax var type = adatachannel.binarytype; adatachannel.binarytype = type; value a domstring that can have one of these values: "blob" received binary messages' contents will be contained in blob objects. "arraybuffer" received binary messages' contents will be contained in arraybuffer objects. example this code configures a data channel to receive binary data in...
RTCDataChannel.bufferedAmount - Web APIs
essages are actually sent, this value is reduced accordingly. closing the data channel doesn't reset this count, even though the user agent purges the queued messages. however, even after closing the channel, attempts to send messages continue to add to the bufferedamount value, even though the messages are neither sent nor buffered. whenever this value decreases to fall to or below the value
specified in the bufferedamountlowthreshold property, the user agent fires the bufferedamountlow event. this event may be used, for example, to implement code which queues more messages to be sent whenever there's room to buffer them. syntax var amount = adatachannel.bufferedamount; value the number of bytes of data currently queued to be sent over the data channel but have not yet been sent. example...
RTCDataChannel: bufferedamountlow event - Web APIs
a bufferedamountlow event is sent to an rtcdatachannel when the number of bytes currently in the outbound data transfer buffer falls below the threshold
specified in bufferedamountlowthreshold. bufferedamountlow events aren't sent if bufferedamountlowthreshold is 0. bubbles no cancelable no interface event event handler property onbufferedamountlow examples this example sets up a handler for bufferedamountlow to request more data any time the data channel's buffer falls below the number of bytes
specified by bufferedamountlowthreshold, which we have set to 65536. in other words, we'll try to keep at least 64kb of data in the buffer, reading 64kb at a time from the source. let pc = new rtcpeerconnection(); let dc = pc.createdatachannel("send...
RTCDataChannel: error event - Web APIs
break; } // add source file name and line information console.error(" error in file ", err.filename, " at line ", err.linenumber, ", column ", err.columnnumber); }, false); the received event provides details in an rtcerror object called error; rtcerror is an extension of the domexception interface. the error's name is rtcerror and the message is an error string
specified by the webrtc layer. error information is output to the console using console.error(). the message string is always output, as is information about the source file's name, line number, and column number at which the error occurred. in addition, however, depending on the value of errordetail, additional information may be output. each error type has a different set of information output. for exa...
RTCDataChannel.label - Web APIs
tirely up to the design decisions made when building your site or app. a unique id can be found in the id property. a data channel's label is set when the channel is created by calling rtcpeerconnection.createdatachannel(). it cannot be changed after that. syntax var name = adatachannel.label; value a string identifier assigned by the web site or app when the data channel was created, as
specified when rtcpeerconnection.createdatachannel() was called to create the channel. example this sample creates a data channel on an rtcpeerconnection, then, some time later, sets the content of a ui element to display the channel's name. var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel"); /* ... */ document.getelementbyid("channel-name").innerhtml = "<span clas...
RTCDataChannel.maxRetransmits - Web APIs
the read-only rtcdatachannel property maxretransmits returns the maximum number of times the browser should try to retransmit a message before giving up, as set when the data channel was created, or null, which indicates that there is no maximum. this can only be set when the rtcdatachannel is created by calling rtcpeerconnection.createdatachannel(), using the maxretransmits field in the
specified options. syntax var tries = adatachannel.maxretransmits; value the maximum number of times the browser will try to retransmit a message before giving up, or null if not set when rtcpeerconnection.createdatachannel() was called. the default is null. example // tbd specifications specification status comment webrtc 1.0: real-time communication between browsersthe def...
RTCDataChannel.protocol - Web APIs
the permitted values of this property are defined by the web site or app using the data channel. the ability for each channel to have a defined subprotocol lets your app, for example, use json objects as messages on one channel while another channel is plaintext and another is raw binary or even some other format. ...
RTCDataChannelEvent() - Web APIs
has following fields: "channel" of type rtcdatachannel, representing the data channel being concerned by the event. "bubbles", optional, inherited from eventinit. indicates if the event must bubble or not. default is false. "cancelable", optional, inherited from eventinit. indicates if the event can be canceled 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 definition of 'rtcdatachannelevent' in that specification. candidate recommendation in...
RTCIceCandidate.address - Web APIs
the address field's value is set when the rtcicecandidate() constructor is used. you can't specify the address in the options object, but the address is automatically extracted from the candidate a-line, if it's formatted properly. syntax var address = rtcicecandidate.address; value a domstring providing the ip address from which the candidate comes. ...
RTCIceCandidate.protocol - Web APIs
the protocol property's value is set when the rtcicecandidate() constructor is used. the value is automatically extracted from the candidate a-line, if it's formatted properly. ...
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. ...
RTCIceCandidate.sdpMid - Web APIs
e 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 rtcicecandidateinit 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 sdpmid or sdpmlineindex will throw a typeerror exception. e...
RTCIceCandidate.type - Web APIs
a-line, if it's formatted properly, being taken from its cand-type field. syntax var type = rtcicecandidate.type; value a domstring whose value is one of those defined by the rtcicecandidatetype enumerated type. these candidate types are listed in order of priority; the higher in the list they are, the more efficient they are. host the candidate is a host candidate, whose ip address as
specified in the rtcicecandidate.ip property is in fact the true address of the remote peer. srflx the candidate is a server reflexive candidate; the ip indicates an intermediary address assigned by the stun server to represent the candidate's peer anonymously. prflx the candidate is a peer reflexive candidate; the ip is an intermediary address assigned by the stun server to represent the candidate's p...
RTCIceCandidatePairStats.nominated - Web APIs
true by the ice layer if the controlling user agent has indicated that the candidate pair should be used to configure the webrtc connection between the two peers. note: if more than one candidate pair are nominated at the same time, the one whose priority is higher will be selected for use. once a candidate pair has been nominated and the two peers have each reconfigured themselves to use the
specified configuration, the ice negotiation process can potentially end (or it can continue, to allow the connection to adapt to changing conditions). specifications specification status comment identifiers for webrtc's statistics apithe definition of 'rtcicecandidatepairstats.nominated' in that specification. candidate recommendation initial specification. ...
RTCIceCandidatePairStats.selected - Web APIs
tax isselected = icpstats.selected; value a firefox-specific boolean value which is true if the candidate pair described by this object is the one currently in use. in any other browser, you can determine the selected candidate pair by looking for a stats object of type transport, which is an rtctransportstats object. that object's selectedcandidatepairid property indicates whether or not the
specified transport is the one being used. example the function shown in this example identifies the currently-selected candidate pair from a statistics report by first iterating over each report, looking for a transport report; when one is found, that transport's selectedcandidatepairid is used to get the rtcicecandidatepair describing the connection. if that fails, then the second section iterates ove...
RTCIceCandidateStats.candidateType - Web APIs
the rtcicecandidatestats interface's candidatetype property is a string which indicates the type of ice candidate the object represents. syntax candidatetype = rtcicecandidatestats.candidatetype; value a domstring whose value is one of the strings found in the rtcicecandidatetype enumerated type:host the candidate is a host candidate, whose ip address as
specified in the rtcicecandidate.ip property is in fact the true address of the remote peer. srflx the candidate is a server reflexive candidate; the ip indicates an intermediary address assigned by the stun server to represent the candidate's peer anonymously. prflx the candidate is a peer reflexive candidate; the ip is an intermediary address assigned by the stun server to represent the candidate's peer anonymously. relay the candida...
RTCIceCandidateStats.networkType - Web APIs
etwork type, which is not discernible. unknown the user's browser is unable or unwilling to identify the underlying connection technology used by the described connection. this may be because the browser isn't able to determine the network type for some reason or it may be intentionally getting obscured for security reasons, such as to avoid device fingerprinting. note: keep in mind that the
specified value only reflects the initial connection between the local peer and the next hop along the network toward reaching the remote peer. for example, if the networktype is wifi but the user is connected using a cellular hotspot, the connection will be bottlenecked by the underlying cellular network (and any other networks between the two peers). example this example sets up a periodic function us...
RTCIceCandidateStats.protocol - Web APIs
syntax protocol = rtcicecandidatestats.protocol; value the value is one of the members of the rtciceprotocol enumerated string type: tcp the candidate, if selected, would use tcp as the transport protocol for its data. the tcptype property provides additional information about the kind of tcp candidate represented by the object. udp the candidate will use the udp transport protocol for its data. this is the preferred protocol for media interactions because of its better performance profile. ...
RTCIceCandidateType - Web APIs
webrtc api's rtcicecandidatetype enumerated type provides a set of domstring values representing the types of ice candidate that can arrive. these strings are taken directly from the candidate a-line in sdp. values these candidate types are listed in order of priority; the higher in the list they are, the more efficient they are. host the candidate is a host candidate, whose ip address as
specified in the rtcicecandidate.ip property is in fact the true address of the remote peer. srflx the candidate is a server reflexive candidate; the ip indicates an intermediary address assigned by the stun server to represent the candidate's peer anonymously. prflx the candidate is a peer reflexive candidate; the ip is an intermediary address assigned by the stun server to represent the candidate's p...
RTCIceServers.urls - Web APIs
y specifies the url or urls of the servers to be used for ice negotiations. these are typically stun and/or turn servers. syntax var iceserver = { urls = iceserverurl | [ url1, ..., urln ], username: "webrtc", // optional credential: "turnpassword" // optional }; iceservers.push(iceserver); the value of this property may be
specified as a single url or as an array of multiple urls. examples let's look a few examples of varying complexity. a single ice server this example creates a new rtcpeerconnection which will use a stun server at stunserver.example.org to negotiate connections. mypeerconnection = new rtcpeerconnection({ iceservers: [ { urls: "stun:stunserver.example.org" } ] }); notice that only th...
RTCNetworkType - Web APIs
etwork type, which is not discernible. unknown the user's browser is unable or unwilling to identify the underlying connection technology used by the described connection. this may be because the browser isn't able to determine the network type for some reason or it may be intentionally getting obscured for security reasons, such as to avoid device fingerprinting. note: keep in mind that the
specified value only reflects the initial connection between the local peer and the next hop along the network toward reaching the remote peer. for example, if the networktype is wifi but the user is connected using a cellular hotspot, the connection will be bottlenecked by the underlying cellular network (and any other networks between the two peers). specifications specification status ...
RTCPeerConnection.addTransceiver() - Web APIs
rtptransceiver object's rtcrtptransceiver.direction property. 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. exceptions typeerror a string was
specified as trackorkind which is not valid. the string must be either "audio" or "video". specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.addtransceiver()' in that specification. candidate recommendation ...
RTCPeerConnection.connectionState - Web APIs
when this property's value changes, a connectionstatechange event is sent to the rtcpeerconnection instance. syntax var connectionstate = rtcpeerconnection.connectionstate; value the current state of the connection, as a value from the enum rtcpeerconnectionstate. rtcpeerconnectionstate enum the rtcpeerconnectionstate enum defines string constants which describe states in which the rtcpeerconnection may be. ...
RTCPeerConnection.getDefaultIceServers() - Web APIs
ns an array of objects based on the rtciceserver dictionary, which indicates what, if any, ice servers the browser will use by default if none are provided to the rtcpeerconnection in its rtcconfiguration. however, browsers are not required to provide any default ice servers at all. syntax var defaulticeservers = rtcpeerconnection.getdefaulticeservers(); return value an array of ice servers,
specified as objects based on rtciceserver, which the browser will use if none are
specified in the configuration of the rtcpeerconnection. if there are no defaults provided by the browser, the returned array is empty; this property's value is never null. example var pc = new rtcpeerconnection(); var iceservers = pc.getdefaulticeservers(); if (iceservers.length === 0) { // deal with the lack of defaul...
RTCPeerConnection.getSenders() - Web APIs
ders is not defined by the specification, and may change from one call to getsenders() to the next. example in this example, a setmuting() function is shown. this function takes as input an rtcpeerconnection, pc, and a boolean, muting. the function gets the list of the peer connection's senders and iterates over every sender, setting the corresponding media track's enabled to the inverse of the
specified muting. function setmuting(pc, muting) { let senderlist = pc.getsenders(); senderlist.foreach(sender) { sender.track.enabled = !muting; } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.getsenders()' in that specification. candidate recommendation initial specifi...
RTCPeerConnection.onaddstream - Web APIs
occurs may be nearly immediately after the remote end of the connection is set using rtcpeerconnection.setremotedescription(); it doesn't wait for a particular stream to be accepted or rejected using sdp negotiation. example this code, based on an older version of our signaling and video calling sample, responds to addstream events by setting the video source for a <video> element to the stream
specified in the event, and then enabling a "hang up" button in the app's user interface. pc.onaddstream = function(event) { document.getelementbyid("received_video").srcobject = event.stream; document.getelementbyid("hangup-button").disabled = false; }; you can also use addeventlistener() to add a handler for addstream events to an rtcpeerconnection. ...
RTCPeerConnection.onicecandidateerror - Web APIs
f (event.errorcode >= 300 && event.errorcode <= 699) { // stun errors are in the range 300-699. see rfc 5389, section 15.6 // for a list of codes. turn adds a few more error codes; see // rfc 5766, section 15 for details. } else if (event.errorcode >= 700 && event.errorcode <= 799) { // server could not be reached; a specific error number is // provided but these are not yet
specified. } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.onicecandidateerror' in that specification. candidate recommendation initial specification. ...
RTCPeerConnection.removeTrack() - Web APIs
if the track is already stopped, or is not in the connection's senders list, this method has no effect. if the connection has already been negotiated (signalingstate is set to "stable"), it is marked as needing to be negotiated again; the remote peer won't experience the change until this negotiation occurs. a negotiationneeded event is sent to the rtcpeerconnection to let the local end know this negotiation must occur. ...
RTCPeerConnection.signalingState - Web APIs
see signaling in lifetime of a webrtc session for more details about the signaling process. because the signaling process is a state machine, being able to verify that your code is in the expected state when messages arrive can help avoid unexpected and avoidable failures. ...
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 not ye...
RTCPeerConnectionIceEvent() - Web APIs
a stun or turn server, this value must be null. "bubbles" (optional, default is false): inherited from eventinit(), this boolean option indicates whether or not the event must bubble. "cancelable" (optional, default is false, inherited from eventinit(), 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 definition of 'rtcpeerconnectioniceevent()' in that specification. candidate recommendation initial definition. ...
RTCRtpCodecParameters - Web APIs
peer connection. most of the fields in this property take values which are defined and maintained by the internet assigned numbers authority (iana). references to relevant iana documents are provided in the see also section at the end of this article. properties payloadtype optional the rtp payload type used to identify this codec. mimetype optional the codec's mime media type and subtype
specified as a domstring of the form "type/subtype". iana maintains a registry of valid mime types. clockrate optional an unsigned long integer value specifying the codec's clock rate in hertz (hz). the clock rate is the rate at which the codec's rtp timestamp advances. most codecs have specific values or ranges of values they permit; see the iana payload format media type registry for details. channels...
RTCRtpEncodingParameters.maxBitrate - Web APIs
value an unsigned long integer value specifying the maximum bandwidth this encoding is permitted to use for a track of media it encodes in terms of bits per second. other parameters may further reduce the bandwidth used by the track; for example, maxframerate will, if set low enough, constrain the bandwidth as well. in addition, there's no guarantee that the network interface can support the
specified bandwidth, in which case the actual bandwidth will be lower. this value is computed using the standard transport independent application specific maximum (tias) bandwidth as defined by rfc 3890, section 6.2.2; this is the maximum bandwidth needed without considering protocol overheads from ip, tcp or udp, and so forth. specifications specification status comment webrtc ...
RTCRtpReceiver.getCapabilities() static function - Web APIs
nction rtcrtpsender.getcapabilities(). syntax let rtpcapabilities = rtcrtpreceiver.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the device's capability to receive. all browsers support the primary media kinds: audio and video. return value an rtcrtpcapabilities object stating what capabilities the browser has for receiving the
specified media kind over an rtcpeerconnection. if the browser doesn't have any support for the given media kind, the returned value is null. description as a static function, this is always called using the form: capabilities = rtcrtpreceiver.getcapabilities("audio"); the returned set of capabilities is the most optimistic possible list. it is entirely possible that certain combinations of options may...
RTCRtpSender.getCapabilities() static function - Web APIs
function rtcrtpreceiver.getcapabilities(). syntax let rtpcapabilities = rtcrtpsender.getcapabilities(kind); parameters kind a domstring indicating the type of media for which you wish to get the sender's capability to receive. all browsers support the primary media kinds: audio and video. return value an rtcrtpcapabilities object stating what capabilities the browser has for sending the
specified media kind over an rtcpeerconnection. if the browser doesn't have any support for the given media kind, the returned value is null. description as a static function, this is always called using the form: capabilities = rtcrtpsender.getcapabilities("audio"); the returned set of capabilities is the most optimistic possible list. it is entirely possible that certain combinations of options may f...
RTCRtpSender - Web APIs
rtcrtpsender.replacetrack() attempts to replace the track currently being sent by the rtcrtpsender with another track, without performing renegotiation. this method can be used, for example, to toggle between the front- and rear-facing cameras on a device. static methods rtcrtpsender.getcapabilities() returns an rtcrtpcapabilities object describing the system's capabilities for sending a
specified kind of media data. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtpsender' in that specification. candidate recommendation ...
RTCRtpTransceiver.direction - Web APIs
negotiation of the connection is required, so a negotiationneeded event is sent to the rtcpeerconnection. effect on offers and answers the value of direction is used by rtcpeerconnection.createoffer() or rtcpeerconnection.createanswer() in order to generate the sdp generated by each of those methods. the sdp contains an a-line which specifies the directionality. for example, if the direction is
specified as "sendrecv", the corresponding sdp a-line is: a=sendrecv specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtptransceiver.direction' in that specification. candidate recommendation ...
RTCRtpTransceiver.setCodecPreferences() - Web APIs
when preparing to open an rtcpeerconnection, you can change the codec parameters from the user agent's default configuration by calling setcodecparameters() before calling either rtcpeerconnection.createoffer() or createanswer(). ...
RTCRtpTransceiverInit - Web APIs
rtptransceiver object's rtcrtptransceiver.direction property. 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. specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcrtptransceiverinit' in that specification. candidate recommendation ...
RTCSessionDescription - Web APIs
roperties. rtcsessiondescription.type read only an enum of type rtcsdptype describing the session description's type. rtcsessiondescription.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 definitive 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 ...
RTCTrackEventInit.streams - Web APIs
provides an array containing a mediastream object for each of the streams associated with the event's track. syntax var trackeventinit = { receiver: rtpreceiver, track: mediastreamtrack, streams: [videostream], transceiver: rtptransceiver }; var streamlist = trackeventinit.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 definition of 'rtctrackeventinit.streams' in that specification. candidate recommendation initial specification. ...
Range.setEnd() - Web APIs
the range.setend() method sets the end position of a range to be located at the given offset into the
specified node x.setting the end point above (higher in the document) than the start point will result in a collapsed range with the start and end points both set to the
specified end position. syntax range.setend(endnode, endoffset); parameters endnode the node inside which the range should end. endoffset an integer greater than or equal to zero representing the offset for the end of the range from the start of endnode. return value undefined. exceptions exceptions are thrown as domexception objects of the following types: invalidnodetypeerror the node
specified by endnode is a doctype node; range endpoints cannot be located inside a doctype node. indexsizeerror the value spe...
Range.setStart() - Web APIs
f a range. if the startnode is a node of type text, comment, or cdatasection, then startoffset is the number of characters from the start of startnode. for other node types, startoffset is the number of child nodes between the start of the startnode. setting the start point below (lower in the document) the end point will result in a collapsed range with the start and end points both set to the
specified start position. syntax range.setstart(startnode, startoffset); parameters startnode the node where the range should start. startoffset an integer greater than or equal to zero representing the offset for the start of the range from the start of startnode. examples highlight part of an element this example uses the range.setstart() and range.setend() methods to add part of an address...
Range.surroundContents() - Web APIs
this method is nearly equivalent to newnode.appendchild(range.extractcontents()); range.insertnode(newnode). after surrounding, the boundary points of the range include newnode. an exception will be thrown, however, if the range splits a non-text node with only one of its boundary points. that is, unlike the alternative above, if there are partially selected nodes, they will not be cloned and instead the operation will fail. syntax range.surroundcontents(newparent); parameters newparent a node with which to surround the contents. ...
ReadableStream.getReader() - Web APIs
d. syntax var reader = readablestream.getreader({mode}); parameters {mode} optional an object containing a property mode, which takes as its value a domstring specifying the type of reader to create. values can be: "byob", which results in a readablestreambyobreader being created that can read readable byte streams (i.e. can handle "bring your own buffer" reading). undefined (or not
specified at all — this is the default), which results in a readablestreamdefaultreader being created that can read individual chunks from a stream. return value a readablestreamdefaultreader or readablestreambyobreader object instance, depending on the mode value. exceptions rangeerror the provided mode value is not "byob" or undefined. typeerror the stream you are trying to create a reade...
RenderingContext - Web APIs
renderingcontext is a webidl typedef which can refer to any one of the interfaces that represent a graphics rendering context within a <canvas> element: canvasrenderingcontext2d, webglrenderingcontext, or webgl2renderingcontext. by using the shorthand renderingcontext, methods and properties which can make use of any of these interfaces can be
specified and written more easily; since <canvas> supports several rendering systems, it's helpful from a specification and browser implementation perspective to have a shorthand that means "one of these interfaces." as such, renderingcontext is an implementation detail, and isn't something web developers directly use. there is no renderingcontext interface, and there are no objects which implement type renderingcontext. the primary use of this type is th...
Report - Web APIs
the report details are displayed via the displayreports() fuction, which takes the observer callback's reports parameter as its parameter: function displayreports(reports) { const outputelem = document.que...
ReportingObserver - Web APIs
res on our web page: let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { reportbtn.onclick = () => displayreports(reports); }, options); we then tell it to start observing reports using reportingobserver.observe(); this tells the observer to start collecting reports in its report queue, and runs the callback function
specified inside the constructor: observer.observe(); later on in the example we deliberately use the deprecated version of mediadevices.getusermedia(): if(navigator.mozgetusermedia) { navigator.mozgetusermedia( constraints, success, failure); } else { navigator.getusermedia( constraints, success, failure); } this causes a deprecation report to be generated; because of the e...
Request.integrity - Web APIs
the integrity read-only property of the request interface contains the subresource integrity value of the request. syntax var myintegrity = request.integrity; value the subresource integrity value of the request (e.g., sha256-bpfbw7ivv8q2jlit13fxdyae2tjllusrsz273h2nfse=). if an integrity has not been
specified, the property returns ''. example 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 integrity value in a variable: var myrequest = new request('flowers.jpg'); var myintegrity = myrequest.integrity; specifications specification status comment fetchthe definition of 'integrity' in that specification. living standard initial definition ...
Request.redirect - Web APIs
the redirect read-only property of the request interface contains the mode for how redirects are handled. syntax var myredirect = request.redirect; value a requestredirect enum value, which can be one the following strings: follow error manual if not
specified when the request is created, it takes the default value of follow. example 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 redirect value in a variable: var myrequest = new request('flowers.jpg'); var mycred = myrequest.redirect; specifications specification status comment fetchthe definition of 'redirect' in that specification. living standard initial definition ...
ResizeObserver.observe() - Web APIs
syntax resizeobserver.observe(target, options); parameters target a reference to an element or svgelement to be observed. options optional an options object allowing you to set options for the observation. currently this only has one possible option that can be set: box sets which box model the observer will observe changes to. possible values are content-box (the default), and border-box. return value void. exceptions none. ...
ResizeObserver - Web APIs
m 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 size, even if they have nothing to...
Using the Resource Timing API - Web APIs
ations may use more resources than that limit. to help the developer manage the buffer size, resource timing defines two methods that extend the performance interface. the clearresourcetimings() method removes all "resource" type performance entries from the browser's resource performance entry buffer. the setresourcetimingbuffersize() method sets the resource performance entry buffer size to the
specified number of resource performance entries. the following example demonstrates the usage of these two methods. function clear_resource_timings() { if (performance === undefined) { console.log("= performance.clearresourcetimings(): peformance not supported"); return; } // check if performance.clearresourcetiming() is supported console.log ("= print performance.clearresourcetimings()"...
Resource Timing API - Web APIs
can be used to obtain a domhighrestimestamp when the worker was started. methods the resource timing api includes two methods that extend the performance interface. the clearresourcetimings() method removes all "resource" type performance entries from the browser's resource performance entry buffer. the setresourcetimingbuffersize() method sets the resource performance entry buffer size to the
specified number of resource performance entries. the performanceresourcetiming interface's tojson() method returns a json serialization of a "resource" type performance entry. implementation status as shown in the performanceresourcetiming interface's browser compatibility table, most of these interfaces are broadly implemented by desktop browsers. however, note that some properties have little to no i...
Response.redirect() - Web APIs
the redirect() method of the response interface returns a response resulting in a redirect to the
specified url. note: this is mainly relevant to the serviceworker api. a controlling service worker could intercept a page's request and redirect it as desired. this will actually lead to a real redirect if a service worker sends it upstream. syntax var response = response.redirect(url, status); parameters url the url that the new response is to originate from. status optional an optional status code for the response (e.g., 302.) return value a response object. exceptions exception explanation rangeerror the
specified status is not a redirect status. typeerror the
specified url is invalid. example responseobj.redirect('https://www.exampl...
cx - Web APIs
syntax var xcoordinate = element.cx; value an svganimatedlength representing the x-coordinate of the circleʼs center. ...
cy - Web APIs
syntax var ycoordinate = element.cy; value an svganimatedlength representing the y-coordinate of the circleʼs center. ...
r - Web APIs
syntax var radius = element.r; value an svganimatedlength representing the radius of the circle. ...
SVGDocument - Web APIs
returns the uri of the page that linked to this page. the value is an empty string if the user navigated to the page directly (not through a link, but, for example, via a bookmark). rootelement svgsvgelement the root "svg" in the document hierarchy. title domstring the title of a document as
specified by the "title" sub-element of the "svg" root element (i.e., <svg><title>here is the title</title>...</svg>) url domstring the complete uri of the document. methods the svgdocument interface does not provide any specific methods. browser compatibility ...
SVGPathSeg - Web APIs
pathseg_curveto_quadratic_smooth_rel 19 corresponds to a "relative smooth quadratic curveto" (t) path data command. properties name type description pathsegtype unsigned short the type of the path segment as
specified by one of the constants defined on this interface. pathsegtypeasletter domstring the type of the path segment as
specified by the corresponding one character command name. methods the svgpathseg interface does not provide any specific methods. browser compatibility ...
SVGPreserveAspectRatio - Web APIs
of this type or to attempt to switch an existing value to this type. svg_meetorslice_meet 1 corresponds to value meet for attribute preserveaspectratio. svg_meetorslice_slice 2 corresponds to value slice for attribute preserveaspectratio. properties name type description align unsigned short the type of the alignment value as
specified by one of the svg_preserveaspectratio_* constants defined on this interface. meetorslice unsigned short the type of the meet-or-slice value as
specified by one of the svg_meetorslice_* constants defined on this interface. exceptions on setting: a domexception with code no_modification_allowed_err is raised on an attempt to change the value of an attribute on a read only obje...
SVGRect - Web APIs
8" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">svgrect</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} properties svgrect.x the exact effect of this coordinate depends on each element. if the attribute is not
specified, the effect is as if a value of 0 were
specified. svgrect.y the exact effect of this coordinate depends on each element.if the attribute is not
specified, the effect is as if a value of 0 were
specified. svgrect.width this represents the width of the rectangle.a value that is negative results to an error. a value of zero disables rendering of the element svgrect.height this represents the h...
SVGSVGElement - Web APIs
g dom with a method call similar to: const suspendhandleid = suspendredraw(maxwaitmilliseconds) and follow the changes with a method call similar to: unsuspendredraw(suspendhandleid) note that multiple suspendredraw() calls can be used at once, and that each such method call is treated independently of the other suspendredraw() method calls. svgsvgelement.unsuspendredraw() cancels a
specified suspendredraw() by providing a unique suspend handle id that was returned by a previous suspendredraw() call. svgsvgelement.unsuspendredrawall() cancels all currently active suspendredraw() method calls. this method is most useful at the very end of a set of svg dom calls to ensure that all pending suspendredraw() method calls have been cancelled. svgsvgelement.forceredraw() in rendering ...
SVGStylable - Web APIs
svg stylable interface the svgstylable interface is implemented on all objects corresponding to svg elements that can have style, class and presentation attributes
specified on them. interface overview also implement none methods cssvalue getpresentationattribute(in domstring name) properties readonly svganimatedstring classname readonly cssstyledeclaration style normative document svg 1.1 (2nd edition) properties name type description classname svganimatedstring corresponds to attribute class on the given element. style cssstyledeclaration corresponds to attribute style on the given element. methods name & arguments return ...
SVGTests - Web APIs
atures attribute of the given element. svgtests.requiredextensions read only an svgstringlist corresponding to the requiredextensions 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. specifications specification status comment scalable vector graphics (svg) 2the definition of 'svgtests' in that specification. candidate recommendation removed requiredfeatures property and hasextension() method. scalable vector graphics (svg) 1.1 (second edition)the definition of 'svgtests' in that specification. recommendation initial d...
Screen.lockOrientation() - Web APIs
the screenorientation.lock() method should be used instead. note: this method only works for installed web apps or for web pages in full-screen mode. syntax lockallowed = window.screen.lockorientation(orientation); parameters orientation the orientation into which to lock the screen. this is either a string or an array of strings. passing several strings lets the screen rotate only in the selected orientations. the following strings represent the possible orientation requirements you may specify: portrait-primary it represents the orientation of the screen when it is in its primary portrait mode. ...
Screen Capture API - Web APIs
't have any interfaces of its own; instead, it adds one method to the existing mediadevices interface. mediadevices interface mediadevices.getdisplaymedia() the getdisplaymedia() method is added to the mediadevices interface. similar to getusermedia(), this method creates a promise that resolves with a mediastream containing the display area selected by the user, in a format that matches the
specified options. additions to existing dictionaries the screen capture api adds properties to the following dictionaries defined by other specifications. mediatrackconstraints mediatrackconstraints.cursor a constraindomstring indicating whether or not the cursor should be included in the captured display surface's stream, and if it should always be visible or if it should only be visible while th...
Screen Wake Lock API - Web APIs
modern devices do this to save on battery power. whilst this is a useful feature, some applications need the screen to stay awake to be their most useful. the screen wake lock api prevents the screen from turning off, dimming or locking. ...
Selection.collapse() - Web APIs
the selection.collapse() method collapses the current selection to a single point. the document is not modified. if the content is focused and editable, the caret will blink there. syntax sel.collapse(node, offset); parameters node the caret location will be within this node. this value can also be set to null — if null is
specified, the method will behave like selection.removeallranges(), i.e. all ranges will be removed from the selection. offset optional the offset in node to which the selection will be collapsed. if not
specified, the default value 0 is used. examples /* place the caret at the beginning of an html document's body. */ var body = document.getelementsbytagname("body")[0]; window.getselection().collapse(body,0); specifications specification ...
Selection.containsNode() - Web APIs
cates whether a specfied node is part of the selection. syntax sel.containsnode(node, partialcontainment) parameters node the node that is being looked for in the selection. partialcontainment optional when true, containsnode() returns true when a part of the node is part of the selection. when false, containsnode() only returns true when the entire node is part of the selection. if not
specified, the default value false is used. example check for selection this snippet checks whether anything inside the body element is selected. console.log(window.getselection().containsnode(document.body, true)); find the hidden word in this example, a message appears when you select the secret word. it uses addeventlistener() to check for selectionchange events. html <p>can you find the secret...
Selection.getRangeAt() - Web APIs
the selection.getrangeat() method returns a range object representing one of the ranges currently selected. syntax range = sel.getrangeat(index) parameters index the zero-based index of the range to return. a negative number or a number greater than or equal to selection.rangecount will result in an error. return value the
specified range object. example let ranges = []; sel = window.getselection(); for(let i = 0; i < sel.rangecount; i++) { ranges[i] = sel.getrangeat(i); } /* each item in the ranges array is now * a range object representing one of the * ranges in the current selection */ specifications specification status comment selection apithe definition of 'selection: getrangeat()' in that specification. working draft current ...
Selection.selectAllChildren() - Web APIs
previous selection is lost. syntax sel.selectallchildren(parentnode) parameters parentnode all children of parentnode will be selected. parentnode itself is not part of the selection. ...
onnotificationclose - Web APIs
function(notificationevent) { ... }); example //inside a service worker. self.onnotificationclose = function(event) { console.log('on notification close: ', event.notification.tag); }; specifications specification status comment notifications apithe definition of 'onnotificationclick' in that specification. living standard initial definition. this property is
specified on the notifications_api even though it's part of serviceworkerglobalscope. ...
ServiceWorkerGlobalScope.onpushsubscriptionchange - Web APIs
lf.addeventlistener('pushsubscriptionchange', function() { // do something, usually resubscribe to push and // send the new subscription details back to the // server via xhr or fetch }); specifications specification status comment push apithe definition of 'onpushsubscriptionchange' in that specification. working draft initial definition (note: this event is
specified in the push api, but accessed through serviceworkerglobalscope.) ...
ServiceWorkerRegistration.getNotifications() - Web APIs
rvice worker on the same origin will not be available to other active services workers on that same origin. syntax serviceworkerregistration.getnotifications(options) .then(function(notificationslist) { ... }); parameters options optional an object containing options to filter the notifications returned. the available options are: tag: a domstring representing a notification tag. if
specified, only notifications that have this tag will be returned. return value a promise that resolves to a list of notification objects. example navigator.serviceworker.register('sw.js'); var options = { tag : 'user_alerts' }; navigator.serviceworker.ready.then(function(registration) { registration.getnotifications(options).then(function(notifications) { // do something with your notific...
Service Worker API - Web APIs
r which they will respond with a success or failure action. the promises architecture is ideal for this. registration a service worker is first registered using the serviceworkercontainer.register() method. if successful, your service worker will be downloaded to the client and attempt installation/activation (see below) for urls accessed by the user inside the whole origin, or inside a subset
specified by you. download, install and activate at this point, your service worker will observe the following lifecycle: download install activate the service worker is immediately downloaded when a user first accesses a service worker–controlled site/page. after that, it is updated when: a navigation to an in-scope page occurs. an event is fired on the service worker and it hasn't been do...
SharedWorker - Web APIs
es or even workers. they implement an interface different than dedicated workers and have a different global scope, sharedworkerglobalscope. note: if sharedworker can be accessed from several browsing contexts, all those browsing contexts must share the exact same origin (same protocol, host and port). constructors sharedworker() creates a shared web worker that executes the script at the
specified url. properties inherits properties from its parent, eventtarget, and implements properties from abstractworker. abstractworker.onerror is an eventlistener that is called whenever an errorevent of type error bubbles through the worker. sharedworker.port read only returns a messageport object used to communicate with and control the shared worker. methods inherits methods from its ...
SpeechGrammarList.addFromString() - Web APIs
g,weight); returns void. parameters string a domstring representing the grammar to be added. weight optional a float representing the weight of the grammar relative to other grammars present in the speechgrammarlist. the weight means the importance of this grammar, or the likelihood that it will be recognised by the speech recognition service. the value can be between 0.0 and 1.0; if not
specified, the default used is 1.0. examples var grammar = '#jsgf v1.0; grammar colors; public <color> = aqua | azure | beige | bisque | black | blue | brown | chocolate | coral | crimson | cyan | fuchsia | ghostwhite | gold | goldenrod | gray | green | indigo | ivory | khaki | lavender | lime | linen | magenta | maroon | moccasin | navy | olive | orange | orchid | peru | pink | plum | purple | red | sa...
SpeechGrammarList.addFromURI() - Web APIs
the addfromuri() method of the speechgrammarlist interface takes a grammar present at a specific uri and adds it to the speechgrammarlist as a new speechgrammar object. note that some speech recognition services may support built-in grammars that can be
specified by uri. syntax speechgrammarlistinstance.addfromuri(src,weight); returns void. parameters src a domstring representing the uri of the grammar to be added. weight optional a float representing the weight of the grammar relative to other grammars present in the speechgrammarlist. the weight means the importance of this grammar, or the likelihood that it will be recognised by the speech recognition service. the value can be between 0.0 and 1.0; if not
specified, the default used is 1.0. examples var grammar = '#jsgf v1.0; gr...
SpeechRecognition.lang - Web APIs
syntax var mylang = myspeechrecognition.lang; myspeechrecognition.lang = 'en-us'; value a domstring representing the bcp 47 language tag for the current speechrecognition. examples this code is excerpted from our speech color changer example. ...
SpeechRecognition - Web APIs
es a new speechrecognition object. properties speechrecognition also inherits properties from its parent interface, eventtarget. speechrecognition.grammars returns and sets a collection of speechgrammar objects that represent the grammars that will be understood by the current speechrecognition. speechrecognition.lang returns and sets the language of the current speechrecognition. if not
specified, this defaults to the html lang attribute value, or the user agent's language setting if that isn't set either. speechrecognition.continuous controls whether continuous results are returned for each recognition, or only a single result. defaults to single (false.) speechrecognition.interimresults controls whether interim results should be returned (true) or not (false.) interim results are re...
StylePropertyMapReadOnly.get() - Web APIs
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. ...
StylePropertyMapReadOnly - Web APIs
s an array of a given object's own enumerable property [key, value] pairs, in the same order as that provided by a for...in loop (the difference being that a for-in loop enumerates properties in the prototype chain as well). stylepropertymapreadonly.foreach() executes a provided function once for each element of stylepropertymapreadonly. stylepropertymapreadonly.get() returns the value of the
specified property. stylepropertymapreadonly.getall() returns an array of cssstylevalue objects containing the values for the provided property. stylepropertymapreadonly.has() indicates whether the
specified property is in the stylepropertymapreadonly object. stylepropertymapreadonly.keys() returns a new array iterator containing the keys for each item in stylepropertymapreadonly. stylepropertymapre...
StyleSheet.title - Web APIs
the title property of the stylesheet interface returns the advisory title of the current style sheet. the title is often
specified in the ownernode. specifications specification status comment css object model (cssom)the definition of 'stylesheet: title' in that specification. working draft ...
SubmitEvent - Web APIs
the submitevent interface defines the object used to represent an html form's submit event. this event is fired at the <form> when the form's submit action is invoked. constructor submitevent() creates and returns a new submitevent object whose type and other options are configured as
specified. note that currently, the only valid type for a submitevent is submit. properties in addition to the properties listed below, this interface inherits the properties of its parent interface, event. submitter read only an htmlelement object which identifies the button or other element which was invoked to trigger the form being submitted. methods while submitevent offers no methods of its own, it inherits any
specified by its parent interface, event. examples in this example, a shopping cart...
SubtleCrypto.decrypt() - Web APIs
containing the data to be decrypted (also known as ciphertext). return value result is a promise that fulfills with an arraybuffer containing the plaintext. exceptions the promise is rejected when the following exceptions are encountered: invalidaccesserror raised when the requested operation is not valid for the provided key (e.g. invalid encryption algorithm, or invalid key for the
specified encryption algorithm). operationerror raised when the operation failed for an operation-specific reason (e.g. algorithm parameters of invalid sizes, or there was an error decrypting the ciphertext). supported algorithms the decrypt() method supports the same algorithms as the encrypt() method. examples note: you can try the working examples on github. rsa-oaep this code decrypts cipher...
SubtleCrypto.wrapKey() - Web APIs
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 the derivekey method. the key material is a password supplied by the user. */ function getkeymate...
SubtleCrypto - Web APIs
responding to the format, the algorithm, raw key data, usages, and extractability given as parameters. subtlecrypto.exportkey() returns a promise that fulfills with a buffer containing the key in the requested format. subtlecrypto.wrapkey() returns a promise that fulfills with a wrapped symmetric key for usage (transfer and storage) in insecure environments. the wrapped key matches the format
specified in the given parameters, and wrapping is done by the given wrapping key, using the
specified algorithm. subtlecrypto.unwrapkey() returns a promise that fulfills with a cryptokey corresponding to the wrapped key given in the parameter. using subtlecrypto we can split the functions implemented by this api into two groups: cryptography functions and key management functions. cryptography funct...
SyncManager.register() - Web APIs
ation) { ... }) returns a promise that resolves to an instance of syncregistration. parameters options optional an object that sets options for an instance of syncregistration. the available options are: allowonbattery: a boolean that determines whether synchronization is allowed when the user agent is on a battery-powered device. the default is true. id: the unique identifier of the
specified syncregistration object. idlerequired: a boolean that determines whether synchronization is allowed when the user agent's device is idle. the default is false. maxdelay: the maximum delay in milliseconds before the next sync event (or the first sync event if it is periodic). the default is 0, meaning there is no maximum delay. mindelay: the minimum delay in milliseconds before the next sync...
Text.replaceWholeText() - Web APIs
the replaced nodes are removed, including the current node, unless it was the recipient of the replacement text. a domexception with the value no_modification_err is thrown if one of the text nodes being replaced is read only. this method returns the text node which received the replacement text, or null if the replacement text is an empty string. ...
Text - Web APIs
roperties included from slotable the text interface includes the following property, defined on the slotable mixin. slotable.assignedslot read only returns a htmlslotelement representing the <slot> the node is inserted in. methods inherits methods from its parent, characterdata. text.replacewholetext replaces the text of the current node and all logically adjacent nodes with the
specified text. text.splittext breaks the node into two nodes at a
specified offset. specifications specification status comment domthe definition of 'text' in that specification. living standard removed the iselementcontentwhitespace property. removed the replacewholetext() method. added the text() constructor. added the assignedslot property. ...
TextDecoder() - Web APIs
if the value for utflabel is unknown, or is one of the two values leading to a 'replacement' decoding algorithm ( "iso-2022-cn" or "iso-2022-cn-ext"), a domexception with the "typeerror" value is thrown. syntax decoder = new textdecoder(utflabel, options); parameters utflabeloptional is a domstring, defaulting to "utf-8", containing the label of the encoder. ...
TextDecoder - Web APIs
r encoding, which is appropriate for cyrillic script. let win1251decoder = new textdecoder('windows-1251'); let bytes = new uint8array([207, 240, 232, 226, 229, 242, 44, 32, 236, 232, 240, 33]); console.log(win1251decoder.decode(bytes)); // Привет, мир! constructor textdecoder() returns a newly constructed textdecoder that will generate a code point stream with the decoding method
specified in parameters. properties the textdecoder interface doesn't inherit any properties. textdecoder.prototype.encodingread only is a domstring containing the name of the decoder, that is a string describing the method the textdecoder will use. textdecoder.prototype.fatalread only is a boolean indicating whether the error mode is fatal. textdecoder.prototype.ignorebomread only is a boole...
TextTrackList - Web APIs
onchange an event handler to be called when the change event occurs. onremovetrack an event handler to call when the removetrack event is sent, indicating that a text track has been removed from the media element. methods this interface also inherits methods from its parent interface, eventtarget. gettrackbyid() returns the texttrack found within the texttracklist whose id matches the
specified string. if no match is found, null is returned. events addtrack fired when a new text track has been added to the media element. also available via the onaddtrack property. change fired when a text track has been made active or inactive. also available via the onchange property. removetrack fired when a new text track has been removed from the media element. also available via the on...
TimeRanges.end() - Web APIs
example given a video element with the id "myvideo": var v = document.getelementbyid("myvideo"); var buf = v.buffered; var numranges = buf.length; if (buf.length == 1) { // only one range if (buf.start(0) == 0 && buf.end(0) == v.duration) { // the one range starts at the beginning and ends at // the end of the video, so the whole thing is loaded } } this example looks at the time ranges and looks to see if the entire video has been loaded. ...
TimeRanges.start() - Web APIs
example given a video element with the id "myvideo": var v = document.getelementbyid("myvideo"); var buf = v.buffered; var numranges = buf.length; if (buf.length == 1) { // only one range if (buf.start(0) == 0 && buf.end(0) == v.duration) { // the one range starts at the beginning and ends at // the end of the video, so the whole thing is loaded } } this example looks at the time ranges and looks to see if the entire video has been loaded. ...
Touch.radiusX - Web APIs
in combination with touch.radiusy and touch.rotationangle constructs an ellipse that approximates the size and shape of the area of contact between the user and the screen. this may be a relatively large ellipse representing the contact between a fingertip and the screen or a small area representing the tip of a stylus, for example. note: this attribute has not been formally standardized. it is
specified in the touch events – level 2 draft specification and not in touch events recommendation. this attribute is not widely implemented. syntax var xradius = touchitem.radiusx; return value xradius the x radius of the ellipse that most closely circumscribes the area of contact with the touch surface. example this example illustrates using the touch interface's touch.radiusx, touch.radius...
Touch.radiusY - Web APIs
this value, in combination with touch.radiusx and touch.rotationangle constructs an ellipse that approximates the size and shape of the area of contact between the user and the screen. this may be a large ellipse representing the contact between a fingertip and the screen or a small one representing the tip of a stylus, for example. note: this attribute has not been formally standardized. it is
specified in the touch events – level 2 draft specification and not in touch events recommendation. this attribute is not widely implemented. syntax var yradius = touchitem.radiusy; return value yradius the y radius of the ellipse that most closely circumscribes the area of contact with the screen. example the touch.radiusx example includes an example of this property's usage. specifications...
Touch.rotationAngle - Web APIs
value may be between 0 and 90. together, these three values describe an ellipse that approximates the size and shape of the area of contact between the user and the screen. this may be a relatively large ellipse representing the contact between a fingertip and the screen or a small area representing the tip of a stylus, for example. note: this attribute has not been formally standardized. it is
specified in the touch events – level 2 draft specification and not in touch events recommendation. this attribute is not widely implemented. syntax var angle = touchitem.rotationangle; return value angle the number of degrees of rotation to apply to the described ellipse to align with the contact area between the user and the touch surface. example the touch.radiusx example includes an examp...
TouchList.identifiedTouch() - Web APIs
the identifiedtouch() method returns the first touch item in the touchlist that matches the
specified identifier. it is recommended that you use touchlist.item() instead. syntax var touchitem = touchlist.identifiedtouch(id); parameters id an integer value identifying the touch object to retrieve from the list. return value touchitem a touch object matching the
specified id. specifications not part of any specification. this api was removed from the touch events v2 draft specification. ...
TouchList.item() - Web APIs
syntax var touchpoint = touchlist.item(index); parameters index the index of the touch object to retrieve. the index is a number in the range of 0 to one less than the length of the touchlist. return value touchpoint the requested touch object from the touchlist. returns null if the index is not less than the length of the list. example this code example illustrates the use of the touchlist interface's item method and the length property. ...
TouchList - Web APIs
ple, if the user has three fingers on the touch surface (such as a screen or trackpad), the corresponding touchlist object would have one touch object for each finger, for a total of three entries. properties touchlist.length read only the number of touch objects in the touchlist. methods touchlist.identifiedtouch() returns the first touch item in the list whose identifier matches a
specified value. touchlist.item() returns the touch object at the
specified index in the list. example see the example on the main touch events article. specifications specification status comment touch events – level 2 draft non-stable version. touch events recommendation initial definition. ...
TrackDefault.byteStreamTrackID - Web APIs
the bytestreamtrackid read-only property of the trackdefault interface returns the id of the specific track that the sourcebuffer should apply to. if not
specified in the constructor, this value will be an empty string and the sourcebuffer can contain any tracks of the
specified trackdefault.type. syntax var myid = trackdefault.bytestreamtrackid; value a domstring. example tbd ...
TrackEvent - Web APIs
t's important not to confuse trackevent with the rtctrackevent interface, which is used for tracks which are part of an rtcpeerconnection. events based on trackevent are always sent to one of the 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 ob...
TreeWalker - Web APIs
the treewalker object represents the nodes of a document subtree and a position within them. a treewalker can be created using the document.createtreewalker() method. properties this interface doesn't inherit any property. treewalker.root read only returns a node representing the root node as
specified when the treewalker was created. treewalker.whattoshow read only returns an unsigned long being a bitmask made of constants describing the types of node that must be presented. non-matching nodes are skipped, but their children may be included, if relevant. the possible values are: constant numerical value description nodefilter.show_all -1 (that is the max value of unsigned long) shows all nodes. nodefilter.show_attrib...
ULongRange - Web APIs
the ulongrange dictionary is used to define a range of permitted integer values for a property, with either or both a maximum and minimum value
specified. the constrainulongrange dictionary is based on this, augmenting it to support exact and ideal values as well. properties max a numeric value in the range of signed 32-bit integers, specifying the largest permissible value of the property it describes. min a numeric value in the range of signed 32-bit integers, specifying the smallest permissible value of the property it describes. the
specified min and/or and max values are required. if no match can be found that is within the given range, an error will occur. specifications specification status comment media capture and streamsthe definition of 'ulongrange' in...
URL() - Web APIs
note: this feature is available in web workers. syntax const url = new url(url [, base]) parameters url a usvstring representing an absolute or relative url. if url is a relative url, base is required, and will be used as the base url. if url is an absolute url, a given base will be ignored. base optional a usvstring representing the base url to use in case url is a relative url. if not
specified, it defaults to ''. note: you can still use an existing url object for the base, which stringifies itself to the object's href property. exceptions exception explanation typeerror url (in the case of absolute urls) or base + url (in the case of relative urls) is not a valid url. examples // base urls let m = 'https://developer.mozilla.org'; let a = new ur...
URL.createObjectURL() - Web APIs
the url.createobjecturl() static method creates a domstring containing a url representing the object given in the parameter. the url lifetime is tied to the document in the window on which it was created. the new object url represents the
specified file object or blob object. to release an object url, call revokeobjecturl(). note: this feature is available in web workers. note: this feature is not available in service workers due to its potential to create memory leaks. syntax const objecturl = url.createobjecturl(object) parameters object a file, blob, or mediasource object to create an object url for. return value a domstring containing an object url that can be used to reference the contents of the
specified source object. examples see using object urls to display images. ...
URL.origin - Web APIs
the origin read-only property of the url interface returns a usvstring containing the unicode serialization of the origin of the represented url. the exact structure varies depending on the type of url: for http or https urls, the scheme followed by '://', followed by the domain, followed by ':', followed by the port (the default port, 80 and 443 respectively, if explicitely
specified). for file: urls, the value is browser dependant. for blob: urls, the origin of the url following blob: will 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://mozi...
URL.password - Web APIs
if it is set without first setting the username property, it silently fails. note: this feature is available in web workers. syntax const passwordstring = url.password url.password = newpassword value a usvstring. ...
URL.username - Web APIs
note: this feature is available in web workers. syntax const usernamestring = url.username url.username = newusername value a usvstring. ...
URLSearchParams.append() - Web APIs
as shown in the example below, if the same key is appended multiple times it will appear in the parameter string multiple times for each value. note: this feature is available in web workers. syntax urlsearchparams.append(name, value) parameters name the name of the parameter to append. value the value of the parameter to append. return value void. examples let url = new url('https://example.com?foo=1&bar=2'); let params = new urlsearchparams(url.search.slice(1)); //add a second foo parameter. ...
URLSearchParams.has() - Web APIs
note: this feature is available in web workers. syntax var hasname = urlsearchparams.has(name) parameters name the name of the parameter to find. return value a boolean. ...
URLSearchParams - Web APIs
enting urlsearchparams can directly be used in a for...of structure, for example the following two lines are equivalent: for (const [key, value] of mysearchparams) {} for (const [key, value] of mysearchparams.entries()) {} note: this feature is available in web workers. constructor urlsearchparams() returns a urlsearchparams object instance. methods urlsearchparams.append() appends a
specified key/value pair as a new search parameter. urlsearchparams.delete() deletes the given search parameter, and its associated value, from the list of all search parameters. urlsearchparams.entries() returns an iterator allowing iteration through all key/value pairs contained in this object. urlsearchparams.foreach() allows iteration through all values contained in this object via a callback fun...
URLUtilsReadOnly.origin - Web APIs
for url using file: scheme, the value is browser dependant. this version of origin is implemented by workerlocation for use on workers. ...
URL API - Web APIs
lication/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 definition of a url and how it is structured and parsed. also covered are definitions 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 constituent parts through its properties. let addr = new url("/docs/web/api/url_api"); let host = addr.host; let path = addr.pathname; the snippet above creates a url object for the article you're reading right now, then fetch...
USB.requestDevice() - Web APIs
the requestdevice() method of the usb interface 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. syntax usb.requestdevice([filters]) parameters filters an array of filter objects for possible devices you would like to pair. each filter object can have the following properties: vendorid productid classcode subclasscode protocolcode serialnumber return value a promise that resolves with an instance of usbdevice. example the following example looks for one of two usb devices. notice that two product ids are
specified. both are passed to requestdevice(). this triggers a user-agent flow that prompts the user to select a device for pairing. only the selected devic...
USB - Web APIs
lers usb.onconnect an event handler called whenever a previously paired device is connected. usb.ondisconnect an event handler called whenever a paired device is disconnected. 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 definition of 'usb' in that specification. draft initial definition. ...
USBAlternateInterface - Web APIs
e protocol supported by this interface. this is equal to the binterfaceprotocol field of the interface descriptor defining this interface. the meaning of this value depends on the interfaceclass and interfacesubclass fields. usbalternateinterface.interfacenameread only returns the name of the interface, if one is provided by the device. this is the value of the string descriptor with the index
specified by the iinterface 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 definition of 'usbalternateinterface' in that specification. ...
USBDevice.opened - Web APIs
usbdevice interface indicates whether a session has been started with a paired usb device. a device must be opened before it can be controlled by a web page. syntax var serialnumber = usbdevice.opened value a boolean. example this example is for a hypothetical usb device with a multi-colored led. it shows how to test that a device is open before calling usbdevice.controltransferout to set a
specified led color. what data can be passed to a usb device and how it is passed is particular and unique to each device. async setdevicecolor(usbdevice, r, g, b) { if (device.opened) { // this hypothetical usb device requires that the data passed to // it be in a uint8array. let payload = new uint8array([r, g, b]); await usbdevice.controltransferout({ requesttype: 'ven...
USBDevice.selectAlternateInterface() - Web APIs
syntax var promise = usbdevice.selectalternateinterface(interfacenumber, alternatesetting) parameters interfacenumber the index of one of the interfaces supported by the device. interfaces are device-specific. alternatesetting the configuration of the selected interface. return value a promise. ...
USBDevice.selectConfiguration() - Web APIs
syntax var promise = usbdevice.selectconfiguration(configurationvalue) parameters configurationvalue the number of a device-specific configuration. return value a promise. ...
USBDevice.serialNumber - Web APIs
the serialnumber read only property of the usbdevice interface is the manufacturer-defined serial number for the specific usb device. syntax var serialnumber = usbdevice.serialnumber value the serial number for the
specified usb device specifications specification status comment webusbthe definition of 'serialnumber' in that specification. draft initial definition. ...
USBDevice - Web APIs
a promise that resolves when a device session has started. usbdevice.releaseinterface() returns a promise that resolves when a cliamed interface is released from exclusive access. usbdevice.reset() returns a promise that resolves when the device is reset and all app operations canceled and their promises rejected. usbdevice.selectalternateinterface() returns a promise that resolves when the
specified alternative endpoint is selected. usbdevice.selectconfiguration() returns a promise that resolves when the
specified configuration is selected. usbdevice.transferin() returns a promise that resolves with a usbtransferinresult when bulk or interrupt data is received from the usb device. usbdevice.transferout() returns a promise that resolves with a usbtransferoutresult when bulk or interrupt...
VideoTrack.id - Web APIs
klist.gettrackbyid() method to locate a specific track within the media associated with a media element. the track id can also be used as the fragment of a url that loads the specific track (if the media supports media fragments). syntax var trackid = videotrack.id; value a domstring which identifies the track, suitable for use when calling gettrackbyid() on an videotracklist such as the one
specified by a media element's videotracks property. specifications specification status comment html living standardthe definition of 'videotrack: id' in that specification. living standard ...
VideoTrack.label - Web APIs
k.label; value a domstring specifying the track's human-readable label, if one is available in the track metadata. otherwise, an empty string ("") is returned. for example, a track whose kind is "sign" might have a label such as "a sign-language interpretation.". example this example returns an array of track kinds and labels for potential use in a user interface to select video tracks for a
specified media element. the list is filtered to only allow certain track kinds through. function gettracklist(el) { var tracklist = []; const wantedkinds = [ "main", "alternative", "commentary" ]; el.videotracks.foreach(function(track) { if (wantedkinds.includes(track.kind)) { tracklist.push({ id: track.id, kind: track.kind, label: track.label }); ...
Videotrack.language - Web APIs
track. for tracks that include multiple languages (such as a movie in english in which a few lines are spoken in other languages), this should be the video's primary language. syntax var videotracklanguage = videotrack.language; value a domstring specifying the bcp 47 (rfc 5646) format language tag of the primary language used in the video track, or an empty string ("") if the language is not
specified or known, or if the track doesn't contain speech. for example, if the primary language used in the track is united states english, this value would be "en-us". for brazilian portuguese, the value would be "pt-br". specifications specification status comment html living standardthe definition of 'videotrack: language' in that specification. living standard ...
VideoTrack - Web APIs
he main video track would have a kind of "main". label read only a domstring providing a human-readable label for the track. for example, a track whose kind is "sign" might have a label of "a sign-language interpretation". this string is empty if no label is provided. language read only a domstring specifying the video track's primary language, or an empty string if unknown. the language is
specified as a bcp 47 (rfc 5646) language code, such as "en-us" or "pt-br". sourcebuffer read only the sourcebuffer that created the track. returns null if the track was not created by a sourcebuffer or the sourcebuffer has been removed from the mediasource.sourcebuffers attribute of its parent media source. usage notes to get a videotrack for a given media element, use the element's videotracks prop...
VideoTrackList - Web APIs
a track has changed, due to the track being made active or inactive. onremovetrack an event handler to call when the removetrack event is sent, indicating that a video track has been removed from the media element. methods this interface also inherits methods from its parent interface, eventtarget. gettrackbyid() returns the videotrack found within the videotracklist whose id matches the
specified string. if no match is found, null is returned. events addtrack fired when a new video track has been added to the media element. also available via the onaddtrack property. change fired when a video track has been made active or inactive. also available via the onchange property. removetrack fired when a new video track has been removed from the media element. also available via the...
WebGL2RenderingContext.getIndexedParameter() - Web APIs
ffer. gl.transform_feedback_buffer_size: returns a glsizeiptr. gl.transform_feedback_buffer_start: returns a glintptr. gl.uniform_buffer_binding: returns a webglbuffer. gl.uniform_buffer_size: 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 definition of 'getindexedparameter' in that specification. editor's draft initial definition for webgl. opengl es 3.0the definition of 'glget' in that specification. standard man page of the...
WebGL2RenderingContext.getInternalformatParameter() - Web APIs
num specifying the internal format about which to retrieve information (must be a color-renderable, depth-renderable or stencil-renderable format). pname a glenum specifying the type of information to query. possible values: gl.samples: returns a int32array containing sample counts supported 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 definition of 'getinternalformatparameter' in that specification. editor's draft initial definition for webgl. ...
WebGL2RenderingContext.vertexAttribIPointer() - Web APIs
nt, or gl.unsigned_int. stride a glsizei specifying the offset in bytes between the beginning of consecutive vertex attributes. offset a glintptr specifying an offset in bytes of the first component in the vertex attribute array. must be a multiple of type. return value none. description very similar to webglrenderingcontext.vertexattribpointer(). the main difference is that while values
specified by vertexattribpointer are always interpreted as floating-point values in the shader (even if they were originally
specified as integers in the buffer), this method allows specifying values which are interpreted as integers in the shader. examples linear blend skinning //describe the layout of the buffer: //1. position gl.vertexattribpointer(0, 3, gl.float, false, 20, 0); gl.enablevertexattri...
WebGLRenderingContext.getBufferParameter() - Web APIs
n of the buffer. this is either: gl.static_draw, gl.dynamic_draw, gl.stream_draw. when using a webgl 2 context, the following values are available additionally: gl.static_read, 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 definition of 'getbufferparameter' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgetbufferparameteriv' in that specification. standar...
WebGLRenderingContext.getError() - Web APIs
the webglrenderingcontext.geterror() method of the webgl api returns error information. syntax glenum gl.geterror(); parameters none. return value constant description gl.no_error no error has been recorded. the value of this constant is 0. gl.invalid_enum an unacceptable value has been
specified for an enumerated argument. the command is ignored and the error flag is set. gl.invalid_value a numeric argument is out of range. the command is ignored and the error flag is set. gl.invalid_operation the
specified command is not allowed for the current state. the command is ignored and the error flag is set. gl.invalid_framebuffer_operation the currently bound framebuffer is not framebuffer complete when trying to render ...
WebGLRenderingContext.getProgramInfoLog() - Web APIs
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. when a webglprogram object is initially created, its information log will be a string of length 0. ...
WebGLRenderingContext.getProgramParameter() - Web APIs
form feedback is active. may be gl.separate_attribs or gl.interleaved_attribs. gl.transform_feedback_varyings: returns a glint indicating the number of varying variables 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 definition of 'getprogramparameter' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glgetprogramiv' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.getRenderbufferParameter() - Web APIs
ponent. gl.renderbuffer_stencil_size: returns a glint that is the resolution size (in bits) for the stencil component. when using a webgl 2 context, the following value is available additionally: gl.renderbuffer_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 definition of 'getrenderbufferparameter' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgetrenderbufferparameteriv' in that ...
WebGLRenderingContext.getShaderInfoLog() - Web APIs
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. ...
WebGLRenderingContext.getShaderParameter() - Web APIs
glboolean indicating whether or not the shader is flagged for deletion. gl.compile_status: returns a glboolean indicating whether or not the last shader compilation 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 definition of 'getshaderparameter' in that specification. recommendation initial definition. opengl es 2.0the definition of 'glgetshaderiv' in that specification. standard man page of the (similar) opengl api. ...
WebGLRenderingContext.getShaderPrecisionFormat() - Web APIs
syntax webglshaderprecisionformat gl.getshaderprecisionformat(shadertype, precisiontype); parameters shadertype either a gl.fragment_shader or a gl.vertex_shader. precisiontype a precision type value. either gl.low_float, gl.medium_float, gl.high_float, gl.low_int, gl.medium_int, or gl.high_int. return value a webglshaderprecisionformat object or null, if an error occurs. ...
WebGLRenderingContext.getTexParameter() - Web APIs
texture maximum level-of-detail value any float values. gl.texture_min_lod glfloat texture minimum level-of-detail value any float values. gl.texture_wrap_r glenum wrapping 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 definition of 'gettexparameter' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgettexparameter' in that specification. sta...
WebGLRenderingContext.getVertexAttrib() - Web APIs
t the given index. gl.vertex_attrib_array_divisor: returns a glint describing the frequency divisor used for instanced rendering. when using the angle_instanced_arrays extension: 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). examples gl.getvertexattrib(0, gl.vertex_attrib_array_buffer_binding); specifications specification status comment webgl 1.0the definition of 'getvertexattrib' in that specification. recommendation initial definition for webgl. opengl es 2.0the definition of 'glgetvertexattrib' in that specification. standard man page of the opengl es...
WebGLRenderingContext.getVertexAttribOffset() - Web APIs
syntax glintptr gl.getvertexattriboffset(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 definition of 'getvertexattriboffset' in that specification. recommendation initial definition. ...
WebGLRenderingContext.readPixels() - Web APIs
syntax // webgl1: void gl.readpixels(x, y, width, height, format, type, pixels); // webgl2: void gl.readpixels(x, y, width, height, format, type, glintptr offset); void gl.readpixels(x, y, width, height, format, type, arraybufferview pixels, gluint dstoffset); parameters x a glint specifying the first horizontal pixel that is read from the lower left corner of a rectangular block of pixels. y a glint specifying the first vertical pixel that is read from the lower left corner of a rectangular block of pixels. ...
WebGLRenderingContext.scissor() - Web APIs
syntax void gl.scissor(x, y, width, height); parameters x a glint specifying the horizontal coordinate for the lower left corner of the box. default value: 0. y a glint specifying the vertical coordinate for the lower left corner of the box. default value: 0. width a non-negative glsizei specifying the width of the scissor box. default value: width of the canvas. height a non-negative glsizei specifying the height of the scissor box. default value: height of the canvas. return value none. ...
WebGLRenderingContext.stencilOp() - Web APIs
a glenum specifying the function to use when both the stencil test and the depth test pass, or when the stencil test passes and there is no depth buffer or depth testing is disabled. the default value is gl.keep. return value none. constants gl.keep keeps the current value. gl.zero sets the stencil buffer value to 0. gl.replace sets the stencil buffer value to the reference value as
specified by webglrenderingcontext.stencilfunc(). gl.incr increments the current stencil buffer value. clamps to the maximum representable unsigned value. gl.incr_wrap increments the current stencil buffer value. wraps stencil buffer value to zero when incrementing the maximum representable unsigned value. gl.decr decrements the current stencil buffer value. clamps to 0. gl.decr_wrap decrements the...
WebGLRenderingContext.stencilOpSeparate() - Web APIs
a glenum specifying the function to use when both the stencil test and the depth test pass, or when the stencil test passes and there is no depth buffer or depth testing is disabled. the default value is gl.keep. return value none. constants gl.keep keeps the current value. gl.zero sets the stencil buffer value to 0. gl.replace sets the stencil buffer value to the reference value as
specified by webglrenderingcontext.stencilfunc(). gl.incr increments the current stencil buffer value. clamps to the maximum representable unsigned value. gl.incr_wrap increments the current stencil buffer value. wraps stencil buffer value to zero when incrementing the maximum representable unsigned value. gl.decr decrements the current stencil buffer value. clamps to 0. gl.decr_wrap decrements the...
WebGLRenderingContext.texParameter[fi]() - Web APIs
ture. 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. the pname parameter is a glenum specifying the texture parameter to set. the param parameter is a glfloat or glint specifying the value for the
specified parameter pname. pname description param available in webgl 1 gl.texture_mag_filter texture magnification filter gl.linear (default value), gl.nearest. gl.texture_min_filter texture minification filter gl.linear, gl.nearest, gl.nearest_mipmap_nearest, gl.linear_mipmap_nearest, gl.nearest_mipmap_linear (default value), gl.linear_mipmap_lin...
WebGLRenderingContext.useProgram() - Web APIs
syntax 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 definition of 'useprogram' in that specification. recommendation initial definition. ...
WebGL constants - Web APIs
int_vec3 0x8b54 int_vec4 0x8b55 bool 0x8b56 bool_vec2 0x8b57 bool_vec3 0x8b58 bool_vec4 0x8b59 float_mat2 0x8b5a float_mat3 0x8b5b float_mat4 0x8b5c sampler_2d 0x8b5e sampler_cube 0x8b60 shader precision-
specified types constant name value description low_float 0x8df0 medium_float 0x8df1 high_float 0x8df2 low_int 0x8df3 medium_int 0x8df4 high_int 0x8df5 framebuffers and renderbuffers constant name value description framebuffer 0x8d40 ...
Getting started with WebGL - Web APIs
ocument.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_buffer_bit); } window.onload = main; 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 displ...
WebGL model view projection - Web APIs
ition, 1.0); the results view on jsfiddle the viewing frustum before we move on to covering how to compute a perspective projection matrix, we need to introduce the concept of the viewing frustum (also known as the view frustum). this is the region of space whose contents are visible to the user at the current time. it's the 3d region of space defined by the field of view and the distances
specified as the nearest and farthest content that should be rendered. while rendering, we need to determine which polygons need to be rendered in order to represent the scene. this is what the viewing frustum defines. but what's a frustum in the first place? a frustum is the 3d solid that results from taking any solid and slicing off two sections of it using two parallel planes. consider our camera, whi...
WebRTC connectivity - Web APIs
and rtcpeerconnection.remotedescription), the returned value is the value of pendinglocaldescription/pendingremotedescription if there's a pending description (that is, the pending description isn't null); otherwise, the current description (currentlocaldescription/currentremotedescription) is returned. when changing the description by calling setlocaldescription() or setremotedescription(), the
specified description is set as the pending description, and the webrtc layer begins to evaluate whether or not it's acceptable. once the proposed description has been agreed upon, the value of currentlocaldescription or currentremotedescription is changed to the pending description, and the pending description is set to null again, indicating that there isn't a pending description. the pendinglocaldescr...
WebRTC API - Web APIs
urn server). rtcrtpcontributingsource contains information about a given contributing source (csrc) including the most recent time a packet that the source contributed was played out. events bufferedamountlow the amount of data currently buffered by the data channel—as indicated by its bufferedamount property—has decreased to be at or below the channel's minimum buffered data size, as
specified by bufferedamountlowthreshold. close the data channel has completed the closing process and is now in the closed state. its underlying data transport is completely closed at this point. you can be notified before closing completes by watching for the closing event instead. closing the rtcdatachannel has transitioned to the closing state, indicating that it will be closed soon. you can detect ...
WebSocket() - Web APIs
ich to connect; this should be the url to which the websocket server will respond. protocols optional either a single protocol string or an array of protocol strings. these strings are used to indicate sub-protocols, so that a single server can implement multiple websocket sub-protocols (for example, you might want one server 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 definition of 'the websocket constructor' in that specification. living standard ...
WebSocket.close() - Web APIs
the websocket.close() method closes the websocket connection or connection attempt, if any. if the connection is already closed, this method does nothing. syntax websocket.close(); parameters code optional a numeric value indicating the status code explaining why the connection is being closed. if this parameter is not
specified, a default value of 1005 is assumed. see the list of status codes of closeevent for permitted values. reason optional a human-readable string explaining why the connection is closing. this string must be no longer than 123 bytes of utf-8 text (not characters). exceptions thrown invalid_access_err an invalid code was
specified. syntax_err the reason string is too long or contains unpaired surrogates. note: in gecko, this method didn't support any paramet...
WebSocket.send() - Web APIs
if the data can't be sent (for example, because it needs to be buffered but the buffer is full), the socket is closed automatically. syntax websocket.send("hello server!"); parameters data the data to send to the server. it may be one of the following types: usvstring a text string. the string is added to the buffer in utf-8 format, and the value of bufferedamount is increased by the number of bytes required to represent the utf-8 string. ...
Writing WebSocket client applications - Web APIs
hough some software may allow you to use the insecure ws:// for local connections. protocols optional either a single protocol string or an array of protocol strings. these strings are used to indicate sub-protocols, so that a single server can implement multiple websocket sub-protocols (for example, you might want one server 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. the constructor will throw a securityerror if the destination doesn't allow access. this may happen if you attempt to use an insecure connection (most user agents now require a secure link for all websocket connections unless they're on the same device or possibly on the same network). connection errors if an error...
Writing WebSocket servers - Web APIs
act same payload data as the ping (for pings and pongs, the max payload length is 125). you might also get a pong without ever sending a ping; ignore this if it happens. if you have gotten more than one ping before you get the chance to send a pong, you only send one pong. closing the connection to close a connection either the client or server can send a control frame with data containing a
specified control sequence to begin the closing handshake (detailed in section 5.5.1). upon receiving such a frame, the other peer sends a close frame in response. the first peer then closes the connection. any further data received after closing of connection is then discarded. miscellaneous websocket codes, extensions, subprotocols, etc. are registered at the iana websocket protocol registry. webso...
Web Video Text Tracks Format (WebVTT) - Web APIs
se of a notepad and then save the file as ‘.vtt’ file. steps are given below: open a notepad. the first line of webvtt is standardized similar to the way some other languages require you to put headers as the file starts to indicate the file type. on the very first line you have to write: webvtt 3. leave the second line blank, and on the third line the time for first cue is to be
specified. for example, for a first cue starting at time 1 second and ending at 5 seconds, it is written as: 00:01.000 --> 00:05.000 on the next line you can write the caption for this cue which will run from 1st second to the 5th second, inclusive. following the similar steps, a complete webvtt file for specific video or audio file can be made. css pseudo-classes css pseudo classes allow us to cla...
Using bounded reference spaces - Web APIs
requiredfeatures: ["local-floor"], optionalfeatures: ["bounded-floor"] }).then((session) => { xrsession = session; startsessionanimation(); }); } } this function, called when the user clicks on a button to start the xr experience, works as usual, exiting at once if a session is already in place, then requesting a new session using immersive-vr mode. the options
specified when requesting the session indicate that at a minimum, the session must be compatible with the local-floor reference space, but that it would be nice if the bounded-floor space were supported as well. once the session has been created, our startsessionanimation() function can try to establish a bounded-floor reference space, and if it fails to do so it can then fall back to requesting a local-f...
Using the Web Animations API - Web APIs
h each loop of the animation unless told otherwise. when we want to explicitly set a key’s offset from the other keys, we can specify an offset directly in the object, separated from the declaration with a comma. in the above example, to make sure that alice’s color changes at 30% (not 50%) for the color change, we are giving it offset: 0.3. currently, there should be at least two keyframes
specified (representing the starting and ending states of the animation sequence). if your keyframe list has only one entry, element.animate() may throw a notsupportederror 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 p...
Controlling multiple parameters with ConstantSourceNode - Web APIs
all of its outputs, it acts as a splitter for that value, sending it to each connected parameter. the diagram below shows how this works; an input value, n, is set as the value of the constantsourcenode.offset property. the constantsourcenode can have as many outputs as necessary; in this case, we've connected it to three nodes: two gainnodes and a stereopannernode. so n becomes the value of the
specified parameter (gain for the gainnodes and pan for the stereopannernode. as a result, every time you change n (the value of the input audioparam, the values of the two gainnodes' gain properties and the value of the stereopannernode's pan propertry are all set to n as well. example let's take a look at this technique in action. in this simple example, we create three oscillatornodes. two of them ...
Example and tutorial: Simple synth keyboard - Web APIs
om", we call oscillatornode.setperiodicwave() to configure the oscillator to use our custom waveform. doing this automatically sets the oscillator's type to custom. if any other waveform type is selected in the wave picker, we simply set the oscillator's type to the value of the picker; that value will be one of sine, square, triangle, and sawtooth. the oscillator's frequency is set to the value
specified in the freq parameter by setting the value of the oscillator.frequency audioparam object. then, at last, the oscillator is started up so that it begins to produce sound by calling the oscillator's inherited audioscheduledsourcenode.start() method. playing a tone when the mousedown or mouseover event occurs on a key, we want to start playing the corresponding note. the notepressed() function is ...
Background audio processing using AudioWorklet - Web APIs
rything else going on until it completed execution. this was far less than ideal, especially for something that can be as computationally expensive as audio processing. enter audioworklet. an audio context's audio worklet is a worklet which runs off the main thread, executing audio processing code added to it by calling the context's audioworklet.addmodule() method. calling addmodule() loads the
specified javascript file, which should contain the implementation of the audio processor. with the processor registered, you can create a new audioworkletnode which passes the audio through the processor's code when the node is linked into the chain of audio nodes along with any other audio nodes. the process of creating an audio processor using javascript, establishing it as an audio worklet processor, ...
Web Bluetooth API - Web APIs
bluetoothadvertisingdata provides advertising data about a particular bluetooth device. bluetoothcharacteristicproperties provides properties of a particular bluetoothremotegattcharacteristic. bluetoothdevice represents a bluetooth device inside a particular script execution environment. ...
Using Web Workers - Web APIs
ers are a simple means for web content to run scripts in background threads. the worker thread can perform tasks without interfering with the user interface. in addition, they can perform i/o using xmlhttprequest (although the responsexml and channel attributes are always null). once created, a worker can send messages to the javascript code that created it by posting messages to an event handler
specified by that code (and vice versa). this article provides a detailed introduction to using web workers. web workers api a worker is an object created using a constructor (e.g. worker()) that runs a named javascript file — this file contains the code that will run in the worker thread; workers run in another global context that is different from the current window. thus, using the window shortcut t...
WheelEvent() - Web APIs
"deltaz", optional and defaulting to 0.0, is a double representing the scroll amount for the z-axis in the deltamode unit. "deltamode", optional and defaulting to 0, is a unsigned long representing the unit of the delta values scroll amount. 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. dom_delta_page 0x02 the delta values are
specified in pages. the wheeleventinit dictionary also accepts fields from the mouseeventinit, uieventinit and eventinit dictionaries. specifications specification status comment ...
WheelEvent.deltaMode - Web APIs
the wheelevent.deltamode read-only property returns an unsigned long representing the unit of the delta values scroll amount. 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. dom_delta_page 0x02 the delta values are
specified in pages. syntax var unit = event.deltamode; example var syntheticevent = new wheelevent("syntheticwheel", {"deltax": 4, "deltamode": 0}); console.log(syntheticevent.deltamode); specifications specification status comment document object model (dom) level 3 events specificationthe definition of 'wheelevent.deltamode' in that specification. obsolete in...
WheelEvent - Web APIs
presenting the vertical scroll amount. wheelevent.deltazread only returns a double representing the scroll amount for the z-axis. wheelevent.deltamoderead only returns an unsigned long representing the unit of the delta* values' scroll amount. permitted values are: constant value description wheelevent.dom_delta_pixel 0x00 the delta* values are
specified in pixels. wheelevent.dom_delta_line 0x01 the delta* values are
specified in lines. wheelevent.dom_delta_page 0x02 the delta* values are
specified in pages. methods this interface doesn't define any specific methods, but inherits methods from its ancestors, mouseevent, uievent, and event. specifications specification status co...
Window.alert() - Web APIs
syntax window.alert(message); parameters message optional a string you want to display in the alert dialog, or, alternatively, an object that is converted into a string and displayed. example window.alert("hello world!"); alert("hello world!"); both produce: notes the alert dialog should be used for messages which do not require any response on the part of the user, other than the acknowledgement of the message. ...
Window.captureEvents() - Web APIs
syntax window.captureevents(eventtype) eventtype is a combination of the following values: event.abort, event.blur, event.click, event.change, event.dblclick, event.dragddrop, event.error, event.focus, event.keydown, event.keypress, event.keyup, event.load, event.mousedown, event.mousemove, event.mouseout, event.mouseover, event.mouseup, event.move, event.reset, event.resize, event.select, event.submit, event.unload. example <!doctype html> <html lang="en"> <head> <!-- ... ...
Window.clearImmediate() - Web APIs
this method is not expected to become standard, and is only implemented by recent builds of internet explorer and node.js 0.10+. it meets resistance both from gecko (firefox) and webkit (google/apple). syntax window.clearimmediate( immediateid ) where immediateid is a id returned by window.setimmediate. examples let immediateid = setimmediate(() => { // run some code } document.getelementbyid("button") .addeventlistener(() => { clearimmediate(immediateid); }); specifications specification status comment efficient script yielding the definition of 'setimmediate' in that specification. ...
window.dump() - Web APIs
window.dump() prints messages to the (native) console. syntax window.dump(message); dump(message); parameters message is the string message to log. notes a common use of dump() is to debug javascript. the message passed to dump() is sent to the system console (native console) if the firefox process was started with the -console option. if the -console option was not
specified then the output goes to stderr. output from dump() is not sent to the browser console. output can be sent to the browser console using console.log(). privileged code can also use components.utils.reporterror and nsiconsoleservice to log messages to the error console/browser console. dump() is also available to xpcom components implemented in javascript, even though window is not the global object in comp...
Window.getDefaultComputedStyle() - Web APIs
the default computed values of all the css properties of an element, ignoring author styling. that is, only user-agent and user styles are taken into account. syntax var style = window.getdefaultcomputedstyle(element [, pseudoelt]); parameters element the element for which to get the computed style. pseudoelt optional a string specifying the pseudo-element to match. must be null (or not
specified) for regular elements. return value the returned style is a cssstyledeclaration object. the object is of the same type as the object returned by window.getcomputedstyle(), but only takes into account user-agent and user rules. example simple example var elem1 = document.getelementbyid("elemid"); var style = window.getdefaultcomputedstyle(elem1); longer example <style> #elem-container...
Window.localStorage - Web APIs
orage; value a storage object which can be used to access the current origin's local storage space. exceptions securityerror the request violates a policy decision, or the origin is not a valid scheme/host/port tuple (this can happen if the origin uses the file: or data: scheme, for example). for example, the user may have their browser configured to deny permission to persist data for the
specified origin. example the following snippet accesses the current domain's local storage object and adds a data item to it using storage.setitem(). localstorage.setitem('mycat', 'tom'); the syntax for reading the localstorage item is as follows: const cat = localstorage.getitem('mycat'); the syntax for removing the localstorage item is as follows: localstorage.removeitem('mycat'); the syntax fo...
Window.moveBy() - Web APIs
note: this function moves the window relative to its current location. in contrast, window.moveto() moves the window to an absolute location. syntax window.moveby(deltax, deltay) parameters deltax is the amount of pixels to move the window horizontally. positive values are to the right, while negative values are to the left. deltay is the amount of pixels to move the window vertically. positive values are down, while negative values are up. example this example moves the window 10 pixels to the right and 10 pixels up. ...
Window.moveTo() - Web APIs
note: this function moves the window to an absolute location. in contrast, window.moveby() moves the window relative to its current location. syntax window.moveto(x, y) parameters x is the horizontal coordinate to be moved to. y is the vertical coordinate to be moved to. example this example moves the window to the top-left corner of the screen. ...
Window.openDialog() - Web APIs
dialog window. to access these extra parameters from within dialog code, use the following scheme: var food = window.arguments[0]; var price = window.arguments[1]; note that you can access this property from within anywhere in the dialog code. (another example). returning values from the dialog since window.close() erases all properties associated with the dialog window (i.e. the variables
specified in the javascript code which gets loaded from the dialog), it is not possible to pass return values back past the close operation using globals (or any other constructs). to be able to pass values back to the caller, you have to supply some object via the extra parameters. you can then access this object from within the dialog code and set properties on it, containing the values you want to retu...
Window.requestAnimationFrame() - Web APIs
the method takes a callback as an argument to be invoked before the repaint. note: your callback routine must itself call requestanimationframe() if you want to animate another frame at the next repaint. you should call this method whenever you're ready to update your animation onscreen. this will request that your animation function be called before the browser performs the next repaint. ...
Window.resizeBy() - Web APIs
syntax window.resizeby(xdelta, ydelta) parameters xdelta is the number of pixels to grow the window horizontally. ydelta is the number of pixels to grow the window vertically. example // shrink the window window.resizeby(-200, -200); notes this method resizes the window relative to its current size. to resize the window in absolute terms, use window.resizeto(). creating and resizing an external window for security reasons, it's no longer possible in firefox for a website to change the default size of a window in a browser if the window wasn’t created by window.open(), or contains more than one tab. ...
Window.scrollByLines() - Web APIs
syntax window.scrollbylines(lines) parameters lines is the number of lines to scroll the document by. it may be a positive or negative integer. ...
Window.scrollByPages() - Web APIs
syntax window.scrollbypages(pages) parameters pages is the number of pages to scroll. it may be a positive or negative integer. ...
Window.sessionStorage - Web APIs
ge; value a storage object which can be used to access the current origin's session storage space. exceptions securityerror the request violates a policy decision, or the origin is not a valid scheme/host/port tuple (this can happen if the origin uses the file: or data: scheme, for example). for example, the user may have their browser configured to deny permission to persist data for the
specified origin. example the following snippet accesses the current origin's session storage object and adds data to it with storage.setitem(). sessionstorage.setitem('mycat', 'tom'); the following example autosaves the contents of a text field, and if the browser is refreshed, restores the text field content so that no writing is lost. // get the text field that we're going to track let field = doc...
WindowClient.navigate() - Web APIs
syntax windowclient.navigate(url).then(function(windowclient) { // do something with your windowclient after navigation }); parameters url the location to navigate to. return value a promise that resolves to the existing windowclient. ...
WindowClient - Web APIs
cope of a service worker client that is a document in a browsing context, controlled by an active worker. the service worker client independently selects and uses a service worker for its own loading and sub-resources. methods windowclient inherits methods from its parent interface, client. windowclient.focus() gives user input focus to the current client. windowclient.navigate() loads a
specified url into a controlled client page. properties windowclient inherits properties from its parent interface, client. windowclient.focused read only a boolean that indicates whether the current client has focus. windowclient.visibilitystate read only indicates the visibility of the current client. this value can be one of "hidden", "visible", or "prerender". example self.addeventlistene...
WindowOrWorkerGlobalScope.fetch() - Web APIs
keepalive flag is a replacement for the navigator.sendbeacon() api. signal an abortsignal object instance; allows you to communicate with a fetch request and abort it if desired via an abortcontroller. return value a promise that resolves to a response object. exceptions aborterror the request was aborted due to a call to the abortcontroller method abort() method. typeerror the
specified url string includes user credentials. this information should instead be provided using an authorization header. examples in our fetch request example (see fetch request live) we create a new request object using the relevant constructor, then fetch it using a fetch() call. since we are fetching an image, we run body.blob() on the response to give it the proper mime type so it will be handled ...
Worker - Web APIs
scripts inside a worker. workers may use xmlhttprequest for network communication, but its responsexml and channel attributes are always null. (fetch is also available, with no such restrictions.) in firefox extensions, if you want to use workers with access to js-ctypes, use chromeworker object instead. constructors worker() creates a dedicated web worker that executes the script at the
specified url. this also works for blob urls. properties inherits properties from its parent, eventtarget, and implements properties from abstractworker. event handlers abstractworker.onerror an eventlistener called whenever an errorevent of type error bubbles through to the worker. this is inherited from abstractworker. worker.onmessage an eventlistener called whenever a messageevent of type mes...
Worklet.addModule() - Web APIs
ing the module. can be one of "omit", "same-origin", or "include". defaults to "same-origin". see also request.credentials. return value a promise that resolves once the module from the given url has been added. the promise doesn't return any value. exceptions if addmodule() fails, it rejects the promise, delivering one of the following errors to the rejection handler. aborterror the
specified script is invalid or could not be loaded. syntaxerror the
specified moduleurl is invalid. examples audioworklet example const audioctx = new audiocontext(); const audioworklet = audioctx.audioworklet; await audioworklet.addmodule('modules/bypassfilter.js', { credentials: 'omit', }); paintworklet example css.paintworklet.addmodule('https://mdn.github.io/houdini-examples/csspaint/intro/w...
WritableStream.WritableStream() - Web APIs
the underlying sink. if this process is to be done asynchronously, it can return a promise to signal success or failure. the controller parameter passed to this method is a writablestreamdefaultcontroller. this can be used by the developer to control the stream during set up. write(chunk, controller) optional this method, also defined by the developer, will be called when a new chunk of data (
specified in the chunk parameter) is ready to be written to the underlying sink. it can return a promise to signal success or failure of the write operation. the controller parameter passed to this method is a writablestreamdefaultcontroller that can be used by the developer to control the stream as more chunks are submitted for writing. this method will be called only after previous writes have succeeded,...
XDomainRequest - Web APIs
ew xdomainrequest object, which can then be used to make and manage these requests. properties xdomainrequest.timeout gets or sets the amount of time until a request times out. xdomainrequest.responsetext gets the response body as a string. methods xdomainrequest.open() opens the request, specifing the method (get/post) and url. xdomainrequest.send() sends the request. post data is
specified in this method. xdomainrequest.abort() aborts the request. event handlers xdomainrequest.onprogress a handler for when the request has made progress between the send method call and the onload event. xdomainrequest.ontimeout a handler for when the request times out. xdomainrequest.onerror a handler for when a request has errored. xdomainrequest.onload a handler for when the full res...
Sending and Receiving Binary Data - Web APIs
lso read a binary file as a blob by setting the string "blob" to the responsetype property. var oreq = new xmlhttprequest(); oreq.open("get", "/myfile.png", true); oreq.responsetype = "blob"; oreq.onload = function(oevent) { var blob = oreq.response; // ... }; oreq.send(); receiving binary data in older browsers the load_binary_resource() function shown below loads binary data from the
specified url, returning it to the caller. function load_binary_resource(url) { var req = new xmlhttprequest(); req.open('get', url, false); //xhr binary charset opt by marcus granado 2006 [http://mgran.blogspot.com] req.overridemimetype('text\/plain; charset=x-user-defined'); req.send(null); if (req.status != 200) return ''; return req.responsetext; } the magic happens in line 5, which ov...
init() - Web APIs
quest. 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. baseuri the base uri to use when resolving relative uris when handling the request. this may be null. loadgroup optional an optional load group used when performing the request. if this is
specified, it is used even if the global has a window with a load group already established. ...
XMLHttpRequest.overrideMimeType() - Web APIs
be used instead when interpreting the data being transferred in a request. this may be used, for example, to force a stream to be treated and parsed as "text/xml", even if the server does not report it as such. this method must be called before calling send(). syntax xmlhttprequest.overridemimetype(mimetype) parameters mimetype a domstring specifying the mime type to use instead of the one
specified by the server. if the server doesn't specify a type, xmlhttprequest assumes "text/xml". return value undefined. example this example specifies a mime type of "text/plain", overriding the server's stated type for the data being received. note: if the server doesn't provide a content-type header, xmlhttprequest assumes that the mime type is "text/xml". if the content isn't valid xml, an "xml...
XMLHttpRequest.responseText - Web APIs
ived when the value of readystate becomes xmlhttprequest.done (4), and status becomes 200 ("ok"). exceptions invalidstateerror the xmlhttprequest.responsetype is not set to either the empty string or "text". since the responsetext property is only valid for text content, any other value is an error condition. ...
XMLHttpRequest.responseXML - Web APIs
property isn't available to workers. syntax var data = xmlhttprequest.responsexml; value a document from parsing the xml or html received using xmlhttprequest, or null if no data was received or if the data is not xml/html. exceptions invalidstateerror the responsetype isn't either "document" or an empty string. ...
XMLHttpRequest.send() - Web APIs
ccept 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 xmlhttprequestbodyinit, 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 invalidstateerror send() has already been invoked for the request, and/or the request is complete. networkerror ...
XMLHttpRequest.setRequestHeader() - Web APIs
the xmlhttprequest method setrequestheader() sets the value of an http request header. when using setrequestheader(), you must call it after calling open(), but before calling send(). if this method is called several times with the same header, the values are merged into one single request header. each time you call setrequestheader() after the first time you call it, the
specified text is appended to the end of the existing header's content. if no accept header has been set using this, an accept header with the type "*/*" is sent with the request when send() is called. for security reasons, some headers can only be controlled by the user agent. these headers include the forbidden header names and forbidden response header names. note: for your custom fields, you may encounter a "not allowed...
XMLHttpRequest.upload - Web APIs
progress onprogress periodically delivered to indicate the amount of progress made so far. abort onabort the upload operation was aborted. error onerror the upload failed due to an error. load onload the upload completed successfully. timeout ontimeout the upload timed out because a reply did not arrive within the time interval
specified by the xmlhttprequest.timeout. loadend onloadend the upload finished. this event does not differentiate between success or failure, and is sent at the end of the upload regardless of the outcome. prior to this event, one of load, error, abort, or timeout will already have been delivered to indicate why the upload ended. specifications specification status com...
XMLHttpRequest - Web APIs
ddeventlistener() apis in addition to setting on* properties to a handler function. methods xmlhttprequest.abort() aborts the request if it has already been sent. xmlhttprequest.getallresponseheaders() returns all the response headers, separated by crlf, as a string, or null if no response has been received. xmlhttprequest.getresponseheader() returns the string containing the text of the
specified header, or null if either the response has not yet been received or the header doesn't exist in the response. xmlhttprequest.open() initializes a request. xmlhttprequest.overridemimetype() overrides the mime type returned by the server. xmlhttprequest.send() sends the request. if the request is asynchronous (which is the default), this method returns as soon as the request is sent. xmlhttp...
XPathEvaluator.createExpression() - Web APIs
pression into appropriate namespace uris. return value a xpathexpression representing the compiled form of the xpath expression. exceptions invalid_expression_err if the expression is not legal according to the rules of the xpathevaluator, an xpathexception of type invalid_expression_err is raised. namespace_err if the expression contains namespace prefixes which cannot be resolved by the
specified xpathnsresolver, a domexception of type namespace_error is raised. example the following example shows the use of the evaluate() method. html <div>xpath example</div> <div>number of <div>s: <output></output></div> javascript var xpath = "//div"; var evaluator = new xpathevaluator(); var expression = evaluator.createexpression("//div"); var result = expression.evaluate(document, xpath...
XPathEvaluator.createNSResolver() - Web APIs
rmation available in the node's hierarchy at the time the method is called, also correctly resolving the implicit xml prefix. syntax xpathnsresolver 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 definitions in scope for a
specified node. specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathevaluator.creatensresolver()' in that specification. recommendation initial definition ...
XPathEvaluator - Web APIs
methods xpathevaluator.createexpression() creates a parsed xpath expression with resolved namespaces. xpathevaluator.creatensresolver() adapts any dom node to resolve namespaces allowing the xpath expression to be evaluated relative to the context of the node where it appeared within the document. xpathevaluator.evaluate() evaluates an xpath expression string and returns a result of the
specified type if possible. example the following example shows the use of the xpathevaluator interface. html <div>xpath example</div> <div>number of <div>s: <output></output></div> javascript var xpath = "//div"; var evaluator = new xpathevaluator(); var expression = evaluator.createexpression("//div"); var result = expression.evaluate(document, xpathresult.ordered_node_snapshot_type); docum...
XPathException - Web APIs
specifications specification status comment document object model (dom) level 3 xpath specificationthe definition of 'xpathexception' in that specification. recommendation initial definition ...
XRBoundedReferenceSpace.boundsGeometry - Web APIs
ur own, as appropriate. boundary shape the shape defined by boundsgeometry may be as simple as a square or as complex as is needed, potentially including concave and/or convex sections. however, you can't represent spaces with uneven floor levels using xrboundedreferencespace. the ground is always at y = 0. it's important that your content not be designed to require the user to exit the bounds
specified by boundsgeometry. however, if the user's surroundings permit them to move in such a way as to exit the defined bounds, your content must be able to gracefully handle the situation, which is not considered an error condition. although some samples render a mesh or other shape to display the bounds to the user, in a real-world application, you shouldn't do this. the browser, however, should provi...
XRBoundedReferenceSpace - Web APIs
his extends xrreferencespace, which describes an essentially unrestricted space around the viewer's position. these bounds are defined using an array of points, each of which defines a vertex in a polygon inside which the user is allowed to move. this is typically used when the xr system is capable of tracking the user's physical movement within a limited distance of their starting position. the
specified bounds may, in fact, describe the shape and size of the room the user is located in, in order to let the webxr site or application prevent the user from colliding with the walls or other obstacles in the real world. at a minimum, the boundaries indicate the area in which the xr device is capable of tracking the user's movement. see the article using bounded reference spaces for details on how bo...
XRFrame.getViewerPose() - Web APIs
the getviewerpose() method, a member of the xrframe interface, returns a xrviewerpose object which describes the viewer's pose (position and orientation) relative to the
specified reference space. see the getpose() method for a way to calculate a pose that represents the difference between two spaces. syntax var xrviewerpose = xrframe.getviewerpose(referencespace); parameters referencespace an xrreferencespace object specifying the space to use as the reference point or base for the computation of the viewer's current pose. return value a xrviewerpose describing the viewer's position and orientation relative to the
specified reference space. exceptions invalidstateerror a domexception indicating that getviewerpose() was not called within the context of a callback to a se...
XRFrame - Web APIs
e describing the relative position of one xrspace relative to another. properties session read only the xrsession that for which this xrframe describes the tracking details for all objects. the information about a specific object can be obtained 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 definition of 'xrframe' in that specification. working draft initial definition. ...
XRInputSourceArray.forEach() - Web APIs
syntax xrinputsourcearray.foreach(callback, thisarg); parameters callback a function to execute once for each entry in the array xrinputsourcearray. the callback accepts up to three parameters: currentvalue a xrinputsource object which is the value of the item from within the xrinputsourcearray which is currently being processed. currentindex optional an integer value providing the index into the array at which the element given by currentvalue is located. if you don't need to know the index number, you can omit this. ...
XRInputSourceEvent.frame - Web APIs
vent. syntax let inputframe = xrinputsourceevent.frame; value an xrframe indicating the event frame at which the user input event described by the object took place. usage notes the event frame does not correspond to a visual frame as is delivered to the frame rendering callback function (see rendering and the webxr frame rendering callback for details on the callback). instead, the xrframe
specified by the frame property is simply a method to provide access to the getpose() method, which you can use to get the relative positions of the objects in the scene at the time the event occurred. however, since the event frame isn't an animation frame, there is no viewer pose available to represent the viewer's current point of view; the results of calling getviewerpose() will be an xrviewerpose wi...
XRInputSourceEventInit.frame - Web APIs
e 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 delivered to the frame rendering callback function (see rendering and the webxr frame rendering callback for details on the callback). instead, the xrframe
specified by the frame property is simply a method to provide access to the getpose() method, which you can use to get the relative 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.dispat...
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 xrinputsourceschangeeventinit 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 to whi...
XRPermissionDescriptor.mode - Web APIs
esented 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. usage notes examples the example below checks to ensure that permission has been granted to allow the user to use webxr for an immersive virtual reality experience. no specific features are
specified during this query; see requiredfeatures and optionalfeatures for more information on specifying features during a webxr permission check. let xrpermissiondesc = { name: "xr", mode: "immersive-vr" }; if (navigator.permissions) { navigator.permissions.query(xrpermissiondesc).then(({state}) => { switch(state) { case "granted": setupxr(); break; case "prompt": ...
XRPermissionStatus - Web APIs
onitored over time for changes to that permissions tate. properties in addition to the properties listed below, xrpermissionstatus includes the properties defined by its parent interface, permissionstatus. granted an array of strings listing the names of the features for which permission has been granted as of the time at which navigator.permissions.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 definition of 'xrpermissionstatus' in that specification. ...
XRPose.transform - Web APIs
syntax let posetransform = xrpose.transform; value an xrrigidtransform which provides the position and orientation of the xrpose relative to the xrframe to which this xrpose is aligned. this is the same pose that's returned by the frame's getpose() method. example this handler for the xrsession event select handles events for tracked pointers. ...
XRReferenceSpace - Web APIs
the tracking behavior is defined by the selected reference space type. it expands upon the base class, xrspace, by adding support for several different tracking behaviors as well as to request a new reference space which describes the offset transform between the tracked object and another location in the world. all reference spaces—with the sole exception being bounded reference spaces—are described using the xrreferencespace type. ...
XRRenderState - Web APIs
omposited. these properties include the range of distances from the viewer within which content should be rendered, the vertical field of view (for inline presentations), and a reference to the xrwebgllayer being used as the target for rendering the scene prior to it being presented on the xr device's display or displays. when you apply changes using the xrsession method updaterenderstate(), the
specified changes take effect after the current animation frame has completed, but before the next one begins. properties the followiing properties are available on xrrenderstate objects. baselayer read only the xrwebgllayer from which the browser's compositing system obtains the image for the xr session. depthfar read only the distance, in meters, of the far clip plane from the viewer. the f...
XRRigidTransform.orientation - Web APIs
roviding the orientation component of the transform. as a unit quaternion, the length of the returned quaternion is always 1.0 meters. examples to create a reference space which is oriented to look straight up, positioned 2 meters off of ground level: xrreferencespace = refspace.getoffsetreferencespace( new xrrigidtransform({y: -2}, {x: 0.0, y: 1.0, z: 0.0, w: 1.0}); ); the unit quaternion
specified here is [0.0, 1.0, 0.0, 1.0] to indicate that the object should be facing directly along the y axis. specifications specification status comment webxr device apithe definition of 'xrrigidtransform.orientation' in that specification. working draft initial definition. ...
XRRigidTransform - Web APIs
rm in these places rather than bare arrays that providing the matrix data is that the xrrigidtransform automatically does things like computing the inverse of the transform. even better, once it's been computed, it's cached so that subsequent requests are significantly faster. constructor new xrrigidtransform() creates a new xrrigidtransform object which represents a transform that applies a
specified position and/or orientation. attributes xrrigidtransform.position read only a dompointreadonly specifying a 3-dimensional point, expressed in meters, describing the translation component of the transform. the w attribute is always 1.0. xrrigidtransform.orientation read only a dompointreadonly which contains a unit quaternion describing the rotational component of the transform. as a...
XRSession.cancelAnimationFrame() - Web APIs
imationframe() method of the xrsession interface cancels an animation frame which was previously requested by calling requestanimationframe. syntax xrsession.cancelanimationframe(handle); parameters handle the unique value returned by the call to requestanimationframe() that previously scheduled the animation callback. return value none. usage notes this function has no effect if the
specified handle cannot be found. example in the example below we see code which starts up a webxr session if immersive vr mode is supported. once started, the session schedules its first frame to be rendered by calling requestanimationframe(). the pausexr() function shown at the bottom can be called to suspend the webvr session, in essence, by canceling any pending animation frame callback. since each ...
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 xrsessioneventinit 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 its typ...
XRSessionMode - Web APIs
e 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. usage notes the xrsessionmode type indicates the values that can be
specified when calling xr.issessionsupported() to determine whether or not the
specified session type is supported and available to be used, and by requestsession() to attempt to open a new webxr session. the immersive-ar mode supports all the same features and reference spaces that immersive-vr does, since both are immersive sessions. browsers may support either or both of these modes, but if webxr is av...
XRSystem: requestSession() - Web APIs
romise, passing into it a domexception whose name is one of the following: invalidstateerror the requested session mode is immersive-vr but there is already an immersive vr session either currently active or in the process of being set up. there can only be one immersive vr session at a time. notsupportederror there is no webxr-compatible device available, or the device does not support the
specified sessionmode; this can also be thrown if any of the required 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...
XRSystem - Web APIs
ties while xrsystem directly offers no properties, it does inherit properties from its parent interface, eventtarget. methods in addition to inheriting methods from its parent interface, eventtarget, the xrsystem interface includes the following methods: issessionsupported() returns a promise which resolves to true if the browser supports the given xrsessionmode. resolves to false if the
specified mode isn't supported. requestsession() returns a promise that resolves to a new xrsession with the
specified xrsessionmode. events devicechange sent when the set of available xr devices has changed. also available using the ondevicechange event handler. usage notes thsi interface was previously known as simply xr in earlier versions of the specification; if you see references to x...
XRView.transform - Web APIs
with the transform, you can then position the view as a camera within the 3d scene. if you instead need the more traditional view matrix, you can get using view.transform.inverse.matrix; this gets the underlying matrix of the transform's inverse. ...
XRViewport - Web APIs
f the viewport to the bottom edge of the viewport; webgl's coordinate system places (0, 0) at the bottom left corner of the surface. usage notes currently, the only type of surface available is the xrwebgllayer. the precise orientation of the coordinate system may vary with other surface types, but in webgl, the origin (0, 0) is located at the bottom-left corner of the surface. thus the values
specified in an xrviewport define a rectangle whose bottom-left corner 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 a...
XRWebGLLayer.antialias - Web APIs
syntax let antialiasingsupported = xrwebgllayer.antialias; value a boolean value which is true if the webgl rendering layer's frame buffer is configured to support antialiasing. ...
XRWebGLLayer.ignoreDepthValues - Web APIs
redepthvalues 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 xrwebgllayerinit object
specified as the constructor's layerinit 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. otherwise, if t...
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. ...
XRWebGLLayerInit.ignoreDepthValues - Web APIs
, the depth buffer's contents are used, if one is present. using a depth buffer while compositing allows the xr compositor to help ensure the compositing is done as accurately as possible. each entry in the depth buffer corresponds to the depth of the fragment whose color is at the same location in the color buffer, and must have a value between 0.0 and 1.0, where 0.0 corresponds to the distance
specified in the xrsession object's renderstate record's depthnear and 1.0 represents the distance given by depthfar. ignoring depth values causes the compositor to rely solely upon the relative position of objects to establish depth, and may result in less effective and less comfortable 3d effects. the default is false (depth values are used by default). example in this example, a new xrwebgllayer is c...
XSL Transformations in Mozilla FAQ - Web APIs
ff like text entered into textfields and other dynamic changes. this is achieved by printing the current dom tree. having xslt stylesheet specific to particular media would require to retransform the original xml source, which counteracts the expectations of the user. thus, using media in <?xml-stylesheet ?> is strongly discouraged. future builds might only load an xslt stylesheet if media is not
specified, or if the
specified media include screen. this does not affect css stylesheets loaded from the generated dom, those honor media just like in pages without xslt. how do i do transformnode? there is transformtodocument and transformtofragment starting with mozilla 1.2 final, see using the mozilla javascript interface to xsl transformations. why does internet explorer require a different xslt n...
XSLTProcessor - Web APIs
ltprocessor.getparameter(string namespaceuri, string localname) gets the value of a parameter from the xslt stylesheet. a null value for namespaceuri is treated the same as an empty string. [throws] void xsltprocessor.removeparameter(string namespaceuri, string localname) removes the parameter if it was previously set. this will make the xsltprocessor use the default value for the parameter as
specified in the stylesheet. a null value for namespaceuri is treated the same as an empty string. void xsltprocessor.clearparameters() removes all set parameters from the xsltprocessor. the xsltprocessor will then use the defaults
specified in the xslt stylesheet. void xsltprocessor.reset() removes all parameters and stylesheets from the xsltprocessor. properties non-web-exposed properties the fol...
Using the aria-valuetext attribute - Accessibility
, which indicate the position of each value in the value space, but thearia-valuetext would be one of the strings: small, medium, or large. value string representation of a number possible effects on user agents and assistive technology if the aria-valuetext attribute is absent, assistive technologies will rely solely on the aria-valuenow attribute for the current value. if aria-valuetext is
specified, assistive technologies should render that value instead of the value of aria-valuenow. note: opinions may differ on how assistive technology should handle this technique. the information provided above is one of those opinions and therefore not normative. examples example 1: the snippet below shows a simple slider for selecting a day of the week. the value of the slider is numeric, and the ...
Using the progressbar role - Accessibility
cribedby to point to the status, and set the aria-busy attribute to true on the region until it is finished loading. it is not possible for the user to alter the value of a progressbar because it is always readonly. note: assistive technologies generally will render the value of aria-valuenow as a percent of the range between the value of aria-valuemin and aria-valuemax, unless aria-valuetext is
specified. it is best to set the values for aria-valuemin, aria-valuemax, and aria-valuenow in a manner that is appropriate for this calculation. note: elements with the role progressbar have an implicit aria-readonly value of true. possible effects on user agents and assistive technology screen readers should announce the progress updates as they occur. if the progress bar is labeled, the label text s...
ARIA: feed role - Accessibility
d to provide another key, such as alt + page down, to navigate from an 'outer' article to the first item in that article's nested feed. navigate between the nested feed and main feed with control + end , moving focus from the inner feed to the next article in the outer feed. wai-aria roles, states, and properties aria-labelled if the feed has no visible title, the feed element has a label
specified with aria-label. if it does, see aria-labelledby. aria-labelledby if the feed has a visible title, the feed element has aria-labelledby referring to the element containing the title. if not, add an aria-label. aria-busy when busy, such as when articles are being added or removed from the feed, set aria-busy="true" during the update operation. make sure it's reset to false when the operation i...
Web applications and ARIA FAQ - Accessibility
example of aria in action? sure. here's the markup for a progress bar widget: <div id="percent-loaded" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" /> this progress bar is built using a <div>, which is not very descriptive. unfortunately, there isn't a more semantic tag available to developers in html 4, so we need to include aria roles and properties. these are
specified by adding attributes to the element. in this example, the role="progressbar" attribute informs the browser that this element is actually a javascript-powered progress bar widget. the aria-valuemin and aria-valuemax attributes specify the minimum and maximum values for the progress bar, and the aria-valuenow describes the current state of it. along with placing them directly in the markup, aria a...
Multipart labels: Using ARIA for labels with embedded fields inside them - Accessibility
easily be “months” or “years”, and in many ordinary dialogs, there is no way to find this out other than navigating around with screen reviewing commands. the solution is in an aria attribute called aria-labelledby. its parameter is a string that consists of the ids of the html elements you want to concatenate into a single accessible name. both aria-labelledby and aria-describedby are
specified on the form element that is to be labelled, for example an <input> in both cases, the label for/label control bindings that may also exist are overridden by aria-labelledby. if on an html page you provide aria-labelledby, you should also provide a label for construct to also support older browsers that do not have aria support yet. with firefox 3, your blind users will automatically get better ac...
ARIA - Accessibility
) browser behaviour in script. here's the markup for a progress bar widget: <div id="percent-loaded" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"> </div> this progress bar is built using a <div>, which has no meaning. unfortunately, there isn't a more semantic tag available to developers in html 4, so we need to include aria roles and properties. these are
specified by adding attributes to the element. in this example, the role="progressbar" attribute informs the browser that this element is actually a javascript-powered progress bar widget. the aria-valuemin and aria-valuemax attributes specify the minimum and maximum values for the progress bar, and the aria-valuenow describes the current state of it and therefore must be kept updated with javascript. alo...
Custom properties (--*): CSS variables - CSS: Cascading Style Sheets
le-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 declaration can have as its value. note: custom property names are...
-moz-float-edge - CSS: Cascading Style Sheets
ntent-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-image-rect - CSS: Cascading Style Sheets
the -moz-image-rect value for css background-image lets you use a portion of a larger image as a background. syntax -moz-image-rect(<uri>, top, right, bottom, left); values <url> the uri of the image from which to take the sub-image. top the top edge,
specified as an <integer> or <percentage>, of the sub-image within the
specified image. right the right edge,
specified as an <integer> or <percentage>, of the sub-image within the
specified image. bottom the bottom edge,
specified as an <integer> or <percentage>, of the sub-image within the
specified image. left the left edge,
specified as an <integer> or <percentage>, of the sub-image within the
specified image. description this property allows you to, for example, use different parts of one larger image as backgrounds i...
-moz-outline-radius - CSS: Cascading Style Sheets
refer to the corresponding dimension of the border box-moz-outline-radius-topright: refer to the corresponding dimension of the border box-moz-outline-radius-bottomright: refer to the corresponding dimension of the border box-moz-outline-radius-bottomleft: refer to the corresponding dimension of the border boxcomputed valueas each of the properties of the shorthand:-moz-outline-radius-topleft: as
specified-moz-outline-radius-topright: as
specified-moz-outline-radius-bottomright: as
specified-moz-outline-radius-bottomleft: as
specifiedanimation typeas each of the properties of the shorthand:-moz-outline-radius-topleft: a length, percentage or calc();-moz-outline-radius-topright: a length, percentage or calc();-moz-outline-radius-bottomright: a length, percentage or calc();-moz-outline-radius-bottoml...
-moz-user-input - CSS: Cascading Style Sheets
at 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 definition 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-box-reflect - CSS: Cascading Style Sheets
ieve 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-overflow-scrolling - CSS: Cascading Style Sheets
h 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 definition 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: #f5f9fa; border: 2px solid #eaf2f4; padding: 10px; } .scroll-touch { -webkit-ov...
-webkit-print-color-adjust - CSS: Cascading Style Sheets
d 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 are overridden. formal definition value not found in db! formal synta...
-webkit-tap-highlight-color - CSS: Cascading Style Sheets
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
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 definition 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. ...
::-webkit-scrollbar - CSS: Cascading Style Sheets
e that appears at the bottom corner of some elements. syntax syntax not found in db! examples .visible-scrollbar, .invisible-scrollbar, .mostly-customized-scrollbar { display: block; width: 10em; overflow: auto; height: 2em; } .invisible-scrollbar::-webkit-scrollbar { display: none; } /* demonstrate a "mostly customized" scrollbar * (won't be visible otherwise if width/height is
specified) */ .mostly-customized-scrollbar::-webkit-scrollbar { width: 5px; height: 8px; background-color: #aaa; /* or add it to the track */ } /* add a thumb */ .mostly-customized-scrollbar::-webkit-scrollbar-thumb { background: #000; } <div class="visible-scrollbar"> etiam sagittis sem sed lacus laoreet, eu fermentum eros auctor. proin at nulla elementum, consectetur ex eget, commodo ant...
:lang() - CSS: Cascading Style Sheets
uage is determined by a combination of the lang attribute, the <meta> element, and possibly by information from the protocol (such as http headers). for other document types there may be other document methods for determining the language. syntax formal syntax :lang( <language-code> ) parameter <language-code> a <string> representing the language you want to target. acceptable values are
specified in the html spec. examples in this example, the :lang() pseudo-class is used to match the parents of quote elements (<q>) using child combinators. note that this doesn't illustrate the only way to do this, and that the best method to use depends on the type of document. also note that unicode values are used to specify some of the special quote characters. html <div lang="en"><q>this english...
:nth-last-child() - CSS: Cascading Style Sheets
eir position among a group of siblings, counting from the end. /* selects every fourth element among any group of siblings, counting backwards from the last one */ :nth-last-child(4n) { color: lime; } note: this pseudo-class is essentially the same as :nth-child, except it counts items backwards from the end, not forwards from the beginning. syntax the nth-last-child pseudo-class is
specified with a single argument, which represents the pattern for matching elements, counting from the end. keyword values odd represents elements whose numeric position in a series of siblings is odd: 1, 3, 5, etc., counting from the end. even represents elements whose numeric position in a series of siblings is even: 2, 4, 6, etc., counting from the end. functional notation <an+b> represent...
:nth-last-of-type() - CSS: Cascading Style Sheets
n among a group of siblings, counting from the end. /* selects every fourth <p> element among any group of siblings, counting backwards from the last one */ p:nth-last-of-type(4n) { color: lime; } note: this pseudo-class is essentially the same as :nth-of-type, except it counts items backwards from the end, not forwards from the beginning. syntax the nth-last-of-type pseudo-class is
specified with a single argument, which represents the pattern for matching elements, counting from the end. see :nth-last-child for a more detailed explanation of its syntax. formal syntax :nth-last-of-type( <nth> )where <nth> = <an-plus-b> | even | odd examples html <div> <span>this is a span.</span> <span>this is another span.</span> <em>this is emphasized.</em> <span>wow, this span gets ...
:state() - CSS: Cascading Style Sheets
custom-element:state(foo) { /* styles to apply when `custom-element` is in the `foo` state */ } syntax syntax not found in db! examples fill in a simple example that nicely shows a typical usage of the selector, then perhaps some more complex examples. ...
additive-symbols - CSS: Cascading Style Sheets
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. ...
suffix - CSS: Cascading Style Sheets
s 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 definition related at-rule@counter-styleinitial value". ...
font-display - CSS: Cascading Style Sheets
ont 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. ...
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 definition related at-rule@font-faceinitial 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 definition of 'font-family' in that specification. candidate recommendation...
font-variation-settings - CSS: Cascading Style Sheets
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. ...
unicode-range - CSS: Cascading Style Sheets
ce 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 definition related at-rule@font-faceinitial 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 serif font, times new roman, for the ampersand. in the css we are in effect defin...
@font-face - CSS: Cascading Style Sheets
tf) format("truetype"); the available types are: "woff", "woff2", "truetype", "opentype", "embedded-opentype", and "svg". unicode-range the range of unicode code points to be used from the font. description if the local() function is provided, specifying a font name to look for on the user's computer, and the user agent finds a match, that local font is used. otherwise, the font resource
specified using the url() function is downloaded and used. by allowing authors to provide their own fonts, @font-face makes it possible to design content without being limited to the so-called "web-safe" fonts (that is, the fonts which are so common that they're considered to be universally available). the ability to specify the name of a locally-installed font to look for and use makes it possible to cus...
-ms-high-contrast - CSS: Cascading Style Sheets
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. high contrast mode is a specialized display mode that prioritizes making content as legible as possible by dynamically replacing foreground and background colors with a user-
specified theme. for web content, theme colors are mapped to content types. this media feature applies to bitmap media types. it does not accept min/max prefixes. syntax the -ms-high-contrast media feature is
specified as one of the following values. values none ... no longer supported as of microsoft edge 18. active indicates that the subsequent styling rules will be applied when the system is placed in high contrast mode with...
-webkit-device-pixel-ratio - CSS: Cascading Style Sheets
the -webkit-device-pixel-ratio is a non-standard boolean css media feature which is an alternative to the standard resolution media feature. note: this media feature is a webkit feature. if possible, use the resolution media feature query instead. syntax the -webkit-device-pixel-ratio feature is
specified as a <number> value. it is a range feature, meaning that you can also use the prefixed -webkit-min-device-pixel-ratio and -webkit-max-device-pixel-ratio variants to query minimum and maximum values, respectively. values <number> the number of device pixels used to represent each css px. although the value is a <number>, and thus doesn't syntactically allow units, its implicit unit is dppx. implementation /* a unit of "dppx" is implied: */ @media (-webkit-min-device-pixel-ra...
-webkit-transition - CSS: Cascading Style Sheets
the -webkit-transition boolean css media feature is a chrome extension whose value is true if the browsing context supports css transitions. it was never supported in browsers not based on webkit or blink. apple has a description in safari css reference; this is now called simply transition there. note: you should not use this media feature; it was never
specified, has never been widely implemented, and has been removed from all browsers. use an @supports feature query instead. syntax @media (-webkit-transition) { /* css to use if transitions are supported */ } examples use @supports instead do not use the -webkit-transition media feature. instead, test for transition support using the css @supports at-rule, like this: @supports (transition: initial) { /* css to use if tra...
any-hover - CSS: Cascading Style Sheets
none none of the available input mechanism(s) can hover conveniently, or there is no pointing input mechanism. hover one or more available input mechanisms can conveniently hover over elements. ...
any-pointer - CSS: Cascading Style Sheets
none no pointing device is available. coarse at least one input mechanism includes a pointing device of limited accuracy. fine at least one input mechanism includes an accurate pointing device. ...
aspect-ratio - CSS: Cascading Style Sheets
it is a range feature, meaning you can also use the prefixed min-aspect-ratio and max-aspect-ratio variants to query minimum and maximum values, respectively. examples the example below is contained in an <iframe>, which creates its own viewport. resize the <iframe> to see aspect-ratio in action. html <div id='inner'> watch this element as you resize your viewport's width and height. ...
color-gamut - CSS: Cascading Style Sheets
the color-gamut css media feature can be used to test the approximate range of colors that are supported by the user agent and the output device. syntax the color-gamut feature is
specified as a keyword value chosen from the list below. srgb the output device can support approximately the srgb gamut or more. this includes the vast majority of color displays. p3 the output device can support approximately the gamut
specified by the dci p3 color space or more. the p3 gamut is larger than and includes the srgb gamut. rec2020 the output device can support approximately the gamut
specified by the itu-r recommendation 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 { bac...
color-index - CSS: Cascading Style Sheets
(this value is zero if the device does not use such a table.) it is a range feature, meaning that you can also use the prefixed min-color-index and max-color-index variants to query minimum and maximum values, respectively. ...
color - CSS: Cascading Style Sheets
if the device is not a color device, the value is zero. it is a range feature, meaning that you can also use the prefixed min-color and max-color variants to query minimum and maximum values, respectively. note: if the various color components are represented by different numbers of bits, the smallest number is used. ...
device-height - CSS: Cascading Style Sheets
it is a range feature, meaning that you can also use the prefixed min-device-height and max-device-height variants to query minimum and maximum values, respectively. examples this html applies a special stylesheet for devices that are shorter than 800 pixels. ...
device-width - CSS: Cascading Style Sheets
it is a range feature, meaning that you can also use the prefixed min-device-width and max-device-width variants to query minimum and maximum values, respectively. examples this html applies a special stylesheet for devices that are narrower than 800 pixels. ...
display-mode - CSS: Cascading Style Sheets
ication. you can use it to provide a consistent user experience between launching a site from a url and launching it from a desktop icon. this feature corresponds to the web app manifest's display member. both apply to the top-level browsing context and any child browsing contexts. the feature query applies regardless of whether a web app manifest is present. syntax the display-mode feature is
specified as a keyword value chosen from the list below. display mode description fallback display mode fullscreen all of the available display area is used and no user agent chrome is shown. standalone standalone the application will look and feel like a standalone application. this can include the application having a different window, its own icon in the ap...
forced-colors - CSS: Cascading Style Sheets
ced colors mode is active. the browser provides the color palette to authors through the css system color keywords and, if appropriate, it triggers the appropriate value of prefers-color-scheme so that authors can adapt the page. usage notes properties affected by forced-color mode in forced colors mode, the values of the following properties are treated as if they have no author-level values
specified. that is, user-
specified values (if any) or browser-
specified values are used instead. color fill stroke text-decoration-color text-emphasis-color border-color outline-color column-rule-color scrollbar-color -webkit-tap-highlight-color box-shadow text-shadow you can use system color keywords with any property other than those listed above, to ensure that the rest of the page integ...
bleed - CSS: Cascading Style Sheets
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. formal definition related at-rule@pageinitial valueautocomputed valueas
specified formal syntax auto | <length> examples setting a page bleed of 1cm @page { bleed: 1cm; } specifications specification status comment css paged media module level 3the definition of 'bleed' in that specification. working draft initial definition ...
marks - CSS: Cascading Style Sheets
x. 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. formal definition related at-rule@pageinitial 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 definition of 'marks' in that specification. working draft initial definition this css property was initially proposed in css level 2, but was dropped from css level ...
size - CSS: Cascading Style Sheets
r 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. ...
max-zoom - CSS: Cascading Style Sheets
s 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 definition related at-rule@viewportinitial 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 definition of '"max-zoom" descriptor' in that specification. working draft initial definition ...
min-zoom - CSS: Cascading Style Sheets
s 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 definition related at-rule@viewportinitial 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 definition of '"min-zoom" descriptor' in that specification. working draft initial definition ...
orientation - CSS: Cascading Style Sheets
ardware 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. formal definition related at-rule@viewportinitial valueautopercentagesrefer to the size of bounding boxcomputed valueas
specified formal syntax auto | portrait | landscape examples setting viewport orientation @viewport { orientation: landscape; } specifications specification status comment css device adaptationthe definition of '"orientation" descriptor' in that specification. working draft initial definition ...
user-zoom - CSS: Cascading Style Sheets
ccessibility concerns disabling zooming capabilities prevents people experiencing low vision conditions from being able to read and understand page content. mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.4 | understanding wcag 2.0 formal definition related at-rule@viewportinitial 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 definition of '"user-zoom" descriptor' in that specification. working draft initial definition ...
viewport-fit - CSS: Cascading Style Sheets
p 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 definition related at-rule@viewportinitial 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 definition of '"viewport-fit" descriptor' in that specification. working draft initial definition. ...
zoom - CSS: Cascading Style Sheets
ctor. 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 definition related at-rule@viewportinitial 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 definition of '"zoom" descriptor' in that specification. working draft initial specification ...
@viewport - CSS: Cascading Style Sheets
note: see https://github.com/w3c/csswg-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). 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...
At-rules - CSS: Cascading Style Sheets
e type of condition, which at any time evaluates to either true or false. if the condition evaluates to true, then all of the statements within the group will be applied. conditional group rules are defined in css conditionals level 3 and are: @media, @supports, @document. (deferred to level 4 of css spec) since each conditional group may also contain nested statements, there may be an un
specified amount of nesting. specifications specification status comment css conditional rules module level 3 candidate recommendation initial definition compatibility standardthe definition of 'css at-rules' in that specification. living standard standardizes @-webkit-keyframes. ...
Detecting CSS animation support - CSS: Cascading Style Sheets
break; } } } for starters we define a few variables. we assume that animation is not supported by setting animation to false. we set the animationstring to animation which is the property we want to set later on. we create an array of browser prefixes to loop over and we set pfx to an empty string. then we check if the css animation-name property on the style collection for the element
specified by the variable elem is set. this means the browser supports css animation without any prefix, which, to date, none of them do. if the browser does not support non-prefixed animation and animation is still false, we iterate over all the possible prefixes, since all the major browsers are currently prefixing this property and changing its name to animationname instead. once this code is finished...
Using multiple backgrounds - CSS: Cascading Style Sheets
op and the last background listed in the back. only the last background can include a background color. specifying multiple backgrounds is easy: .myclass { background: background1, background 2, ..., backgroundn; } you can do this with both the shorthand background property and the individual properties thereof except for background-color. that is, the following background properties can be
specified as a list, one per background: background, background-attachment, background-clip, background-image, background-origin, background-position, background-repeat, background-size. example in this example, three backgrounds are stacked: the firefox logo, an image of bubbles, and a linear gradient: html <div class="multi-bg-example"></div> css .multi-bg-example { width: 100%; height: 400px; ...
Box alignment for block, absolutely positioned and table layout - CSS: Cascading Style Sheets
tch, unless the positioned item is a replaced element, in which case it resolves to start. aligning in these layout methods today as we do not currently have browser support for box alignment in block layout, your options for alignment are either to use one of the existing alignment methods or, to make even a single item inside a container a flex item in order to use the alignment properties as
specified in flexbox. alignment of blocks horizontally prior to flexbox was typically achieved by way of setting auto margins on the block. a margin of auto will absorb all available space in that dimension, therefore setting a left and right margin of auto, you can push a block into the center: .container { width: 20em; margin-left: auto; margin-right: auto; } in table layout, you have access to...
Basic Concepts of Multicol - CSS: Cascading Style Sheets
cify both properties on a multicol container then column-count will act as a maximum number of columns. therefore the behaviour as described for column-width will happen, until the number of columns in column-count is reached. after this point no more columns will be drawn, and the extra space is distributed evenly between the existing columns, even if there is enough room for more columns of the
specified column-width size. when using both properties together you may get fewer columns than
specified in the value for column-count. in this next example we use column-width of 200px and column-count of 2. even if there is space for more than two columns, we get two. if there is not enough space for two columns of 200px, however, we get one. the columns shorthand you can use the columnsshorthand...
Basic concepts of flexbox - CSS: Cascading Style Sheets
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 properties flex-direction and flex-wrap into the flex-flow shorthand. the first value
specified is flex-direction and the second value is flex-wrap. in the live example below try changing the first value to one of the allowable values for flex-direction - row, row-reverse, column or column-reverse, and also change the second to wrap and nowrap. properties applied to flex items to have more control over flex items we can target them directly. we do this by way of three properties: fl...
Flow Layout and Overflow - CSS: Cascading Style Sheets
g context. the overflow property is in reality a shorthand for the overflow-x and overflow-y properties. if you specify only one value for overflow, this value is used for both axes. however, you can specify both values in which case the first is used for overflow-x and therefore the horizontal direction, and the second for overflow-y and the vertical direction. in the below example, i have only
specified overflow-y: scroll so we do not get the unwanted horizontal scrollbar. flow relative properties in the guide to writing modes and flow layout, we looked at the newer properties of block-size and inline-size which make more sense when working with different writing modes than tying our layout to the physical dimensions of the screen. the level 3 overflow module also includes flow relative prop...
Variable fonts guide - CSS: Cascading Style Sheets
g live example's css can be edited to allow you to play with font grade values. using a variable font: @font-face changes the syntax for loading variable fonts is very similar to any other web font, with a few notable differences, which are provided via upgrades to the traditional @font-face syntax now available in modern browsers. the basic syntax is the same, but the font technology can be
specified, and allowable ranges for descriptors like font-weight and font-stretch can be supplied, rather than named according to the font file being loaded. example for a standard upright (roman) font: @font-face { font-family: 'myvariablefontname'; src: 'path/to/font/file/myvariablefont.woff2' format('woff2-variations'); font-weight: 125 950; font-stretch: 75% 125%; font-style: normal; } example...
Basic Concepts of grid layout - CSS: Cascading Style Sheets
greater detail in the rest of this guide. what is a grid? a grid is a set of intersecting horizontal and vertical lines defining columns and rows. elements can be placed onto the grid within these column and row lines. css grid layout has the following features: fixed and flexible track sizes you can create a grid with fixed track sizes – using pixels for example. this sets the grid to the
specified pixel which fits to the layout you desire. you can also create a grid using flexible sizes with percentages or with the new fr unit designed for this purpose. item placement you can place items into a precise location on the grid using line numbers, names or by targeting an area of the grid. grid also contains an algorithm to control the placement of items not given an explicit position on the ...
Grid template areas - CSS: Cascading Style Sheets
with the grid-area property i can assign each of these areas a name. this will not yet create any layout, but we now have named areas to use in a layout. .header { grid-area: hd; } .footer { grid-area: ft; } .content { grid-area: main; } .sidebar { grid-area: sd; } having defined these names i then create my layout. this time, instead of placing my items using line numbers
specified on the items themselves, i create the whole layout on the grid container. .wrapper { display: grid; grid-template-columns: repeat(9, 1fr); grid-auto-rows: minmax(100px, auto); grid-template-areas: "hd hd hd hd hd hd hd hd hd" "sd sd sd main main main main main main" "ft ft ft ft ft ft ft ft ft"; } * {box-sizing: border-box;} .wrapper { ...
Using CSS counters - CSS: Cascading Style Sheets
otherwise the declaration is ignored. displaying a counter the value of a counter can be displayed using either the counter() or counters() function in a content property. the counter() function has two forms: 'counter(name)' or 'counter(name, style)'. the generated text is the value of the innermost counter of the given name in scope at the given pseudo-element.the counter is rendered in the
specified style (decimal by default). the counters() function also has two forms: 'counters(name, string)' or 'counters(name, string, style)'. the generated text is the value of all counters with 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 exa...
Basic Shapes - CSS: Cascading Style Sheets
to use as a reference box. in the example below change the reference box from margin-box to border-box, padding-box or content-box to see how the reference box used as the starting point before offsets are calculated changes. circle() the circle() value for shape-outside can accept two possible arguments. the first is the shape-radius. both circle() and ellipse() values for shape-outside are
specified as accepting this argument of <shape-radius>. this argument can be a length or percentage but can also be one of the keywords closest-side or farthest-side. the keyword closest-side uses the length from the center of the shape to the closest side of the reference box. for circles, this is the closest side in any dimension. for ellipses, this is the closest side in the radius dimension. the keyw...
Overview of CSS Shapes - CSS: Cascading Style Sheets
e. 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 a shape. it takes a variety of values, all of which define different shapes,
specified in the <basic-shape> datatype. we can start by looking at a very simple case. in the following example i have an image floated left. i have then applied the shape-outside property to it with a value of circle(50%). the result is that the content now curves around the circular shape rather than following the rectangle created by the box of the image. as in this level of the specification an el...
Using CSS transitions - CSS: Cascading Style Sheets
else { el = document.queryselector("div.box1"); el.classname = "box"; } return el; } var intervalid = window.setinterval(updatetransition, 7000); transition-timing-function specifies a function to define how intermediate values for properties are computed. timing functions determine how intermediate values of the transition are calculated. most timing functions can be
specified by providing the graph of the corresponding function, as defined by four points defining a cubic bezier. you can also choose easing from easing functions cheat sheet. transition-timing-function: ease <div class="parent"> <div class="box">lorem</div> </div> .parent { width: 250px; height:125px;} .box { width: 100px; height: 100px; background-color: red; font-size: ...
Questions about CSS - CSS: Cascading Style Sheets
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 style sheet with the current style sheet style attributes
specified by the viewer to the browser the default style sheet assumed by the browser in general, the web page creator's style sheet takes precedence, but it's recommended that browsers provide ways for the viewer to override the style attributes in some respects. since it's likely that different browsers will choose to implement css1 somewhat differently, the web page creator must test the page with di...
Center an element - CSS: Cascading Style Sheets
is example choices made to center one box inside another we make the containing box a flex container. then set align-items to center to perform centering on the block axis, and justify-content to center to perform centering on the inline axis. in the future we may be able to center elements without needing to turn the parent into a flex container, as the box alignment properties used here are
specified to apply to block layout too. however, support is currently limited for box alignment properties on block layout, so currently centering using flexbox is the most robust way to achieve this. ...
Using Media Queries for Accessibility - CSS: Cascading Style Sheets
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 contrast sensitivity issues but also users that are working on a computer or phone with direct sunlight. syntax the -ms-high-contrast media feature is
specified as one of the following values. values active indicates that the subsequent styling rules will be applied when the system is placed in high contrast mode with any color variation. black-on-white indicates that the subsequent styling rules will be applied when the system is placed in high contrast mode with a black-on-white color variation. white-on-black indicates that the subs...
Visual formatting model - CSS: Cascading Style Sheets
generates an intermediary structure, the box tree, which represents the formatting structure of the rendered document. each box in the box tree represents its corresponding element (or pseudo-element) in space and/or time on the canvas, while each text run in the box tree likewise represents the contents of its corresponding text nodes. then, for each element, css generates zero or more boxes as
specified by that element’s display property value. note: boxes are often referred to by their display type — e.g. a box generated by an element with display: block is called a "block box" or just a "block". note however that block boxes, block-level boxes and box containers are all subtly different; see the block boxes section below for more details. the principal box when an element generates on...
Actual value - CSS: Cascading Style Sheets
value of a css property is the used value of that property after any necessary approximations 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 loca...
align-items - CSS: Cascading Style Sheets
ment 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. ...
align-self - CSS: Cascading Style Sheets
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. ...
<angle-percentage> - CSS: Cascading Style Sheets
the <angle-percentage> css data type represents a value that can be either a <angle> or a <percentage>. syntax refer to the documentation 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 definition of '<angle-percentage>' in that specification. editor's draft css values and units module level 3the definition of '<angle-percentage>' in that specification. candidate recommendation defines <angle-percentage>. adds calc() ...
backdrop-filter - CSS: Cascading Style Sheets
al; 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. ...
background-blend-mode - CSS: Cascading Style Sheets
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 definition initial valuenormalapplies toall elements. in svg, it applies to container elements, graphics elements, and graphics referencing elements.. ...
background-position-x - CSS: Cascading Style Sheets
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 with the right edge of the background position layer. <length> the offset of the gi...
background-position-y - CSS: Cascading Style Sheets
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 background image with the bottom edge of the background position layer. <length> th...
<basic-shape> - CSS: Cascading Style Sheets
mension. for ellipses, this is the closest side in the radius dimension. farthest-side uses the length from the center of the shape to the farthest side of the reference box. for circles, this is the farthest side in any dimension. for ellipses, this is the farthest side in the radius dimension. description computed values of basic shapes the values in a <basic-shape> function are computed as
specified, with these exceptions: omitted values are included and compute to their defaults. a <position> value in circle() or ellipse() is computed as a pair of offsets (horizontal then vertical) from the top left origin, each given as a combination of an absolute length and a percentage. a <border-radius> value in inset() is computed as an expanded list of all eight <length> or percentage values. ...
border-block-end-style - CSS: Cascading Style Sheets
e: 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. ...
border-block-start-style - CSS: Cascading Style Sheets
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. ...
border-block-style - CSS: Cascading Style Sheets
der-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-bottom-color - CSS: Cascading Style Sheets
ll 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 definition 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 <div class="mybox"> <p>this is a box with a border around it. note which s...
border-bottom-style - CSS: Cascading Style Sheets
r-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 definition 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 | double | groove | ridge | inset | outset examples demonstrating all bord...
border-color - CSS: Cascading Style Sheets
-color border-top-color syntax /* <color> values */ border-color: red; /* horizontal | vertical */ border-color: red #f015ca; /* top | vertical | bottom */ border-color: red rgb(240,30,50,.7) green; /* top | right | bottom | left */ border-color: red yellow green blue; /* global values */ border-color: inherit; border-color: initial; border-color: unset; the border-color property may be
specified using one, two, three, or four values. 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 right, the third to the bottom. when four values are
specified, the colo...
border-inline-end-style - CSS: Cascading Style Sheets
: 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. ...
border-inline-style - CSS: Cascading Style Sheets
der-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. ...
border-left-color - CSS: Cascading Style Sheets
les 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 definition 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> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> ...
border-left-style - CSS: Cascading Style Sheets
er-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 definition 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 | double | groove | ridge | inset | outset examples html <table> <tr> ...
border-radius - CSS: Cascading Style Sheets
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> or a <percentage> denoting a radius to use for the border in each ...
border-right-color - CSS: Cascading Style Sheets
nd 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 definition 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> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()>...
border-right-style - CSS: Cascading Style Sheets
: 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 definition 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 | double | groove | ridge | inset | outset examples border styles html <...
border-top-color - CSS: Cascading Style Sheets
tive-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 definition 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> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = ...
border-width - CSS: Cascading Style Sheets
medium; border-width: thick; /* <length> values */ border-width: 4px; border-width: 1.2rem; /* vertical | horizontal */ border-width: 2px 1.5em; /* top | horizontal | bottom */ border-width: 1px 2em 1.5cm; /* top | right | bottom | left */ border-width: 1px 2em 0 4rem; /* global keywords */ border-width: inherit; border-width: initial; border-width: unset; the border-width property may be
specified using one, two, three, or four values. 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 right, the third to the bottom. when four values are
specified, the widt...
calc() - CSS: Cascading Style Sheets
and / operators do not require whitespace, but adding it for consistency is both allowed and recommended. division by zero results in an error being generated by the html parser. math expressions involving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if auto had been
specified. it is permitted to nest calc() functions, in which case the inner ones are treated as simple parentheses. formal syntax calc( <calc-sum> )where <calc-sum> = <calc-product> [ [ '+' | '-' ] <calc-product> ]*where <calc-product> = <calc-value> [ '*' <calc-value> | '/' <number> ]*where <calc-value> = <number> | <dimension> | <percentage> | ( <calc-sum> ) accessibility concerns when calc() is ...
caret-color - CSS: Cascading Style Sheets
g 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. ...
clamp() - CSS: Cascading Style Sheets
h computation order when needed. you can use different units for each value in your expressions, and different units in any math function making up any of the arguments. notes math expressions involving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if auto had been
specified. it is permitted to nest max() and min() functions as expression values, in which case the inner ones are treated as simple parentheses. the expressions are full math expressions, so you can use direct addition, subtraction, multiplication and division without using the calc() function itself. the expression can be values combining the addition ( + ), subtraction ( - ), multiplication ( * ) and...
clear - CSS: Cascading Style Sheets
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 definition 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="red">lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p> <p class="left">thi...
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 the text is placed over is high enough that people ...
column-rule-color - CSS: Cascading Style Sheets
project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* <color> 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. formal definition initial valuecurrentcolorapplies tomulticol elementsinheritednocomputed valuecomputed coloranimation typea color formal syntax <color>where <color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>where <rgb()> = rgb( <...
column-rule-style - CSS: Cascading Style Sheets
mn-rule-style: none; column-rule-style: hidden; column-rule-style: dotted; column-rule-style: dashed; column-rule-style: solid; column-rule-style: double; column-rule-style: groove; column-rule-style: ridge; column-rule-style: 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 definition initial valuenoneapplies tomulticol elementsinheritednocomputed valueas
specifiedanimation typediscrete formal syntax <'border-style'> examples setting a dashed column rule...
column-rule-width - CSS: Cascading Style Sheets
e clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* keyword values */ column-rule-width: thin; column-rule-width: medium; column-rule-width: thick; /* <length> values */ column-rule-width: 1px; 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 definition initial valuemediumapplies tomulticol elementsinheritednocomputed valuethe absolute length; 0 if the column-rule-style is none or hiddenanimation typea length formal s...
conic-gradient() - CSS: Cascading Style Sheets
ops are placed around a gradient arc, the circumference of a circle, rather than on the gradient line emerging from the center of the gradient. with conic gradients, the colors transition as as if spun around the center of a circle, starting at the top and going clockwise. in a radial gradient, the colors transition from the center of an ellipse, outward, in all directions. a conic gradient is
specified by indicating a rotation angle, the center of the gradient, and then specifying a list of color-stops. unlike linear and radial gradients, whose color-stops are placed by specifying a length, the color-stops of a conic gradient are
specified with an angle. units include deg for degrees, grad for gradients, rad for radians, and turn for turns. there are 360 degrees, 400 gradians, 2π radians, and ...
counters() - CSS: Cascading Style Sheets
resenting the current values of the named counters, if there are any. the counters() function has two forms: 'counters(name, string)' or 'counters(name, string, style)'. it is generally used with pseudo-elements, but can be used, theoretically, anywhere a <string> value is supported. the generated text is the value of all counters with the given name, from outermost to innermost, separated by the
specified string. the counters are rendered in the style indicated, defaulting to decimal if no style is
specified. /* simple usage - style defaults to decimal */ counters(countername, '-'); /* changing the counter display */ counters(countername, '.', upper-roman) a counter has no visible effect by itself. the counters() function (and counter() function) is what makes it useful by returning developer ...
cross-fade() - CSS: Cascading Style Sheets
if the result is greater than 0%, the result is then divided equally between all images with omitted percentages. in the simplest case, two images are faded between each other. to do that, only one of the images needs to have a percentage, the other one will be faded accordingly. for example, a value of 0% defined for the first image yiel...
direction - CSS: Cascading Style Sheets
ction: 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 definition 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 definition of 'direction' in that specification. proposed recommendation no change. css level 2 (revision 1)the definition of 'direction' in that sp...
<display-box> - CSS: Cascading Style Sheets
amples in this first example, the paragraph with a class of secret is set to display: none; the box and any content is now not rendered. display: none html <p>visible text</p> <p class="secret">invisible text</p> css p.secret { display: none; } result display: contents in this example the outer <div> has a 2-pixel red border and a width of 300px. however it also has display: contents
specified therefore this <div> will not be rendered, the border and width will no longer apply, and the child element will be displayed as if the parent had never existed. html <div class="outer"> <div>inner div.</div> </div> css .outer { border: 2px solid red; width: 300px; display: contents; } .outer > div { border: 1px solid green; } result specifications specification ...
<display-inside> - CSS: Cascading Style Sheets
he element behaves like a block element and lays out its content according to the grid model. ruby the element behaves like an inline element and lays out its content according to the ruby formatting model. it behaves like the corresponding html <ruby> elements. note: browsers that support the two value syntax, on finding the inner value only, such as when display: flex or display: grid is
specified, will set their outer value to block. this will result in expected behavior; for example if you specify an element to be display: grid, you would expect that the box created on the grid container would be a block level box. examples in this example the parent box has been given display: flow-root and so establishes a new bfc and contains the floated item. html <div class="box"> <div class=...
<display-listitem> - CSS: Cascading Style Sheets
the list-item keyword causes the element to generate a ::marker pseudo-element with the content
specified by its list-style properties (for example a bullet point) together with a principal box of the
specified type for its own contents. syntax a single value of list-item will cause the element to behave like a list item. this can be used together with list-style-type and list-style-position. list-item can also be combined with any <display-outside> keyword and the flow or flow-root <display-inside> keywords. note: in browsers that support the two-value syntax, if no inner value is
specified it will default to flow. if no outer value is
specified, the principal box will have an outer display type of block. examples html <div class="fake-list">i will display as a list item</div> css .fa...
<display-outside> - CSS: Cascading Style Sheets
pending on the surrounding elements. that is: if the run-in box contains a block box, same as block. if a block box follows the run-in box, the run-in box becomes the first inline box of the block box. if an inline box follows, the run-in box becomes a block box. note: browsers that support the two value syntax, on finding the outer value only, such as when display: block or display: inline is
specified, will set the inner value to flow. this will result in expected behavior; for example if you specify an element to be block, you would expect that the children of that element would participate in block and inline normal flow layout. examples in the following example, span elements (normally displayed as inline elements) are set to display: block and so break onto new lines and expand to fill ...
element() - CSS: Cascading Style Sheets
updated. a particularly useful scenario for using this would be to render an image in an html <canvas> element, then use that as a background. on gecko browsers, you can use the non-standard document.mozsetimageelement() method to change the element being used as the background for a given css background element. syntax element(id) where: id the id of an element to use as the background,
specified using the html attribute #id on the element. examples these examples can be viewed live in builds of firefox that support -moz-element(). a somewhat realistic example this example uses a hidden <div> as a background. the background element uses a gradient, but also includes text that is rendered as part of the background. <div style="width:400px; height:400px; background:-moz-element(#mybac...
blur() - CSS: Cascading Style Sheets
the blur() css function applies a gaussian blur to the input image. its result is a <filter-function>. 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 blur(radius) parameters radius the radius of the blur,
specified as a <length>. it defines the value of the standard deviation to the gaussian function, i.e., how many pixels on the screen blend into each other; thus, a larger value will create more blur. a value of 0 leaves the input unchanged. the lacuna value for interpolation is 0. examples setting a blur with pixels and with rem blur(0) /* no effect */ blur(8px) /* blur with 8px radius */ ...
brightness() - CSS: Cascading Style Sheets
to the input image, making it appear brighter or darker. its result is a <filter-function>. 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 brightness(amount) parameters amount the brightness of the result,
specified as a <number> or a <percentage>. a value under 100% darkens the image, while a value over 100% brightens it. a value of 0% will create an image that is completely black, while a value of 100% leaves the input unchanged. the lacuna value for interpolation is 1. examples setting brightness using numbers and percentages brightness(0%) /* completely black */ brightness(0.4) /* 40% brightness *...
contrast() - CSS: Cascading Style Sheets
rast() css function adjusts the contrast of the input image. its result is a <filter-function>. 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 contrast(amount) parameters amount the contrast of the result,
specified as a <number> or a <percentage>. a value under 100% decreases the contrast, while a value over 100% increases it. a value of 0% will create an image that is completely gray, while a value of 100% leaves the input unchanged. the lacuna value for interpolation is 1. examples setting contrast using numbers and percentages contrast(0) /* completely gray */ contrast(65%) /* 65% contrast */ c...
drop-shadow() - CSS: Cascading Style Sheets
(required) two <length> values that determine the shadow offset. offset-x specifies the horizontal distance, where negative values place the shadow to the left of the element. offset-y specifies the vertical distance, where negative values place the shadow above the element. if both values are 0, the shadow is placed directly behind the element. blur-radius (optional) the shadow's blur radius,
specified as a <length>. the larger the value, the larger and more blurred the shadow becomes. if un
specified, it defaults to 0, resulting in a sharp, unblurred edge. negative values are not allowed. color (optional) the color of the shadow,
specified as a <color>. if un
specified, the value of the color property is used. examples setting a drop shadow using pixel offsets and blur radius /* black shad...
grayscale() - CSS: Cascading Style Sheets
ale() css function converts the input image to grayscale. its result is a <filter-function>. 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 grayscale(amount) parameters amount the amount of the conversion,
specified as a <number> or a <percentage>. a value of 100% is completely grayscale, while a value of 0% leaves the input unchanged. values between 0% and 100% are linear multipliers on the effect. default value when omitted is 1. the initial value for interpolation is 0. examples grayscale(0) /* no effect */ grayscale(.7) /* 70% grayscale */ grayscale(100%) /* completely grayscale */ specificat...
hue-rotate() - CSS: Cascading Style Sheets
the hue of an element and its contents. its result is a <filter-function>. 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 hue-rotate(angle) parameters angle the relative change in hue of the input sample,
specified as an <angle>. a value of 0deg leaves the input unchanged. a positive hue rotation increases the hue value, while a negative rotation decreases the hue value. the lacuna value for interpolation is 0. there is no minimum or maximum value; hue-rotate(ndeg) evaluates to n modulo 360. examples hue-rotate(-90deg) /* same as 270deg rotation */ hue-rotate(0deg) /* no effect */ hue-rotate(90deg) ...
invert() - CSS: Cascading Style Sheets
) css function inverts the color samples in the input image. its result is a <filter-function>. 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 invert(amount) parameters amount the amount of the conversion,
specified as a <number> or a <percentage>. a value of 100% is completely inverted, 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 invert(0) /* no effect */ invert(.6) /* 60% inversion */ invert(100%) /* completely inverted */ specifications specification status ...
opacity() - CSS: Cascading Style Sheets
like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. note: this function is similar to the more established opacity property. the difference is that with filters, some browsers provide hardware acceleration for better performance. syntax opacity(amount) parameters amount the amount of the conversion,
specified as a <number> or a <percentage>. a value of 0% is completely transparent, while a value of 100% leaves the input unchanged. values between 0% and 100% are linear multipliers on the effect. the lacuna value for interpolation is 1. examples opacity(0%) /* completely transparent */ opacity(50%) /* 50% transparent */ opacity(1) /* no effect */ specifications specification statu...
saturate() - CSS: Cascading Style Sheets
s function super-saturates or desaturates the input image. its result is a <filter-function>. 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 saturate(amount) parameters amount the amount of the conversion,
specified as a <number> or a <percentage>. a value under 100% desaturates the image, while a value over 100% super-saturates 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%) /* doub...
sepia() - CSS: Cascading Style Sheets
e to sepia, giving it a warmer, more yellow/brown appearance. its result is a <filter-function>. 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 sepia(amount) parameters amount the amount of the conversion,
specified as a <number> or a <percentage>. 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...
<filter-function> - CSS: Cascading Style Sheets
each function requires an argument which, if invalid, results in no filter being applied. blur() blurs the image. brightness() makes the image brighter or darker. contrast() increases or decreases the image's contrast. drop-shadow() applies a drop shadow behind the image. ...
flex-flow - CSS: Cascading Style Sheets
lumn-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 definition 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-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...
<flex> - CSS: Cascading Style Sheets
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. ...
font-feature-settings - CSS: Cascading Style Sheets
he 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 definition initial valuenormalapplies toall elements. ...
font-optical-sizing - CSS: Cascading Style Sheets
sented 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 definition 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 should see a difference in supporting browsers.</p> @font-face { src: url('amstelvaralpha-vf.ttf'); font-family:'amstelvar'; ...
font-smooth - CSS: Cascading Style Sheets
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. formal definition initial valueautoapplies toall elementsinheritedyescomputed valueas
specifiedanimation typediscrete formal syntax auto | never | always | <absolute-size> | <length>where <absolute-size> = xx-small | x-small | small | medium | large | x-large | xx-large | xxx-large examples basic usage example the following example shows the safari/chromium and firefox equivalents that turn on font-smoothing on macos. in both cases the smoothed font should look slightly lighter in weig...
font-synthesis - CSS: Cascading Style Sheets
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 definition initial valueweight styleapplies toall elements. ...
font-variant-alternates - CSS: Cascading Style Sheets
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 definition initial valuenormalapplies toall elements. ...
font-variant-east-asian - CSS: Cascading Style Sheets
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 definition initial valuenormalapplies toall elements. ...
font-variant-numeric - CSS: Cascading Style Sheets
ated 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 definition initial valuenormalapplies toall elements. ...
font-variant - CSS: Cascading Style Sheets
st-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 definition initial valuenormalapplies toall elements. ...
font-variation-settings - CSS: Cascading Style Sheets
te. 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 definition 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 edited to allow you to play with font weight values. slant (slnt) the following live example's css can be edited to allow you to play wit...
<frequency-percentage> - CSS: Cascading Style Sheets
type represents a value that can be either a <frequency> or a <percentage>. frequency values, e.g. the pitch of a speaking voice, are not currently used in any css properties. syntax the value of a <frequency-percentage> is either a <frequency> or a <percentage>; see their individual reference pages for details about their syntaxes. description use in calc() where a <frequency-percentage> is
specified as an allowable type, this means that the percentage resolves to a frequency and therefore can be used in a calc() expression. examples valid percentage values 90% positive percentage +90% positive percentage with leading + -90% negative percentage — not valid for all properties that use percentages invalid percentage values 90 % no space is allowed between the number and the unit valid f...
<frequency> - CSS: Cascading Style Sheets
presents a frequency in hertz. examples: 0hz, 1500hz, 10000hz. khz represents a frequency in kilohertz. examples: 0khz, 1.5khz, 10khz. note: although the number 0 is always the same regardless of unit, the unit may not be omitted. in other words, 0 is invalid and does not represent 0hz or 0khz. though the units are case-insensitive, it is good practice to use a capital "h" for hz and khz, as
specified in the si. examples valid frequency values 12hz positive integer 4.3hz non-integer 14khz the unit is case-insensitive, though non-si capitalization is not recommended. +0hz zero, with a leading + and a unit -0khz zero, 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 allo...
grid-auto-flow - CSS: Cascading Style Sheets
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. ...
grid-template-areas - CSS: Cascading Style Sheets
as. <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. ...
inherit - CSS: Cascading Style Sheets
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. ...
initial-letter-align - CSS: Cascading Style Sheets
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. ...
initial-letter - CSS: Cascading Style Sheets
s are not allowed. <integer> defines the number of lines the initial letter should sink when the size of it is given. values must be greater than zero. if omitted, it duplicates the size value, floored to the nearest positive whole number. ...
Initial value - CSS: Cascading Style Sheets
the initial value of a css property is its default value, as listed in its definition 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 definition. css level 2 (revision 1)the definition of 'initial value' in that ...
isolation - CSS: Cascading Style Sheets
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 definition initial valueautoapplies toall elements. in svg, it applies to container elements, graphics elements, and graphics referencing elements.inheritednocomputed valueas spec...
justify-content - CSS: Cascading Style Sheets
sing 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. ...
justify-items - CSS: Cascading Style Sheets
ve 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. ...
justify-self - CSS: Cascading Style Sheets
nt 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. ...
<length-percentage> - CSS: Cascading Style Sheets
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 definition of '<length-percentage>' in tha...
line-height-step - CSS: Cascading Style Sheets
the line-height-step css 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 definition 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 ce...
linear-gradient() - CSS: Cascading Style Sheets
0% of the length to change to blue */ linear-gradient(.25turn, red, 10%, blue); /* multi-position color stop: a gradient tilted 45 degrees, with a red bottom-left half and a blue top-right half, with a hard line where the gradient changes from red to blue */ linear-gradient(45deg, red 0 50%, blue 50% 100%); values <side-or-corner> the position of the gradient line's starting point. if
specified, it consists of the word to and up to two keywords: one indicates the horizontal side (left or right), and the other the vertical side (top or bottom). the order of the side keywords does not matter. if un
specified, it defaults to to bottom. the values to top, to bottom, to left, and to right are equivalent to the angles 0deg, 180deg, 270deg, and 90deg, respectively. the other values are transla...
margin-trim - CSS: Cascading Style Sheets
s 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 definition initial valuenoneapplies toblock containers and multi-column containers. ...
mask-border-mode - CSS: Cascading Style Sheets
ode: 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 definition 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, 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 modu...
mask-border-source - CSS: Cascading Style Sheets
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. ...
mask-composite - CSS: Cascading Style Sheets
s 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. ...
mask-image - CSS: Cascading Style Sheets
ge: 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. ...
mask-repeat - CSS: Cascading Style Sheets
specifications specification status comment css masking module level 1the definition of 'mask-repeat' in that specification. candidate recommendation initial definition ...
max() - CSS: Cascading Style Sheets
nested min() and max() functions. you can use different units for each value in your expression. you may also use parentheses to establish computation order when needed. notes math expressions involving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if auto had been
specified. it is permitted to nest min() and other max() functions as expression values. the expressions are full math expressions, so you can use direct addition, subtraction, multiplication and division without using the calc() function itself. the expression can be values combining the addition ( + ), subtraction ( - ), multiplication ( * ) and division ( / ) operators, using standard operator precede...
min() - CSS: Cascading Style Sheets
ype (like <length>). you can use different units for each value in your expression, if you wish. you may also use parentheses to establish computation order when needed. notes math expressions involving percentages for widths and heights on table columns, table column groups, table rows, table row groups, and table cells in both auto and fixed layout tables may be treated as if auto had been
specified. it is permitted to nest max() and other min() functions as expression values. the expressions are full math expressions, so you can use direct addition, subtraction, multiplication and division without using the calc() function itself. the expression can be values combining the addition ( + ), subtraction ( - ), multiplication ( * ) and division ( / ) operators, using standard operator precede...
minmax() - CSS: Cascading Style Sheets
>-sized track takes a share of the remaining space in proportion to its flex factor. max-content represents the largest max-content contribution of the grid items occupying the grid track. min-content represents the largest min-content contribution of the grid items occupying the grid track. auto as a maximum, identical to max-content. as a minimum it represents the largest minimum size (as
specified by min-width/min-height) of the grid items occupying the grid track. formal syntax minmax( [ <length> | <percentage> | min-content | max-content | auto ] , [ <length> | <percentage> | <flex> | min-content | max-content | auto ] ) css properties minmax() function can be used within: grid-template-columns grid-template-rows grid-auto-columns grid-auto-rows examples css #container { ...
mix-blend-mode - CSS: Cascading Style Sheets
nd-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. ...
object-position - CSS: Cascading Style Sheets
l; 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. ...
offset-position - CSS: Cascading Style Sheets
: 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> 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 position and the second represents the vertical position. if only one value is
specified, the second value is assumed to be ce...
offset - CSS: Cascading Style Sheets
or: 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 each of the properties of the shorthand:offset-position: for <length> the absolute value, otherwise a percentageoffset-path: as
specifiedoffset-distance: for <length> the absolute value, otherwise a percentageoffset-anchor: for <length> the absolute value, otherwise a percentageoffset-rotate: as
specifiedanimation typeas each of the properties of the shorthand:offset-position: a positionoffset-path: as <angle>, <basic-shape> or <path()>offset-distance: a length, percentage or calc();offset-anchor: a positionoffset-rotate: as <angle...
opacity - CSS: Cascading Style Sheets
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. ...
orphans - CSS: Cascading Style Sheets
rphan 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 definition 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>this is the third paragraph. it has a little bit more text than the first one.</p> </div> ...
outline-color - CSS: Cascading Style Sheets
ute 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 outline is a line that is drawn around an element, outside the border. un...
outline-offset - CSS: Cascading Style Sheets
lement. 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. ...
overflow-anchor - CSS: Cascading Style Sheets
* 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 definition 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 definition of 'overflow-anchor' in that specification. editor's draft initial...
page-break-after - CSS: Cascading Style Sheets
be aliased as follows: page-break-after break-after auto auto left left right right avoid avoid always page formal definition initial valueautoapplies toblock-level elements in the normal flow of the root element. ...
page-break-before - CSS: Cascading Style Sheets
e aliased as follows: page-break-before break-before auto auto left left right right avoid avoid always page formal definition 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-break-before: avoid; } specifications specification status comment css logical properties and values level 1the definition of 'recto and verso' in that specification. edi...
page-break-inside - CSS: Cascading Style Sheets
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 definition initial valueautoapplies toblock-level elements in the normal flow of the root element. ...
place-content - CSS: Cascading Style Sheets
examples placing content in a flex container html <div id="container"> <div class="small">lorem</div> <div class="small">lorem<br/>ipsum</div> <div class="large">lorem</div> <div class="large">lorem<br/>impsum</div> <div class="large"></div> <div class="large"></div> </div> <code>writing-mode:</code><s...
place-self - CSS: Cascading Style Sheets
ely-positioned boxes, and grid itemsinheritednocomputed valueas each of the properties of the shorthand:align-self: auto 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
specified value.justify-self: as
specifiedanimation typediscrete formal syntax <'align-self'> <'justify-self'>? examples simple demonstration in the following example we have a simple 2 x 2 grid layout. initially the grid container has justify-items and align-items values of stretch — the defaults — which causes the grid items to stretch across the entire width of their cells. the second, third, ...
quotes - CSS: Cascading Style Sheets
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 definition 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 most browsers, the default value of quotes is auto (firefox 70+), or the browser otherwise had thi...
radial-gradient() - CSS: Cascading Style Sheets
les project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax /* a gradient at the center of its container, starting red, changing to blue, and finishing green */ radial-gradient(circle at center, red 0, blue, green 100%) values <position> the position of the gradient, interpreted in the same way as background-position or transform-origin. if un
specified, it defaults to center. <shape> the gradient's shape. the value can be circle (meaning that the gradient's shape is a circle with constant radius) or ellipse (meaning that the shape is an axis-aligned ellipse). if un
specified, it defaults to ellipse. <extent-keyword> a keyword describing how big the ending shape must be. the possible values are: keyword description ...
repeating-conic-gradient() - CSS: Cascading Style Sheets
nt arc -- the circumference of a circle, rather than on the gradient line emerging from the center of the gradient. the colors transition as as if spun around the center of a circle, starting at the top if no from <angle> is declared, and going clockwise for the the size of the angle that is the different between the largest and smallest color angle, then repeating. a repeating conic gradient is
specified by indicating a rotation angle, the center of the gradient, and then specifying a list of color-stops. like non-repeating conic gradients, the color-stops of a repeating conic gradient are
specified with an <angle>. units include deg for degrees, grad for gradients, rad for radians, and turn for turns. there are 360 degrees, 400 gradians, 2π radians, and 1 turn in a circle. browsers supporting r...
repeating-linear-gradient() - CSS: Cascading Style Sheets
s gradient doesn't repeat because the last color stop defaults to 100% */ repeating-linear-gradient(0deg, blue, green 40%, red); /* a gradient repeating five times, going from the left to right, starting red, turning green, and back to red */ repeating-linear-gradient(to right, red 0%, green 10%, red 20%); values <side-or-corner> the position of the gradient line's starting point. if
specified, it consists of the word to and up to two keywords: one indicates the horizontal side (left or right), and the other the vertical side (top or bottom). the order of the side keywords does not matter. if un
specified, it defaults to to bottom. the values to top, to bottom, to left, and to right are equivalent to the angles 0deg, 180deg, 270deg, and 90deg respectively. the other values are translat...
repeating-radial-gradient() - CSS: Cascading Style Sheets
ner, starting red, changing to green and back again, repeating five times between the center and the bottom right corner, and only once between the center and the top left corner */ repeating-radial-gradient(farthest-corner at 20% 20%, red 0, green, red 20%); values <position> the position of the gradient, interpreted in the same way as background-position or transform-origin. if un
specified, it defaults to center. <shape> the gradient's shape. the value can be circle (meaning that the gradient's shape is a circle with constant radius) or ellipse (meaning that the shape is an axis-aligned ellipse). if un
specified, it defaults to ellipse. <extent-keyword> a keyword describing how big the ending shape must be. the possible values are: keyword description ...
rotate - CSS: Cascading Style Sheets
le 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. ...
ruby-align - CSS: Cascading Style Sheets
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. ...
ruby-position - CSS: Cascading Style Sheets
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. ...
scroll-margin-block - CSS: Cascading Style Sheets
<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 container’s coordinate space), then adding the
specified outsets. formal definition initial value0applies toall elementsinheritednocomputed valueas
specifiedanimation typeby computed value type formal syntax <length>{1,2} specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-block' in that specification. candidate recommendation initial definition ...
scroll-margin-inline - CSS: Cascading Style Sheets
<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 container’s coordinate space), then adding the
specified outsets. formal definition 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 b...
scroll-padding-block-end - CSS: Cascading Style Sheets
m 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. formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas
specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-block-end' in that specification. candidate recommendation initial definition ...
scroll-padding-block-start - CSS: Cascading Style Sheets
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. formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas
specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-block-start' in that specification. candidate recommendation initial definition ...
scroll-padding-block - CSS: Cascading Style Sheets
e 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. formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas
specifiedanimation typeby computed value type formal syntax [ auto | <length-percentage> ]{1,2}where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-block' in that specification. candidate recommendation initial definition ...
scroll-padding-bottom - CSS: Cascading Style Sheets
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. formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas
specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-bottom' in that specification. candidate recommendation initial definition ...
scroll-padding-inline-end - CSS: Cascading Style Sheets
m 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. formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas
specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-inline-end' in that specification. candidate recommendation initial definition ...
scroll-padding-inline-start - CSS: Cascading Style Sheets
he 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. formal definition initial valueautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas
specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-inline-start' in that specification. candidate recommendation initial definition ...
<shape> - CSS: Cascading Style Sheets
the <shape> css data type defines the specific form (shape) of a region. the region represents the part of an element to which the clip property applies. note: <shape> and rect() work in conjunction with clip, which has been deprecated in favor of clip-path. when possible, use clip-path and the <basic-shape> data type instead. syntax the <shape> data type is
specified using the rect() function, which produces a region in the form of a rectangle. rect() rect(top, right, bottom, left) values top is a <length> representing the offset for the top of the rectangle relative to the top border of the element's box. right is a <length> representing the offset for the right of the rectangle relative to the left border of the element's box. bottom is a <length> representing the offs...
tab-size - CSS: Cascading Style Sheets
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. formal definition initial value8applies toblock containersinheritedyescomputed valuethe
specified integer or an absolute lengthanimation typea length formal syntax <integer> | <length> examples expanding by character count pre { tab-size: 4; /* set tab size to 4 characters wide */ } collapse tabs pre { tab-size: 0; /* remove indentation */ } comparing to the default size this example compares a default tab size with a custom tab size. note that white-space is set to pre to prev...
text-align-last - CSS: Cascading Style Sheets
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 definition 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, suscipit sed dictum quis, accumsan a ligula.</p> css p { font-size: 1.4em; text-alig...
text-decoration-skip-ink - CSS: Cascading Style Sheets
y 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
nderlines. (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. ...
text-decoration-thickness - CSS: Cascading Style Sheets
st 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 definition initial valueautoapplies toall elements. ...
text-emphasis-position - CSS: Cascading Style Sheets
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 definition 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 marks over ruby some other editors prefer to hide ruby when they conflict with emphasis m...
text-emphasis-style - CSS: Cascading Style Sheets
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. formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas
specifiedanimation typediscrete formal syntax none | [ [ filled | open ] | [ dot | circle | double-circle | triangle | sesame ] ] | <string> examples h2 { text-emphasis-style: sesame; } specifications specification status comment css text decoration module level 3the definition of 'text-emphasis' in that specification. candidate recommendation initial definition ...
text-underline-position - CSS: Cascading Style Sheets
nym 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 definition 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, sit amet feugiat tortor volutpat quis. nam eget sodales quam. aliquam accumsan t...
<time-percentage> - CSS: Cascading Style Sheets
the <time-percentage> css data type represents a value that can be either a <time> or a <percentage>. syntax refer to the documentation for <time> and <percentage> for details of the individual syntaxes allowed by this type. examples use in calc() where a <time-percentage> is
specified as an allowable type, this means that the percentage resolves to a time and therefore can be used in a calc() expression. valid percentages 50% +50% optional plus sign -50% negative percentages are not valid for all properties that accept percentages invalid percentages 50 % space not allowed between the space and the percentage sign valid times 12s positive integer -456ms negative integer 4.3ms non-integer 14ms the unit is case-insensitive, although capital ...
matrix() - CSS: Cascading Style Sheets
the constant values are implied and not passed as parameters; the other parameters are described in the column-major order. note: until firefox 16, gecko accepted a <length> value for tx and ty. ...
matrix3d() - CSS: Cascading Style Sheets
they are described in the column-major order. matrix3d(a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, a4, b4, c4, d4) values a1 b1 c1 d1 a2 b2 c2 d2 a3 b3 c3 d3 are <number>s describing the linear transformation. a4 b4 c4 d4 are <number>s describing the translation to apply. note: until firefox 16, gecko accepted a <length> value for a4, b4 and c4. ...
perspective() - CSS: Cascading Style Sheets
ase clone https://github.com/mdn/interactive-examples and send us a pull request. the perspective() transform function is part of the transform value applied on the element being transformed. this differs from the perspective and perspective-origin properties which are attached to the parent of a child transformed in 3-dimensional space. syntax the perspective distance used by perspective() is
specified by a <length> value, which represents the distance between the user and the z=0 plane. the z=0 plane is the plane where everything appears in a 2-dimensional view, or the screen. a positive value makes the element appear closer to the user than the rest of the interface, a negative value farther. the greater the value, the further away the perspective of the user is. perspective(d) values d...
rotate() - CSS: Cascading Style Sheets
d a fixed point on the 2d plane, without deforming it. its result is a <transform-function> data type. the fixed point that the element rotates around — mentioned above — is also known as the transform origin. this defaults to the center of the element, but you can set your own custom transform origin using the transform-origin property. syntax the amount of rotation created by rotate() is
specified by an <angle>. if positive, the movement will be clockwise; if negative, it will be counter-clockwise. a rotation by 180° is called point reflection. rotate(a) values a is an <angle> representing the angle of the rotation. a positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 ...
rotateX() - CSS: Cascading Style Sheets
request. the axis of rotation passes through an origin, defined by the transform-origin css property. note: rotatex(a) is equivalent to rotate3d(1, 0, 0, a). note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative. in other words, the order in which the rotations are applied impacts the result. syntax the amount of rotation created by rotatex() is
specified by an <angle>. if positive, the movement will be clockwise; if negative, it will be counter-clockwise. rotatex(a) values a is an <angle> representing the angle of the rotation. a positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous...
rotateY() - CSS: Cascading Style Sheets
request. the axis of rotation passes through an origin, defined by the transform-origin css property. note: rotatey(a) is equivalent to rotate3d(0, 1, 0, a). note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative. in other words, the order in which the rotations are applied impacts the result. syntax the amount of rotation created by rotatey() is
specified by an <angle>. if positive, the movement will be clockwise; if negative, it will be counter-clockwise. rotatey(a) values a is an <angle> representing the angle of the rotation. a positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous...
rotateZ() - CSS: Cascading Style Sheets
axis of rotation passes through an origin, defined by the transform-origin css property. note: rotatez(a) is equivalent to rotate(a) or rotate3d(0, 0, 1, a). note: unlike rotations in the 2d plane, the composition of 3d rotations is usually not commutative. in other words, the order in which the rotations are applied impacts the result. syntax the amount of rotation created by rotatez() is
specified by an <angle>. if positive, the movement will be clockwise; if negative, it will be counter-clockwise. rotatez(a) values a is an <angle> representing the angle of the rotation. a positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous...
scale3d() - CSS: Cascading Style Sheets
ee coordinates are equal, the scaling is uniform (isotropic) and the aspect ratio of the element is preserved (this is a homothetic transformation). when a coordinate value is outside the [-1, 1] range, the element grows along that dimension; when inside, it shrinks. if it is negative, the result a point reflection in that dimension. a value of 1 has no effect. syntax the scale3d() function is
specified with three values, which represent the amount of scaling to be applied in each direction. scale3d(sx, sy, sz) values sx is a <number> representing the abscissa of the scaling vector. sy is a <number> representing the ordinate of the scaling vector. sz is a <number> representing the z-component of the scaling vector. cartesian coordinates on ℝ2 homogeneous coordinates on...
scaleX() - CSS: Cascading Style Sheets
-axis (horizontally). its result is a <transform-function> data type. it modifies the abscissa of each element point by a constant factor, except when the scale factor is 1, in which case the function is the identity transform. the scaling is not isotropic, and the angles of the element are not conserved. scalex(-1) defines an axial symmetry, with a vertical axis passing through the origin (as
specified by the transform-origin property). note: scalex(sx) is equivalent to scale(sx, 1) or scale3d(sx, 1, 1). syntax scalex(s) values s is a <number> representing the scaling factor to apply on the abscissa of each point of the element. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 ...
scaleY() - CSS: Cascading Style Sheets
-axis (vertically). its result is a <transform-function> data type. it modifies the ordinate of each element point by a constant factor, except when the scale factor is 1, in which case the function is the identity transform. the scaling is not isotropic, and the angles of the element are not conserved. scaley(-1) defines an axial symmetry, with a horizontal axis passing through the origin (as
specified by the transform-origin property). note: scaley(sy) is equivalent to scale(1, sy) or scale3d(1, sy, 1). transform: rotatex(180deg); === transform: scaley(-1); syntax scaley(s) values s is a <number> representing the scaling factor to apply on the ordinate of each point of the element. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordina...
scaleZ() - CSS: Cascading Style Sheets
nteractive-examples and send us a pull request. this scaling transformation modifies the z-coordinate of each element point by a constant factor, except when the scale factor is 1, in which case the function is the identity transform. the scaling is not isotropic, and the angles of the element are not conserved. scalez(-1) defines an axial symmetry, with the z-axis passing through the origin (as
specified by the transform-origin property). in the above interactive examples, perspective: 550px; (to create a 3d space) and transform-style: preserve-3d; (so the children, the 6 sides of the cube, are also positioned in the 3d space), have been set on the cube. note: scalez(sz) is equivalent to to scale3d(1, 1, sz). syntax scalez(s) values s is a <number> representing the scaling factor to a...
skew() - 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. this transformation is a shear mapping (transvection) that distorts each point within an element by a certain angle in the horizontal and vertical directions. the coordinates of each point are modified by a value proportionate to the
specified angle and the distance to the origin; thus, the farther from the origin a point is, the greater will be the value added it. syntax the skew() function is
specified with either one or two values, which represent the amount of skewing to be applied in each direction. skew(ax) skew(ax, ay) values ax is an <angle> representing the angle to use to distort the element along the abscissa. ay ...
skewX() - CSS: Cascading Style Sheets
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 transformation is a shear mapping (transvection) that distorts each point within an element by a certain angle in the horizontal direction. the abscissa coordinate of each point is modified by a value proportionate to the
specified angle and the distance to the origin; thus, the farther from the origin a point is, the greater will be the value added it. note: skewx(a) is equivalent to skew(a). syntax skewx(a) values a is an <angle> representing the angle to use to distort the element along the abscissa. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3...
skewY() - 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. this transformation is a shear mapping (transvection) that distorts each point within an element by a certain angle in the vertical direction. the ordinate coordinate of each point is modified by a value proportionate to the
specified angle and the distance to the origin; thus, the farther from the origin a point is, the greater will be the value added it. syntax skewy(a) values a is an <angle> representing the angle to use to distort the element along the ordinate. cartesian coordinates on ℝ2 homogeneous coordinates on ℝℙ2 cartesian coordinates on ℝ3 homogeneous coordinates on ℝℙ3 ...
transform-origin - CSS: Cascading Style Sheets
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 v...
transform-style - CSS: Cascading Style Sheets
d; /* 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 definition 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 3d space and you can see it as intended. we also provide a checkbox allowing you to toggle...
transition-property - CSS: Cascading Style Sheets
ransition-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 definition initial valueallapplies toall elements, ::before 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 definition of 'transition-property' in that specification. working d...
unicode-bidi - CSS: Cascading Style Sheets
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. ...
<url> - CSS: Cascading Style Sheets
tended 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 definition. now, url() denotes only true <url>s. syntax the <url> data type is
specified using the url() functional notation. it may be written without quotes, or surrounded by single or double quotes. relative urls are allowed, and are relative to the url of the stylesheet (not to the url of the web page). if you choose to write the url without quotes, use a backslash (\) before any parentheses, whitespace characters, single quotes (') and double quotes (") that are part of the url...
Used value - CSS: Cascading Style Sheets
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 from css 2.1 changes:
specified, computed, and actual values): background-position bottom, left, right, top height, width margin-bottom, margin-left, margin-right, margin-top min-height, min-width padding-bottom, padding-left, padding-right, padding-top text-indent specification specification status comment css level 2 (revision 2)the definition of 'used value' in that specification. w...
user-modify - CSS: Cascading Style Sheets
. 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 definition value not found in db! formal syntax syntax not...
user-select - CSS: Cascading Style Sheets
stor 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. ...
widows - CSS: Cascading Style Sheets
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 definition 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 paragraph. it has a little bit more text than the first one.</p> </div> css div { backg...
will-change - CSS: Cascading Style Sheets
e 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 definition 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 = document.getelementbyid('element'); // set will-change when the element is hovered...
zoom - CSS: Cascading Style Sheets
ebkit (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. ...
exsl:object-type() - EXSLT
note: most xslt object types can be coerced into each other safely; however, certain coercsions to raise error conditions. in particular, treating something that's not a node-set as a node-set will do so. this function lets authors of named templates and extension functions easily provide flexibility in parameter values. syntax exsl:object-type(object) parameters object the object whose type is to be returned. ...
math:highest() - EXSLT
a node has this maximum value if converting its string value to a number equals the maximum value. ...
math:lowest() - EXSLT
a node has this minimum value if converting its string value to a number equals the minimum value. ...
Math (math) - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the exslt math package provides functions for working with numeric values and comparing nodes. the namespace for the math package is http://exslt.org/math. math:highest()math:highest() returns the node in the
specified node-set with the highest value (where the highest value calculated using math:max()).math:lowest()math:lowest() returns the node in the
specified node-set with the lowest value (where the lowest value calculated using math:min()).math:max()math:max() returns the maximum value of a node-set.math:min()math:min() returns the minimum value of a node-set. ...
regexp:match() - EXSLT
xp:match(targetstring, regexpstring[, flagsstring]) parameters targetstring the string to perform regular expression matching upon. regexpstring the javascript style regular expression to evaluate. flagsstringoptional an optional string containing character flags. the character flags are: g global match the submatches from every match in the string are returned. if this flag isn't
specified, only the submatches from the first match are returned. i case insensitive match if this flag is
specified, the match is performed in a case insensitive fashion. returns a node set of match elements, each of which has the string value equal to a portion of the first parameter string as captured by the regular expression. if the match isn't a global one, the first match element has the value...
regexp:replace() - EXSLT
, regexpstring, flagsstring, replacestring) parameters originalstring the string perform a search-and-replace operation upon. regexpstring the javascript style regular expression to evaluate. flagsstring the string containing character flags. replacestring the string with which the matched substrings are to be replaced. the character flags are: g - global replace if this flag is
specified, all occurrences of the regular expression within the originalstring are replaced. otherwise only the first occurrence is replaced. i - case insensitive match if this flag is
specified, the match is performed in a case insensitive fashion. returns the revised version of the string. specifications exslt - regexp:replace ...
regexp:test() - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes regexp:test() tests to see whether a string matches a
specified regular expression. syntax regexp:test(teststring, regexpstring[, flagsstring]) parameters teststring the string to test.. regexpstring the javascript style regular expression to evaluate. flagsstringoptional an optional string containing character flags. the character flags are: g global match has no effect for this function; it's allowed for consistency with other regexp functions. i case insensitive match if this flag is
specified, the match is performed in a case insensitive fashion. returns true if the
specified regexp matches the test string. specifications exslt - regexp:test ...
set:distinct() - EXSLT
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes set:distinct() returns a subset of the nodes in the
specified node-set, returning only nodes with unique string values. syntax set:distinct(nodeset) parameters nodeset the node-set in which to find unique nodes. returns a node-set containing the nodes that have unique string values. specifications exslt - set:distinct ...
Sets (set) - EXSLT
functions, xpath axes the exslt sets package offers functions that let you perform set manipulation. the namespace for these functions is http://exslt.org/sets. set:difference()set:difference() returns the difference between two node-sets. in other words, it returns a node-set whose nodes are in one node-set but not in the other.set:distinct()set:distinct() returns a subset of the nodes in the
specified node-set, returning only nodes with unique string values.set:has-same-node()set:has-same-node() determines whether two node-sets have any nodes in common.set:intersection()set:intersection() returns the intersection of two node-sets. in other words, it returns a node-set containing all the nodes that exits in both nodeset1 and nodeset2.set:leading()set:leading() returns the nodes in one node-set ...
Event reference
in a browser iframe. mozbrowserusernameandpasswordrequired firefox os browser api-specific sent when an http authentication is requested. mozbrowservisibilitychange firefox os browser api-specific sent when the visibility state of the current browser iframe <iframe> changes, for example due to a call to setvisible(). mozgamepadbuttondown to be
specified a gamepad button is pressed down. mozgamepadbuttonup to be
specified a gamepad button is released. mozmousepixelscroll mozilla specific the wheel button of a pointing device is rotated (detail attribute is a number of pixels). (use wheel instead) mozorientation mozilla specific fresh data is available from an orientation sensor (see ...
Getting Started - Developer guides
you want with the data the server sent. you have two options to access that data: httprequest.responsetext – returns the server response as a string of text httprequest.responsexml – returns the response as an xmldocument object you can traverse with javascript dom functions note that the steps above are valid only if you used an asynchronous request (the third parameter of open() was un
specified or set to true). if you used a synchronous request you don't need to specify a function, but this is highly discouraged as it makes for an awful user experience. step 3 – a simple example let's put it all together with a simple http request. our javascript will request an html document, test.html, which contains the text "i'm a test." then we'll alert() the contents of the response. note that...
Adding captions and subtitles to HTML5 video - Developer guides
ment html5 allows us to specify subtitles for a video using the <track> element. the various attributes of this element allow us to specify such things as the type of content that we're adding, the language it's in, and of course a reference to the text file that contains the actual subtitle information. webvtt the files that contain the actual subtitle data are simple text files that follow a
specified format, in this case the web video text tracks (webvtt) format. the webvtt specification is still being worked on, but major parts of it are stable so we can use it today. video providers (such as the blender foundation) provide captions and subtitles in a text format with their videos, but they're usually in the subrip text (srt) format. these can be easily converted to webvtt using an online c...
Creating a cross-browser video player - Developer guides
bute 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 video. ie9 will only use the
specified poster image in this way if preload="none" is set; otherwise, it will take the first still of the video and display that instead. three different video sources are provided for the player: mp4, webm, and ogg. using these different source formats gives the best chance of being supported across all ...
Block formatting context - Developer guides
define bfc(abbr) etc. css level 2 (revision 1)the definition of 'block formatting context' in that specification. recommendation initial definition. 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. definitions of value syntax, shorthand properties and replaced elements. ...
DOM onevent handlers - Developer guides
has changed: <code> ${el.getattribute("onclick")} </code><br>`); result for historical reasons, some attributes/properties on the <body> and <frameset> elements instead set event handlers on their parent window object. (the html specification names these: onblur, onerror, onfocus, onload, and onscroll.) event handler's parameters, this binding, and the return value when the event handler is
specified as an html attribute, the
specified code is wrapped into a function with the following parameters: event — for all event handlers except onerror. event, source, lineno, colno, and error for the onerror event handler. note that the event parameter actually contains the error message as a string. when the event handler is invoked, the this keyword inside the handler is set to the dom elemen...
Content categories - Developer guides
pable when it's neither empty or hidden; it is content that is rendered and is substantive. elements whose model is flow content or phrasing content should have at least one node which is palpable. form-associated content form-associated content comprises elements that have a form owner, exposed by a form attribute. a form owner is either the containing <form> element or the element whose id is
specified in the form attribute. <button> <fieldset> <input> <keygen> <label> <meter> <object> <output> <progress> <select> <textarea> this category contains several sub-categories: listed elements that are listed in the form.elements and fieldset.elements idl collections. contains <button>, <fieldset>, <input>, <keygen>, <object>, <output>, <select>, and <textarea>. labelable elemen...
Parsing and serializing XML - Developer guides
var dochtml = document.documentelement.innerhtml; as a result, dochtml is a domstring containing the html of the contents of the document; that is, the <body> element's contents. you can get html corresponding to the <body> and its descendants with this code: var dochtml = document.documentelement.outerhtml...
HTML attribute: accept - HTML: Hypertext Markup Language
put>, omit the multiple attribute. limiting accepted file types often you won't want the user to be able to pick any arbitrary type of file; instead, you often want them to select files of a specific type or types. for example, if your file input lets users upload a profile picture, you probably want them to select web-compatible image formats, such as jpeg or png. acceptable file types can be
specified with the accept attribute, which takes a comma-separated list of allowed file extensions or mime types. some examples: accept="image/png" or accept=".png" — accepts png files. accept="image/png, image/jpeg" or accept=".png, .jpg, .jpeg" — accept png or jpeg files. accept="image/*" — accept any file with an image/* mime type. (many mobile devices also let the user take a picture with th...
HTML attribute: crossorigin - HTML: Hypertext Markup Language
cription anonymous cors requests for this element will have the credentials flag set to 'same-origin'. use-credentials cors requests for this element will have the credentials flag set to 'include'. "" setting the attribute name to an empty value, like crossorigin or crossorigin="", is the same as anonymous. by default (that is, when the attribute is not
specified), cors is not used at all. the "anonymous" keyword means that there will be no exchange of user credentials via cookies, client-side ssl certificates or http authentication as described in the terminology section of the cors specification, unless it is in the same origin. an invalid keyword and an empty string will be handled as the anonymous keyword. example: crossorigin with the script elemen...
HTML attribute: maxlength - HTML: Hypertext Markup Language
any maxlength value must be greater than or equal to the value of minlength, if present and valid. the input will fail constraint validation if the length of the text value of the field is greater than maxlength utf-16 code units long. constraint validation is only applied when the value is changed by the user. ...
HTML attribute: rel - HTML: Hypertext Markup Language
ngines. dns-prefetch relevant for the <link> element both in the <body> and <head>, it tells the browser to preemptively perform dns resolution for the target resource's origin. useful for resources the user will likely need, it helps reduce latency and thereby improves performance when the user does access the resources as the browser preemptively performed dns resolution for the origin of the
specified resource. see dns-prefetch described in resource hints. external relevant to <form>, <a>, and <area>, it indicates the referenced document is not part of the current site. this can be used with attribute selectors to style external links in a way that indicates to the user that they will be leaving the current site. help relevant to <form>, <link>, <a>, and <area>, the help keyword indicates ...
HTML attribute: required - HTML: Hypertext Markup Language
group of checkbox input types, only the checkboxes with the required attribute are required. note: setting aria-required="true" tells a screen reader that an element (any element) is required, but has no bearing on the optionality of the element. attribute interactions because a read-only field cannot have a value, required does not have any effect on inputs with the readonly attribute also
specified. usability when including the required attribute, provide a visible indication near the control informing the user that the input, select or textarea is required. in addition, target required form controls with the :required pseudo-class, styling them in a way to indicate they are required. this improves usability for sited user. assistive technology should inform the user that the form contr...
HTML attribute: step - HTML: Hypertext Markup Language
min="019-12-25t19:30" step="7"> number 1 <input type="number" min="0" step="0.1" max="10"> range 1 <input type="range" min="0" step="2" max="10"> if any is not explicity set, valid values for the number, date/time input types, and range input types are equal to the basis for stepping - the min value and increments of the step value, up to the max value, if
specified. for example, if we have <input type="number" min="10" step="2"> any even integer, 10 or great, is valid. if omitted, <input type="number">, any integer is valid, but floats, like 4.2, are not valid, as step defaults to 1. for 4.2 to be valid, step would have had to be set to any, 0.1, 0.2, or any the min value would have had to be a number ending in .2, such as <input type="number" min="-5.2"> ...
<a>: The Anchor element - HTML: Hypertext Markup Language
tp content-type header on the linked url. coordsobsolete since html5 used with the shape attribute. a comma-separated list of coordinates. nameobsolete since html5 was required to define a possible target location in a page. in html 4.01, id and name could both be used on <a>, as long as they had identical values. note: use the global attribute id instead. revobsolete since html5
specified a reverse link; the opposite of the rel attribute. deprecated for being very confusing. shapeobsolete since html5 the shape of the hyperlink’s region in an image map. note: use the <area> element for image maps instead. properties content categories flow content, phrasing content, interactive content, palpable content. permitted content transparent, containing ei...
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
enclosed within the <applet> element may also be rendered as alternative text. archive this attribute refers to an archived or compressed version of the applet and its associated class files, which might help reduce download time. code this attribute specifies the url of the applet's class file to be loaded and executed. applet filenames are identified by a .class filename extension. the url
specified by code might be relative to the codebase attribute. codebase this attribute gives the absolute or relative url of the directory where applets' .class files referenced by the code attribute are stored. datafld this attribute, supported by internet explorer 4 and higher, specifies the column name from the data source object that supplies the bound data. this attribute might be used to specify ...
<basefont> - HTML: Hypertext Markup Language
o the base size using the <font> element. you should not use this element; instead, you should use css properties such as font, font-family, font-size, and color to change the font configuration for an element and its contents. attributes like all other html elements, this element supports the global attributes. color this attribute sets the text color using either a named color or a color
specified in the hexadecimal #rrggbb format. face this attribute contains a list of one or more font names. the document text in the default style is rendered in the first font face that the client's browser supports. if no font listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system. size this attribute specifies the font size as ...
<code>: The Inline Code element - HTML: Hypertext Markup Language
he text.</p> the output generated by this html looks like this: notes to represent multiple lines of code, wrap 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 definition of '<code>' in that specification. living standard html5the definition of '<code>' in that specification. recommendation html 4.01 specificationthe definition of '<code>' in that specification. recommendation ...
<col> - HTML: Hypertext Markup Language
background-color property. char this attribute is used to set the character to align the cells in a column on. typical values for this include a period (.) when attempting to align numbers or monetary values. if align is not set to char, this attribute is ignored. charoff this attribute is used to indicate the number of characters to offset the column data from the alignment characters
specified by the char attribute. valign this attribute specifies the vertical alignment of the text within each cell of the column. possible values for this attribute are: baseline, which will put the text as close to the bottom of the cell as it is possible, but align it on the baseline of the characters instead of the bottom of them. if characters are all of the size, this has the same effect as ...
<colgroup> - HTML: Hypertext Markup Language
ypical values for this include a period (.) when attempting to align numbers or monetary values. if align is not set to char, this attribute is ignored, though it will still be used as the default value for the align of the <col> which are members of this column group. charoff this attribute is used to indicate the number of characters to offset the column data from the alignment character
specified by the char attribute. valign this attribute specifies the vertical alignment of the text within each cell of the column. possible values for this attribute are: baseline, which will put the text as close to the bottom of the cell as it is possible, but align it on the baseline of the characters instead of the bottom of them. if characters are all of the size, this has the same effect ...
<dl>: The Description List element - HTML: Hypertext Markup Language
common uses for this element are to implement a glossary or to display metadata (a list of key-value pairs). 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, and if the <dl> element's children include one name-value group, palpable content. ...
<dt>: The Description Term element - HTML: Hypertext Markup Language
<dt> element specifies a term in a description or definition list, and as such must be used inside a <dl> element. it is usually followed by a <dd> element; however, multiple <dt> elements in a row indicate several terms that are all defined by the immediate next <dd> element. the subsequent <dd> (description details) element provides the definition or other related text associated with the term
specified using <dt>. 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, but with no <header>, <footer>, sectioning content or heading content descend...
<embed>: The Embed External Content element - HTML: Hypertext Markup Language
this content is provided by an external application or other source of interactive content such as a browser plug-in. 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: this topic documents only the element that is defined as part of html5. it does not address earlier, non-standardized implementation of the element. ...
<figure>: The Figure with Optional Caption element - HTML: Hypertext Markup Language
the figure, its caption, and its contents are referenced as a single unit. 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, sectioning root, palpable content. ...
<font> - HTML: Hypertext Markup Language
style attribute of each element). for any new web development, styling should be written using css only. the former behavior of the <font> element can be achieved, and even better controlled using the css fonts css properties. attributes like all other html elements, this element supports the global attributes. color this attribute sets the text color using either a named color or a color
specified in the hexadecimal #rrggbb format. face this attribute contains a comma-separated list of one or more font names. the document text in the default style is rendered in the first font face that the client's browser supports. if no font listed is installed on the local system, the browser typically defaults to the proportional or fixed-width font for that system. size this attribute specifies t...
<hr>: The Thematic Break (Horizontal Rule) element - HTML: Hypertext Markup Language
st have start tag, but must not have an end tag. permitted parents any element that accepts flow content. implicit aria role separator permitted aria roles presentation or none dom interface htmlhrelement attributes this element's attributes include the global attributes. align sets the alignment of the rule on the page. if no value is
specified, the default value is left. color sets the color of the rule through color name or hexadecimal value. noshade sets the rule to have no shading. size sets the height, in pixels, of the rule. width sets the length of the rule on the page through a pixel or percentage value. example html <p> this is the first paragraph of text. this is the first paragraph of text. this is t...
<input type="checkbox"> - HTML: Hypertext Markup Language
cos may draw the checkbox with a hyphen "-" inside to indicate an unexpected state. value the value attribute is one which all <input>s share; however, it serves a special purpose for inputs of type checkbox: when a form is submitted, only checkboxes which are currently checked are submitted to the server, and the reported value is the value of the value attribute. if the value is not otherwise
specified, it is the string on by default. this is demonstrated in the section value above. using checkbox inputs we already covered the most basic use of checkboxes above. let's now look at the other common checkbox-related features and techniques you'll need. handling multiple checkboxes the example we saw above only contained one checkbox; in real-world situations you'll be likely to encounter multi...
<input type="date"> - HTML: Hypertext Markup Language
y-mm-dd, then the element has no minimum date value. if both the max and min attributes are set, this value must be a date string earlier than or equal to the one in the max attribute. step the step attribute is a number that specifies the granularity that the value must adhere to, or the special value any, which is described below. only values which are equal to the basis for stepping (min if
specified, value otherwise, and an appropriate default value if neither of those is provided) are valid. a string value of any means that no stepping is implied, and any value is allowed (barring other constraints, such as min and max). note: when the data entered by the user doesn't adhere to the stepping configuration, the user agent may round to the nearest valid value, preferring numbers in the posi...
<input type="radio"> - HTML: Hypertext Markup Language
<input> across page loads. use the autocomplete attribute to control this feature. value the value attribute is one which all <input>s share; however, it serves a special purpose for inputs of type radio: when a form is submitted, only radio buttons which are currently checked are submitted to the server, and the reported value is the value of the value attribute. if the value is not otherwise
specified, it is the string on by default. this is demonstrated in the section value above. using radio inputs we already covered the fundamentals of radio buttons above. let's now look at the other common radio-button-related features and techniques you may need to know about. selecting a radio button by default to make a radio button selected by default, you simply include checked attribute, as shown...
<input type="reset"> - HTML: Hypertext Markup Language
</div> <div> <input type="reset" value="reset the form"> </div> </form> this renders like so: try entering some text into the text field, and then pressing the reset button. adding a reset keyboard shortcut to add a keyboard shortcut to a submit button — just as you would with any <input> for which it makes sense — you use the accesskey global attribute. in this example, r is
specified as the access key (you'll need to press r plus the particular modifier keys for your browser/os combination; see accesskey for a useful list of those). <form> <div> <label for="example">type in some sample text</label> <input id="example" type="text"> </div> <div> <input type="reset" value="reset the form" accesskey="r"> </div> </form> the problem with the above examp...
<main> - HTML: Hypertext Markup Language
e central topic of a document, or the central functionality of an application. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. a document mustn't have more than one <main> element that doesn't have the hidden attribute
specified. content categories flow content, palpable content. permitted content flow content. tag omission none; both the starting and ending tags are mandatory. permitted parents where flow content is expected, but only if it is a hierarchically correct main element. implicit aria role main permitted aria roles no role permitted ...
<map> - HTML: Hypertext Markup Language
this element includes the global attributes. name the name attribute gives the map a name so that it can be referenced. the attribute must be present and must have a non-empty value with no space characters. the value of the name attribute must not be a compatibility-caseless match for the value of the name attribute of another <map> element in the same document. if the id attribute is also
specified, both attributes must have the same value. examples <map name="primary"> <area shape="circle" coords="75,75,75" href="left.html"> <area shape="circle" coords="275,75,75" href="right.html"> </map> <img usemap="#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 ...
<menu> - HTML: Hypertext Markup Language
list permitted aria roles directory, group, listbox, menu, menubar, none, presentation, radiogroup, tablist, toolbar or tree dom interface htmlmenuelement attributes this element includes the global attributes. label the name of the menu as shown to the user. used within nested menus, to provide a label through which the submenu can be accessed. must only be
specified when the parent element is a <menu> in the context menu state. type this attribute indicates the kind of menu being declared, and can be one of two values. context : indicates the popup menu state, which represents a group of commands activated through another element. this might be as a button menu referenced by a menu attribute of a <button> element, or as context menu for an element wi...
<menuitem> - HTML: Hypertext Markup Language
commands gain checkboxes or radio buttons when defined against elements <input type="checkbox"> and <input type="radio">.) content categories none. permitted content none, it is an empty element. tag omission must have a start tag and must not have an end tag. permitted parents the <menu> element, where that element is in the popup menu state. (if
specified, the type attribute of the <menu> element must be popup; if missing, the parent element of the <menu> must itself be a <menu> in the popup menu state.) permitted aria roles none dom interface htmlmenuitemelement attributes this element includes the global attributes; in particular title can be used to describe the command, or provide usage hints. checked boolea...
theme-color - HTML: Hypertext Markup Language
example <meta name="theme-color" content="#4285f4"> the following image shows the effect that the <meta> element above will have on a document displayed in chrome running on an android mobile device. ...
Standard metadata names - HTML: Hypertext Markup Language
ormal the document is unaware of color schemes and should simply be rendered using the default color palette. [light | dark]+ one or more color schemes supported by the document. specifying the same color scheme more than once has the same effect as specifying it only once. indicating multiple color schemes indicates that the first scheme is preferred by the document, but that the second
specified scheme is acceptable if the user prefers it. only light indicates that the document only supports light mode, with a light background and dark foreground colors. by specification, only dark is not valid, because forcing a document to render in dark mode when it isn't truly compatible with it can result in unreadable content; all major browsers default to light mode if not otherwise configur...
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
v defines a pragma directive. the attribute is named http-equiv(alent) because all the allowed values are names of particular http headers: content-security-policy allows page authors to define a content policy for the current page. content policies mostly specify allowed server origins and script endpoints which help guard against cross-site scripting attacks. content-type if
specified, the content attribute must have the value "text/html; charset=utf-8". note: can only be used in documents served with a text/html mime type — not in documents served with an xml mime type. default-style sets the name of the default css style sheet set. x-ua-compatible if
specified, the content attribute must have the value "ie=edge". user agents are required to ignore this pra...
<ol>: The Ordered List element - HTML: Hypertext Markup Language
st items. always an arabic numeral (1, 2, 3, etc.), even when the numbering type is letters or roman numerals. for example, to start numbering elements from the letter "d" or the roman numeral "iv," use start="4". type sets the numbering type: a for lowercase letters a for uppercase letters i for lowercase roman numerals i for uppercase roman numerals 1 for numbers (default) the
specified type is used for the entire list unless a different type attribute is used on an enclosed <li> element. note: unless the type of the list number matters (like legal or technical documents where items are referenced by their number/letter), use the css list-style-type property instead. usage notes typically, ordered list items display with a preceding marker, such as a number or letter.
<param>: The Object Parameter element - HTML: Hypertext Markup Language
le no corresponding role permitted aria roles no role permitted dom interface htmlparamelement attributes this element includes the global attributes. name name of the parameter. value specifies the value of the parameter. deprecated attributes type only used if the valuetype is set to ref. specifies the mime type of values found at the uri
specified by value. valuetype specifies the type of the value attribute. possible values are: data: default value. the value is passed to the object's implementation as a string. ref: the value is a uri to a resource where run-time values are stored. object: an id of another <object> in the same document. examples please see the <object> page for examples on <param>. specifications ...
<script>: The Script element - HTML: Hypertext Markup Language
n (e.g. https→http). unsafe-url: the referrer will include the origin and the path (but not the fragment, password, or username). this value is unsafe, because it leaks origins and paths from tls-protected resources to insecure origins. note: an empty string value ("") is both the default value, and a fallback value if referrerpolicy is not supported. if referrerpolicy is not explicitly
specified on the <script> element, it will adopt a higher-level referrer policy, i.e. one set on the whole document or domain. if a higher-level policy is not available, the empty string is treated as being equivalent to no-referrer-when-downgrade. src this attribute specifies the uri of an external script; this can be used as an alternative to embedding a script directly within a document. type...
<style>: The Style Information element - HTML: Hypertext Markup Language
cade issues. in the same manner as <link> elements, <style> elements can include media attributes that contain media queries, allowing you to selectively apply internal stylesheets to your document depending on media features such as viewport width. attributes this element includes the global attributes. type this attribute defines the styling language as a mime type (charset should not be
specified). this attribute is optional and defaults to text/css if it is not
specified; values other than the empty string or text/css are not used. note: there is very little reason to include this attribute in modern web documents. media this attribute defines which media the style should be applied to. its value is a media query, which defaults to all if the attribute is missing. nonce a cryptograph...
<table>: The Table element - HTML: Hypertext Markup Language
a caption to your table with <caption> caption & summary • tables • w3c wai web accessibility tutorials scoping rows and columns the scope attribute on header elements is redundant in simple contexts, because scope is inferred. however, some assistive technologies may fail to draw correct inferences, so specifying header scope may improve user experiences. in complex tables, scope can be
specified so as to provide necessary information about the cells related to a header. example <table> <caption>color names and values</caption> <tbody> <tr> <th scope="col">name</th> <th scope="col">hex</th> <th scope="col">hsla</th> <th scope="col">rgba</th> </tr> <tr> <th scope="row">teal</th> <td><code>#51f6f6</code></td> <td><code>hsla(180, 90...
<tbody>: The Table Body element - HTML: Hypertext Markup Language
color property instead. char this attribute is used to set the character to align the cells in a column on. typical values for this include a period (.) when attempting to align numbers or monetary values. if align is not set to char, this attribute is ignored. charoff this attribute is used to indicate the number of characters to offset the column data from the alignment characters
specified by the char attribute. valign this attribute specifies the vertical alignment of the text within each row of cells of the table header. possible values for this attribute are: baseline, which will put the text as close to the bottom of the cell as it is possible, but align it on the baseline of the characters instead of the bottom of them. if characters are all of the size, this has the s...
<tfoot>: The Table Foot element - HTML: Hypertext Markup Language
bute as it is obsolete (and not supported) in the latest standard. to achieve the same effect as the char, in css3, you can use the character set using the char attribute as the value of the text-align property unimplemented. charoff deprecated since html4obsolete since html5 this attribute is used to indicate the number of characters to offset the column data from the alignment characters
specified by the char attribute. note: do not use this attribute as it is obsolete (and not supported) in the latest standard. valign deprecated since html4obsolete since html5 this attribute specifies the vertical alignment of the text within each row of cells of the table header. possible values for this attribute are: baseline, which will put the text as close to the bottom of the cell as it...
<thead>: The Table Head element - HTML: Hypertext Markup Language
not use this attribute as it is obsolete (and not supported) in the latest standard. to achieve the same effect as the char, in css3, you can use the character set using the char attribute as the value of the text-align property unimplemented. charoff in html 4, in html5 this attribute is used to indicate the number of characters to offset the column data from the alignment characters
specified by the char attribute. note: do not use this attribute as it is obsolete (and not supported) in the latest standard. valign in html 4, in html5 this attribute specifies the vertical alignment of the text within each row of cells of the table header. possible values for this attribute are: baseline, which will put the text as close to the bottom of the cell as it is possible, but a...
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
en. chapters chapter titles are intended to be used when the user is navigating the media resource. metadata tracks used by scripts. not visible to the user. label a user-readable title of the text track which is used by the browser when listing available text tracks. src address of the track (.vtt file). must be a valid url. this attribute must be
specified and its url value must have the same origin as the document — unless the <audio> or <video> parent element of the track element has a crossorigin attribute. srclang language of the track text data. it must be a valid bcp 47 language tag. if the kind attribute is set to subtitles, then srclang must be defined. usage notes track data types the type of data that track adds to the media is se...
itemtype - HTML: Hypertext Markup Language
te must have a value that is an unordered set of unique tokens which are case-sensitive, each is a valid and absolute url, and all defined to use the same vocabulary. the attribute's value must have at least one token. the item types must all be types defined in applicable specifications (such as schema.org), and must all be defined to use the same vocabulary. the itemtype attribute can only be
specified on elements which have an itemscope attribute
specified. the itemid attribute can only be
specified on elements which have both an itemscope attribute and an itemtype attribute
specified. they must only be
specified on elements with an itemscope attribute, whose itemtype attribute specifies a vocabulary not supporting global identifiers for items, as defined by that vocabulary's specification. ...
tabindex - HTML: Hypertext Markup Language
element should be focusable in sequential keyboard navigation, with its order defined by the value of the number. that is, tabindex="4" is focused before tabindex="5" and tabindex="0", but after tabindex="3". if multiple elements share the same positive tabindex value, their order relative to each other follows their position in the document source. the maximum value for tabindex is 32767. if not
specified, it takes the default value 0. avoid using tabindex values greater than 0. doing so makes it difficult for people who rely on assistive technology to navigate and operate page content. instead, write the document with the elements in a logical sequence. if you set the tabindex attribute on a <div>, then its child content cannot be scrolled with the arrow keys unless you set tabindex o...
Inline elements - HTML: Hypertext Markup Language
inline elements are those which only occupy the space bounded by the tags defining the element, instead of breaking the flow of the content. in this article, we'll examine html inline-level elements and how they differ from block-level elements. an inline element does not start on a new line and only takes up as much width as necessary. inline vs. ...
Microdata - HTML: Hypertext Markup Language
blems between the cyrillic and latin alphabets. due to the implementation of additional marking parameters of schema's vocabulary, the indexation of information in russian-language web-pages became considerably more successful. global attributes itemid – the unique, global identifier of an item. itemprop – used to add properties to an item. every html element may have an itemprop attribute
specified, where an itemprop consists of a name and value pair. itemref – properties that are not descendants of an element with the itemscope attribute can be associated with the item using an itemref. itemref provides a list of element ids (not itemids) with additional properties elsewhere in the document. itemscope – itemscope (usually) works along with itemtype to specify that the html contained ...
Preloading content with rel="preload" - HTML: Hypertext Markup Language
it is intended for prefetching resources that will be used in the next navigation/page load (e.g. when you go to the next page). this is fine, but isn't useful for the current page! in addition, browsers will give prefetch resources a lower priority than preload ones — the current page is more important than the next. see link prefetching faq for more details. <link rel="prerender"> renders a
specified webpage in the background, speeding up its load if the user navigates to it. because of the potential to waste users bandwidth, chrome treats prerender as a nostate prefetch instead. <link rel="subresource"> was supported in chrome a while ago, and was intended to tackle the same issue as preload, but it had a problem: there was no way to work out a priority for the items (as didn't exist back...
HTML: Hypertext Markup Language
nsists of elements, each of which may be modified by some number of attributes. html documents are connected to each other with links. html element reference browse a list of all html elements. html attribute reference elements in html have attributes. these are additional values that configure the elements or adjust their behavior in various ways. global attributes global attributes may be
specified on all html elements, even those not
specified in the standard. this means that any non-standard elements must still permit these attributes, even though those elements make the document html5-noncompliant. inline elements and block-level elements html elements are usually "inline" or "block-level" elements. an inline element occupies only the space bounded by the tags that define it. a block-l...
Reason: invalid token ‘xyz’ in CORS header ‘Access-Control-Allow-Methods’ - HTTP
to the cors request that was sent by the server includes an access-control-allow-methods header which includes at least one invalid method name. the access-control-allow-methods header is sent by the server to let the client know what http request methods it supports for cors requests. the header's value is a comma-delineated string of http method names, such as get, post, or head. if any of the
specified values are not recognized by the client user agent, this error occurs. this is a problem that most likely can only be fixed on the server side, by modifying the server's configuration to no longer send the invalid or unknown method name with the access-control-allow-methods header. it may also be worth checking to ensure that the user agent or http library you're using on the client is up-to-dat...
Reason: missing token ‘xyz’ in CORS header ‘Access-Control-Allow-Headers’ from CORS preflight channel - HTTP
er to let the client know which headers it supports for cors requests. the value of access-control-allow-headers should be a comma-delineated list of header names, such as "x-custom-information" or any of the standard but non-basic header names (which are always allowed). this error occurs when attempting to preflight a header that is not expressly allowed (that is, it's not included in the list
specified by the access-control-allow-headers header sent by the server). to fix this, the server needs to be updated so that it allows the indicated header, or you need to avoid using that header. ...
Reason: CORS request not HTTP - HTTP
this often occurs if the url specifies a local file, using a file:/// url. to fix this problem, simply make sure you use https urls when issuing requests involving cors, such as xmlhttprequest, fetch apis, web fonts (@font-face), and webgl textures, and xsl stylesheets. local file security in firefox 68 when a user opened a page using a file:/// uri in firefox 67 and earlier, the origin of the page was defined as the directory from which the page was opened. ...
Configuring servers for Ogg media - HTTP
ver should accept the accept-ranges: bytes http header if it can accept byte-range requests. it must return 206: partial content to all byte range requests; otherwise, browsers can't be sure you actually support byte range requests. your server must also return 206: partial content for the request range: bytes=0- as well. include regular key frames when the browser seeks through ogg media to a
specified time, it has to seek to the nearest key frame before the seek target, then download and decode the video from there until the requested target time. the farther apart your key frames are, the longer this takes, so it's helpful to include key frames at regular intervals. by default, ffmpeg2theora uses one key frame every 64 frames (or about every 2 seconds at 30 frames per second), which works pr...
Access-Control-Allow-Origin - HTTP
rol-allow-origin response header indicates whether the response can be shared with requesting code from the given origin. header type response header forbidden header name no syntax access-control-allow-origin: * access-control-allow-origin: <origin> access-control-allow-origin: null directives * for requests without credentials, the literal value "*" can be
specified, as a wildcard; the value tells browsers to allow requesting code from any origin to access the resource. attempting to use the wildcard with credentials will result in an error. <origin> specifies an origin. only a single origin can be
specified. if the server supports clients from multiple origins, it must return the origin for the specific client making the request. null specifies the orig...
Alt-Svc - HTTP
ax-age> seconds, minus the age of the response (from the age header). if the cached entry expires, the client can no longer use this alternative service for new connections. persist=1optional usually cached alternative service entries are cleared on network configuration changes. use of the persist=1 parameter ensures that the entry is not deleted through such changes. multiple entries can be
specified in a single alt-svc header using comma as separator. in that case, early entries are considered more preferable. example alt-svc: h2=":443"; ma=2592000; alt-svc: h2=":443"; ma=2592000; persist=1 alt-svc: h2="alt.example.com:443", h2=":443" alt-svc: h3-25=":443"; ma=3600, h2=":443"; ma=3600 specifications specification status comment rfc 7838 ietf rfc initial ...
Cache-Control - HTTP
-maxage=<seconds> overrides max-age or the expires header, but only for shared caches (e.g., proxies). ignored by private caches. max-stale[=<seconds>] indicates the client will accept a stale response. an optional value in seconds indicates the upper limit of staleness the client will accept. min-fresh=<seconds> indicates the client wants a response that will still be fresh for at least the
specified number of seconds. stale-while-revalidate=<seconds> indicates the client will accept a stale response, while asynchronously checking 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 re...
Content-Encoding - HTTP
which has disappeared from most unix distributions, this content-encoding is not used by many browsers today, partly because of a patent issue (it expired in 2003). deflate using the zlib structure (defined in rfc 1950) with the deflate compression algorithm (defined in rfc 1951). identity indicates the identity function (i.e., no compression or modification). this token, except if explicitly
specified, is always deemed acceptable. br a format using the brotli algorithm. examples compressing with gzip on the client side, you can advertise a list of compression schemes that will be sent along in an http request. the accept-encoding header is used for negotiating content encoding. accept-encoding: gzip, deflate the server responds with the scheme used, indicated by the content-encoding re...
Content-Language - HTTP
example, if "content-language: de-de" is set, it says that the document is intended for german language speakers (however, it doesn't indicate the document is written in german. for example, it might be written in english as part of a language course for german speakers. if you want to indicate which language the document is written in, use the lang attribute instead). if no content-language is
specified, the default is that the content is intended for all language audiences. multiple language tags are also possible, as well as applying the content-language header to various media types and not only to textual documents. header type entity header forbidden header name no cors-safelisted response header yes cors-safelisted request header yes, with t...
Content-Range - HTTP
eader indicates where in a full body message a partial message belongs. header type response header forbidden header name no cors-safelisted response-header no syntax content-range: <unit> <range-start>-<range-end>/<size> content-range: <unit> <range-start>-<range-end>/* content-range: <unit> */<size> directives <unit> the unit in which ranges are
specified. this is usually bytes. <range-start> an integer in the given unit indicating the beginning of the request range. <range-end> an integer in the given unit indicating the end of the requested range. <size> the total size of the document (or '*' if unknown). examples content-range: bytes 200-1000/67589 specifications specification title rfc 7233, section 4.2: con...
CSP: default-src - HTTP
h a nonce or a hash, shall be propagated to all the scripts loaded by that root script. at the same time, any allow-list or source expressions such as 'self' or 'unsafe-inline' are ignored. see script-src for an example. 'report-sample' requires a sample of the violating code to be included in the violation report. examples no inheritance with default-src if there are other directives
specified, default-src does not influence them. the following header: content-security-policy: default-src 'self'; script-src https://example.com is the same as: content-security-policy: connect-src 'self'; font-src 'self'; frame-src 'self'; img-src 'self'; manifest-src 'self'; me...
CSP: frame-ancestors - HTTP
for the source. single quotes surrounding the host are not allowed. examples: http://*.example.com: matches all attempts to load from any subdomain of example.com using the http: url scheme. mail.example.com:443: matches all attempts to access port 443 on mail.example.com. https://store.example.com: matches all attempts to access store.example.com using https:. if no url scheme is
specified for a host-source and the iframe is loaded from an https url, the url for the page loading 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...
CSP: navigate-to - HTTP
this is an enforcement on what navigations this document initiates not on what this document is allowed to navigate to. 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. ...
CSP: plugin-types - HTTP
the http content-security-policy (csp) plugin-types directive restricts the set of plugins that can be embedded into a document by limiting the types of resources which can be loaded. instantiation of an <embed>, <object> or <applet> element will fail if: the element to load does not declare a valid mime type, the declared type does not match one of
specified types in the plugin-types directive, the fetched resource does not match the declared type. csp version 2 directive type document directive default-src fallback no. not setting this allows anything. syntax one or more mime types can be set for the plugin-types policy: content-security-policy: plugin-types <type>/<subtype>; content-security-policy: plugin-types <type>/<subtype> <type>/<subty...
CSP: referrer - HTTP
precated and removed from browsers. use the referrer-policy header instead. syntax content-security-policy: referrer <referrer-policy>; where <referrer-policy> can be one of the following values: "no-referrer" the referer header will be omitted entirely. no referrer information is sent along with requests. "none-when-downgrade" this is the user agent's default behavior if no policy is
specified. the origin is sent as referrer to a-priori as-much-secure destination (https->https), but isn't sent to a less secure destination (https->http). "origin" only send the origin of the document as the referrer in all cases. the document https://example.com/page.html will send the referrer https://example.com/. "origin-when-cross-origin" / "origin-when-crossorigin" send a full url when performi...
CSP: report-uri - HTTP
though the report-to directive is intended to replace the deprecated report-uri directive, report-to isn’t supported in most browsers yet. ...
Content-Type - HTTP
be very robust through email gateways, and not ending with white space. it is used to encapsulate the boundaries of the multiple parts of the message. often, the header boundary is prepended with two dashes and the final boundary has two dashes appended at the end. examples content-type in html forms in a post request, resulting from an html form submission, the content-type of the request is
specified by the enctype attribute on the <form> element. <form action="/" method="post" enctype="multipart/form-data"> <input type="text" name="description" value="some text"> <input type="file" name="myfile"> <button type="submit">submit</button> </form> the request looks something like this (less interesting headers are omitted here): post /foo http/1.1 content-length: 68137 content-type: mult...
DNT - HTTP
es the user's tracking preference. it lets users indicate whether they would prefer privacy rather than personalized content. header type request header forbidden header name yes syntax dnt: 0 dnt: 1 dnt: null directives 0 the user prefers to allow tracking on the target site. 1 the user prefers not to be tracked on the target site. null the user has not
specified a preference about tracking. examples reading do not track status from javascript the user's dnt preference can also be read from javascript using the navigator.donottrack property: navigator.donottrack; // "0" or "1" specifications specification status comment tracking preference expression (dnt)the definition of 'dnt header field for http requests' in that specifi...
ETag - HTTP
ly equivalent, but not byte-for-byte identical. this means weak etags prevent caching when byte range requests are used, but strong etags mean range requests can still be cached. "<etag_value>" entity tag uniquely representing the requested resource. they are a string of ascii characters placed between double quotes, like "675af34563dc-tr34". the method by which etag values are generated is not
specified. often, a hash of the content, a hash of the last modification timestamp, or just a revision number is used. for example, mdn uses a hexadecimal hash of the wiki article content. examples etag: "33a64df551425fcc55e4d42a148795d9f25f89d4" etag: w/"0815" avoiding mid-air collisions with the help of the etag and the if-match headers, you can detect mid-air edit collisions. for example, when edi...
Expect - HTTP
failed) if it cannot meet the expectation; or any other 4xx status otherwise. for example, the server may reject a request if its content-length is too large. no common browsers send the expect header, but some other clients such as curl do so by default. header type request header forbidden header name yes syntax no other expectations except "100-continue" are
specified currently. expect: 100-continue directives 100-continue informs recipients that the client is about to send a (presumably large) message body in this request and wishes to receive a 100 (continue) interim response. examples large message body a client sends a request with a expect header and waits for the server to respond before sending the message body. put /somewhere/fun http/1.1 h...
Feature-Policy: unsized-media - HTTP
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. 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. syntax feature-policy: unsized-media <allowlist>; <allowlist> an allowlist is a list of origins that takes one or more of the following values, separated by spaces: *: the feature will be allowed in this document, and all nested browsing contexts (iframes) regardless of their origin. 'self': the feature will be allowed in this document, and in all nested browsing contexts (iframes) in the same origin. 'src': (in an ifram...
Feature-Policy - HTTP
r not the current document is allowed to use the webxr device api to interact with a webxr session. example securecorp inc. wants to disable microphone and geolocation apis in its application. it can do so by delivering the following http response header to define a feature policy: feature-policy: microphone 'none'; geolocation 'none' by specifying the 'none' keyword for the origin list, the
specified features will be disabled for all browsing contexts (this includes all iframes), regardless of their origin. specifications specification permissions policy ...
Pragma - HTTP
the pragma http/1.0 general header is an implementation-specific header that may have various effects along the request-response chain. it is used for backwards compatibility with http/1.0 caches where the cache-control http/1.1 header is not yet present. note: pragma is not
specified for http responses 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. header type general header, but response behavior is not
specified and thus implementation-specific. forbidden header name no cors-safelisted response header yes syntax pragma: ...
Proxy-Authenticate - HTTP
ate header is sent along with a 407 proxy authentication required. header type response header forbidden header name no syntax proxy-authenticate: <type> realm=<realm> directives <type> authentication type. a common type is "basic". iana maintains a list of authentication schemes. realm=<realm> a description of the protected area, the realm. if no realm is
specified, clients often display a formatted host name instead. examples proxy-authenticate: basic proxy-authenticate: basic realm="access to the internal site" specifications specification title rfc 7235, section 4.3: proxy-authenticate http/1.1: authentication rfc 7617 the 'basic' http authentication scheme ...
Public-Key-Pins - HTTP
ect public key information (spki) fingerprint. it is possible to specify multiple pins for different public keys. some browsers might allow other hashing algorithms than sha-256 in the future. max-age=<expire-time> the time, in seconds, that the browser should remember that this site is only to be accessed using one of the defined keys. includesubdomains optional if this optional parameter is
specified, this rule applies to all of the site's subdomains as well. report-uri="<uri>" optional if this optional parameter is
specified, pin validation failures are reported to the given url. example hpkp has the potential to lock out users for a long time if used incorrectly! the use of backup certificates and/or pinning the ca certificate is recommended. public-key-pins: pin-sha256="cupctazwk...
Range - HTTP
header type request header forbidden header name no syntax range: <unit>=<range-start>- range: <unit>=<range-start>-<range-end> range: <unit>=<range-start>-<range-end>, <range-start>-<range-end> range: <unit>=<range-start>-<range-end>, <range-start>-<range-end>, <range-start>-<range-end> range: <unit>=-<suffix-length> directives <unit> the unit in which ranges are
specified. this is usually bytes. <range-start> an integer in the given unit indicating the beginning of the request range. <range-end> an integer in the given unit indicating the end of the requested range. this value is optional and, if omitted, the end of the document is taken as the end of the range. <suffix-length> an integer in the given unit indicating the number of units at the end of the ...
SameSite cookies - HTTP
and so the following message might appear in your console: some cookies are misusing the “samesite“ attribute, so it won’t work as expected. cookie “mycookie” has “samesite” policy set to “lax” because it is missing a “samesite” attribute, and “samesite=lax” is the default value for this attribute. the warning appears because the samesite policy for a cookie has not
specified explicitly: set-cookie: flavor=choco while you could rely on modern browsers to apply samesite=lax automatically, you should rather specify it explicitly to clearly communicate your intent which samesite policy applies to your cookie. this will also improve the experience across browsers as not all of them default to lax yet. set-cookie: flavor=choco; samesite=lax example: rewriteengine on r...
Transfer-Encoding - HTTP
). gzip a format using the lempel-ziv coding (lz77), with a 32-bit crc. this is originally the format of the unix gzip program. the http/1.1 standard also recommends that the servers supporting this content-encoding should recognize x-gzip as an alias, for compatibility purposes. identity indicates the identity function (i.e. no compression, nor modification). this token, except if explicitly
specified, is always deemed acceptable. examples chunked encoding chunked encoding is useful when larger amounts of data are sent to the client and the total size of the response may not be known until the request has been fully processed. for example, when generating a large html table resulting from a database query or when transmitting large images. a chunked response looks like this: http/1.1 200 ...
WWW-Authenticate - HTTP
icate header is sent along with a 401 unauthorized response. header type response header forbidden header name no syntax www-authenticate: <type> realm=<realm>[, charset="utf-8"] directives <type> authentication type. a common type is "basic". iana maintains a list of authentication schemes. realm=<realm> a description of the protected area. if no realm is
specified, clients often display a formatted hostname instead. charset=<charset> tells the client the server's prefered encoding scheme when submitting a username and password. the only allowed value is the case insensitive string "utf-8". this does not relate to the encoding of the realm string. examples typically, a server response contains a www-authenticate header that looks like these: www-authe...
X-Frame-Options - HTTP
op level, the parent, or the whole chain, although it is argued that the option is not very useful unless all ancestors are also in the same origin (see bug 725490). also see browser compatibility for support details. allow-from uri this is an obsolete directive that no longer works in modern browsers. don't use it. in supporting legacy browsers, a page can be displayed in a frame only on the
specified origin uri. note that in the legacy firefox implementation this still suffered from the same problem as sameorigin did — it doesn't check the frame ancestors to see if they are in the same origin. the content-security-policy http header has a frame-ancestors directive which you can use instead. examples note: setting x-frame-options inside the <meta> element is useless! for instance, <meta...
Link prefetching FAQ - HTTP
what is link prefetching? link prefetching is a browser mechanism, which utilizes browser idle time to download or prefetch documents that the user might visit in the near future. a web page provides a set of prefetching hints to the browser, and after the browser is finished loading the page, it begins silently prefetching
specified documents and stores them in its cache. when the user visits one of the prefetched documents, it can be served up quickly out of the browser's cache. does prefetching work with https? starting in gecko 1.9.1 (firefox 3.5), https content can be prefetched. what are the prefetching hints? the browser looks for either an html <link> or an http link: header with a relation type of either next or prefetch. an example using the link tag follows: <link rel="pref...
HTTP Messages - HTTP
is start-line is always a single line. an optional set of http headers specifying the request, or describing the body included in the message. a blank line indicating all meta-information for the request has been sent. an optional body containing data associated with the 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 (...
DELETE - HTTP
request has body may successful response has body may safe no idempotent yes cacheable no allowed in html forms no syntax delete /file.html http/1.1 example request delete /file.html http/1.1 responses if a delete method is successfully applied, there are several response status codes possible: a 202 (accepted) status code if the action will likely succeed but has not yet been enacted. a 204 (no content) status code if the action has been enacted and no further information is to be supplied. ...
GET - HTTP
requests using get should only retrieve data. ...
Network Error Logging - HTTP
d (and, if desired, successful) network fetches from supporting browsers. reports are sent to a reporting group defined within a report-to header. usage web applications opt in to this behaviour with the nel header, which is a json-encoded object: nel: { "report_to": "nel", "max_age": 31556952 } an origin considered secure by the browser is required. the following object keys can be
specified in the nel header: report_to the reporting api group to send network error reports to (see below). max_age specifies the lifetime of the policy, in seconds (in a similar way to e.g. hsts policies are time-restricted). the referenced reporting group should have a lifetime at least as long as the nel policy. include_subdomains if true, the policy applies to all subdomains under the orig...
HTTP resources and specifications - HTTP
designed with extensibility in mind, it has seen numerous additions over the years; this lead to its specification being scattered through numerous specification documents (in the midst of experimental abandoned extensions). this page lists relevant resources about http. ...
A typical HTTP session - HTTP
x-www-form-urlencoded name=joe%20user&request=send%20me%20one%20of%20your%20catalogue request methods http defines a set of request methods indicating the desired action to be performed upon a resource. although they can also be nouns, these requests methods are sometimes referred as http verbs. the most common requests are get and post: the get method requests a data representation of the
specified resource. requests using get should only retrieve data. the post method sends data to a server so it may change its state. this is the method often used for html forms. structure of a server response after the connected agent has sent its request, the web server processes it, and ultimately returns a response. similar to a client request, a server response is formed of text directives, separa...
JavaScript data types and data structures - JavaScript
escription default value [[get]] function object or undefined the function is called with an empty argument list and retrieves the property value whenever a get access to the value is performed. see also get. undefined [[set]] function object or undefined the function is called with an argument that contains the assigned value and is executed whenever a
specified property is attempted to be changed. see also set. undefined [[enumerable]] boolean if true, the property will be enumerated in for...in loops. false [[configurable]] boolean if false, the property can't be deleted and can't be changed to a data property. false "normal" objects, and functions a javascript object is a mapping between keys and valu...
Equality comparisons and sameness - JavaScript
erable: false }); function attemptmutation(v) { object.defineproperty(number, 'negative_zero', { value: v }); } object.defineproperty will throw an exception when attempting to change an immutable property, but it does nothing if no actual change is requested. if v is -0, no change has been requested, and no error will be thrown. internally, when an immutable property is redefined, the newly-
specified value is compared against the current value using same-value equality. same-value equality is provided by the object.is method. same-value-zero equality similar to same-value equality, but +0 and -0 are considered equal. abstract equality, strict equality, and same value in the specification in es5, the comparison performed by == is described in section 11.9.3, the abstract equality algorith...
Concurrency model and the event loop - JavaScript
e number of waiting tasks in the queue. in the example below, the message ''this is just a message'' will be written to the console before the message in the callback gets processed, because the delay is the minimum time required for the runtime to process the request (not a guaranteed time). basically, the settimeout needs to wait for all the code for queued messages to complete even though you
specified a particular time limit for your settimeout. (function() { console.log('this is the start'); settimeout(function cb() { console.log('callback 1: this is a msg from call back'); }); // has a default time value of 0 console.log('this is just a message'); settimeout(function cb1() { console.log('callback 2: this is a msg from call back'); }, 0); console.log('this is the e...
Groups and ranges - JavaScript
l() to get all matches. \n where "n" is a positive integer. a back reference to the last substring matching the n parenthetical in the regular expression (counting left parentheses). for example, /apple(,)\sorange\1/ matches "apple, orange," in "apple, orange, cherry, peach". \k<name> a back reference to the last substring matching the named capture group
specified by <name>. for example, /(?<title>\w+), yes \k<title>/ matches "sir, yes sir" in "do you copy? sir, yes sir!". \k is used literally here to indicate the beginning of a back reference to a named capture group. (?<name>x) named capturing group: matches "x" and stores it on the groups property of the returned matches under the name
specified by <name>. the an...
Unicode property escapes - JavaScript
ore info. unicodepropertyname the name of a non-binary property: unicodepropertyvalue one of the tokens listed in the values section, below. many values have aliases or shorthand (e.g. the value decimal_number for the general_category property may be written nd, digit, or decimal_number). for most values, the unicodepropertyname part and equals sign may be omitted. if a unicodepropertyname is
specified, the value must correspond to the property type given. note: as there are many properties and values available, we will not describe them exhaustively here but rather provide various examples rationale before es2018 there was no performance-efficient way to match characters from different sets based on scripts (like macedonian, greek, georgian etc.) or propertyname (like emoji etc) in javas...
Regular expressions - JavaScript
search(), replace(), split() this guide articles': character classes, assertions, groups and ranges, quantifiers, unicode property escapes using special characters to verify input in the following example, the user is expected to enter a phone number. when the user presses the "check" button, the script checks the validity of the number. if the number is valid (matches the character sequence
specified by the regular expression), the script shows a message thanking the user and confirming the number. if the number is invalid, the script informs the user that the phone number is not valid. within non-capturing parentheses (?: , the regular expression looks for three numeric characters \d{3} or | a left parenthesis \( followed by three digits \d{3}, followed by a close parenthesis \), (end non-c...
Using Promises - JavaScript
have unhandled rejected promises. these get logged to the console by the node runtime. you can capture these for analysis and handling by your code—or just to avoid having them cluttering up your output—by adding a handler for the unhandledrejection event, like this: window.addeventlistener("unhandledrejection", event => { /* you might start here by adding code to examine the promise
specified by event.promise and the reason in event.reason */ event.preventdefault(); }, false); by calling the event's preventdefault() method, you tell the javascript runtime not to do its default action when rejected promises go unhandled. that default action usually involves logging the error to console, and this is indeed the case for node. ideally, of course, you should examine the rejected...
Deprecated and obsolete features - JavaScript
been entirely removed from javascript and can no longer be used as of the indicated version of javascript. object property description __count__ returns the number of enumerable properties directly on a user-defined object. __parent__ points to an object's context. object.prototype.eval() evaluates a string of javascript code in the context of the
specified object. object.observe() asynchronously observing the changes to an object. object.unobserve() remove observers. object.getnotifier() creates an object that allows to synthetically trigger a change. function property description arity number of formal arguments. array property description array.observ...
RangeError: radix must be an integer - JavaScript
the javascript exception "radix must be an integer at least 2 and no greater than 36" occurs when the optional radix parameter of the number.prototype.tostring() or the bigint.prototype.tostring() method was
specified and is not between 2 and 36. message rangeerror: invalid argument (edge) rangeerror: radix must be an integer at least 2 and no greater than 36 (firefox) rangeerror: tostring() radix argument must be between 2 and 36 (chrome) error type rangeerror what went wrong? the optional radix parameter of the number.prototype.tostring() or the bigint.prototype.tostring() method was
specified. its value must be an integer (a number) between 2 and 36, specifying the base of the number system to be used for representing numeric values. for example, the decimal (base 10) number 169 is repre...
TypeError: can't redefine non-configurable property "x" - JavaScript
whether its attributes (other than writable) can be changed. usually, properties in an object created by an object 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 if you haven't
specified them as configurable. var obj = object.create({}); object.defineproperty(obj, "foo", {value: "bar"}); object.defineproperty(obj, "foo", {value: "baz"}); // typeerror: can't redefine non-configurable property "foo" you will need to set the "foo" property to configurable, if you intend to redefine it later in the code. var obj = object.create({}); object.defineproperty(obj, "foo", {value: "bar...
TypeError: setting getter-only property "x" - JavaScript
the javascript strict mode-only exception "setting getter-only property" occurs when there is an attempt to set a new value to a property for which only a getter is
specified. message typeerror: assignment to read-only properties is not allowed in strict mode (edge) typeerror: setting getter-only property "x" (firefox) typeerror: cannot set property "prop" of #<object> which has only a getter (chrome) error type typeerror in strict mode only. what went wrong? there is an attempt to set a new value to a property for which only a getter is
specified. while this will be silently ignored in non-strict mode, it will throw a typeerror in strict mode. examples property with no setter the example below shows how to set a getter for a property. it doesn't specify a setter, so a typeerror will be ...
SyntaxError: missing ) after condition - JavaScript
pear in parenthesis after the if keyword. message syntaxerror: expected ')' (edge) syntaxerror: missing ) after condition (firefox) error type syntaxerror what went wrong? there is an error with how an if condition is written. in any programming language, code needs to make decisions and carry out actions accordingly depending on different inputs. the if statement executes a statement if a
specified condition is truthy. in javascript, this condition must appear in parenthesis after the if keyword, like this: if (condition) { // do something if the condition is true } examples missing parenthesis it might just be an oversight, carefully check all you parenthesis in your code. if (3 > math.pi { console.log("wait what?"); } // syntaxerror: missing ) after condition to fix this code,...
TypeError: can't delete non-configurable array element - JavaScript
s 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.defineproperty(arr, 1, {value: "1"}); arr.length = 1; // typeerror: can't delete non-configurable array element you will need to set the elements as configurable, if you intend to shorten the array. var arr = []; object.defineproperty(arr, 0, {value: 0, configurable: true}); object.defineproperty(arr, 1, {v...
Arrow function expressions - JavaScript
{}; console.log(foo.prototype); // undefined use of the yield keyword the yield keyword may not be used in an arrow function's body (except when permitted within functions further nested within it). as a consequence, arrow functions cannot be used as generators. function body arrow functions can have either a "concise body" or the usual "block body". in a concise body, only an expression is
specified, which becomes the implicit return value. in a block body, you must use an explicit return statement. var func = x => x * x; // concise body syntax, implied "return" var func = (x, y) => { return x + y; }; // with block body, explicit "return" needed returning object literals keep in mind that returning object literals using the concise body syntax params => {object:literal} will not work as...
setter - JavaScript
n](val) { . . . }} parameters prop the name of the property to bind to the given function. val an alias for the variable that holds the value attempted to be assigned to prop. expression starting with ecmascript 2015, you can also use expressions for a computed property name to bind to the given function. description in javascript, a setter can be used to execute a function whenever a
specified property is attempted to be changed. setters are most often used in conjunction with getters to create a type of pseudo-property. it is not possible to simultaneously have a setter on a property that holds an actual value. note the following when working with the set syntax: it can have an identifier which is either a number or a string; it must have exactly one parameter (see incompatible ...
Functions - JavaScript
in non-strict code, function declarations inside blocks behave strangely. for example: if (shoulddefinezero) { function zero() { // danger: compatibility risk console.log("this is zero."); } } es2015 says that if shoulddefinezero is false, then zero should never be defined, since the block never executes. however, it's a new part of the standard. historically, this was left un
specified, and some browsers would define zero whether the block executed or not. in strict mode, all browsers that support es2015 handle this the same way: zero is defined only if shoulddefinezero is true, and only in the scope of the if-block. a safer way to define functions conditionally is to assign a function expression to a variable: var zero; if (shoulddefinezero) { zero = function() { c...
Array.prototype.every() - JavaScript
l elements of the empty set satisfy any given condition.) polyfill every was added to the ecma-262 standard in the 5th edition, and it may not be present in other implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of every in implementations which do not natively support it. this algorithm is exactly the one
specified in ecma-262, 5th edition, assuming object and typeerror have their original values, and that callbackfn.call evaluates to the original value of function.prototype.call. if (!array.prototype.every) { array.prototype.every = function(callbackfn, thisarg) { 'use strict'; var t, k; if (this == null) { throw new typeerror('this is null or not defined'); } // 1. let o be ...
Array.prototype.filter() - JavaScript
hey will not be visited. polyfill filter() was added to the ecma-262 standard in the 5th edition. therefore, it may not be present in all implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of filter() in ecma-262 implementations which do not natively support it. this algorithm is exactly equivalent to the one
specified in ecma-262, 5th edition, assuming that fn.call evaluates to the original value of function.prototype.bind(), and that array.prototype.push() has its original value. if (!array.prototype.filter){ array.prototype.filter = function(func, thisarg) { 'use strict'; if ( ! ((typeof func === 'function' || typeof func === 'function') && this) ) throw new typeerror(); var len = thi...
Array.prototype.flat() - 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 var newarray = arr.flat([depth]); parameters depth optional the depth level specifying how deep a nested array structure should be flattened. defaults to 1. return value a new array with the sub-array elements concatenated into it. ...
Array.from() - JavaScript
bclass, not array. polyfill array.from() was added to the ecma-262 standard in the 6th edition (es2015). as such, it may not be present in other implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of array.from() in implementations that don't natively support it. polyfill notes: this algorithm is exactly as
specified in ecma-262 6th edition (assuming object and typeerror have their original values and that callback.call() evaluates to the original value of function.prototype.call()). in addition, since true iterables cannot be polyfilled, this implementation does not support generic iterables as defined in the 6th edition of ecma-262. // production steps of ecma-262, edition 6, 22.1.2.1 if (!array.from) { ...
Array.prototype.includes() - JavaScript
t fromindex for positive values of fromindex, or at arr.length + fromindex for negative values of fromindex (using the absolute value of fromindex as the number of elements from the end of the array at which to start the search). defaults to 0. return value a boolean which is true if the value valuetofind is found within the array (or the part of the array indicated by the index fromindex, if
specified). values of zero are all considered to be equal, regardless of sign. (that is, -0 is considered to be equal to both 0 and +0), but false is not considered to be the same as 0. note: technically speaking, includes() uses the samevaluezero algorithm to determine whether the given element is found. examples [1, 2, 3].includes(2) // true [1, 2, 3].includes(4) // false [1, 2, 3].includ...
Array.prototype.indexOf() - JavaScript
ls operator). note: for the string method, see string.prototype.indexof(). polyfill indexof() was added to the ecma-262 standard in the 5th edition; as such it may not be present in all browsers. you can 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 definitely 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(obje...
Array.prototype.join() - JavaScript
if the array has only one item, then that item will be returned without using the separator. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax arr.join([separator]) parameters separator optional specifies a string to separate each pair of adjacent elements of the array. ...
Array.prototype.lastIndexOf() - JavaScript
d by the ===, or triple-equals, operator). polyfill lastindexof was added to the ecma-262 standard in the 5th edition; as such it may not be present in other implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of lastindexof in implementations which do not natively support it. this algorithm is exactly the one
specified in ecma-262, 5th edition, assuming object, typeerror, number, math.floor, math.abs, and math.min have their original values. // production steps of ecma-262, edition 5, 15.4.4.15 // reference: http://es5.github.io/#x15.4.4.15 if (!array.prototype.lastindexof) { array.prototype.lastindexof = function(searchelement /*, fromindex*/) { 'use strict'; if (this === void 0 || this === null) {...
Array.prototype.map() - JavaScript
ing array will also be sparse keeping same indices blank. polyfill map was added to the ecma-262 standard in the 5th edition. therefore, it may not be present in all implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of map in implementations which do not natively support it. this algorithm is exactly the one
specified in ecma-262, 5th edition, assuming object, typeerror, and array have their original values and that callback.call evaluates to the original value of function.prototype.call. // production steps of ecma-262, edition 5, 15.4.4.19 // reference: http://es5.github.io/#x15.4.4.19 if (!array.prototype.map) { array.prototype.map = function(callback/*, thisarg*/) { var t, a, k; if (this == n...
Array.prototype.some() - JavaScript
method on an empty array returns false for any condition! polyfill some() was added to the ecma-262 standard in the 5th edition, and it may not be present in all implementations of the standard. you can work around this by inserting the following code at the beginning of your scripts, allowing use of some() in implementations which do not natively support it. this algorithm is exactly the one
specified in ecma-262, 5th edition, assuming object and typeerror have their original values and that fun.call evaluates to the original value of function.prototype.call(). // production steps of ecma-262, edition 5, 15.4.4.17 // reference: http://es5.github.io/#x15.4.4.17 if (!array.prototype.some) { array.prototype.some = function(fun, thisarg) { 'use strict'; if (this == null) { throw ...
Array.prototype.splice() - JavaScript
element (see below). item1, item2, ... optional the elements to add to the array, beginning from start. if you do not specify any elements, splice() will only remove elements from the array. return value an array containing the deleted elements. if only one element is removed, an array of one element is returned. if no elements are removed, an empty array is returned. description if the
specified number of elements to insert differs from the number of elements being removed, the array's length will be changed. examples remove 0 (zero) elements before index 2, and insert "drum" let myfish = ['angel', 'clown', 'mandarin', 'sturgeon'] let removed = myfish.splice(2, 0, 'drum') // myfish is ["angel", "clown", "drum", "mandarin", "sturgeon"] // removed is [], no elements removed remove 0 (...
Array.prototype.toString() - JavaScript
syntax arr.tostring() return value a string representing the elements of the array. description the array object overrides the tostring method of object. for array objects, the tostring method joins the array and returns one string containing each array element separated by commas. javascript calls the tostring method automatically when an array is to be represented as a text value or when an array is referred to in a string concatenation. ecmascript 5 semantics starting in javascript 1.8.5 (firefox 4), and consistent with ecmascript 5th edition semantics, the tostring() method is generic and can be used with any object. ...
Array - JavaScript
console.log(vegetables) // ["cabbage", "carrot"] (the original array is changed) console.log(removeditems) // ["turnip", "radish"] copy an array let shallowcopy = fruits.slice() // this is how to make a copy // ["strawberry", "mango"] accessing array elements javascript arrays are zero-indexed. the first element of an array is at index 0, an...
ArrayBuffer() constructor - JavaScript
ybuffer 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 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 = arraybuffe...
BigInt.prototype.valueOf() - JavaScript
the valueof() method returns the wrapped primitive value of a bigint 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 bigintobj.valueof() return value a bigint representing the primitive value of the
specified bigint object. examples using valueof typeof object(1n); // object typeof object(1n).valueof(); // bigint specifications specification ecmascript (ecma-262)the definition of 'bigint.prototype.valueof()' in that specification. ...
BigInt - JavaScript
lue to a signed integer between -2width-1 and 2width-1 - 1. bigint.asuintn() wraps a bigint value to an unsigned integer between 0 and 2width - 1. instance methods bigint.prototype.tolocalestring() returns a string with a language-sensitive representation of this number. overrides the object.prototype.tolocalestring() method. bigint.prototype.tostring() returns a string representing the
specified object in the
specified radix (base). overrides the object.prototype.tostring() method. bigint.prototype.valueof() returns the primitive value of the
specified object. overrides the object.prototype.valueof() method. usage recommendations coercion because coercing between number and bigint can lead to loss of precision, it is recommended to only use bigint when values greater than 253 are r...
BigInt64Array() constructor - JavaScript
before being copied into the new array. the length of the new typed array will be same as the length of the typedarray argument. object when called with an object argument, a new typed array is created as if by the typedarray.from() method. buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the
specified arraybuffer. the byteoffset and length 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. examples different ways to create a bigint64array // from a length var bigint64 = new bigint64array(2); bigint64[0] = 42n; console.log(bigint64[0]); // 42n console.lo...
BigUint64Array() constructor - JavaScript
before being copied into the new array. the length of the new typed array will be same as the length of the typedarray argument. object when called with an object argument, a new typed array is created as if by the typedarray.from() method. buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the
specified arraybuffer. the byteoffset and length 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. examples different ways to create a biguint64array // from a length var biguint64 = new biguint64array(2); biguint64[0] = 42n; console.log(biguint64[0]); // 42n conso...
DataView() constructor - JavaScript
ples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax new dataview(buffer [, byteoffset [, bytelength]]) parameters buffer an existing arraybuffer or sharedarraybuffer to use as the storage backing the new dataview object. byteoffset optional the offset, in bytes, to the first byte in the above buffer for the new view to reference. if un
specified, the buffer view starts with the first byte. bytelength optional the number of elements in the byte array. if un
specified, the view's length will match the buffer's length. return value a new dataview object representing the
specified data buffer. (that probably wasn't a very helpful description.) you can think of the returned object as an "interpreter" of the array buffer of bytes — it k...
DataView.prototype.byteLength - JavaScript
. if the dataview is not specifying an offset or a bytelength, the bytelength of the referenced arraybuffer or sharedarraybuffer will be returned. examples using the bytelength property var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.bytelength; // 8 (matches the bytelength of the buffer) var dataview2 = new dataview(buffer, 1, 5); dataview2.bytelength; // 5 (as
specified when constructing the dataview) var dataview3 = new dataview(buffer, 2); dataview3.bytelength; // 6 (due to the offset of the constructed dataview) specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.bytelength' in that specification. ...
DataView.prototype.byteOffset - JavaScript
d us a pull request. description the byteoffset property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. the value is established when an dataview is constructed and cannot be changed. examples using the byteoffset property var buffer = new arraybuffer(8); var dataview = new dataview(buffer); dataview.byteoffset; // 0 (no offset
specified) var dataview2 = new dataview(buffer, 3); dataview2.byteoffset; // 3 (as
specified when constructing the dataview) specifications specification ecmascript (ecma-262)the definition of 'dataview.prototype.byteoffset' in that specification. ...
DataView.prototype.getBigInt64() - 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 dataview.getbigint64(byteoffset [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view to read the data from. littleendian optional indicates whether the 64-bit int is stored in little- or big-endian format. if false or undefined, a big-endian value is read. return value a bigint. ...
DataView.prototype.getBigUint64() - 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 dataview.getbiguint64(byteoffset [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view to read the data from. littleendian optional indicates whether the 64-bit int is stored in little- or big-endian format. if false or undefined, a big-endian value is read. return value a bigint. ...
DataView.prototype.getFloat32() - 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 dataview.getfloat32(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data. littleendian optional indicates whether the 32-bit float is stored in little- or big-endian format. if false or undefined, a big-endian value is read. return value a signed 32-bit float number. ...
DataView.prototype.getFloat64() - 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 dataview.getfloat64(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data. littleendian optional indicates whether the 64-bit float is stored in little- or big-endian format. if false or undefined, a big-endian value is read. return value a signed 64-bit float number. ...
DataView.prototype.getInt16() - 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 dataview.getint16(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data. littleendian optional indicates whether the 16-bit int is stored in little- or big-endian format. if false or undefined, a big-endian value is read. return value a signed 16-bit integer number. ...
DataView.prototype.getInt32() - 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 dataview.getint32(byteoffset [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view where to read the data. littleendian optional indicates whether the 32-bit int is stored in little- or big-endian format. if false or undefined, a big-endian value is read. return value a signed 32-bit integer number. ...
DataView.prototype.getInt8() - 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 dataview.getint8(byteoffset) parameters byteoffset the offset, in byte, from the start of the view where to read the data. return value a signed 8-bit integer number. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view. description there is no alignment constraint; multi-byte values may be fetched from any offset. ...
DataView.prototype.getUint16() - 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 dataview.getuint16(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data. littleendian optional indicates whether the 16-bit int is stored in little- or big-endian format. if false or undefined, a big-endian value is read. return value an unsigned 16-bit integer number. ...
DataView.prototype.getUint32() - 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 dataview.getuint32(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data. littleendian optional indicates whether the 32-bit int is stored in little- or big-endian format. if false or undefined, a big-endian value is read. return value an unsigned 32-bit integer number. ...
DataView.prototype.getUint8() - 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 dataview.getuint8(byteoffset) parameters byteoffset the offset, in byte, from the start of the view where to read the data. return value an unsigned 8-bit integer number. errors thrown rangeerror thrown if the byteoffset is set such as it would read beyond the end of the view. ...
DataView.prototype.setBigInt64() - 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 dataview.setbigint64(byteoffset, value [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view to store the data from. value the value to set as a bigint. the highest possible value that fits in a signed 64-bit integer is 2n ** (64n -1n) - 1n (9223372036854775807n). ...
DataView.prototype.setBigUint64() - 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 dataview.setbiguint64(byteoffset, value [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view to store the data from. value the value to set as a bigint. the highest possible value that fits in an unsigned 64-bit integer is 2n ** 64n - 1n (18446744073709551615n). ...
DataView.prototype.setFloat32() - 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 dataview.setfloat32(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data. value the value to set. littleendian optional indicates whether the 32-bit float is stored in little- or big-endian format. if false or undefined, a big-endian value is written. return value undefined. ...
DataView.prototype.setFloat64() - 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 dataview.setfloat64(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data. value the value to set. littleendian optional indicates whether the 64-bit float is stored in little- or big-endian format. if false or undefined, a big-endian value is written. return value undefined. ...
DataView.prototype.setInt16() - 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 dataview.setint16(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data. value the value to set. littleendian optional indicates whether the 16-bit int is stored in little- or big-endian format. if false or undefined, a big-endian value is written. return value undefined. ...
DataView.prototype.setInt32() - 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 dataview.setint32(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data. value the value to set. littleendian optional indicates whether the 32-bit int is stored in little- or big-endian format. if false or undefined, a big-endian value is written. return value undefined. ...
DataView.prototype.setInt8() - 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 dataview.setint8(byteoffset, value) parameters byteoffset the offset, in byte, from the start of the view where to store the data. value the value to set. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view. ...
DataView.prototype.setUint16() - 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 dataview.setuint16(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data. value the value to set. littleendian optional indicates whether the 16-bit int is stored in little- or big-endian format. if false or undefined, a big-endian value is written. ...
DataView.prototype.setUint32() - 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 dataview.setuint32(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data. value the value to set. littleendian optional indicates whether the 32-bit int is stored in little- or big-endian format. if false or undefined, a big-endian value is written. ...
DataView.prototype.setUint8() - 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 dataview.setuint8(byteoffset, value) parameters byteoffset the offset, in byte, from the start of the view where to store the data. value the value to set. return value undefined. errors thrown rangeerror thrown if the byteoffset is set such as it would store beyond the end of the view. ...
Date() constructor - JavaScript
time value or timestamp number value an integer value representing the number of milliseconds since january 1, 1970, 00:00:00 utc (the ecmascript epoch, equivalent to the unix epoch), with leap seconds ignored. keep in mind that most unix timestamp functions are only accurate to the nearest second. timestamp string datestring a string value representing a date,
specified in a format recognized by the date.parse() method. (these formats are ietf-compliant rfc 2822 timestamps, and also strings in a version of iso8601.) note: parsing of date strings with the date constructor (and date.parse(), which works the same way) is strongly discouraged due to browser differences and inconsistencies. support for rfc 2822 format strings is by convention only. ...
Date.UTC() - JavaScript
0. millisecond optional an integer between 0 and 999 representing the milliseconds. if omitted, defaults to 0. return value a number representing the number of milliseconds for the given date since january 1, 1970, 00:00:00, utc. description utc() takes comma-delimited date and time parameters and returns the number of milliseconds between january 1, 1970, 00:00:00, universal time and the
specified date and time. years between 0 and 99 are converted to a year in the 20th century (1900 + year). for example, 95 is converted to the year 1995. the utc() method differs from the date constructor in two ways: date.utc() uses universal time instead of the local time. date.utc() returns a time value as a number instead of creating a date object. if a parameter is outside of the expected rang...
Date.prototype.getDate() - 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 dateobj.getdate() return value an integer number, between 1 and 31, representing the day of the month for the given date according to local time. examples using getdate() the second statement below assigns the value 25 to the variable day, based on the value of the date object xmas95. ...
Date.prototype.getDay() - JavaScript
for the day of the month, see date.prototype.getdate(). 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 dateobj.getday() return value an integer number, between 0 and 6, corresponding to the day of the week for the given date, according to local time: 0 for sunday, 1 for monday, 2 for tuesday, and so on. examples using getday() the second statement below assigns the value 1 to weekday, based on the value of the date object xmas95. ...
Date.prototype.getFullYear() - JavaScript
use this method instead of the getyear() method. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax dateobj.getfullyear() return value a number corresponding to the year of the given date, according to local time. description the value returned by getfullyear() is an absolute number. for dates between the years 1000 and 9999, getfullyear() returns a four-digit number, for example, 1995. use this function to make sure a year is compliant with years after 2000. ...
Date.prototype.getHours() - 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 dateobj.gethours() return value an integer number, between 0 and 23, representing the hour for the given date according to local time. examples using gethours() the second statement below assigns the value 23 to the variable hours, based on the value of the date object xmas95. ...
Date.prototype.getMilliseconds() - 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 dateobj.getmilliseconds() return value a number, between 0 and 999, representing the milliseconds for the given date according to local time. ...
Date.prototype.getMinutes() - JavaScript
syntax dateobj.getminutes() return value an integer number, between 0 and 59, representing the minutes in the given date according to local time. examples using getminutes() the second statement below assigns the value 15 to the variable minutes, based on the value of the date object xmas95. ...
Date.prototype.getMonth() - 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 dateobj.getmonth() return value an integer number, between 0 and 11, representing the month in the given date according to local time. 0 corresponds to january, 1 to february, and so on. examples using getmonth() the second statement below assigns the value 11 to the variable month, based on the value of the date object xmas95. ...
Date.prototype.getSeconds() - 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 dateobj.getseconds() return value an integer number, between 0 and 59, representing the seconds in the given date according to local time. examples using getseconds() the second statement below assigns the value 30 to the variable seconds, based on the value of the date object xmas95. ...
Date.prototype.getUTCDate() - JavaScript
syntax dateobj.getutcdate() return value an integer number, between 1 and 31, representing the day of the month in the given date according to universal time. examples using getutcdate() the following example assigns the day portion of the current date to the variable day. ...
Date.prototype.getUTCDay() - 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 dateobj.getutcday() return value an integer number corresponding to the day of the week for the given date, according to universal time: 0 for sunday, 1 for monday, 2 for tuesday, and so on. examples using getutcday() the following example assigns the weekday portion of the current date to the variable weekday. ...
Date.prototype.getUTCFullYear() - 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 dateobj.getutcfullyear() return value a number representing the year in the given date according to universal time. description the value returned by getutcfullyear() is an absolute number that is compliant with year-2000, for example, 1995. examples using getutcfullyear() the following example assigns the four-digit value of the current year to the variable year. ...
Date.prototype.setUTCSeconds() - 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 dateobj.setutcseconds(secondsvalue[, msvalue]) parameters secondsvalue an integer between 0 and 59, representing the seconds. msvalue optional. a number between 0 and 999, representing the milliseconds. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. ...
Date.prototype.setYear() - JavaScript
because setyear() does not set full years ("year 2000 problem"), it is no longer used and has been replaced by the setfullyear() method. syntax dateobj.setyear(yearvalue) parameters yearvalue an integer. return value the number of milliseconds between 1 january 1970 00:00:00 utc and the updated date. description if yearvalue is a number between 0 and 99 (inclusive), then the year for dateobj is set to 1900 + yearvalue. otherwise, the year for dateobj is set to yearvalue. examples using setyear() the first two lines set the year to 1996. the third sets the year to 2000. ...
Error - JavaScript
r. error.prototype.linenumber a non-standard mozilla property for the line number in the file that raised this error. error.prototype.columnnumber a non-standard mozilla property for the column number in the line that raised this error. error.prototype.stack a non-standard mozilla property for a stack trace. instance methods error.prototype.tostring() returns a string representing the
specified object. overrides the object.prototype.tostring() method. examples throwing a generic error usually you create an error object with the intention of raising it using the throw keyword. you can handle the error using the try...catch construct: try { throw new error('whoops!') } catch (e) { console.error(e.name + ': ' + e.message) } handling a specific error you can choose to handle onl...
Float32Array() constructor - JavaScript
before being copied into the new array. the length of the new typed array will be same as the length of the typedarray argument. object when called with an object argument, a new typed array is created as if by the typedarray.from() method. buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the
specified arraybuffer. the byteoffset and length 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. examples different ways to create a float32array // from a length var float32 = new float32array(2); float32[0] = 42; console.log(float32[0]); // 42 console.log(float...
Float64Array() constructor - JavaScript
before being copied into the new array. the length of the new typed array will be same as the length of the typedarray argument. object when called with an object argument, a new typed array is created as if by the typedarray.from() method. buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the
specified arraybuffer. the byteoffset and length 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. examples different ways to create a float64array // from a length var float64 = new float64array(2); float64[0] = 42; console.log(float64[0]); // 42 console.log(float...
Function.prototype.call() - JavaScript
e as this when calling func. caution: in certain cases, thisarg may not be the actual value seen by the method. if the method is a function in non-strict mode, null and undefined will be replaced with the global object, and primitive values will be converted to objects. arg1, arg2, ...argn optional arguments for the function. return value the result of calling the function with the
specified this value and arguments. description the call() allows for a function/method belonging to one object to be assigned and called for a different object. call() provides a new value of this to the function/method. with call(), you can write a method once and then inherit it in another object, without having to rewrite the method for the new object. note: while the syntax of this function is al...
Function.caller - JavaScript
it returns null for strict, async function and generator function callers. description if the function f was invoked by the top level code, the value of f.caller is null, otherwise it's the function that called f. it's also null for strict, async function and generator function callers. this property replaces the obsolete arguments.caller property of the arguments object. the special property __caller__, which returned the activation object of the caller thus allowing to reconstruct the stack, was removed for security reasons. notes note that in case of recursion, you can't reconstruct the call stack using this property. ...
Function.name - 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. property attributes of function.name writable no enumerable no configurable yes note that in non-standard, pre-es2015 implementations the configurable attribute was false as well. ...
Int16Array() constructor - JavaScript
before being copied into the new array. the length of the new typed array will be same as the length of the typedarray argument. object when called with an object argument, a new typed array is created as if by the typedarray.from() method. buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the
specified arraybuffer. the byteoffset and length 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. examples different ways to create an int16array // from a length var int16 = new int16array(2); int16[0] = 42; console.log(int16[0]); // 42 console.log(int16.length)...
Int32Array() constructor - JavaScript
before being copied into the new array. the length of the new typed array will be same as the length of the typedarray argument. object when called with an object argument, a new typed array is created as if by the typedarray.from() method. buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the
specified arraybuffer. the byteoffset and length 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. examples different ways to create an int32array // from a length var int32 = new int32array(2); int32[0] = 42; console.log(int32[0]); // 42 console.log(int32.length)...
Int8Array() constructor - JavaScript
before being copied into the new array. the length of the new typed array will be same as the length of the typedarray argument. object when called with an object argument, a new typed array is created as if by the typedarray.from() method. buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the
specified arraybuffer. the byteoffset and length 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. examples different ways to create an int8array // from a length var int8 = new int8array(2); int8[0] = 42; console.log(int8[0]); // 42 console.log(int8.length); // 2...
Intl.Locale.prototype.language - JavaScript
ring must start with the language subtag. the main argument to the locale constructor must be a valid unicode locale identifier, so whenever the constructor is used, it must be passed an identifier with a language subtag. let langstr = new intl.locale("en-latn-us"); console.log(langstr.language); // prints "en" overriding language via the configuration object while the language subtag must be
specified, the locale constructor takes a configuration object, which can override the language subtag. let langobj = new intl.locale("en-latn-us", {language: "es"}); console.log(langobj.language); // prints "es" specifications specification ecmascript internationalization api (ecma-402) ...
Intl.NumberFormat.prototype.formatToParts() - JavaScript
tom strings while preserving the locale-specific parts. the structure the formattoparts() method returns, looks like this: [ { type: "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 (","). infinity the infinity 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 ...
JSON.parse() - JavaScript
the text is not json parseable, then a syntaxerror is thrown. throw new syntaxerror("json.parse"); }; } examples using json.parse() json.parse('{}'); // {} json.parse('true'); // true json.parse('"foo"'); // "foo" json.parse('[1, 5, "false"]'); // [1, 5, "false"] json.parse('null'); // null using the reviver parameter if a reviver is
specified, the value computed by parsing is transformed before being returned. specifically, the computed value and all its properties (beginning with the most nested properties and proceeding to the original value itself) are individually run through the reviver. then it is called, with the object containing the property being processed as this, and with the property name as a string, and the property val...
JSON.stringify() - 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 json.stringify(value[, replacer[, space]]) parameters value the value to convert to a json string. ...
JSON - JavaScript
form the produced value and its properties, and return the value. any violations of the json syntax, including those pertaining to the differences between javascript and json, cause a syntaxerror to be thrown. the reviver option allows for interpreting what the replacer has used to stand in for other datatypes. json.stringify(value[, replacer[, space]]) return a json string corresponding to the
specified value, optionally including only certain properties or replacing property values in a user-defined manner. by default, all instances of undefined are replaced with null, and other unsupported native data types are censored. the replacer option allows for specifying other behavior. examples example json { "browsers": { "firefox": { "name": "firefox", "pref_url": "about:config...
Map.prototype.delete() - 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.delete(key); parameters key the key of the element to remove from the map object. return value true if an element in the map object existed and has been removed, or false if the element does not exist. examples using delete() var mymap = new map(); mymap.set('bar', 'foo'); mymap.delete('bar'); // returns true. successfully removed. mymap.has('bar'); // returns false. the "bar" element is no longer present. ...
Map.prototype.get() - JavaScript
the get() method returns a
specified element from a map object. if the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the map 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 mymap.get(key) parameters key the key of the element to return from the map object. return value the element associated with the
specified key, or undefined if the key can't be found in the map object. examples using get() let mymap = new map(); mymap.set('bar', 'foo'); mymap.get('bar'); // retur...
Map.prototype.has() - JavaScript
the has() method returns a boolean indicating whether an element with the
specified key exists or not. 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.has(key) parameters key the key of the element to test for presence in the map object. return value true if an element with the
specified key exists in the map object; otherwise false. examples using has() let mymap = new map() mymap.set('bar', "foo") mymap.has('bar') // returns true mymap.has('baz') // returns false specifications specification ecmascript (ecma-262)the definition of 'map.prototype.has' in that specificati...
Map.prototype.set() - 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.set(key, value) parameters key the key of the element to add to the map object. value the value of the element to add to the map object. return value the map object. ...
Math.cos() - JavaScript
this value is length adjacent length hypotenuse . 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 math.cos(x) parameters x the angle in radians for which to return the cosine. return value the cosine of the given number. description the math.cos() method returns a numeric value between -1 and 1, which represents the cosine of the angle. ...
Math.floor() - JavaScript
less than or equal to a given 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 math.floor(x) parameters x a number. return value a number representing the largest integer less than or equal to the
specified number. description because floor() is a static method of math, you always use it as math.floor(), rather than as a method of a math object you created (math is not a constructor). note: math.floor(null) returns 0, not a nan. examples using math.floor() math.floor( 45.95); // 45 math.floor( 45.05); // 45 math.floor( 4 ); // 4 math.floor(-45.05); // -46 math.floor(-45.95); // -46 ...
Math.random() - JavaScript
ng the one for math.random() itself) aren't exact. if extremely large bounds are chosen (253 or higher), it's possible in extremely rare cases to calculate the usually-excluded upper bound. getting a random number between 0 (inclusive) and 1 (exclusive) function getrandom() { return math.random(); } getting a random number between two values this example returns a random number between the
specified values. the returned value is no lower than (and may possibly equal) min, and is less than (and not equal) max. function getrandomarbitrary(min, max) { return math.random() * (max - min) + min; } getting a random integer between two values this example returns a random integer between the
specified values. the value is no lower than min (or the next integer greater than min if min isn't an ...
Math.random() - JavaScript
ng the one for math.random() itself) aren't exact. if extremely large bounds are chosen (253 or higher), it's possible in extremely rare cases to calculate the usually-excluded upper bound. getting a random number between 0 (inclusive) and 1 (exclusive) function getrandom() { return math.random(); } getting a random number between two values this example returns a random number between the
specified values. the returned value is no lower than (and may possibly equal) min, and is less than (and not equal) max. function getrandomarbitrary(min, max) { return math.random() * (max - min) + min; } getting a random integer between two values this example returns a random integer between the
specified values. the value is no lower than min (or the next integer greater than min if min isn't an ...
Number.MAX_SAFE_INTEGER - JavaScript
property attributes of number.max_safe_integer writable no enumerable no configurable no description the max_safe_integer constant has a value of 9007199254740991 (9,007,199,254,740,991 or ~9 quadrillion). the reasoning behind that number is that javascript uses double-precision floating-point format numbers as
specified in ieee 754 and can only safely represent numbers between -(253 - 1) and 253 - 1. safe in this context refers to the ability to represent integers exactly and to correctly compare them. for example, number.max_safe_integer + 1 === number.max_safe_integer + 2 will evaluate to true, which is mathematically incorrect. see number.issafeinteger() for more information. this field does not exist in ol...
Number.MIN_SAFE_INTEGER - JavaScript
erty attributes of number.min_safe_integer writable no enumerable no configurable no description the min_safe_integer constant has a value of -9007199254740991 (-9,007,199,254,740,991 or about -9 quadrillion). the reasoning behind that number is that javascript uses double-precision floating-point format numbers as
specified in ieee 754 and can only safely represent numbers between -(253 - 1) and 253 - 1. see number.issafeinteger() for more information. because min_safe_integer is a static property of number, you always use it as number.min_safe_integer, rather than as a property of a number object you created. examples using min_safe_integer number.min_safe_integer // -9007199254740991 -(math.pow(2, 53) - 1) /...
Number.parseInt() - 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 number.parseint(string,[ radix]) parameters string the value to parse. if this argument is not a string, then it is converted to one using the tostring abstract operation. leading whitespace in this argument is ignored. radix optional an integer between 2 and 36 that represents the radix (the base in mathematical numeral systems) of the string. ...
Number.prototype.toFixed() - JavaScript
owed to support larger and smaller values as chosen. typeerror if this method is invoked on an object that is not a number. description tofixed() returns a string representation of numobj that does not use exponential notation and has exactly digits digits after the decimal place. the number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the
specified length. if the absolute value of numobj is greater or equal to 1e+21, this method simply calls number.prototype.tostring() and returns a string in exponential notation. warning: floating point numbers cannot represent all decimals precisely in binary. this can lead to unexpected results, such as 0.1 + 0.2 === 0.3 returning false . examples using tofixed let numobj = 12345.6789 numobj.tofix...
Number.prototype.toLocaleString() - JavaScript
ringsupportslocales() { var number = 0; try { number.tolocalestring('i'); } catch (e) { return e.name === 'rangeerror'; } return false; } prior to es5.1, implementations were not required to throw a range error exception if tolocalestring is called with arguments. a check that works in all hosts, including those supporting ecma-262 prior to ed 5.1, is to test for the features
specified in ecma-402 that are required to support regional options for number.prototype.tolocalestring directly: function tolocalestringsupportsoptions() { return !!(typeof intl == 'object' && intl && typeof intl.numberformat == 'function'); } this tests for a global intl object, checks that it's not null and that it has a numberformat property that is a function. using locales this example shows s...
Number.prototype.toPrecision() - JavaScript
syntax numobj.toprecision([precision]) parameters precision optional an integer specifying the number of significant digits. return value a string representing a number object in fixed-point or exponential notation rounded to precision significant digits. see the discussion of rounding in the description of the number.prototype.tofixed() method, which also applies to toprecision(). if the precision argument is omitted, behaves as number.prototype.tostring(). if the precision argument is a non-integer value, it is rounded to the nearest integer. ...
Number.prototype.valueOf() - JavaScript
the valueof() method returns the wrapped primitive value of a number 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 numobj.valueof() return value a number representing the primitive value of the
specified number object. description this method is usually called internally by javascript and not explicitly in web code. examples using valueof let numobj = new number(10) console.log(typeof numobj) // object let num = numobj.valueof() console.log(num) // 10 console.log(typeof num) // number specifications specification ecmascript (ecma-262)the definition of 'number...
Number - JavaScript
n exponential notation. number.prototype.tofixed(digits) returns a string representing the number in fixed-point notation. number.prototype.tolocalestring([locales [, options]]) returns a string with a language sensitive representation of this number. overrides the object.prototype.tolocalestring() method. number.prototype.toprecision(precision) returns a string representing the number to a
specified precision in fixed-point or exponential notation. number.prototype.tostring([radix]) returns a string representing the
specified object in the
specified radix ("base"). overrides the object.prototype.tostring() method. number.prototype.valueof() returns the primitive value of the
specified object. overrides the object.prototype.valueof() method. examples using the number object to assign v...
Object.prototype.__defineGetter__() - JavaScript
ation 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. description the __definegetter__ allows a getter to be defined on a pre-existing object. examples non-standard and deprecated way var o = {}; o.__definegetter__('gimmefive', function() { return 5; }); console.log(o.gimmefive); // 5 standard-compliant ways // using the get operator var o = { get gimmefive() { return 5; } }; console.log(o.gimmefive); // ...
Object.prototype.__defineSetter__() - JavaScript
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) { . . . } val an alias for the variable that holds the value attempted to be assigned to prop. return value undefined. description the __definesetter__ method allows a setter to be defined on a pre-existing object. examples non-standard and deprecated way var o = {}; o.__definesetter__('value', function(val) { this.anotherva...
Object.prototype.__lookupGetter__() - JavaScript
description if a getter has been defined for an object's property, it's not possible to reference the getter function through that property, because that property refers to the return value of that function. __lookupgetter__ can be used to obtain a reference to the getter function. it is now possible to do this in a standardized way using object.getownpropertydescriptor() and object.getprototypeof(). ...
Object.prototype.__lookupSetter__() - JavaScript
description if a setter has been defined for an object's property, it was not possible to reference the setter function through that property, because that property refers to the return value of that function. __lookupsetter__ can be used to obtain a reference to the setter function. it is now possible to do this in a standardized way using object.getownpropertydescriptor(). ...
Object.create() - 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 object.create(proto, [propertiesobject]) parameters proto the object which should be the prototype of the newly-created object. propertiesobject optional if
specified and not undefined, an object whose enumerable own properties (that is, those properties defined upon itself and not enumerable properties along its prototype chain) specify property descriptors to be added to the newly-created object, with the corresponding property names. these properties correspond to the second argument of object.defineproperties(). return value a new object with the specif...
Object.defineProperty() - JavaScript
obj, 'key', withvalue('static')); // if freeze is available, prevents adding or // removing the object prototype properties // (value, get, set, enumerable, writable, configurable) (object.freeze || object)(object.prototype); examples if you want to see how to use the object.defineproperty method with a binary-flags-like syntax, see additional examples. creating a property when the property
specified doesn't exist in the object, object.defineproperty() creates a new property as described. fields may be omitted from the descriptor, and default values for those fields are inputted. var o = {}; // creates a new object // example of an object property added // with defineproperty with a data property descriptor object.defineproperty(o, 'a', { value: 37, writable: true, enumerable: true, ...
Object.getPrototypeOf() - 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 object.getprototypeof(obj) parameters obj the object whose prototype is to be returned. return value the prototype of the given object. if there are no inherited properties, null is returned. ...
Object.prototype.isPrototypeOf() - JavaScript
ffers from the instanceof operator. in the expression "object instanceof afunction", the object prototype chain is checked against afunction.prototype, not against afunction itself. syntax prototypeobj.isprototypeof(object) parameters object the object whose prototype chain will be searched. return value a boolean indicating whether the calling object lies in the prototype chain of the
specified object. errors thrown typeerror a typeerror is thrown if prototypeobj is undefined or null. description the isprototypeof() method allows you to check whether or not an object exists within another object's prototype chain. examples using isprototypeof this example demonstrates that baz.prototype, bar.prototype, foo.prototype and object.prototype exist in the prototype chain for object...
Promise.allSettled() - JavaScript
omise returned by promise.all() may be more appropriate if the tasks are dependent on each other / if you'd like to immediately reject upon any of them rejecting. syntax promise.allsettled(iterable); parameters iterable an iterable object, such as an array, in which each member is a promise. return value a pending promise that will be asynchronously fulfilled once every promise in the
specified collection of promises has completed, either by successfully being fulfilled or by being rejected. at that time, the returned promise's handler is passed as input an array containing the outcome of each promise in the original set of promises. however, if and only if an empty iterable is passed as an argument, promise.allsettled() returns a promise object that has already been resolved as an emp...
Reflect.apply() - JavaScript
the static reflect.apply() method calls a target function with arguments as
specified. 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 reflect.apply(target, thisargument, argumentslist) parameters target the target function to call. thisargument the value of this provided for the call to target. argumentslist an array-like object specifying the arguments with which target should be called. return value the result of calling the given target function with the
specified this value and arguments. exceptions a typeerror, if the target is not callable. description in es5, you typically use the functio...
Reflect - JavaScript
atic (just like the math object). the reflect object provides the following static functions which have the same names as the proxy handler methods. some of these methods are also the same as corresponding methods on object, although they do have some subtle differences between them. static methods reflect.apply(target, thisargument, argumentslist) calls a target function with arguments as
specified by the argumentslist parameter. see also function.prototype.apply(). reflect.construct(target, argumentslist[, newtarget]) the new operator as a function. equivalent to calling new target(...argumentslist). also provides the option to specify a different prototype. reflect.defineproperty(target, propertykey, attributes) similar to object.defineproperty(). returns a boolean that is true if the...
RegExp() constructor - JavaScript
ctor, and factory notations are possible: /pattern/flags new regexp(pattern[, flags]) regexp(pattern[, flags]) parameters pattern the text of the regular expression. as of es5, this can also be another regexp object or literal (for the two regexp constructor notations only). patterns may include special characters to match a wider range of values than would a literal string. flags if
specified, flags is a string that contains the flags to add. alternatively, if an object is supplied for the pattern, the flags string will replace any of that object's flags (and lastindex will be reset to 0) (as of es2015). if flags is not
specified and a regular expressions object is supplied, that object's flags (and lastindex value) will be copied over. flags may contain any combination of the f...
RegExp.prototype.compile() - JavaScript
the deprecated compile() method is used to (re-)compile a regular expression during execution of a script. it is basically the same as the regexp constructor. syntax regexobj.compile(pattern, flags) parameters pattern the text of the regular expression. flags if
specified, flags can have any combination of the following values: g global match i ignore case m multiline; treat beginning and end characters (^ and $) as working over multiple lines (i.e., match the beginning or end of each line (delimited by \n or \r), not only the very beginning or end of the whole input string) y sticky; matches only from the index indicated by the lastindex property of this regular expression in the target string (and does not attempt to match from any later indexes). descriptio...
RegExp.prototype.test() - JavaScript
returns true or false. 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 regexobj.test(str) parameters str the string against which to match the regular expression. returns true if there is a match between the regular expression and the string str. otherwise, false. description use test() whenever you want to know whether a pattern is found in a string. ...
RegExp - JavaScript
regexp.prototype.unicode whether or not unicode features are enabled. instance methods regexp.prototype.compile() (re-)compiles a regular expression during execution of a script. regexp.prototype.exec() executes a search for a match in its string parameter. regexp.prototype.test() tests for a match in its string parameter. regexp.prototype.tostring() returns a string representing the
specified object. overrides the object.prototype.tostring() method. regexp.prototype[@@match]() performs match to given string and returns match result. regexp.prototype[@@matchall]() returns all matches of the regular expression against a string. regexp.prototype[@@replace]() replaces matches in given string with new substring. regexp.prototype[@@search]() searches the match in given string and re...
Set.prototype.add() - 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.add(value); parameters value the value of the element to add to the set object. return value the set object. ...
Set.prototype.delete() - 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.delete(value); parameters value the value to remove from myset. return value returns true if value was successfully removed from myset; otherwise false. examples using the delete() method const myset = new set(); myset.add('foo'); myset.delete('bar'); // returns false. no "bar" element found to be deleted. myset.delete('foo'); // returns true. successfully removed. myset.has('foo'); // returns false. the "foo" element is no longer present. ...
SharedArrayBuffer() constructor - JavaScript
t. 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 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...
String.prototype.charAt() - JavaScript
the string object's charat() method returns a new string consisting of the single utf-16 code unit located at the
specified offset into the string. 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 character = str.charat(index) parameters index an integer between 0 and str.length - 1. if the index cannot be converted to the integer or no index is provided, the default is 0, so the first character of str is returned. return value a string representing the character (exactly one utf-16 code unit) at the
specified index. if index is out of range, charat() returns an empty string. description characters i...
String.prototype.charCodeAt() - JavaScript
match of the ascii character set. examples using charcodeat() the following example returns 65, the unicode value for a. 'abc'.charcodeat(0) // returns 65 fixing charcodeat() to handle non-basic-multilingual-plane characters if their presence earlier in the string is unknown this version might be used in for loops and the like when it is unknown whether non-bmp characters exist before the
specified index position. function fixedcharcodeat(str, idx) { // ex. fixedcharcodeat('\ud800\udc00', 0); // 65536 // ex. fixedcharcodeat('\ud800\udc00', 1); // false idx = idx || 0; var code = str.charcodeat(idx); var hi, low; // high surrogate (could change last hex to 0xdb7f // to treat high private surrogates // as single characters) if (0xd800 <= code && code <= 0xdbff) { hi = ...
String.prototype.codePointAt() - JavaScript
project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.codepointat(pos) parameters pos position of an element in str to return the code point value from. return value a number representing the code point value of the character at the given pos. if there is no element at pos, returns undefined. description if there is no element at the
specified position, undefined is returned. if no utf-16 surrogate pair begins at pos, the code unit at pos is returned. polyfill the following extends strings to include the codepointat() function as
specified in ecmascript 2015 for browsers without native support. /*! https://mths.be/codepointat v0.2.0 by @mathias */ if (!string.prototype.codepointat) { (function() { 'use strict'; // needed to s...
String.prototype.endsWith() - 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 str.endswith(searchstring[, length]) parameters searchstring the characters to be searched for at the end of str. length optional if provided, it is used as the length of str. defaults to str.length. return value true if the given characters are found at the end of the string; otherwise, false. ...
String.prototype.fontcolor() - JavaScript
usage note: the <font> element has been removed in html5 and shouldn't be used anymore. instead web developers should use css properties. syntax str.fontcolor(color) parameters color a string expressing the color as a hexadecimal rgb triplet or as a string literal. string literals for color names are listed in the css color reference. return value a string containing a <font> html element. description if you express color as a hexadecimal rgb triplet, you must use the format rrggbb. ...
String.prototype.fontsize() - JavaScript
usage note: the <font> element has been removed in html5 and shouldn't be used anymore. instead web developers should use css properties. syntax str.fontsize(size) parameters size an integer between 1 and 7, a string representing a signed integer between 1 and 7. return value a string containing a <font> html element. description when you specify size as an integer, you set the font size of str to one of the 7 defined sizes. when you specify size as a string such as "-2", you adjust the font size of str relative to the size set in the <basefont> tag. ...
String.fromCharCode() - JavaScript
the static string.fromcharcode() method returns a string created from the
specified sequence of utf-16 code units. 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 string.fromcharcode(num1[, ...[, numn]]) parameters num1, ..., numn a sequence of numbers that are utf-16 code units. the range is between 0 and 65535 (0xffff). numbers greater than 0xffff are truncated. no validity checks are performed. return value a string of length n consisting of the n
specified utf-16 code units. description this method returns a string and not a string object. because fromcharcode() is a static method of string, you al...
String.prototype.lastIndexOf() - JavaScript
returns -1 if the value is not found. 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.lastindexof(searchvalue[, fromindex]) parameters searchvalue a string representing the value to search for. if searchvalue is an empty string, then fromindex is returned. ...
String length - JavaScript
6, the string format used by javascript, uses a single 16-bit code unit to represent the most common characters, but needs to use two code units for less commonly-used characters, so it's possible for the value returned by length to not match the actual number of characters in the string. ecmascript 2016 (ed. 7) established a maximum length of 2^53 - 1 elements. previously, no maximum length was
specified. in firefox, strings have a maximum length of 2**30 - 2 (~1gb). in versions prior to firefox 65, the maximum length was 2**28 - 1 (~256mb). for an empty string, length is 0. the static property string.length is unrelated to the length of strings, it's the arity of the string function (loosely, the number of formal parameters it has), which is 1. unicode since `length` counts code units instea...
String.prototype.normalize() - JavaScript
"nfc" canonical decomposition, followed by canonical composition. "nfd" canonical decomposition. "nfkc" compatibility decomposition, followed by canonical composition. "nfkd" compatibility decomposition. return value a string containing the unicode normalization form of the given string. errors thrown rangeerror a rangeerror is thrown if form isn't one of the values
specified above. description unicode assigns a unique numerical value, called a code point, to each character. for example, the code point for "a" is given as u+0041. however, sometimes more than one code point, or sequence of code points, can represent the same abstract character — the character "ñ" for example can be represented by either of: the single code point u+00f1. the code point for "n"...
String.prototype.padEnd() - JavaScript
lower than str.length, the current string will be returned as-is. padstring optional the string to pad the current str with. if padstring is too long to stay within targetlength, it will be truncated: for left-to-right languages the left-most part and for right-to-left languages the right-most will be applied. the default value for this parameter is " " (u+0020). return value a string of the
specified targetlength with the padstring applied at the end of the current str. examples using padend 'abc'.padend(10); // "abc " 'abc'.padend(10, "foo"); // "abcfoofoof" 'abc'.padend(6, "123456"); // "abc123" 'abc'.padend(1); // "abc" specifications specification ecmascript (ecma-262)the definition of 'string.prototype.padend' in that specification. ...
String.prototype.padStart() - JavaScript
]) parameters targetlength the length of the resulting string once the current str has been padded. if the value is less than str.length, then str is returned as-is. padstring optional the string to pad the current str with. if padstring is too long to stay within the targetlength, it will be truncated from the end. the default value is " " (u+0020 'space'). return value a string of the
specified targetlength with padstring applied from the start. examples basic examples 'abc'.padstart(10); // " abc" 'abc'.padstart(10, "foo"); // "foofoofabc" 'abc'.padstart(6,"123465"); // "123abc" 'abc'.padstart(8, "0"); // "00000abc" 'abc'.padstart(1); // "abc" fixed width string number conversion // javascript version of: (unsigned) // printf "%0*d" width num function ...
String.prototype.replace() - JavaScript
ample 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 const newstr = str.replace(regexp|substr, newsubstr|function) parameters regexp (pattern) a regexp object or literal. the match or matches are replaced with newsubstr or the value returned by the
specified function. substr a string that is to be replaced by newsubstr. it is treated as a literal string and is not interpreted as a regular expression. only the first occurrence will be replaced. newsubstr (replacement) the string that replaces the substring
specified by the
specified regexp or substr parameter. a number of special replacement patterns are supported; see the "specifying a string as ...
String.prototype.replaceAll() - JavaScript
a pull request. syntax const newstr = str.replaceall(regexp|substr, newsubstr|function) when using a `regexp` you must have to set the global ("g") flag; otherwise, it will throw a typeerror: "replaceall must be called with a global regexp". parameters regexp (pattern) a regexp object or literal with the global flag. the matches are replaced with newsubstr or the value returned by the
specified function. a regexp without the global ("g") flag will throw a typeerror: "replaceall must be called with a global regexp". substr a string that is to be replaced by newsubstr. it is treated as a literal string and is not interpreted as a regular expression. newsubstr (replacement) the string that replaces the substring
specified by the
specified regexp or substr parameter. a number of special...
String.prototype.split() - JavaScript
a separator, the string is not split by user-perceived characters (grapheme clusters) or unicode characters (codepoints), but by utf-16 codeunits. this destroys surrogate pairs. see “how do you get a string to a character array in javascript?” on stackoverflow. limit optional a non-negative integer limiting the number of pieces. if provided, splits the string at each occurrence of the
specified separator, but stops when limit entries have been placed in the array. any leftover text is not included in the array at all. the array may contain fewer entries than limit if the end of the string is reached before the limit is reached. if limit is 1, str.split(separator)[0] is returned if limit is 0, [] is returned. return value an array of strings, split at each point where the...
String.prototype.startsWith() - 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 str.startswith(searchstring[, position]) parameters searchstring the characters to be searched for at the start of this string. position optional the position in this string at which to begin searching for searchstring. defaults to 0. return value true if the given characters are found at the beginning of the string; otherwise, false. ...
String.prototype.substring() - JavaScript
he interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax str.substring(indexstart[, indexend]) parameters indexstart the index of the first character to include in the returned substring. indexend optional the index of the first character to exclude from the returned substring. return value a new string containing the
specified part of the given string. description substring() extracts characters from indexstart up to but not including indexend. in particular: if indexend is omitted, substring() extracts characters to the end of the string. if indexstart is equal to indexend, substring() returns an empty string. if indexstart is greater than indexend, then the effect of substring() is as if the two arguments were...
String.prototype.toString() - JavaScript
syntax str.tostring() return value a string representing the calling object. description the string object overrides the tostring() method of the object object; it does not inherit object.prototype.tostring(). for string objects, the tostring() method returns a string representation of the object and is the same as the string.prototype.valueof() method. ...
Symbol.prototype[@@toPrimitive] - JavaScript
description the [@@toprimitive]() method of symbol returns the primitive value of a symbol object as a symbol data type. the hint argument is not used. javascript calls the [@@toprimitive]() method to convert an object to a primitive value. you rarely need to invoke the [@@toprimitive]() method yourself; javascript automatically invokes it when encountering an object where a primitive value is expected. ...
Symbol.prototype.valueOf() - JavaScript
description the valueof method of symbol returns the primitive value of a symbol object as a symbol data type. javascript calls the valueof method to convert an object to a primitive value. you rarely need to invoke the valueof method yourself; javascript automatically invokes it when encountering an object where a primitive value is expected. ...
TypedArray.prototype.byteLength - JavaScript
darray is not specifying an byteoffset or a length, the length of the referenced arraybuffer will be returned. typedarray is one of the typedarray objects. examples using the bytelength property var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer); uint8.bytelength; // 8 (matches the bytelength of the buffer) var uint8 = new uint8array(buffer, 1, 5); uint8.bytelength; // 5 (as
specified when constructing the uint8array) var uint8 = new uint8array(buffer, 2); uint8.bytelength; // 6 (due to the offset of the constructed uint8array) specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.bytelength' in that specification. ...
TypedArray.prototype.byteOffset - JavaScript
offset property is an accessor property whose set accessor function is undefined, meaning that you can only read this property. the value is established when a typedarray is constructed and cannot be changed. typedarray is one of the typedarray objects. examples using the byteoffset property var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer); uint8.byteoffset; // 0 (no offset
specified) var uint8 = new uint8array(buffer, 3); uint8.byteoffset; // 3 (as
specified when constructing uint8array) specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.byteoffset' in that specification. ...
TypedArray.from() - JavaScript
n') { throw new typeerror('# is not a constructor'); } if (this.__proto__ !== typedarrayclass) { throw new typeerror('this is not a typed array.'); } func = func || function (elem) { return elem; }; if (typeof func !== 'function') { throw new typeerror('
specified argument is not a function'); } obj = object(obj); if (!obj['length']) { return new this(0); } var copy_data = []; for(var i = 0; i < obj.length; i++) { copy_data.push(obj[i]); } copy_data = copy_data.map(func, thisobj); var typed_array = new this(copy_dat...
TypedArray.prototype.length - JavaScript
ged. if the typedarray is not specifying an byteoffset or a length, the length of the referenced arraybuffer will be returned. typedarray is one of the typedarray objects. examples using the length property var buffer = new arraybuffer(8); var uint8 = new uint8array(buffer); uint8.length; // 8 (matches the length of the buffer) var uint8 = new uint8array(buffer, 1, 5); uint8.length; // 5 (as
specified when constructing the uint8array) var uint8 = new uint8array(buffer, 2); uint8.length; // 6 (due to the offset of the constructed uint8array) specifications specification ecmascript (ecma-262)the definition of 'typedarray.prototype.length' in that specification. ...
TypedArray.prototype.set() - 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 typedarray.set(array[, offset]) typedarray.set(typedarray[, offset]) parameters array the array from which to copy values. all values from the source array are copied into the target array, unless the length of the source array plus the offset exceeds the length of the target array, in which case an exception is thrown. ...
TypedArray.prototype.toString() - JavaScript
this method has the same algorithm as array.prototype.tostring(). 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.tostring() return value a string representing the elements of the typed array. examples the typedarray objects override the tostring method of object. for typedarray objects, the tostring method joins the array and returns one string containing each typed array element separated by commas. ...
Uint16Array() constructor - JavaScript
before being copied into the new array. the length of the new typed array will be same as the length of the typedarray argument. object when called with an object argument, a new typed array is created as if by the typedarray.from() method. buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the
specified arraybuffer. the byteoffset and length 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, u...
Uint32Array() constructor - JavaScript
before being copied into the new array. the length of the new typed array will be same as the length of the typedarray argument. object when called with an object argument, a new typed array is created as if by the typedarray.from() method. buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the
specified arraybuffer. the byteoffset and length 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. examples different ways to create a uint32array // from a length var uint32 = new uint32array(2); uint32[0] = 42; console.log(uint32[0]); // 42 console.log(uint32.le...
Uint8Array() constructor - JavaScript
before being copied into the new array. the length of the new typed array will be same as the length of the typedarray argument. object when called with an object argument, a new typed array is created as if by the typedarray.from() method. buffer, byteoffset, length when called with a buffer, and optionally a byteoffset and a length argument, a new typed array view is created that views the
specified arraybuffer. the byteoffset and length 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. examples different ways to create a uint8array // from a length var uint8 = new uint8array(2); uint8[0] = 42; console.log(uint8[0]); // 42 console.log(uint8.length);...
WeakMap.prototype.delete() - 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 wm.delete(key); parameters key the key of the element to remove from the weakmap object. return value true if an element in the weakmap object has been removed successfully. false if the key is not found in the weakmap or if the key is not an object. examples using the delete method var wm = new weakmap(); wm.set(window, 'foo'); wm.delete(window); // returns true. successfully removed. wm.has(window); // returns false. ...
WeakMap.prototype.has() - JavaScript
the has() method returns a boolean indicating whether an element with the
specified key exists in the weakmap object or not. the source for this interactive example is stored in a github repository. if you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. syntax wm.has(key); parameters key required. the key of the element to test for presence in the weakmap object. return value boolean returns true if an element with the
specified key exists in the weakmap object; otherwise false. examples using the has method var wm = new weakmap(); wm.set(window, 'foo'); wm.has(window); // returns true wm.has('baz'); // returns false specifications specification ecmascript (ecma...
WeakMap.prototype.set() - 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 wm.set(key, value); parameters key required. must be object. the key of the element to add to the weakmap object. value required. any value. the value of the element to add to the weakmap object. return value the weakmap object. ...
WeakSet.prototype.delete() - 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 ws.delete(value); parameters value required. the object remove from the weakset object. return value true if an element in the weakmap object has been removed successfully. false if the key is not found in the weakmap or if the key is not an object. examples using the delete method var ws = new weakset(); var obj = {}; ws.add(window); ws.delete(obj); // returns false. no obj found to be deleted. ws.delete(window); // returns true. ...
WeakSet.prototype.has() - JavaScript
not. 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 ws.has(value); parameters value required. the object to test for presence in the weakset. return value boolean returns true if an element with the
specified value exists in the weakset object; otherwise false. examples using the has method var ws = new weakset(); var obj = {}; ws.add(window); myset.has(window); // returns true myset.has(obj); // returns false specifications specification ecmascript (ecma-262)the definition of 'weakset.prototype.has' in that specification. ...
WebAssembly.CompileError - JavaScript
ileerror.prototype.columnnumber column number in line that raised this error. inherited from error. webassembly.compileerror.prototype.stack stack trace. inherited from error. instance methods webassembly.compileerror.prototype.tosource() returns code that could eval to the same error. inherited from error. webassembly.compileerror.prototype.tostring() returns a string representing the
specified error object.. inherited from error. examples creating a new compileerror instance the following snippet creates a new compileerror instance, and logs its details to the console: try { throw new webassembly.compileerror('hello', 'somefile', 10); } catch (e) { console.log(e instanceof compileerror); // true console.log(e.message); // "hello" console.log(e.name); ...
WebAssembly.Global() constructor - JavaScript
tionary object, which contains two properties: value: a usvstring representing the data type of the global. this can be one of i32, i64, f32, and f64. mutable: a boolean value that determines whether the global is mutable or not. by default, this is false. value the value the variable contains. this can be any value, as long as its type matches the variable's data type. if no value is
specified, a typed 0 value is used, as
specified by the defaultvalue algorithm. examples creating a new global instance the following example shows a new global instance being created using the webassembly.global() constructor. it is being defined as a mutable i32 type, with a value of 0. the value of the global is then changed, first to 42 using the global.value property, and then to 43 using th...
WebAssembly.LinkError - JavaScript
ssembly.linkerror.prototype.columnnumber column number in line that raised this error. inherited from error. webassembly.linkerror.prototype.stack stack trace. inherited from error. instance methods webassembly.linkerror.prototype.tosource() returns code that could eval to the same error. inherited from error. webassembly.linkerror.prototype.tostring() returns a string representing the
specified error object.. inherited from error. examples creating a new linkerror instance the following snippet creates a new linkerror instance, and logs its details to the console: try { throw new webassembly.linkerror('hello', 'somefile', 10); } catch (e) { console.log(e instanceof linkerror); // true console.log(e.message); // "hello" console.log(e.name); ...
WebAssembly.Memory() constructor - JavaScript
ly memories don't need to set 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. ...
WebAssembly.Memory.prototype.grow() - JavaScript
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. 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). ...
WebAssembly.Memory - JavaScript
mory created by javascript or in webassembly code will be accessible and mutable from both javascript and webassembly. constructor webassembly.memory() creates a new memory object. instance properties memory.prototype.buffer an accessor property that returns the buffer contained 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.
Unsigned right shift assignment (>>>=) - 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. ...
yield - JavaScript
is normally the case when an exception is thrown). the end of the generator function is reached. in this case, execution of the generator ends and an iteratorresult is returned to the caller in which the value is undefined and done is true. a return statement is reached. in this case, execution of the generator ends and an iteratorresult is returned to the caller in which the value is the value
specified by the return statement and done is true. if an optional value is passed to the generator's next() method, that value becomes the value returned by the generator's current yield operation. between the generator's code path, its yield operators, and the ability to specify a new starting value by passing it to generator.prototype.next(), generators offer enormous power and control. unfortunate...
do...while - 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 do statement while (condition); statement a statement that is executed at least once and is re-executed each time the condition evaluates to true. to execute multiple statements within the loop, use a block statement ({ ... }) to group those statements. ...
function declaration - JavaScript
you can also define functions using the function constructor and a function expression. 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([param[, param,[..., param]]]) { [statements] } name the function name. param optional the name of an argument to be passed to the function. maximum number of arguments varies in different engines. statements optional the statements which comprise the body of the function. ...
if...else - JavaScript
if the condition is falsy, another statement can be executed. 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 if (condition) statement1 [else statement2] condition an expression that is considered to be either truthy or falsy. statement1 statement that is executed if condition is truthy. can be any statement, including further nested if statements. to execute multiple statements, use a block statement ({ ... }) to group those statements. ...
return - JavaScript
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 return [[expression]]; expression the expression whose value is to be returned. if omitted, undefined is returned instead. description when a return statement is used in a function body, the execution of the function is stopped. if
specified, a given value is returned to the function caller. for example, the following function returns the square of its argument, x, where x is a number. function square(x) { return x * x; } var demo = square(3); // demo will equal 9 if the value is omitted, undefined is returned instead. the following return statements all break the function execution: return; return true; return false; return ...
switch - JavaScript
ase valuen: //statements executed when the //result of expression matches valuen [break;] [default: //statements executed when none of //the values match the value of the expression [break;]] } expression an expression whose result is matched against each case clause. case valuen optional a case clause used to match against expression. if the expression matches the
specified valuen, the statements inside the case clause are executed until either the end of the switch statement or a break. default optional a default clause; if provided, this clause is executed if the value of expression doesn't match any of the case clauses. description a switch statement first evaluates its expression. it then looks for the first case clause whose expression evaluates to the sam...
try...catch - JavaScript
ructures, like this: try { myroutine(); // may throw three types of exceptions } catch (e) { if (e instanceof typeerror) { // statements to handle typeerror exceptions } else if (e instanceof rangeerror) { // statements to handle rangeerror exceptions } else if (e instanceof evalerror) { // statements to handle evalerror exceptions } else { // statements to handle any un
specified exceptions logmyerrors(e); // pass exception object to error handler } } a common use case for this is to only catch (and silence) a small subset of expected errors, and then re-throw the error in other cases: try { myroutine(); } catch (e) { if (e instanceof rangeerror) { // statements to handle this very common expected error } else { throw e; // re-throw the error uncha...
while - JavaScript
the condition is evaluated before executing the statement. 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 while (condition) statement condition an expression evaluated before each pass through the loop. if this condition evaluates to true, statement is executed. when condition evaluates to false, execution continues with the statement after the while loop. ...
with - JavaScript
to repeat a lengthy object reference without performance penalty. the scope chain change required by 'with' is not computationally expensive. use of 'with' will relieve the interpreter of parsing repeated object references. note, however, that in many cases this benefit can be achieved by using a temporary variable to store a reference to the desired object. contra: the with statement forces the
specified object to be searched first for all name lookups. therefore all identifiers that aren't members of the
specified object will be found more slowly in a 'with' block. where performance is important, 'with' should only be used to encompass code blocks that access members of the
specified object. ambiguity contra contra: the with statement makes it hard for a human reader or javascript compiler to ...
JavaScript typed arrays - JavaScript
to control the byte-order. it is big-endian by default and can be set to little-endian in the getter/setter methods. web apis using typed arrays these are some examples of apis that make use of typed arrays; there are others, and more are being added all the time. filereader.prototype.readasarraybuffer() the filereader.prototype.readasarraybuffer() method starts reading the contents of the
specified blob or file. xmlhttprequest.prototype.send() xmlhttprequest instances' send() method now supports typed arrays and arraybuffer objects as 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...
display - Web app manifests
type string mandatory no the display member is a string that determines the developers’ preferred display mode for the website. the display mode changes how much of browser ui is shown to the user and can range from browser (when the full browser window is shown) to fullscreen (when the app is full-screened). note: if the display member is not
specified, it defaults to browser. note: you can selectively apply css to your app based on the display mode, using the display-mode media feature. this can be used to provide a consistent user experience between launching a site from an url and launching it from a desktop icon. values the possible values are: display mode description fallback display mode fullscreen all of the availabl...
related_applications - Web app manifests
s://itunes.apple.com/app/example-app1/id123456789" } ] related application values application objects may contain the following values: 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 definition of 'related_applications' in that specification. working draft initial definition. web app manifest working group drafts ...
Web app manifests
browsers generally support manifests with other appropriate extensions like .json (content-type: application/json). note: if the manifest requires credentials to fetch - the crossorigin attribute must be set to use-credentials, even if the manif...
MathML attribute reference - MathML
ossible values are: none (default), solid and dashed. framespacing <mtable> specifies additional space added between the table and frame. unimplemented groupalign <maligngroup>, <mtable>, <mtd>, <mtr> height <mglyph>, <mpadded>, <mspace> specifies the desired height. see lengths for possible values. href all used to set a hyperlink to a
specified uri. id all sets up a unique identifier associated with the element. unimplemented indentalign <mo>, <mspace> unimplemented indentalignfirst <mo>, <mspace> unimplemented indentalignlast <mo>, <mspace> unimplemented indentshift <mo>, <mspace> unimplemented indentshiftfirst <mo>, <mspace> unimple...
<math> - MathML
ther, but you can have an arbitrary number of other child elements in it. attributes in addition to the following attributes, the <math> element accepts any attributes of the <mstyle> element. class, id, style provided for use with stylesheets. dir overall directionality of formulas. possible values are either ltr (left to right) or rtl (right to left). href used to set a hyperlink to a
specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. display this enumerated attribute specifies how the enclosed mathml markup should be rendered. it can have one of the following values: block, which means that this element will be displayed outside the current span of text, ...
<menclose> - MathML
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. notation a list of notations, separated by white space, to apply to the child elements. the symbols are each drawn as if the others are not present, and therefore may overlap. ...
<merror> - MathML
firefox this error message is rendered similar to the typical xml error message. note that this error is not thrown when your mathml markup is wrong or not well-formed xml. you will still get an xml parsing error (in case of the xhtml notation of mathml), which has nothing to do with <merror>. attributes class, id, style provided for use with stylesheets. href used to set a hyperlink to a
specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color and also the fraction line color. you can use #rgb, #rrggbb and html color names. examples <math> <merror> <mrow> <mtext> division by zero: </mtext> <mfrac> <mn> 1 </mn> <mn> 0 </mn> </mfrac> </mrow> </merror> </math> specifications sp...
<mfrac> - MathML
ribute is deprecated and will be removed in the future. use u+2044 (fraction slash) instead. class, id, style provided for use with stylesheets. denomalign the alignment of the denominator under the fraction. possible values are: left, center (default), and right. this attribute is deprecated and will be removed in the future. use css text-align instead. href used to set a hyperlink to a
specified uri. linethickness the thickness of the horizontal fraction line. this attributes accepts any length values. the values medium, thin, and thick are deprecated and will be removed in the future. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color and also the fraction line color. you can use #rgb, #rrggbb and html color names. numal...
<mglyph> - MathML
available. it may be used within token elements. attributes alt this attribute defines the alternative text describing the image. users will see this displayed if the image url is wrong, the image is not in one of the supported formats, or until the image is downloaded. class, id, style provided for use with stylesheets. height the height of the image. href used to set a hyperlink to a
specified uri. mathbackground the background 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. width the width of the image. examples <math> <mi><mglyph src="my-glyph.png" alt="my glyph"/></mi> </math> specifications specification status commen...
<mi> - MathML
e mathml <mi> element indicates that the content should be rendered as an identifier such as function names, variables or symbolic constants. you can also have arbitrary text in it to mark up terms. attributes class, id, style provided for use with stylesheets. dir the text direction. possible values are either ltr (left to right) or rtl (right to left). href used to set a hyperlink to a
specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. mathsize the size of the content. see length for possible values. deprecated values are: small, normal and big. these will be removed in the future. mathvariant this logical class of the identifier, which varies in typography.
<mlabeledtr> - MathML
right side (determined using the side attribute on the <mtable> element). child elements of <mlabeledtr> must be <mtd> elements. the first child is the label whereas all other children are representing row contents and are treated identically to children of <mtr> elements. attributes class, id, style provided for use with stylesheets. columnalign overrides the horizontal alignment of cells
specified by <mtable> for this row. possible values are: left, center and right. groupalign href used to set a hyperlink to a
specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. rowalign overrides the vertical alignment of cells
specified by <mtable> for this row. possible va...
<mmultiscripts> - MathML
one <mprescripts /> element is allowed, otherwise you will get an duplicatemprescripts error in the error console and "invalid-markup" in your rendering). in addition you are able to use <none/> as a placeholder for empty scripts (not for the base). see the examples section for a correct usage. attributes class, id, style provided for use with stylesheets. href used to set a hyperlink to a
specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. subscriptshift the minimum space by which to shift the subscript below the baseline of the expression, as a css length. this property is deprecated and will be removed in the future. superscriptshift the minimum space by w...
<mn> - MathML
h is normally a sequence of digits with a possible separator (a dot or a comma). however, it is also allowed to have arbitrary text in it which is actually a numeric quantity, for example "eleven". attributes class, id, style provided for use with stylesheets. dir the text direction. possible values are either ltr (left to right) or rtl (right to left). href used to set a hyperlink to a
specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. mathsize the size of the content. see length for possible values. deprecated values are: small, normal and big. these will be removed in the future. mathvariant this attribute specifies the logical class of the number which va...
<mo> - MathML
es. (it is the default value if the operator is the first argument in a <mrow> element with more than one argument.) infix, for separators. (it is the default value if the operator is not included in a <mrow> element.) postfix, closing fences. (it is the default value if the operator is the last argument in a <mrow> element with more than one argument.) href used to set a hyperlink to a
specified uri. largeop specifies whether the operator should be drawn larger than normal when displaystyle="true" is set. allowed values are either true or false. lspace the amount of space before the operator (see length for values and units). the constant thickmathspace (5/18em) is the default value. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor th...
<mover> - MathML
, which is drawn closer to the base expression. if false (default value) the over-script is a limit over the base expression. align the alignment of the over-script. possible values are: left, center, and right. this attribute is deprecated and will be removed in the future. use css text-align instead. class, id, style provided for use with stylesheets. href used to set a hyperlink to a
specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. examples sample rendering: rendering in your browser: x + y + z ⏞ <math> <mover accent="true"> <mrow> <mi> x </mi> <mo> + </mo> <mi> y </mi> <mo> + </mo> <mi> z </mi> </mrow> <mo...
<mpadded> - MathML
on and size of enclosed contents. attributes class, id, style provided for use with stylesheets. depth sets or increments the depth. possible values: any length or an increment/decrement (a length prefixed with "+" or "-") . height sets or increments the height. possible values: any length or an increment/decrement (a length prefixed with "+" or "-") . href used to set a hyperlink to a
specified uri. lspace sets or increments the horizontal position. possible values: any length or an increment/decrement (a length prefixed with "+" or "-") . mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. voffset sets or increments the vertical position. possible values: any length or an ...
<mroot> - MathML
mathbackground the 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. ...
<mrow> - MathML
ws for more intelligent line-breaking and indentation. it simplifies the interpretation of the expression by automated systems such as computer algebra systems and audio renderers. attributes class, id, style provided for use with stylesheets. dir overall directionality of formulas. possible values are either ltr (left to right) or rtl (right to left). href used to set a hyperlink to a
specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. examples <math> <mrow> <mn> 1 </mn> <mo> + </mo> <mn> 1 </mn> </mrow> <mrow> <mo> ( </mo> <mrow> <mi> x </mi> <mo> , </mo> <mi> y </mi> </mrow> <mo> ) </mo> </mrow> </ma...
<msqrt> - MathML
mathbackground the 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. ...
<mstyle> - MathML
wed. scriptlevel controls mostly the font-size. the higher the scriptlevel, the smaller the font size. this attribute accepts a non-negative integer, as well as a "+" or a "-" sign, which increments or decrements the current value. in addition, the scriptlevel attribute can never reduce the font size below scriptminsize in order to avoid unreadable small font sizes and depends on the multiplier
specified in scriptsizemultiplier. scriptminsize specifies a minimum font size allowed due to changes in scriptlevel. the default value is 8pt. scriptsizemultiplier specifies the multiplier to be used to adjust font size due to changes in scriptlevel. the default value is 0.71. the <mstyle> element accepts all attributes of all presentation elements with the following exceptions: height, depth or ...
<msub> - MathML
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. subscriptshift the minimum space by which to shift the subscript below the baseline of the expression, as a length value. ...
<msubsup> - MathML
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. ...
<msup> - MathML
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. superscriptshift the minimum space by which to shift the superscript up from the baseline of the expression, as a length value. ...
<mtd> - MathML
the mathml <mtd> element represents a cell in a table or a matrix. it may only appear in a <mtr> element. this element is similar to the <td> element of html. attributes class, id, style provided for use with stylesheets. columnalign specifies the horizontal alignment of this cell and overrides values
specified by <mtable> or <mtr>. possible values are: left, center and right. columnspan a non-negative integer value that indicates on how many columns does the cell extend. groupalign unimplemented href used to set a hyperlink to a
specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. rowalign specifies the vertical alignment of this cell and overrides values sp...
<mtext> - MathML
the mathml <mtext> element is used to render arbitrary text with no notational meaning, such as comments or annotations. to display text with notational meaning, use <mi> and <mo> instead. attributes class, id, style provided for use with stylesheets. dir the text direction. possible values are either ltr (left to right) or rtl (right to left). href used to set a hyperlink to a
specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. mathsize the size of the content. see length for possible values. deprecated values are: small, normal and big. these will be removed in the future. mathvariant this attribute specifies the logical class of the identifier, which varie...
<mtr> - MathML
the mathml <mtr> element represents a row in a table or a matrix. it may only appear in a <mtable> element. this element is similar to the <tr> element of html. attributes class, id, style provided for use with stylesheets. columnalign overrides the horizontal alignment of cells
specified by <mtable> for this row. possible values are: left, center and right. groupalign unimplemented href used to set a hyperlink to a
specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. rowalign overrides the vertical alignment of cells
specified by <mtable> for this row. possible values are: axis, baseline, bottom, center and top. specifications specification sta...
<munder> - MathML
nt, which is drawn closer to the base expression. if false (default value), the element is a limit under the base expression. align the alignment of the underscript. possible values are: left, center, and right. this attribute is deprecated and will be removed in the future. use css text-align instead. class, id, style provided for use with stylesheets. href used to set a hyperlink to a
specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. examples sample rendering: rendering in your browser: x + y + z ⏟ <math> <munder accentunder="true"> <mrow> <mi> x </mi> <mo> + </mo> <mi> y </mi> <mo> + </mo> <mi> z </mi> </mrow>...
<munderover> - MathML
loser to the base expression. if false (default value), the underscript is a limit under the base expression. align the alignment of both underscript and overscript. possible values are: left, center, and right. this attribute is deprecated and will be removed in the future. use css text-align instead. class, id, style provided for use with stylesheets. href used to set a hyperlink to a
specified uri. mathbackground the background color. you can use #rgb, #rrggbb and html color names. mathcolor the text color. you can use #rgb, #rrggbb and html color names. examples sample rendering: rendering in your browser: ∫ 0 ∞ <math displaystyle="true"> <munderover > <mo> ∫ <!--integral--> </mo> <mn> 0 </mn> <mi> ∞ <!--infinity--> </mi> </munder...
MathML element reference - MathML
yph> (displaying non-standard symbols) i <mi> (identifier) l <mlabeledtr> (labeled row in a table or a matrix) <mlongdiv> (long division notation) m <mmultiscripts> (prescripts and tensor indices) n <mn> (number) o <mo> (operator) <mover> (overscript) p <mpadded> (space around content) <mphantom> (invisible content with reserved space) r <mroot> (radical with
specified index) <mrow> (grouped sub-expressions) s <ms> (string literal) <mscarries> (annotations such as carries) <mscarry> (single carry, child element of <mscarries>) <msgroup> (grouped rows of <mstack> and <mlongdiv> elements) <msline> (horizontal lines inside <mstack> elements) <mspace> (space) <msqrt> (square root without an index) <msrow> (rows in <mstack> elements) <mstack> (stacked ...
Digital audio concepts - Web media technologies
e for the encoded data, while the second involves specifying a constant quality value to target while allowing the bit rate to vary. average bit rate the first method for controlling the quality of the output file is to specify the average bit rate (abr) to target when encoding the audio. the encoder will attempt to produce an encoded sound file that, when playing it back, uses, on average, the
specified number of bits for each second of audio. this controls quality from the perspective of the encoded audio size; the higher the bit rate, the higher the resulting audio quality will be. the quality of the audio will fluctuate over time as needed in order to meet the targeted bit rate. somewhat similar to abr is cbr (constant bit rate). where abr attempts to keep the bit rate on average at a given ...
Performance budgets - Web Performance
uct goals. when defining metrics, you should focus on user experience, which will dictate not only the bounce or conversion rate but how likely is that user to return. how do i implement a performance budget? during development, there are a few tools to run checks against new or modified assets: a module bundler (e.g. webpack), has performance features that will notify you when assets exceed
specified limits. bundlesize, allows you to define and run file size checks in your ci pipeline. file size checks are the first line of defense against regressions but translating size back into time metrics can be difficult since development environments could be missing 3rd party scripts, and optimizations commonly provided by a cdn. the first step is to define a development baseline for each branch ...
Using dns-prefetch - Web Performance
ng can help to reduce this latency, dns resolution can add significant latency to requests. for websites that open connections to many third parties, this latency can significantly reduce loading performance. dns-prefetch helps developers mask dns resolution latency. the html <link> element offers this functionality by way of a rel attribute value of dns-prefetch. ...
Add to Home screen - Progressive web apps (PWAs)
t can function when offline). manifest the web manifest is written in standard json format and should be placed somewhere inside your app directory (in the root is probably best) with the name somefilename.webmanifest (we've chosen manifest.webmanifest). it contains multiple fields that define certain information about the web app and how it should behave. note: the .webmanifest extension is
specified in the media type registration section of the specification, but generally browsers will support manifests with other appropriate extensions, e.g. .json. the fields needed for a2hs are as follows: background_color: specifies a background color to be used in some app contexts. the most relevant one to a2hs is the splash screen displayed when the app icon on the home screen is tapped and it fi...
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
now, onto the next javascript file. server.js the server part is written in node.js and needs to be hosted somewhere suitable, which is a subject for an entirely separate article. we will only provide a high-level overview here. the web-push module is used to set the vapid keys, and optionally generate them if they are not available yet. const webpush...
Structural overview of progressive web apps - Progressive web apps (PWAs)
lf.addeventlistener('install', function(e) { console.log('[service worker] install'); e.waituntil( caches.open(cachename).then(function(cache) { console.log('[service worker] caching all: app shell and content'); return cache.addall(contenttocache); }) ); }); with that done, we implement the service worker's fetch event handler; its job is to return the contents of the
specified file, either from the cache or by loading it over the network (caching it upon doing so): self.addeventlistener('fetch', function(e) { e.respondwith( caches.match(e.request).then(function(r) { console.log('[service worker] fetching resource: '+e.request.url); return r || fetch(e.request).then(function(response) { return caches.open(cachename).then(function(cache) { ...
SVG Conditional Processing Attributes - SVG: Scalable Vector Graphics
externalresourcesrequired requiredextensions requiredfeatures systemlanguage attributes externalresourcesrequired deprecated since svg 2 if set to true, it indicates that the browser must wait for all the external resources necessary to render that element to be loaded before processing the associated element. value: false|true; animatable: no requiredextensions list all the browser specific capabilities that must be supported by the borwser to be allowed to render the associated element. ...
SVG Core Attributes - SVG: Scalable Vector Graphics
id lang tabindex xml:base xml:lang xml:space attributes id defines a unique identifier (id) which must be unique in the whole document. its purpose is to identify the element when linking (using a fragment identifier), scripting, or styling (with css). value: any valid id string; animatable: no lang participates in defining the language of the element, the language that non-editable elements are written in or the language that editable elements should be written in. the tag contains one single entry value in the format defined in the tags for identifying languages (bcp47) ietf document. ...
SVG Event Attributes - SVG: Scalable Vector Graphics
for every event type that the browser supports, svg supports that as an event attribute, following the same requirements as for html event attributes. the global event attributes are available on all svg elements. ...
SVG Styling Attributes - SVG: Scalable Vector Graphics
class style attributes class assigns a class name or set of class names to an element. it functions identically to the class attribute in html. value: any valid id string; animatable: yes style it specifies style information for its element. ...
accumulate - SVG: Scalable Vector Graphics
e animatable no sum specifies that each repeat iteration after the first builds upon the last value of the previous iteration. 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. this attribute will be ignored if the animation function is
specified with only the to attribute. specifications specification status comment svg animations level 2the definition of 'accumulate' in that specification. editor's draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'accumulate' in that specification. recommendation initial definition ...
ascent - SVG: Scalable Vector Graphics
only one element is using this attribute: <font-face> font-face for <font-face>, ascent defines the maximum unaccented height of the font within the font coordinate system. ...
baseProfile - SVG: Scalable Vector Graphics
the baseprofile attribute describes the minimum svg language profile that the author believes is necessary to correctly render the content. the attribute does not specify any processing restrictions; it can be considered metadata. for example, the value of the attribute could be used by an authoring tool to warn the user when they are modifying the document beyond the scope of the
specified base profile. each svg profile should define the text that is appropriate for this attribute. only one element 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 specif...
baseline-shift - SVG: Scalable Vector Graphics
centage> | sub | super default value 0 animatable yes sub the dominant-baseline is shifted to the default position for subscripts. super the dominant-baseline is shifted to the default position for superscripts. <length-percentage> a length value raises (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 definition of 'alignment-baseline' in that specification. working draft removed the baseline value, as it is a re...
calcMode - SVG: Scalable Vector Graphics
ation between values is used to calculate the animation function. except for <animatemotion>, this is the default value. paced defines interpolation to produce an even pace of change across the animation. this is only supported for values that define a linear numeric range, and for which some notion of "distance" between points can be calculated (e.g. position, width, height, etc.). if paced is
specified, any keytimes or keysplines will be ignored. for <animatemotion>, this is the 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. the points of the spline are defined in the keytimes attribute, and the control points for each interval are defined in the keysplines attribute. specifications s...
cap-height - SVG: Scalable Vector Graphics
the cap-height attribute defines the height of uppercase glyphs of the font within the font coordinate system. note: it was
specified to share the syntax and semantics 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 definition of 'cap-height' in that specification. recommendation initial definition ...
color-profile - SVG: Scalable Vector Graphics
profile can be used as a css property. as a presentation attribute, it can be applied to any element but it only has an effect on the following element: <image> usage notes value auto | srgb | <name> | <iri> default value auto animatable yes auto all colors are presumed to be defined in the srgb color space unless a more precise embedded profile is
specified within content data. for images that do have a profile built into their data, that profile is used. for images that do not have a profile, the srgb profile is used. srgb the source profile is assumed to be srgb. this differs from auto in that it overrides an embedded profile inside an image. <name> a name corresponding to a defined color profile that is in the browser's color profile descript...
color-rendering - SVG: Scalable Vector Graphics
how to optimize its color interpolation and compositing operations. color-rendering takes precedence over color-interpolation-filters. for example, assume color-rendering: optimizespeed and color-interpolation-filters: linearrgb. in this case, the svg user agent should perform color operations in a way that optimizes performance, which might mean sacrificing the color interpolation precision as
specified by through the linearrgb value for color-interpolation-filters. note: as a presentation attribute, color-rendering can be used as a css property. as a presentation attribute, it can be applied to any element but it only has an effect on the following 29 elements: <a>, <animate>, <animatecolor>, <circle>, <clippath>, <defs>, <ellipse>, <foreignobject>, <g>, <glyph>, <image>, <line>, <lineargradi...
contentScriptType - SVG: Scalable Vector Graphics
for the given document fragment on the <svg> element. this attribute sets the default scripting language used to process the value strings in event attributes. this language must be used for all instances of script that do not specify their own scripting language. the value specifies a media type, per mime part two: media types [rfc2046]. usage notes value one of the content types
specified in the media types default value application/ecmascript animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'contentscripttype' in that specification. recommendation initial definition ...
contentStyleType - SVG: Scalable Vector Graphics
etype attribute specifies the style sheet language for the given document fragment on the <svg> element. this language is used for all instances of style that do not specify their own styling language, such as the style attribute that is available on many elements. the value specifies a media type, per mime part two: media types [rfc2046]. usage notes value one of the content types
specified in the media types default value text/css animatable no since css is the only widely deployed style sheet language for online styling and it's already defined as default value if contentstyletype is ommitted, the attribute is not well supported in user agents. if other style sheet languages become more popular they might not use the style attribute, instead it could...
descent - SVG: Scalable Vector Graphics
the descent attribute defines the maximum unaccented depth of the font. note: it was
specified to share the syntax and semantics of the obsolete descent 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 value of vert-origin-y animatable no specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'descent' in that specification. recommendation initial definition ...
direction - SVG: Scalable Vector Graphics
phs oriented perpendicular to the inline-base direction, which includes the usual case of horizontally-oriented latin or arabic text and the case of narrow-cell latin or arabic characters rotated 90 degrees clockwise relative to a top-to-bottom inline-base direction. in many cases, the bidirectional unicode algorithm produces the desired result automatically, so this attribute doesn't need to be
specified in those cases. for other cases, such as when using right-to-left languages, it may be sufficient to add the direction attribute to the outermost <svg> element, and allow that direction to inherit to all text elements: note: as a presentation attribute, direction can be used as a css property. see css direction for further information. as a presentation attribute, it can be applied to any eleme...
divisor - SVG: Scalable Vector Graphics
);"/> <image xlink:href="//developer.mozilla.org/files/6457/mdn_logo_only_color.png" width="200" height="200" style="filter:url(#convolvematrix2); transform:translatex(220px);"/> </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. if the
specified divisor is 0 then the default value will be used instead. specifications specification status comment filter effects module level 1the definition of 'divisor' in that specification. working draft no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'divisor' in that specification. recommendation initial definition ...
dur - SVG: Scalable Vector Graphics
d can be expressed with hours (h), minutes (m), seconds (s) or milliseconds (ms). itʼs possible to combine those time representations to create some complex durations like hh:mm:ss.iii or mm:ss.iii. media this value specifies the simple duration as the intrinsic media duration. this is only valid for elements that define media. (for animation elements the attribute will be ignored if media is
specified.) indefinite this value specifies the simple duration as indefinite. note: the interpolation will not work if the simple duration is indefinite (although this may still be useful for <set> elements). specifications specification status comment svg animations level 2the definition of 'dur' in that specification. editor's draft no change scalab...
enable-background - SVG: Scalable Vector Graphics
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 the background image is allowed to happen. those values act as a clipping rectangle on the background image canvas. negative values for <width> or <height> are forbidden. if one, two, or three values are
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 definition of 'enable-background' in that specification. recommendation initial def...
externalResourcesRequired - SVG: Scalable Vector Graphics
the externalresourcesrequired attribute specifies whether referenced resources that are not part of the current document are required for proper rendering of the given container or graphics element. this attribute applies to all types of resource references, including style sheets, color profiles and fonts
specified by a reference using a <font-face> element or a css @font-face specification. in particular, if an element sets externalresourcesrequired="true", then all style sheets must be available since any style sheet might affect the rendering of that element. the externalresourcesrequired attribute is not inheritable (from a sense of attribute value inheritance), but if set on a container element, its value will apply to all elements within the container. because setting externalresourcesr...
filterRes - SVG: Scalable Vector Graphics
e element which referenced the filter. only one element is using this attribute: <filter> usage notes value <number-optional-number> default value none 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 definition of 'filterres' in that specification. recommendation initial definition ...
font-size-adjust - SVG: Scalable Vector Graphics
10px times, but now adjusted to the same aspect ratio as the verdana. </text> </svg> usage notes default value none value none | <number> animatable yes none choose the size of the font based only on the font-size property. <number> choose the size of the font so that its lowercase letters (as determined 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). specifications specification status com...
from - SVG: Scalable Vector Graphics
the from attribute indicates the initial value of the attribute that will be modified during the animation. 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. four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> html, body, svg { height: 100%; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <rect x="10" y="10" height="100"> <animate attributename="width" fill="freeze" from="100" to="150" dur="3s"/> </rect> </svg> usage notes value see below default value none animatable no ...
g1 - SVG: Scalable Vector Graphics
the g1 attribute specifies a list of glyph names which identify a set of possible first glyphs in the kerning pair. all glyphs with the given glyph name are included in the set. the total set of possible first glyphs in the kerning pair is the union of glyphs
specified by the u1 and g1 attributes. two elements are using this attribute: <hkern> and <vkern> context notes value <name># default 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)th...
g2 - SVG: Scalable Vector Graphics
the g2 attribute specifies a list of glyph names which identify a set of possible second glyphs in the kerning pair. all glyphs with the given glyph name are included in the set. the total set of possible second glyphs in the kerning pair is the union of glyphs
specified by the u2 and g2 attributes. two elements are using this attribute: <hkern> and <vkern> context notes value <name># default 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 editio...
glyph-orientation-horizontal - SVG: Scalable Vector Graphics
ed as a css property. as a presentation attribute, it can be applied to any element but it has effect only on the following five elements: <altglyph>, <textpath>, <text>, <tref>, and <tspan> context notes value <angle> default value 0deg animatable no <angle> the value of the angle is restricted to 0, 90, 180, and 270 degrees. if another angle is
specified, it is rounded to the closest of the permitted values. a value of 0deg indicates that all glyphs are set with the top of the glyphs oriented towards the reference orientation. a value of 90deg indicates an orientation of 90 degrees clockwise from the reference orientation. specifications specification status comment scalable vector graphics (svg) 1.1 (second edi...
glyph-orientation-vertical - SVG: Scalable Vector Graphics
e auto-ligature formation or similar context-driven variations.) the determination of which characters should be auto-rotated may vary across user agents. the determination is based on a complex interaction between country, language, script, character properties, font, and character context. <angle> the value of the angle is restricted to 0, 90, 180, and 270 degrees. if another angle is
specified, it is rounded to the closest of the permitted values. a value of 0deg indicates that all glyphs are set with the top of the glyphs oriented towards the reference orientation. a value of 90deg indicates an orientation of 90 degrees clockwise from the reference orientation. specifications specification status comment scalable vector graphics (svg) 1.1 (second edi...
keyTimes - SVG: Scalable Vector Graphics
the keytimes attribute represents a list of time values used to control the pacing of the animation. each time in the list corresponds to a value in the values attribute list, and defines when the value is used in the animation. each time value in the keytimes list is
specified as a floating point value between 0 and 1 (inclusive), representing a proportional offset into the duration of the animation element. four elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, and <animatetransform> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <circle cx="60" cy="10" r="10"> <animate attributename="cx" dur="4s" repeatcount="indefinite" values="60 ; 110 ; 60 ; 10 ; 60" keytimes="0 ; 0.25 ; 0.5 ; 0.75 ; 1"/> ...
lang - SVG: Scalable Vector Graphics
lang attribute specifies the primary language used in contents and attributes containing text content of particular elements. there is also an xml:lang attribute (with namespace). if both of them are defined, the one with namespace is used and the one without is ignored. in svg 1.1 there was a lang attribute defined with a different meaning and only applying to <glyph> elements. that attribute
specified a list of languages in bcp 47 format. the glyph was meant to be used if the xml:lang attribute exactly matched one of the languages given in the value of this parameter, or if the xml:lang attribute exactly equaled a prefix of one of the languages given in the value of this parameter such that the first tag character following the prefix was "-". all elements are using this attribute. <svg vie...
local - SVG: Scalable Vector Graphics
the local attribute specifies the unique id for a locally stored color profile as
specified by international color consortium. if both the xlink:href and the local attribute are
specified, then the local file system is searched for the color profile first, and, if not available locally, then the resource identified by the xlink:href attribute is used. only one element is using 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 definition of 'local' in tha...
markerHeight - SVG: Scalable Vector Graphics
fitted when it is rendered according to the viewbox and preserveaspectratio attributes. only one element is using this attribute: <marker> usage notes value <length-percentage> | <number> default value 3 animatable yes <length-percentage> this value defines either an absolute or a relative height of the marker. relative 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. a value of zero disables rendering of the element and negative values are an error. specifications specification status comment scalable vector graphics (svg) 2the definition of 'markerheight' in that specific...
markerWidth - SVG: Scalable Vector Graphics
be fitted when it is rendered according to the viewbox and preserveaspectratio attributes. only one element is using this attribute: <marker> usage notes value <length-percentage> | <number> default value 3 animatable yes <length-percentage> this value defines either an absolute or a relative width of the marker. relative 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. a value of zero disables rendering of the element and negative values are an error. specifications specification status comment scalable vector graphics (svg) 2the definition of 'markerwidth' in that specificat...
media - SVG: Scalable Vector Graphics
x)"> rect { fill: seagreen; } </style> <text y="15">resize the window to see the effect</text> <rect y="20" width="200" height="200" /> </svg> usage notes 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. specifications specification status comment scalable vector graphics (svg) 2the definition of 'media' in that specification. candidate recommendation changed the value definition from different media types as defined in css 2 to <media-query-list>. scalable vector graphics (svg) 1.1 (second edition)the de...
name - SVG: Scalable Vector Graphics
b" (case-insensitively) will be ignored. font-face-name for <font-face-name>, name defines the name of the font face. value <name> default value none animatable yes <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. specifications specification status comment scalable vector graphics (svg) 1.1 (second edition)the definition of 'name for <font-face-name>' in that specification. recommendation initial definition for <font-face-name> scalable vector graphics (svg) 1.1 (second edition)the definition of '...
overflow - SVG: Scalable Vector Graphics
o fit in its block formatting context. it has the same parameter values and meaning as the css overflow property, however, the following additional points apply: if it has a value of visible, the attribute has no effect (i.e., a clipping rectangle is not created). if the overflow property has the value hidden or scroll, 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 shee...
paint-order - SVG: Scalable Vector Graphics
ue normal animatable yes normal this value indicates that the fill will be painted first, then the stroke, and finally the markers. [ fill || stroke || markers ] the order of these three keywords indicates the order in which the painting happens, from left to right. if any of the three painting components is omitted, they will be painted in their default order after the
specified components. for example, using stroke is equivalent to stroke fill markers. example <svg xmlns="http://www.w3.org/2000/svg" width="400" height="200"> <lineargradient id="g" x1="0" y1="0" x2="0" y2="1"> <stop stop-color="#888"/> <stop stop-color="#ccc" offset="1"/> </lineargradient> <rect width="400" height="200" fill="url(#g)"/> <g fill="crimson" stroke="white" stroke-width="6"...
path - SVG: Scalable Vector Graphics
commands that can be used, see the explanation for the d attribute. textpath for <textpath>, path defines the path onto which the glyphs of a <text> element will be rendered. an empty string indicates that there is no path data for the element. this means that the text within the <textpath> element does not render or contribute to the bounding box of the <text> element. if the attribute is not
specified, the path
specified in href is used instead. value <path-data> 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. specifications spec...
patternContentUnits - SVG: Scalable Vector Graphics
only one element is using this attribute: <pattern> html,body,svg { height:100% } <svg viewbox="0 0 200 100" xmlns="http://www.w3.org/2000/svg"> <!-- a pattern tile that content coordinates and values are computed against the current coordinate user space. ...
rotate - SVG: Scalable Vector Graphics
usage notes value auto | auto-reverse | <number> default value 0 animatable no the auto and auto-reverse values allow the animated element's rotation to change dynamically as it travels along the path. if the value of rotate is auto, the element turns to align its right-hand side in the current direction of motion. if the value is auto-reverse, it turns its left-hand side in the current direction of motion. ...
rx - SVG: Scalable Vector Graphics
animatable yes note: starting with svg2, rx is a geometry property meaning this attribute can also be used as a css property for ellipses. rect for <rect>, rx defines the x-axis radius of the ellipse used to round off the corners of the rectangle. the way the value of the rx attribute is interpreted depend on both the ry attribute and the width of the rectangle: if a properly
specified value is provided for rx but not for ry (or the opposite), then the browser will consider the missing value equal to the defined one. if neither rx nor ry has a properly
specified value, then the browser will draw a rectangle with square corners. if rx is greater than half of the width of the rectangle, then the browser will consider the value for rx as half of the width of the rectangle. ...
ry - SVG: Scalable Vector Graphics
animatable yes note: starting with svg2, ry is a geometry property meaning this attribute can also be used as a css property for ellipses. rect for <rect>, ry defines the y-axis radius of the ellipse used to round off the corners of the rectangle. the way the value of the ry attribute is interpreted depend on both the rx attribute and the width of the rectangle: if a properly
specified value is provided for ry but not for rx (or the opposite), then the browser will consider the missing value equal to the defined one. if neither ry nor rx has a properly
specified value, then the browser will draw a rectangle with square corners. if ry is greater than half of the width of the rectangle, then the browser will consider the value for ry as half of the width of the rectangle. ...
spacing - SVG: Scalable Vector Graphics
e auto | exact default value exact animatable yes auto this value indicates that the user agent should use text-on-a-path layout algorithms to adjust the spacing between typographic characters in order to achieve visually appealing results. exact this value indicates that the typographic characters should be rendered exactly according to the spacing rules as
specified by the layout rules for text-on-a-path. specifications specification status comment scalable vector graphics (svg) 2the definition of 'spacing' in that specification. candidate recommendation no change scalable vector graphics (svg) 1.1 (second edition)the definition of 'spacing' in that specification. recommendation initial definition ...
stop-color - SVG: Scalable Vector Graphics
note: as a presentation attribute, stop-color can be used as a css property. as a presentation attribute, it can be applied to any element but it has effect only on the following element: <stop> usage notes value currentcolor | <color> <icccolor> default value black animatable 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. specifications specification status comment scalable vector graphics (svg) 2the definition of 'stop-color' in that specification. candidate recommendation added a note tha...
stroke-miterlimit - SVG: Scalable Vector Graphics
the stroke-miterlimit ratio is used to define when the limit is exceeded, if so the join is converted from a miter to a bevel. the ratio of miter length (distance between the outer tip and the inner corner of the miter) to stroke-width is directly related to the angle (theta) betwe...
transform-origin - SVG: Scalable Vector Graphics
roperty for more information. usage notes values [ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | 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 v...
u1 - SVG: Scalable Vector Graphics
.e., there are multiple <glyph> elements with the same unicode attribute value but different glyph-name values), then all such glyphs are included in the set. comma is the separator character; thus, to kern a comma, specify the comma as part of a range of unicode characters or as a glyph name using the g1 attribute. the total set of possible first glyphs in the kerning pair is the union of glyphs
specified by the u1 and g1 attributes. two elements are using this attribute: <hkern> and <vkern> context notes value [ <character> | <urange> ]# 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 glyph...
u2 - SVG: Scalable Vector Graphics
e., there are multiple <glyph> elements with the same unicode attribute value but different glyph-name values), then all such glyphs are included in the set. comma is the separator character; thus, to kern a comma, specify the comma as part of a range of unicode characters or as a glyph name using the g2 attribute. the total set of possible second glyphs in the kerning pair is the union of glyphs
specified by the u2 and g2 attributes. two elements are using this attribute: <hkern> and <vkern> context notes value [ <character> | <urange> ]# 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 glyp...
values - SVG: Scalable Vector Graphics
f color change to be performed. five elements are using this attribute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <fecolormatrix> animate, animatecolor, animatemotion, animatetransform for <animate>, <animatecolor>, <animatemotion>, and <animatetransform>, values is a list of values defining the sequence of values over the course of the animation. if this attribute is
specified, any from, to, and by attribute values set on the element are ignored. value <list-of-values> default value none animatable no <list-of-values> the value holds a semicolon-separated list of one or more values. the type of the values is defined by the href and attributename attributes. fecolormatrix for the <fecolormatrix> element, values is a list...
vector-effect - SVG: Scalable Vector Graphics
<polyline>, <rect>, <text>, <textpath> <tspan>, and <use> usage notes value none | non-scaling-stroke | non-scaling-size | non-rotation | fixed-position default value none animatable yes none this value specifies that no vector effect shall be applied, i.e. the default rendering behaviour is used which is to first fill the geometry of a shape with a
specified paint, then stroke the outline with a
specified paint. non-scaling-stroke this value modifies the way an object is stroked. normally stroking involves calculating stroke outline of the shapeʼs path in current user coordinate system and filling that outline with the stroke paint (color or gradient). the resulting visual effect of this value is that the stroke width is not dependant on the trans...
version - SVG: Scalable Vector Graphics
the version attribute is used to indicate what specification a svg document conforms to. it is only allowed on the root <svg> element. it is purely advisory and has no influence on rendering or processing. while it is
specified to accept any number, the only two valid choices are currently 1.0 and 1.1. <svg version="1.1" viewbox="0 0 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 definition of 'version' in that specification. recommendation initial definition ...
<feColorMatrix> - SVG: Scalable Vector Graphics
values are constant. r' = r1*r + r2*g + r3*b + r4*a + r5 g' = g1*r + g2*g + g3*b + g4*a + g5 b' = b1*r + b2*g + b3*b + b4*a + b5 a' = a1*r + a2*g + a3*b + a4*a + a5 take the amount of red in the new pixel, or r': it is the sum of r1 times the old pixel's red r, r2 times the old pixel's green g, r3 times of the old pixel's blue b, r4 times the old pixel's alpha a, plus a shift r5. these
specified amounts can be any real number, though the final r' will be clamped between 0 and 1. the same goes for g', b', and a'. r' = r1 * r + r2 * g + r3 * b + r4 * a + r5 new red = [ r1 * old red ] + [ r2 * old green ] + [ r3 * old blue ] + [ r4 * old alpha ] + [ shift of r5 ] if, say, we want to make a completely black image redder, we can make t...
<feGaussianBlur> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in stddeviation edgemode dom interface this element implements the svgfegaussianblurelement interface. ...
<feOffset> - SVG: Scalable Vector Graphics
usage context categoriesfilter primitive elementpermitted contentany number of the following elements, in any order:<animate>, <set> attributes global attributes core attributes presentation attributes filter primitive attributes class style specific attributes in dx dy dom interface this element implements the svgfeoffsetelement interface. ...
<hatch> - SVG: Scalable Vector Graphics
hatches defined by the <hatch> element can then referenced by the fill and stroke css properties on a given graphics element to indicate that the given element shall be filled or stroked with the hatch. paths are defined by <hatchpath> elements. ...
<pattern> - SVG: Scalable Vector Graphics
erence a template pattern that provides default values for the <pattern> attributes. value 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 definition 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|objec...
<rect> - SVG: Scalable Vector Graphics
s y the y coordinate of the rect. value type: <length>|<percentage> ; default value: 0; animatable: yes width the width of the rect. value type: auto|<length>|<percentage> ; default value: auto; animatable: yes height the height of the rect. value type: auto|<length>|<percentage> ; default value: auto; animatable: yes rx the horizontal corner radius of the rect. defaults to ry if it is
specified. value type: auto|<length>|<percentage> ; default value: auto; animatable: yes ry the vertical corner radius of the rect. defaults to rx if it is
specified. value type: auto|<length>|<percentage> ; default value: auto; animatable: yes pathlength the total length of the rectangle's perimeter, in user units. value type: <number> ; default value: none; animatable: yes note: starting with s...
<set> - SVG: Scalable Vector Graphics
the svg <set> element provides a simple means of just setting the value of an attribute for a
specified duration. it supports all attribute types, including those that cannot reasonably be interpolated, such as string and boolean values. for attributes that can be reasonably be interpolated, the <animate> is usualy prefered. note: the <set> element is non-additive. the additive and accumulate attributes are not allowed, and will be ignored if
specified. html,body,svg { height:100%; margin:0; padding:0; } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <style> rect { cursor: pointer } .round { rx: 5px; fill: green; } </style> <rect id="me" width="10" height="10"> <set attributename="class" to="round" begin="me.click" dur="2s" /> </rect> </svg> attributes...
<symbol> - SVG: Scalable Vector Graphics
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. specifications specification status comment scalable vector graphics (svg) 2the definition of '<symbol>' in that specification. candidate recommendation allowed geometry properties to be
specified on a symbol scalable vector graphics (svg) 1.1 (second edition)the definition of '<symbol>' in that specification. recommendation initial definition ...
<tref> - SVG: Scalable Vector Graphics
the textual content for a <text> svg element can be either character data directly embedded within the <text> element or the character data content of a referenced element, where the referencing is
specified with a <tref> element. usage context categoriestext content element, text content child elementpermitted contentany number of the following elements, in any order:descriptive elements<animate>, <animatecolor>, <set> attributes global attributes conditional processing attributes core attributes graphical event attributes presentation attributes xlink attributes class style externalresourcesrequired specific attributes xlink:href dom interface this element implements the svgtrefelement interface. example <svg width="100%" height="100%" viewbox="0 0 1000 300" xmlns=...
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
attribute deprecated in favor of child <title> implementation status unknown spaces 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 un
specified 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...
Scripting - SVG: Scalable Vector Graphics
suggested workaround is to use "top" instead of "parent". since it is a beta version of their plugin, we can probably safely ignore this. more information and some examples can be found on the svg wiki inter-document scripting page. setproperty has three parameters the function svgelement.style.setproperty("fill-opacity", "0.0") throws a domexception - syntax err in mozilla. this behaviour is
specified by the w3c in the dom level 2 style specification. the function setproperty is defined as a function with three parameters. the above can be replaced with 'svgelement.style.setproperty("fill-opacity", "0.0", "")', which is standards compliant. links svg wiki on scripting and programming ...
SVG fonts - SVG: Scalable Vector Graphics
since accessing the correct font file is however crucial for rendering text correctly, a font description technology was added to svg to provide this ability. it was not meant for compatibility with other formats like postscript or otf, but rather as a simple means of embedding glyph information into svg when rendered. svg fonts are currently supported only in safari and android browser. internet explorer hasn't considered implementing this, the functionality has been removed from chrome 38 (and opera 25) and firefox has postponed its implementation indefinitely to concentrate on woff. ...
Subresource Integrity - Web security
kpzqho1wx4jwy8wc" crossorigin="anonymous"></script> note: for more details on the purpose of the crossorigin attribute, see cors settings attributes. how browsers handle subresource integrity browsers handle sri by doing the following: when a browser encounters a <script> or <link> element with an integrity attribute, before executing the script or before applying any stylesheet
specified by the <link> element, the browser must first compare the script or stylesheet to the expected hash given in the integrity value. note: for subresource-integrity verification of a resource served from an origin other than the document in which it’s embedded, browsers additionally check the resource using cross-origin resource sharing (cors), to ensure the origin serving the resource allows it...
Transport Layer Security - Web security
reliability of data. this article provides an overview of tls and the kinds of decisions you need to make when securing your content. history when https was introduced, it was based on secure sockets layer (ssl) 2.0, a technology introduced by netscape. it was updated to ssl 3.0 not long after, and as its usage expanded, it became clear that a common, standard encryption technology needed to be
specified to ensure interoperability among all web browsers and servers. the internet engineering task force (ietf)
specified tls 1.0 in rfc 2246 in january, 1999. the current version of tls is 1.3 (rfc 8446). despite the fact that the web now uses tls for encryption, many people still refer to it as "ssl" out of habit. although tls can be used on top of any low-level transport protocol, the original g...
Using custom elements - Web Components
o longer connected, use node.isconnected to make sure. disconnectedcallback: invoked each time the custom element is disconnected from the document's dom. adoptedcallback: invoked each time the custom element is moved to a new document. attributechangedcallback: invoked each time one of the custom element's attributes is added, removed, or changed. which attributes to notice change for is
specified in a static get observedattributes method let's look at an example of these in use. the code below is taken from the life-cycle-callbacks example (see it running live). this is a trivial example that simply generates a colored square of a fixed size on the page. the custom element looks like this: <custom-square l="100" c="red"></custom-square> the class constructor is really simple — here ...
xml:base - XML: Extensible Markup Language
xml:base is like the html <base> element, but can specify the base uri per element as well as the entire document. the base url of a element can be queried from a script using node.baseuri. the base uri of an element is: the base uri
specified by an xml:base attribute on the element, if one exists, otherwise the base uri of the element's parent element within the document entity or external entity, if one exists, otherwise the base uri of the document entity or external entity containing the element. support was removed from blink (chrome and opera) in 2015: chromium bug 341854 blink-dev mailing list post and from firefox 66 in bug 903372. use cases if you have an inline svg you use as icons that needs to work in a document with a html baseelement , you can reset the uri on your...
choose - XPath
note: this method should be used instead of if(), which has been deprecated. syntax choose( boolean , object1, object2 ) arguments boolean the boolean operation to use when determining which object to return. object1 the first object to consider returning. object2 the second object to consider returning. returns if the boolean parameter is true, the first object is returned; otherwise, the second object is returned. ...
document - XPath
is a node-set, and the second argument is present, each node in the node-set will be evaluated as a separate uri, and the returned node-set will be as if the document function has been called multiple times (each time with the same second argument just as given in the function call) and the resulting node-sets had been concatenated into a single node-set. other specific conditions exist with
specified behaviors. see the xslt 1.0 documentation for details. since the uri is relative to the xsl document, document("") would return the root node of the current document. this function is an xslt-specific addition to xpath. it is not a part of the core xpath function library. defined xslt 1.0 12.1 gecko support supported. ...
namespace-uri - XPath
the namespace uri of the first node in a given node-set. syntax namespace-uri( [node-set] ) arguments node-set (optional) the namespace uri of the first node in this node-set will be returned. if this argument is omitted, the current context node will be used. returns a string representing uri of the namespace in which the given node resides. notes if the given node does not have a
specified namespace, the returned string will be an empty string. for nodes other than element and attribute nodes, the returned string will always be an empty string. defined xpath 1.0 4.1 gecko support supported. ...
system-property - XPath
sion. the system-property function returns an object representing the value of the system property identified by the name. if there is no such system property, the empty string should be returned. returns an object representing the given system-property. notes xsl:version, a number giving the version of xslt implemented by the processor; for xslt processors implementing the version of xslt
specified by this document, this is the number 1.0 xsl:vendor, a string identifying the vendor of the xslt processor xsl:vendor-url, a string containing a url identifying the vendor of the xslt processor; typically this is the host page (home page) of the vendor's web site. defined xslt 1.0 12.4 gecko support supported. ...
Index - XPath
18 boolean xslt, xslt_reference the boolean function evaluates an expression and returns true or false. 19 ceiling xslt, xslt_reference the ceiling function evaluates a decimal number and returns the smallest integer greater than or equal to the decimal number. 20 choose function, xpath, xslt the choose function returns one of the
specified objects based on a boolean parameter. 21 concat xslt, xslt_reference the concat function concatenates two or more strings and returns the resulting string. 22 contains xslt, xslt_reference the contains function determines whether the first argument string contains the second argument string and returns boolean true or false. 23 count xs...
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
the count attribute and then counts that node plus all its preceding siblings (stopping when it reaches a match to the from attribute, if there is one) that also match the count attribute.if no match is found, the sequence will be an empty list. multiple numbers nodes as a composite sequence that reflects the hierarchic position of the node, e.g. 1.2.2.5. (the nested format can be
specified with the format attribute, e.g. a.1.1). the processor looks at all ancestors of the current node and the current node itself, stopping when it reaches a match for the from attribute, if there is one. for each node in this list that matches the count attribute, the processor counts how many preceding matching siblings it has, and adds one for the node itself. if no match is found, the sequence wil...
<xsl:param> - XSLT: Extensible Stylesheet Language Transformations
global . when used inside an <xsl:template> element, the parameter is local to that template. in this case it must be the first child element of the template. syntax <xsl:param name=name select=expression> template </xsl:param> required attributes name names the parameter. this must be a qname. optional attributes select uses an xpath expression to provide a default value if none is
specified. type instruction, can appear as a top-level element or within a template. defined xslt, section 11. gecko support supported. ...
An Overview - XSLT: Extensible Stylesheet Language Transformations
s specific pattern should be manipulated in this specific way and end up in this specific position in the result tree. the particulars of how this is to be accomplished are left up to the processor. because the order of execution of the stylesheet cannot be guaranteed, xslt does not support any functionality that produces side-effects. in this it is like lisp or scheme. locations on the tree are
specified using xpath, another w3c recommendation. transformations depend on the processor's being able to pinpoint individual nodes on the tree. to facilitate this, the w3c decided to use a separate language, xpath, which also has uses outside the xslt context. as its name implies, xpath defines a "path" the processor must take through the tree to arrive at the desired node. this path consists of xpath-s...
XSLT: Extensible Stylesheet Language Transformations
ing and sorting the content, including a wholesale reordering of it if so desired, and transforming the content into a different format. using the mozilla javascript interface to xsl transformations this document describes the javascript interface to the xslt processing engine in mozilla 1.2 and up. specifying parameters using processing instructions firefox allows stylesheet parameters to be
specified when using the <?xml-stylesheet?> processing instruction. this is done using the <?xslt-param?> pi described in this document. xslt & xpath tutorial the topxml xslt tutorial introduces you to the basics of xslt concepts, syntax, and programming. xslt tutorial this w3schools tutorial teaches the reader how to use xslt to transform xml documents into other formats, like xhtml. what is xslt? t...
Compiling a New C/C++ Module to WebAssembly - WebAssembly
repo. copy it into a sub-directory called html_template inside your previous new directory. now navigate into your new directory (again, in your emscripten compiler environment terminal window), and run the following command: emcc -o hello2.html hello2.c -o3 -s wasm=1 --shell-file html_template/shell_minimal.html the options we've passed are slightly different this time: we've
specified -o hello2.html, meaning that the compiler will still output the javascript glue code and .html. we've also
specified --shell-file html_template/shell_minimal.html — this provides the path to the html template you want to use to create the html you will run your example through. now let's run this example. the above command will have generated hello2.html, which will have much the sa...
Caching compiled WebAssembly modules - WebAssembly
ven importobject, and returns a promise resolving to the finished wasm instance. additionally, it handles creating a database to cache the compiled wasm modules in, attempts to store new modules in the database, and retrieves previously cached modules from the database, saving you from having to download them again. note: the entire site's wasm cache (not just the given url) is versioned by the
specified dbversion passed into the function. if the wasm module code is updated, or its url changes, you will need to update dbversion. any subsequent call to instantiatecachedurl() will then clear out the entire cache, allowing you to avoid using out-of-date modules. the function starts off by defining some necessary constants: function instantiatecachedurl(dbversion, url, importobject) { const dbna...
WebAssembly Concepts - WebAssembly
mbly code can be executed at near-native speed across different platforms by taking advantage of common hardware capabilities. be readable and debuggable — webassembly is a low-level assembly language, but it does have a human-readable text format (the specification for which is still being finalized) that allows code to be written, viewed, and debugged by hand. keep secure — webassembly is
specified to be run in a safe, sandboxed execution environment. like other web code, it will enforce the browser's same-origin and permissions policies. don't break the web — webassembly is designed so that it plays nicely with other web technologies and maintains backwards compatibility. note: webassembly will also have uses outside web and javascript environments (see non-web embeddings). how doe...
Understanding WebAssembly text format - WebAssembly
bset of the functions in a module, in any order, allowing duplicates. this is a list of the functions that are to be referenced by the table, in the order they are to be referenced. the (i32.const 0) value inside the elem section is an offset — this needs to be declared at the start of the section, and specifies at what index in the table function references start to be populated. here we’ve
specified 0, and a size of 2 (see above), so we can fill in two references at indexes 0 and 1. if we wanted to start writing our references at offset 1, we’d have to write (i32.const 1), and the table size would have to be 3. note: uninitialized elements are given a default throw-on-call value. in javascript, the equivalent calls to create such a table instance would look something like this: funct...